@health-samurai/aidbox-client 0.0.0-alpha.2 → 0.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +295 -66
- package/dist/src/auth-providers.d.ts +22 -0
- package/dist/src/auth-providers.d.ts.map +1 -1
- package/dist/src/auth-providers.js +149 -13
- package/dist/src/client.d.ts +504 -31
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +1455 -934
- package/dist/src/fhir-types/hl7-fhir-r4-core/Address.d.ts +26 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Address.d.ts.map +1 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Address.js +5 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/ContactPoint.d.ts +16 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/ContactPoint.d.ts.map +1 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/ContactPoint.js +5 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/DomainResource.d.ts +1 -1
- package/dist/src/fhir-types/hl7-fhir-r4-core/DomainResource.d.ts.map +1 -1
- package/dist/src/fhir-types/hl7-fhir-r4-core/HumanName.d.ts +20 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/HumanName.d.ts.map +1 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/HumanName.js +5 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Patient.d.ts +58 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Patient.d.ts.map +1 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Patient.js +10 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/Resource.d.ts +1 -1
- package/dist/src/fhir-types/hl7-fhir-r4-core/Resource.d.ts.map +1 -1
- package/dist/src/fhir-types/hl7-fhir-r4-core/index.d.ts +5 -0
- package/dist/src/fhir-types/hl7-fhir-r4-core/index.d.ts.map +1 -1
- package/dist/src/fhir-types/hl7-fhir-r4-core/index.js +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/result.d.ts +114 -3
- package/dist/src/result.d.ts.map +1 -1
- package/dist/src/result.js +6 -2
- package/dist/src/smart-backend-services.d.ts +44 -0
- package/dist/src/smart-backend-services.d.ts.map +1 -0
- package/dist/src/smart-backend-services.js +685 -0
- package/dist/src/types.d.ts +104 -70
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +10 -2
- package/dist/src/utils.d.ts +10 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +22 -0
- package/dist/test/auth-providers.test.d.ts +2 -0
- package/dist/test/auth-providers.test.d.ts.map +1 -0
- package/dist/test/basic-auth.test.d.ts +2 -0
- package/dist/test/basic-auth.test.d.ts.map +1 -0
- package/dist/test/smart-backend-services.test.d.ts +2 -0
- package/dist/test/smart-backend-services.test.d.ts.map +1 -0
- package/dist/test/utils.test.d.ts +2 -0
- package/dist/test/utils.test.d.ts.map +1 -0
- package/package.json +3 -1
- package/dist/src/fhir-http.d.ts +0 -96
- package/dist/src/fhir-http.d.ts.map +0 -1
- package/dist/src/fhir-http.js +0 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { Result } from "./result";
|
|
1
|
+
import type { AddPatch, CopyPatch, MovePatch, RemovePatch, ReplacePatch, TestPatch } from "json-patch";
|
|
2
|
+
import type { Resource } from "./fhir-types/hl7-fhir-r4-core";
|
|
4
3
|
export type Parameters = [string, string][];
|
|
5
4
|
export type Headers = Record<string, string>;
|
|
6
5
|
export type AuthProvider = {
|
|
@@ -9,10 +8,6 @@ export type AuthProvider = {
|
|
|
9
8
|
revokeSession: () => void;
|
|
10
9
|
establishSession: () => void;
|
|
11
10
|
};
|
|
12
|
-
export type ClientParams = {
|
|
13
|
-
baseUrl: string;
|
|
14
|
-
authProvider: AuthProvider;
|
|
15
|
-
};
|
|
16
11
|
export type User = Resource & {
|
|
17
12
|
email?: string;
|
|
18
13
|
};
|
|
@@ -32,6 +27,9 @@ export type ResponseWithMeta = {
|
|
|
32
27
|
export type ResourceResponse<T> = ResponseWithMeta & {
|
|
33
28
|
resource: T;
|
|
34
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* An error indicating that request didn't met client's expectations and was not sent as a result.
|
|
32
|
+
*/
|
|
35
33
|
export declare class RequestError extends Error {
|
|
36
34
|
request: RequestParams;
|
|
37
35
|
constructor(msg: string, { cause, request }: {
|
|
@@ -39,72 +37,108 @@ export declare class RequestError extends Error {
|
|
|
39
37
|
request: RequestParams;
|
|
40
38
|
});
|
|
41
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* An error indicating an unknown errornous response from the server.
|
|
42
|
+
*
|
|
43
|
+
* Thrown from `client.rawRequest` on any non-successful response code.
|
|
44
|
+
*
|
|
45
|
+
* Only thrown from `client.request` on any non-success code if response body isn't an `OperationOutcome`.
|
|
46
|
+
*/
|
|
42
47
|
export declare class ErrorResponse extends Error {
|
|
43
48
|
responseWithMeta: ResponseWithMeta;
|
|
44
49
|
constructor(msg: string, cause: ResponseWithMeta);
|
|
45
50
|
}
|
|
46
|
-
export type
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
51
|
+
export type ReadOptions = {
|
|
52
|
+
type: string;
|
|
53
|
+
id: string;
|
|
54
|
+
mimeType?: string;
|
|
55
|
+
};
|
|
56
|
+
export type VReadOptions = ReadOptions & {
|
|
57
|
+
vid: string;
|
|
58
|
+
};
|
|
59
|
+
export type SearchTypeOptions = {
|
|
60
|
+
type: string;
|
|
61
|
+
query: Parameters;
|
|
62
|
+
};
|
|
63
|
+
export type SearchSystemOptions = {
|
|
64
|
+
query: Parameters;
|
|
65
|
+
};
|
|
66
|
+
export type SearchCompartmentOptions = {
|
|
67
|
+
query: Parameters;
|
|
68
|
+
type: string;
|
|
69
|
+
compartment: string;
|
|
70
|
+
compartmentId: string;
|
|
71
|
+
};
|
|
72
|
+
export type CreateOptions<T> = {
|
|
73
|
+
type: string;
|
|
74
|
+
resource: T;
|
|
75
|
+
};
|
|
76
|
+
export type ConditionalCreateOptions<T> = {
|
|
77
|
+
type: string;
|
|
78
|
+
resource: T;
|
|
79
|
+
searchParameters: Parameters;
|
|
80
|
+
};
|
|
81
|
+
export type UpdateOptions<T> = {
|
|
82
|
+
type: string;
|
|
83
|
+
resource: T;
|
|
84
|
+
id: string;
|
|
85
|
+
};
|
|
86
|
+
export type ConditionalUpdateOptions<T> = {
|
|
87
|
+
type: string;
|
|
88
|
+
resource: T;
|
|
89
|
+
searchParameters: Parameters;
|
|
90
|
+
};
|
|
91
|
+
export type PatchOptions = {
|
|
92
|
+
type: string;
|
|
93
|
+
id: string;
|
|
94
|
+
patch: (AddPatch | RemovePatch | ReplacePatch | MovePatch | CopyPatch | TestPatch)[];
|
|
95
|
+
};
|
|
96
|
+
export type ConditionalPatchOptions = {
|
|
97
|
+
type: string;
|
|
98
|
+
searchParameters: Parameters;
|
|
99
|
+
patch: (AddPatch | RemovePatch | ReplacePatch | MovePatch | CopyPatch | TestPatch)[];
|
|
100
|
+
};
|
|
101
|
+
export type DeleteOptions = {
|
|
102
|
+
type: string;
|
|
103
|
+
id: string;
|
|
104
|
+
};
|
|
105
|
+
export type ConditionalDeleteOptions = {
|
|
106
|
+
type?: string;
|
|
107
|
+
searchParameters: Parameters;
|
|
108
|
+
};
|
|
109
|
+
export type DeleteHistoryVersionOptions = {
|
|
110
|
+
type: string;
|
|
111
|
+
id: string;
|
|
112
|
+
vid: string;
|
|
113
|
+
};
|
|
114
|
+
export type HistoryInstanceOptions = {
|
|
115
|
+
type: string;
|
|
116
|
+
id: string;
|
|
117
|
+
};
|
|
118
|
+
export type HistoryTypeOptions = {
|
|
119
|
+
type: string;
|
|
120
|
+
};
|
|
121
|
+
export type HistorySystemOptions = Record<string, never>;
|
|
122
|
+
export type OperationOptions<T> = {
|
|
123
|
+
type: string;
|
|
124
|
+
id?: string;
|
|
125
|
+
operation: "$run" | "$validate";
|
|
126
|
+
resource: T;
|
|
127
|
+
};
|
|
128
|
+
export type ValidateOptions<T> = Omit<OperationOptions<T>, "operation">;
|
|
129
|
+
export type CapabilitiesOptions = {
|
|
130
|
+
mode: "full" | "normative" | "terminology";
|
|
131
|
+
};
|
|
132
|
+
export type BatchOptions<TBundle> = {
|
|
133
|
+
format: string;
|
|
134
|
+
bundle: TBundle & {
|
|
135
|
+
type: "batch";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export type TransactionOptions<TBundle> = {
|
|
139
|
+
format: string;
|
|
140
|
+
bundle: TBundle & {
|
|
141
|
+
type: "transaction";
|
|
142
|
+
};
|
|
109
143
|
};
|
|
110
144
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EACZ,SAAS,EACT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;AAC5C,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAGF,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,aAAa,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X,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAGzD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,OAAO,IAAI;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,GAAG;QACjB,IAAI,EAAE,OAAO,CAAC;KACd,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,OAAO,IAAI;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,GAAG;QACjB,IAAI,EAAE,aAAa,CAAC;KACpB,CAAC;CACF,CAAC"}
|
package/dist/src/types.js
CHANGED
|
@@ -116,7 +116,9 @@ function _is_native_reflect_construct() {
|
|
|
116
116
|
return !!result;
|
|
117
117
|
})();
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
/**
|
|
120
|
+
* An error indicating that request didn't met client's expectations and was not sent as a result.
|
|
121
|
+
*/ export var RequestError = /*#__PURE__*/ function(Error1) {
|
|
120
122
|
"use strict";
|
|
121
123
|
_inherits(RequestError, Error1);
|
|
122
124
|
function RequestError(msg, param) {
|
|
@@ -138,7 +140,13 @@ export var RequestError = /*#__PURE__*/ function(Error1) {
|
|
|
138
140
|
}
|
|
139
141
|
return RequestError;
|
|
140
142
|
}(_wrap_native_super(Error));
|
|
141
|
-
|
|
143
|
+
/**
|
|
144
|
+
* An error indicating an unknown errornous response from the server.
|
|
145
|
+
*
|
|
146
|
+
* Thrown from `client.rawRequest` on any non-successful response code.
|
|
147
|
+
*
|
|
148
|
+
* Only thrown from `client.request` on any non-success code if response body isn't an `OperationOutcome`.
|
|
149
|
+
*/ export var ErrorResponse = /*#__PURE__*/ function(Error1) {
|
|
142
150
|
"use strict";
|
|
143
151
|
_inherits(ErrorResponse, Error1);
|
|
144
152
|
function ErrorResponse(msg, cause) {
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { ResponseWithMeta } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Validate that fetch input URL starts with baseUrl.
|
|
4
|
+
* Throws if the URL doesn't match baseUrl.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateBaseUrl(input: RequestInfo | URL, baseUrl: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Merge two Headers objects.
|
|
9
|
+
* Headers from `override` take precedence over `base`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeHeaders(base?: Headers, override?: Headers): Headers;
|
|
2
12
|
export declare const coerceBody: <T>(meta: ResponseWithMeta) => Promise<T>;
|
|
3
13
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,OAAO,EAAE,MAAM,GACb,IAAI,CAMN;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAYxE;AAWD,eAAO,MAAM,UAAU,GAAU,CAAC,EAAE,MAAM,gBAAgB,KAAG,OAAO,CAAC,CAAC,CA2BrE,CAAC"}
|
package/dist/src/utils.js
CHANGED
|
@@ -127,6 +127,28 @@ function _ts_generator(thisArg, body) {
|
|
|
127
127
|
}
|
|
128
128
|
import YAML from "yaml";
|
|
129
129
|
import { ErrorResponse } from "./types";
|
|
130
|
+
/**
|
|
131
|
+
* Validate that fetch input URL starts with baseUrl.
|
|
132
|
+
* Throws if the URL doesn't match baseUrl.
|
|
133
|
+
*/ export function validateBaseUrl(input, baseUrl) {
|
|
134
|
+
var url = _instanceof(input, Request) ? input.url : input.toString();
|
|
135
|
+
if (!url.startsWith(baseUrl)) {
|
|
136
|
+
throw new Error("URL of the request must start with baseUrl");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Merge two Headers objects.
|
|
141
|
+
* Headers from `override` take precedence over `base`.
|
|
142
|
+
*/ export function mergeHeaders(base, override) {
|
|
143
|
+
var merged = new Headers();
|
|
144
|
+
base === null || base === void 0 ? void 0 : base.forEach(function(value, key) {
|
|
145
|
+
merged.set(key, value);
|
|
146
|
+
});
|
|
147
|
+
override === null || override === void 0 ? void 0 : override.forEach(function(value, key) {
|
|
148
|
+
merged.set(key, value);
|
|
149
|
+
});
|
|
150
|
+
return merged;
|
|
151
|
+
}
|
|
130
152
|
var normalizeContentType = function(contentType) {
|
|
131
153
|
var semicolon = contentType.indexOf(";");
|
|
132
154
|
if (semicolon !== -1) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-providers.test.d.ts","sourceRoot":"","sources":["../../test/auth-providers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-auth.test.d.ts","sourceRoot":"","sources":["../../test/basic-auth.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-backend-services.test.d.ts","sourceRoot":"","sources":["../../test/smart-backend-services.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../test/utils.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@health-samurai/aidbox-client",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.4",
|
|
4
4
|
"description": "A client library for communicating with Aidbox",
|
|
5
5
|
"author": "Health Samurai",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
".": "./dist/src/index.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@types/json-patch": "^0.0.33",
|
|
17
|
+
"oauth4webapi": "^3.8.3",
|
|
16
18
|
"yaml": "^2.8.1"
|
|
17
19
|
},
|
|
18
20
|
"publishConfig": {
|
package/dist/src/fhir-http.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import type { Parameters } from "./types";
|
|
2
|
-
export type ReadOptions = {
|
|
3
|
-
type: string;
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
export type VReadOptions = ReadOptions & {
|
|
7
|
-
vid: string;
|
|
8
|
-
};
|
|
9
|
-
export type SearchTypeOptions = {
|
|
10
|
-
type: string;
|
|
11
|
-
query: Parameters;
|
|
12
|
-
};
|
|
13
|
-
export type SearchSystemOptions = {
|
|
14
|
-
query: Parameters;
|
|
15
|
-
};
|
|
16
|
-
export type SearchCompartmentOptions = {
|
|
17
|
-
query: Parameters;
|
|
18
|
-
type: string;
|
|
19
|
-
compartment: string;
|
|
20
|
-
compartmentId: string;
|
|
21
|
-
};
|
|
22
|
-
export type CreateOptions = {
|
|
23
|
-
type: string;
|
|
24
|
-
resource: object;
|
|
25
|
-
};
|
|
26
|
-
export type ConditionalCreateOptions = {
|
|
27
|
-
type: string;
|
|
28
|
-
resource: object;
|
|
29
|
-
searchParameters: Parameters;
|
|
30
|
-
};
|
|
31
|
-
export type UpdateOptions = {
|
|
32
|
-
type: string;
|
|
33
|
-
resource: object;
|
|
34
|
-
id: string;
|
|
35
|
-
};
|
|
36
|
-
export type ConditionalUpdateOptions = {
|
|
37
|
-
type: string;
|
|
38
|
-
resource: object;
|
|
39
|
-
searchParameters: Parameters;
|
|
40
|
-
};
|
|
41
|
-
export type PatchOptions = {
|
|
42
|
-
type: string;
|
|
43
|
-
id: string;
|
|
44
|
-
patch: object;
|
|
45
|
-
};
|
|
46
|
-
export type ConditionalPatchOptions = {
|
|
47
|
-
type: string;
|
|
48
|
-
searchParameters: Parameters;
|
|
49
|
-
patch: object;
|
|
50
|
-
};
|
|
51
|
-
export type DeleteOptions = {
|
|
52
|
-
type: string;
|
|
53
|
-
id: string;
|
|
54
|
-
};
|
|
55
|
-
export type ConditionalDeleteOptions = {
|
|
56
|
-
type?: string;
|
|
57
|
-
searchParameters: Parameters;
|
|
58
|
-
};
|
|
59
|
-
export type DeleteHistoryVersionOptions = {
|
|
60
|
-
type: string;
|
|
61
|
-
id: string;
|
|
62
|
-
vid: string;
|
|
63
|
-
};
|
|
64
|
-
export type HistoryInstanceOptions = {
|
|
65
|
-
type: string;
|
|
66
|
-
id: string;
|
|
67
|
-
};
|
|
68
|
-
export type HistoryTypeOptions = {
|
|
69
|
-
type: string;
|
|
70
|
-
};
|
|
71
|
-
export type HistorySystemOptions = Record<string, never>;
|
|
72
|
-
export type OperationOptions = {
|
|
73
|
-
type: string;
|
|
74
|
-
id?: string;
|
|
75
|
-
operation: "$run" | "$validate";
|
|
76
|
-
resource: object;
|
|
77
|
-
};
|
|
78
|
-
export type ValidateOptions = Omit<OperationOptions, "operation">;
|
|
79
|
-
export type CapabilitiesOptions = {
|
|
80
|
-
mode: "full" | "normative" | "terminology";
|
|
81
|
-
};
|
|
82
|
-
type Bundle = Record<string, unknown>;
|
|
83
|
-
export type BatchOptions = {
|
|
84
|
-
format: string;
|
|
85
|
-
bundle: Bundle & {
|
|
86
|
-
type: "batch";
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export type TransactionOptions = {
|
|
90
|
-
format: string;
|
|
91
|
-
bundle: Bundle & {
|
|
92
|
-
type: "transaction";
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
export {};
|
|
96
|
-
//# sourceMappingURL=fhir-http.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fhir-http.d.ts","sourceRoot":"","sources":["../../src/fhir-http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACtC,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;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