@oystehr/sdk 3.0.5 → 3.0.7
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 +24 -8
- 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 +255 -92
- 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 +1 -0
- package/dist/cjs/resources/classes/charge.d.ts +1 -0
- package/dist/cjs/resources/classes/conversation.d.ts +1 -0
- package/dist/cjs/resources/classes/developer.d.ts +1 -0
- package/dist/cjs/resources/classes/erx.d.ts +10 -1
- package/dist/cjs/resources/classes/fax.d.ts +31 -0
- package/dist/cjs/resources/classes/fhir.d.ts +1 -0
- package/dist/cjs/resources/classes/index.d.ts +2 -0
- package/dist/cjs/resources/classes/m2m.d.ts +1 -0
- 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 +1 -0
- package/dist/cjs/resources/classes/rcm.d.ts +2 -1
- package/dist/cjs/resources/classes/role.d.ts +1 -0
- package/dist/cjs/resources/classes/secret.d.ts +1 -0
- package/dist/cjs/resources/classes/telemed.d.ts +1 -0
- package/dist/cjs/resources/classes/transactionalSMS.d.ts +1 -0
- package/dist/cjs/resources/classes/user.d.ts +1 -0
- package/dist/cjs/resources/classes/version.d.ts +1 -0
- package/dist/cjs/resources/classes/z3.d.ts +1 -0
- package/dist/cjs/resources/classes/zambda.d.ts +1 -0
- package/dist/cjs/resources/classes/zambdaLogStream.d.ts +1 -0
- package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +0 -4
- package/dist/cjs/resources/types/ErxCancelOrderParams.d.ts +6 -0
- package/dist/cjs/resources/types/ErxCancelOrderResponse.d.ts +6 -0
- package/dist/cjs/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
- package/dist/cjs/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
- package/dist/cjs/resources/types/FaxSendParams.d.ts +18 -0
- package/dist/cjs/resources/types/FaxSendResponse.d.ts +10 -0
- package/dist/cjs/resources/types/index.d.ts +6 -0
- 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 +1 -0
- package/dist/esm/resources/classes/application.js +12 -8
- 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 +6 -2
- package/dist/esm/resources/classes/charge.js.map +1 -1
- package/dist/esm/resources/classes/conversation.d.ts +1 -0
- package/dist/esm/resources/classes/conversation.js +9 -5
- package/dist/esm/resources/classes/conversation.js.map +1 -1
- package/dist/esm/resources/classes/developer.d.ts +1 -0
- package/dist/esm/resources/classes/developer.js +10 -6
- package/dist/esm/resources/classes/developer.js.map +1 -1
- package/dist/esm/resources/classes/erx.d.ts +10 -1
- package/dist/esm/resources/classes/erx.js +20 -4
- package/dist/esm/resources/classes/erx.js.map +1 -1
- package/dist/esm/resources/classes/fax.d.ts +31 -0
- package/dist/esm/resources/classes/fax.js +45 -0
- package/dist/esm/resources/classes/fax.js.map +1 -0
- package/dist/esm/resources/classes/fhir.d.ts +1 -0
- package/dist/esm/resources/classes/fhir.js +4 -0
- package/dist/esm/resources/classes/fhir.js.map +1 -1
- package/dist/esm/resources/classes/index.d.ts +2 -0
- package/dist/esm/resources/classes/index.js +7 -0
- package/dist/esm/resources/classes/index.js.map +1 -1
- package/dist/esm/resources/classes/m2m.d.ts +1 -0
- package/dist/esm/resources/classes/m2m.js +11 -7
- 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 +5 -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 +8 -4
- package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
- package/dist/esm/resources/classes/project.d.ts +1 -0
- package/dist/esm/resources/classes/project.js +6 -2
- package/dist/esm/resources/classes/project.js.map +1 -1
- package/dist/esm/resources/classes/rcm.d.ts +2 -1
- package/dist/esm/resources/classes/rcm.js +8 -4
- package/dist/esm/resources/classes/rcm.js.map +1 -1
- package/dist/esm/resources/classes/role.d.ts +1 -0
- package/dist/esm/resources/classes/role.js +9 -5
- 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 +8 -4
- package/dist/esm/resources/classes/secret.js.map +1 -1
- package/dist/esm/resources/classes/telemed.d.ts +1 -0
- package/dist/esm/resources/classes/telemed.js +6 -2
- package/dist/esm/resources/classes/telemed.js.map +1 -1
- package/dist/esm/resources/classes/transactionalSMS.d.ts +1 -0
- package/dist/esm/resources/classes/transactionalSMS.js +5 -1
- package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
- package/dist/esm/resources/classes/user.d.ts +1 -0
- package/dist/esm/resources/classes/user.js +11 -7
- 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 +5 -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 +1 -0
- package/dist/esm/resources/classes/z3.js +10 -6
- 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 +1 -0
- package/dist/esm/resources/classes/zambda.js +12 -8
- package/dist/esm/resources/classes/zambda.js.map +1 -1
- package/dist/esm/resources/classes/zambdaLogStream.d.ts +1 -0
- package/dist/esm/resources/classes/zambdaLogStream.js +7 -3
- package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
- package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +0 -4
- package/dist/esm/resources/types/ErxCancelOrderParams.d.ts +6 -0
- package/dist/esm/resources/types/ErxCancelOrderResponse.d.ts +6 -0
- package/dist/esm/resources/types/ErxCancelPrescriptionParams.d.ts +6 -0
- package/dist/esm/resources/types/ErxCancelPrescriptionResponse.d.ts +6 -0
- package/dist/esm/resources/types/FaxSendParams.d.ts +18 -0
- package/dist/esm/resources/types/FaxSendResponse.d.ts +10 -0
- package/dist/esm/resources/types/index.d.ts +6 -0
- package/dist/esm/tests/setup/constants.d.ts +2 -6
- package/dist/esm/tests/setup/global.d.ts +1 -0
- package/package.json +4 -4
- 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 +15 -8
- package/src/resources/classes/charge.ts +5 -2
- package/src/resources/classes/conversation.ts +20 -5
- package/src/resources/classes/developer.ts +9 -6
- package/src/resources/classes/erx.ts +26 -4
- package/src/resources/classes/fax.ts +44 -0
- package/src/resources/classes/fhir.ts +3 -0
- package/src/resources/classes/index.ts +6 -0
- package/src/resources/classes/m2m.ts +10 -7
- package/src/resources/classes/messaging.ts +4 -1
- package/src/resources/classes/paymentMethod.ts +7 -4
- package/src/resources/classes/project.ts +5 -2
- package/src/resources/classes/rcm.ts +7 -4
- package/src/resources/classes/role.ts +8 -5
- package/src/resources/classes/secret.ts +7 -4
- package/src/resources/classes/telemed.ts +5 -2
- package/src/resources/classes/transactionalSMS.ts +4 -1
- package/src/resources/classes/user.ts +10 -7
- package/src/resources/classes/version.ts +4 -1
- package/src/resources/classes/z3-ext.ts +10 -4
- package/src/resources/classes/z3.ts +9 -6
- package/src/resources/classes/zambda-ext.ts +5 -1
- package/src/resources/classes/zambda.ts +11 -8
- package/src/resources/classes/zambdaLogStream.ts +10 -3
- package/src/resources/types/DeveloperInviteResponse.ts +0 -4
- package/src/resources/types/ErxCancelOrderParams.ts +8 -0
- package/src/resources/types/ErxCancelOrderResponse.ts +8 -0
- package/src/resources/types/ErxCancelPrescriptionParams.ts +8 -0
- package/src/resources/types/ErxCancelPrescriptionResponse.ts +8 -0
- package/src/resources/types/FaxSendParams.ts +20 -0
- package/src/resources/types/FaxSendResponse.ts +12 -0
- package/src/resources/types/index.ts +6 -0
- /package/dist/cjs/tests/{common.d.ts → integrational/common.d.ts} +0 -0
- /package/dist/esm/tests/{common.d.ts → integrational/common.d.ts} +0 -0
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
import {
|
|
4
4
|
ErxAllergySearchParams,
|
|
5
5
|
ErxAllergySearchResponse,
|
|
6
|
+
ErxCancelOrderParams,
|
|
7
|
+
ErxCancelOrderResponse,
|
|
8
|
+
ErxCancelPrescriptionParams,
|
|
9
|
+
ErxCancelPrescriptionResponse,
|
|
6
10
|
ErxMedicationSearchParams,
|
|
7
11
|
ErxMedicationSearchResponse,
|
|
8
12
|
ErxMedicationSearchV2Params,
|
|
@@ -18,17 +22,35 @@ export class Erx extends SDKResource {
|
|
|
18
22
|
constructor(config: OystehrConfig) {
|
|
19
23
|
super(config);
|
|
20
24
|
}
|
|
25
|
+
baseUrlThunk(): string {
|
|
26
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
27
|
+
}
|
|
21
28
|
/**
|
|
22
29
|
* Retrieve patient properties from FHIR service and sync them with eRx service
|
|
23
30
|
*/
|
|
24
31
|
syncPatient(params: ErxSyncPatientParams, request?: OystehrClientRequest): Promise<ErxSyncPatientResponse> {
|
|
25
|
-
return this.request('/erx/sync-patient/{patientId}', 'post')(params, request);
|
|
32
|
+
return this.request('/erx/sync-patient/{patientId}', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* Search for allergies
|
|
29
36
|
*/
|
|
30
37
|
allergySearch(params: ErxAllergySearchParams, request?: OystehrClientRequest): Promise<ErxAllergySearchResponse> {
|
|
31
|
-
return this.request('/erx/allergy/search', 'get')(params, request);
|
|
38
|
+
return this.request('/erx/allergy/search', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Cancel photon order
|
|
42
|
+
*/
|
|
43
|
+
cancelOrder(params: ErxCancelOrderParams, request?: OystehrClientRequest): Promise<ErxCancelOrderResponse> {
|
|
44
|
+
return this.request('/erx/cancel-order', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Cancel photon prescription
|
|
48
|
+
*/
|
|
49
|
+
cancelPrescription(
|
|
50
|
+
params: ErxCancelPrescriptionParams,
|
|
51
|
+
request?: OystehrClientRequest
|
|
52
|
+
): Promise<ErxCancelPrescriptionResponse> {
|
|
53
|
+
return this.request('/erx/cancel-prescription', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
32
54
|
}
|
|
33
55
|
/**
|
|
34
56
|
* Search for medications. Provide at least one of code or name filters
|
|
@@ -37,7 +59,7 @@ export class Erx extends SDKResource {
|
|
|
37
59
|
params: ErxMedicationSearchParams,
|
|
38
60
|
request?: OystehrClientRequest
|
|
39
61
|
): Promise<ErxMedicationSearchResponse> {
|
|
40
|
-
return this.request('/erx/medication/search', 'get')(params, request);
|
|
62
|
+
return this.request('/erx/medication/search', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
41
63
|
}
|
|
42
64
|
/**
|
|
43
65
|
* Search for medications. Provide at least one of code or name filters
|
|
@@ -46,6 +68,6 @@ export class Erx extends SDKResource {
|
|
|
46
68
|
params: ErxMedicationSearchV2Params,
|
|
47
69
|
request?: OystehrClientRequest
|
|
48
70
|
): Promise<ErxMedicationSearchV2Response> {
|
|
49
|
-
return this.request('/erx/v2/medication/search', 'get')(params, request);
|
|
71
|
+
return this.request('/erx/v2/medication/search', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
50
72
|
}
|
|
51
73
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// AUTOGENERATED -- DO NOT EDIT
|
|
2
|
+
|
|
3
|
+
import { FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..';
|
|
4
|
+
import { SDKResource } from '../../client/client';
|
|
5
|
+
import { OystehrConfig } from '../../config';
|
|
6
|
+
|
|
7
|
+
export class Fax extends SDKResource {
|
|
8
|
+
constructor(config: OystehrConfig) {
|
|
9
|
+
super(config);
|
|
10
|
+
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['faxApiUrl'] ?? 'https://fax-api.zapehr.com/v1';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure.
|
|
16
|
+
*
|
|
17
|
+
* Access Policy Requirements:
|
|
18
|
+
* Action: `Fax:Offboard`
|
|
19
|
+
* Access Policy Resource: `Fax:Number`
|
|
20
|
+
*/
|
|
21
|
+
offboard(request?: OystehrClientRequest): Promise<void> {
|
|
22
|
+
return this.request('/offboard', 'post', this.baseUrlThunk.bind(this))(request);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call.
|
|
26
|
+
*
|
|
27
|
+
* Access Policy Requirements:
|
|
28
|
+
* Action: `Fax:Onboard`
|
|
29
|
+
* Access Policy Resource: `Fax:Number`
|
|
30
|
+
*/
|
|
31
|
+
onboard(request?: OystehrClientRequest): Promise<void> {
|
|
32
|
+
return this.request('/onboard', 'post', this.baseUrlThunk.bind(this))(request);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance.
|
|
36
|
+
*
|
|
37
|
+
* Access Policy Requirements:
|
|
38
|
+
* Action: `Fax:Send`
|
|
39
|
+
* Access Policy Resource: `Fax:Fax`
|
|
40
|
+
*/
|
|
41
|
+
send(params: FaxSendParams, request?: OystehrClientRequest): Promise<FaxSendResponse> {
|
|
42
|
+
return this.request('/send', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -8,6 +8,9 @@ export class Fhir extends SDKResource {
|
|
|
8
8
|
constructor(config: OystehrConfig) {
|
|
9
9
|
super(config);
|
|
10
10
|
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['fhirApiUrl'] ?? 'https://fhir-api.zapehr.com';
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Performs a FHIR search and returns the results as a Bundle resource
|
|
13
16
|
* @param options FHIR resource type and FHIR search parameters
|
|
@@ -6,6 +6,7 @@ import { Charge } from './charge';
|
|
|
6
6
|
import { Conversation } from './conversation';
|
|
7
7
|
import { Developer } from './developer';
|
|
8
8
|
import { Erx } from './erx';
|
|
9
|
+
import { Fax } from './fax';
|
|
9
10
|
import { Fhir } from './fhir';
|
|
10
11
|
import { M2m } from './m2m';
|
|
11
12
|
import { Messaging } from './messaging';
|
|
@@ -43,9 +44,13 @@ export class Oystehr {
|
|
|
43
44
|
readonly z3: Z3;
|
|
44
45
|
readonly zambda: Zambda;
|
|
45
46
|
readonly zambdaLogStream: ZambdaLogStream;
|
|
47
|
+
readonly fax: Fax;
|
|
46
48
|
readonly fhir: Fhir;
|
|
47
49
|
constructor(config: OystehrConfig) {
|
|
48
50
|
this.config = config;
|
|
51
|
+
this.config.services ??= {};
|
|
52
|
+
this.config.services.projectApiUrl ??= config.projectApiUrl;
|
|
53
|
+
this.config.services.fhirApiUrl ??= config.fhirApiUrl;
|
|
49
54
|
this.application = new Application(config);
|
|
50
55
|
this.developer = new Developer(config);
|
|
51
56
|
this.m2m = new M2m(config);
|
|
@@ -65,6 +70,7 @@ export class Oystehr {
|
|
|
65
70
|
this.z3 = new Z3(config);
|
|
66
71
|
this.zambda = new Zambda(config);
|
|
67
72
|
this.zambdaLogStream = new ZambdaLogStream(config);
|
|
73
|
+
this.fax = new Fax(config);
|
|
68
74
|
this.fhir = new Fhir(config);
|
|
69
75
|
}
|
|
70
76
|
}
|
|
@@ -22,6 +22,9 @@ export class M2m extends SDKResource {
|
|
|
22
22
|
constructor(config: OystehrConfig) {
|
|
23
23
|
super(config);
|
|
24
24
|
}
|
|
25
|
+
baseUrlThunk(): string {
|
|
26
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
27
|
+
}
|
|
25
28
|
/**
|
|
26
29
|
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.
|
|
27
30
|
*
|
|
@@ -31,7 +34,7 @@ export class M2m extends SDKResource {
|
|
|
31
34
|
* Access Policy Resource: `IAM:M2MClient`
|
|
32
35
|
*/
|
|
33
36
|
list(request?: OystehrClientRequest): Promise<M2mListResponse> {
|
|
34
|
-
return this.request('/m2m', 'get')(request);
|
|
37
|
+
return this.request('/m2m', 'get', this.baseUrlThunk.bind(this))(request);
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -40,7 +43,7 @@ export class M2m extends SDKResource {
|
|
|
40
43
|
* Access Policy Resource: `IAM:M2MClient`
|
|
41
44
|
*/
|
|
42
45
|
create(params: M2mCreateParams, request?: OystehrClientRequest): Promise<M2mCreateResponse> {
|
|
43
|
-
return this.request('/m2m', 'post')(params, request);
|
|
46
|
+
return this.request('/m2m', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -49,7 +52,7 @@ export class M2m extends SDKResource {
|
|
|
49
52
|
* Access Policy Resource: `IAM:M2MClient`
|
|
50
53
|
*/
|
|
51
54
|
get(params: M2mGetParams, request?: OystehrClientRequest): Promise<M2mGetResponse> {
|
|
52
|
-
return this.request('/m2m/{id}', 'get')(params, request);
|
|
55
|
+
return this.request('/m2m/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
58
|
* Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -58,7 +61,7 @@ export class M2m extends SDKResource {
|
|
|
58
61
|
* Access Policy Resource: `IAM:M2MClient`
|
|
59
62
|
*/
|
|
60
63
|
update(params: M2mUpdateParams, request?: OystehrClientRequest): Promise<M2mUpdateResponse> {
|
|
61
|
-
return this.request('/m2m/{id}', 'patch')(params, request);
|
|
64
|
+
return this.request('/m2m/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
67
|
* Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -67,7 +70,7 @@ export class M2m extends SDKResource {
|
|
|
67
70
|
* Access Policy Resource: `IAM:M2MClient`
|
|
68
71
|
*/
|
|
69
72
|
delete(params: M2mDeleteParams, request?: OystehrClientRequest): Promise<void> {
|
|
70
|
-
return this.request('/m2m/{id}', 'delete')(params, request);
|
|
73
|
+
return this.request('/m2m/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
|
|
71
74
|
}
|
|
72
75
|
/**
|
|
73
76
|
* Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -76,7 +79,7 @@ export class M2m extends SDKResource {
|
|
|
76
79
|
* Access Policy Resource: `IAM:M2MClient`
|
|
77
80
|
*/
|
|
78
81
|
rotateSecret(params: M2mRotateSecretParams, request?: OystehrClientRequest): Promise<M2mRotateSecretResponse> {
|
|
79
|
-
return this.request('/m2m/{id}/rotate-secret', 'post')(params, request);
|
|
82
|
+
return this.request('/m2m/{id}/rotate-secret', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
80
83
|
}
|
|
81
84
|
/**
|
|
82
85
|
* Get M2M clients in the Project with pagination, sort, sort Order and filtering. [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/services/zambda).
|
|
@@ -85,6 +88,6 @@ export class M2m extends SDKResource {
|
|
|
85
88
|
* Access Policy Resource: `IAM:M2MClient`
|
|
86
89
|
*/
|
|
87
90
|
listV2(params: M2mListV2Params, request?: OystehrClientRequest): Promise<M2mListV2Response> {
|
|
88
|
-
return this.request('/m2m/v2/list', 'get')(params, request);
|
|
91
|
+
return this.request('/m2m/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
89
92
|
}
|
|
90
93
|
}
|
|
@@ -8,10 +8,13 @@ export class Messaging extends SDKResource {
|
|
|
8
8
|
constructor(config: OystehrConfig) {
|
|
9
9
|
super(config);
|
|
10
10
|
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Get an information about the Messaging services configuration. This information includes phone number, phone number type and also rate limits of each service.
|
|
13
16
|
*/
|
|
14
17
|
getMessagingConfig(request?: OystehrClientRequest): Promise<MessagingGetMessagingConfigResponse> {
|
|
15
|
-
return this.request('/messaging/config', 'get')(request);
|
|
18
|
+
return this.request('/messaging/config', 'get', this.baseUrlThunk.bind(this))(request);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -16,6 +16,9 @@ export class PaymentMethod extends SDKResource {
|
|
|
16
16
|
constructor(config: OystehrConfig) {
|
|
17
17
|
super(config);
|
|
18
18
|
}
|
|
19
|
+
baseUrlThunk(): string {
|
|
20
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
23
|
* Enter a new credit card or other payment method for the user.
|
|
21
24
|
*
|
|
@@ -32,7 +35,7 @@ export class PaymentMethod extends SDKResource {
|
|
|
32
35
|
* Access Policy Resource: `FHIR:Patient`
|
|
33
36
|
*/
|
|
34
37
|
setUp(params: PaymentMethodSetUpParams, request?: OystehrClientRequest): Promise<PaymentMethodSetUpResponse> {
|
|
35
|
-
return this.request('/payment/payment-method/setup', 'post')(params, request);
|
|
38
|
+
return this.request('/payment/payment-method/setup', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* Set a specified payment method for the user as default.
|
|
@@ -50,7 +53,7 @@ export class PaymentMethod extends SDKResource {
|
|
|
50
53
|
* Access Policy Resource: `FHIR:Patient`
|
|
51
54
|
*/
|
|
52
55
|
setDefault(params: PaymentMethodSetDefaultParams, request?: OystehrClientRequest): Promise<void> {
|
|
53
|
-
return this.request('/payment/payment-method/set-default', 'post')(params, request);
|
|
56
|
+
return this.request('/payment/payment-method/set-default', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Delete a specified payment method for the beneficiary.
|
|
@@ -68,7 +71,7 @@ export class PaymentMethod extends SDKResource {
|
|
|
68
71
|
* Access Policy Resource: `FHIR:Patient`
|
|
69
72
|
*/
|
|
70
73
|
delete(params: PaymentMethodDeleteParams, request?: OystehrClientRequest): Promise<void> {
|
|
71
|
-
return this.request('/payment/payment-method', 'delete')(params, request);
|
|
74
|
+
return this.request('/payment/payment-method', 'delete', this.baseUrlThunk.bind(this))(params, request);
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
77
|
* List all payment methods for the patient.
|
|
@@ -86,6 +89,6 @@ export class PaymentMethod extends SDKResource {
|
|
|
86
89
|
* Access Policy Resource: `FHIR:Patient`
|
|
87
90
|
*/
|
|
88
91
|
list(params: PaymentMethodListParams, request?: OystehrClientRequest): Promise<PaymentMethodListResponse> {
|
|
89
|
-
return this.request('/payment/payment-method/list', 'post')(params, request);
|
|
92
|
+
return this.request('/payment/payment-method/list', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -8,6 +8,9 @@ export class Project extends SDKResource {
|
|
|
8
8
|
constructor(config: OystehrConfig) {
|
|
9
9
|
super(config);
|
|
10
10
|
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Get the Project settings for a Project. Developers must specify a [project ID](https://docs.oystehr.com/core-documentation/authenticating-api-requests/#x-zapehr-project-id-header) in the header. A Project is the logically-isolated instance of Oystehr that segments your data from other Projects. [Projects](https://docs.oystehr.com/services/project/) are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/services/fhir/basics/), [Applications](https://docs.oystehr.com/services/app/applications/), [Users](https://docs.oystehr.com/services/app/users/), etc .
|
|
13
16
|
*
|
|
@@ -15,7 +18,7 @@ export class Project extends SDKResource {
|
|
|
15
18
|
* Access Policy Resource: `Project:Settings`
|
|
16
19
|
*/
|
|
17
20
|
get(request?: OystehrClientRequest): Promise<ProjectGetResponse> {
|
|
18
|
-
return this.request('/project', 'get')(request);
|
|
21
|
+
return this.request('/project', 'get', this.baseUrlThunk.bind(this))(request);
|
|
19
22
|
}
|
|
20
23
|
/**
|
|
21
24
|
* Update the Project settings for the Project that corresponds to the project-id in the request header. A [Project](https://docs.oystehr.com/services/project/) is the logically-isolated instance of Oystehr that segments your data from other Projects. Projects are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/services/fhir/basics/), [Applications](https://docs.oystehr.com/services/app/applications/), [Users](https://docs.oystehr.com/services/app/users/), etc .
|
|
@@ -24,6 +27,6 @@ export class Project extends SDKResource {
|
|
|
24
27
|
* Access Policy Resource: `Project:Settings`
|
|
25
28
|
*/
|
|
26
29
|
update(params: ProjectUpdateParams, request?: OystehrClientRequest): Promise<ProjectUpdateResponse> {
|
|
27
|
-
return this.request('/project', 'patch')(params, request);
|
|
30
|
+
return this.request('/project', 'patch', this.baseUrlThunk.bind(this))(params, request);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -16,20 +16,23 @@ export class Rcm extends SDKResource {
|
|
|
16
16
|
constructor(config: OystehrConfig) {
|
|
17
17
|
super(config);
|
|
18
18
|
}
|
|
19
|
+
baseUrlThunk(): string {
|
|
20
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
23
|
* Check [Insurance Eligibility](https://docs.oystehr.com/services/rcm/eligibility/).
|
|
21
24
|
*
|
|
22
25
|
* Access Policy Action: `RCM:CheckInsuranceEligibility`
|
|
23
26
|
* Access Policy Resource: `RCM:InsuranceEligibility`
|
|
24
27
|
*
|
|
25
|
-
*
|
|
28
|
+
* Access Policy Action: `FHIR:Create`
|
|
26
29
|
* Access Policy Resource: `FHIR:CoverageEligibilityResponse`
|
|
27
30
|
*/
|
|
28
31
|
eligibilityCheck(
|
|
29
32
|
params: RcmEligibilityCheckParams,
|
|
30
33
|
request?: OystehrClientRequest
|
|
31
34
|
): Promise<RcmEligibilityCheckResponse> {
|
|
32
|
-
return this.request('/rcm/eligibility-check', 'post')(params, request);
|
|
35
|
+
return this.request('/rcm/eligibility-check', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Check [Validate Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
|
|
@@ -44,7 +47,7 @@ export class Rcm extends SDKResource {
|
|
|
44
47
|
params: RcmValidateProfessionalClaimParams,
|
|
45
48
|
request?: OystehrClientRequest
|
|
46
49
|
): Promise<RcmValidateProfessionalClaimResponse> {
|
|
47
|
-
return this.request('/rcm/professional-claim/validate', 'post')(params, request);
|
|
50
|
+
return this.request('/rcm/professional-claim/validate', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
48
51
|
}
|
|
49
52
|
/**
|
|
50
53
|
* Check [Submit Professional Claim](https://docs.oystehr.com/services/rcm/professional-claim-submission/).
|
|
@@ -62,6 +65,6 @@ export class Rcm extends SDKResource {
|
|
|
62
65
|
params: RcmSubmitProfessionalClaimParams,
|
|
63
66
|
request?: OystehrClientRequest
|
|
64
67
|
): Promise<RcmSubmitProfessionalClaimResponse> {
|
|
65
|
-
return this.request('/rcm/professional-claim/submit', 'post')(params, request);
|
|
68
|
+
return this.request('/rcm/professional-claim/submit', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -18,6 +18,9 @@ export class Role extends SDKResource {
|
|
|
18
18
|
constructor(config: OystehrConfig) {
|
|
19
19
|
super(config);
|
|
20
20
|
}
|
|
21
|
+
baseUrlThunk(): string {
|
|
22
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
23
|
+
}
|
|
21
24
|
/**
|
|
22
25
|
* Get a list of all Roles. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
|
|
23
26
|
*
|
|
@@ -25,7 +28,7 @@ export class Role extends SDKResource {
|
|
|
25
28
|
* Access Policy Resource: `IAM:Role`
|
|
26
29
|
*/
|
|
27
30
|
list(request?: OystehrClientRequest): Promise<RoleListResponse> {
|
|
28
|
-
return this.request('/iam/role', 'get')(request);
|
|
31
|
+
return this.request('/iam/role', 'get', this.baseUrlThunk.bind(this))(request);
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
34
|
* Create a new Role. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
|
|
@@ -34,7 +37,7 @@ export class Role extends SDKResource {
|
|
|
34
37
|
* Access Policy Resource: `IAM:Role`
|
|
35
38
|
*/
|
|
36
39
|
create(params: RoleCreateParams, request?: OystehrClientRequest): Promise<RoleCreateResponse> {
|
|
37
|
-
return this.request('/iam/role', 'post')(params, request);
|
|
40
|
+
return this.request('/iam/role', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Get the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
|
|
@@ -43,7 +46,7 @@ export class Role extends SDKResource {
|
|
|
43
46
|
* Access Policy Resource: `IAM:Role`
|
|
44
47
|
*/
|
|
45
48
|
get(params: RoleGetParams, request?: OystehrClientRequest): Promise<RoleGetResponse> {
|
|
46
|
-
return this.request('/iam/role/{roleId}', 'get')(params, request);
|
|
49
|
+
return this.request('/iam/role/{roleId}', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
49
52
|
* Update the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
|
|
@@ -52,7 +55,7 @@ export class Role extends SDKResource {
|
|
|
52
55
|
* Access Policy Resource: `IAM:Role`
|
|
53
56
|
*/
|
|
54
57
|
update(params: RoleUpdateParams, request?: OystehrClientRequest): Promise<RoleUpdateResponse> {
|
|
55
|
-
return this.request('/iam/role/{roleId}', 'patch')(params, request);
|
|
58
|
+
return this.request('/iam/role/{roleId}', 'patch', this.baseUrlThunk.bind(this))(params, request);
|
|
56
59
|
}
|
|
57
60
|
/**
|
|
58
61
|
* Delete the Role with the provided ID. A [Role](https://docs.oystehr.com/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/services/iam/developers/), [Users](https://docs.oystehr.com/services/app/users/), and [M2M Clients](https://docs.oystehr.com/services/iam/m2m-clients/).
|
|
@@ -62,6 +65,6 @@ export class Role extends SDKResource {
|
|
|
62
65
|
* Will fail if any entities hold the Role or if Role is assigned as the default patient role for the project
|
|
63
66
|
*/
|
|
64
67
|
delete(params: RoleDeleteParams, request?: OystehrClientRequest): Promise<void> {
|
|
65
|
-
return this.request('/iam/role/{roleId}', 'delete')(params, request);
|
|
68
|
+
return this.request('/iam/role/{roleId}', 'delete', this.baseUrlThunk.bind(this))(params, request);
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -16,6 +16,9 @@ export class Secret extends SDKResource {
|
|
|
16
16
|
constructor(config: OystehrConfig) {
|
|
17
17
|
super(config);
|
|
18
18
|
}
|
|
19
|
+
baseUrlThunk(): string {
|
|
20
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
21
|
+
}
|
|
19
22
|
/**
|
|
20
23
|
* Get a list of all secrets in the Project.
|
|
21
24
|
*
|
|
@@ -23,7 +26,7 @@ export class Secret extends SDKResource {
|
|
|
23
26
|
* Access Policy Resource: `Zambda:Secret`
|
|
24
27
|
*/
|
|
25
28
|
list(request?: OystehrClientRequest): Promise<SecretListResponse> {
|
|
26
|
-
return this.request('/secret', 'get')(request);
|
|
29
|
+
return this.request('/secret', 'get', this.baseUrlThunk.bind(this))(request);
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
29
32
|
* Create a secret for a project. If the secret is already defined, update it.
|
|
@@ -32,7 +35,7 @@ export class Secret extends SDKResource {
|
|
|
32
35
|
* Access Policy Resource: `Zambda:Secret`
|
|
33
36
|
*/
|
|
34
37
|
set(params: SecretSetParams, request?: OystehrClientRequest): Promise<SecretSetResponse> {
|
|
35
|
-
return this.request('/secret', 'post')(params, request);
|
|
38
|
+
return this.request('/secret', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
36
39
|
}
|
|
37
40
|
/**
|
|
38
41
|
* Get the secret with the provided name.
|
|
@@ -41,7 +44,7 @@ export class Secret extends SDKResource {
|
|
|
41
44
|
* Access Policy Resource: `Zambda:Secret`
|
|
42
45
|
*/
|
|
43
46
|
get(params: SecretGetParams, request?: OystehrClientRequest): Promise<SecretGetResponse> {
|
|
44
|
-
return this.request('/secret/{name}', 'get')(params, request);
|
|
47
|
+
return this.request('/secret/{name}', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
45
48
|
}
|
|
46
49
|
/**
|
|
47
50
|
* Delete the secret with the provided name.
|
|
@@ -50,6 +53,6 @@ export class Secret extends SDKResource {
|
|
|
50
53
|
* Access Policy Resource: `Zambda:Secret`
|
|
51
54
|
*/
|
|
52
55
|
delete(params: SecretDeleteParams, request?: OystehrClientRequest): Promise<void> {
|
|
53
|
-
return this.request('/secret/{name}', 'delete')(params, request);
|
|
56
|
+
return this.request('/secret/{name}', 'delete', this.baseUrlThunk.bind(this))(params, request);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
@@ -14,6 +14,9 @@ export class Telemed extends SDKResource {
|
|
|
14
14
|
constructor(config: OystehrConfig) {
|
|
15
15
|
super(config);
|
|
16
16
|
}
|
|
17
|
+
baseUrlThunk(): string {
|
|
18
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
19
|
+
}
|
|
17
20
|
/**
|
|
18
21
|
* Create a [telemedicine video meeting](https://docs.oystehr.com/services/telemed/).
|
|
19
22
|
*
|
|
@@ -29,7 +32,7 @@ export class Telemed extends SDKResource {
|
|
|
29
32
|
params: TelemedCreateMeetingParams,
|
|
30
33
|
request?: OystehrClientRequest
|
|
31
34
|
): Promise<TelemedCreateMeetingResponse> {
|
|
32
|
-
return this.request('/telemed/v2/meeting', 'post')(params, request);
|
|
35
|
+
return this.request('/telemed/v2/meeting', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Get Meeting and Attendee objects necessary to join a telemedicine video meeting.
|
|
@@ -42,6 +45,6 @@ export class Telemed extends SDKResource {
|
|
|
42
45
|
* Access Policy Resource: `Telemed:Meeting`
|
|
43
46
|
*/
|
|
44
47
|
joinMeeting(params: TelemedJoinMeetingParams, request?: OystehrClientRequest): Promise<TelemedJoinMeetingResponse> {
|
|
45
|
-
return this.request('/telemed/v2/meeting/{encounterId}/join', 'get')(params, request);
|
|
48
|
+
return this.request('/telemed/v2/meeting/{encounterId}/join', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
46
49
|
}
|
|
47
50
|
}
|
|
@@ -8,6 +8,9 @@ export class TransactionalSMS extends SDKResource {
|
|
|
8
8
|
constructor(config: OystehrConfig) {
|
|
9
9
|
super(config);
|
|
10
10
|
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
|
|
13
16
|
*
|
|
@@ -24,6 +27,6 @@ export class TransactionalSMS extends SDKResource {
|
|
|
24
27
|
* Access Policy Resource: `FHIR:Patient`
|
|
25
28
|
*/
|
|
26
29
|
send(params: TransactionalSMSSendParams, request?: OystehrClientRequest): Promise<TransactionalSMSSendResponse> {
|
|
27
|
-
return this.request('/messaging/transactional-sms/send', 'post')(params, request);
|
|
30
|
+
return this.request('/messaging/transactional-sms/send', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -21,13 +21,16 @@ export class User extends SDKResource {
|
|
|
21
21
|
constructor(config: OystehrConfig) {
|
|
22
22
|
super(config);
|
|
23
23
|
}
|
|
24
|
+
baseUrlThunk(): string {
|
|
25
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* Get your own User details. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
26
29
|
*
|
|
27
30
|
* Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
|
|
28
31
|
*/
|
|
29
32
|
me(request?: OystehrClientRequest): Promise<UserMeResponse> {
|
|
30
|
-
return this.request('/user/me', 'get')(request);
|
|
33
|
+
return this.request('/user/me', 'get', this.baseUrlThunk.bind(this))(request);
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
33
36
|
* Get the User with the provided ID. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
@@ -36,7 +39,7 @@ export class User extends SDKResource {
|
|
|
36
39
|
* Access Policy Resource: `App:User`
|
|
37
40
|
*/
|
|
38
41
|
get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {
|
|
39
|
-
return this.request('/user/{id}', 'get')(params, request);
|
|
42
|
+
return this.request('/user/{id}', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* Update the User with the provided ID. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
@@ -45,7 +48,7 @@ export class User extends SDKResource {
|
|
|
45
48
|
* Access Policy Resource: `App:User`
|
|
46
49
|
*/
|
|
47
50
|
update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {
|
|
48
|
-
return this.request('/user/{id}', 'patch')(params, request);
|
|
51
|
+
return this.request('/user/{id}', 'patch', this.baseUrlThunk.bind(this))(params, request);
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
51
54
|
* Delete the User with the provided ID. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
@@ -54,7 +57,7 @@ export class User extends SDKResource {
|
|
|
54
57
|
* Access Policy Resource: `App:User`
|
|
55
58
|
*/
|
|
56
59
|
delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {
|
|
57
|
-
return this.request('/user/{id}', 'delete')(params, request);
|
|
60
|
+
return this.request('/user/{id}', 'delete', this.baseUrlThunk.bind(this))(params, request);
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* Invite a User to the Project. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
@@ -63,7 +66,7 @@ export class User extends SDKResource {
|
|
|
63
66
|
* Access Policy Resource: `App:User`
|
|
64
67
|
*/
|
|
65
68
|
invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {
|
|
66
|
-
return this.request('/user/invite', 'post')(params, request);
|
|
69
|
+
return this.request('/user/invite', 'post', this.baseUrlThunk.bind(this))(params, request);
|
|
67
70
|
}
|
|
68
71
|
/**
|
|
69
72
|
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
|
|
@@ -74,7 +77,7 @@ export class User extends SDKResource {
|
|
|
74
77
|
* Access Policy Resource: `App:User`
|
|
75
78
|
*/
|
|
76
79
|
list(request?: OystehrClientRequest): Promise<UserListResponse> {
|
|
77
|
-
return this.request('/user', 'get')(request);
|
|
80
|
+
return this.request('/user', 'get', this.baseUrlThunk.bind(this))(request);
|
|
78
81
|
}
|
|
79
82
|
/**
|
|
80
83
|
* Get Users in the Project with pagination, sort, sort Order and filtering. [Users](https://docs.oystehr.com/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
@@ -83,6 +86,6 @@ export class User extends SDKResource {
|
|
|
83
86
|
* Access Policy Resource: `Project:Settings`
|
|
84
87
|
*/
|
|
85
88
|
listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response> {
|
|
86
|
-
return this.request('/user/v2/list', 'get')(params, request);
|
|
89
|
+
return this.request('/user/v2/list', 'get', this.baseUrlThunk.bind(this))(params, request);
|
|
87
90
|
}
|
|
88
91
|
}
|
|
@@ -8,10 +8,13 @@ export class Version extends SDKResource {
|
|
|
8
8
|
constructor(config: OystehrConfig) {
|
|
9
9
|
super(config);
|
|
10
10
|
}
|
|
11
|
+
baseUrlThunk(): string {
|
|
12
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Get project API version. This endpoint is public so there are no access policy requirements.
|
|
13
16
|
*/
|
|
14
17
|
get(request?: OystehrClientRequest): Promise<VersionGetResponse> {
|
|
15
|
-
return this.request('/version', 'get')(request);
|
|
18
|
+
return this.request('/version', 'get', this.baseUrlThunk.bind(this))(request);
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -2,6 +2,10 @@ import { defaultProjectApiUrl, SDKResource } from '../../client/client';
|
|
|
2
2
|
import { OystehrSdkError } from '../../errors';
|
|
3
3
|
import { Z3GetPresignedUrlParams, Z3GetPresignedUrlResponse } from '../types';
|
|
4
4
|
|
|
5
|
+
function baseUrlThunk(this: SDKResource): string {
|
|
6
|
+
return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
7
11
|
*
|
|
@@ -21,7 +25,8 @@ export async function uploadFile(
|
|
|
21
25
|
): Promise<void> {
|
|
22
26
|
const uploadUrl = await this.request(
|
|
23
27
|
'/z3/{bucketName}/{objectPath+}',
|
|
24
|
-
'post'
|
|
28
|
+
'post',
|
|
29
|
+
baseUrlThunk.bind(this)
|
|
25
30
|
)({
|
|
26
31
|
action: 'upload',
|
|
27
32
|
bucketName,
|
|
@@ -50,7 +55,8 @@ export async function downloadFile(
|
|
|
50
55
|
): Promise<ArrayBuffer> {
|
|
51
56
|
const uploadUrl = await this.request(
|
|
52
57
|
'/z3/{bucketName}/{objectPath+}',
|
|
53
|
-
'post'
|
|
58
|
+
'post',
|
|
59
|
+
baseUrlThunk.bind(this)
|
|
54
60
|
)({
|
|
55
61
|
action: 'download',
|
|
56
62
|
bucketName,
|
|
@@ -84,7 +90,7 @@ export async function getPresignedUrlForZ3Url(
|
|
|
84
90
|
const z3PathParts = url.pathname.split('/').slice(1);
|
|
85
91
|
bucket = url.hostname;
|
|
86
92
|
key = z3PathParts.join('/');
|
|
87
|
-
} else if (url.href.startsWith(this.config.projectApiUrl ?? defaultProjectApiUrl)) {
|
|
93
|
+
} else if (url.href.startsWith(this.config.services?.['projectApiUrl'] ?? defaultProjectApiUrl)) {
|
|
88
94
|
// remove leading `/v1/z3`
|
|
89
95
|
const httpsPathParts = url.pathname.split('/').slice(3);
|
|
90
96
|
bucket = httpsPathParts[0];
|
|
@@ -97,5 +103,5 @@ export async function getPresignedUrlForZ3Url(
|
|
|
97
103
|
bucketName: bucket,
|
|
98
104
|
'objectPath+': key,
|
|
99
105
|
};
|
|
100
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'post')(requestParams);
|
|
106
|
+
return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))(requestParams);
|
|
101
107
|
}
|