@esushealth/sdk 0.0.0-stage → 0.1.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.
@@ -0,0 +1,124 @@
1
+ // Generated from the registered Esus integration routes and webhook catalog. Do not edit.
2
+ export const tenantWebhookEvents = [
3
+ "allergy_intolerance.created",
4
+ "allergy_intolerance.deleted",
5
+ "allergy_intolerance.updated",
6
+ "appointment.created",
7
+ "appointment.deleted",
8
+ "appointment.updated",
9
+ "condition.created",
10
+ "condition.deleted",
11
+ "condition.updated",
12
+ "consent.revoked",
13
+ "diagnostic_report.created",
14
+ "diagnostic_report.deleted",
15
+ "diagnostic_report.updated",
16
+ "document_reference.created",
17
+ "document_reference.deleted",
18
+ "document_reference.updated",
19
+ "encounter.created",
20
+ "encounter.deleted",
21
+ "encounter.updated",
22
+ "immunization.created",
23
+ "immunization.deleted",
24
+ "immunization.updated",
25
+ "medication_request.created",
26
+ "medication_request.deleted",
27
+ "medication_request.updated",
28
+ "observation.created",
29
+ "observation.deleted",
30
+ "observation.updated",
31
+ "patient.created",
32
+ "patient.deleted",
33
+ "patient.updated",
34
+ "procedure.created",
35
+ "procedure.deleted",
36
+ "procedure.updated",
37
+ "service_request.created",
38
+ "service_request.deleted",
39
+ "service_request.updated",
40
+ "user.created",
41
+ "user.deactivated",
42
+ "user.deleted",
43
+ "user.email_changed",
44
+ "user.email_verified",
45
+ "user.locked",
46
+ "user.mfa_disabled",
47
+ "user.mfa_enabled",
48
+ "user.password_changed",
49
+ "user.password_reset",
50
+ "user.patient_linked",
51
+ "user.patient_unlinked",
52
+ "user.reactivated",
53
+ "user.refresh_reuse",
54
+ "user.role_assigned",
55
+ "user.role_removed",
56
+ "user.webauthn_registered",
57
+ "user.webauthn_removed"
58
+ ];
59
+ export const patientPortalResources = ["AllergyIntolerance", "Condition", "Consent", "DiagnosticReport", "DocumentReference", "Encounter", "Immunization", "MedicationRequest", "Observation"];
60
+ export const clinicalWorkflowStatuses = {
61
+ "POST /pharmacy/adjust": 200,
62
+ "POST /pharmacy/dispense": 200,
63
+ "GET /pharmacy/expiring": 200,
64
+ "GET /pharmacy/low-stock": 200,
65
+ "POST /pharmacy/restock": 201,
66
+ "GET /pharmacy/stock": 200,
67
+ "POST /queue/:id/complete": 200,
68
+ "POST /queue/:id/no-show": 200,
69
+ "POST /queue/:id/start": 200,
70
+ "GET /queue/board": 200,
71
+ "POST /queue/call-next": 200,
72
+ "POST /queue/check-in": 201,
73
+ "GET /queue/stats": 200,
74
+ "GET /queue/waiting": 200,
75
+ };
76
+ export const tenantAppStatuses = {
77
+ "POST /tenant-apps/:id/backfill-patient-consents": 200,
78
+ "POST /tenant-apps/:id/email/test": 200,
79
+ "GET /tenant-apps/:id/roles/:roleId/users": 200,
80
+ "DELETE /tenant-apps/:id/roles/:roleId": 204,
81
+ "PATCH /tenant-apps/:id/roles/:roleId": 200,
82
+ "GET /tenant-apps/:id/roles": 200,
83
+ "POST /tenant-apps/:id/roles": 201,
84
+ "POST /tenant-apps/:id/staff-invitations": 201,
85
+ "GET /tenant-apps/:id/stats": 200,
86
+ "POST /tenant-apps/:id/user-invitations/:invId/resend": 200,
87
+ "DELETE /tenant-apps/:id/user-invitations/:invId": 204,
88
+ "POST /tenant-apps/:id/user-invitations/bulk": 200,
89
+ "GET /tenant-apps/:id/user-invitations": 200,
90
+ "POST /tenant-apps/:id/user-invitations": 201,
91
+ "DELETE /tenant-apps/:id/users/:userId/roles/:roleId": 204,
92
+ "POST /tenant-apps/:id/users/:userId/roles/:roleId": 204,
93
+ "GET /tenant-apps/:id/users/:userId/roles": 200,
94
+ "POST /tenant-apps/:id/users/:userId/send-password-reset": 204,
95
+ "POST /tenant-apps/:id/users/:userId/verify-email": 204,
96
+ "DELETE /tenant-apps/:id/users/:userId": 204,
97
+ "GET /tenant-apps/:id/users/:userId": 200,
98
+ "PATCH /tenant-apps/:id/users/:userId": 204,
99
+ "GET /tenant-apps/:id/users": 200,
100
+ "DELETE /tenant-apps/:id": 204,
101
+ "GET /tenant-apps/:id": 200,
102
+ "PATCH /tenant-apps/:id": 200,
103
+ "GET /tenant-apps": 200,
104
+ "POST /tenant-apps": 201,
105
+ "PATCH /v1/auth/users/:userId": 200,
106
+ };
107
+ export const organizationStatuses = {
108
+ "GET /admin/audit": 200,
109
+ "GET /admin/audit/patient/:patientId": 200,
110
+ "GET /admin/audit/user/:userId": 200,
111
+ "GET /admin/email-log": 200,
112
+ "GET /billing/plan": 200,
113
+ "GET /billing/usage/history": 200,
114
+ "GET /billing/usage": 200,
115
+ "GET /organizations/:id/cors-origins": 200,
116
+ "PUT /organizations/:id/cors-origins": 200,
117
+ "GET /plan/quota": 200,
118
+ "DELETE /smart/apps/:id": 204,
119
+ "GET /smart/apps/:id": 200,
120
+ "PUT /smart/apps/:id": 200,
121
+ "GET /smart/apps": 200,
122
+ "POST /smart/apps": 201,
123
+ "GET /v1/admin/audit": 200,
124
+ };
@@ -0,0 +1,11 @@
1
+ import type { IntegrationResults } from "./integration-contract.js";
2
+ import { type RequestOptions, type Transport } from "./transport.js";
3
+ type Params = Readonly<Record<string, string>>;
4
+ type Options = RequestOptions & {
5
+ body?: object;
6
+ query?: object;
7
+ };
8
+ type ParamFormatter = (value: string | undefined, name: string) => string;
9
+ export declare const uuidPattern: RegExp;
10
+ export declare function integrationRequest<R extends keyof IntegrationResults>(request: Transport, statuses: Readonly<Record<R, number>>, format: ParamFormatter, invalidMessage: string): <Route extends R>(route: Route, params: Params, { signal, body, query }?: Options) => Promise<IntegrationResults[Route]["body"]>;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import { queryPath } from "./fhir.js";
2
+ import { EsusError, record } from "./transport.js";
3
+ export const uuidPattern = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
4
+ export function integrationRequest(request, statuses, format, invalidMessage) {
5
+ return async (route, params, { signal, body, query } = {}) => {
6
+ const separator = route.indexOf(" ");
7
+ const method = route.slice(0, separator);
8
+ const path = route.slice(separator + 1).replace(/:(\w+)/g, (_, parameter) => format(params[parameter], parameter));
9
+ const { body: result, response } = await request(query ? queryPath(path, query) : path, {
10
+ method, signal,
11
+ ...(body === undefined ? {} : { headers: { "content-type": "application/json" }, body: JSON.stringify(body) }),
12
+ });
13
+ const expected = statuses[route];
14
+ if (response.status !== expected || (expected !== 204 && !record(result))) {
15
+ throw new EsusError(invalidMessage, response.status, response.headers.get("x-request-id"));
16
+ }
17
+ return (expected === 204 ? undefined : result);
18
+ };
19
+ }
@@ -0,0 +1,324 @@
1
+ import { type IntegrationInputs, type IntegrationQueries, type IntegrationResults } from "./integration-contract.js";
2
+ import type { RequestOptions, Transport } from "./transport.js";
3
+ type AuditQuery = IntegrationQueries["GET /admin/audit"];
4
+ type Query<R extends keyof IntegrationQueries> = IntegrationQueries[R];
5
+ type Input<R extends keyof IntegrationInputs> = IntegrationInputs[R];
6
+ export type OrganizationAuditEvent = IntegrationResults["GET /v1/admin/audit"]["body"]["events"][number];
7
+ export type OrganizationEmailLogEntry = IntegrationResults["GET /admin/email-log"]["body"]["entries"][number];
8
+ export type RegisteredSmartApp = IntegrationResults["GET /smart/apps/:id"]["body"];
9
+ export declare function organizationClient(request: Transport, organizationId: string): {
10
+ audit: {
11
+ searchEvents: (query?: Query<"GET /v1/admin/audit">, options?: RequestOptions) => Promise<{
12
+ readonly events: ReadonlyArray<{
13
+ readonly "id": string;
14
+ readonly "type": string;
15
+ readonly "subtype": string | null;
16
+ readonly "action": "C" | "R" | "U" | "D" | "E";
17
+ readonly "outcome": "success" | "failure";
18
+ readonly "outcomeDesc": string | null;
19
+ readonly "agent": {
20
+ readonly "userId"?: string;
21
+ readonly "email"?: string;
22
+ readonly "ip"?: string;
23
+ readonly "userAgent"?: string;
24
+ };
25
+ readonly "entity": {
26
+ readonly "resourceType"?: string;
27
+ readonly "resourceId"?: string;
28
+ readonly "query"?: string;
29
+ } | null;
30
+ readonly "recordedAt": string;
31
+ }>;
32
+ readonly nextCursor: string | null;
33
+ }>;
34
+ searchLogs: (query?: AuditQuery, options?: RequestOptions) => Promise<{
35
+ readonly rows: ReadonlyArray<{
36
+ readonly "id": string;
37
+ readonly "organizationId"?: string | null;
38
+ readonly "type": string;
39
+ readonly "subtype"?: string | null;
40
+ readonly "action": "C" | "R" | "U" | "D" | "E";
41
+ readonly "outcome": "success" | "failure";
42
+ readonly "outcomeDesc"?: string | null;
43
+ readonly "agent": {
44
+ readonly "userId"?: string;
45
+ readonly "email"?: string;
46
+ readonly "ip"?: string;
47
+ readonly "userAgent"?: string;
48
+ };
49
+ readonly "source"?: {
50
+ readonly "site"?: string;
51
+ readonly "observer"?: string;
52
+ readonly "integrity"?: string;
53
+ } | null;
54
+ readonly "entity"?: {
55
+ readonly "resourceType"?: string;
56
+ readonly "resourceId"?: string;
57
+ readonly "query"?: string;
58
+ readonly "patients"?: ReadonlyArray<string>;
59
+ } | null;
60
+ readonly "recorded": string;
61
+ }>;
62
+ readonly total: number;
63
+ }>;
64
+ forPatient: (patientId: string, query?: AuditQuery, options?: RequestOptions) => Promise<{
65
+ readonly rows: ReadonlyArray<{
66
+ readonly "id": string;
67
+ readonly "organizationId"?: string | null;
68
+ readonly "type": string;
69
+ readonly "subtype"?: string | null;
70
+ readonly "action": "C" | "R" | "U" | "D" | "E";
71
+ readonly "outcome": "success" | "failure";
72
+ readonly "outcomeDesc"?: string | null;
73
+ readonly "agent": {
74
+ readonly "userId"?: string;
75
+ readonly "email"?: string;
76
+ readonly "ip"?: string;
77
+ readonly "userAgent"?: string;
78
+ };
79
+ readonly "source"?: {
80
+ readonly "site"?: string;
81
+ readonly "observer"?: string;
82
+ readonly "integrity"?: string;
83
+ } | null;
84
+ readonly "entity"?: {
85
+ readonly "resourceType"?: string;
86
+ readonly "resourceId"?: string;
87
+ readonly "query"?: string;
88
+ readonly "patients"?: ReadonlyArray<string>;
89
+ } | null;
90
+ readonly "recorded": string;
91
+ }>;
92
+ readonly total: number;
93
+ }>;
94
+ forUser: (userId: string, query?: AuditQuery, options?: RequestOptions) => Promise<{
95
+ readonly rows: ReadonlyArray<{
96
+ readonly "id": string;
97
+ readonly "organizationId"?: string | null;
98
+ readonly "type": string;
99
+ readonly "subtype"?: string | null;
100
+ readonly "action": "C" | "R" | "U" | "D" | "E";
101
+ readonly "outcome": "success" | "failure";
102
+ readonly "outcomeDesc"?: string | null;
103
+ readonly "agent": {
104
+ readonly "userId"?: string;
105
+ readonly "email"?: string;
106
+ readonly "ip"?: string;
107
+ readonly "userAgent"?: string;
108
+ };
109
+ readonly "source"?: {
110
+ readonly "site"?: string;
111
+ readonly "observer"?: string;
112
+ readonly "integrity"?: string;
113
+ } | null;
114
+ readonly "entity"?: {
115
+ readonly "resourceType"?: string;
116
+ readonly "resourceId"?: string;
117
+ readonly "query"?: string;
118
+ readonly "patients"?: ReadonlyArray<string>;
119
+ } | null;
120
+ readonly "recorded": string;
121
+ }>;
122
+ readonly total: number;
123
+ }>;
124
+ emailLog: (query?: Query<"GET /admin/email-log">, options?: RequestOptions) => Promise<{
125
+ readonly entries: ReadonlyArray<{
126
+ readonly "id": string;
127
+ readonly "appId": string | null;
128
+ readonly "toAddress": string;
129
+ readonly "subject": string;
130
+ readonly "template": string;
131
+ readonly "status": string;
132
+ readonly "attempts": number;
133
+ readonly "lastError": string | null;
134
+ readonly "queuedAt": string;
135
+ readonly "deliveredAt": string | null;
136
+ readonly "failedAt": string | null;
137
+ }>;
138
+ readonly nextCursor: string | null;
139
+ }>;
140
+ };
141
+ billing: {
142
+ plan: (options?: RequestOptions) => Promise<{
143
+ readonly organizationId: string;
144
+ readonly tier: {
145
+ readonly "id": string;
146
+ readonly "name": string;
147
+ readonly "displayName": string;
148
+ readonly "description": string | null;
149
+ readonly "isActive": boolean;
150
+ readonly "maxPatients": number;
151
+ readonly "maxPractitioners": number;
152
+ readonly "maxUsers": number;
153
+ readonly "maxApiKeys": number;
154
+ readonly "maxRequestsPerMonth": number;
155
+ readonly "rateLimitPerMinute": number;
156
+ readonly "writeLimitPerMinute": number;
157
+ readonly "features": {
158
+ readonly [key: string]: boolean;
159
+ };
160
+ readonly "commercial": {
161
+ readonly "published": boolean;
162
+ readonly "currency": "USD";
163
+ readonly "monthlyPriceCents": string | number | null;
164
+ readonly "annualPriceCents": string | number | null;
165
+ readonly "launchEndsAt": string | null;
166
+ readonly "support": "community" | "email" | "dedicated";
167
+ readonly "sla": "none" | "standard" | "custom";
168
+ } | null;
169
+ readonly "createdAt": string;
170
+ readonly "updatedAt": string;
171
+ };
172
+ readonly effectiveLimits: {
173
+ readonly "tierName": string;
174
+ readonly "tierDisplayName": string;
175
+ readonly "maxPatients": number;
176
+ readonly "maxPractitioners": number;
177
+ readonly "maxUsers": number;
178
+ readonly "maxApiKeys": number;
179
+ readonly "maxRequestsPerMonth": number;
180
+ readonly "rateLimitPerMinute": number;
181
+ readonly "writeLimitPerMinute": number;
182
+ readonly "features": {
183
+ readonly [key: string]: boolean;
184
+ };
185
+ };
186
+ readonly assignedAt: string;
187
+ readonly assignedBy: string | null;
188
+ readonly notes: string | null;
189
+ readonly hasOverrides: boolean;
190
+ }>;
191
+ usage: (options?: RequestOptions) => Promise<{
192
+ readonly organizationId: string;
193
+ readonly tierName: string;
194
+ readonly patients: {
195
+ readonly "current": number;
196
+ readonly "limit": number;
197
+ readonly "remaining": number;
198
+ readonly "percentUsed": number;
199
+ };
200
+ readonly practitioners: {
201
+ readonly "current": number;
202
+ readonly "limit": number;
203
+ readonly "remaining": number;
204
+ readonly "percentUsed": number;
205
+ };
206
+ readonly users: {
207
+ readonly "current": number;
208
+ readonly "limit": number;
209
+ readonly "remaining": number;
210
+ readonly "percentUsed": number;
211
+ };
212
+ readonly apiKeys: {
213
+ readonly "current": number;
214
+ readonly "limit": number;
215
+ readonly "remaining": number;
216
+ readonly "percentUsed": number;
217
+ };
218
+ readonly requestsThisMonth: {
219
+ readonly "current": number;
220
+ readonly "limit": number;
221
+ readonly "remaining": number;
222
+ readonly "percentUsed": number;
223
+ };
224
+ }>;
225
+ usageHistory: (query?: Query<"GET /billing/usage/history">, options?: RequestOptions) => Promise<{
226
+ readonly entries: ReadonlyArray<{
227
+ readonly "id": string;
228
+ readonly "organizationId": string;
229
+ readonly "period": string;
230
+ readonly "requestCount": number;
231
+ readonly "resourceCount": number;
232
+ readonly "storageBytes": number;
233
+ readonly "lastUpdated": string;
234
+ }>;
235
+ readonly total: number;
236
+ }>;
237
+ quota: (options?: RequestOptions) => Promise<{
238
+ readonly patients: {
239
+ readonly "current": number;
240
+ readonly "limit": number;
241
+ };
242
+ readonly practitioners: {
243
+ readonly "current": number;
244
+ readonly "limit": number;
245
+ };
246
+ readonly apiKeys: {
247
+ readonly "current": number;
248
+ readonly "limit": number;
249
+ };
250
+ }>;
251
+ };
252
+ cors: {
253
+ list: (options?: RequestOptions) => Promise<{
254
+ readonly origins: ReadonlyArray<string>;
255
+ }>;
256
+ replace: (body: Input<"PUT /organizations/:id/cors-origins">, options?: RequestOptions) => Promise<{
257
+ readonly origins: ReadonlyArray<string>;
258
+ }>;
259
+ };
260
+ smartApps: {
261
+ list: (query?: Query<"GET /smart/apps">, options?: RequestOptions) => Promise<{
262
+ readonly items: ReadonlyArray<{
263
+ readonly "id": string;
264
+ readonly "clientId": string;
265
+ readonly "name": string;
266
+ readonly "description"?: string;
267
+ readonly "redirectUris": ReadonlyArray<string>;
268
+ readonly "scopes": ReadonlyArray<string>;
269
+ readonly "launchUri"?: string;
270
+ readonly "logoUri"?: string;
271
+ readonly "isConfidential": boolean;
272
+ readonly "active": boolean;
273
+ readonly "createdAt": string;
274
+ readonly "updatedAt": string;
275
+ }>;
276
+ readonly total: number;
277
+ }>;
278
+ get: (id: string, options?: RequestOptions) => Promise<{
279
+ readonly id: string;
280
+ readonly clientId: string;
281
+ readonly name: string;
282
+ readonly description?: string;
283
+ readonly redirectUris: ReadonlyArray<string>;
284
+ readonly scopes: ReadonlyArray<string>;
285
+ readonly launchUri?: string;
286
+ readonly logoUri?: string;
287
+ readonly isConfidential: boolean;
288
+ readonly active: boolean;
289
+ readonly createdAt: string;
290
+ readonly updatedAt: string;
291
+ }>;
292
+ create: (body: Input<"POST /smart/apps">, options?: RequestOptions) => Promise<{
293
+ readonly id: string;
294
+ readonly clientId: string;
295
+ readonly name: string;
296
+ readonly description?: string;
297
+ readonly redirectUris: ReadonlyArray<string>;
298
+ readonly scopes: ReadonlyArray<string>;
299
+ readonly launchUri?: string;
300
+ readonly logoUri?: string;
301
+ readonly isConfidential: boolean;
302
+ readonly active: boolean;
303
+ readonly createdAt: string;
304
+ readonly updatedAt: string;
305
+ readonly clientSecret: string;
306
+ }>;
307
+ update: (id: string, body: Input<"PUT /smart/apps/:id">, options?: RequestOptions) => Promise<{
308
+ readonly id: string;
309
+ readonly clientId: string;
310
+ readonly name: string;
311
+ readonly description?: string;
312
+ readonly redirectUris: ReadonlyArray<string>;
313
+ readonly scopes: ReadonlyArray<string>;
314
+ readonly launchUri?: string;
315
+ readonly logoUri?: string;
316
+ readonly isConfidential: boolean;
317
+ readonly active: boolean;
318
+ readonly createdAt: string;
319
+ readonly updatedAt: string;
320
+ }>;
321
+ delete: (id: string, options?: RequestOptions) => Promise<undefined>;
322
+ };
323
+ };
324
+ export {};
@@ -0,0 +1,43 @@
1
+ import { validSegment } from "./fhir.js";
2
+ import { organizationStatuses } from "./integration-contract.js";
3
+ import { integrationRequest, uuidPattern } from "./integration-request.js";
4
+ function formatParam(value, name) {
5
+ if (value !== undefined) {
6
+ if (name === "id" && uuidPattern.test(value))
7
+ return value.toLowerCase();
8
+ if (name !== "id" && validSegment(value))
9
+ return value;
10
+ if (name === "userId" && value.startsWith("apikey:") && uuidPattern.test(value.slice(7)))
11
+ return encodeURIComponent(value);
12
+ }
13
+ throw new TypeError(`Invalid organization API path parameter: ${name}`);
14
+ }
15
+ export function organizationClient(request, organizationId) {
16
+ const call = integrationRequest(request, organizationStatuses, formatParam, "Esus returned an invalid organization response");
17
+ return {
18
+ audit: {
19
+ searchEvents: (query, options) => call("GET /v1/admin/audit", {}, { ...options, query }),
20
+ searchLogs: (query, options) => call("GET /admin/audit", {}, { ...options, query }),
21
+ forPatient: (patientId, query, options) => call("GET /admin/audit/patient/:patientId", { patientId }, { ...options, query }),
22
+ forUser: (userId, query, options) => call("GET /admin/audit/user/:userId", { userId }, { ...options, query }),
23
+ emailLog: (query, options) => call("GET /admin/email-log", {}, { ...options, query }),
24
+ },
25
+ billing: {
26
+ plan: (options) => call("GET /billing/plan", {}, options),
27
+ usage: (options) => call("GET /billing/usage", {}, options),
28
+ usageHistory: (query, options) => call("GET /billing/usage/history", {}, { ...options, query }),
29
+ quota: (options) => call("GET /plan/quota", {}, options),
30
+ },
31
+ cors: {
32
+ list: (options) => call("GET /organizations/:id/cors-origins", { id: organizationId }, options),
33
+ replace: (body, options) => call("PUT /organizations/:id/cors-origins", { id: organizationId }, { ...options, body }),
34
+ },
35
+ smartApps: {
36
+ list: (query, options) => call("GET /smart/apps", {}, { ...options, query }),
37
+ get: (id, options) => call("GET /smart/apps/:id", { id }, options),
38
+ create: (body, options) => call("POST /smart/apps", {}, { ...options, body }),
39
+ update: (id, body, options) => call("PUT /smart/apps/:id", { id }, { ...options, body }),
40
+ delete: (id, options) => call("DELETE /smart/apps/:id", { id }, options),
41
+ },
42
+ };
43
+ }
@@ -0,0 +1,2 @@
1
+ import type { FhirCreateInputs } from "./fhir-contract.js";
2
+ export type PatientInput = FhirCreateInputs["Patient"];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,125 @@
1
+ import type { IntegrationQueries } from "./integration-contract.js";
2
+ import { type RequestOptions, type TransportOptions } from "./transport.js";
3
+ export declare function createPublicClient(options: Omit<TransportOptions, "organizationId">): {
4
+ planCatalog(options?: RequestOptions): Promise<{
5
+ readonly plans: ReadonlyArray<{
6
+ readonly "name": string;
7
+ readonly "displayName": string;
8
+ readonly "limits": {
9
+ readonly "patients": string | number;
10
+ readonly "practitioners": string | number;
11
+ readonly "users": string | number;
12
+ readonly "apiKeys": string | number;
13
+ readonly "requests": string | number;
14
+ readonly "rateLimit": string | number;
15
+ readonly "writeLimit": string | number;
16
+ };
17
+ readonly "features": {
18
+ readonly "smart_on_fhir": boolean;
19
+ readonly "bulk_export": boolean;
20
+ readonly "webhooks": boolean;
21
+ };
22
+ readonly "pricing": {
23
+ readonly "currency": "USD";
24
+ readonly "monthlyPriceCents": string | number | null;
25
+ readonly "annualPriceCents": string | number | null;
26
+ readonly "launchEndsAt": string | null;
27
+ readonly "annualMonthlyEquivalentCents": string | number | null;
28
+ readonly "annualSavingsCents": string | number | null;
29
+ readonly "freeMonths": string | number;
30
+ };
31
+ readonly "support": "community" | "email" | "dedicated";
32
+ readonly "sla": "none" | "standard" | "custom";
33
+ readonly "checkout": {
34
+ readonly "month": boolean;
35
+ readonly "year": boolean;
36
+ };
37
+ }>;
38
+ }>;
39
+ health: {
40
+ summary(options?: RequestOptions): Promise<{
41
+ readonly status: "ok" | "degraded" | "down";
42
+ readonly timestamp: string;
43
+ }>;
44
+ live(options?: RequestOptions): Promise<{
45
+ readonly status: "ok";
46
+ }>;
47
+ ready(options?: RequestOptions): Promise<{
48
+ status: number;
49
+ body: {
50
+ readonly status: "ok" | "degraded" | "down";
51
+ readonly timestamp: string;
52
+ readonly checks: {
53
+ readonly "database": {
54
+ readonly "status": string;
55
+ };
56
+ readonly "redis": {
57
+ readonly "status": string;
58
+ };
59
+ readonly "storage": {
60
+ readonly "status": string;
61
+ };
62
+ readonly "email": {
63
+ readonly "status": string;
64
+ };
65
+ readonly "queues": {
66
+ readonly "status": string;
67
+ };
68
+ readonly "backup": {
69
+ readonly "status": string;
70
+ readonly "heartbeatAt"?: string;
71
+ };
72
+ readonly "vault": {
73
+ readonly "status": string;
74
+ };
75
+ };
76
+ };
77
+ }>;
78
+ history(query?: IntegrationQueries["GET /health/history"], options?: RequestOptions): Promise<{
79
+ readonly range: {
80
+ readonly "from": string;
81
+ readonly "to": string;
82
+ readonly "bucket": "1m" | "5m" | "1h" | "1d";
83
+ };
84
+ readonly uptime: {
85
+ readonly "percent": number;
86
+ readonly "samples": number;
87
+ readonly "days": number;
88
+ };
89
+ readonly overall: ReadonlyArray<{
90
+ readonly "at": string;
91
+ readonly "status": "ok" | "degraded" | "down";
92
+ }>;
93
+ readonly components: {
94
+ readonly "database": ReadonlyArray<{
95
+ readonly "at": string;
96
+ readonly "status": "ok" | "degraded" | "down" | null;
97
+ }>;
98
+ readonly "redis": ReadonlyArray<{
99
+ readonly "at": string;
100
+ readonly "status": "ok" | "degraded" | "down" | null;
101
+ }>;
102
+ readonly "storage": ReadonlyArray<{
103
+ readonly "at": string;
104
+ readonly "status": "ok" | "degraded" | "down" | null;
105
+ }>;
106
+ readonly "email": ReadonlyArray<{
107
+ readonly "at": string;
108
+ readonly "status": "ok" | "degraded" | "down" | null;
109
+ }>;
110
+ readonly "queues": ReadonlyArray<{
111
+ readonly "at": string;
112
+ readonly "status": "ok" | "degraded" | "down" | null;
113
+ }>;
114
+ readonly "backup": ReadonlyArray<{
115
+ readonly "at": string;
116
+ readonly "status": "ok" | "degraded" | "down" | null;
117
+ }>;
118
+ readonly "vault": ReadonlyArray<{
119
+ readonly "at": string;
120
+ readonly "status": "ok" | "degraded" | "down" | null;
121
+ }>;
122
+ };
123
+ }>;
124
+ };
125
+ };