@medplum/core 2.0.24 → 2.0.25
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/index.cjs +28 -14114
- package/dist/cjs/index.cjs.map +7 -1
- package/dist/esm/index.mjs +31 -29
- package/dist/esm/index.mjs.map +7 -1
- package/dist/types/utils.d.ts +14 -0
- package/package.json +2 -2
- package/dist/cjs/index.min.cjs +0 -1
- package/dist/esm/access.mjs +0 -142
- package/dist/esm/access.mjs.map +0 -1
- package/dist/esm/base-schema.json.mjs +0 -4408
- package/dist/esm/base-schema.json.mjs.map +0 -1
- package/dist/esm/base64.mjs +0 -33
- package/dist/esm/base64.mjs.map +0 -1
- package/dist/esm/bundle.mjs +0 -36
- package/dist/esm/bundle.mjs.map +0 -1
- package/dist/esm/cache.mjs +0 -64
- package/dist/esm/cache.mjs.map +0 -1
- package/dist/esm/client.mjs +0 -2168
- package/dist/esm/client.mjs.map +0 -1
- package/dist/esm/crypto.mjs +0 -22
- package/dist/esm/crypto.mjs.map +0 -1
- package/dist/esm/eventtarget.mjs +0 -36
- package/dist/esm/eventtarget.mjs.map +0 -1
- package/dist/esm/fhirlexer/parse.mjs +0 -122
- package/dist/esm/fhirlexer/parse.mjs.map +0 -1
- package/dist/esm/fhirlexer/tokenize.mjs +0 -231
- package/dist/esm/fhirlexer/tokenize.mjs.map +0 -1
- package/dist/esm/fhirmapper/parse.mjs +0 -329
- package/dist/esm/fhirmapper/parse.mjs.map +0 -1
- package/dist/esm/fhirmapper/tokenize.mjs +0 -13
- package/dist/esm/fhirmapper/tokenize.mjs.map +0 -1
- package/dist/esm/fhirpath/atoms.mjs +0 -347
- package/dist/esm/fhirpath/atoms.mjs.map +0 -1
- package/dist/esm/fhirpath/date.mjs +0 -24
- package/dist/esm/fhirpath/date.mjs.map +0 -1
- package/dist/esm/fhirpath/functions.mjs +0 -1626
- package/dist/esm/fhirpath/functions.mjs.map +0 -1
- package/dist/esm/fhirpath/parse.mjs +0 -145
- package/dist/esm/fhirpath/parse.mjs.map +0 -1
- package/dist/esm/fhirpath/tokenize.mjs +0 -10
- package/dist/esm/fhirpath/tokenize.mjs.map +0 -1
- package/dist/esm/fhirpath/utils.mjs +0 -377
- package/dist/esm/fhirpath/utils.mjs.map +0 -1
- package/dist/esm/filter/parse.mjs +0 -101
- package/dist/esm/filter/parse.mjs.map +0 -1
- package/dist/esm/filter/tokenize.mjs +0 -16
- package/dist/esm/filter/tokenize.mjs.map +0 -1
- package/dist/esm/filter/types.mjs +0 -34
- package/dist/esm/filter/types.mjs.map +0 -1
- package/dist/esm/format.mjs +0 -390
- package/dist/esm/format.mjs.map +0 -1
- package/dist/esm/hl7.mjs +0 -242
- package/dist/esm/hl7.mjs.map +0 -1
- package/dist/esm/index.min.mjs +0 -1
- package/dist/esm/jwt.mjs +0 -30
- package/dist/esm/jwt.mjs.map +0 -1
- package/dist/esm/node_modules/tslib/package.json +0 -1
- package/dist/esm/outcomes.mjs +0 -295
- package/dist/esm/outcomes.mjs.map +0 -1
- package/dist/esm/readablepromise.mjs +0 -82
- package/dist/esm/readablepromise.mjs.map +0 -1
- package/dist/esm/schema.mjs +0 -417
- package/dist/esm/schema.mjs.map +0 -1
- package/dist/esm/search/details.mjs +0 -162
- package/dist/esm/search/details.mjs.map +0 -1
- package/dist/esm/search/match.mjs +0 -166
- package/dist/esm/search/match.mjs.map +0 -1
- package/dist/esm/search/search.mjs +0 -378
- package/dist/esm/search/search.mjs.map +0 -1
- package/dist/esm/sftp.mjs +0 -24
- package/dist/esm/sftp.mjs.map +0 -1
- package/dist/esm/storage.mjs +0 -95
- package/dist/esm/storage.mjs.map +0 -1
- package/dist/esm/types.mjs +0 -370
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/typeschema/types.mjs +0 -278
- package/dist/esm/typeschema/types.mjs.map +0 -1
- package/dist/esm/typeschema/validation.mjs +0 -262
- package/dist/esm/typeschema/validation.mjs.map +0 -1
- package/dist/esm/utils.mjs +0 -632
- package/dist/esm/utils.mjs.map +0 -1
package/dist/esm/outcomes.mjs
DELETED
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
const OK_ID = 'ok';
|
|
2
|
-
const CREATED_ID = 'created';
|
|
3
|
-
const GONE_ID = 'gone';
|
|
4
|
-
const NOT_MODIFIED_ID = 'not-modified';
|
|
5
|
-
const NOT_FOUND_ID = 'not-found';
|
|
6
|
-
const UNAUTHORIZED_ID = 'unauthorized';
|
|
7
|
-
const FORBIDDEN_ID = 'forbidden';
|
|
8
|
-
const TOO_MANY_REQUESTS_ID = 'too-many-requests';
|
|
9
|
-
const ACCEPTED_ID = 'accepted';
|
|
10
|
-
const allOk = {
|
|
11
|
-
resourceType: 'OperationOutcome',
|
|
12
|
-
id: OK_ID,
|
|
13
|
-
issue: [
|
|
14
|
-
{
|
|
15
|
-
severity: 'information',
|
|
16
|
-
code: 'informational',
|
|
17
|
-
details: {
|
|
18
|
-
text: 'All OK',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
const created = {
|
|
24
|
-
resourceType: 'OperationOutcome',
|
|
25
|
-
id: CREATED_ID,
|
|
26
|
-
issue: [
|
|
27
|
-
{
|
|
28
|
-
severity: 'information',
|
|
29
|
-
code: 'informational',
|
|
30
|
-
details: {
|
|
31
|
-
text: 'Created',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
const notModified = {
|
|
37
|
-
resourceType: 'OperationOutcome',
|
|
38
|
-
id: NOT_MODIFIED_ID,
|
|
39
|
-
issue: [
|
|
40
|
-
{
|
|
41
|
-
severity: 'information',
|
|
42
|
-
code: 'informational',
|
|
43
|
-
details: {
|
|
44
|
-
text: 'Not Modified',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
};
|
|
49
|
-
const notFound = {
|
|
50
|
-
resourceType: 'OperationOutcome',
|
|
51
|
-
id: NOT_FOUND_ID,
|
|
52
|
-
issue: [
|
|
53
|
-
{
|
|
54
|
-
severity: 'error',
|
|
55
|
-
code: 'not-found',
|
|
56
|
-
details: {
|
|
57
|
-
text: 'Not found',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
const unauthorized = {
|
|
63
|
-
resourceType: 'OperationOutcome',
|
|
64
|
-
id: UNAUTHORIZED_ID,
|
|
65
|
-
issue: [
|
|
66
|
-
{
|
|
67
|
-
severity: 'error',
|
|
68
|
-
code: 'login',
|
|
69
|
-
details: {
|
|
70
|
-
text: 'Unauthorized',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
};
|
|
75
|
-
const forbidden = {
|
|
76
|
-
resourceType: 'OperationOutcome',
|
|
77
|
-
id: FORBIDDEN_ID,
|
|
78
|
-
issue: [
|
|
79
|
-
{
|
|
80
|
-
severity: 'error',
|
|
81
|
-
code: 'forbidden',
|
|
82
|
-
details: {
|
|
83
|
-
text: 'Forbidden',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
|
-
const gone = {
|
|
89
|
-
resourceType: 'OperationOutcome',
|
|
90
|
-
id: GONE_ID,
|
|
91
|
-
issue: [
|
|
92
|
-
{
|
|
93
|
-
severity: 'error',
|
|
94
|
-
code: 'deleted',
|
|
95
|
-
details: {
|
|
96
|
-
text: 'Gone',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
],
|
|
100
|
-
};
|
|
101
|
-
const tooManyRequests = {
|
|
102
|
-
resourceType: 'OperationOutcome',
|
|
103
|
-
id: TOO_MANY_REQUESTS_ID,
|
|
104
|
-
issue: [
|
|
105
|
-
{
|
|
106
|
-
severity: 'error',
|
|
107
|
-
code: 'throttled',
|
|
108
|
-
details: {
|
|
109
|
-
text: 'Too Many Requests',
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
],
|
|
113
|
-
};
|
|
114
|
-
function accepted(location) {
|
|
115
|
-
return {
|
|
116
|
-
resourceType: 'OperationOutcome',
|
|
117
|
-
id: ACCEPTED_ID,
|
|
118
|
-
issue: [
|
|
119
|
-
{
|
|
120
|
-
severity: 'information',
|
|
121
|
-
code: 'informational',
|
|
122
|
-
details: {
|
|
123
|
-
text: 'Accepted',
|
|
124
|
-
},
|
|
125
|
-
diagnostics: location,
|
|
126
|
-
},
|
|
127
|
-
],
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function badRequest(details, expression) {
|
|
131
|
-
return {
|
|
132
|
-
resourceType: 'OperationOutcome',
|
|
133
|
-
issue: [
|
|
134
|
-
{
|
|
135
|
-
severity: 'error',
|
|
136
|
-
code: 'invalid',
|
|
137
|
-
details: {
|
|
138
|
-
text: details,
|
|
139
|
-
},
|
|
140
|
-
expression: expression ? [expression] : undefined,
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function validationError(details) {
|
|
146
|
-
return {
|
|
147
|
-
resourceType: 'OperationOutcome',
|
|
148
|
-
issue: [
|
|
149
|
-
{
|
|
150
|
-
severity: 'error',
|
|
151
|
-
code: 'structure',
|
|
152
|
-
details: {
|
|
153
|
-
text: details,
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function serverError(err) {
|
|
160
|
-
return {
|
|
161
|
-
resourceType: 'OperationOutcome',
|
|
162
|
-
issue: [
|
|
163
|
-
{
|
|
164
|
-
severity: 'error',
|
|
165
|
-
code: 'exception',
|
|
166
|
-
details: {
|
|
167
|
-
text: 'Internal server error',
|
|
168
|
-
},
|
|
169
|
-
diagnostics: err.toString(),
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
function isOperationOutcome(value) {
|
|
175
|
-
return typeof value === 'object' && value !== null && value.resourceType === 'OperationOutcome';
|
|
176
|
-
}
|
|
177
|
-
function isOk(outcome) {
|
|
178
|
-
return (outcome.id === OK_ID || outcome.id === CREATED_ID || outcome.id === NOT_MODIFIED_ID || outcome.id === ACCEPTED_ID);
|
|
179
|
-
}
|
|
180
|
-
function isAccepted(outcome) {
|
|
181
|
-
return outcome.id === ACCEPTED_ID;
|
|
182
|
-
}
|
|
183
|
-
function isNotFound(outcome) {
|
|
184
|
-
return outcome.id === NOT_FOUND_ID;
|
|
185
|
-
}
|
|
186
|
-
function isGone(outcome) {
|
|
187
|
-
return outcome.id === GONE_ID;
|
|
188
|
-
}
|
|
189
|
-
function getStatus(outcome) {
|
|
190
|
-
if (outcome.id === OK_ID) {
|
|
191
|
-
return 200;
|
|
192
|
-
}
|
|
193
|
-
else if (outcome.id === CREATED_ID) {
|
|
194
|
-
return 201;
|
|
195
|
-
}
|
|
196
|
-
else if (outcome.id === ACCEPTED_ID) {
|
|
197
|
-
return 202;
|
|
198
|
-
}
|
|
199
|
-
else if (outcome.id === NOT_MODIFIED_ID) {
|
|
200
|
-
return 304;
|
|
201
|
-
}
|
|
202
|
-
else if (outcome.id === UNAUTHORIZED_ID) {
|
|
203
|
-
return 401;
|
|
204
|
-
}
|
|
205
|
-
else if (outcome.id === FORBIDDEN_ID) {
|
|
206
|
-
return 403;
|
|
207
|
-
}
|
|
208
|
-
else if (outcome.id === NOT_FOUND_ID) {
|
|
209
|
-
return 404;
|
|
210
|
-
}
|
|
211
|
-
else if (outcome.id === GONE_ID) {
|
|
212
|
-
return 410;
|
|
213
|
-
}
|
|
214
|
-
else if (outcome.id === TOO_MANY_REQUESTS_ID) {
|
|
215
|
-
return 429;
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
return 400;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* Asserts that the operation completed successfully and that the resource is defined.
|
|
223
|
-
* @param outcome The operation outcome.
|
|
224
|
-
* @param resource The resource that may or may not have been returned.
|
|
225
|
-
*/
|
|
226
|
-
function assertOk(outcome, resource) {
|
|
227
|
-
if (!isOk(outcome) || resource === undefined) {
|
|
228
|
-
throw new OperationOutcomeError(outcome);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
class OperationOutcomeError extends Error {
|
|
232
|
-
constructor(outcome, cause) {
|
|
233
|
-
super(operationOutcomeToString(outcome));
|
|
234
|
-
this.outcome = outcome;
|
|
235
|
-
this.cause = cause;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Normalizes an error object into an OperationOutcome.
|
|
240
|
-
* @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
|
|
241
|
-
* @returns The normalized OperationOutcome.
|
|
242
|
-
*/
|
|
243
|
-
function normalizeOperationOutcome(error) {
|
|
244
|
-
if (error instanceof OperationOutcomeError) {
|
|
245
|
-
return error.outcome;
|
|
246
|
-
}
|
|
247
|
-
if (isOperationOutcome(error)) {
|
|
248
|
-
return error;
|
|
249
|
-
}
|
|
250
|
-
return badRequest(normalizeErrorString(error));
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Normalizes an error object into a displayable error string.
|
|
254
|
-
* @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.
|
|
255
|
-
* @returns A display string for the error.
|
|
256
|
-
*/
|
|
257
|
-
function normalizeErrorString(error) {
|
|
258
|
-
if (!error) {
|
|
259
|
-
return 'Unknown error';
|
|
260
|
-
}
|
|
261
|
-
if (typeof error === 'string') {
|
|
262
|
-
return error;
|
|
263
|
-
}
|
|
264
|
-
if (error instanceof Error) {
|
|
265
|
-
return error.message;
|
|
266
|
-
}
|
|
267
|
-
if (isOperationOutcome(error)) {
|
|
268
|
-
return operationOutcomeToString(error);
|
|
269
|
-
}
|
|
270
|
-
return JSON.stringify(error);
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Returns a string represenation of the operation outcome.
|
|
274
|
-
* @param outcome The operation outcome.
|
|
275
|
-
* @returns The string representation of the operation outcome.
|
|
276
|
-
*/
|
|
277
|
-
function operationOutcomeToString(outcome) {
|
|
278
|
-
const strs = outcome.issue?.map(operationOutcomeIssueToString) ?? [];
|
|
279
|
-
return strs.length > 0 ? strs.join('; ') : 'Unknown error';
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Returns a string represenation of the operation outcome issue.
|
|
283
|
-
* @param issue The operation outcome issue.
|
|
284
|
-
* @returns The string representation of the operation outcome issue.
|
|
285
|
-
*/
|
|
286
|
-
function operationOutcomeIssueToString(issue) {
|
|
287
|
-
let issueStr = issue.details?.text ?? issue.diagnostics ?? 'Unknown error';
|
|
288
|
-
if (issue.expression?.length) {
|
|
289
|
-
issueStr += ` (${issue.expression.join(', ')})`;
|
|
290
|
-
}
|
|
291
|
-
return issueStr;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export { OperationOutcomeError, accepted, allOk, assertOk, badRequest, created, forbidden, getStatus, gone, isAccepted, isGone, isNotFound, isOk, isOperationOutcome, normalizeErrorString, normalizeOperationOutcome, notFound, notModified, operationOutcomeIssueToString, operationOutcomeToString, serverError, tooManyRequests, unauthorized, validationError };
|
|
295
|
-
//# sourceMappingURL=outcomes.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outcomes.mjs","sources":["../../src/outcomes.ts"],"sourcesContent":["import { OperationOutcome, OperationOutcomeIssue } from '@medplum/fhirtypes';\n\nconst OK_ID = 'ok';\nconst CREATED_ID = 'created';\nconst GONE_ID = 'gone';\nconst NOT_MODIFIED_ID = 'not-modified';\nconst NOT_FOUND_ID = 'not-found';\nconst UNAUTHORIZED_ID = 'unauthorized';\nconst FORBIDDEN_ID = 'forbidden';\nconst TOO_MANY_REQUESTS_ID = 'too-many-requests';\nconst ACCEPTED_ID = 'accepted';\n\nexport const allOk: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: OK_ID,\n issue: [\n {\n severity: 'information',\n code: 'informational',\n details: {\n text: 'All OK',\n },\n },\n ],\n};\n\nexport const created: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: CREATED_ID,\n issue: [\n {\n severity: 'information',\n code: 'informational',\n details: {\n text: 'Created',\n },\n },\n ],\n};\n\nexport const notModified: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: NOT_MODIFIED_ID,\n issue: [\n {\n severity: 'information',\n code: 'informational',\n details: {\n text: 'Not Modified',\n },\n },\n ],\n};\n\nexport const notFound: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: NOT_FOUND_ID,\n issue: [\n {\n severity: 'error',\n code: 'not-found',\n details: {\n text: 'Not found',\n },\n },\n ],\n};\n\nexport const unauthorized: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: UNAUTHORIZED_ID,\n issue: [\n {\n severity: 'error',\n code: 'login',\n details: {\n text: 'Unauthorized',\n },\n },\n ],\n};\n\nexport const forbidden: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: FORBIDDEN_ID,\n issue: [\n {\n severity: 'error',\n code: 'forbidden',\n details: {\n text: 'Forbidden',\n },\n },\n ],\n};\n\nexport const gone: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: GONE_ID,\n issue: [\n {\n severity: 'error',\n code: 'deleted',\n details: {\n text: 'Gone',\n },\n },\n ],\n};\n\nexport const tooManyRequests: OperationOutcome = {\n resourceType: 'OperationOutcome',\n id: TOO_MANY_REQUESTS_ID,\n issue: [\n {\n severity: 'error',\n code: 'throttled',\n details: {\n text: 'Too Many Requests',\n },\n },\n ],\n};\n\nexport function accepted(location: string): OperationOutcome {\n return {\n resourceType: 'OperationOutcome',\n id: ACCEPTED_ID,\n issue: [\n {\n severity: 'information',\n code: 'informational',\n details: {\n text: 'Accepted',\n },\n diagnostics: location,\n },\n ],\n };\n}\n\nexport function badRequest(details: string, expression?: string): OperationOutcome {\n return {\n resourceType: 'OperationOutcome',\n issue: [\n {\n severity: 'error',\n code: 'invalid',\n details: {\n text: details,\n },\n expression: expression ? [expression] : undefined,\n },\n ],\n };\n}\n\nexport function validationError(details: string): OperationOutcome {\n return {\n resourceType: 'OperationOutcome',\n issue: [\n {\n severity: 'error',\n code: 'structure',\n details: {\n text: details,\n },\n },\n ],\n };\n}\n\nexport function serverError(err: Error): OperationOutcome {\n return {\n resourceType: 'OperationOutcome',\n issue: [\n {\n severity: 'error',\n code: 'exception',\n details: {\n text: 'Internal server error',\n },\n diagnostics: err.toString(),\n },\n ],\n };\n}\n\nexport function isOperationOutcome(value: unknown): value is OperationOutcome {\n return typeof value === 'object' && value !== null && (value as any).resourceType === 'OperationOutcome';\n}\n\nexport function isOk(outcome: OperationOutcome): boolean {\n return (\n outcome.id === OK_ID || outcome.id === CREATED_ID || outcome.id === NOT_MODIFIED_ID || outcome.id === ACCEPTED_ID\n );\n}\n\nexport function isAccepted(outcome: OperationOutcome): boolean {\n return outcome.id === ACCEPTED_ID;\n}\n\nexport function isNotFound(outcome: OperationOutcome): boolean {\n return outcome.id === NOT_FOUND_ID;\n}\n\nexport function isGone(outcome: OperationOutcome): boolean {\n return outcome.id === GONE_ID;\n}\n\nexport function getStatus(outcome: OperationOutcome): number {\n if (outcome.id === OK_ID) {\n return 200;\n } else if (outcome.id === CREATED_ID) {\n return 201;\n } else if (outcome.id === ACCEPTED_ID) {\n return 202;\n } else if (outcome.id === NOT_MODIFIED_ID) {\n return 304;\n } else if (outcome.id === UNAUTHORIZED_ID) {\n return 401;\n } else if (outcome.id === FORBIDDEN_ID) {\n return 403;\n } else if (outcome.id === NOT_FOUND_ID) {\n return 404;\n } else if (outcome.id === GONE_ID) {\n return 410;\n } else if (outcome.id === TOO_MANY_REQUESTS_ID) {\n return 429;\n } else {\n return 400;\n }\n}\n\n/**\n * Asserts that the operation completed successfully and that the resource is defined.\n * @param outcome The operation outcome.\n * @param resource The resource that may or may not have been returned.\n */\nexport function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T {\n if (!isOk(outcome) || resource === undefined) {\n throw new OperationOutcomeError(outcome);\n }\n}\n\nexport class OperationOutcomeError extends Error {\n readonly outcome: OperationOutcome;\n\n constructor(outcome: OperationOutcome, cause?: unknown) {\n super(operationOutcomeToString(outcome));\n this.outcome = outcome;\n this.cause = cause;\n }\n}\n\n/**\n * Normalizes an error object into an OperationOutcome.\n * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.\n * @returns The normalized OperationOutcome.\n */\nexport function normalizeOperationOutcome(error: unknown): OperationOutcome {\n if (error instanceof OperationOutcomeError) {\n return error.outcome;\n }\n if (isOperationOutcome(error)) {\n return error;\n }\n return badRequest(normalizeErrorString(error));\n}\n\n/**\n * Normalizes an error object into a displayable error string.\n * @param error The error value which could be a string, Error, OperationOutcome, or other unknown type.\n * @returns A display string for the error.\n */\nexport function normalizeErrorString(error: unknown): string {\n if (!error) {\n return 'Unknown error';\n }\n if (typeof error === 'string') {\n return error;\n }\n if (error instanceof Error) {\n return error.message;\n }\n if (isOperationOutcome(error)) {\n return operationOutcomeToString(error);\n }\n return JSON.stringify(error);\n}\n\n/**\n * Returns a string represenation of the operation outcome.\n * @param outcome The operation outcome.\n * @returns The string representation of the operation outcome.\n */\nexport function operationOutcomeToString(outcome: OperationOutcome): string {\n const strs = outcome.issue?.map(operationOutcomeIssueToString) ?? [];\n return strs.length > 0 ? strs.join('; ') : 'Unknown error';\n}\n\n/**\n * Returns a string represenation of the operation outcome issue.\n * @param issue The operation outcome issue.\n * @returns The string representation of the operation outcome issue.\n */\nexport function operationOutcomeIssueToString(issue: OperationOutcomeIssue): string {\n let issueStr = issue.details?.text ?? issue.diagnostics ?? 'Unknown error';\n if (issue.expression?.length) {\n issueStr += ` (${issue.expression.join(', ')})`;\n }\n return issueStr;\n}\n"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,IAAI,CAAC;AACnB,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,OAAO,GAAG,MAAM,CAAC;AACvB,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,YAAY,GAAG,WA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able for React Suspense.
|
|
4
|
-
* See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js
|
|
5
|
-
* See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js
|
|
6
|
-
*/
|
|
7
|
-
class ReadablePromise {
|
|
8
|
-
constructor(requestPromise) {
|
|
9
|
-
this[_a] = 'ReadablePromise';
|
|
10
|
-
this.status = 'pending';
|
|
11
|
-
this.suspender = requestPromise.then((res) => {
|
|
12
|
-
this.status = 'success';
|
|
13
|
-
this.response = res;
|
|
14
|
-
return res;
|
|
15
|
-
}, (err) => {
|
|
16
|
-
this.status = 'error';
|
|
17
|
-
this.error = err;
|
|
18
|
-
throw err;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Returns true if the promise is pending.
|
|
23
|
-
* @returns True if the Promise is pending.
|
|
24
|
-
*/
|
|
25
|
-
isPending() {
|
|
26
|
-
return this.status === 'pending';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Returns true if the promise resolved successfully.
|
|
30
|
-
* @returns True if the Promise resolved successfully.
|
|
31
|
-
*/
|
|
32
|
-
isOk() {
|
|
33
|
-
return this.status === 'success';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Attempts to read the value of the promise.
|
|
37
|
-
* If the promise is pending, this method will throw a promise.
|
|
38
|
-
* If the promise rejected, this method will throw the rejection reason.
|
|
39
|
-
* If the promise resolved, this method will return the resolved value.
|
|
40
|
-
* @returns The resolved value of the Promise.
|
|
41
|
-
*/
|
|
42
|
-
read() {
|
|
43
|
-
switch (this.status) {
|
|
44
|
-
case 'pending':
|
|
45
|
-
throw this.suspender; //eslint-disable-line @typescript-eslint/no-throw-literal
|
|
46
|
-
case 'error':
|
|
47
|
-
throw this.error;
|
|
48
|
-
default:
|
|
49
|
-
return this.response;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
54
|
-
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
55
|
-
* @param onrejected The callback to execute when the Promise is rejected.
|
|
56
|
-
* @returns A Promise for the completion of which ever callback is executed.
|
|
57
|
-
*/
|
|
58
|
-
then(onfulfilled, onrejected) {
|
|
59
|
-
return this.suspender.then(onfulfilled, onrejected);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Attaches a callback for only the rejection of the Promise.
|
|
63
|
-
* @param onrejected The callback to execute when the Promise is rejected.
|
|
64
|
-
* @returns A Promise for the completion of the callback.
|
|
65
|
-
*/
|
|
66
|
-
catch(onrejected) {
|
|
67
|
-
return this.suspender.catch(onrejected);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
71
|
-
* resolved value cannot be modified from the callback.
|
|
72
|
-
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
73
|
-
* @returns A Promise for the completion of the callback.
|
|
74
|
-
*/
|
|
75
|
-
finally(onfinally) {
|
|
76
|
-
return this.suspender.finally(onfinally);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
_a = Symbol.toStringTag;
|
|
80
|
-
|
|
81
|
-
export { ReadablePromise };
|
|
82
|
-
//# sourceMappingURL=readablepromise.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readablepromise.mjs","sources":["../../src/readablepromise.ts"],"sourcesContent":["/**\n * The ReadablePromise class wraps a request promise suitable for React Suspense.\n * See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js\n * See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js\n */\nexport class ReadablePromise<T> implements Promise<T> {\n readonly [Symbol.toStringTag]: string = 'ReadablePromise';\n private suspender: Promise<T>;\n private status: 'pending' | 'error' | 'success' = 'pending';\n private response: T | undefined;\n private error: Error | undefined;\n\n constructor(requestPromise: Promise<T>) {\n this.suspender = requestPromise.then(\n (res: T) => {\n this.status = 'success';\n this.response = res;\n return res;\n },\n (err: any) => {\n this.status = 'error';\n this.error = err;\n throw err;\n }\n );\n }\n\n /**\n * Returns true if the promise is pending.\n * @returns True if the Promise is pending.\n */\n isPending(): boolean {\n return this.status === 'pending';\n }\n\n /**\n * Returns true if the promise resolved successfully.\n * @returns True if the Promise resolved successfully.\n */\n isOk(): boolean {\n return this.status === 'success';\n }\n\n /**\n * Attempts to read the value of the promise.\n * If the promise is pending, this method will throw a promise.\n * If the promise rejected, this method will throw the rejection reason.\n * If the promise resolved, this method will return the resolved value.\n * @returns The resolved value of the Promise.\n */\n read(): T {\n switch (this.status) {\n case 'pending':\n throw this.suspender; //eslint-disable-line @typescript-eslint/no-throw-literal\n case 'error':\n throw this.error as Error;\n default:\n return this.response as T;\n }\n }\n\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then<TResult1 = T, TResult2 = never>(\n onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,\n onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null\n ): Promise<TResult1 | TResult2> {\n return this.suspender.then(onfulfilled, onrejected);\n }\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch<TResult = never>(\n onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null\n ): Promise<T | TResult> {\n return this.suspender.catch(onrejected);\n }\n\n /**\n * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The\n * resolved value cannot be modified from the callback.\n * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).\n * @returns A Promise for the completion of the callback.\n */\n finally(onfinally?: (() => void) | undefined | null): Promise<T> {\n return this.suspender.finally(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