@oystehr/sdk 4.0.0-alpha.4 → 4.0.0
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/dist/cjs/client/client.cjs +259 -0
- package/dist/cjs/client/client.cjs.map +1 -0
- package/dist/cjs/errors/index.cjs +58 -0
- package/dist/cjs/errors/index.cjs.map +1 -0
- package/dist/cjs/index.cjs +11 -1980
- 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.cjs +88 -0
- package/dist/cjs/resources/classes/application.cjs.map +1 -0
- package/dist/cjs/resources/classes/charge.cjs +44 -0
- package/dist/cjs/resources/classes/charge.cjs.map +1 -0
- package/dist/cjs/resources/classes/conversation-ext.cjs +31 -0
- package/dist/cjs/resources/classes/conversation-ext.cjs.map +1 -0
- package/dist/cjs/resources/classes/conversation.cjs +84 -0
- package/dist/cjs/resources/classes/conversation.cjs.map +1 -0
- package/dist/cjs/resources/classes/developer.cjs +72 -0
- package/dist/cjs/resources/classes/developer.cjs.map +1 -0
- package/dist/cjs/resources/classes/erx.cjs +88 -0
- package/dist/cjs/resources/classes/erx.cjs.map +1 -0
- package/dist/cjs/resources/classes/erx.d.ts +5 -1
- package/dist/cjs/resources/classes/erxV1.cjs +46 -0
- package/dist/cjs/resources/classes/erxV1.cjs.map +1 -0
- package/dist/cjs/resources/classes/erxV2.cjs +22 -0
- package/dist/cjs/resources/classes/erxV2.cjs.map +1 -0
- package/dist/cjs/resources/classes/fax.cjs +46 -0
- package/dist/cjs/resources/classes/fax.cjs.map +1 -0
- package/dist/cjs/resources/classes/fhir-ext.cjs +200 -0
- package/dist/cjs/resources/classes/fhir-ext.cjs.map +1 -0
- package/dist/cjs/resources/classes/fhir-ext.d.ts +8 -8
- package/dist/cjs/resources/classes/fhir.cjs +34 -0
- package/dist/cjs/resources/classes/fhir.cjs.map +1 -0
- package/dist/cjs/resources/classes/fhir.d.ts +2 -2
- package/dist/cjs/resources/classes/index.cjs +88 -0
- package/dist/cjs/resources/classes/index.cjs.map +1 -0
- package/dist/cjs/resources/classes/lab.cjs +76 -0
- package/dist/cjs/resources/classes/lab.cjs.map +1 -0
- package/dist/cjs/resources/classes/m2m.cjs +81 -0
- package/dist/cjs/resources/classes/m2m.cjs.map +1 -0
- package/dist/cjs/resources/classes/messaging.cjs +22 -0
- package/dist/cjs/resources/classes/messaging.cjs.map +1 -0
- package/dist/cjs/resources/classes/paymentMethod.cjs +88 -0
- package/dist/cjs/resources/classes/paymentMethod.cjs.map +1 -0
- package/dist/cjs/resources/classes/project.cjs +34 -0
- package/dist/cjs/resources/classes/project.cjs.map +1 -0
- package/dist/cjs/resources/classes/rcm.cjs +55 -0
- package/dist/cjs/resources/classes/rcm.cjs.map +1 -0
- package/dist/cjs/resources/classes/role.cjs +62 -0
- package/dist/cjs/resources/classes/role.cjs.map +1 -0
- package/dist/cjs/resources/classes/secret.cjs +52 -0
- package/dist/cjs/resources/classes/secret.cjs.map +1 -0
- package/dist/cjs/resources/classes/telemed.cjs +43 -0
- package/dist/cjs/resources/classes/telemed.cjs.map +1 -0
- package/dist/cjs/resources/classes/transactionalSMS.cjs +34 -0
- package/dist/cjs/resources/classes/transactionalSMS.cjs.map +1 -0
- package/dist/cjs/resources/classes/user.cjs +80 -0
- package/dist/cjs/resources/classes/user.cjs.map +1 -0
- package/dist/cjs/resources/classes/version.cjs +22 -0
- package/dist/cjs/resources/classes/version.cjs.map +1 -0
- package/dist/cjs/resources/classes/z3-ext.cjs +81 -0
- package/dist/cjs/resources/classes/z3-ext.cjs.map +1 -0
- package/dist/cjs/resources/classes/z3.cjs +88 -0
- package/dist/cjs/resources/classes/z3.cjs.map +1 -0
- package/dist/cjs/resources/classes/zambda-ext.cjs +15 -0
- package/dist/cjs/resources/classes/zambda-ext.cjs.map +1 -0
- package/dist/cjs/resources/classes/zambda.cjs +89 -0
- package/dist/cjs/resources/classes/zambda.cjs.map +1 -0
- package/dist/cjs/resources/classes/zambdaLogStream.cjs +43 -0
- package/dist/cjs/resources/classes/zambdaLogStream.cjs.map +1 -0
- package/dist/cjs/resources/types/ErxGetConfigurationResponse.d.ts +9 -0
- package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +12 -0
- package/dist/cjs/resources/types/ZambdaFunction.d.ts +8 -0
- package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +8 -0
- package/dist/cjs/resources/types/fhir.d.ts +12 -12
- package/dist/cjs/resources/types/index.d.ts +1 -0
- package/dist/esm/client/client.js +68 -67
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/errors/index.js +3 -2
- package/dist/esm/errors/index.js.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/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.js +11 -15
- package/dist/esm/resources/classes/application.js.map +1 -1
- package/dist/esm/resources/classes/charge.js +5 -9
- package/dist/esm/resources/classes/charge.js.map +1 -1
- package/dist/esm/resources/classes/conversation-ext.js +4 -5
- package/dist/esm/resources/classes/conversation-ext.js.map +1 -1
- package/dist/esm/resources/classes/conversation.js +16 -20
- package/dist/esm/resources/classes/conversation.js.map +1 -1
- package/dist/esm/resources/classes/developer.js +9 -13
- package/dist/esm/resources/classes/developer.js.map +1 -1
- package/dist/esm/resources/classes/erx.d.ts +5 -1
- package/dist/esm/resources/classes/erx.js +20 -18
- package/dist/esm/resources/classes/erx.js.map +1 -1
- package/dist/esm/resources/classes/erxV1.js +8 -12
- package/dist/esm/resources/classes/erxV1.js.map +1 -1
- package/dist/esm/resources/classes/erxV2.js +4 -8
- package/dist/esm/resources/classes/erxV2.js.map +1 -1
- package/dist/esm/resources/classes/fax.js +6 -10
- package/dist/esm/resources/classes/fax.js.map +1 -1
- package/dist/esm/resources/classes/fhir-ext.d.ts +8 -8
- package/dist/esm/resources/classes/fhir-ext.js +71 -62
- package/dist/esm/resources/classes/fhir-ext.js.map +1 -1
- package/dist/esm/resources/classes/fhir.d.ts +2 -2
- package/dist/esm/resources/classes/fhir.js +20 -20
- package/dist/esm/resources/classes/fhir.js.map +1 -1
- package/dist/esm/resources/classes/index.js +28 -5
- package/dist/esm/resources/classes/index.js.map +1 -1
- package/dist/esm/resources/classes/lab.js +9 -13
- package/dist/esm/resources/classes/lab.js.map +1 -1
- package/dist/esm/resources/classes/m2m.js +10 -14
- package/dist/esm/resources/classes/m2m.js.map +1 -1
- package/dist/esm/resources/classes/messaging.js +4 -8
- package/dist/esm/resources/classes/messaging.js.map +1 -1
- package/dist/esm/resources/classes/paymentMethod.js +7 -11
- package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
- package/dist/esm/resources/classes/project.js +5 -9
- package/dist/esm/resources/classes/project.js.map +1 -1
- package/dist/esm/resources/classes/rcm.js +6 -10
- package/dist/esm/resources/classes/rcm.js.map +1 -1
- package/dist/esm/resources/classes/role.js +8 -12
- package/dist/esm/resources/classes/role.js.map +1 -1
- package/dist/esm/resources/classes/secret.js +7 -11
- package/dist/esm/resources/classes/secret.js.map +1 -1
- package/dist/esm/resources/classes/telemed.js +5 -9
- package/dist/esm/resources/classes/telemed.js.map +1 -1
- package/dist/esm/resources/classes/transactionalSMS.js +4 -8
- package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
- package/dist/esm/resources/classes/user.js +10 -14
- package/dist/esm/resources/classes/user.js.map +1 -1
- package/dist/esm/resources/classes/version.js +4 -8
- package/dist/esm/resources/classes/version.js.map +1 -1
- package/dist/esm/resources/classes/z3-ext.js +47 -56
- package/dist/esm/resources/classes/z3-ext.js.map +1 -1
- package/dist/esm/resources/classes/z3.js +26 -30
- package/dist/esm/resources/classes/z3.js.map +1 -1
- package/dist/esm/resources/classes/zambda-ext.js +6 -11
- package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
- package/dist/esm/resources/classes/zambda.js +12 -16
- package/dist/esm/resources/classes/zambda.js.map +1 -1
- package/dist/esm/resources/classes/zambdaLogStream.js +6 -10
- package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
- package/dist/esm/resources/types/ErxGetConfigurationResponse.d.ts +9 -0
- package/dist/esm/resources/types/ZambdaCreateParams.d.ts +12 -0
- package/dist/esm/resources/types/ZambdaFunction.d.ts +8 -0
- package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +8 -0
- package/dist/esm/resources/types/fhir.d.ts +12 -12
- package/dist/esm/resources/types/index.d.ts +1 -0
- package/package.json +4 -3
- package/rollup.config-cjs.mjs +97 -18
- package/src/resources/classes/erx.ts +7 -0
- package/src/resources/classes/fhir-ext.ts +6 -6
- package/src/resources/types/ErxGetConfigurationResponse.ts +11 -0
- package/src/resources/types/ZambdaCreateParams.ts +12 -0
- package/src/resources/types/ZambdaFunction.ts +8 -0
- package/src/resources/types/ZambdaUpdateParams.ts +8 -0
- package/src/resources/types/fhir.ts +12 -12
- package/src/resources/types/index.ts +1 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js +0 -40
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,1987 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
super(message, { cause });
|
|
8
|
-
Object.setPrototypeOf(this, OystehrSdkError.prototype);
|
|
9
|
-
this.code = code;
|
|
10
|
-
this.name = 'OystehrSdkError';
|
|
11
|
-
}
|
|
12
|
-
toString() {
|
|
13
|
-
return `${this.name}: ${this.message} (code: ${this.code})`;
|
|
14
|
-
}
|
|
15
|
-
toJSON() {
|
|
16
|
-
return {
|
|
17
|
-
name: this.name,
|
|
18
|
-
message: this.message,
|
|
19
|
-
code: this.code,
|
|
20
|
-
cause: this.cause,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function transformOperationOutcomeToErrorMessage(cause) {
|
|
25
|
-
var _a;
|
|
26
|
-
const causes = [];
|
|
27
|
-
for (const issue of (_a = cause.issue) !== null && _a !== void 0 ? _a : []) {
|
|
28
|
-
if (issue.details && issue.details.text) {
|
|
29
|
-
causes.push(issue.details.text);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (!causes.length) {
|
|
33
|
-
causes.push('Unknown FHIR error');
|
|
34
|
-
}
|
|
35
|
-
return causes.join(',');
|
|
36
|
-
}
|
|
37
|
-
class OystehrFHIRError extends OystehrSdkError {
|
|
38
|
-
constructor({ error, code }) {
|
|
39
|
-
super({
|
|
40
|
-
message: transformOperationOutcomeToErrorMessage(error),
|
|
41
|
-
code,
|
|
42
|
-
});
|
|
43
|
-
Object.setPrototypeOf(this, OystehrFHIRError.prototype);
|
|
44
|
-
this.cause = error;
|
|
45
|
-
this.name = 'OystehrFHIRError';
|
|
46
|
-
}
|
|
47
|
-
toJSON() {
|
|
48
|
-
return {
|
|
49
|
-
name: this.name,
|
|
50
|
-
message: this.message,
|
|
51
|
-
code: this.code,
|
|
52
|
-
cause: this.cause,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/******************************************************************************
|
|
58
|
-
Copyright (c) Microsoft Corporation.
|
|
59
|
-
|
|
60
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
61
|
-
purpose with or without fee is hereby granted.
|
|
62
|
-
|
|
63
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
64
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
65
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
66
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
67
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
68
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
69
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
70
|
-
***************************************************************************** */
|
|
71
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
75
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
76
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
77
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
78
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
79
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
80
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
85
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
86
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
87
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
91
|
-
var e = new Error(message);
|
|
92
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const defaultProjectApiUrl = 'https://project-api.zapehr.com/v1';
|
|
96
|
-
const defaultFhirApiUrl = 'https://fhir-api.zapehr.com';
|
|
97
|
-
const STATUS_CODES_TO_RETRY = [408, 429, 500, 502, 503, 504];
|
|
98
|
-
const ERROR_CODES_TO_RETRY = [
|
|
99
|
-
'ECONNRESET',
|
|
100
|
-
'ECONNREFUSED',
|
|
101
|
-
'EPIPE',
|
|
102
|
-
'ETIMEDOUT',
|
|
103
|
-
'UND_ERR_CONNECT_TIMEOUT',
|
|
104
|
-
'UND_ERR_HEADERS_TIMEOUT',
|
|
105
|
-
'UND_ERR_HEADERS_TIMEOUT',
|
|
106
|
-
'UND_ERR_SOCKET',
|
|
107
|
-
];
|
|
108
|
-
class SDKResource {
|
|
109
|
-
constructor(config) {
|
|
110
|
-
this.config = config;
|
|
111
|
-
}
|
|
112
|
-
request(path, method, baseUrlThunk) {
|
|
113
|
-
return (params, request) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
const configThunk = () => this.config;
|
|
115
|
-
try {
|
|
116
|
-
return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
117
|
-
}
|
|
118
|
-
catch (err) {
|
|
119
|
-
const error = err;
|
|
120
|
-
throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
fhirRequest(path, method) {
|
|
125
|
-
return (params, request) => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
try {
|
|
127
|
-
const baseUrlThunk = () => { var _a, _b; return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a.fhirApiUrl) !== null && _b !== void 0 ? _b : defaultFhirApiUrl; };
|
|
128
|
-
const configThunk = () => this.config;
|
|
129
|
-
// must await here to catch
|
|
130
|
-
return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
131
|
-
}
|
|
132
|
-
catch (err) {
|
|
133
|
-
// FHIR API error messages are JSON strings
|
|
134
|
-
const fullError = err;
|
|
135
|
-
if (typeof fullError.message === 'string') {
|
|
136
|
-
throw new OystehrSdkError({
|
|
137
|
-
message: fullError.message,
|
|
138
|
-
code: fullError.code,
|
|
139
|
-
cause: fullError.cause,
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
throw new OystehrFHIRError({
|
|
143
|
-
error: fullError.message,
|
|
144
|
-
code: fullError.code,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function isInternalClientRequest(request) {
|
|
151
|
-
return 'accessToken' in request;
|
|
152
|
-
}
|
|
153
|
-
function fetcher(baseUrlThunk, configThunk, path, methodParam) {
|
|
154
|
-
return (params, request) => __awaiter(this, void 0, void 0, function* () {
|
|
155
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
156
|
-
// this function supports multiple signatures. fetcher(baseUrl, path, method)(params, request) or fetcher(baseUrl, path, method)(request)
|
|
157
|
-
// or fetcher(baseUrl, path, method)(params) or fetcher(baseUrl, path, method)(). the types for this are handled by Client<Path, Methods>
|
|
158
|
-
// and this is the backend implementation behind it. the heuristic we're using is that if the first param is an object with an accessToken
|
|
159
|
-
// and there is no second param, assume the first one is the request object instead
|
|
160
|
-
const providedParams = !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)
|
|
161
|
-
? {}
|
|
162
|
-
: (_a = params) !== null && _a !== void 0 ? _a : {};
|
|
163
|
-
const requestCtx = !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)
|
|
164
|
-
? params
|
|
165
|
-
: request;
|
|
166
|
-
const method = methodParam.toLowerCase();
|
|
167
|
-
const config = configThunk();
|
|
168
|
-
const fetchImpl = (_b = config.fetch) !== null && _b !== void 0 ? _b : fetch;
|
|
169
|
-
const accessToken = (_c = requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.accessToken) !== null && _c !== void 0 ? _c : config.accessToken;
|
|
170
|
-
const projectId = (_d = requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.projectId) !== null && _d !== void 0 ? _d : configThunk().projectId;
|
|
171
|
-
let finalPath = path;
|
|
172
|
-
let finalParams = providedParams;
|
|
173
|
-
if (!Array.isArray(providedParams)) {
|
|
174
|
-
const [subbedPath, addlParams] = subParamsInPath(path, providedParams);
|
|
175
|
-
finalPath = subbedPath;
|
|
176
|
-
finalParams = addlParams;
|
|
177
|
-
}
|
|
178
|
-
finalPath = finalPath.replace(/^\//, ''); // remove leading slash
|
|
179
|
-
const baseUrlEvaluated = baseUrlThunk();
|
|
180
|
-
const fullBaseUrl = baseUrlEvaluated.endsWith('/') ? baseUrlEvaluated : baseUrlEvaluated + '/';
|
|
181
|
-
const url = new URL(finalPath, fullBaseUrl);
|
|
182
|
-
let body;
|
|
183
|
-
if (Array.isArray(finalParams)) {
|
|
184
|
-
body = JSON.stringify(finalParams);
|
|
185
|
-
}
|
|
186
|
-
else if (Object.keys(finalParams).length) {
|
|
187
|
-
if (method === 'get') {
|
|
188
|
-
addParamsToSearch(finalParams, url.searchParams);
|
|
189
|
-
}
|
|
190
|
-
else if ((requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.contentType) === 'application/x-www-form-urlencoded') {
|
|
191
|
-
const search = new URLSearchParams();
|
|
192
|
-
addParamsToSearch(finalParams, search);
|
|
193
|
-
body = search.toString();
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
body = JSON.stringify(finalParams);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
// override for rpc call
|
|
201
|
-
if ((requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.contentType) !== 'application/x-www-form-urlencoded' && method === 'post') {
|
|
202
|
-
body = '{}';
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
const headers = Object.assign(projectId
|
|
206
|
-
? {
|
|
207
|
-
'x-zapehr-project-id': projectId,
|
|
208
|
-
'x-oystehr-project-id': projectId,
|
|
209
|
-
}
|
|
210
|
-
: {}, {
|
|
211
|
-
'content-type': (_e = requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.contentType) !== null && _e !== void 0 ? _e : 'application/json',
|
|
212
|
-
}, accessToken ? { Authorization: `Bearer ${accessToken}` } : {}, (requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.ifMatch) ? { 'If-Match': requestCtx.ifMatch } : {}, { 'x-oystehr-request-id': (_f = requestCtx === null || requestCtx === void 0 ? void 0 : requestCtx.requestId) !== null && _f !== void 0 ? _f : uuid.v4() });
|
|
213
|
-
const retryConfig = {
|
|
214
|
-
retries: (_h = (_g = config.retry) === null || _g === void 0 ? void 0 : _g.retries) !== null && _h !== void 0 ? _h : 3,
|
|
215
|
-
jitter: (_k = (_j = config.retry) === null || _j === void 0 ? void 0 : _j.jitter) !== null && _k !== void 0 ? _k : 20,
|
|
216
|
-
delay: (_m = (_l = config.retry) === null || _l === void 0 ? void 0 : _l.delay) !== null && _m !== void 0 ? _m : 100,
|
|
217
|
-
onRetry: (_o = config.retry) === null || _o === void 0 ? void 0 : _o.onRetry,
|
|
218
|
-
// Using array instead of set because the length is too short for uniqueness to be important
|
|
219
|
-
retryOn: [...((_q = (_p = config.retry) === null || _p === void 0 ? void 0 : _p.retryOn) !== null && _q !== void 0 ? _q : []), ...STATUS_CODES_TO_RETRY],
|
|
220
|
-
};
|
|
221
|
-
retryConfig.retryOn.push(...STATUS_CODES_TO_RETRY);
|
|
222
|
-
return retry(() => __awaiter(this, void 0, void 0, function* () {
|
|
223
|
-
var _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
224
|
-
const response = yield fetchImpl(new Request(url, {
|
|
225
|
-
method: method.toUpperCase(),
|
|
226
|
-
body,
|
|
227
|
-
headers,
|
|
228
|
-
}));
|
|
229
|
-
const responseBody = response.body ? yield response.text() : null;
|
|
230
|
-
let responseJson;
|
|
231
|
-
try {
|
|
232
|
-
responseJson =
|
|
233
|
-
responseBody &&
|
|
234
|
-
(((_r = response.headers.get('content-type')) === null || _r === void 0 ? void 0 : _r.includes('application/json')) ||
|
|
235
|
-
((_s = response.headers.get('content-type')) === null || _s === void 0 ? void 0 : _s.includes('application/fhir+json')))
|
|
236
|
-
? JSON.parse(responseBody)
|
|
237
|
-
: null;
|
|
238
|
-
}
|
|
239
|
-
catch (_err) {
|
|
240
|
-
// ignore JSON.parse errors
|
|
241
|
-
responseJson = null;
|
|
242
|
-
}
|
|
243
|
-
const isError = !response.ok || response.status >= 400;
|
|
244
|
-
if (isError) {
|
|
245
|
-
const errObj = {
|
|
246
|
-
message: (_x = (_w = (_v = (_u = (_t = responseJson === null || responseJson === void 0 ? void 0 : responseJson.output) === null || _t === void 0 ? void 0 : _t.message) !== null && _u !== void 0 ? _u : responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _v !== void 0 ? _v : responseJson) !== null && _w !== void 0 ? _w : responseBody) !== null && _x !== void 0 ? _x : response.statusText,
|
|
247
|
-
code: (_0 = (_z = (_y = responseJson === null || responseJson === void 0 ? void 0 : responseJson.output) === null || _y === void 0 ? void 0 : _y.code) !== null && _z !== void 0 ? _z : responseJson === null || responseJson === void 0 ? void 0 : responseJson.code) !== null && _0 !== void 0 ? _0 : response.status,
|
|
248
|
-
response,
|
|
249
|
-
};
|
|
250
|
-
throw errObj;
|
|
251
|
-
}
|
|
252
|
-
return responseJson;
|
|
253
|
-
}), retryConfig);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
function retry(work, config) {
|
|
257
|
-
var _a, _b;
|
|
258
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
let lastErr;
|
|
260
|
-
for (const attempt of Array.from({ length: ((_a = config.retries) !== null && _a !== void 0 ? _a : 0) + 1 }, (_, index) => index)) {
|
|
261
|
-
try {
|
|
262
|
-
return yield work(attempt);
|
|
263
|
-
}
|
|
264
|
-
catch (e) {
|
|
265
|
-
let isRetryable = false;
|
|
266
|
-
if ('response' in e) {
|
|
267
|
-
// error from API
|
|
268
|
-
const err = e;
|
|
269
|
-
isRetryable = config.retryOn.includes(err.code);
|
|
270
|
-
// Removes response
|
|
271
|
-
lastErr = { message: e.message, code: e.code };
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
lastErr = e;
|
|
275
|
-
// error from fetch
|
|
276
|
-
if ('code' in e && typeof e.code === 'string') {
|
|
277
|
-
const err = e;
|
|
278
|
-
isRetryable = ERROR_CODES_TO_RETRY.includes(err.code);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
if (!isRetryable) {
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
const jitter = Math.floor(Math.random() * (config.jitter + 1));
|
|
285
|
-
yield new Promise((resolve) => setTimeout(resolve, config.delay + jitter));
|
|
286
|
-
if (config.onRetry && attempt !== ((_b = config.retries) !== null && _b !== void 0 ? _b : 0)) {
|
|
287
|
-
config.onRetry(attempt + 1);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
throw lastErr;
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
/**
|
|
295
|
-
* Substitutes params in a path and returns the path with params substituted and any unused params.
|
|
296
|
-
*
|
|
297
|
-
* Uses the property names in the params object to determine the param to substitute in the path.
|
|
298
|
-
*
|
|
299
|
-
* @param path JSON API resource URI
|
|
300
|
-
* @param params all params provided to the client method
|
|
301
|
-
* @returns resource URI with params substituted and any unused params
|
|
302
|
-
*/
|
|
303
|
-
function subParamsInPath(path, params) {
|
|
304
|
-
const unusedParams = Object.assign({}, params);
|
|
305
|
-
// capture everything of the form `{paramName}` and replace with the value of `params[paramName]`
|
|
306
|
-
const subbedPath = path.replace(/\{([^}]+)\}/g, (_, paramName) => {
|
|
307
|
-
delete unusedParams[paramName];
|
|
308
|
-
// override for path params that are paths, indicated by a `+` at the end
|
|
309
|
-
if (paramName.match(/^.*\+$/)) {
|
|
310
|
-
return params[paramName] + '';
|
|
311
|
-
}
|
|
312
|
-
// error if param value is empty
|
|
313
|
-
if (!params[paramName] || params[paramName] === '') {
|
|
314
|
-
throw new OystehrSdkError({ message: `Required path parameter is an empty string: ${paramName}`, code: 400 });
|
|
315
|
-
}
|
|
316
|
-
// encode search params
|
|
317
|
-
if (params[paramName]) {
|
|
318
|
-
return encodeURIComponent(params[paramName] + ''); // coerce to string
|
|
319
|
-
}
|
|
320
|
-
return '';
|
|
321
|
-
});
|
|
322
|
-
const unusedKeys = Object.keys(unusedParams);
|
|
323
|
-
const addlParams = unusedKeys.length
|
|
324
|
-
? unusedKeys.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: unusedParams[key] })), {})
|
|
325
|
-
: {};
|
|
326
|
-
return [subbedPath, addlParams];
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Adds params to a URLSearchParams object in such a way as to preserve array values.
|
|
330
|
-
* @param params params
|
|
331
|
-
* @param search URLSearchParams object
|
|
332
|
-
*/
|
|
333
|
-
function addParamsToSearch(params, search) {
|
|
334
|
-
for (const [key, value] of Object.entries(params)) {
|
|
335
|
-
if (Array.isArray(value)) {
|
|
336
|
-
value.forEach((v) => search.append(key, v));
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
search.append(key, value);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
344
|
-
var _Application_instances, _Application_baseUrlThunk;
|
|
345
|
-
class Application extends SDKResource {
|
|
346
|
-
constructor(config) {
|
|
347
|
-
super(config);
|
|
348
|
-
_Application_instances.add(this);
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Get a list of Applications. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
|
|
352
|
-
*
|
|
353
|
-
* Access Policy Action: `App:ListAllApplications`
|
|
354
|
-
* Access Policy Resource: `App:Application`
|
|
355
|
-
*/
|
|
356
|
-
list(request) {
|
|
357
|
-
return this.request('/application', 'get', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(request);
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Create a new Application. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
|
|
361
|
-
*
|
|
362
|
-
* Access Policy Action: `App:CreateApplication`
|
|
363
|
-
* Access Policy Resource: `App:Application`
|
|
364
|
-
*/
|
|
365
|
-
create(params, request) {
|
|
366
|
-
return this.request('/application', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Get the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
|
|
370
|
-
*
|
|
371
|
-
* Access Policy Action: `App:GetApplication`
|
|
372
|
-
* Access Policy Resource: `App:Application`
|
|
373
|
-
*/
|
|
374
|
-
get(params, request) {
|
|
375
|
-
return this.request('/application/{id}', 'get', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* Update the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
|
|
379
|
-
*
|
|
380
|
-
* Access Policy Action: `App:UpdateApplication`
|
|
381
|
-
* Access Policy Resource: `App:Application`
|
|
382
|
-
*/
|
|
383
|
-
update(params, request) {
|
|
384
|
-
return this.request('/application/{id}', 'patch', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Delete the Application with the provided ID. [Applications](https://docs.oystehr.com/oystehr/services/app/applications/) provide authentication in front of the web and mobile apps you build on Oystehr.
|
|
388
|
-
*
|
|
389
|
-
* Access Policy Action: `App:DeleteApplication`
|
|
390
|
-
* Access Policy Resource: `App:Application`
|
|
391
|
-
*/
|
|
392
|
-
delete(params, request) {
|
|
393
|
-
return this.request('/application/{id}', 'delete', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Rotate client's secrete associated with an application.
|
|
397
|
-
*
|
|
398
|
-
* Access Policy Action: `App:RotateApplicationSecret`
|
|
399
|
-
* Access Policy Resource: `App:Application`
|
|
400
|
-
*/
|
|
401
|
-
rotateSecret(params, request) {
|
|
402
|
-
return this.request('/application/{id}/rotate-secret', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Revokes user's refresh token issued for the application.
|
|
406
|
-
*
|
|
407
|
-
* Access Policy Action: `App:RevokeRefreshToken`
|
|
408
|
-
* Access Policy Resource: `App:Application`
|
|
409
|
-
*/
|
|
410
|
-
revokeRefreshToken(params, request) {
|
|
411
|
-
return this.request('/application/{id}/revoke-refresh-token', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
412
|
-
}
|
|
413
|
-
/**
|
|
414
|
-
* Revokes user's access token issued for the application.
|
|
415
|
-
*
|
|
416
|
-
* Access Policy Action: `App:RevokeAccessToken`
|
|
417
|
-
* Access Policy Resource: `App:Application`
|
|
418
|
-
*/
|
|
419
|
-
revokeAccessToken(params, request) {
|
|
420
|
-
return this.request('/application/{id}/revoke-access-token', 'post', __classPrivateFieldGet(this, _Application_instances, "m", _Application_baseUrlThunk).bind(this))(params, request);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
_Application_instances = new WeakSet(), _Application_baseUrlThunk = function _Application_baseUrlThunk() {
|
|
424
|
-
var _a, _b;
|
|
425
|
-
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';
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
429
|
-
var _Charge_instances, _Charge_baseUrlThunk;
|
|
430
|
-
class Charge extends SDKResource {
|
|
431
|
-
constructor(config) {
|
|
432
|
-
super(config);
|
|
433
|
-
_Charge_instances.add(this);
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Charge patient's default payment method for a specified encounter or charge item.
|
|
437
|
-
*
|
|
438
|
-
* Access Policy Requirements:
|
|
439
|
-
* Action: `Payment:Issue`
|
|
440
|
-
* Access Policy Resource: `Payment:Charge`
|
|
441
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
442
|
-
* Access Policy Resource: `FHIR:ChargeItem:*,`FHIR:PaymentReconciliation:*`
|
|
443
|
-
* Action: `FHIR:Read`
|
|
444
|
-
* Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
|
|
445
|
-
*/
|
|
446
|
-
issue(params, request) {
|
|
447
|
-
return this.request('/payment/charge/issue', 'post', __classPrivateFieldGet(this, _Charge_instances, "m", _Charge_baseUrlThunk).bind(this))(params, request);
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Retrieve charge status for a specified encounter or charge item.
|
|
451
|
-
*
|
|
452
|
-
* Access Policy Requirements:
|
|
453
|
-
* Action: `Payment:Status`
|
|
454
|
-
* Access Policy Resource: `Payment:Charge`
|
|
455
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
456
|
-
* Access Policy Resource: `FHIR:ChargeItem:*,`FHIR:PaymentReconciliation:*`
|
|
457
|
-
* Action: `FHIR:Read`
|
|
458
|
-
* Access Policy Resources: `FHIR:Patient:*,FHIR:Encounter:*,FHIR:Coverage:*`
|
|
459
|
-
*/
|
|
460
|
-
status(params, request) {
|
|
461
|
-
return this.request('/payment/charge/status', 'post', __classPrivateFieldGet(this, _Charge_instances, "m", _Charge_baseUrlThunk).bind(this))(params, request);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
_Charge_instances = new WeakSet(), _Charge_baseUrlThunk = function _Charge_baseUrlThunk() {
|
|
465
|
-
var _a, _b;
|
|
466
|
-
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';
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
const ENCOUNTER_VS_EXTENSION_URL = 'https://extensions.fhir.zapehr.com/encounter-virtual-service-pre-release';
|
|
470
|
-
const ENCOUNTER_VS_EXTENSION_RELATIVE_URL = 'addressString';
|
|
471
|
-
const ENCOUNTER_VS_CODING_SYSTEM = 'https://fhir.zapehr.com/virtual-service-type';
|
|
472
|
-
function isR5Encounter(encounter) {
|
|
473
|
-
return Object.hasOwn(encounter, 'virtualService');
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Helper function to get a conversationId from an encounter created as an Oystehr Conversation
|
|
477
|
-
* @param encounter well-formed FHIR R4B or R5 Encounter
|
|
478
|
-
* @returns conversationId
|
|
479
|
-
*/
|
|
480
|
-
function getConversationIdFromEncounter(encounter) {
|
|
481
|
-
var _a, _b, _c;
|
|
482
|
-
if (isR5Encounter(encounter)) {
|
|
483
|
-
const virtualService = (_a = encounter.virtualService) === null || _a === void 0 ? void 0 : _a.find((vs) => { var _a; return ((_a = vs.channelType) === null || _a === void 0 ? void 0 : _a.system) === ENCOUNTER_VS_CODING_SYSTEM; });
|
|
484
|
-
return virtualService === null || virtualService === void 0 ? void 0 : virtualService.addressString;
|
|
485
|
-
}
|
|
486
|
-
if (!encounter.extension)
|
|
487
|
-
return;
|
|
488
|
-
const virtualServiceExtension = encounter.extension.find((extension) => extension.url === ENCOUNTER_VS_EXTENSION_URL);
|
|
489
|
-
if (!(virtualServiceExtension === null || virtualServiceExtension === void 0 ? void 0 : virtualServiceExtension.extension))
|
|
490
|
-
return;
|
|
491
|
-
const conversationId = (_c = (_b = virtualServiceExtension.extension) === null || _b === void 0 ? void 0 : _b.find((extension) => extension.url === ENCOUNTER_VS_EXTENSION_RELATIVE_URL)) === null || _c === void 0 ? void 0 : _c.valueString;
|
|
492
|
-
return conversationId;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
496
|
-
var _Conversation_instances, _Conversation_baseUrlThunk;
|
|
497
|
-
class Conversation extends SDKResource {
|
|
498
|
-
constructor(config) {
|
|
499
|
-
super(config);
|
|
500
|
-
_Conversation_instances.add(this);
|
|
501
|
-
this.ENCOUNTER_VS_EXTENSION_URL = ENCOUNTER_VS_EXTENSION_URL;
|
|
502
|
-
this.ENCOUNTER_VS_EXTENSION_RELATIVE_URL = ENCOUNTER_VS_EXTENSION_RELATIVE_URL;
|
|
503
|
-
/**
|
|
504
|
-
* Helper function to get a conversationId from an encounter created as an Oystehr Conversation
|
|
505
|
-
* @param encounter well-formed FHIR R4B or R5 Encounter
|
|
506
|
-
* @returns conversationId
|
|
507
|
-
*/
|
|
508
|
-
this.getConversationIdFromEncounter = getConversationIdFromEncounter;
|
|
509
|
-
}
|
|
510
|
-
/**
|
|
511
|
-
* Create a new Conversation. [Conversations](https://docs.oystehr.com/oystehr/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
|
|
512
|
-
*
|
|
513
|
-
* Access Policy Requirements:
|
|
514
|
-
* Action: `Messaging:CreateConversation`
|
|
515
|
-
* Access Policy Resource: `Messaging:Conversation`
|
|
516
|
-
* Action: `FHIR:Create`
|
|
517
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
518
|
-
* Action: `FHIR:Update`
|
|
519
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
520
|
-
*/
|
|
521
|
-
create(params, request) {
|
|
522
|
-
return this.request('/messaging/conversation', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Get a Conversation Token. Conversation Tokens are used to join the Conversation with the Twilio Conversations SDKs. [Conversations](https://docs.oystehr.com/oystehr/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
|
|
526
|
-
*
|
|
527
|
-
* Access Policy Action: `Messaging:GetConversationToken`
|
|
528
|
-
* Access Policy Resource: `Messaging:Conversation`.
|
|
529
|
-
*/
|
|
530
|
-
getToken(request) {
|
|
531
|
-
return this.request('/messaging/conversation/token', 'get', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(request);
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* Add a participant to a Conversation. [Conversations](https://docs.oystehr.com/oystehr/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
|
|
535
|
-
*
|
|
536
|
-
* Access Policy Requirements:
|
|
537
|
-
* Action: `Messaging:ConversationAddParticipant`
|
|
538
|
-
* Access Policy Resource: `Messaging:Conversation`
|
|
539
|
-
* Action: `FHIR:Read`
|
|
540
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
541
|
-
* Action: `FHIR:Update`
|
|
542
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
543
|
-
*/
|
|
544
|
-
addParticipant(params, request) {
|
|
545
|
-
return this.request('/messaging/conversation/{conversationId}/participant', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Remove a participant from a Conversation. [Conversations](https://docs.oystehr.com/oystehr/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
|
|
549
|
-
*
|
|
550
|
-
* Access Policy Requirements:
|
|
551
|
-
* Action: `Messaging:ConversationRemoveParticipant`
|
|
552
|
-
* Access Policy Resource: `Messaging:Conversation`
|
|
553
|
-
* Action: `FHIR:Read`
|
|
554
|
-
* Access Policy Resource: `FHIR:Patient`, `FHIR:Practitioner`, or `FHIR:RelatedPerson`
|
|
555
|
-
*/
|
|
556
|
-
removeParticipant(params, request) {
|
|
557
|
-
return this.request('/messaging/conversation/{conversationId}/participant', 'delete', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Send a message to a Conversation. [Conversations](https://docs.oystehr.com/oystehr/services/messaging/conversations/) allow you to build multi-channel bi-directional messaging workflows. For example, you might create a Conversation where a provider messages with a patient through a web app, and the patient receives and responds to messages via SMS on their phone.
|
|
561
|
-
*
|
|
562
|
-
* Access Policy Requirements:
|
|
563
|
-
* Action: `Messaging:ConversationSendMessage`
|
|
564
|
-
* Access Policy Resource: `Messaging:Conversation`
|
|
565
|
-
*/
|
|
566
|
-
message(params, request) {
|
|
567
|
-
return this.request('/messaging/conversation/{conversationId}/message', 'post', __classPrivateFieldGet(this, _Conversation_instances, "m", _Conversation_baseUrlThunk).bind(this))(params, request);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
_Conversation_instances = new WeakSet(), _Conversation_baseUrlThunk = function _Conversation_baseUrlThunk() {
|
|
571
|
-
var _a, _b;
|
|
572
|
-
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';
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
576
|
-
var _Developer_instances, _Developer_baseUrlThunk;
|
|
577
|
-
class Developer extends SDKResource {
|
|
578
|
-
constructor(config) {
|
|
579
|
-
super(config);
|
|
580
|
-
_Developer_instances.add(this);
|
|
581
|
-
}
|
|
582
|
-
/**
|
|
583
|
-
* Get the Developer with the provided ID. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
|
|
584
|
-
*
|
|
585
|
-
* Access Policy Action: `IAM:GetDeveloper`
|
|
586
|
-
* Access Policy Resource: `IAM:Developer`
|
|
587
|
-
*/
|
|
588
|
-
get(params, request) {
|
|
589
|
-
return this.request('/developer/{id}', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Update the Developer with the provided ID. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
|
|
593
|
-
*
|
|
594
|
-
* Access Policy Action: `IAM:UpdateDeveloper`
|
|
595
|
-
* Access Policy Resource: `IAM:Developer`
|
|
596
|
-
*/
|
|
597
|
-
update(params, request) {
|
|
598
|
-
return this.request('/developer/{id}', 'patch', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Remove the Developer with the provided ID from the project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
|
|
602
|
-
*
|
|
603
|
-
* Access Policy Action: `IAM:RemoveDeveloper`
|
|
604
|
-
* Access Policy Resource: `IAM:Developer`
|
|
605
|
-
*/
|
|
606
|
-
delete(params, request) {
|
|
607
|
-
return this.request('/developer/{id}', 'delete', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
|
|
608
|
-
}
|
|
609
|
-
/**
|
|
610
|
-
* Invite a new Developer to the Project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
|
|
611
|
-
*
|
|
612
|
-
* Access Policy Action: `IAM:InviteDeveloper`
|
|
613
|
-
* Access Policy Resource: `IAM:Developer`
|
|
614
|
-
*/
|
|
615
|
-
invite(params, request) {
|
|
616
|
-
return this.request('/developer/invite', 'post', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_developer-v2-list) instead.
|
|
620
|
-
*
|
|
621
|
-
* Get a list of all Developers who are part of the Project. Developer accounts are used to log into the [Developer Console](https://console.oystehr.com/) and administrate [Projects](https://docs.oystehr.com/oystehr/services/project/). [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/) are the only people who can belong to and act across multiple Projects, because they exist above the Project level.
|
|
622
|
-
*
|
|
623
|
-
* Access Policy Action: `IAM:ListAllDevelopers`
|
|
624
|
-
* Access Policy Resource: `IAM:Developer`
|
|
625
|
-
*/
|
|
626
|
-
list(request) {
|
|
627
|
-
return this.request('/developer', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(request);
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Get Developers 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.
|
|
631
|
-
*
|
|
632
|
-
* Access Policy Action: `Project:ListAllUsers`
|
|
633
|
-
* Access Policy Resource: `Project:Settings`
|
|
634
|
-
*/
|
|
635
|
-
listV2(params, request) {
|
|
636
|
-
return this.request('/developer/v2/list', 'get', __classPrivateFieldGet(this, _Developer_instances, "m", _Developer_baseUrlThunk).bind(this))(params, request);
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
_Developer_instances = new WeakSet(), _Developer_baseUrlThunk = function _Developer_baseUrlThunk() {
|
|
640
|
-
var _a, _b;
|
|
641
|
-
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';
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
645
|
-
var _Erx_instances, _Erx_baseUrlThunk;
|
|
646
|
-
class Erx extends SDKResource {
|
|
647
|
-
constructor(config) {
|
|
648
|
-
super(config);
|
|
649
|
-
_Erx_instances.add(this);
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Search for allergens.
|
|
653
|
-
*/
|
|
654
|
-
searchAllergens(params, request) {
|
|
655
|
-
return this.request('/allergen', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Search for medications.
|
|
659
|
-
*/
|
|
660
|
-
searchMedications(params, request) {
|
|
661
|
-
return this.request('/medication', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
662
|
-
}
|
|
663
|
-
/**
|
|
664
|
-
* Checks for drug-allergy interactions for a patient. This endpoint requires the patient's allergies to be synced with the upstream eRx provider.
|
|
665
|
-
*/
|
|
666
|
-
checkAllergyInteractions(params, request) {
|
|
667
|
-
return this.request('/patient/{patientId}/interactions/allergy', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
668
|
-
}
|
|
669
|
-
/**
|
|
670
|
-
* Checks for drug-drug interactions for a patient. This endpoint requires the patient's medications to be synced with the upstream eRx provider.
|
|
671
|
-
*/
|
|
672
|
-
checkMedicationInteractions(params, request) {
|
|
673
|
-
return this.request('/patient/{patientId}/interactions/medication', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Checks for drug-allergy and drug-drug interactions with a specific drug for a patient. This endpoint requires the patient's allergies and medications to be synced with the upstream eRx provider.
|
|
677
|
-
*/
|
|
678
|
-
checkPrecheckInteractions(params, request) {
|
|
679
|
-
return this.request('/patient/{patientId}/interactions/precheck/{drugId}', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Cancel prescription for patient.
|
|
683
|
-
*/
|
|
684
|
-
cancelPrescription(params, request) {
|
|
685
|
-
return this.request('/patient/{patientId}/prescriptions/{medicationRequestId}', 'delete', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Syncs demographic, allergy, and medication data for a patient with the upstream eRx provider.
|
|
689
|
-
*/
|
|
690
|
-
syncPatient(params, request) {
|
|
691
|
-
return this.request('/patient/{patientId}/sync', 'post', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Create an SSO link for a practitioner. This link can be used to log in to the eRx service as the specified practitioner.
|
|
695
|
-
*/
|
|
696
|
-
connectPractitioner(params, request) {
|
|
697
|
-
return this.request('/practitioner/connect', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* Check eRx enrollment for a practitioner.
|
|
701
|
-
*/
|
|
702
|
-
checkPractitionerEnrollment(params, request) {
|
|
703
|
-
return this.request('/practitioner/{practitionerId}', 'get', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
704
|
-
}
|
|
705
|
-
/**
|
|
706
|
-
* Enroll a practitioner in the eRx service.
|
|
707
|
-
*/
|
|
708
|
-
enrollPractitioner(params, request) {
|
|
709
|
-
return this.request('/practitioner/{practitionerId}', 'post', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
710
|
-
}
|
|
711
|
-
/**
|
|
712
|
-
* Unenroll a practitioner from the eRx service.
|
|
713
|
-
*/
|
|
714
|
-
unenrollPractitioner(params, request) {
|
|
715
|
-
return this.request('/practitioner/{practitionerId}', 'delete', __classPrivateFieldGet(this, _Erx_instances, "m", _Erx_baseUrlThunk).bind(this))(params, request);
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
_Erx_instances = new WeakSet(), _Erx_baseUrlThunk = function _Erx_baseUrlThunk() {
|
|
719
|
-
var _a, _b;
|
|
720
|
-
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['erxApiUrl']) !== null && _b !== void 0 ? _b : 'https://erx-api.zapehr.com/v3';
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
724
|
-
var _ErxV1_instances, _ErxV1_baseUrlThunk;
|
|
725
|
-
class ErxV1 extends SDKResource {
|
|
726
|
-
constructor(config) {
|
|
727
|
-
super(config);
|
|
728
|
-
_ErxV1_instances.add(this);
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Retrieve patient properties from FHIR service and sync them with eRx service
|
|
732
|
-
*/
|
|
733
|
-
syncPatient(params, request) {
|
|
734
|
-
return this.request('/erx/sync-patient/{patientId}', 'post', __classPrivateFieldGet(this, _ErxV1_instances, "m", _ErxV1_baseUrlThunk).bind(this))(params, request);
|
|
735
|
-
}
|
|
736
|
-
/**
|
|
737
|
-
* Search for allergies
|
|
738
|
-
*/
|
|
739
|
-
allergySearch(params, request) {
|
|
740
|
-
return this.request('/erx/allergy/search', 'get', __classPrivateFieldGet(this, _ErxV1_instances, "m", _ErxV1_baseUrlThunk).bind(this))(params, request);
|
|
741
|
-
}
|
|
742
|
-
/**
|
|
743
|
-
* Cancel photon order
|
|
744
|
-
*/
|
|
745
|
-
cancelOrder(params, request) {
|
|
746
|
-
return this.request('/erx/cancel-order', 'post', __classPrivateFieldGet(this, _ErxV1_instances, "m", _ErxV1_baseUrlThunk).bind(this))(params, request);
|
|
747
|
-
}
|
|
748
|
-
/**
|
|
749
|
-
* Cancel photon prescription
|
|
750
|
-
*/
|
|
751
|
-
cancelPrescription(params, request) {
|
|
752
|
-
return this.request('/erx/cancel-prescription', 'post', __classPrivateFieldGet(this, _ErxV1_instances, "m", _ErxV1_baseUrlThunk).bind(this))(params, request);
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Search for medications. Provide at least one of code or name filters
|
|
756
|
-
*/
|
|
757
|
-
medicationSearch(params, request) {
|
|
758
|
-
return this.request('/erx/medication/search', 'get', __classPrivateFieldGet(this, _ErxV1_instances, "m", _ErxV1_baseUrlThunk).bind(this))(params, request);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
_ErxV1_instances = new WeakSet(), _ErxV1_baseUrlThunk = function _ErxV1_baseUrlThunk() {
|
|
762
|
-
var _a, _b;
|
|
763
|
-
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';
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
767
|
-
var _ErxV2_instances, _ErxV2_baseUrlThunk;
|
|
768
|
-
class ErxV2 extends SDKResource {
|
|
769
|
-
constructor(config) {
|
|
770
|
-
super(config);
|
|
771
|
-
_ErxV2_instances.add(this);
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Search for medications. Provide at least one of code or name filters
|
|
775
|
-
*/
|
|
776
|
-
medicationSearch(params, request) {
|
|
777
|
-
return this.request('/erx/v2/medication/search', 'get', __classPrivateFieldGet(this, _ErxV2_instances, "m", _ErxV2_baseUrlThunk).bind(this))(params, request);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
_ErxV2_instances = new WeakSet(), _ErxV2_baseUrlThunk = function _ErxV2_baseUrlThunk() {
|
|
781
|
-
var _a, _b;
|
|
782
|
-
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';
|
|
783
|
-
};
|
|
784
|
-
|
|
785
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
786
|
-
var _Fax_instances, _Fax_baseUrlThunk;
|
|
787
|
-
class Fax extends SDKResource {
|
|
788
|
-
constructor(config) {
|
|
789
|
-
super(config);
|
|
790
|
-
_Fax_instances.add(this);
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/oystehr/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.
|
|
794
|
-
*
|
|
795
|
-
* Access Policy Requirements:
|
|
796
|
-
* Action: `Fax:Offboard`
|
|
797
|
-
* Access Policy Resource: `Fax:Number`
|
|
798
|
-
*/
|
|
799
|
-
offboard(request) {
|
|
800
|
-
return this.request('/offboard', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(request);
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/oystehr/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.
|
|
804
|
-
*
|
|
805
|
-
* Access Policy Requirements:
|
|
806
|
-
* Action: `Fax:Onboard`
|
|
807
|
-
* Access Policy Resource: `Fax:Number`
|
|
808
|
-
*/
|
|
809
|
-
onboard(request) {
|
|
810
|
-
return this.request('/onboard', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(request);
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
* Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/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.
|
|
814
|
-
*
|
|
815
|
-
* Access Policy Requirements:
|
|
816
|
-
* Action: `Fax:Send`
|
|
817
|
-
* Access Policy Resource: `Fax:Fax`
|
|
818
|
-
*/
|
|
819
|
-
send(params, request) {
|
|
820
|
-
return this.request('/send', 'post', __classPrivateFieldGet(this, _Fax_instances, "m", _Fax_baseUrlThunk).bind(this))(params, request);
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
_Fax_instances = new WeakSet(), _Fax_baseUrlThunk = function _Fax_baseUrlThunk() {
|
|
824
|
-
var _a, _b;
|
|
825
|
-
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['faxApiUrl']) !== null && _b !== void 0 ? _b : 'https://fax-api.zapehr.com/v1';
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Performs a FHIR search and returns the results as a Bundle resource
|
|
830
|
-
*
|
|
831
|
-
* @param options FHIR resource type and FHIR search parameters
|
|
832
|
-
* @param request optional OystehrClientRequest object
|
|
833
|
-
* @returns FHIR Bundle resource
|
|
834
|
-
*/
|
|
835
|
-
function search(params, request) {
|
|
836
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
837
|
-
const { resourceType, params: searchParams } = params;
|
|
838
|
-
let paramMap;
|
|
839
|
-
if (searchParams) {
|
|
840
|
-
paramMap = Object.entries(searchParams).reduce((acc, [_, param]) => {
|
|
841
|
-
if (!acc[param.name]) {
|
|
842
|
-
acc[param.name] = [];
|
|
843
|
-
}
|
|
844
|
-
acc[param.name].push(param.value);
|
|
845
|
-
return acc;
|
|
846
|
-
}, {});
|
|
847
|
-
}
|
|
848
|
-
const requestBundle = yield this.fhirRequest(`/${resourceType}/_search`, 'POST')(paramMap, Object.assign(Object.assign({}, request), { contentType: 'application/x-www-form-urlencoded' }));
|
|
849
|
-
const bundle = Object.assign(Object.assign({}, requestBundle), { entry: requestBundle.entry, unbundle: function () {
|
|
850
|
-
var _a, _b;
|
|
851
|
-
return (_b = (_a = this.entry) === null || _a === void 0 ? void 0 : _a.map((entry) => entry.resource).filter((entry) => entry !== undefined)) !== null && _b !== void 0 ? _b : [];
|
|
852
|
-
} });
|
|
853
|
-
return bundle;
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
function create(params, request) {
|
|
857
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
858
|
-
const { resourceType } = params;
|
|
859
|
-
return this.fhirRequest(`/${resourceType}`, 'POST')(params, request);
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
function get({ resourceType, id }, request) {
|
|
863
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
864
|
-
return this.fhirRequest(`/${resourceType}/${id}`, 'GET')({}, request);
|
|
865
|
-
});
|
|
866
|
-
}
|
|
867
|
-
function update(params, request) {
|
|
868
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
869
|
-
const { id, resourceType } = params;
|
|
870
|
-
return this.fhirRequest(`/${resourceType}/${id}`, 'PUT')(params, Object.assign(Object.assign({}, request), { ifMatch: (request === null || request === void 0 ? void 0 : request.optimisticLockingVersionId) ? `W/"${request.optimisticLockingVersionId}"` : undefined }));
|
|
871
|
-
});
|
|
872
|
-
}
|
|
873
|
-
function patch({ resourceType, id, operations }, request) {
|
|
874
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
875
|
-
return this.fhirRequest(`/${resourceType}/${id}`, 'PATCH')(operations, Object.assign(Object.assign({}, request), { contentType: 'application/json-patch+json', ifMatch: (request === null || request === void 0 ? void 0 : request.optimisticLockingVersionId) ? `W/"${request.optimisticLockingVersionId}"` : undefined }));
|
|
876
|
-
});
|
|
877
|
-
}
|
|
878
|
-
function del({ resourceType, id }, request) {
|
|
879
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
880
|
-
return this.fhirRequest(`/${resourceType}/${id}`, 'DELETE')({}, request);
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
function history({ resourceType, id, versionId }, request) {
|
|
884
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
885
|
-
return this.fhirRequest(`/${resourceType}/${id}/_history${versionId ? `/${versionId}` : ''}`, 'GET')({}, request);
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
function batchInputRequestToBundleEntryItem(request) {
|
|
889
|
-
const { method, url } = request;
|
|
890
|
-
const baseRequest = {
|
|
891
|
-
request: {
|
|
892
|
-
method,
|
|
893
|
-
url,
|
|
894
|
-
},
|
|
895
|
-
};
|
|
896
|
-
// Escape query string parameters in entry.request.url
|
|
897
|
-
if (url.split('?').length > 1) {
|
|
898
|
-
const [resource, query] = url.split('?');
|
|
899
|
-
const params = query
|
|
900
|
-
.split('&')
|
|
901
|
-
.map((param) => {
|
|
902
|
-
const [name, value] = param.split('=');
|
|
903
|
-
return { name, value };
|
|
904
|
-
})
|
|
905
|
-
.reduce((acc, { name, value }) => {
|
|
906
|
-
if (!name) {
|
|
907
|
-
return acc;
|
|
908
|
-
}
|
|
909
|
-
if (!acc[name]) {
|
|
910
|
-
acc[name] = [];
|
|
911
|
-
}
|
|
912
|
-
acc[name].push(value);
|
|
913
|
-
return acc;
|
|
914
|
-
}, {});
|
|
915
|
-
const search = new URLSearchParams();
|
|
916
|
-
addParamsToSearch(params, search);
|
|
917
|
-
baseRequest.request.url = `${resource}?${search.toString()}`;
|
|
918
|
-
}
|
|
919
|
-
// GET, DELETE, and HEAD require no further parameters
|
|
920
|
-
if (['GET', 'DELETE', 'HEAD'].includes(method)) {
|
|
921
|
-
return baseRequest;
|
|
922
|
-
}
|
|
923
|
-
// PUT updates require a full resource
|
|
924
|
-
if (method === 'PUT') {
|
|
925
|
-
const { resource } = request;
|
|
926
|
-
return Object.assign(Object.assign({}, baseRequest), { resource: resource });
|
|
927
|
-
}
|
|
928
|
-
// PATCH can be Binary resource or JSON patch
|
|
929
|
-
if (method === 'PATCH') {
|
|
930
|
-
if ('resource' in request) {
|
|
931
|
-
return Object.assign(Object.assign({}, baseRequest), { resource: request.resource });
|
|
932
|
-
}
|
|
933
|
-
return Object.assign(Object.assign({}, baseRequest), { resource: {
|
|
934
|
-
resourceType: 'Binary',
|
|
935
|
-
contentType: 'application/json-patch+json',
|
|
936
|
-
data: Buffer.from(JSON.stringify(request.operations), 'utf8').toString('base64'),
|
|
937
|
-
} });
|
|
938
|
-
}
|
|
939
|
-
// POST creates require a full resource
|
|
940
|
-
if (method === 'POST') {
|
|
941
|
-
const { resource, fullUrl } = request;
|
|
942
|
-
return Object.assign(Object.assign({}, baseRequest), { resource: resource, fullUrl });
|
|
943
|
-
}
|
|
944
|
-
throw new Error('Unrecognized method');
|
|
945
|
-
}
|
|
946
|
-
function bundleRequest(type) {
|
|
947
|
-
return function (input, request) {
|
|
948
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
949
|
-
return this.fhirRequest('/', 'POST')({
|
|
950
|
-
resourceType: 'Bundle',
|
|
951
|
-
type,
|
|
952
|
-
entry: input.requests.map(batchInputRequestToBundleEntryItem),
|
|
953
|
-
}, request);
|
|
954
|
-
});
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
|
-
const batch = bundleRequest('batch');
|
|
958
|
-
const transaction = bundleRequest('transaction');
|
|
959
|
-
function formatAddress(address, options) {
|
|
960
|
-
const builder = [];
|
|
961
|
-
if (address.line) {
|
|
962
|
-
builder.push(...address.line);
|
|
963
|
-
}
|
|
964
|
-
if (address.city || address.state || address.postalCode) {
|
|
965
|
-
const cityStateZip = [];
|
|
966
|
-
if (address.city) {
|
|
967
|
-
cityStateZip.push(address.city);
|
|
968
|
-
}
|
|
969
|
-
if (address.state) {
|
|
970
|
-
cityStateZip.push(address.state);
|
|
971
|
-
}
|
|
972
|
-
if (address.postalCode) {
|
|
973
|
-
cityStateZip.push(address.postalCode);
|
|
974
|
-
}
|
|
975
|
-
builder.push(cityStateZip.join(', '));
|
|
976
|
-
}
|
|
977
|
-
if (address.use && ((options === null || options === void 0 ? void 0 : options.all) || (options === null || options === void 0 ? void 0 : options.use))) {
|
|
978
|
-
builder.push('[' + address.use + ']');
|
|
979
|
-
}
|
|
980
|
-
return builder.join((options === null || options === void 0 ? void 0 : options.lineSeparator) || ', ').trim();
|
|
981
|
-
}
|
|
982
|
-
function formatHumanName(name, options) {
|
|
983
|
-
const builder = [];
|
|
984
|
-
if (name.prefix && (options === null || options === void 0 ? void 0 : options.prefix) !== false) {
|
|
985
|
-
builder.push(...name.prefix);
|
|
986
|
-
}
|
|
987
|
-
if (name.given) {
|
|
988
|
-
builder.push(...name.given);
|
|
989
|
-
}
|
|
990
|
-
if (name.family) {
|
|
991
|
-
builder.push(name.family);
|
|
992
|
-
}
|
|
993
|
-
if (name.suffix && (options === null || options === void 0 ? void 0 : options.suffix) !== false) {
|
|
994
|
-
builder.push(...name.suffix);
|
|
995
|
-
}
|
|
996
|
-
if (name.use && ((options === null || options === void 0 ? void 0 : options.all) || (options === null || options === void 0 ? void 0 : options.use))) {
|
|
997
|
-
builder.push('[' + name.use + ']');
|
|
998
|
-
}
|
|
999
|
-
return builder.join(' ').trim();
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1003
|
-
var _Fhir_instances;
|
|
1004
|
-
class Fhir extends SDKResource {
|
|
1005
|
-
constructor(config) {
|
|
1006
|
-
super(config);
|
|
1007
|
-
_Fhir_instances.add(this);
|
|
1008
|
-
/**
|
|
1009
|
-
* Performs a FHIR search and returns the results as a Bundle resource
|
|
1010
|
-
* @param options FHIR resource type and FHIR search parameters
|
|
1011
|
-
* @param request optional OystehrClientRequest object
|
|
1012
|
-
* @returns FHIR Bundle resource
|
|
1013
|
-
*/
|
|
1014
|
-
this.search = search;
|
|
1015
|
-
this.create = create;
|
|
1016
|
-
this.get = get;
|
|
1017
|
-
this.update = update;
|
|
1018
|
-
this.patch = patch;
|
|
1019
|
-
this.delete = del;
|
|
1020
|
-
this.history = history;
|
|
1021
|
-
this.batch = batch;
|
|
1022
|
-
this.transaction = transaction;
|
|
1023
|
-
this.formatAddress = formatAddress;
|
|
1024
|
-
this.formatHumanName = formatHumanName;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
_Fhir_instances = new WeakSet();
|
|
1028
|
-
|
|
1029
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1030
|
-
var _Lab_instances, _Lab_baseUrlThunk;
|
|
1031
|
-
class Lab extends SDKResource {
|
|
1032
|
-
constructor(config) {
|
|
1033
|
-
super(config);
|
|
1034
|
-
_Lab_instances.add(this);
|
|
1035
|
-
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Gets a list of Routes associated with the project. Returns an empty list if no Routes are found.
|
|
1038
|
-
*
|
|
1039
|
-
* Access Policy Requirements:
|
|
1040
|
-
* Action: `Lab:GetRoutes`
|
|
1041
|
-
* Access Policy Resource: `Lab:Route`
|
|
1042
|
-
*/
|
|
1043
|
-
routeList(request) {
|
|
1044
|
-
return this.request('/route', 'get', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(request);
|
|
1045
|
-
}
|
|
1046
|
-
/**
|
|
1047
|
-
* Create a route. A Route represents that a lab and particular customer have a relationship, and a Route is necessary to submit an order to a lab. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) for more details.
|
|
1048
|
-
*
|
|
1049
|
-
* Access Policy Requirements:
|
|
1050
|
-
* Action: `Lab:CreateRoute`
|
|
1051
|
-
* Access Policy Resource: `Lab:Route`
|
|
1052
|
-
*/
|
|
1053
|
-
routeCreate(params, request) {
|
|
1054
|
-
return this.request('/route', 'post', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(params, request);
|
|
1055
|
-
}
|
|
1056
|
-
/**
|
|
1057
|
-
* Delete a route. Deleting a Route will permanently remove the `routeGuid`. Orders can no longer be submitted to this lab until a new Route is created. See [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#delete-route) for more details.
|
|
1058
|
-
*
|
|
1059
|
-
* Access Policy Requirements:
|
|
1060
|
-
* Action: `Lab:DeleteRoute`
|
|
1061
|
-
* Access Policy Resource: `Lab:Route`
|
|
1062
|
-
*/
|
|
1063
|
-
routeDelete(params, request) {
|
|
1064
|
-
return this.request('/route/{routeGuid}', 'delete', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(params, request);
|
|
1065
|
-
}
|
|
1066
|
-
/**
|
|
1067
|
-
* Returns list of active orderable items for the latest compendium version. Page size is default 25 and max 100 items. See [orderable item Search](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#orderable-item-search) for more details.
|
|
1068
|
-
*
|
|
1069
|
-
* Access Policy Requirements:
|
|
1070
|
-
* Action: `Lab:SearchOrderableItems`
|
|
1071
|
-
* Access Policy Resource: `Lab:OrderableItem`
|
|
1072
|
-
*/
|
|
1073
|
-
orderableItemList(params, request) {
|
|
1074
|
-
return this.request('/orderableItem', 'get', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(params, request);
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* Retrieve the AOE (Answer on Entry) Questionnaire for the given orderable item. The orderable item is defined by its labGuid, compendiumVersion, and itemCode. See [AOE](https://docs.oystehr.com/oystehr/services/lab/explore-the-compendium/#AOE) for more details.
|
|
1078
|
-
*
|
|
1079
|
-
* Access Policy Requirements:
|
|
1080
|
-
* Action: `Lab:SearchOrderableItems`
|
|
1081
|
-
* Access Policy Resource: `Lab:OrderableItem`
|
|
1082
|
-
*/
|
|
1083
|
-
orderableItemQuestionnaireGet(params, request) {
|
|
1084
|
-
return this.request('/canonical-questionnaire/lab/{labGuid}/compendium/{compendiumVersion}/item/{itemCode}/questionnaire', 'get', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(params, request);
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* Submit a lab order. Oystehr's [Submit Lab](https://docs.oystehr.com/oystehr/services/lab/submit-an-order/) feature allows users to submit a well configured ServiceRequest to an external lab. In order to successfully submit an order, a [Route](https://docs.oystehr.com/oystehr/services/lab/onboarding-a-lab/#create-route) to and Organization representing that lab must exist.
|
|
1088
|
-
*
|
|
1089
|
-
* Access Policy Requirements:
|
|
1090
|
-
* Action: `Lab:SubmitOrder`
|
|
1091
|
-
* Access Policy Resource: `Lab:Order`
|
|
1092
|
-
*/
|
|
1093
|
-
orderSubmit(params, request) {
|
|
1094
|
-
return this.request('/submit', 'post', __classPrivateFieldGet(this, _Lab_instances, "m", _Lab_baseUrlThunk).bind(this))(params, request);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
_Lab_instances = new WeakSet(), _Lab_baseUrlThunk = function _Lab_baseUrlThunk() {
|
|
1098
|
-
var _a, _b;
|
|
1099
|
-
return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['labApiUrl']) !== null && _b !== void 0 ? _b : 'https://labs-api.zapehr.com/v1';
|
|
1100
|
-
};
|
|
1101
|
-
|
|
1102
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1103
|
-
var _M2m_instances, _M2m_baseUrlThunk;
|
|
1104
|
-
class M2m extends SDKResource {
|
|
1105
|
-
constructor(config) {
|
|
1106
|
-
super(config);
|
|
1107
|
-
_M2m_instances.add(this);
|
|
1108
|
-
}
|
|
1109
|
-
/**
|
|
1110
|
-
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_m2m-v2-list) instead.
|
|
1111
|
-
*
|
|
1112
|
-
* Get a list of all M2M Clients. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1113
|
-
*
|
|
1114
|
-
* Access Policy Action: `App:ListAllM2MClients`
|
|
1115
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1116
|
-
*/
|
|
1117
|
-
list(request) {
|
|
1118
|
-
return this.request('/m2m', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(request);
|
|
1119
|
-
}
|
|
1120
|
-
/**
|
|
1121
|
-
* Create a new M2M Client. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1122
|
-
*
|
|
1123
|
-
* Access Policy Action: `App:CreateM2MClient`
|
|
1124
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1125
|
-
*/
|
|
1126
|
-
create(params, request) {
|
|
1127
|
-
return this.request('/m2m', 'post', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1128
|
-
}
|
|
1129
|
-
/**
|
|
1130
|
-
* Get the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1131
|
-
*
|
|
1132
|
-
* Access Policy Action: `App:GetM2MClient`
|
|
1133
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1134
|
-
*/
|
|
1135
|
-
get(params, request) {
|
|
1136
|
-
return this.request('/m2m/{id}', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1137
|
-
}
|
|
1138
|
-
/**
|
|
1139
|
-
* Update the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1140
|
-
*
|
|
1141
|
-
* Access Policy Action: `App:UpdateM2MClient`
|
|
1142
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1143
|
-
*/
|
|
1144
|
-
update(params, request) {
|
|
1145
|
-
return this.request('/m2m/{id}', 'patch', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1146
|
-
}
|
|
1147
|
-
/**
|
|
1148
|
-
* Delete the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1149
|
-
*
|
|
1150
|
-
* Access Policy Action: `App:DeleteM2MClient`
|
|
1151
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1152
|
-
*/
|
|
1153
|
-
delete(params, request) {
|
|
1154
|
-
return this.request('/m2m/{id}', 'delete', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1155
|
-
}
|
|
1156
|
-
/**
|
|
1157
|
-
* Rotate the client secret for the M2M Client with the provided ID. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1158
|
-
*
|
|
1159
|
-
* Access Policy Action: `App:RotateM2MClientSecret`
|
|
1160
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1161
|
-
*/
|
|
1162
|
-
rotateSecret(params, request) {
|
|
1163
|
-
return this.request('/m2m/{id}/rotate-secret', 'post', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1164
|
-
}
|
|
1165
|
-
/**
|
|
1166
|
-
* Get M2M clients in the Project with pagination, sort, sort order and filtering. [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients) are used to access Oystehr APIs from scripts and server-side code like [Zambda Functions](https://docs.oystehr.com/oystehr/services/zambda).
|
|
1167
|
-
*
|
|
1168
|
-
* Access Policy Action: `App:ListAllM2MClients`
|
|
1169
|
-
* Access Policy Resource: `IAM:M2MClient`
|
|
1170
|
-
*/
|
|
1171
|
-
listV2(params, request) {
|
|
1172
|
-
return this.request('/m2m/v2/list', 'get', __classPrivateFieldGet(this, _M2m_instances, "m", _M2m_baseUrlThunk).bind(this))(params, request);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
_M2m_instances = new WeakSet(), _M2m_baseUrlThunk = function _M2m_baseUrlThunk() {
|
|
1176
|
-
var _a, _b;
|
|
1177
|
-
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';
|
|
1178
|
-
};
|
|
1179
|
-
|
|
1180
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1181
|
-
var _Messaging_instances, _Messaging_baseUrlThunk;
|
|
1182
|
-
class Messaging extends SDKResource {
|
|
1183
|
-
constructor(config) {
|
|
1184
|
-
super(config);
|
|
1185
|
-
_Messaging_instances.add(this);
|
|
1186
|
-
}
|
|
1187
|
-
/**
|
|
1188
|
-
* Get an information about the Messaging services configuration. This information includes phone number, phone number type and also rate limits of each service.
|
|
1189
|
-
*/
|
|
1190
|
-
getMessagingConfig(request) {
|
|
1191
|
-
return this.request('/messaging/config', 'get', __classPrivateFieldGet(this, _Messaging_instances, "m", _Messaging_baseUrlThunk).bind(this))(request);
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
_Messaging_instances = new WeakSet(), _Messaging_baseUrlThunk = function _Messaging_baseUrlThunk() {
|
|
1195
|
-
var _a, _b;
|
|
1196
|
-
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';
|
|
1197
|
-
};
|
|
1198
|
-
|
|
1199
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1200
|
-
var _PaymentMethod_instances, _PaymentMethod_baseUrlThunk;
|
|
1201
|
-
class PaymentMethod extends SDKResource {
|
|
1202
|
-
constructor(config) {
|
|
1203
|
-
super(config);
|
|
1204
|
-
_PaymentMethod_instances.add(this);
|
|
1205
|
-
}
|
|
1206
|
-
/**
|
|
1207
|
-
* Enter a new credit card or other payment method for the user.
|
|
1208
|
-
*
|
|
1209
|
-
* Access Policy Requirements:
|
|
1210
|
-
* Action: `Payment:Setup`
|
|
1211
|
-
* Access Policy Resource: `Payment:PaymentMethod`
|
|
1212
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1213
|
-
* Access Policy Resource: `FHIR:Coverage:*`
|
|
1214
|
-
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1215
|
-
* Access Policy Resource: `FHIR:Account:*`
|
|
1216
|
-
*
|
|
1217
|
-
* Also need to be able to read the patients' details. For example:
|
|
1218
|
-
* Action: `FHIR:Read`
|
|
1219
|
-
* Access Policy Resource: `FHIR:Patient`
|
|
1220
|
-
*/
|
|
1221
|
-
setUp(params, request) {
|
|
1222
|
-
return this.request('/payment/payment-method/setup', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
|
|
1223
|
-
}
|
|
1224
|
-
/**
|
|
1225
|
-
* Set a specified payment method for the user as default.
|
|
1226
|
-
*
|
|
1227
|
-
* Access Policy Requirements:
|
|
1228
|
-
* Action: `Payment:SetDefault`
|
|
1229
|
-
* Access Policy Resource: `Payment:PaymentMethod`
|
|
1230
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1231
|
-
* Access Policy Resource: `FHIR:Coverage:*`
|
|
1232
|
-
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1233
|
-
* Access Policy Resource: `FHIR:Account:*`
|
|
1234
|
-
*
|
|
1235
|
-
* Also need to be able to read the patients' details. For example:
|
|
1236
|
-
* Action: `FHIR:Read`
|
|
1237
|
-
* Access Policy Resource: `FHIR:Patient`
|
|
1238
|
-
*/
|
|
1239
|
-
setDefault(params, request) {
|
|
1240
|
-
return this.request('/payment/payment-method/set-default', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
|
|
1241
|
-
}
|
|
1242
|
-
/**
|
|
1243
|
-
* Delete a specified payment method for the beneficiary.
|
|
1244
|
-
*
|
|
1245
|
-
* Access Policy Requirements:
|
|
1246
|
-
* Action: `Payment:Delete`
|
|
1247
|
-
* Access Policy Resource: `Payment:PaymentMethod`
|
|
1248
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1249
|
-
* Access Policy Resource: `FHIR:Coverage:*`
|
|
1250
|
-
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1251
|
-
* Access Policy Resource: `FHIR:Account:*`
|
|
1252
|
-
*
|
|
1253
|
-
* Also need to be able to read the patients' details. For example:
|
|
1254
|
-
* Action: `FHIR:Read`
|
|
1255
|
-
* Access Policy Resource: `FHIR:Patient`
|
|
1256
|
-
*/
|
|
1257
|
-
delete(params, request) {
|
|
1258
|
-
return this.request('/payment/payment-method', 'delete', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* List all payment methods for the patient.
|
|
1262
|
-
*
|
|
1263
|
-
* Access Policy Requirements:
|
|
1264
|
-
* Action: `Payment:Setup`
|
|
1265
|
-
* Access Policy Resource: `Payment:PaymentMethod`
|
|
1266
|
-
* Actions: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1267
|
-
* Access Policy Resource: `FHIR:Coverage:*`
|
|
1268
|
-
* Action: `FHIR:Read,FHIR:Create,FHIR:Update`
|
|
1269
|
-
* Access Policy Resource: `FHIR:Account:*`
|
|
1270
|
-
*
|
|
1271
|
-
* Also need to be able to read the patients' details. For example:
|
|
1272
|
-
* Action: `FHIR:Read`
|
|
1273
|
-
* Access Policy Resource: `FHIR:Patient`
|
|
1274
|
-
*/
|
|
1275
|
-
list(params, request) {
|
|
1276
|
-
return this.request('/payment/payment-method/list', 'post', __classPrivateFieldGet(this, _PaymentMethod_instances, "m", _PaymentMethod_baseUrlThunk).bind(this))(params, request);
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
_PaymentMethod_instances = new WeakSet(), _PaymentMethod_baseUrlThunk = function _PaymentMethod_baseUrlThunk() {
|
|
1280
|
-
var _a, _b;
|
|
1281
|
-
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';
|
|
1282
|
-
};
|
|
1283
|
-
|
|
1284
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1285
|
-
var _Project_instances, _Project_baseUrlThunk;
|
|
1286
|
-
class Project extends SDKResource {
|
|
1287
|
-
constructor(config) {
|
|
1288
|
-
super(config);
|
|
1289
|
-
_Project_instances.add(this);
|
|
1290
|
-
}
|
|
1291
|
-
/**
|
|
1292
|
-
* Get the Project settings for a Project. Developers must specify a [project ID](https://docs.oystehr.com/oystehr/core-documentation/authenticating-api-requests/#x-oystehr-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/oystehr/services/project/) are completely independent from each other, having their own separate [FHIR store](https://docs.oystehr.com/oystehr/services/fhir/basics/), [Applications](https://docs.oystehr.com/oystehr/services/app/applications/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), etc .
|
|
1293
|
-
*
|
|
1294
|
-
* Access Policy Action: `Project:GetProjectInfo`
|
|
1295
|
-
* Access Policy Resource: `Project:Settings`
|
|
1296
|
-
*/
|
|
1297
|
-
get(request) {
|
|
1298
|
-
return this.request('/project', 'get', __classPrivateFieldGet(this, _Project_instances, "m", _Project_baseUrlThunk).bind(this))(request);
|
|
1299
|
-
}
|
|
1300
|
-
/**
|
|
1301
|
-
* Update the Project settings for the Project that corresponds to the project-id in the request header. A [Project](https://docs.oystehr.com/oystehr/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/oystehr/services/fhir/basics/), [Applications](https://docs.oystehr.com/oystehr/services/app/applications/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), etc .
|
|
1302
|
-
*
|
|
1303
|
-
* Access Policy Action: `Project:UpdateProjectInfo`
|
|
1304
|
-
* Access Policy Resource: `Project:Settings`
|
|
1305
|
-
*/
|
|
1306
|
-
update(params, request) {
|
|
1307
|
-
return this.request('/project', 'patch', __classPrivateFieldGet(this, _Project_instances, "m", _Project_baseUrlThunk).bind(this))(params, request);
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
_Project_instances = new WeakSet(), _Project_baseUrlThunk = function _Project_baseUrlThunk() {
|
|
1311
|
-
var _a, _b;
|
|
1312
|
-
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';
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1316
|
-
var _Rcm_instances, _Rcm_baseUrlThunk;
|
|
1317
|
-
class Rcm extends SDKResource {
|
|
1318
|
-
constructor(config) {
|
|
1319
|
-
super(config);
|
|
1320
|
-
_Rcm_instances.add(this);
|
|
1321
|
-
}
|
|
1322
|
-
/**
|
|
1323
|
-
* Check [Insurance Eligibility](https://docs.oystehr.com/oystehr/services/rcm/eligibility/).
|
|
1324
|
-
*
|
|
1325
|
-
* Access Policy Action: `RCM:CheckInsuranceEligibility`
|
|
1326
|
-
* Access Policy Resource: `RCM:InsuranceEligibility`
|
|
1327
|
-
*
|
|
1328
|
-
* Access Policy Action: `FHIR:Create`
|
|
1329
|
-
* Access Policy Resource: `FHIR:CoverageEligibilityResponse`
|
|
1330
|
-
*/
|
|
1331
|
-
eligibilityCheck(params, request) {
|
|
1332
|
-
return this.request('/rcm/eligibility-check', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
|
|
1333
|
-
}
|
|
1334
|
-
/**
|
|
1335
|
-
* Check [Validate Professional Claim](https://docs.oystehr.com/oystehr/services/rcm/professional-claim-submission/).
|
|
1336
|
-
*
|
|
1337
|
-
* Access Policy Action: `RCM:ValidateProfessionalClaim`
|
|
1338
|
-
* Access Policy Resource: `RCM:Claim`
|
|
1339
|
-
*
|
|
1340
|
-
* Access Policy Action: `FHIR:Create`
|
|
1341
|
-
* Access Policy Resource: `FHIR:AuditEvent`
|
|
1342
|
-
*/
|
|
1343
|
-
validateProfessionalClaim(params, request) {
|
|
1344
|
-
return this.request('/rcm/professional-claim/validate', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
|
|
1345
|
-
}
|
|
1346
|
-
/**
|
|
1347
|
-
* Check [Submit Professional Claim](https://docs.oystehr.com/oystehr/services/rcm/professional-claim-submission/).
|
|
1348
|
-
*
|
|
1349
|
-
* Access Policy Action: `RCM:SubmitProfessionalClaim`
|
|
1350
|
-
* Access Policy Resource: `RCM:Claim`
|
|
1351
|
-
*
|
|
1352
|
-
* Access Policy Action: `FHIR:Create`
|
|
1353
|
-
* Access Policy Resource: `FHIR:AuditEvent`
|
|
1354
|
-
*
|
|
1355
|
-
* Access Policy Actions: `FHIR:Create, FHIR:Update`
|
|
1356
|
-
* Access Policy Resource: `FHIR:Claim`
|
|
1357
|
-
*/
|
|
1358
|
-
submitProfessionalClaim(params, request) {
|
|
1359
|
-
return this.request('/rcm/professional-claim/submit', 'post', __classPrivateFieldGet(this, _Rcm_instances, "m", _Rcm_baseUrlThunk).bind(this))(params, request);
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
_Rcm_instances = new WeakSet(), _Rcm_baseUrlThunk = function _Rcm_baseUrlThunk() {
|
|
1363
|
-
var _a, _b;
|
|
1364
|
-
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';
|
|
1365
|
-
};
|
|
1366
|
-
|
|
1367
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1368
|
-
var _Role_instances, _Role_baseUrlThunk;
|
|
1369
|
-
class Role extends SDKResource {
|
|
1370
|
-
constructor(config) {
|
|
1371
|
-
super(config);
|
|
1372
|
-
_Role_instances.add(this);
|
|
1373
|
-
}
|
|
1374
|
-
/**
|
|
1375
|
-
* Get a list of all Roles. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
|
|
1376
|
-
*
|
|
1377
|
-
* Access Policy Action: `IAM:ListAllRoles`
|
|
1378
|
-
* Access Policy Resource: `IAM:Role`
|
|
1379
|
-
*/
|
|
1380
|
-
list(request) {
|
|
1381
|
-
return this.request('/iam/role', 'get', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(request);
|
|
1382
|
-
}
|
|
1383
|
-
/**
|
|
1384
|
-
* Create a new Role. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
|
|
1385
|
-
*
|
|
1386
|
-
* Access Policy Action: `IAM:CreateRole`
|
|
1387
|
-
* Access Policy Resource: `IAM:Role`
|
|
1388
|
-
*/
|
|
1389
|
-
create(params, request) {
|
|
1390
|
-
return this.request('/iam/role', 'post', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
|
|
1391
|
-
}
|
|
1392
|
-
/**
|
|
1393
|
-
* Get the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
|
|
1394
|
-
*
|
|
1395
|
-
* Access Policy Action: `IAM:GetRole`
|
|
1396
|
-
* Access Policy Resource: `IAM:Role`
|
|
1397
|
-
*/
|
|
1398
|
-
get(params, request) {
|
|
1399
|
-
return this.request('/iam/role/{roleId}', 'get', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* Update the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
|
|
1403
|
-
*
|
|
1404
|
-
* Access Policy Action: `IAM:UpdateRole`
|
|
1405
|
-
* Access Policy Resource: `IAM:Role`
|
|
1406
|
-
*/
|
|
1407
|
-
update(params, request) {
|
|
1408
|
-
return this.request('/iam/role/{roleId}', 'patch', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
|
|
1409
|
-
}
|
|
1410
|
-
/**
|
|
1411
|
-
* Delete the Role with the provided ID. A [Role](https://docs.oystehr.com/oystehr/services/iam/roles/) defines an access policy that can be assigned to any number of [Developers](https://docs.oystehr.com/oystehr/services/iam/developers/), [Users](https://docs.oystehr.com/oystehr/services/app/users/), and [M2M Clients](https://docs.oystehr.com/oystehr/services/iam/m2m-clients/).
|
|
1412
|
-
*
|
|
1413
|
-
* Access Policy Action: `IAM:DeleteRole`
|
|
1414
|
-
* Access Policy Resource: `IAM:Role`
|
|
1415
|
-
* Will fail if any entities hold the Role or if Role is assigned as the default patient role for the project
|
|
1416
|
-
*/
|
|
1417
|
-
delete(params, request) {
|
|
1418
|
-
return this.request('/iam/role/{roleId}', 'delete', __classPrivateFieldGet(this, _Role_instances, "m", _Role_baseUrlThunk).bind(this))(params, request);
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
_Role_instances = new WeakSet(), _Role_baseUrlThunk = function _Role_baseUrlThunk() {
|
|
1422
|
-
var _a, _b;
|
|
1423
|
-
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';
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1427
|
-
var _Secret_instances, _Secret_baseUrlThunk;
|
|
1428
|
-
class Secret extends SDKResource {
|
|
1429
|
-
constructor(config) {
|
|
1430
|
-
super(config);
|
|
1431
|
-
_Secret_instances.add(this);
|
|
1432
|
-
}
|
|
1433
|
-
/**
|
|
1434
|
-
* Get a list of all secrets in the Project.
|
|
1435
|
-
*
|
|
1436
|
-
* Access Policy Action: `Zambda:ListAllSecrets`
|
|
1437
|
-
* Access Policy Resource: `Zambda:Secret`
|
|
1438
|
-
*/
|
|
1439
|
-
list(request) {
|
|
1440
|
-
return this.request('/secret', 'get', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(request);
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Create a secret for a project. If the secret is already defined, update it.
|
|
1444
|
-
*
|
|
1445
|
-
* Access Policy Action: `Zambda:CreateSecret`
|
|
1446
|
-
* Access Policy Resource: `Zambda:Secret`
|
|
1447
|
-
*/
|
|
1448
|
-
set(params, request) {
|
|
1449
|
-
return this.request('/secret', 'post', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
|
|
1450
|
-
}
|
|
1451
|
-
/**
|
|
1452
|
-
* Get the secret with the provided name.
|
|
1453
|
-
*
|
|
1454
|
-
* Access Policy Action: `Zambda:GetSecret`
|
|
1455
|
-
* Access Policy Resource: `Zambda:Secret`
|
|
1456
|
-
*/
|
|
1457
|
-
get(params, request) {
|
|
1458
|
-
return this.request('/secret/{name}', 'get', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
|
|
1459
|
-
}
|
|
1460
|
-
/**
|
|
1461
|
-
* Delete the secret with the provided name.
|
|
1462
|
-
*
|
|
1463
|
-
* Access Policy Action: `Zambda:DeleteSecret`
|
|
1464
|
-
* Access Policy Resource: `Zambda:Secret`
|
|
1465
|
-
*/
|
|
1466
|
-
delete(params, request) {
|
|
1467
|
-
return this.request('/secret/{name}', 'delete', __classPrivateFieldGet(this, _Secret_instances, "m", _Secret_baseUrlThunk).bind(this))(params, request);
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
_Secret_instances = new WeakSet(), _Secret_baseUrlThunk = function _Secret_baseUrlThunk() {
|
|
1471
|
-
var _a, _b;
|
|
1472
|
-
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';
|
|
1473
|
-
};
|
|
1474
|
-
|
|
1475
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1476
|
-
var _Telemed_instances, _Telemed_baseUrlThunk;
|
|
1477
|
-
class Telemed extends SDKResource {
|
|
1478
|
-
constructor(config) {
|
|
1479
|
-
super(config);
|
|
1480
|
-
_Telemed_instances.add(this);
|
|
1481
|
-
}
|
|
1482
|
-
/**
|
|
1483
|
-
* Create a [telemedicine video meeting](https://docs.oystehr.com/oystehr/services/telemed/).
|
|
1484
|
-
*
|
|
1485
|
-
* Access Policy Requirements:
|
|
1486
|
-
* Action: `Telemed:CreateMeeting`
|
|
1487
|
-
* Access Policy Resource: `Telemed:Meeting`
|
|
1488
|
-
* Action: `FHIR:Create`
|
|
1489
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
1490
|
-
* Action: `FHIR:Update`
|
|
1491
|
-
* Access Policy Resource: `FHIR:Encounter`
|
|
1492
|
-
*/
|
|
1493
|
-
createMeeting(params, request) {
|
|
1494
|
-
return this.request('/telemed/v2/meeting', 'post', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* Get Meeting and Attendee objects necessary to join a telemedicine video meeting.
|
|
1498
|
-
*
|
|
1499
|
-
* Access Policy Requirements:
|
|
1500
|
-
* Action: `Telemed:JoinMeeting`
|
|
1501
|
-
* Access Policy Resource: `Telemed:Meeting`
|
|
1502
|
-
* To use M2M token to join as anonymous user:
|
|
1503
|
-
* Action: `Telemed:AddAnonymousToMeeting`
|
|
1504
|
-
* Access Policy Resource: `Telemed:Meeting`
|
|
1505
|
-
*/
|
|
1506
|
-
joinMeeting(params, request) {
|
|
1507
|
-
return this.request('/telemed/v2/meeting/{encounterId}/join', 'get', __classPrivateFieldGet(this, _Telemed_instances, "m", _Telemed_baseUrlThunk).bind(this))(params, request);
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
_Telemed_instances = new WeakSet(), _Telemed_baseUrlThunk = function _Telemed_baseUrlThunk() {
|
|
1511
|
-
var _a, _b;
|
|
1512
|
-
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';
|
|
1513
|
-
};
|
|
1514
|
-
|
|
1515
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1516
|
-
var _TransactionalSMS_instances, _TransactionalSMS_baseUrlThunk;
|
|
1517
|
-
class TransactionalSMS extends SDKResource {
|
|
1518
|
-
constructor(config) {
|
|
1519
|
-
super(config);
|
|
1520
|
-
_TransactionalSMS_instances.add(this);
|
|
1521
|
-
}
|
|
1522
|
-
/**
|
|
1523
|
-
* 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.
|
|
1524
|
-
*
|
|
1525
|
-
* Access Policy Requirements:
|
|
1526
|
-
* Action: `Messaging:SendTransactionalSMS`
|
|
1527
|
-
* Access Policy Resource: `Messaging:TransactionalSMS`
|
|
1528
|
-
* Action: `FHIR:Create`
|
|
1529
|
-
* Access Policy Resource: `FHIR:Communication`
|
|
1530
|
-
* Action: `FHIR:Update`
|
|
1531
|
-
* Access Policy Resource: `FHIR:Communication`
|
|
1532
|
-
*
|
|
1533
|
-
* You also need Read access for the resource to which you are sending a message. For example:
|
|
1534
|
-
* Action: `FHIR:Read`
|
|
1535
|
-
* Access Policy Resource: `FHIR:Patient`
|
|
1536
|
-
*/
|
|
1537
|
-
send(params, request) {
|
|
1538
|
-
return this.request('/messaging/transactional-sms/send', 'post', __classPrivateFieldGet(this, _TransactionalSMS_instances, "m", _TransactionalSMS_baseUrlThunk).bind(this))(params, request);
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
_TransactionalSMS_instances = new WeakSet(), _TransactionalSMS_baseUrlThunk = function _TransactionalSMS_baseUrlThunk() {
|
|
1542
|
-
var _a, _b;
|
|
1543
|
-
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';
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1547
|
-
var _User_instances, _User_baseUrlThunk;
|
|
1548
|
-
class User extends SDKResource {
|
|
1549
|
-
constructor(config) {
|
|
1550
|
-
super(config);
|
|
1551
|
-
_User_instances.add(this);
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* 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.
|
|
1555
|
-
*
|
|
1556
|
-
* Fetch details about the calling User. This endpoint has no access policy requirements, it is available to all authenticated Users.
|
|
1557
|
-
*/
|
|
1558
|
-
me(request) {
|
|
1559
|
-
return this.request('/user/me', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
|
|
1560
|
-
}
|
|
1561
|
-
/**
|
|
1562
|
-
* 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.
|
|
1563
|
-
*
|
|
1564
|
-
* Access Policy Action: `App:GetUser`
|
|
1565
|
-
* Access Policy Resource: `App:User`
|
|
1566
|
-
*/
|
|
1567
|
-
get(params, request) {
|
|
1568
|
-
return this.request('/user/{id}', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
1569
|
-
}
|
|
1570
|
-
/**
|
|
1571
|
-
* 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.
|
|
1572
|
-
*
|
|
1573
|
-
* Access Policy Action: `App:UpdateUser`
|
|
1574
|
-
* Access Policy Resource: `App:User`
|
|
1575
|
-
*/
|
|
1576
|
-
update(params, request) {
|
|
1577
|
-
return this.request('/user/{id}', 'patch', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
1578
|
-
}
|
|
1579
|
-
/**
|
|
1580
|
-
* 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.
|
|
1581
|
-
*
|
|
1582
|
-
* Access Policy Action: `App:DeleteUser`
|
|
1583
|
-
* Access Policy Resource: `App:User`
|
|
1584
|
-
*/
|
|
1585
|
-
delete(params, request) {
|
|
1586
|
-
return this.request('/user/{id}', 'delete', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
1587
|
-
}
|
|
1588
|
-
/**
|
|
1589
|
-
* 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.
|
|
1590
|
-
*
|
|
1591
|
-
* Access Policy Action: `App:CreateUser`
|
|
1592
|
-
* Access Policy Resource: `App:User`
|
|
1593
|
-
*/
|
|
1594
|
-
invite(params, request) {
|
|
1595
|
-
return this.request('/user/invite', 'post', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
1596
|
-
}
|
|
1597
|
-
/**
|
|
1598
|
-
* DEPRECATED. Please use [v2/list](https://api-reference.oystehr.com/reference/get_user-v2-list) instead.
|
|
1599
|
-
*
|
|
1600
|
-
* 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.
|
|
1601
|
-
*
|
|
1602
|
-
* Access Policy Action: `App:ListAllUsers`
|
|
1603
|
-
* Access Policy Resource: `App:User`
|
|
1604
|
-
*/
|
|
1605
|
-
list(request) {
|
|
1606
|
-
return this.request('/user', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(request);
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
* 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.
|
|
1610
|
-
*
|
|
1611
|
-
* Access Policy Action: `Project:ListAllUsers`
|
|
1612
|
-
* Access Policy Resource: `Project:Settings`
|
|
1613
|
-
*/
|
|
1614
|
-
listV2(params, request) {
|
|
1615
|
-
return this.request('/user/v2/list', 'get', __classPrivateFieldGet(this, _User_instances, "m", _User_baseUrlThunk).bind(this))(params, request);
|
|
1616
|
-
}
|
|
1617
|
-
}
|
|
1618
|
-
_User_instances = new WeakSet(), _User_baseUrlThunk = function _User_baseUrlThunk() {
|
|
1619
|
-
var _a, _b;
|
|
1620
|
-
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';
|
|
1621
|
-
};
|
|
1622
|
-
|
|
1623
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1624
|
-
var _Version_instances, _Version_baseUrlThunk;
|
|
1625
|
-
class Version extends SDKResource {
|
|
1626
|
-
constructor(config) {
|
|
1627
|
-
super(config);
|
|
1628
|
-
_Version_instances.add(this);
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* Get project API version. This endpoint is public so there are no access policy requirements.
|
|
1632
|
-
*/
|
|
1633
|
-
get(request) {
|
|
1634
|
-
return this.request('/version', 'get', __classPrivateFieldGet(this, _Version_instances, "m", _Version_baseUrlThunk).bind(this))(request);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
_Version_instances = new WeakSet(), _Version_baseUrlThunk = function _Version_baseUrlThunk() {
|
|
1638
|
-
var _a, _b;
|
|
1639
|
-
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';
|
|
1640
|
-
};
|
|
1641
|
-
|
|
1642
|
-
function baseUrlThunk$1() {
|
|
1643
|
-
var _a, _b;
|
|
1644
|
-
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';
|
|
1645
|
-
}
|
|
1646
|
-
/**
|
|
1647
|
-
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
1648
|
-
*
|
|
1649
|
-
* @param params upload file params
|
|
1650
|
-
*/
|
|
1651
|
-
function uploadFile$1({ bucketName, 'objectPath+': key, file, }) {
|
|
1652
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1653
|
-
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
|
|
1654
|
-
action: 'upload',
|
|
1655
|
-
bucketName,
|
|
1656
|
-
'objectPath+': key,
|
|
1657
|
-
});
|
|
1658
|
-
yield fetch(uploadUrl.signedUrl, {
|
|
1659
|
-
method: 'PUT',
|
|
1660
|
-
body: file,
|
|
1661
|
-
});
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
/**
|
|
1665
|
-
* Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.
|
|
1666
|
-
*
|
|
1667
|
-
* @param params download file params
|
|
1668
|
-
*/
|
|
1669
|
-
function downloadFile({ bucketName, 'objectPath+': key, }) {
|
|
1670
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1671
|
-
const uploadUrl = yield this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))({
|
|
1672
|
-
action: 'download',
|
|
1673
|
-
bucketName,
|
|
1674
|
-
'objectPath+': key,
|
|
1675
|
-
});
|
|
1676
|
-
const resp = yield fetch(uploadUrl.signedUrl, {
|
|
1677
|
-
method: 'GET',
|
|
1678
|
-
});
|
|
1679
|
-
if (!resp.ok) {
|
|
1680
|
-
throw new Error('Failed to download file');
|
|
1681
|
-
}
|
|
1682
|
-
return resp.arrayBuffer();
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* This helper performs a `getPresignedUrl` request for Z3 URLs of the forms
|
|
1687
|
-
* `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`
|
|
1688
|
-
* instead of the standard SDK `Z3GetPresignedUrlParams`.
|
|
1689
|
-
*
|
|
1690
|
-
* @param params url and action
|
|
1691
|
-
*/
|
|
1692
|
-
function getPresignedUrlForZ3Url(params) {
|
|
1693
|
-
var _a, _b;
|
|
1694
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1695
|
-
let bucket;
|
|
1696
|
-
let key;
|
|
1697
|
-
const url = new URL(params.url);
|
|
1698
|
-
if (url.protocol === 'z3:') {
|
|
1699
|
-
// remove leading forward slash
|
|
1700
|
-
const z3PathParts = url.pathname.split('/').slice(1);
|
|
1701
|
-
bucket = url.hostname;
|
|
1702
|
-
key = z3PathParts.join('/');
|
|
1703
|
-
}
|
|
1704
|
-
else if (url.href.startsWith((_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a['projectApiUrl']) !== null && _b !== void 0 ? _b : defaultProjectApiUrl)) {
|
|
1705
|
-
// remove leading `/v1/z3`
|
|
1706
|
-
const httpsPathParts = url.pathname.split('/').slice(3);
|
|
1707
|
-
bucket = httpsPathParts[0];
|
|
1708
|
-
key = httpsPathParts.slice(1).join('/');
|
|
1709
|
-
}
|
|
1710
|
-
else {
|
|
1711
|
-
throw new OystehrSdkError({ message: 'Invalid Z3 URL', code: 400 });
|
|
1712
|
-
}
|
|
1713
|
-
const requestParams = {
|
|
1714
|
-
action: 'upload',
|
|
1715
|
-
bucketName: bucket,
|
|
1716
|
-
'objectPath+': key,
|
|
1717
|
-
};
|
|
1718
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'post', baseUrlThunk$1.bind(this))(requestParams);
|
|
1719
|
-
});
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1723
|
-
var _Z3_instances, _Z3_baseUrlThunk;
|
|
1724
|
-
class Z3 extends SDKResource {
|
|
1725
|
-
constructor(config) {
|
|
1726
|
-
super(config);
|
|
1727
|
-
_Z3_instances.add(this);
|
|
1728
|
-
/**
|
|
1729
|
-
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
1730
|
-
* @param params upload file params
|
|
1731
|
-
*/
|
|
1732
|
-
this.uploadFile = uploadFile$1;
|
|
1733
|
-
/**
|
|
1734
|
-
* Downloads an object matching the bucket and key. File content is returned as an ArrayBuffer.
|
|
1735
|
-
* @param params download file params
|
|
1736
|
-
*/
|
|
1737
|
-
this.downloadFile = downloadFile;
|
|
1738
|
-
/**
|
|
1739
|
-
* This helper performs a `getPresignedUrl` request for Z3 URLs of the forms
|
|
1740
|
-
* `https://projects-api.oystehr.com/v1/z3/<bucket>/<key>` or `z3://<bucket>/<key>`
|
|
1741
|
-
* instead of the standard SDK `Z3GetPresignedUrlParams`.
|
|
1742
|
-
* @param params url and action
|
|
1743
|
-
*/
|
|
1744
|
-
this.getPresignedUrlForZ3Url = getPresignedUrlForZ3Url;
|
|
1745
|
-
}
|
|
1746
|
-
/**
|
|
1747
|
-
* List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
1748
|
-
*
|
|
1749
|
-
* Access Policy Action: `Z3:ListBuckets`
|
|
1750
|
-
* Access Policy Resource: `Z3:BucketName`
|
|
1751
|
-
*/
|
|
1752
|
-
listBuckets(request) {
|
|
1753
|
-
return this.request('/z3', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(request);
|
|
1754
|
-
}
|
|
1755
|
-
/**
|
|
1756
|
-
* 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.
|
|
1757
|
-
*
|
|
1758
|
-
* Access Policy Action: `Z3:CreateBucket`
|
|
1759
|
-
* Access Policy Resource: `Z3:*`
|
|
1760
|
-
*/
|
|
1761
|
-
createBucket(params, request) {
|
|
1762
|
-
return this.request('/z3/{bucketName}', 'put', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
1763
|
-
}
|
|
1764
|
-
/**
|
|
1765
|
-
* 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.
|
|
1766
|
-
*
|
|
1767
|
-
* Access Policy Action: `Z3:DeleteBucket`
|
|
1768
|
-
* Access Policy Resource: `Z3:BucketName`
|
|
1769
|
-
*/
|
|
1770
|
-
deleteBucket(params, request) {
|
|
1771
|
-
return this.request('/z3/{bucketName}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
1772
|
-
}
|
|
1773
|
-
/**
|
|
1774
|
-
* 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.
|
|
1775
|
-
*
|
|
1776
|
-
* Access Policy Action: `Z3:ListObjects`
|
|
1777
|
-
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
1778
|
-
*/
|
|
1779
|
-
listObjects(params, request) {
|
|
1780
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'get', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
1781
|
-
}
|
|
1782
|
-
/**
|
|
1783
|
-
* 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.
|
|
1784
|
-
*
|
|
1785
|
-
* Access Policy Action: `Z3:PutObject` or `Z3:GetObject`
|
|
1786
|
-
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
1787
|
-
*/
|
|
1788
|
-
getPresignedUrl(params, request) {
|
|
1789
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'post', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
1790
|
-
}
|
|
1791
|
-
/**
|
|
1792
|
-
* 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.
|
|
1793
|
-
*
|
|
1794
|
-
* Access Policy Action: `Z3:DeleteObject`
|
|
1795
|
-
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
1796
|
-
*/
|
|
1797
|
-
deleteObject(params, request) {
|
|
1798
|
-
return this.request('/z3/{bucketName}/{objectPath+}', 'delete', __classPrivateFieldGet(this, _Z3_instances, "m", _Z3_baseUrlThunk).bind(this))(params, request);
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
_Z3_instances = new WeakSet(), _Z3_baseUrlThunk = function _Z3_baseUrlThunk() {
|
|
1802
|
-
var _a, _b;
|
|
1803
|
-
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';
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
|
-
function baseUrlThunk() {
|
|
1807
|
-
var _a, _b;
|
|
1808
|
-
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';
|
|
1809
|
-
}
|
|
1810
|
-
function uploadFile({ id, file, filename, }) {
|
|
1811
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1812
|
-
const uploadUrl = yield this.request('/zambda/{id}/s3-upload', 'post', baseUrlThunk.bind(this))({ id, filename });
|
|
1813
|
-
yield fetch(uploadUrl.signedUrl, {
|
|
1814
|
-
method: 'PUT',
|
|
1815
|
-
body: file,
|
|
1816
|
-
});
|
|
1817
|
-
});
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1821
|
-
var _Zambda_instances, _Zambda_baseUrlThunk;
|
|
1822
|
-
class Zambda extends SDKResource {
|
|
1823
|
-
constructor(config) {
|
|
1824
|
-
super(config);
|
|
1825
|
-
_Zambda_instances.add(this);
|
|
1826
|
-
this.uploadFile = uploadFile;
|
|
1827
|
-
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1830
|
-
*
|
|
1831
|
-
* Access Policy Action: `Zambda:ListAllFunctions`
|
|
1832
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1833
|
-
*/
|
|
1834
|
-
list(request) {
|
|
1835
|
-
return this.request('/zambda', 'get', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(request);
|
|
1836
|
-
}
|
|
1837
|
-
/**
|
|
1838
|
-
* Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1839
|
-
*
|
|
1840
|
-
* Access Policy Action: `Zambda:CreateFunction`
|
|
1841
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1842
|
-
*/
|
|
1843
|
-
create(params, request) {
|
|
1844
|
-
return this.request('/zambda', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1845
|
-
}
|
|
1846
|
-
/**
|
|
1847
|
-
* Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1848
|
-
*
|
|
1849
|
-
* Access Policy Action: `Zambda:GetFunction`
|
|
1850
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1851
|
-
*/
|
|
1852
|
-
get(params, request) {
|
|
1853
|
-
return this.request('/zambda/{id}', 'get', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1854
|
-
}
|
|
1855
|
-
/**
|
|
1856
|
-
* Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1857
|
-
*
|
|
1858
|
-
* Access Policy Action: `Zambda:UpdateFunction`
|
|
1859
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1860
|
-
*/
|
|
1861
|
-
update(params, request) {
|
|
1862
|
-
return this.request('/zambda/{id}', 'patch', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1863
|
-
}
|
|
1864
|
-
/**
|
|
1865
|
-
* Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1866
|
-
*
|
|
1867
|
-
* Access Policy Action: `Zambda:DeleteFunction`
|
|
1868
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1869
|
-
*/
|
|
1870
|
-
delete(params, request) {
|
|
1871
|
-
return this.request('/zambda/{id}', 'delete', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1872
|
-
}
|
|
1873
|
-
/**
|
|
1874
|
-
* Execute the [Authenticated Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1875
|
-
*
|
|
1876
|
-
* Access Policy Action: `Zambda:InvokeFunction`
|
|
1877
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1878
|
-
*/
|
|
1879
|
-
execute(params, request) {
|
|
1880
|
-
return this.request('/zambda/{id}/execute', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1881
|
-
}
|
|
1882
|
-
/**
|
|
1883
|
-
* Execute the [Public Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1884
|
-
*
|
|
1885
|
-
* Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.
|
|
1886
|
-
*/
|
|
1887
|
-
executePublic(params, request) {
|
|
1888
|
-
return this.request('/zambda/{id}/execute-public', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1889
|
-
}
|
|
1890
|
-
/**
|
|
1891
|
-
* Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1892
|
-
*
|
|
1893
|
-
* Access Policy Action: `Zambda:UpdateFunction`
|
|
1894
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1895
|
-
*/
|
|
1896
|
-
s3Upload(params, request) {
|
|
1897
|
-
return this.request('/zambda/{id}/s3-upload', 'post', __classPrivateFieldGet(this, _Zambda_instances, "m", _Zambda_baseUrlThunk).bind(this))(params, request);
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
_Zambda_instances = new WeakSet(), _Zambda_baseUrlThunk = function _Zambda_baseUrlThunk() {
|
|
1901
|
-
var _a, _b;
|
|
1902
|
-
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';
|
|
1903
|
-
};
|
|
1904
|
-
|
|
1905
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1906
|
-
var _ZambdaLogStream_instances, _ZambdaLogStream_baseUrlThunk;
|
|
1907
|
-
class ZambdaLogStream extends SDKResource {
|
|
1908
|
-
constructor(config) {
|
|
1909
|
-
super(config);
|
|
1910
|
-
_ZambdaLogStream_instances.add(this);
|
|
1911
|
-
}
|
|
1912
|
-
/**
|
|
1913
|
-
* Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1914
|
-
*
|
|
1915
|
-
* Access Policy Action: `Zambda:ReadLogs`
|
|
1916
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1917
|
-
*/
|
|
1918
|
-
list(params, request) {
|
|
1919
|
-
return this.request('/zambda/{id}/logStream', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
|
|
1920
|
-
}
|
|
1921
|
-
/**
|
|
1922
|
-
* Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1923
|
-
*
|
|
1924
|
-
* Access Policy Action: `Zambda:ReadLogs`
|
|
1925
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1926
|
-
*/
|
|
1927
|
-
search(params, request) {
|
|
1928
|
-
return this.request('/zambda/{id}/logStream/search', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
|
|
1929
|
-
}
|
|
1930
|
-
/**
|
|
1931
|
-
* Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
1932
|
-
*
|
|
1933
|
-
* Access Policy Action: `Zambda:ReadLogs`
|
|
1934
|
-
* Access Policy Resource: `Zambda:Function`
|
|
1935
|
-
*/
|
|
1936
|
-
get(params, request) {
|
|
1937
|
-
return this.request('/zambda/{id}/logStream/{logStreamName}', 'post', __classPrivateFieldGet(this, _ZambdaLogStream_instances, "m", _ZambdaLogStream_baseUrlThunk).bind(this))(params, request);
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
_ZambdaLogStream_instances = new WeakSet(), _ZambdaLogStream_baseUrlThunk = function _ZambdaLogStream_baseUrlThunk() {
|
|
1941
|
-
var _a, _b;
|
|
1942
|
-
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';
|
|
1943
|
-
};
|
|
1944
|
-
|
|
1945
|
-
// AUTOGENERATED -- DO NOT EDIT
|
|
1946
|
-
let Oystehr$1 = class Oystehr {
|
|
1947
|
-
constructor(config) {
|
|
1948
|
-
var _a, _b, _c;
|
|
1949
|
-
var _d, _e, _f;
|
|
1950
|
-
this.config = config;
|
|
1951
|
-
(_a = (_d = this.config).services) !== null && _a !== void 0 ? _a : (_d.services = {});
|
|
1952
|
-
(_b = (_e = this.config.services)['projectApiUrl']) !== null && _b !== void 0 ? _b : (_e['projectApiUrl'] = config.projectApiUrl);
|
|
1953
|
-
(_c = (_f = this.config.services)['fhirApiUrl']) !== null && _c !== void 0 ? _c : (_f['fhirApiUrl'] = config.fhirApiUrl);
|
|
1954
|
-
this.application = new Application(config);
|
|
1955
|
-
this.developer = new Developer(config);
|
|
1956
|
-
this.m2m = new M2m(config);
|
|
1957
|
-
this.messaging = new Messaging(config);
|
|
1958
|
-
this.conversation = new Conversation(config);
|
|
1959
|
-
this.transactionalSMS = new TransactionalSMS(config);
|
|
1960
|
-
this.paymentMethod = new PaymentMethod(config);
|
|
1961
|
-
this.charge = new Charge(config);
|
|
1962
|
-
this.project = new Project(config);
|
|
1963
|
-
this.rcm = new Rcm(config);
|
|
1964
|
-
this.erxV1 = new ErxV1(config);
|
|
1965
|
-
this.erxV2 = new ErxV2(config);
|
|
1966
|
-
this.role = new Role(config);
|
|
1967
|
-
this.secret = new Secret(config);
|
|
1968
|
-
this.telemed = new Telemed(config);
|
|
1969
|
-
this.user = new User(config);
|
|
1970
|
-
this.version = new Version(config);
|
|
1971
|
-
this.z3 = new Z3(config);
|
|
1972
|
-
this.zambda = new Zambda(config);
|
|
1973
|
-
this.zambdaLogStream = new ZambdaLogStream(config);
|
|
1974
|
-
this.fax = new Fax(config);
|
|
1975
|
-
this.lab = new Lab(config);
|
|
1976
|
-
this.erx = new Erx(config);
|
|
1977
|
-
this.fhir = new Fhir(config);
|
|
1978
|
-
}
|
|
1979
|
-
};
|
|
5
|
+
var index$1 = require('./errors/index.cjs');
|
|
6
|
+
var index = require('./resources/classes/index.cjs');
|
|
1980
7
|
|
|
1981
|
-
|
|
8
|
+
// HACK: ideally we would only have to do this for CommonJS
|
|
9
|
+
// where default + named exports are not allowed; however,
|
|
10
|
+
// our ancient tsc settings are somehow grabbing js from
|
|
11
|
+
// dist/esm and types from dist/cjs
|
|
12
|
+
class Oystehr extends index.Oystehr {
|
|
13
|
+
static OystehrFHIRError = index$1.OystehrFHIRError;
|
|
14
|
+
static OystehrSdkError = index$1.OystehrSdkError;
|
|
1982
15
|
}
|
|
1983
|
-
Oystehr.OystehrFHIRError = OystehrFHIRError;
|
|
1984
|
-
Oystehr.OystehrSdkError = OystehrSdkError;
|
|
1985
16
|
|
|
1986
|
-
|
|
17
|
+
exports.default = Oystehr;
|
|
1987
18
|
//# sourceMappingURL=index.cjs.map
|