@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
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { SDKResource } from '../../client/client.js';
|
|
2
3
|
|
|
3
4
|
// AUTOGENERATED -- DO NOT EDIT
|
|
5
|
+
var _Telemed_instances, _Telemed_baseUrlThunk;
|
|
4
6
|
class Telemed extends SDKResource {
|
|
5
7
|
constructor(config) {
|
|
6
8
|
super(config);
|
|
9
|
+
_Telemed_instances.add(this);
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
|
-
* Create a [telemedicine video meeting](https://docs.oystehr.com/services/telemed/).
|
|
12
|
+
* Create a [telemedicine video meeting](https://docs.oystehr.com/oystehr/services/telemed/).
|
|
10
13
|
*
|
|
11
14
|
* Access Policy Requirements:
|
|
12
15
|
* Action: `Telemed:CreateMeeting`
|
|
@@ -17,7 +20,7 @@ class Telemed extends SDKResource {
|
|
|
17
20
|
* Access Policy Resource: `FHIR:Encounter`
|
|
18
21
|
*/
|
|
19
22
|
createMeeting(params, request) {
|
|
20
|
-
return this.request('/telemed/v2/meeting', 'post')(params, request);
|
|
23
|
+
return this.request('/telemed/v2/meeting', 'post', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* Get Meeting and Attendee objects necessary to join a telemedicine video meeting.
|
|
@@ -30,9 +33,13 @@ class Telemed extends SDKResource {
|
|
|
30
33
|
* Access Policy Resource: `Telemed:Meeting`
|
|
31
34
|
*/
|
|
32
35
|
joinMeeting(params, request) {
|
|
33
|
-
return this.request('/telemed/v2/meeting/{encounterId}/join', 'get')(params, request);
|
|
36
|
+
return this.request('/telemed/v2/meeting/{encounterId}/join', 'get', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
|
|
34
37
|
}
|
|
35
38
|
}
|
|
39
|
+
_Telemed_instances = new WeakSet(), _Telemed_baseUrlThunk = function _Telemed_baseUrlThunk() {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
42
|
+
};
|
|
36
43
|
|
|
37
44
|
export { Telemed };
|
|
38
45
|
//# sourceMappingURL=telemed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemed.js","sources":["../../../../src/resources/classes/telemed.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n TelemedCreateMeetingParams,\n TelemedCreateMeetingResponse,\n TelemedJoinMeetingParams,\n TelemedJoinMeetingResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Telemed extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n /**\n * Create a [telemedicine video meeting](https://docs.oystehr.com/services/telemed/).\n *\n * Access Policy Requirements:\n * Action: `Telemed:CreateMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n * Action: `FHIR:Create`\n * Access Policy Resource: `FHIR:Encounter`\n * Action: `FHIR:Update`\n * Access Policy Resource: `FHIR:Encounter`\n */\n createMeeting(\n params: TelemedCreateMeetingParams,\n request?: OystehrClientRequest\n ): Promise<TelemedCreateMeetingResponse> {\n return this.request('/telemed/v2/meeting', 'post')(params, request);\n }\n /**\n * Get Meeting and Attendee objects necessary to join a telemedicine video meeting.\n *\n * Access Policy Requirements:\n * Action: `Telemed:JoinMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n * To use M2M token to join as anonymous user:\n * Action: `Telemed:AddAnonymousToMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n */\n joinMeeting(params: TelemedJoinMeetingParams, request?: OystehrClientRequest): Promise<TelemedJoinMeetingResponse> {\n return this.request('/telemed/v2/meeting/{encounterId}/join'
|
|
1
|
+
{"version":3,"file":"telemed.js","sources":["../../../../src/resources/classes/telemed.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n TelemedCreateMeetingParams,\n TelemedCreateMeetingResponse,\n TelemedJoinMeetingParams,\n TelemedJoinMeetingResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Telemed extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Create a [telemedicine video meeting](https://docs.oystehr.com/oystehr/services/telemed/).\n *\n * Access Policy Requirements:\n * Action: `Telemed:CreateMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n * Action: `FHIR:Create`\n * Access Policy Resource: `FHIR:Encounter`\n * Action: `FHIR:Update`\n * Access Policy Resource: `FHIR:Encounter`\n */\n createMeeting(\n params: TelemedCreateMeetingParams,\n request?: OystehrClientRequest\n ): Promise<TelemedCreateMeetingResponse> {\n return this.request('/telemed/v2/meeting', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Get Meeting and Attendee objects necessary to join a telemedicine video meeting.\n *\n * Access Policy Requirements:\n * Action: `Telemed:JoinMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n * To use M2M token to join as anonymous user:\n * Action: `Telemed:AddAnonymousToMeeting`\n * Access Policy Resource: `Telemed:Meeting`\n */\n joinMeeting(params: TelemedJoinMeetingParams, request?: OystehrClientRequest): Promise<TelemedJoinMeetingResponse> {\n return this.request(\n '/telemed/v2/meeting/{encounterId}/join',\n 'get',\n this.#baseUrlThunk.bind(this)\n )(params, request);\n }\n}\n"],"names":[],"mappings":";;;AAAA;;AAYM,MAAO,OAAQ,SAAQ,WAAW,CAAA;AACtC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;;KACf;AAID;;;;;;;;;;AAUG;IACH,aAAa,CACX,MAAkC,EAClC,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,EAAE,sBAAA,CAAA,IAAI,EAAA,kBAAA,EAAA,GAAA,EAAA,qBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpG;AACD;;;;;;;;;AASG;IACH,WAAW,CAAC,MAAgC,EAAE,OAA8B,EAAA;QAC1E,OAAO,IAAI,CAAC,OAAO,CACjB,wCAAwC,EACxC,KAAK,EACL,sBAAA,CAAA,IAAI,EAAA,kBAAA,EAAA,GAAA,EAAA,qBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAC9B,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpB;AACF,CAAA;;;AApCG,IAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;AACxF,CAAC;;;;"}
|
|
@@ -2,9 +2,10 @@ import { OystehrClientRequest, TransactionalSMSSendParams, TransactionalSMSSendR
|
|
|
2
2
|
import { SDKResource } from '../../client/client';
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
export declare class TransactionalSMS extends SDKResource {
|
|
5
|
+
#private;
|
|
5
6
|
constructor(config: OystehrConfig);
|
|
6
7
|
/**
|
|
7
|
-
* 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.
|
|
8
|
+
* Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/oystehr/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/oystehr/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
|
|
8
9
|
*
|
|
9
10
|
* Access Policy Requirements:
|
|
10
11
|
* Action: `Messaging:SendTransactionalSMS`
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { SDKResource } from '../../client/client.js';
|
|
2
3
|
|
|
3
4
|
// AUTOGENERATED -- DO NOT EDIT
|
|
5
|
+
var _TransactionalSMS_instances, _TransactionalSMS_baseUrlThunk;
|
|
4
6
|
class TransactionalSMS extends SDKResource {
|
|
5
7
|
constructor(config) {
|
|
6
8
|
super(config);
|
|
9
|
+
_TransactionalSMS_instances.add(this);
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
|
-
* 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.
|
|
12
|
+
* Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/oystehr/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/oystehr/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.
|
|
10
13
|
*
|
|
11
14
|
* Access Policy Requirements:
|
|
12
15
|
* Action: `Messaging:SendTransactionalSMS`
|
|
@@ -21,9 +24,13 @@ class TransactionalSMS extends SDKResource {
|
|
|
21
24
|
* Access Policy Resource: `FHIR:Patient`
|
|
22
25
|
*/
|
|
23
26
|
send(params, request) {
|
|
24
|
-
return this.request('/messaging/transactional-sms/send', 'post')(params, request);
|
|
27
|
+
return this.request('/messaging/transactional-sms/send', 'post', __classPrivateFieldGet(this, _TransactionalSMS_instances, "m", _TransactionalSMS_baseUrlThunk).bind(this))(params, request);
|
|
25
28
|
}
|
|
26
29
|
}
|
|
30
|
+
_TransactionalSMS_instances = new WeakSet(), _TransactionalSMS_baseUrlThunk = function _TransactionalSMS_baseUrlThunk() {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
33
|
+
};
|
|
27
34
|
|
|
28
35
|
export { TransactionalSMS };
|
|
29
36
|
//# sourceMappingURL=transactionalSMS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionalSMS.js","sources":["../../../../src/resources/classes/transactionalSMS.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { OystehrClientRequest, TransactionalSMSSendParams, TransactionalSMSSendResponse } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class TransactionalSMS extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n /**\n * 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.\n *\n * Access Policy Requirements:\n * Action: `Messaging:SendTransactionalSMS`\n * Access Policy Resource: `Messaging:TransactionalSMS`\n * Action: `FHIR:Create`\n * Access Policy Resource: `FHIR:Communication`\n * Action: `FHIR:Update`\n * Access Policy Resource: `FHIR:Communication`\n *\n * You also need Read access for the resource to which you are sending a message. For example:\n * Action: `FHIR:Read`\n * Access Policy Resource: `FHIR:Patient`\n */\n send(params: TransactionalSMSSendParams, request?: OystehrClientRequest): Promise<TransactionalSMSSendResponse> {\n return this.request('/messaging/transactional-sms/send', 'post')(params, request);\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"transactionalSMS.js","sources":["../../../../src/resources/classes/transactionalSMS.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { OystehrClientRequest, TransactionalSMSSendParams, TransactionalSMSSendResponse } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class TransactionalSMS extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Send an SMS to any phone number. Oystehr's [Transactional SMS](https://docs.oystehr.com/oystehr/services/messaging/transactional-sms/) feature makes it easy to send a text message to your [Users](https://docs.oystehr.com/oystehr/services/app/users/) with a single API call. You can use this feature to send appointment reminders, prescription refill reminders, discharge information, and more.\n *\n * Access Policy Requirements:\n * Action: `Messaging:SendTransactionalSMS`\n * Access Policy Resource: `Messaging:TransactionalSMS`\n * Action: `FHIR:Create`\n * Access Policy Resource: `FHIR:Communication`\n * Action: `FHIR:Update`\n * Access Policy Resource: `FHIR:Communication`\n *\n * You also need Read access for the resource to which you are sending a message. For example:\n * Action: `FHIR:Read`\n * Access Policy Resource: `FHIR:Patient`\n */\n send(params: TransactionalSMSSendParams, request?: OystehrClientRequest): Promise<TransactionalSMSSendResponse> {\n return this.request('/messaging/transactional-sms/send', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":[],"mappings":";;;AAAA;;AAMM,MAAO,gBAAiB,SAAQ,WAAW,CAAA;AAC/C,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;;KACf;AAID;;;;;;;;;;;;;;AAcG;IACH,IAAI,CAAC,MAAkC,EAAE,OAA8B,EAAA;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,mCAAmC,EAAE,MAAM,EAAE,sBAAA,CAAA,IAAI,EAAA,2BAAA,EAAA,GAAA,EAAA,8BAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClH;AACF,CAAA;;;AApBG,IAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;AACxF,CAAC;;;;"}
|
|
@@ -2,36 +2,37 @@ import { OystehrClientRequest, UserDeleteParams, UserGetParams, UserGetResponse,
|
|
|
2
2
|
import { SDKResource } from '../../client/client';
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
export declare class User extends SDKResource {
|
|
5
|
+
#private;
|
|
5
6
|
constructor(config: OystehrConfig);
|
|
6
7
|
/**
|
|
7
|
-
* 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.
|
|
8
|
+
* Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
8
9
|
*
|
|
9
10
|
* Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
|
|
10
11
|
*/
|
|
11
12
|
me(request?: OystehrClientRequest): Promise<UserMeResponse>;
|
|
12
13
|
/**
|
|
13
|
-
* 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.
|
|
14
|
+
* Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
14
15
|
*
|
|
15
16
|
* Access Policy Action: `App:GetUser`
|
|
16
17
|
* Access Policy Resource: `App:User`
|
|
17
18
|
*/
|
|
18
19
|
get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse>;
|
|
19
20
|
/**
|
|
20
|
-
* 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.
|
|
21
|
+
* Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
21
22
|
*
|
|
22
23
|
* Access Policy Action: `App:UpdateUser`
|
|
23
24
|
* Access Policy Resource: `App:User`
|
|
24
25
|
*/
|
|
25
26
|
update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse>;
|
|
26
27
|
/**
|
|
27
|
-
* 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.
|
|
28
|
+
* Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
28
29
|
*
|
|
29
30
|
* Access Policy Action: `App:DeleteUser`
|
|
30
31
|
* Access Policy Resource: `App:User`
|
|
31
32
|
*/
|
|
32
33
|
delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void>;
|
|
33
34
|
/**
|
|
34
|
-
* 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.
|
|
35
|
+
* Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
35
36
|
*
|
|
36
37
|
* Access Policy Action: `App:CreateUser`
|
|
37
38
|
* Access Policy Resource: `App:User`
|
|
@@ -40,17 +41,24 @@ export declare class User extends SDKResource {
|
|
|
40
41
|
/**
|
|
41
42
|
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
|
|
42
43
|
*
|
|
43
|
-
* Get all Users in 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.
|
|
44
|
+
* Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
44
45
|
*
|
|
45
46
|
* Access Policy Action: `App:ListAllUsers`
|
|
46
47
|
* Access Policy Resource: `App:User`
|
|
47
48
|
*/
|
|
48
49
|
list(request?: OystehrClientRequest): Promise<UserListResponse>;
|
|
49
50
|
/**
|
|
50
|
-
* 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.
|
|
51
|
+
* Get Users in the Project with pagination, sort, sort Order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
51
52
|
*
|
|
52
53
|
* Access Policy Action: `Project:ListAllUsers`
|
|
53
54
|
* Access Policy Resource: `Project:Settings`
|
|
54
55
|
*/
|
|
55
56
|
listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
*
|
|
60
|
+
* Access Policy Action: `Project:ListAllUsers`
|
|
61
|
+
* Access Policy Resource: `Project:Settings`
|
|
62
|
+
*/
|
|
63
|
+
listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;
|
|
56
64
|
}
|
|
@@ -1,64 +1,67 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { SDKResource } from '../../client/client.js';
|
|
2
3
|
|
|
3
4
|
// AUTOGENERATED -- DO NOT EDIT
|
|
5
|
+
var _User_instances, _User_baseUrlThunk;
|
|
4
6
|
class User extends SDKResource {
|
|
5
7
|
constructor(config) {
|
|
6
8
|
super(config);
|
|
9
|
+
_User_instances.add(this);
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
|
-
* 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.
|
|
12
|
+
* Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
10
13
|
*
|
|
11
14
|
* Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
|
|
12
15
|
*/
|
|
13
16
|
me(request) {
|
|
14
|
-
return this.request('/user/me', 'get')(request);
|
|
17
|
+
return this.request('/user/me', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
|
-
* 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.
|
|
20
|
+
* Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
18
21
|
*
|
|
19
22
|
* Access Policy Action: `App:GetUser`
|
|
20
23
|
* Access Policy Resource: `App:User`
|
|
21
24
|
*/
|
|
22
25
|
get(params, request) {
|
|
23
|
-
return this.request('/user/{id}', 'get')(params, request);
|
|
26
|
+
return this.request('/user/{id}', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
24
27
|
}
|
|
25
28
|
/**
|
|
26
|
-
* 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.
|
|
29
|
+
* Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
27
30
|
*
|
|
28
31
|
* Access Policy Action: `App:UpdateUser`
|
|
29
32
|
* Access Policy Resource: `App:User`
|
|
30
33
|
*/
|
|
31
34
|
update(params, request) {
|
|
32
|
-
return this.request('/user/{id}', 'patch')(params, request);
|
|
35
|
+
return this.request('/user/{id}', 'patch', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
|
-
* 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.
|
|
38
|
+
* Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
36
39
|
*
|
|
37
40
|
* Access Policy Action: `App:DeleteUser`
|
|
38
41
|
* Access Policy Resource: `App:User`
|
|
39
42
|
*/
|
|
40
43
|
delete(params, request) {
|
|
41
|
-
return this.request('/user/{id}', 'delete')(params, request);
|
|
44
|
+
return this.request('/user/{id}', 'delete', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
|
-
* 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.
|
|
47
|
+
* Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
45
48
|
*
|
|
46
49
|
* Access Policy Action: `App:CreateUser`
|
|
47
50
|
* Access Policy Resource: `App:User`
|
|
48
51
|
*/
|
|
49
52
|
invite(params, request) {
|
|
50
|
-
return this.request('/user/invite', 'post')(params, request);
|
|
53
|
+
return this.request('/user/invite', 'post', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
51
54
|
}
|
|
52
55
|
/**
|
|
53
56
|
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
|
|
54
57
|
*
|
|
55
|
-
* Get all Users in 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.
|
|
58
|
+
* Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.
|
|
56
59
|
*
|
|
57
60
|
* Access Policy Action: `App:ListAllUsers`
|
|
58
61
|
* Access Policy Resource: `App:User`
|
|
59
62
|
*/
|
|
60
63
|
list(request) {
|
|
61
|
-
return this.request('/user', 'get')(request);
|
|
64
|
+
return this.request('/user', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
67
|
* 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.
|
|
@@ -67,9 +70,13 @@ class User extends SDKResource {
|
|
|
67
70
|
* Access Policy Resource: `Project:Settings`
|
|
68
71
|
*/
|
|
69
72
|
listV2(params, request) {
|
|
70
|
-
return this.request('/user/v2/list', 'get')(params, request);
|
|
73
|
+
return this.request('/user/v2/list', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
71
74
|
}
|
|
72
75
|
}
|
|
76
|
+
_User_instances = new WeakSet(), _User_baseUrlThunk = function _User_baseUrlThunk() {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
79
|
+
};
|
|
73
80
|
|
|
74
81
|
export { User };
|
|
75
82
|
//# sourceMappingURL=user.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n UserDeleteParams,\n UserGetParams,\n UserGetResponse,\n UserInviteParams,\n UserInviteResponse,\n UserListResponse,\n UserListV2Params,\n UserListV2Response,\n UserMeResponse,\n UserUpdateParams,\n UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n /**\n * 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.\n *\n * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n */\n me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n return this.request('/user/me', 'get')(request);\n }\n /**\n * 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.\n *\n * Access Policy Action: `App:GetUser`\n * Access Policy Resource: `App:User`\n */\n get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n return this.request('/user/{id}', 'get')(params, request);\n }\n /**\n * 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.\n *\n * Access Policy Action: `App:UpdateUser`\n * Access Policy Resource: `App:User`\n */\n update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n return this.request('/user/{id}', 'patch')(params, request);\n }\n /**\n * 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.\n *\n * Access Policy Action: `App:DeleteUser`\n * Access Policy Resource: `App:User`\n */\n delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}', 'delete')(params, request);\n }\n /**\n * 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.\n *\n * Access Policy Action: `App:CreateUser`\n * Access Policy Resource: `App:User`\n */\n invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n return this.request('/user/invite', 'post')(params, request);\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n *\n * Get all Users in 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.\n *\n * Access Policy Action: `App:ListAllUsers`\n * Access Policy Resource: `App:User`\n */\n list(request?: OystehrClientRequest): Promise<UserListResponse> {\n return this.request('/user', 'get')(request);\n }\n /**\n * 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.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response> {\n return this.request('/user/v2/list', 'get')(params, request);\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"user.js","sources":["../../../../src/resources/classes/user.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport {\n OystehrClientRequest,\n UserDeleteParams,\n UserGetParams,\n UserGetResponse,\n UserInviteParams,\n UserInviteResponse,\n UserListResponse,\n UserListV2Params,\n UserListV2Response,\n UserMeResponse,\n UserUpdateParams,\n UserUpdateResponse,\n} from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class User extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Get your own User details. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.\n */\n me(request?: OystehrClientRequest): Promise<UserMeResponse> {\n return this.request('/user/me', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:GetUser`\n * Access Policy Resource: `App:User`\n */\n get(params: UserGetParams, request?: OystehrClientRequest): Promise<UserGetResponse> {\n return this.request('/user/{id}', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Update the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:UpdateUser`\n * Access Policy Resource: `App:User`\n */\n update(params: UserUpdateParams, request?: OystehrClientRequest): Promise<UserUpdateResponse> {\n return this.request('/user/{id}', 'patch', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Delete the User with the provided ID. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:DeleteUser`\n * Access Policy Resource: `App:User`\n */\n delete(params: UserDeleteParams, request?: OystehrClientRequest): Promise<void> {\n return this.request('/user/{id}', 'delete', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * Invite a User to the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:CreateUser`\n * Access Policy Resource: `App:User`\n */\n invite(params: UserInviteParams, request?: OystehrClientRequest): Promise<UserInviteResponse> {\n return this.request('/user/invite', 'post', this.#baseUrlThunk.bind(this))(params, request);\n }\n /**\n * DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.\n *\n * Get all Users in the Project. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `App:ListAllUsers`\n * Access Policy Resource: `App:User`\n */\n list(request?: OystehrClientRequest): Promise<UserListResponse> {\n return this.request('/user', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n /**\n * Get Users in the Project with pagination, sort, sort Order and filtering. [Users](https://docs.oystehr.com/oystehr/services/app/users/) are the people who log into the [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) you configure for securing the apps you build on top of Oystehr.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(params: UserListV2Params, request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * 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.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(request?: OystehrClientRequest): Promise<UserListV2Response>;\n /**\n * 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.\n *\n * Access Policy Action: `Project:ListAllUsers`\n * Access Policy Resource: `Project:Settings`\n */\n listV2(\n params?: UserListV2Params | OystehrClientRequest,\n request?: OystehrClientRequest\n ): Promise<UserListV2Response> {\n return this.request('/user/v2/list', 'get', this.#baseUrlThunk.bind(this))(params, request);\n }\n}\n"],"names":[],"mappings":";;;AAAA;;AAmBM,MAAO,IAAK,SAAQ,WAAW,CAAA;AACnC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;;KACf;AAID;;;;AAIG;AACH,IAAA,EAAE,CAAC,OAA8B,EAAA;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,sBAAA,CAAA,IAAI,2CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAChF;AACD;;;;;AAKG;IACH,GAAG,CAAC,MAAqB,EAAE,OAA8B,EAAA;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,EAAE,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,EAAA,kBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC1F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,EAAE,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,EAAA,kBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC5F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,EAAA,kBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;AAKG;IACH,MAAM,CAAC,MAAwB,EAAE,OAA8B,EAAA;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,EAAA,kBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACD;;;;;;;AAOG;AACH,IAAA,IAAI,CAAC,OAA8B,EAAA;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,sBAAA,CAAA,IAAI,2CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAC7E;AAeD;;;;;AAKG;IACH,MAAM,CACJ,MAAgD,EAChD,OAA8B,EAAA;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,EAAE,sBAAA,CAAA,IAAI,EAAA,eAAA,EAAA,GAAA,EAAA,kBAAA,CAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7F;AACF,CAAA;;;AAnFG,IAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;AACxF,CAAC;;;;"}
|
|
@@ -2,6 +2,7 @@ import { OystehrClientRequest, VersionGetResponse } from '../..';
|
|
|
2
2
|
import { SDKResource } from '../../client/client';
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
export declare class Version extends SDKResource {
|
|
5
|
+
#private;
|
|
5
6
|
constructor(config: OystehrConfig);
|
|
6
7
|
/**
|
|
7
8
|
* Get project API version. This endpoint is public so there are no access policy requirements.
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { SDKResource } from '../../client/client.js';
|
|
2
3
|
|
|
3
4
|
// AUTOGENERATED -- DO NOT EDIT
|
|
5
|
+
var _Version_instances, _Version_baseUrlThunk;
|
|
4
6
|
class Version extends SDKResource {
|
|
5
7
|
constructor(config) {
|
|
6
8
|
super(config);
|
|
9
|
+
_Version_instances.add(this);
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Get project API version. This endpoint is public so there are no access policy requirements.
|
|
10
13
|
*/
|
|
11
14
|
get(request) {
|
|
12
|
-
return this.request('/version', 'get')(request);
|
|
15
|
+
return this.request('/version', 'get', __classPrivateFieldGet(this, _Version_instances, "m", _Version_baseUrlThunk).bind(this))(request);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
18
|
+
_Version_instances = new WeakSet(), _Version_baseUrlThunk = function _Version_baseUrlThunk() {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
21
|
+
};
|
|
15
22
|
|
|
16
23
|
export { Version };
|
|
17
24
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../../src/resources/classes/version.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { OystehrClientRequest, VersionGetResponse } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Version extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n /**\n * Get project API version. This endpoint is public so there are no access policy requirements.\n */\n get(request?: OystehrClientRequest): Promise<VersionGetResponse> {\n return this.request('/version', 'get')(request);\n }\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../../src/resources/classes/version.ts"],"sourcesContent":["// AUTOGENERATED -- DO NOT EDIT\n\nimport { OystehrClientRequest, VersionGetResponse } from '../..';\nimport { SDKResource } from '../../client/client';\nimport { OystehrConfig } from '../../config';\n\nexport class Version extends SDKResource {\n constructor(config: OystehrConfig) {\n super(config);\n }\n #baseUrlThunk(): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n }\n /**\n * Get project API version. This endpoint is public so there are no access policy requirements.\n */\n get(request?: OystehrClientRequest): Promise<VersionGetResponse> {\n return this.request('/version', 'get', this.#baseUrlThunk.bind(this))(request);\n }\n}\n"],"names":[],"mappings":";;;AAAA;;AAMM,MAAO,OAAQ,SAAQ,WAAW,CAAA;AACtC,IAAA,WAAA,CAAY,MAAqB,EAAA;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;;KACf;AAID;;AAEG;AACH,IAAA,GAAG,CAAC,OAA8B,EAAA;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,sBAAA,CAAA,IAAI,iDAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;KAChF;AACF,CAAA;;;AARG,IAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;AACxF,CAAC;;;;"}
|
|
@@ -2,6 +2,10 @@ import { __awaiter } from '../../node_modules/tslib/tslib.es6.js';
|
|
|
2
2
|
import { defaultProjectApiUrl } from '../../client/client.js';
|
|
3
3
|
import { OystehrSdkError } from '../../errors/index.js';
|
|
4
4
|
|
|
5
|
+
function baseUrlThunk() {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
8
|
+
}
|
|
5
9
|
/**
|
|
6
10
|
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
7
11
|
*
|
|
@@ -9,7 +13,7 @@ import { OystehrSdkError } from '../../errors/index.js';
|
|
|
9
13
|
*/
|
|
10
14
|
function uploadFile({ bucketName, 'objectPath+': key, file, }) {
|
|
11
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
|
|
16
|
+
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))({
|
|
13
17
|
action: 'upload',
|
|
14
18
|
bucketName,
|
|
15
19
|
'objectPath+': key,
|
|
@@ -27,7 +31,7 @@ function uploadFile({ bucketName, 'objectPath+': key, file, }) {
|
|
|
27
31
|
*/
|
|
28
32
|
function downloadFile({ bucketName, 'objectPath+': key, }) {
|
|
29
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post')({
|
|
34
|
+
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))({
|
|
31
35
|
action: 'download',
|
|
32
36
|
bucketName,
|
|
33
37
|
'objectPath+': key,
|
|
@@ -49,7 +53,7 @@ function downloadFile({ bucketName, 'objectPath+': key, }) {
|
|
|
49
53
|
* @param params url and action
|
|
50
54
|
*/
|
|
51
55
|
function getPresignedUrlForZ3Url(params) {
|
|
52
|
-
var _a;
|
|
56
|
+
var _a, _b;
|
|
53
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
58
|
let bucket;
|
|
55
59
|
let key;
|
|
@@ -60,7 +64,7 @@ function getPresignedUrlForZ3Url(params) {
|
|
|
60
64
|
bucket = url.hostname;
|
|
61
65
|
key = z3PathParts.join('/');
|
|
62
66
|
}
|
|
63
|
-
else if (url.href.startsWith((_a = this.config.projectApiUrl) !== null &&
|
|
67
|
+
else if (url.href.startsWith((_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : defaultProjectApiUrl)) {
|
|
64
68
|
// remove leading `/v1/z3`
|
|
65
69
|
const httpsPathParts = url.pathname.split('/').slice(3);
|
|
66
70
|
bucket = httpsPathParts[0];
|
|
@@ -74,7 +78,7 @@ function getPresignedUrlForZ3Url(params) {
|
|
|
74
78
|
bucketName: bucket,
|
|
75
79
|
'objectPath+': key,
|
|
76
80
|
};
|
|
77
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'post')(requestParams);
|
|
81
|
+
return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))(requestParams);
|
|
78
82
|
});
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"z3-ext.js","sources":["../../../../src/resources/classes/z3-ext.ts"],"sourcesContent":["import { defaultProjectApiUrl, SDKResource } from '../../client/client';\nimport { OystehrSdkError } from '../../errors';\nimport { Z3GetPresignedUrlParams, Z3GetPresignedUrlResponse } from '../types';\n\n/**\n * Uploads a file to the bucket and key. Files should be Blobs.\n *\n * @param params upload file params\n */\nexport async function uploadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n file,\n }: {\n bucketName: string;\n 'objectPath+': string;\n file: Blob;\n }\n): Promise<void> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post'\n )({\n action: 'upload',\n bucketName,\n 'objectPath+': key,\n });\n await fetch(uploadUrl.signedUrl, {\n method: 'PUT',\n body: file,\n });\n}\n\n/**\n * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.\n *\n * @param params download file params\n */\nexport async function downloadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n }: {\n bucketName: string;\n 'objectPath+': string;\n }\n): Promise<ArrayBuffer> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post'\n )({\n action: 'download',\n bucketName,\n 'objectPath+': key,\n });\n const resp = await fetch(uploadUrl.signedUrl, {\n method: 'GET',\n });\n if (!resp.ok) {\n throw new Error('Failed to download file');\n }\n return resp.arrayBuffer();\n}\n\n/**\n * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms\n * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`\n * instead of the standard SDK `Z3GetPresignedUrlParams`.\n *\n * @param params url and action\n */\nexport async function getPresignedUrlForZ3Url(\n this: SDKResource,\n params: { url: string; action: Z3GetPresignedUrlParams['action'] }\n): Promise<Z3GetPresignedUrlResponse> {\n let bucket: string;\n let key: string;\n const url = new URL(params.url);\n if (url.protocol === 'z3:') {\n // remove leading forward slash\n const z3PathParts = url.pathname.split('/').slice(1);\n bucket = url.hostname;\n key = z3PathParts.join('/');\n } else if (url.href.startsWith(this.config.projectApiUrl ?? defaultProjectApiUrl)) {\n // remove leading `/v1/z3`\n const httpsPathParts = url.pathname.split('/').slice(3);\n bucket = httpsPathParts[0];\n key = httpsPathParts.slice(1).join('/');\n } else {\n throw new OystehrSdkError({ message: 'Invalid Z3 URL', code: 400 });\n }\n const requestParams: Z3GetPresignedUrlParams = {\n action: 'upload',\n bucketName: bucket,\n 'objectPath+': key,\n };\n return this.request('/z3/{bucketName}/{objectPath+}', 'post')(requestParams);\n}\n"],"names":[],"mappings":";;;;AAIA;;;;AAIG;AACG,SAAgB,UAAU,CAE9B,EACE,UAAU,EACV,aAAa,EAAE,GAAG,EAClB,IAAI,GAKL,EAAA;;
|
|
1
|
+
{"version":3,"file":"z3-ext.js","sources":["../../../../src/resources/classes/z3-ext.ts"],"sourcesContent":["import { defaultProjectApiUrl, SDKResource } from '../../client/client';\nimport { OystehrSdkError } from '../../errors';\nimport { Z3GetPresignedUrlParams, Z3GetPresignedUrlResponse } from '../types';\n\nfunction baseUrlThunk(this: SDKResource): string {\n return this.config.services?.['projectApiUrl'] ?? 'https://project-api.zapehr.com/v1';\n}\n\n/**\n * Uploads a file to the bucket and key. Files should be Blobs.\n *\n * @param params upload file params\n */\nexport async function uploadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n file,\n }: {\n bucketName: string;\n 'objectPath+': string;\n file: Blob;\n }\n): Promise<void> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post',\n baseUrlThunk.bind(this)\n )({\n action: 'upload',\n bucketName,\n 'objectPath+': key,\n });\n await fetch(uploadUrl.signedUrl, {\n method: 'PUT',\n body: file,\n });\n}\n\n/**\n * Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.\n *\n * @param params download file params\n */\nexport async function downloadFile(\n this: SDKResource,\n {\n bucketName,\n 'objectPath+': key,\n }: {\n bucketName: string;\n 'objectPath+': string;\n }\n): Promise<ArrayBuffer> {\n const uploadUrl = await this.request(\n '/z3/{bucketName}/{objectPath+}',\n 'post',\n baseUrlThunk.bind(this)\n )({\n action: 'download',\n bucketName,\n 'objectPath+': key,\n });\n const resp = await fetch(uploadUrl.signedUrl, {\n method: 'GET',\n });\n if (!resp.ok) {\n throw new Error('Failed to download file');\n }\n return resp.arrayBuffer();\n}\n\n/**\n * This helper performs a `getPresignedUrl` request for Z3 URLs of the forms\n * `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`\n * instead of the standard SDK `Z3GetPresignedUrlParams`.\n *\n * @param params url and action\n */\nexport async function getPresignedUrlForZ3Url(\n this: SDKResource,\n params: { url: string; action: Z3GetPresignedUrlParams['action'] }\n): Promise<Z3GetPresignedUrlResponse> {\n let bucket: string;\n let key: string;\n const url = new URL(params.url);\n if (url.protocol === 'z3:') {\n // remove leading forward slash\n const z3PathParts = url.pathname.split('/').slice(1);\n bucket = url.hostname;\n key = z3PathParts.join('/');\n } else if (url.href.startsWith(this.config.services?.['projectApiUrl'] ?? defaultProjectApiUrl)) {\n // remove leading `/v1/z3`\n const httpsPathParts = url.pathname.split('/').slice(3);\n bucket = httpsPathParts[0];\n key = httpsPathParts.slice(1).join('/');\n } else {\n throw new OystehrSdkError({ message: 'Invalid Z3 URL', code: 400 });\n }\n const requestParams: Z3GetPresignedUrlParams = {\n action: 'upload',\n bucketName: bucket,\n 'objectPath+': key,\n };\n return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk.bind(this))(requestParams);\n}\n"],"names":[],"mappings":";;;;AAIA,SAAS,YAAY,GAAA;;AACnB,IAAA,OAAO,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAG,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,mCAAmC,CAAC;AACxF,CAAC;AAED;;;;AAIG;AACG,SAAgB,UAAU,CAE9B,EACE,UAAU,EACV,aAAa,EAAE,GAAG,EAClB,IAAI,GAKL,EAAA;;AAED,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,gCAAgC,EAChC,MAAM,EACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAC;AACA,YAAA,MAAM,EAAE,QAAQ;YAChB,UAAU;AACV,YAAA,aAAa,EAAE,GAAG;AACnB,SAAA,CAAC,CAAC;AACH,QAAA,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAC/B,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,IAAI,EAAE,IAAI;AACX,SAAA,CAAC,CAAC;KACJ,CAAA,CAAA;AAAA,CAAA;AAED;;;;AAIG;AACG,SAAgB,YAAY,CAEhC,EACE,UAAU,EACV,aAAa,EAAE,GAAG,GAInB,EAAA;;AAED,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAClC,gCAAgC,EAChC,MAAM,EACN,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CACxB,CAAC;AACA,YAAA,MAAM,EAAE,UAAU;YAClB,UAAU;AACV,YAAA,aAAa,EAAE,GAAG;AACnB,SAAA,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;AAC5C,YAAA,MAAM,EAAE,KAAK;AACd,SAAA,CAAC,CAAC;AACH,QAAA,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE;AACZ,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAC5C,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;KAC3B,CAAA,CAAA;AAAA,CAAA;AAED;;;;;;AAMG;AACG,SAAgB,uBAAuB,CAE3C,MAAkE,EAAA;;;AAElE,QAAA,IAAI,MAAc,CAAC;AACnB,QAAA,IAAI,GAAW,CAAC;QAChB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAChC,QAAA,IAAI,GAAG,CAAC,QAAQ,KAAK,KAAK,EAAE;;AAE1B,YAAA,MAAM,WAAW,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACrD,YAAA,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC;AACtB,YAAA,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,SAAA;AAAM,aAAA,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,MAAG,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,eAAe,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,oBAAoB,CAAC,EAAE;;AAE/F,YAAA,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,YAAA,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAC3B,YAAA,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzC,SAAA;AAAM,aAAA;AACL,YAAA,MAAM,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;AACrE,SAAA;AACD,QAAA,MAAM,aAAa,GAA4B;AAC7C,YAAA,MAAM,EAAE,QAAQ;AAChB,YAAA,UAAU,EAAE,MAAM;AAClB,YAAA,aAAa,EAAE,GAAG;SACnB,CAAC;AACF,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;;AACvG;;;;"}
|
|
@@ -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`
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from '../../node_modules/tslib/tslib.es6.js';
|
|
1
2
|
import { SDKResource } from '../../client/client.js';
|
|
2
3
|
import { uploadFile, downloadFile, getPresignedUrlForZ3Url } from './z3-ext.js';
|
|
3
4
|
|
|
4
5
|
// AUTOGENERATED -- DO NOT EDIT
|
|
6
|
+
var _Z3_instances, _Z3_baseUrlThunk;
|
|
5
7
|
class Z3 extends SDKResource {
|
|
6
8
|
constructor(config) {
|
|
7
9
|
super(config);
|
|
10
|
+
_Z3_instances.add(this);
|
|
8
11
|
/**
|
|
9
12
|
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
10
13
|
* @param params upload file params
|
|
@@ -24,60 +27,64 @@ class Z3 extends SDKResource {
|
|
|
24
27
|
this.getPresignedUrlForZ3Url = getPresignedUrlForZ3Url;
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
|
-
* List all Z3 Buckets. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
30
|
+
* List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
28
31
|
*
|
|
29
32
|
* Access Policy Action: `Z3:ListBuckets`
|
|
30
33
|
* Access Policy Resource: `Z3:BucketName`
|
|
31
34
|
*/
|
|
32
35
|
listBuckets(request) {
|
|
33
|
-
return this.request('/z3', 'get')(request);
|
|
36
|
+
return this.request('/z3', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(request);
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
36
|
-
* 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.
|
|
39
|
+
* 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.
|
|
37
40
|
*
|
|
38
41
|
* Access Policy Action: `Z3:CreateBucket`
|
|
39
42
|
* Access Policy Resource: `Z3:BucketName`
|
|
40
43
|
*/
|
|
41
44
|
createBucket(params, request) {
|
|
42
|
-
return this.request('/z3/{bucketName}', 'put')(params, request);
|
|
45
|
+
return this.request('/z3/{bucketName}', 'put', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
45
|
-
* 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.
|
|
48
|
+
* 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.
|
|
46
49
|
*
|
|
47
50
|
* Access Policy Action: `Z3:DeleteBucket`
|
|
48
51
|
* Access Policy Resource: `Z3:BucketName`
|
|
49
52
|
*/
|
|
50
53
|
deleteBucket(params, request) {
|
|
51
|
-
return this.request('/z3/{bucketName}', 'delete')(params, request);
|
|
54
|
+
return this.request('/z3/{bucketName}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
|
-
* 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.
|
|
57
|
+
* 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.
|
|
55
58
|
*
|
|
56
59
|
* Access Policy Action: `Z3:ListObjects`
|
|
57
60
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
58
61
|
*/
|
|
59
62
|
listObjects(params, request) {
|
|
60
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'get')(params, request);
|
|
63
|
+
return this.request('/z3/{bucketName}/{objectPath+}', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
61
64
|
}
|
|
62
65
|
/**
|
|
63
|
-
* 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.
|
|
66
|
+
* 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.
|
|
64
67
|
*
|
|
65
68
|
* Access Policy Action: `Z3:PutObject` or `Z3:GetObject`
|
|
66
69
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
67
70
|
*/
|
|
68
71
|
getPresignedUrl(params, request) {
|
|
69
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'post')(params, request);
|
|
72
|
+
return this.request('/z3/{bucketName}/{objectPath+}', 'post', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
72
|
-
* 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.
|
|
75
|
+
* 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.
|
|
73
76
|
*
|
|
74
77
|
* Access Policy Action: `Z3:DeleteObject`
|
|
75
78
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
76
79
|
*/
|
|
77
80
|
deleteObject(params, request) {
|
|
78
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'delete')(params, request);
|
|
81
|
+
return this.request('/z3/{bucketName}/{objectPath+}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
79
82
|
}
|
|
80
83
|
}
|
|
84
|
+
_Z3_instances = new WeakSet(), _Z3_baseUrlThunk = function _Z3_baseUrlThunk() {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : 'https://project-api.zapehr.com/v1';
|
|
87
|
+
};
|
|
81
88
|
|
|
82
89
|
export { Z3 };
|
|
83
90
|
//# sourceMappingURL=z3.js.map
|