@ovok/core 0.4.49-dev.495 → 0.4.49-dev.496
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/client/observation/measurement-fields.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
- package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
- package/dist/client/observation/services/base-observation-service.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
- package/dist/client/observation/services/blood-oxygen.js +7 -7
- package/dist/client/observation/services/blood-pressure.d.ts +1 -1
- package/dist/client/observation/services/blood-pressure.js +16 -16
- package/dist/client/observation/services/component-observation-services.d.ts +1 -1
- package/dist/client/observation/services/component-observation-services.js +3 -3
- package/dist/client/observation/services/creator.d.ts +1 -1
- package/dist/client/observation/services/creator.js +10 -10
- package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
- package/dist/client/observation/services/ecg.d.ts +1 -1
- package/dist/client/observation/services/ecg.js +10 -10
- package/dist/client/observation/services/lipid-panel.d.ts +1 -1
- package/dist/client/observation/services/lipid-panel.js +13 -13
- package/dist/client/observation/services/single-value-services.d.ts +1 -1
- package/dist/client/observation/services/single-value-services.js +19 -19
- package/dist/client/observation/services/step-count.d.ts +1 -1
- package/dist/client/observation/services/step-count.js +5 -5
- package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
- package/dist/client/observation/services/uric-acid-service.js +7 -7
- package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
- package/dist/client/wearables/types.d.ts +5 -0
- package/dist/conformance/capability-requirements.js +1 -1
- package/dist/next/auth/access-token.d.ts +9 -0
- package/dist/next/auth/access-token.js +18 -0
- package/dist/next/auth/client-credentials.d.ts +16 -0
- package/dist/next/auth/client-credentials.js +40 -0
- package/dist/next/auth/credentials.d.ts +5 -0
- package/dist/next/auth/credentials.js +7 -0
- package/dist/next/auth/session-store.d.ts +12 -0
- package/dist/next/auth/session-store.js +33 -0
- package/dist/next/auth/session.d.ts +28 -0
- package/dist/next/auth/session.js +27 -0
- package/dist/next/auth/token-endpoint.d.ts +12 -0
- package/dist/next/auth/token-endpoint.js +28 -0
- package/dist/next/auth/user-session.d.ts +27 -0
- package/dist/next/auth/user-session.js +82 -0
- package/dist/next/config/ovok-config.d.ts +42 -0
- package/dist/next/config/ovok-config.js +2 -0
- package/dist/next/config/settings.d.ts +6 -0
- package/dist/next/config/settings.js +74 -0
- package/dist/next/errors/error-from-response.d.ts +2 -0
- package/dist/next/errors/error-from-response.js +35 -0
- package/dist/next/errors/ovok-errors.d.ts +42 -0
- package/dist/next/errors/ovok-errors.js +74 -0
- package/dist/next/http/http-client.d.ts +35 -0
- package/dist/next/http/http-client.js +113 -0
- package/dist/next/http/retry-after.d.ts +1 -0
- package/dist/next/http/retry-after.js +16 -0
- package/dist/next/http/retry-policy.d.ts +13 -0
- package/dist/next/http/retry-policy.js +27 -0
- package/dist/next/http/transmit.d.ts +14 -0
- package/dist/next/http/transmit.js +57 -0
- package/dist/next/http/url.d.ts +6 -0
- package/dist/next/http/url.js +22 -0
- package/dist/next/index.d.ts +69 -0
- package/dist/next/index.js +33 -0
- package/dist/next/ovok.d.ts +52 -0
- package/dist/next/ovok.js +74 -0
- package/dist/next/paging/bundle-page.d.ts +4 -0
- package/dist/next/paging/bundle-page.js +25 -0
- package/dist/next/paging/cursor-pages.d.ts +7 -0
- package/dist/next/paging/cursor-pages.js +14 -0
- package/dist/next/paging/numbered-pages.d.ts +15 -0
- package/dist/next/paging/numbered-pages.js +20 -0
- package/dist/next/paging/page.d.ts +12 -0
- package/dist/next/paging/page.js +17 -0
- package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
- package/dist/next/resources/accounts/accounts-resource.js +13 -0
- package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
- package/dist/next/resources/ai/ai-chat-resource.js +12 -0
- package/dist/next/resources/ai/ai-resource.d.ts +16 -0
- package/dist/next/resources/ai/ai-resource.js +19 -0
- package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
- package/dist/next/resources/ai/chat-messages-resource.js +18 -0
- package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
- package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
- package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
- package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
- package/dist/next/resources/auth/registration.d.ts +35 -0
- package/dist/next/resources/auth/registration.js +24 -0
- package/dist/next/resources/auth/social-login.d.ts +8 -0
- package/dist/next/resources/auth/social-login.js +7 -0
- package/dist/next/resources/auth-resource.d.ts +63 -0
- package/dist/next/resources/auth-resource.js +119 -0
- package/dist/next/resources/bots/bots-resource.d.ts +10 -0
- package/dist/next/resources/bots/bots-resource.js +15 -0
- package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
- package/dist/next/resources/cms/cms-delivery.js +36 -0
- package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
- package/dist/next/resources/cms/cms-documents-resource.js +17 -0
- package/dist/next/resources/cms/cms-resource.d.ts +17 -0
- package/dist/next/resources/cms/cms-resource.js +38 -0
- package/dist/next/resources/cms/payload-pages.d.ts +6 -0
- package/dist/next/resources/cms/payload-pages.js +15 -0
- package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
- package/dist/next/resources/cms/release-notes-resource.js +15 -0
- package/dist/next/resources/cms/translation-tree.d.ts +3 -0
- package/dist/next/resources/cms/translation-tree.js +45 -0
- package/dist/next/resources/consent/consent-resource.d.ts +23 -0
- package/dist/next/resources/consent/consent-resource.js +43 -0
- package/dist/next/resources/content/content-resource.d.ts +19 -0
- package/dist/next/resources/content/content-resource.js +41 -0
- package/dist/next/resources/documents/documents-resource.d.ts +26 -0
- package/dist/next/resources/documents/documents-resource.js +41 -0
- package/dist/next/resources/email/email-resource.d.ts +6 -0
- package/dist/next/resources/email/email-resource.js +10 -0
- package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
- package/dist/next/resources/email/email-templates-resource.js +13 -0
- package/dist/next/resources/fhir-resource.d.ts +28 -0
- package/dist/next/resources/fhir-resource.js +64 -0
- package/dist/next/resources/health-resource.d.ts +17 -0
- package/dist/next/resources/health-resource.js +14 -0
- package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
- package/dist/next/resources/invites/invite-flow-resource.js +19 -0
- package/dist/next/resources/invites/invites-resource.d.ts +17 -0
- package/dist/next/resources/invites/invites-resource.js +14 -0
- package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
- package/dist/next/resources/localization/i18next-resource.js +18 -0
- package/dist/next/resources/localization/locales-resource.d.ts +9 -0
- package/dist/next/resources/localization/locales-resource.js +16 -0
- package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
- package/dist/next/resources/localization/localizations-resource.js +27 -0
- package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
- package/dist/next/resources/measurements/measurements-resource.js +77 -0
- package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
- package/dist/next/resources/measurements/observation-builder.js +57 -0
- package/dist/next/resources/measurements/save-error.d.ts +5 -0
- package/dist/next/resources/measurements/save-error.js +18 -0
- package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
- package/dist/next/resources/measurements/signed-in-account.js +26 -0
- package/dist/next/resources/patient/fhir-records.d.ts +19 -0
- package/dist/next/resources/patient/fhir-records.js +33 -0
- package/dist/next/resources/patient/patient-resource.d.ts +21 -0
- package/dist/next/resources/patient/patient-resource.js +38 -0
- package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
- package/dist/next/resources/projects/project-features-resource.js +17 -0
- package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
- package/dist/next/resources/projects/project-members-resource.js +25 -0
- package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
- package/dist/next/resources/projects/project-settings-resource.js +21 -0
- package/dist/next/resources/projects/projects-resource.d.ts +20 -0
- package/dist/next/resources/projects/projects-resource.js +21 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
- package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
- package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
- package/dist/next/resources/sharing/sharing-resource.js +14 -0
- package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
- package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
- package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
- package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
- package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
- package/dist/next/resources/signals/signals-resource.d.ts +13 -0
- package/dist/next/resources/signals/signals-resource.js +19 -0
- package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
- package/dist/next/resources/signals/undeliverable-resource.js +18 -0
- package/dist/next/resources/slim/live-reads.d.ts +12 -0
- package/dist/next/resources/slim/live-reads.js +76 -0
- package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
- package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
- package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
- package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
- package/dist/next/resources/slim/slim-devices-resource.d.ts +28 -0
- package/dist/next/resources/slim/slim-devices-resource.js +80 -0
- package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-exports-resource.js +14 -0
- package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
- package/dist/next/resources/slim/slim-locations-resource.js +30 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
- package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
- package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
- package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
- package/dist/next/resources/slim/slim-paths.d.ts +6 -0
- package/dist/next/resources/slim/slim-paths.js +9 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
- package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
- package/dist/next/resources/slim/slim-patients-resource.js +39 -0
- package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-policies-resource.js +29 -0
- package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
- package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
- package/dist/next/resources/slim/slim-projects-resource.js +35 -0
- package/dist/next/resources/slim/slim-queries.d.ts +34 -0
- package/dist/next/resources/slim/slim-queries.js +2 -0
- package/dist/next/resources/slim/slim-resource.d.ts +38 -0
- package/dist/next/resources/slim/slim-resource.js +44 -0
- package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
- package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
- package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-trends-resource.js +19 -0
- package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-users-resource.js +15 -0
- package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-zones-resource.js +24 -0
- package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
- package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
- package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
- package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
- package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
- package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
- package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
- package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
- package/dist/next/resources/wearables/wearables-resource.js +14 -0
- package/dist/next/storage/ovok-storage.d.ts +11 -0
- package/dist/next/storage/ovok-storage.js +19 -0
- package/dist/types/MeasurementTypes.d.ts +5 -0
- package/dist/types/MeasurementTypes.js +21 -0
- package/dist/types/index.d.ts +1 -5
- package/dist/types/index.js +1 -5
- package/next/index.d.ts +1 -0
- package/next/index.js +3 -0
- package/package.json +3 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pathSegment = exports.joinPath = void 0;
|
|
4
|
+
exports.toSearchQuery = toSearchQuery;
|
|
5
|
+
const joinPath = (...parts) => parts
|
|
6
|
+
.map((part) => part.replace(/^\/+|\/+$/g, ""))
|
|
7
|
+
.filter((part) => part !== "")
|
|
8
|
+
.join("/");
|
|
9
|
+
exports.joinPath = joinPath;
|
|
10
|
+
const pathSegment = (value) => encodeURIComponent(value);
|
|
11
|
+
exports.pathSegment = pathSegment;
|
|
12
|
+
/** A list value repeats its key, so `date: ["ge1", "le2"]` is FHIR's AND; write "a,b" for OR. */
|
|
13
|
+
function toSearchQuery(params) {
|
|
14
|
+
const pairs = Object.entries(params).flatMap(([key, value]) => valuesOf(value).map((entry) => `${encodeURIComponent(key)}=${encodeURIComponent(entry)}`));
|
|
15
|
+
return pairs.length === 0 ? "" : `?${pairs.join("&")}`;
|
|
16
|
+
}
|
|
17
|
+
const valuesOf = (value) => {
|
|
18
|
+
if (value === undefined) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
return typeof value === "object" ? value.map(String) : [String(value)];
|
|
22
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export { Ovok } from "./ovok";
|
|
2
|
+
export type { OvokConfig, OvokFetch, OvokUnauthenticatedReason } from "./config/ovok-config";
|
|
3
|
+
export { MemoryStorage } from "./storage/ovok-storage";
|
|
4
|
+
export type { OvokStorage } from "./storage/ovok-storage";
|
|
5
|
+
export { OvokAuthenticationError, OvokConfigError, OvokConflictError, OvokConnectionError, OvokError, OvokNotFoundError, OvokPermissionError, OvokRateLimitError, OvokServiceError, OvokValidationError, } from "./errors/ovok-errors";
|
|
6
|
+
export type { OvokErrorDetails } from "./errors/ovok-errors";
|
|
7
|
+
export type { RequestOptions } from "./http/transmit";
|
|
8
|
+
export type { QueryParams, QueryValue } from "./http/url";
|
|
9
|
+
export type { Page, PagePromise } from "./paging/page";
|
|
10
|
+
export type { OvokReference, Session } from "./auth/session";
|
|
11
|
+
export type { LoginCredentials, LoginResult, MfaChallenge, ProfileType } from "./resources/auth-resource";
|
|
12
|
+
export type { CreateOptions, PatchOperation } from "./resources/fhir-resource";
|
|
13
|
+
export type { HealthCheck } from "./resources/health-resource";
|
|
14
|
+
export type { PatientRegistration, PractitionerRegistration, RegisterResult } from "./resources/auth/registration";
|
|
15
|
+
export type { SocialCredentials, SocialProvider } from "./resources/auth/social-login";
|
|
16
|
+
export type { LastObservationsQuery, LatestObservationsParams, MeasurementCodeTypes, SaveObservationsOptions, SaveObservationsResult, } from "./resources/measurements/measurements-resource";
|
|
17
|
+
export type { BuildObservationsParams } from "./resources/measurements/observation-builder";
|
|
18
|
+
export type { SignalsDeliveryRepair, SignalsDeliveryRepairResult, SignalsUndeliverable, SignalsUndeliverableResident, } from "./resources/signals/undeliverable-resource";
|
|
19
|
+
export type { ProjectListQuery } from "./resources/projects/projects-resource";
|
|
20
|
+
export type { ProjectMemberListQuery } from "./resources/projects/project-members-resource";
|
|
21
|
+
export type { LocalizationList } from "./resources/localization/localizations-resource";
|
|
22
|
+
export type { PersonInviteFlow, RecordShareFlow } from "./resources/invites/invites-resource";
|
|
23
|
+
export type { AiFhirSearchRequest } from "./resources/ai/ai-resource";
|
|
24
|
+
export type { ChatSessionRetrieveParams } from "./resources/ai/chat-sessions-resource";
|
|
25
|
+
export type { VideoCallAccessPermission } from "./resources/video-calls/video-call-access-resource";
|
|
26
|
+
export type { ActiveCallNotification } from "./resources/video-calls/video-calls-resource";
|
|
27
|
+
export type { CmsListParams, CmsReadParams } from "./resources/cms/cms-delivery";
|
|
28
|
+
export type { DeletedDocument, DocumentDownloadParams } from "./resources/documents/documents-resource";
|
|
29
|
+
export type { BotInput, BotOutput } from "./resources/bots/bots-resource";
|
|
30
|
+
export type * from "./resources/slim/slim-queries";
|
|
31
|
+
export type { AccountsResource } from "./resources/accounts/accounts-resource";
|
|
32
|
+
export type { AiResource } from "./resources/ai/ai-resource";
|
|
33
|
+
export type { AuthResource } from "./resources/auth-resource";
|
|
34
|
+
export type { BotsResource } from "./resources/bots/bots-resource";
|
|
35
|
+
export type { CmsResource } from "./resources/cms/cms-resource";
|
|
36
|
+
export type { ConsentResource } from "./resources/consent/consent-resource";
|
|
37
|
+
export type { ContentResource } from "./resources/content/content-resource";
|
|
38
|
+
export type { DocumentsResource } from "./resources/documents/documents-resource";
|
|
39
|
+
export type { EmailResource } from "./resources/email/email-resource";
|
|
40
|
+
export type { FhirResource } from "./resources/fhir-resource";
|
|
41
|
+
export type { HealthResource } from "./resources/health-resource";
|
|
42
|
+
export type { InvitesResource } from "./resources/invites/invites-resource";
|
|
43
|
+
export type { LocalesResource } from "./resources/localization/locales-resource";
|
|
44
|
+
export type { LocalizationsResource } from "./resources/localization/localizations-resource";
|
|
45
|
+
export type { MeasurementsResource } from "./resources/measurements/measurements-resource";
|
|
46
|
+
export type { PatientResource } from "./resources/patient/patient-resource";
|
|
47
|
+
export type { ProjectsResource } from "./resources/projects/projects-resource";
|
|
48
|
+
export type { QuestionnaireResponsesResource, QuestionnairesResource, } from "./resources/questionnaires/questionnaires-resource";
|
|
49
|
+
export type { SharingResource } from "./resources/sharing/sharing-resource";
|
|
50
|
+
export type { SignalsResource } from "./resources/signals/signals-resource";
|
|
51
|
+
export type { SignalsGatewayRequest } from "./resources/signals/signals-gateway-resource";
|
|
52
|
+
export type { SlimResource } from "./resources/slim/slim-resource";
|
|
53
|
+
export type { VideoCallsResource } from "./resources/video-calls/video-calls-resource";
|
|
54
|
+
export type { WearablesResource } from "./resources/wearables/wearables-resource";
|
|
55
|
+
export * from "../types/MeasurementTypes";
|
|
56
|
+
export type * from "../client/slim/types";
|
|
57
|
+
export type * from "../client/notifications/types";
|
|
58
|
+
export type * from "../client/change-history/types";
|
|
59
|
+
export type * from "../client/experience/types";
|
|
60
|
+
export type * from "../client/platform/types";
|
|
61
|
+
export type * from "../client/consent/types";
|
|
62
|
+
export type * from "../client/patient-sharing/types";
|
|
63
|
+
export type * from "../client/invites/types";
|
|
64
|
+
export type * from "../client/wearables/types";
|
|
65
|
+
export type * from "../client/cms/types";
|
|
66
|
+
export type * from "../client/email/types";
|
|
67
|
+
export type * from "../client/patient/types";
|
|
68
|
+
export type * from "../client/ai-fhir/types";
|
|
69
|
+
export type { EnableSignalsResponse } from "../client/signals/types";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.OvokValidationError = exports.OvokServiceError = exports.OvokRateLimitError = exports.OvokPermissionError = exports.OvokNotFoundError = exports.OvokError = exports.OvokConnectionError = exports.OvokConflictError = exports.OvokConfigError = exports.OvokAuthenticationError = exports.MemoryStorage = exports.Ovok = void 0;
|
|
18
|
+
var ovok_1 = require("./ovok");
|
|
19
|
+
Object.defineProperty(exports, "Ovok", { enumerable: true, get: function () { return ovok_1.Ovok; } });
|
|
20
|
+
var ovok_storage_1 = require("./storage/ovok-storage");
|
|
21
|
+
Object.defineProperty(exports, "MemoryStorage", { enumerable: true, get: function () { return ovok_storage_1.MemoryStorage; } });
|
|
22
|
+
var ovok_errors_1 = require("./errors/ovok-errors");
|
|
23
|
+
Object.defineProperty(exports, "OvokAuthenticationError", { enumerable: true, get: function () { return ovok_errors_1.OvokAuthenticationError; } });
|
|
24
|
+
Object.defineProperty(exports, "OvokConfigError", { enumerable: true, get: function () { return ovok_errors_1.OvokConfigError; } });
|
|
25
|
+
Object.defineProperty(exports, "OvokConflictError", { enumerable: true, get: function () { return ovok_errors_1.OvokConflictError; } });
|
|
26
|
+
Object.defineProperty(exports, "OvokConnectionError", { enumerable: true, get: function () { return ovok_errors_1.OvokConnectionError; } });
|
|
27
|
+
Object.defineProperty(exports, "OvokError", { enumerable: true, get: function () { return ovok_errors_1.OvokError; } });
|
|
28
|
+
Object.defineProperty(exports, "OvokNotFoundError", { enumerable: true, get: function () { return ovok_errors_1.OvokNotFoundError; } });
|
|
29
|
+
Object.defineProperty(exports, "OvokPermissionError", { enumerable: true, get: function () { return ovok_errors_1.OvokPermissionError; } });
|
|
30
|
+
Object.defineProperty(exports, "OvokRateLimitError", { enumerable: true, get: function () { return ovok_errors_1.OvokRateLimitError; } });
|
|
31
|
+
Object.defineProperty(exports, "OvokServiceError", { enumerable: true, get: function () { return ovok_errors_1.OvokServiceError; } });
|
|
32
|
+
Object.defineProperty(exports, "OvokValidationError", { enumerable: true, get: function () { return ovok_errors_1.OvokValidationError; } });
|
|
33
|
+
__exportStar(require("../types/MeasurementTypes"), exports);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { OvokConfig } from "./config/ovok-config";
|
|
2
|
+
import { AccountsResource } from "./resources/accounts/accounts-resource";
|
|
3
|
+
import { AiResource } from "./resources/ai/ai-resource";
|
|
4
|
+
import { AuthResource } from "./resources/auth-resource";
|
|
5
|
+
import { BotsResource } from "./resources/bots/bots-resource";
|
|
6
|
+
import { CmsResource } from "./resources/cms/cms-resource";
|
|
7
|
+
import { ConsentResource } from "./resources/consent/consent-resource";
|
|
8
|
+
import { ContentResource } from "./resources/content/content-resource";
|
|
9
|
+
import { DocumentsResource } from "./resources/documents/documents-resource";
|
|
10
|
+
import { EmailResource } from "./resources/email/email-resource";
|
|
11
|
+
import { FhirResource } from "./resources/fhir-resource";
|
|
12
|
+
import { HealthResource } from "./resources/health-resource";
|
|
13
|
+
import { InvitesResource } from "./resources/invites/invites-resource";
|
|
14
|
+
import { LocalesResource } from "./resources/localization/locales-resource";
|
|
15
|
+
import { LocalizationsResource } from "./resources/localization/localizations-resource";
|
|
16
|
+
import { MeasurementsResource } from "./resources/measurements/measurements-resource";
|
|
17
|
+
import { PatientResource } from "./resources/patient/patient-resource";
|
|
18
|
+
import { ProjectsResource } from "./resources/projects/projects-resource";
|
|
19
|
+
import { QuestionnaireResponsesResource, QuestionnairesResource } from "./resources/questionnaires/questionnaires-resource";
|
|
20
|
+
import { SharingResource } from "./resources/sharing/sharing-resource";
|
|
21
|
+
import { SignalsResource } from "./resources/signals/signals-resource";
|
|
22
|
+
import { SlimResource } from "./resources/slim/slim-resource";
|
|
23
|
+
import { VideoCallsResource } from "./resources/video-calls/video-calls-resource";
|
|
24
|
+
import { WearablesResource } from "./resources/wearables/wearables-resource";
|
|
25
|
+
/** One client per tenant; each namespace mirrors an area of the Ovok API. */
|
|
26
|
+
export declare class Ovok {
|
|
27
|
+
readonly auth: AuthResource;
|
|
28
|
+
readonly fhir: FhirResource;
|
|
29
|
+
readonly health: HealthResource;
|
|
30
|
+
readonly patient: PatientResource;
|
|
31
|
+
readonly measurements: MeasurementsResource;
|
|
32
|
+
readonly questionnaires: QuestionnairesResource;
|
|
33
|
+
readonly questionnaireResponses: QuestionnaireResponsesResource;
|
|
34
|
+
readonly consent: ConsentResource;
|
|
35
|
+
readonly invites: InvitesResource;
|
|
36
|
+
readonly sharing: SharingResource;
|
|
37
|
+
readonly signals: SignalsResource;
|
|
38
|
+
readonly slim: SlimResource;
|
|
39
|
+
readonly projects: ProjectsResource;
|
|
40
|
+
readonly accounts: AccountsResource;
|
|
41
|
+
readonly locales: LocalesResource;
|
|
42
|
+
readonly localizations: LocalizationsResource;
|
|
43
|
+
readonly cms: CmsResource;
|
|
44
|
+
readonly content: ContentResource;
|
|
45
|
+
readonly documents: DocumentsResource;
|
|
46
|
+
readonly videoCalls: VideoCallsResource;
|
|
47
|
+
readonly ai: AiResource;
|
|
48
|
+
readonly wearables: WearablesResource;
|
|
49
|
+
readonly email: EmailResource;
|
|
50
|
+
readonly bots: BotsResource;
|
|
51
|
+
constructor(config: OvokConfig);
|
|
52
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Ovok = void 0;
|
|
4
|
+
const client_credentials_1 = require("./auth/client-credentials");
|
|
5
|
+
const session_store_1 = require("./auth/session-store");
|
|
6
|
+
const token_endpoint_1 = require("./auth/token-endpoint");
|
|
7
|
+
const user_session_1 = require("./auth/user-session");
|
|
8
|
+
const settings_1 = require("./config/settings");
|
|
9
|
+
const http_client_1 = require("./http/http-client");
|
|
10
|
+
const retry_policy_1 = require("./http/retry-policy");
|
|
11
|
+
const accounts_resource_1 = require("./resources/accounts/accounts-resource");
|
|
12
|
+
const ai_resource_1 = require("./resources/ai/ai-resource");
|
|
13
|
+
const auth_resource_1 = require("./resources/auth-resource");
|
|
14
|
+
const bots_resource_1 = require("./resources/bots/bots-resource");
|
|
15
|
+
const cms_resource_1 = require("./resources/cms/cms-resource");
|
|
16
|
+
const consent_resource_1 = require("./resources/consent/consent-resource");
|
|
17
|
+
const content_resource_1 = require("./resources/content/content-resource");
|
|
18
|
+
const documents_resource_1 = require("./resources/documents/documents-resource");
|
|
19
|
+
const email_resource_1 = require("./resources/email/email-resource");
|
|
20
|
+
const fhir_resource_1 = require("./resources/fhir-resource");
|
|
21
|
+
const health_resource_1 = require("./resources/health-resource");
|
|
22
|
+
const invites_resource_1 = require("./resources/invites/invites-resource");
|
|
23
|
+
const locales_resource_1 = require("./resources/localization/locales-resource");
|
|
24
|
+
const localizations_resource_1 = require("./resources/localization/localizations-resource");
|
|
25
|
+
const measurements_resource_1 = require("./resources/measurements/measurements-resource");
|
|
26
|
+
const patient_resource_1 = require("./resources/patient/patient-resource");
|
|
27
|
+
const projects_resource_1 = require("./resources/projects/projects-resource");
|
|
28
|
+
const questionnaires_resource_1 = require("./resources/questionnaires/questionnaires-resource");
|
|
29
|
+
const sharing_resource_1 = require("./resources/sharing/sharing-resource");
|
|
30
|
+
const signals_resource_1 = require("./resources/signals/signals-resource");
|
|
31
|
+
const slim_resource_1 = require("./resources/slim/slim-resource");
|
|
32
|
+
const video_calls_resource_1 = require("./resources/video-calls/video-calls-resource");
|
|
33
|
+
const wearables_resource_1 = require("./resources/wearables/wearables-resource");
|
|
34
|
+
/** One client per tenant; each namespace mirrors an area of the Ovok API. */
|
|
35
|
+
class Ovok {
|
|
36
|
+
constructor(config) {
|
|
37
|
+
const settings = (0, settings_1.readSettings)(config, (0, settings_1.currentEnvironment)());
|
|
38
|
+
const credentials = credentialsFor(settings);
|
|
39
|
+
const http = new http_client_1.HttpClient({ settings, credentials, retryPolicy: new retry_policy_1.RetryPolicy(settings.maxNetworkRetries) });
|
|
40
|
+
const session = credentials instanceof user_session_1.UserSession ? credentials : null;
|
|
41
|
+
const fhir = new fhir_resource_1.FhirResource(http.under(settings.fhirPath));
|
|
42
|
+
this.auth = new auth_resource_1.AuthResource(http, settings.tenantCode, session, settings.clientId);
|
|
43
|
+
this.fhir = fhir;
|
|
44
|
+
this.health = new health_resource_1.HealthResource(http.anonymous());
|
|
45
|
+
this.patient = new patient_resource_1.PatientResource(http, fhir);
|
|
46
|
+
this.measurements = new measurements_resource_1.MeasurementsResource(http, fhir, session);
|
|
47
|
+
this.questionnaires = new questionnaires_resource_1.QuestionnairesResource(http);
|
|
48
|
+
this.questionnaireResponses = new questionnaires_resource_1.QuestionnaireResponsesResource(http, fhir);
|
|
49
|
+
this.consent = new consent_resource_1.ConsentResource(http);
|
|
50
|
+
this.invites = new invites_resource_1.InvitesResource(http);
|
|
51
|
+
this.sharing = new sharing_resource_1.SharingResource(http);
|
|
52
|
+
this.signals = new signals_resource_1.SignalsResource(http);
|
|
53
|
+
this.slim = new slim_resource_1.SlimResource(http);
|
|
54
|
+
this.projects = new projects_resource_1.ProjectsResource(http);
|
|
55
|
+
this.accounts = new accounts_resource_1.AccountsResource(http);
|
|
56
|
+
this.locales = new locales_resource_1.LocalesResource(http);
|
|
57
|
+
this.localizations = new localizations_resource_1.LocalizationsResource(http);
|
|
58
|
+
this.cms = new cms_resource_1.CmsResource(http, settings.tenantCode);
|
|
59
|
+
this.content = new content_resource_1.ContentResource(http);
|
|
60
|
+
this.documents = new documents_resource_1.DocumentsResource(http, settings.baseUrl);
|
|
61
|
+
this.videoCalls = new video_calls_resource_1.VideoCallsResource(http);
|
|
62
|
+
this.ai = new ai_resource_1.AiResource(http);
|
|
63
|
+
this.wearables = new wearables_resource_1.WearablesResource(http);
|
|
64
|
+
this.email = new email_resource_1.EmailResource(http);
|
|
65
|
+
this.bots = new bots_resource_1.BotsResource(http);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.Ovok = Ovok;
|
|
69
|
+
const credentialsFor = (settings) => {
|
|
70
|
+
const tokenEndpoint = new token_endpoint_1.TokenEndpoint(settings);
|
|
71
|
+
return settings.machineClient
|
|
72
|
+
? new client_credentials_1.ClientCredentials(tokenEndpoint, settings.machineClient)
|
|
73
|
+
: new user_session_1.UserSession((0, session_store_1.sessionStoreFor)(settings.storage, settings.tenantCode), tokenEndpoint, settings);
|
|
74
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Bundle, Resource } from "@medplum/fhirtypes";
|
|
2
|
+
import { LoadedPage } from "./page";
|
|
3
|
+
/** Follows the next link by its query only: Medplum writes its own host into the link, and Ovok is the only door. */
|
|
4
|
+
export declare function bundlePage<T extends Resource>(bundle: Bundle<T>, loadNext: (query: string) => Promise<LoadedPage<T>>): LoadedPage<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bundlePage = bundlePage;
|
|
4
|
+
const NON_MATCH_SEARCH_MODES = new Set(["include", "outcome"]);
|
|
5
|
+
/** Follows the next link by its query only: Medplum writes its own host into the link, and Ovok is the only door. */
|
|
6
|
+
function bundlePage(bundle, loadNext) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const nextUrl = (_b = (_a = bundle.link) === null || _a === void 0 ? void 0 : _a.find((link) => link.relation === "next")) === null || _b === void 0 ? void 0 : _b.url;
|
|
9
|
+
return {
|
|
10
|
+
page: { data: matchesOf(bundle), hasMore: nextUrl !== undefined, total: (_c = bundle.total) !== null && _c !== void 0 ? _c : null },
|
|
11
|
+
next: nextUrl === undefined ? null : () => loadNext(queryOf(nextUrl)),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const matchesOf = (bundle) => {
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = bundle.entry) !== null && _a !== void 0 ? _a : [])
|
|
17
|
+
.filter(isMatch)
|
|
18
|
+
.map((entry) => entry.resource)
|
|
19
|
+
.filter((resource) => resource !== undefined);
|
|
20
|
+
};
|
|
21
|
+
const isMatch = (entry) => { var _a, _b; return !NON_MATCH_SEARCH_MODES.has((_b = (_a = entry.search) === null || _a === void 0 ? void 0 : _a.mode) !== null && _b !== void 0 ? _b : "match"); };
|
|
22
|
+
const queryOf = (url) => {
|
|
23
|
+
const start = url.indexOf("?");
|
|
24
|
+
return start === -1 ? "" : url.slice(start);
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PagePromise } from "./page";
|
|
2
|
+
/** Ovok's cursor list shape: pass `nextCursor` back unchanged for the next page. */
|
|
3
|
+
export type CursorPage<T> = {
|
|
4
|
+
items: T[];
|
|
5
|
+
nextCursor: string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare function cursorPages<T>(load: (cursor: string | undefined) => Promise<CursorPage<T>>): PagePromise<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cursorPages = cursorPages;
|
|
4
|
+
const page_1 = require("./page");
|
|
5
|
+
function cursorPages(load) {
|
|
6
|
+
return (0, page_1.pagePromise)(() => loadCursor(load, undefined));
|
|
7
|
+
}
|
|
8
|
+
async function loadCursor(load, cursor) {
|
|
9
|
+
const { items, nextCursor } = await load(cursor);
|
|
10
|
+
return {
|
|
11
|
+
page: { data: items, hasMore: nextCursor !== null, total: null },
|
|
12
|
+
next: nextCursor === null ? null : () => loadCursor(load, nextCursor),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QueryValue } from "../http/url";
|
|
2
|
+
import { PagePromise } from "./page";
|
|
3
|
+
/** Ovok's page-numbered list shape: `page` is 0-based and `count` is the page size. */
|
|
4
|
+
export type NumberedPage<T> = {
|
|
5
|
+
total: number;
|
|
6
|
+
page: number;
|
|
7
|
+
count: number;
|
|
8
|
+
resources: T[];
|
|
9
|
+
};
|
|
10
|
+
export declare function numberedPages<T>(load: (page: number) => Promise<NumberedPage<T>>, firstPage?: number): PagePromise<T>;
|
|
11
|
+
export type NumberedPageQuery = Record<string, QueryValue> & {
|
|
12
|
+
page?: number;
|
|
13
|
+
};
|
|
14
|
+
/** Lists a page-numbered route with Ovok's query encoding; `query.page` is the first page loaded. */
|
|
15
|
+
export declare const numberedRoutePages: <T>(read: (path: string) => Promise<NumberedPage<T>>, path: string, query: NumberedPageQuery) => PagePromise<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.numberedRoutePages = void 0;
|
|
4
|
+
exports.numberedPages = numberedPages;
|
|
5
|
+
const query_string_1 = require("../../client/query-string");
|
|
6
|
+
const page_1 = require("./page");
|
|
7
|
+
function numberedPages(load, firstPage = 0) {
|
|
8
|
+
return (0, page_1.pagePromise)(() => loadNumbered(load, firstPage));
|
|
9
|
+
}
|
|
10
|
+
async function loadNumbered(load, page) {
|
|
11
|
+
const result = await load(page);
|
|
12
|
+
const hasMore = (result.page + 1) * result.count < result.total;
|
|
13
|
+
return {
|
|
14
|
+
page: { data: result.resources, hasMore, total: result.total },
|
|
15
|
+
next: hasMore ? () => loadNumbered(load, result.page + 1) : null,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Lists a page-numbered route with Ovok's query encoding; `query.page` is the first page loaded. */
|
|
19
|
+
const numberedRoutePages = (read, path, query) => numberedPages((page) => read(`${path}${(0, query_string_1.toQueryString)({ ...query, page })}`), query.page);
|
|
20
|
+
exports.numberedRoutePages = numberedRoutePages;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Page<T> = {
|
|
2
|
+
data: T[];
|
|
3
|
+
hasMore: boolean;
|
|
4
|
+
total: number | null;
|
|
5
|
+
};
|
|
6
|
+
/** Await it for the first page, or `for await` over it to walk every page. */
|
|
7
|
+
export type PagePromise<T> = Promise<Page<T>> & AsyncIterable<T>;
|
|
8
|
+
export type LoadedPage<T> = {
|
|
9
|
+
page: Page<T>;
|
|
10
|
+
next: (() => Promise<LoadedPage<T>>) | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function pagePromise<T>(loadFirst: () => Promise<LoadedPage<T>>): PagePromise<T>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pagePromise = pagePromise;
|
|
4
|
+
function pagePromise(loadFirst) {
|
|
5
|
+
const first = loadFirst();
|
|
6
|
+
const firstPage = first.then((loaded) => loaded.page);
|
|
7
|
+
// A caller that only iterates never awaits firstPage; its rejection still reaches them through first.
|
|
8
|
+
firstPage.catch(() => undefined);
|
|
9
|
+
return Object.assign(firstPage, { [Symbol.asyncIterator]: () => everyItem(first) });
|
|
10
|
+
}
|
|
11
|
+
async function* everyItem(first) {
|
|
12
|
+
let loaded = await first;
|
|
13
|
+
while (loaded !== null) {
|
|
14
|
+
yield* loaded.page.data;
|
|
15
|
+
loaded = loaded.next === null ? null : await loaded.next();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OvokAccount } from "../../../client/platform/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class AccountsResource {
|
|
5
|
+
private readonly http;
|
|
6
|
+
constructor(http: HttpClient);
|
|
7
|
+
list(options?: RequestOptions): Promise<OvokAccount[]>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountsResource = void 0;
|
|
4
|
+
const ACCOUNTS_PATH = "accounts";
|
|
5
|
+
class AccountsResource {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
list(options) {
|
|
10
|
+
return this.http.get(ACCOUNTS_PATH, options);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.AccountsResource = AccountsResource;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HttpClient } from "../../http/http-client";
|
|
2
|
+
import { ChatMessagesResource } from "./chat-messages-resource";
|
|
3
|
+
import { ChatSessionsResource } from "./chat-sessions-resource";
|
|
4
|
+
export declare class AiChatResource {
|
|
5
|
+
readonly sessions: ChatSessionsResource;
|
|
6
|
+
readonly messages: ChatMessagesResource;
|
|
7
|
+
constructor(ai: HttpClient);
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiChatResource = void 0;
|
|
4
|
+
const chat_messages_resource_1 = require("./chat-messages-resource");
|
|
5
|
+
const chat_sessions_resource_1 = require("./chat-sessions-resource");
|
|
6
|
+
class AiChatResource {
|
|
7
|
+
constructor(ai) {
|
|
8
|
+
this.sessions = new chat_sessions_resource_1.ChatSessionsResource(ai);
|
|
9
|
+
this.messages = new chat_messages_resource_1.ChatMessagesResource(ai);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.AiChatResource = AiChatResource;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AIFhirRequest, AIFhirResponse } from "../../../client/ai-fhir/types";
|
|
2
|
+
import type { OvokTranslationRequest, OvokTranslationResponse } from "../../../client/experience/types";
|
|
3
|
+
import { HttpClient } from "../../http/http-client";
|
|
4
|
+
import { RequestOptions } from "../../http/transmit";
|
|
5
|
+
import { AiChatResource } from "./ai-chat-resource";
|
|
6
|
+
export type AiFhirSearchRequest = AIFhirRequest & {
|
|
7
|
+
fhirVersion?: "R4" | "R5";
|
|
8
|
+
};
|
|
9
|
+
export declare class AiResource {
|
|
10
|
+
readonly chat: AiChatResource;
|
|
11
|
+
private readonly ai;
|
|
12
|
+
constructor(http: HttpClient);
|
|
13
|
+
translate(body: OvokTranslationRequest, options?: RequestOptions): Promise<OvokTranslationResponse>;
|
|
14
|
+
/** An LLM plans and runs the FHIR queries, so the answer can be wrong or invented. */
|
|
15
|
+
fhirSearch(body: AiFhirSearchRequest, options?: RequestOptions): Promise<AIFhirResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiResource = void 0;
|
|
4
|
+
const ai_chat_resource_1 = require("./ai-chat-resource");
|
|
5
|
+
const AI_PATH = "ai";
|
|
6
|
+
class AiResource {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.ai = http.under(AI_PATH);
|
|
9
|
+
this.chat = new ai_chat_resource_1.AiChatResource(this.ai);
|
|
10
|
+
}
|
|
11
|
+
translate(body, options) {
|
|
12
|
+
return this.ai.post("translation", body, options);
|
|
13
|
+
}
|
|
14
|
+
/** An LLM plans and runs the FHIR queries, so the answer can be wrong or invented. */
|
|
15
|
+
fhirSearch(body, options) {
|
|
16
|
+
return this.ai.post("fhir/search", body, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.AiResource = AiResource;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OvokChatMessage, OvokChatMessageInput, OvokChatMessageQuery, OvokChatMessagesResponse } from "../../../client/experience/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export declare class ChatMessagesResource {
|
|
5
|
+
private readonly ai;
|
|
6
|
+
constructor(ai: HttpClient);
|
|
7
|
+
list(sessionId: string, params?: OvokChatMessageQuery, options?: RequestOptions): Promise<OvokChatMessagesResponse>;
|
|
8
|
+
send(sessionId: string, body: OvokChatMessageInput, options?: RequestOptions): Promise<OvokChatMessage>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatMessagesResource = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const chat_sessions_resource_1 = require("./chat-sessions-resource");
|
|
6
|
+
const messagesPath = (sessionId) => `${(0, chat_sessions_resource_1.sessionPath)(sessionId)}/message`;
|
|
7
|
+
class ChatMessagesResource {
|
|
8
|
+
constructor(ai) {
|
|
9
|
+
this.ai = ai;
|
|
10
|
+
}
|
|
11
|
+
list(sessionId, params = {}, options) {
|
|
12
|
+
return this.ai.get(`${messagesPath(sessionId)}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
13
|
+
}
|
|
14
|
+
send(sessionId, body, options) {
|
|
15
|
+
return this.ai.post(messagesPath(sessionId), body, options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.ChatMessagesResource = ChatMessagesResource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OvokChatSession, OvokChatSessionQuery, OvokChatSessionsResponse, OvokCreateChatSession } from "../../../client/experience/types";
|
|
2
|
+
import { HttpClient } from "../../http/http-client";
|
|
3
|
+
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
export type ChatSessionRetrieveParams = {
|
|
5
|
+
messageCount?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const sessionPath: (sessionId: string) => string;
|
|
8
|
+
export declare class ChatSessionsResource {
|
|
9
|
+
private readonly ai;
|
|
10
|
+
constructor(ai: HttpClient);
|
|
11
|
+
create(body: OvokCreateChatSession, options?: RequestOptions): Promise<OvokChatSession>;
|
|
12
|
+
list(params?: OvokChatSessionQuery, options?: RequestOptions): Promise<OvokChatSessionsResponse>;
|
|
13
|
+
retrieve(sessionId: string, params?: ChatSessionRetrieveParams, options?: RequestOptions): Promise<OvokChatSession>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatSessionsResource = exports.sessionPath = void 0;
|
|
4
|
+
const query_string_1 = require("../../../client/query-string");
|
|
5
|
+
const url_1 = require("../../http/url");
|
|
6
|
+
const SESSION_PATH = "session";
|
|
7
|
+
const sessionPath = (sessionId) => `${SESSION_PATH}/${(0, url_1.pathSegment)(sessionId)}`;
|
|
8
|
+
exports.sessionPath = sessionPath;
|
|
9
|
+
class ChatSessionsResource {
|
|
10
|
+
constructor(ai) {
|
|
11
|
+
this.ai = ai;
|
|
12
|
+
}
|
|
13
|
+
create(body, options) {
|
|
14
|
+
return this.ai.post(SESSION_PATH, body, options);
|
|
15
|
+
}
|
|
16
|
+
list(params = {}, options) {
|
|
17
|
+
return this.ai.get(`${SESSION_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
18
|
+
}
|
|
19
|
+
retrieve(sessionId, params = {}, options) {
|
|
20
|
+
return this.ai.get(`${(0, exports.sessionPath)(sessionId)}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ChatSessionsResource = ChatSessionsResource;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OvokSession, SessionRevokeOption } from "../../../client/auth/types/Session";
|
|
2
|
+
import { UserSession } from "../../auth/user-session";
|
|
3
|
+
import { HttpClient } from "../../http/http-client";
|
|
4
|
+
import { RequestOptions } from "../../http/transmit";
|
|
5
|
+
/** The account's sessions on the server. */
|
|
6
|
+
export declare class AuthSessionsResource {
|
|
7
|
+
private readonly http;
|
|
8
|
+
private readonly session;
|
|
9
|
+
constructor(http: HttpClient, session: UserSession | null);
|
|
10
|
+
list(options?: RequestOptions): Promise<OvokSession[]>;
|
|
11
|
+
/** Revoking the current session also ends it here. */
|
|
12
|
+
revoke(option: SessionRevokeOption, options?: RequestOptions): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthSessionsResource = void 0;
|
|
4
|
+
const url_1 = require("../../http/url");
|
|
5
|
+
const SESSIONS_PATH = "auth/session";
|
|
6
|
+
const CURRENT_SESSION = "current";
|
|
7
|
+
/** The account's sessions on the server. */
|
|
8
|
+
class AuthSessionsResource {
|
|
9
|
+
constructor(http, session) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
this.session = session;
|
|
12
|
+
}
|
|
13
|
+
list(options) {
|
|
14
|
+
return this.http.get(SESSIONS_PATH, options);
|
|
15
|
+
}
|
|
16
|
+
/** Revoking the current session also ends it here. */
|
|
17
|
+
async revoke(option, options) {
|
|
18
|
+
var _a;
|
|
19
|
+
await this.http.delete(`${SESSIONS_PATH}/${(0, url_1.pathSegment)(option)}`, options);
|
|
20
|
+
if (option === CURRENT_SESSION) {
|
|
21
|
+
await ((_a = this.session) === null || _a === void 0 ? void 0 : _a.end());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AuthSessionsResource = AuthSessionsResource;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RegisterBody } from "../../../client/auth/types/RegisterBody";
|
|
2
|
+
import type { RegisterPractitionerBody } from "../../../client/auth/types/RegisterPractitionerBody";
|
|
3
|
+
import type { ClinicianInviteStep } from "../../../client/auth/types/RegisterResponse";
|
|
4
|
+
import { LoginTokens, Session } from "../../auth/session";
|
|
5
|
+
/** The tenant comes from the client's config, as it does for login. */
|
|
6
|
+
export type PatientRegistration = Omit<RegisterBody, "tenantCode">;
|
|
7
|
+
export type PractitionerRegistration = Omit<RegisterPractitionerBody, "tenantCode">;
|
|
8
|
+
export type RegisterResult = {
|
|
9
|
+
status: "signed-in";
|
|
10
|
+
session: Session;
|
|
11
|
+
} | {
|
|
12
|
+
status: "clinician-invite";
|
|
13
|
+
};
|
|
14
|
+
export type RegisterResponse = LoginTokens | ClinicianInviteStep;
|
|
15
|
+
export declare const REGISTER_PATHS: {
|
|
16
|
+
readonly patient: "auth/tenant/Patient/register";
|
|
17
|
+
readonly practitioner: "auth/tenant/Practitioner/register";
|
|
18
|
+
};
|
|
19
|
+
export declare const isClinicianInvite: (response: RegisterResponse) => response is ClinicianInviteStep;
|
|
20
|
+
/** The confirmation is checked here and never sent. */
|
|
21
|
+
export declare function practitionerRegistrationBody(details: PractitionerRegistration, tenantCode: string): {
|
|
22
|
+
email: string;
|
|
23
|
+
password: string;
|
|
24
|
+
name: string;
|
|
25
|
+
surname: string;
|
|
26
|
+
tenantCode: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const patientRegistrationBody: (details: PatientRegistration, tenantCode: string) => {
|
|
29
|
+
continueAsPatientToken: string | undefined;
|
|
30
|
+
email: string;
|
|
31
|
+
password: string;
|
|
32
|
+
name: string;
|
|
33
|
+
surname: string;
|
|
34
|
+
tenantCode: string;
|
|
35
|
+
};
|