@ovok/core 0.4.49-dev.504 → 0.4.49-dev.513
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/ai-fhir/methods/AIFhirResources.d.ts +3 -1
- package/dist/client/ai-fhir/methods/AIFhirResources.js +3 -1
- package/dist/client/ai-fhir/types/AIFhirPlan.d.ts +8 -0
- package/dist/client/ai-fhir/types/AIFhirPlanRequest.d.ts +8 -0
- package/dist/client/ai-fhir/types/AIFhirRequest.d.ts +5 -0
- package/dist/client/ai-fhir/types/AIFhirResponse.d.ts +6 -0
- package/dist/client/auth/errors.d.ts +15 -2
- package/dist/client/auth/errors.js +12 -2
- package/dist/client/auth/methods/appleLogin.d.ts +1 -0
- package/dist/client/auth/methods/appleLogin.js +1 -0
- package/dist/client/auth/methods/changePassword.d.ts +1 -0
- package/dist/client/auth/methods/changePassword.js +1 -0
- package/dist/client/auth/methods/googleLogin.d.ts +1 -0
- package/dist/client/auth/methods/googleLogin.js +1 -0
- package/dist/client/auth/methods/login.d.ts +6 -0
- package/dist/client/auth/methods/login.js +6 -0
- package/dist/client/auth/methods/register.d.ts +5 -0
- package/dist/client/auth/methods/register.js +5 -0
- package/dist/client/auth/methods/registerPractitioner.d.ts +5 -0
- package/dist/client/auth/methods/registerPractitioner.js +5 -0
- package/dist/client/auth/methods/reloadSession.d.ts +3 -0
- package/dist/client/auth/methods/requestDeleteUser.d.ts +4 -5
- package/dist/client/auth/methods/requestDeleteUser.js +4 -5
- package/dist/client/auth/methods/setPasswordFromReset.d.ts +1 -0
- package/dist/client/auth/methods/setPasswordFromReset.js +1 -0
- package/dist/client/auth/session-fetch.d.ts +11 -0
- package/dist/client/auth/types/Account.d.ts +8 -1
- package/dist/client/auth/types/AppleLoginBody.d.ts +16 -0
- package/dist/client/auth/types/AppleLoginBody.js +5 -0
- package/dist/client/auth/types/AuthResponse.d.ts +12 -0
- package/dist/client/auth/types/ChangePasswordBody.d.ts +7 -0
- package/dist/client/auth/types/ChangePasswordResponse.d.ts +5 -0
- package/dist/client/auth/types/CompletePasswordResetBody.d.ts +8 -0
- package/dist/client/auth/types/GoogleLoginBody.d.ts +5 -0
- package/dist/client/auth/types/LoginBody.d.ts +15 -1
- package/dist/client/auth/types/LoginError.d.ts +21 -2
- package/dist/client/auth/types/LoginError.js +8 -2
- package/dist/client/auth/types/LoginResponse.d.ts +8 -1
- package/dist/client/auth/types/RegisterBody.d.ts +12 -0
- package/dist/client/auth/types/RegisterPractitionerBody.d.ts +5 -0
- package/dist/client/auth/types/RegisterResponse.d.ts +7 -0
- package/dist/client/auth/types/RequestDeleteUserBody.d.ts +7 -7
- package/dist/client/auth/types/RequestDeleteUserResponse.d.ts +14 -0
- package/dist/client/auth/types/ResetPasswordBody.d.ts +5 -0
- package/dist/client/auth/types/Session.d.ts +14 -2
- package/dist/client/change-history/methods.d.ts +6 -0
- package/dist/client/change-history/methods.js +6 -0
- package/dist/client/change-history/types.d.ts +82 -0
- package/dist/client/chat/ai/methods/createAiSession.d.ts +6 -0
- package/dist/client/chat/ai/methods/createAiSession.js +6 -0
- package/dist/client/chat/ai/types/CreateAiSessionResponse.d.ts +17 -0
- package/dist/client/chat/ai/types/SessionMessagesResponse.d.ts +9 -0
- package/dist/client/cms/locale.d.ts +12 -2
- package/dist/client/cms/locale.js +9 -2
- package/dist/client/cms/methods.d.ts +6 -2
- package/dist/client/cms/methods.js +7 -3
- package/dist/client/cms/types.d.ts +44 -4
- package/dist/client/consent/methods.d.ts +16 -0
- package/dist/client/consent/methods.js +16 -0
- package/dist/client/consent/types.d.ts +53 -1
- package/dist/client/consent/types.js +10 -1
- package/dist/client/email/methods.d.ts +3 -0
- package/dist/client/email/methods.js +3 -0
- package/dist/client/email/types.d.ts +33 -0
- package/dist/client/errors/field-errors.d.ts +3 -0
- package/dist/client/errors/field-errors.js +3 -0
- package/dist/client/errors/ovok-error-utils.d.ts +6 -0
- package/dist/client/errors/ovok-error-utils.js +6 -0
- package/dist/client/errors/ovok-error.d.ts +36 -4
- package/dist/client/errors/ovok-error.js +15 -4
- package/dist/client/errors/rate-limit-error.d.ts +11 -2
- package/dist/client/errors/rate-limit-error.js +10 -2
- package/dist/client/errors/sign-in-required-error.d.ts +5 -2
- package/dist/client/errors/sign-in-required-error.js +5 -2
- package/dist/client/experience/methods.d.ts +38 -0
- package/dist/client/experience/methods.js +35 -0
- package/dist/client/experience/types.d.ts +316 -0
- package/dist/client/experience/types.js +1 -0
- package/dist/client/invites/methods.d.ts +27 -9
- package/dist/client/invites/methods.js +27 -9
- package/dist/client/invites/parse-accept-invite-link.d.ts +3 -1
- package/dist/client/invites/parse-accept-invite-link.js +3 -1
- package/dist/client/invites/types.d.ts +55 -0
- package/dist/client/invites/types.js +12 -0
- package/dist/client/notifications/methods.d.ts +15 -0
- package/dist/client/notifications/methods.js +15 -0
- package/dist/client/notifications/types.d.ts +249 -2
- package/dist/client/observation/methods/generateObservationBodiesByMeasurement.d.ts +3 -0
- package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +3 -0
- package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +3 -0
- package/dist/client/observation/methods/getLatestObservationsByCodes.js +3 -0
- package/dist/client/observation/methods/observationsToMeasurements.d.ts +23 -1
- package/dist/client/observation/methods/observationsToMeasurements.js +8 -1
- package/dist/client/observation/methods/saveMeasurement.d.ts +3 -1
- package/dist/client/observation/methods/saveMeasurement.js +3 -1
- package/dist/client/observation/observation-bundle-utils.d.ts +6 -0
- package/dist/client/observation/observation-bundle-utils.js +6 -0
- package/dist/client/observation/series.d.ts +25 -3
- package/dist/client/observation/series.js +6 -2
- package/dist/client/observation/services/creator.d.ts +5 -0
- package/dist/client/observation/services/creator.js +5 -0
- package/dist/client/observation/services/uric-acid-service.js +0 -1
- package/dist/client/observation/types/GetLatestObservationsByCodeParams.d.ts +10 -0
- package/dist/client/observation/types/MeasurementTypeKey.d.ts +26 -0
- package/dist/client/observation/types/MeasurementTypeKey.js +26 -0
- package/dist/client/observation/types/ObservationCode.d.ts +64 -1
- package/dist/client/observation/types/ObservationCode.js +64 -1
- package/dist/client/observation/types/UrineAnalytes.d.ts +14 -0
- package/dist/client/observation/types/UrineAnalytes.js +1 -0
- package/dist/client/observation/types/generate-measurement/Sample.d.ts +33 -0
- package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.d.ts +9 -0
- package/dist/client/observation/types/measurement/BabySleepMeasurement.d.ts +3 -0
- package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/BloodPressureMeasurement.d.ts +10 -0
- package/dist/client/observation/types/measurement/BloodPressureStates.d.ts +10 -0
- package/dist/client/observation/types/measurement/BloodPressureStates.js +10 -0
- package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/BodyWeightMeasurmement.d.ts +8 -0
- package/dist/client/observation/types/measurement/EcgDiagnosticFlag.d.ts +18 -0
- package/dist/client/observation/types/measurement/EcgDiagnosticFlag.js +18 -0
- package/dist/client/observation/types/measurement/EcgMeasurement.d.ts +9 -0
- package/dist/client/observation/types/measurement/HeartRateMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/LipidPanelMeasurement.d.ts +12 -0
- package/dist/client/observation/types/measurement/Measurement.d.ts +9 -0
- package/dist/client/observation/types/measurement/MeasurementDevice.d.ts +10 -0
- package/dist/client/observation/types/measurement/MeasurementSeries.d.ts +2 -0
- package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +10 -0
- package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/RespiratoryTherapyMeasurement.d.ts +3 -0
- package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/SpirometryMeasurement.d.ts +23 -0
- package/dist/client/observation/types/measurement/StepCountMeasurement.d.ts +9 -0
- package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.d.ts +29 -0
- package/dist/client/observation/types/measurement/Vo2MaxMeasurement.d.ts +7 -0
- package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.d.ts +7 -0
- package/dist/client/observation/types/service/MeasurementField.d.ts +5 -1
- package/dist/client/observation/utils/getObservationValueDisplay.d.ts +2 -0
- package/dist/client/offline/offline-measurement-queue.d.ts +56 -1
- package/dist/client/offline/offline-measurement-queue.js +21 -0
- package/dist/client/offline/shared-measurement-queue.d.ts +16 -1
- package/dist/client/offline/shared-measurement-queue.js +3 -1
- package/dist/client/ovok-client.d.ts +27 -6
- package/dist/client/ovok-client.js +8 -5
- package/dist/client/patient/methods.d.ts +21 -0
- package/dist/client/patient/methods.js +21 -0
- package/dist/client/patient/types.d.ts +131 -0
- package/dist/client/patient-sharing/methods.d.ts +18 -0
- package/dist/client/patient-sharing/methods.js +18 -0
- package/dist/client/patient-sharing/types.d.ts +89 -1
- package/dist/client/platform/methods.d.ts +22 -0
- package/dist/client/platform/methods.js +20 -0
- package/dist/client/platform/types.d.ts +194 -1
- package/dist/client/platform/types.js +24 -0
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +3 -0
- package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +3 -0
- package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +3 -0
- package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +3 -0
- package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +3 -0
- package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +3 -0
- package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +3 -0
- package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +3 -0
- package/dist/client/questionnaire-response/types.d.ts +6 -0
- package/dist/client/signals/errors.d.ts +13 -2
- package/dist/client/signals/errors.js +9 -2
- package/dist/client/signals/methods.d.ts +9 -0
- package/dist/client/signals/methods.js +9 -0
- package/dist/client/signals/types.d.ts +31 -0
- package/dist/client/slim/methods.d.ts +268 -21
- package/dist/client/slim/methods.js +264 -21
- package/dist/client/slim/paging.d.ts +22 -2
- package/dist/client/slim/paging.js +6 -2
- package/dist/client/slim/types.d.ts +920 -1
- package/dist/client/storage.d.ts +15 -1
- package/dist/client/storage.js +7 -1
- package/dist/client/wearables/methods.d.ts +24 -0
- package/dist/client/wearables/methods.js +24 -0
- package/dist/client/wearables/types.d.ts +74 -0
- package/dist/conformance/api-requirements.d.ts +31 -5
- package/dist/conformance/api-requirements.js +47 -10
- package/dist/conformance/capability-requirements.d.ts +4 -26
- package/dist/conformance/capability-requirements.js +5 -27
- package/dist/conformance/capability.d.ts +9 -1
- package/dist/conformance/capability.js +3 -1
- package/dist/hooks/account-hooks.d.ts +35 -0
- package/dist/hooks/account-hooks.js +33 -0
- package/dist/hooks/api-hooks.d.ts +74 -4
- package/dist/hooks/api-hooks.js +56 -4
- package/dist/hooks/cms-hooks.d.ts +9 -3
- package/dist/hooks/cms-hooks.js +9 -3
- package/dist/hooks/email-hooks.d.ts +3 -0
- package/dist/hooks/email-hooks.js +3 -0
- package/dist/hooks/experience-hooks.d.ts +26 -0
- package/dist/hooks/experience-hooks.js +24 -0
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/invites-hooks.d.ts +21 -2
- package/dist/hooks/invites-hooks.js +21 -2
- package/dist/hooks/notification-ack-hooks.d.ts +6 -2
- package/dist/hooks/notification-ack-hooks.js +6 -2
- package/dist/hooks/notification-hooks.d.ts +27 -3
- package/dist/hooks/notification-hooks.js +27 -3
- package/dist/hooks/notification-note-hooks.d.ts +41 -0
- package/dist/hooks/notification-note-hooks.js +33 -0
- package/dist/hooks/observation-hooks.d.ts +29 -0
- package/dist/hooks/observation-hooks.js +23 -1
- package/dist/hooks/patient-hooks.d.ts +53 -0
- package/dist/hooks/patient-hooks.js +48 -0
- package/dist/hooks/patient-sharing-hooks.d.ts +18 -0
- package/dist/hooks/patient-sharing-hooks.js +18 -0
- package/dist/hooks/platform-hooks.d.ts +32 -0
- package/dist/hooks/platform-hooks.js +23 -0
- package/dist/hooks/poll-hooks.d.ts +17 -1
- package/dist/hooks/poll-hooks.js +3 -1
- package/dist/hooks/signals-hooks.d.ts +3 -0
- package/dist/hooks/signals-hooks.js +3 -0
- package/dist/hooks/wearables-hooks.d.ts +23 -0
- package/dist/hooks/wearables-hooks.js +21 -0
- package/dist/next/auth/saved-accounts-store.d.ts +10 -0
- package/dist/next/auth/session.d.ts +17 -0
- package/dist/next/auth/user-session.d.ts +5 -0
- package/dist/next/config/ovok-config.d.ts +45 -0
- package/dist/next/errors/ovok-account-error.d.ts +14 -1
- package/dist/next/errors/ovok-account-error.js +8 -1
- package/dist/next/errors/ovok-errors.d.ts +88 -0
- package/dist/next/errors/ovok-errors.js +67 -0
- package/dist/next/http/http-client.d.ts +5 -0
- package/dist/next/http/transmit.d.ts +7 -0
- package/dist/next/http/url.d.ts +10 -0
- package/dist/next/ovok.d.ts +31 -1
- package/dist/next/ovok.js +5 -1
- package/dist/next/paging/page.d.ts +13 -1
- package/dist/next/react/context.d.ts +7 -0
- package/dist/next/react/context.js +7 -0
- package/dist/next/react/index.d.ts +24 -0
- package/dist/next/react/index.js +18 -0
- package/dist/next/react/query-hooks.d.ts +69 -0
- package/dist/next/react/query-hooks.js +31 -0
- package/dist/next/resources/accounts/accounts-resource.d.ts +6 -0
- package/dist/next/resources/accounts/accounts-resource.js +6 -0
- package/dist/next/resources/ai/ai-chat-resource.d.ts +7 -0
- package/dist/next/resources/ai/ai-chat-resource.js +5 -0
- package/dist/next/resources/ai/ai-resource.d.ts +13 -0
- package/dist/next/resources/ai/ai-resource.js +6 -0
- package/dist/next/resources/ai/chat-messages-resource.d.ts +7 -0
- package/dist/next/resources/ai/chat-messages-resource.js +7 -0
- package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
- package/dist/next/resources/ai/chat-sessions-resource.js +8 -0
- package/dist/next/resources/auth/auth-sessions-resource.d.ts +6 -1
- package/dist/next/resources/auth/auth-sessions-resource.js +6 -1
- package/dist/next/resources/auth/registration.d.ts +18 -1
- package/dist/next/resources/auth/social-login.d.ts +12 -0
- package/dist/next/resources/auth-resource.d.ts +54 -1
- package/dist/next/resources/auth-resource.js +23 -0
- package/dist/next/resources/bots/bots-resource.d.ts +15 -0
- package/dist/next/resources/bots/bots-resource.js +5 -0
- package/dist/next/resources/cms/cms-delivery.d.ts +14 -2
- package/dist/next/resources/cms/cms-documents-resource.d.ts +7 -1
- package/dist/next/resources/cms/cms-documents-resource.js +7 -1
- package/dist/next/resources/cms/cms-resource.d.ts +7 -0
- package/dist/next/resources/cms/cms-resource.js +5 -0
- package/dist/next/resources/cms/release-notes-resource.d.ts +6 -0
- package/dist/next/resources/cms/release-notes-resource.js +6 -0
- package/dist/next/resources/consent/consent-resource.d.ts +22 -0
- package/dist/next/resources/consent/consent-resource.js +20 -0
- package/dist/next/resources/content/content-resource.d.ts +18 -0
- package/dist/next/resources/content/content-resource.js +12 -0
- package/dist/next/resources/documents/documents-resource.d.ts +24 -0
- package/dist/next/resources/documents/documents-resource.js +10 -0
- package/dist/next/resources/email/email-resource.d.ts +6 -0
- package/dist/next/resources/email/email-resource.js +5 -0
- package/dist/next/resources/email/email-templates-resource.d.ts +6 -0
- package/dist/next/resources/email/email-templates-resource.js +6 -0
- package/dist/next/resources/fhir-resource.d.ts +36 -0
- package/dist/next/resources/fhir-resource.js +21 -0
- package/dist/next/resources/health-resource.d.ts +16 -0
- package/dist/next/resources/health-resource.js +5 -0
- package/dist/next/resources/invites/invite-flow-resource.d.ts +7 -1
- package/dist/next/resources/invites/invite-flow-resource.js +7 -1
- package/dist/next/resources/invites/invites-resource.d.ts +15 -0
- package/dist/next/resources/invites/invites-resource.js +5 -0
- package/dist/next/resources/localization/i18next-resource.d.ts +6 -0
- package/dist/next/resources/localization/i18next-resource.js +6 -0
- package/dist/next/resources/localization/locales-resource.d.ts +7 -0
- package/dist/next/resources/localization/locales-resource.js +7 -0
- package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
- package/dist/next/resources/localization/localizations-resource.js +9 -0
- package/dist/next/resources/measurements/measurements-resource.d.ts +53 -1
- package/dist/next/resources/measurements/measurements-resource.js +14 -0
- package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
- package/dist/next/resources/measurements/offline-measurement-queue-types.d.ts +32 -0
- package/dist/next/resources/patient/fhir-records.d.ts +19 -1
- package/dist/next/resources/patient/fhir-records.js +19 -1
- package/dist/next/resources/patient/patient-resource.d.ts +15 -0
- package/dist/next/resources/patient/patient-resource.js +6 -0
- package/dist/next/resources/projects/project-features-resource.d.ts +7 -0
- package/dist/next/resources/projects/project-features-resource.js +7 -0
- package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
- package/dist/next/resources/projects/project-members-resource.js +9 -0
- package/dist/next/resources/projects/project-settings-resource.d.ts +8 -0
- package/dist/next/resources/projects/project-settings-resource.js +8 -0
- package/dist/next/resources/projects/projects-resource.d.ts +15 -0
- package/dist/next/resources/projects/projects-resource.js +5 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +13 -0
- package/dist/next/resources/questionnaires/questionnaires-resource.js +13 -0
- package/dist/next/resources/realtime/realtime-resource.d.ts +11 -0
- package/dist/next/resources/realtime/realtime-resource.js +11 -0
- package/dist/next/resources/realtime/realtime-types.d.ts +16 -0
- package/dist/next/resources/session/saved-accounts-resource.d.ts +16 -0
- package/dist/next/resources/session/saved-accounts-resource.js +16 -0
- package/dist/next/resources/session/session-resource.d.ts +8 -0
- package/dist/next/resources/session/session-resource.js +7 -0
- package/dist/next/resources/sharing/sharing-invites-resource.d.ts +7 -0
- package/dist/next/resources/sharing/sharing-invites-resource.js +7 -0
- package/dist/next/resources/sharing/sharing-resource.d.ts +8 -0
- package/dist/next/resources/sharing/sharing-resource.js +5 -0
- package/dist/next/resources/sharing/sharing-settings-resource.d.ts +7 -0
- package/dist/next/resources/sharing/sharing-settings-resource.js +7 -0
- package/dist/next/resources/sharing/sharing-shares-resource.d.ts +7 -0
- package/dist/next/resources/sharing/sharing-shares-resource.js +7 -0
- package/dist/next/resources/signals/signals-gateway-resource.d.ts +15 -0
- package/dist/next/resources/signals/signals-gateway-resource.js +6 -0
- package/dist/next/resources/signals/signals-resource.d.ts +7 -0
- package/dist/next/resources/signals/signals-resource.js +5 -0
- package/dist/next/resources/signals/undeliverable-resource.d.ts +35 -0
- package/dist/next/resources/signals/undeliverable-resource.js +6 -0
- package/dist/next/resources/slim/slim-alarms-resource.d.ts +7 -0
- package/dist/next/resources/slim/slim-alarms-resource.js +7 -0
- package/dist/next/resources/slim/slim-change-history-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-change-history-resource.js +6 -0
- package/dist/next/resources/slim/slim-child-projects-resource.d.ts +21 -0
- package/dist/next/resources/slim/slim-child-projects-resource.js +8 -0
- package/dist/next/resources/slim/slim-devices-resource.d.ts +31 -0
- package/dist/next/resources/slim/slim-devices-resource.js +16 -0
- package/dist/next/resources/slim/slim-exports-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-exports-resource.js +6 -0
- package/dist/next/resources/slim/slim-locations-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-locations-resource.js +9 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-medical-notifications-resource.js +6 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-notification-notes-resource.js +10 -0
- package/dist/next/resources/slim/slim-notifications-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-notifications-resource.js +6 -0
- package/dist/next/resources/slim/slim-organizations-resource.d.ts +9 -0
- package/dist/next/resources/slim/slim-organizations-resource.js +9 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-out-of-bed-resource.js +7 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-patient-thresholds-resource.js +6 -0
- package/dist/next/resources/slim/slim-patients-resource.d.ts +11 -0
- package/dist/next/resources/slim/slim-patients-resource.js +10 -0
- package/dist/next/resources/slim/slim-policies-resource.d.ts +10 -0
- package/dist/next/resources/slim/slim-policies-resource.js +10 -0
- package/dist/next/resources/slim/slim-practitioners-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-practitioners-resource.js +6 -0
- package/dist/next/resources/slim/slim-projects-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-projects-resource.js +11 -0
- package/dist/next/resources/slim/slim-queries.d.ts +51 -0
- package/dist/next/resources/slim/slim-resource.d.ts +21 -0
- package/dist/next/resources/slim/slim-resource.js +6 -0
- package/dist/next/resources/slim/slim-sleep-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-sleep-resource.js +6 -0
- package/dist/next/resources/slim/slim-thresholds-resource.d.ts +5 -0
- package/dist/next/resources/slim/slim-thresholds-resource.js +5 -0
- package/dist/next/resources/slim/slim-trends-resource.d.ts +6 -0
- package/dist/next/resources/slim/slim-trends-resource.js +6 -0
- package/dist/next/resources/slim/slim-users-resource.d.ts +12 -0
- package/dist/next/resources/slim/slim-users-resource.js +6 -0
- package/dist/next/resources/slim/slim-zones-resource.d.ts +8 -0
- package/dist/next/resources/slim/slim-zones-resource.js +8 -0
- package/dist/next/resources/video-calls/video-call-access-resource.d.ts +13 -0
- package/dist/next/resources/video-calls/video-call-access-resource.js +8 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +8 -0
- package/dist/next/resources/video-calls/video-call-appointments-resource.js +8 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +8 -0
- package/dist/next/resources/video-calls/video-call-emails-resource.js +8 -0
- package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
- package/dist/next/resources/video-calls/video-calls-resource.js +6 -0
- package/dist/next/resources/wearables/wearable-connections-resource.d.ts +8 -0
- package/dist/next/resources/wearables/wearable-connections-resource.js +8 -0
- package/dist/next/resources/wearables/wearable-providers-resource.d.ts +10 -0
- package/dist/next/resources/wearables/wearable-providers-resource.js +10 -0
- package/dist/next/resources/wearables/wearables-resource.d.ts +7 -0
- package/dist/next/resources/wearables/wearables-resource.js +5 -0
- package/dist/next/storage/ovok-storage.d.ts +16 -0
- package/dist/next/storage/ovok-storage.js +8 -0
- package/dist/types/ValidationError.d.ts +9 -0
- package/dist/utils/patch/getPatchOperationType.d.ts +3 -0
- package/dist/utils/patch/getPatchOperationType.js +3 -0
- package/package.json +5 -2
|
@@ -3,11 +3,35 @@ import type { Session } from "../auth/session";
|
|
|
3
3
|
import type { Ovok } from "../ovok";
|
|
4
4
|
import type { OvokQueryState } from "./query-hooks";
|
|
5
5
|
import { useOvok } from "./context";
|
|
6
|
+
/**
|
|
7
|
+
* Props for `OvokProvider`.
|
|
8
|
+
*
|
|
9
|
+
* @category React
|
|
10
|
+
*/
|
|
6
11
|
export type OvokProviderProps = React.PropsWithChildren<{
|
|
12
|
+
/** The Ovok client every hook below reads from. */
|
|
7
13
|
client: Ovok;
|
|
8
14
|
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Makes `client` available to the hooks in its subtree.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <OvokProvider client={ovok}><App /></OvokProvider>
|
|
20
|
+
*
|
|
21
|
+
* @category React
|
|
22
|
+
*/
|
|
9
23
|
export declare const OvokProvider: ({ client, children }: OvokProviderProps) => React.ReactElement;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the current session, or null when signed out, and updates when the session changes.
|
|
26
|
+
*
|
|
27
|
+
* @category React
|
|
28
|
+
*/
|
|
10
29
|
export declare const useSession: () => OvokQueryState<Session | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Returns the signed-in profile reference, or null when signed out.
|
|
32
|
+
*
|
|
33
|
+
* @category React
|
|
34
|
+
*/
|
|
11
35
|
export declare const useProfile: () => OvokQueryState<Session["profile"] | null>;
|
|
12
36
|
export { useOvokMutation, useOvokQuery, useResource, useSearch, useSubscription } from "./query-hooks";
|
|
13
37
|
export { useOvok };
|
package/dist/next/react/index.js
CHANGED
|
@@ -39,8 +39,21 @@ const React = __importStar(require("react"));
|
|
|
39
39
|
const context_1 = require("./context");
|
|
40
40
|
Object.defineProperty(exports, "useOvok", { enumerable: true, get: function () { return context_1.useOvok; } });
|
|
41
41
|
const query_hooks_1 = require("./query-hooks");
|
|
42
|
+
/**
|
|
43
|
+
* Makes `client` available to the hooks in its subtree.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <OvokProvider client={ovok}><App /></OvokProvider>
|
|
47
|
+
*
|
|
48
|
+
* @category React
|
|
49
|
+
*/
|
|
42
50
|
const OvokProvider = ({ client, children }) => (React.createElement(context_1.OvokContext.Provider, { value: client }, children));
|
|
43
51
|
exports.OvokProvider = OvokProvider;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the current session, or null when signed out, and updates when the session changes.
|
|
54
|
+
*
|
|
55
|
+
* @category React
|
|
56
|
+
*/
|
|
44
57
|
const useSession = () => {
|
|
45
58
|
const client = (0, context_1.useOvok)();
|
|
46
59
|
const subscribe = React.useCallback((listener) => client.session.onChange(listener), [client]);
|
|
@@ -51,6 +64,11 @@ const useSession = () => {
|
|
|
51
64
|
: { ...state, data: changedSession, loading: false, isRefreshing: false, isStale: false, error: undefined };
|
|
52
65
|
};
|
|
53
66
|
exports.useSession = useSession;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the signed-in profile reference, or null when signed out.
|
|
69
|
+
*
|
|
70
|
+
* @category React
|
|
71
|
+
*/
|
|
54
72
|
const useProfile = () => {
|
|
55
73
|
var _a, _b;
|
|
56
74
|
const session = (0, exports.useSession)();
|
|
@@ -2,30 +2,99 @@ import type { QueryParams } from "../http/url";
|
|
|
2
2
|
import type { Ovok } from "../ovok";
|
|
3
3
|
import type { Page } from "../paging/page";
|
|
4
4
|
import type { ExtractResource, ResourceType } from "@medplum/fhirtypes";
|
|
5
|
+
/**
|
|
6
|
+
* Options for `useOvokQuery`.
|
|
7
|
+
*
|
|
8
|
+
* @category React
|
|
9
|
+
*/
|
|
5
10
|
export type OvokQueryOptions = {
|
|
11
|
+
/** Identifies the query; the query runs again when it changes. */
|
|
6
12
|
queryKey: readonly unknown[];
|
|
13
|
+
/** Set false to skip the query; defaults to true. */
|
|
7
14
|
enabled?: boolean;
|
|
8
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* The state returned by the query hooks.
|
|
18
|
+
*
|
|
19
|
+
* @category React
|
|
20
|
+
*/
|
|
9
21
|
export type OvokQueryState<T> = {
|
|
22
|
+
/** The latest result, or undefined before the first one. */
|
|
10
23
|
data: T | undefined;
|
|
24
|
+
/** Whether a request is in flight. */
|
|
11
25
|
loading: boolean;
|
|
26
|
+
/** Whether a request is in flight while earlier data is still shown. */
|
|
12
27
|
isRefreshing: boolean;
|
|
28
|
+
/** Whether the shown data may be out of date, because a refresh is running or failed. */
|
|
13
29
|
isStale: boolean;
|
|
30
|
+
/** The last error, or undefined. */
|
|
14
31
|
error: Error | undefined;
|
|
32
|
+
/** Runs the query again. */
|
|
15
33
|
refetch: () => void;
|
|
16
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* The state returned by `useOvokMutation`.
|
|
37
|
+
*
|
|
38
|
+
* @category React
|
|
39
|
+
*/
|
|
17
40
|
export type OvokMutationState<TVariables, TResult> = {
|
|
41
|
+
/** The latest result, or undefined before the first one. */
|
|
18
42
|
data: TResult | undefined;
|
|
43
|
+
/** Whether a mutation is in flight. */
|
|
19
44
|
loading: boolean;
|
|
45
|
+
/** The last error, or undefined. */
|
|
20
46
|
error: Error | undefined;
|
|
47
|
+
/** Runs the mutation; rejects with the error it sets. */
|
|
21
48
|
mutate: (variables: TVariables) => Promise<TResult>;
|
|
49
|
+
/** Clears `data` and `error`. */
|
|
22
50
|
reset: () => void;
|
|
23
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* A function that reads data with the client; it receives an abort signal.
|
|
54
|
+
*
|
|
55
|
+
* @category React
|
|
56
|
+
*/
|
|
24
57
|
type OvokQuery<T> = (client: Ovok, signal: AbortSignal) => Promise<T>;
|
|
58
|
+
/**
|
|
59
|
+
* A function that writes with the client, given the variables passed to `mutate`.
|
|
60
|
+
*
|
|
61
|
+
* @category React
|
|
62
|
+
*/
|
|
25
63
|
type OvokMutation<TVariables, TResult> = (client: Ovok, variables: TVariables) => Promise<TResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Runs `query` and tracks its loading, error and data state; it runs again when `options.queryKey` changes.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const { data, loading } = useOvokQuery((ovok, signal) => ovok.health.check({ signal }), { queryKey: ["health"] });
|
|
69
|
+
*
|
|
70
|
+
* @category React
|
|
71
|
+
*/
|
|
26
72
|
export declare const useOvokQuery: <T>(query: OvokQuery<T>, options: OvokQueryOptions) => OvokQueryState<T>;
|
|
73
|
+
/**
|
|
74
|
+
* Wraps a write so a component can call it and track its loading, error and data state.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const { mutate } = useOvokMutation((ovok, patient) => ovok.fhir.create(patient));
|
|
78
|
+
*
|
|
79
|
+
* @category React
|
|
80
|
+
*/
|
|
27
81
|
export declare const useOvokMutation: <TVariables, TResult>(mutation: OvokMutation<TVariables, TResult>) => OvokMutationState<TVariables, TResult>;
|
|
82
|
+
/**
|
|
83
|
+
* Reads one FHIR resource by id; skipped while `id` is undefined.
|
|
84
|
+
*
|
|
85
|
+
* @category React
|
|
86
|
+
*/
|
|
28
87
|
export declare const useResource: <K extends ResourceType>(type: K, id: string | undefined, options?: Pick<OvokQueryOptions, "enabled">) => OvokQueryState<ExtractResource<K>>;
|
|
88
|
+
/**
|
|
89
|
+
* Searches a FHIR resource type and returns the first page.
|
|
90
|
+
*
|
|
91
|
+
* @category React
|
|
92
|
+
*/
|
|
29
93
|
export declare const useSearch: <K extends ResourceType>(type: K, params?: QueryParams, options?: Pick<OvokQueryOptions, "enabled">) => OvokQueryState<Page<ExtractResource<K>>>;
|
|
94
|
+
/**
|
|
95
|
+
* Subscribes to a source of values and returns the latest one, or undefined before the first.
|
|
96
|
+
*
|
|
97
|
+
* @category React
|
|
98
|
+
*/
|
|
30
99
|
export declare const useSubscription: <T>(subscribe: (listener: (value: T) => void) => () => void) => T | undefined;
|
|
31
100
|
export {};
|
|
@@ -36,6 +36,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.useSubscription = exports.useSearch = exports.useResource = exports.useOvokMutation = exports.useOvokQuery = void 0;
|
|
37
37
|
const React = __importStar(require("react"));
|
|
38
38
|
const context_1 = require("./context");
|
|
39
|
+
/**
|
|
40
|
+
* Runs `query` and tracks its loading, error and data state; it runs again when `options.queryKey` changes.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const { data, loading } = useOvokQuery((ovok, signal) => ovok.health.check({ signal }), { queryKey: ["health"] });
|
|
44
|
+
*
|
|
45
|
+
* @category React
|
|
46
|
+
*/
|
|
39
47
|
const useOvokQuery = (query, options) => {
|
|
40
48
|
var _a, _b;
|
|
41
49
|
const client = (0, context_1.useOvok)();
|
|
@@ -94,6 +102,14 @@ const useOvokQuery = (query, options) => {
|
|
|
94
102
|
};
|
|
95
103
|
};
|
|
96
104
|
exports.useOvokQuery = useOvokQuery;
|
|
105
|
+
/**
|
|
106
|
+
* Wraps a write so a component can call it and track its loading, error and data state.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* const { mutate } = useOvokMutation((ovok, patient) => ovok.fhir.create(patient));
|
|
110
|
+
*
|
|
111
|
+
* @category React
|
|
112
|
+
*/
|
|
97
113
|
const useOvokMutation = (mutation) => {
|
|
98
114
|
const client = (0, context_1.useOvok)();
|
|
99
115
|
const mutationRef = React.useRef(mutation);
|
|
@@ -128,6 +144,11 @@ const useOvokMutation = (mutation) => {
|
|
|
128
144
|
return { data, loading, error, mutate, reset };
|
|
129
145
|
};
|
|
130
146
|
exports.useOvokMutation = useOvokMutation;
|
|
147
|
+
/**
|
|
148
|
+
* Reads one FHIR resource by id; skipped while `id` is undefined.
|
|
149
|
+
*
|
|
150
|
+
* @category React
|
|
151
|
+
*/
|
|
131
152
|
const useResource = (type, id, options = {}) => {
|
|
132
153
|
var _a;
|
|
133
154
|
return (0, exports.useOvokQuery)((client, signal) => {
|
|
@@ -138,8 +159,18 @@ const useResource = (type, id, options = {}) => {
|
|
|
138
159
|
}, { queryKey: [type, id], enabled: (_a = options.enabled) !== null && _a !== void 0 ? _a : Boolean(id) });
|
|
139
160
|
};
|
|
140
161
|
exports.useResource = useResource;
|
|
162
|
+
/**
|
|
163
|
+
* Searches a FHIR resource type and returns the first page.
|
|
164
|
+
*
|
|
165
|
+
* @category React
|
|
166
|
+
*/
|
|
141
167
|
const useSearch = (type, params = {}, options = {}) => (0, exports.useOvokQuery)((client, signal) => client.fhir.search(type, params, { signal }), { queryKey: [type, params], enabled: options.enabled });
|
|
142
168
|
exports.useSearch = useSearch;
|
|
169
|
+
/**
|
|
170
|
+
* Subscribes to a source of values and returns the latest one, or undefined before the first.
|
|
171
|
+
*
|
|
172
|
+
* @category React
|
|
173
|
+
*/
|
|
143
174
|
const useSubscription = (subscribe) => {
|
|
144
175
|
const [subscription, setSubscription] = React.useState();
|
|
145
176
|
React.useEffect(() => {
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { OvokAccount } from "../../../client/platform/types";
|
|
2
2
|
import { HttpClient } from "../../http/http-client";
|
|
3
3
|
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
/**
|
|
5
|
+
* Lists the accounts the signed-in user can access.
|
|
6
|
+
*
|
|
7
|
+
* @category accounts
|
|
8
|
+
*/
|
|
4
9
|
export declare class AccountsResource {
|
|
5
10
|
private readonly http;
|
|
6
11
|
constructor(http: HttpClient);
|
|
12
|
+
/** Lists the accounts the signed-in user can access. Calls `GET accounts`. */
|
|
7
13
|
list(options?: RequestOptions): Promise<OvokAccount[]>;
|
|
8
14
|
}
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AccountsResource = void 0;
|
|
4
4
|
const ACCOUNTS_PATH = "accounts";
|
|
5
|
+
/**
|
|
6
|
+
* Lists the accounts the signed-in user can access.
|
|
7
|
+
*
|
|
8
|
+
* @category accounts
|
|
9
|
+
*/
|
|
5
10
|
class AccountsResource {
|
|
6
11
|
constructor(http) {
|
|
7
12
|
this.http = http;
|
|
8
13
|
}
|
|
14
|
+
/** Lists the accounts the signed-in user can access. Calls `GET accounts`. */
|
|
9
15
|
list(options) {
|
|
10
16
|
return this.http.get(ACCOUNTS_PATH, options);
|
|
11
17
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { HttpClient } from "../../http/http-client";
|
|
2
2
|
import { ChatMessagesResource } from "./chat-messages-resource";
|
|
3
3
|
import { ChatSessionsResource } from "./chat-sessions-resource";
|
|
4
|
+
/**
|
|
5
|
+
* Chat sessions and messages of the AI assistant.
|
|
6
|
+
*
|
|
7
|
+
* @category ai
|
|
8
|
+
*/
|
|
4
9
|
export declare class AiChatResource {
|
|
10
|
+
/** Chat sessions. */
|
|
5
11
|
readonly sessions: ChatSessionsResource;
|
|
12
|
+
/** Messages within chat sessions. */
|
|
6
13
|
readonly messages: ChatMessagesResource;
|
|
7
14
|
constructor(ai: HttpClient);
|
|
8
15
|
}
|
|
@@ -3,6 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AiChatResource = void 0;
|
|
4
4
|
const chat_messages_resource_1 = require("./chat-messages-resource");
|
|
5
5
|
const chat_sessions_resource_1 = require("./chat-sessions-resource");
|
|
6
|
+
/**
|
|
7
|
+
* Chat sessions and messages of the AI assistant.
|
|
8
|
+
*
|
|
9
|
+
* @category ai
|
|
10
|
+
*/
|
|
6
11
|
class AiChatResource {
|
|
7
12
|
constructor(ai) {
|
|
8
13
|
this.sessions = new chat_sessions_resource_1.ChatSessionsResource(ai);
|
|
@@ -3,13 +3,26 @@ import type { OvokTranslationRequest, OvokTranslationResponse } from "../../../c
|
|
|
3
3
|
import { HttpClient } from "../../http/http-client";
|
|
4
4
|
import { RequestOptions } from "../../http/transmit";
|
|
5
5
|
import { AiChatResource } from "./ai-chat-resource";
|
|
6
|
+
/**
|
|
7
|
+
* Request for an AI-assisted FHIR search, optionally pinned to a FHIR version.
|
|
8
|
+
*
|
|
9
|
+
* @category ai
|
|
10
|
+
*/
|
|
6
11
|
export type AiFhirSearchRequest = AIFhirRequest & {
|
|
12
|
+
/** FHIR version to search; the server default applies when omitted. */
|
|
7
13
|
fhirVersion?: "R4" | "R5";
|
|
8
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* AI features: chat, translation and natural-language FHIR search. Calls routes under `ai`.
|
|
17
|
+
*
|
|
18
|
+
* @category ai
|
|
19
|
+
*/
|
|
9
20
|
export declare class AiResource {
|
|
21
|
+
/** Chat sessions and messages. */
|
|
10
22
|
readonly chat: AiChatResource;
|
|
11
23
|
private readonly ai;
|
|
12
24
|
constructor(http: HttpClient);
|
|
25
|
+
/** Translates text. Calls `POST ai/translation`. */
|
|
13
26
|
translate(body: OvokTranslationRequest, options?: RequestOptions): Promise<OvokTranslationResponse>;
|
|
14
27
|
/** An LLM plans and runs the FHIR queries, so the answer can be wrong or invented. */
|
|
15
28
|
fhirSearch(body: AiFhirSearchRequest, options?: RequestOptions): Promise<AIFhirResponse>;
|
|
@@ -3,11 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AiResource = void 0;
|
|
4
4
|
const ai_chat_resource_1 = require("./ai-chat-resource");
|
|
5
5
|
const AI_PATH = "ai";
|
|
6
|
+
/**
|
|
7
|
+
* AI features: chat, translation and natural-language FHIR search. Calls routes under `ai`.
|
|
8
|
+
*
|
|
9
|
+
* @category ai
|
|
10
|
+
*/
|
|
6
11
|
class AiResource {
|
|
7
12
|
constructor(http) {
|
|
8
13
|
this.ai = http.under(AI_PATH);
|
|
9
14
|
this.chat = new ai_chat_resource_1.AiChatResource(this.ai);
|
|
10
15
|
}
|
|
16
|
+
/** Translates text. Calls `POST ai/translation`. */
|
|
11
17
|
translate(body, options) {
|
|
12
18
|
return this.ai.post("translation", body, options);
|
|
13
19
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { OvokChatMessage, OvokChatMessageInput, OvokChatMessageQuery, OvokChatMessagesResponse } from "../../../client/experience/types";
|
|
2
2
|
import { HttpClient } from "../../http/http-client";
|
|
3
3
|
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
/**
|
|
5
|
+
* Messages of an AI chat session.
|
|
6
|
+
*
|
|
7
|
+
* @category ai
|
|
8
|
+
*/
|
|
4
9
|
export declare class ChatMessagesResource {
|
|
5
10
|
private readonly ai;
|
|
6
11
|
constructor(ai: HttpClient);
|
|
12
|
+
/** Lists the messages of a chat session. */
|
|
7
13
|
list(sessionId: string, params?: OvokChatMessageQuery, options?: RequestOptions): Promise<OvokChatMessagesResponse>;
|
|
14
|
+
/** Sends a message to a chat session and returns the reply. */
|
|
8
15
|
send(sessionId: string, body: OvokChatMessageInput, options?: RequestOptions): Promise<OvokChatMessage>;
|
|
9
16
|
}
|
|
@@ -4,13 +4,20 @@ exports.ChatMessagesResource = void 0;
|
|
|
4
4
|
const query_string_1 = require("../../../client/query-string");
|
|
5
5
|
const chat_sessions_resource_1 = require("./chat-sessions-resource");
|
|
6
6
|
const messagesPath = (sessionId) => `${(0, chat_sessions_resource_1.sessionPath)(sessionId)}/message`;
|
|
7
|
+
/**
|
|
8
|
+
* Messages of an AI chat session.
|
|
9
|
+
*
|
|
10
|
+
* @category ai
|
|
11
|
+
*/
|
|
7
12
|
class ChatMessagesResource {
|
|
8
13
|
constructor(ai) {
|
|
9
14
|
this.ai = ai;
|
|
10
15
|
}
|
|
16
|
+
/** Lists the messages of a chat session. */
|
|
11
17
|
list(sessionId, params = {}, options) {
|
|
12
18
|
return this.ai.get(`${messagesPath(sessionId)}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
13
19
|
}
|
|
20
|
+
/** Sends a message to a chat session and returns the reply. */
|
|
14
21
|
send(sessionId, body, options) {
|
|
15
22
|
return this.ai.post(messagesPath(sessionId), body, options);
|
|
16
23
|
}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import type { OvokChatSession, OvokChatSessionQuery, OvokChatSessionsResponse, OvokCreateChatSession } from "../../../client/experience/types";
|
|
2
2
|
import { HttpClient } from "../../http/http-client";
|
|
3
3
|
import { RequestOptions } from "../../http/transmit";
|
|
4
|
+
/**
|
|
5
|
+
* Options for fetching one chat session.
|
|
6
|
+
*
|
|
7
|
+
* @category ai
|
|
8
|
+
*/
|
|
4
9
|
export type ChatSessionRetrieveParams = {
|
|
10
|
+
/** How many of the latest messages to include. */
|
|
5
11
|
messageCount?: number;
|
|
6
12
|
};
|
|
7
13
|
export declare const sessionPath: (sessionId: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Create, list and fetch AI chat sessions.
|
|
16
|
+
*
|
|
17
|
+
* @category ai
|
|
18
|
+
*/
|
|
8
19
|
export declare class ChatSessionsResource {
|
|
9
20
|
private readonly ai;
|
|
10
21
|
constructor(ai: HttpClient);
|
|
22
|
+
/** Creates a chat session. Calls `POST session`. */
|
|
11
23
|
create(body: OvokCreateChatSession, options?: RequestOptions): Promise<OvokChatSession>;
|
|
24
|
+
/** Lists chat sessions. Calls `GET session`. */
|
|
12
25
|
list(params?: OvokChatSessionQuery, options?: RequestOptions): Promise<OvokChatSessionsResponse>;
|
|
26
|
+
/** Fetches one chat session. Calls `GET session/{sessionId}`. */
|
|
13
27
|
retrieve(sessionId: string, params?: ChatSessionRetrieveParams, options?: RequestOptions): Promise<OvokChatSession>;
|
|
14
28
|
}
|
|
@@ -6,16 +6,24 @@ const url_1 = require("../../http/url");
|
|
|
6
6
|
const SESSION_PATH = "session";
|
|
7
7
|
const sessionPath = (sessionId) => `${SESSION_PATH}/${(0, url_1.pathSegment)(sessionId)}`;
|
|
8
8
|
exports.sessionPath = sessionPath;
|
|
9
|
+
/**
|
|
10
|
+
* Create, list and fetch AI chat sessions.
|
|
11
|
+
*
|
|
12
|
+
* @category ai
|
|
13
|
+
*/
|
|
9
14
|
class ChatSessionsResource {
|
|
10
15
|
constructor(ai) {
|
|
11
16
|
this.ai = ai;
|
|
12
17
|
}
|
|
18
|
+
/** Creates a chat session. Calls `POST session`. */
|
|
13
19
|
create(body, options) {
|
|
14
20
|
return this.ai.post(SESSION_PATH, body, options);
|
|
15
21
|
}
|
|
22
|
+
/** Lists chat sessions. Calls `GET session`. */
|
|
16
23
|
list(params = {}, options) {
|
|
17
24
|
return this.ai.get(`${SESSION_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
18
25
|
}
|
|
26
|
+
/** Fetches one chat session. Calls `GET session/{sessionId}`. */
|
|
19
27
|
retrieve(sessionId, params = {}, options) {
|
|
20
28
|
return this.ai.get(`${(0, exports.sessionPath)(sessionId)}${(0, query_string_1.toQueryString)(params)}`, options);
|
|
21
29
|
}
|
|
@@ -2,11 +2,16 @@ import type { OvokSession, SessionRevokeOption } from "../../../client/auth/type
|
|
|
2
2
|
import { UserSession } from "../../auth/user-session";
|
|
3
3
|
import { HttpClient } from "../../http/http-client";
|
|
4
4
|
import { RequestOptions } from "../../http/transmit";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The account's sessions on the server.
|
|
7
|
+
*
|
|
8
|
+
* @category auth
|
|
9
|
+
*/
|
|
6
10
|
export declare class AuthSessionsResource {
|
|
7
11
|
private readonly http;
|
|
8
12
|
private readonly session;
|
|
9
13
|
constructor(http: HttpClient, session: UserSession | null);
|
|
14
|
+
/** Lists the account's sessions. Calls `GET auth/session`. */
|
|
10
15
|
list(options?: RequestOptions): Promise<OvokSession[]>;
|
|
11
16
|
/** Revoking the current session also ends it here. */
|
|
12
17
|
revoke(option: SessionRevokeOption, options?: RequestOptions): Promise<void>;
|
|
@@ -4,12 +4,17 @@ exports.AuthSessionsResource = void 0;
|
|
|
4
4
|
const url_1 = require("../../http/url");
|
|
5
5
|
const SESSIONS_PATH = "auth/session";
|
|
6
6
|
const CURRENT_SESSION = "current";
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The account's sessions on the server.
|
|
9
|
+
*
|
|
10
|
+
* @category auth
|
|
11
|
+
*/
|
|
8
12
|
class AuthSessionsResource {
|
|
9
13
|
constructor(http, session) {
|
|
10
14
|
this.http = http;
|
|
11
15
|
this.session = session;
|
|
12
16
|
}
|
|
17
|
+
/** Lists the account's sessions. Calls `GET auth/session`. */
|
|
13
18
|
list(options) {
|
|
14
19
|
return this.http.get(SESSIONS_PATH, options);
|
|
15
20
|
}
|
|
@@ -2,13 +2,30 @@ import type { RegisterBody } from "../../../client/auth/types/RegisterBody";
|
|
|
2
2
|
import type { RegisterPractitionerBody } from "../../../client/auth/types/RegisterPractitionerBody";
|
|
3
3
|
import type { ClinicianInviteStep } from "../../../client/auth/types/RegisterResponse";
|
|
4
4
|
import { LoginTokens, Session } from "../../auth/session";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The tenant comes from the client's config, as it does for login.
|
|
7
|
+
*
|
|
8
|
+
* @category auth
|
|
9
|
+
*/
|
|
6
10
|
export type PatientRegistration = Omit<RegisterBody, "tenantCode">;
|
|
11
|
+
/**
|
|
12
|
+
* Details for registering a practitioner; the tenant comes from the client's config.
|
|
13
|
+
*
|
|
14
|
+
* @category auth
|
|
15
|
+
*/
|
|
7
16
|
export type PractitionerRegistration = Omit<RegisterPractitionerBody, "tenantCode">;
|
|
17
|
+
/**
|
|
18
|
+
* Either a signed-in session, or a notice that a clinician invitation was started.
|
|
19
|
+
*
|
|
20
|
+
* @category auth
|
|
21
|
+
*/
|
|
8
22
|
export type RegisterResult = {
|
|
23
|
+
/** The new account is signed in. */
|
|
9
24
|
status: "signed-in";
|
|
25
|
+
/** The new session. */
|
|
10
26
|
session: Session;
|
|
11
27
|
} | {
|
|
28
|
+
/** No session was issued; the person must accept a clinician invitation. */
|
|
12
29
|
status: "clinician-invite";
|
|
13
30
|
};
|
|
14
31
|
export type RegisterResponse = LoginTokens | ClinicianInviteStep;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import type { AppleLoginBody } from "../../../client/auth/types/AppleLoginBody";
|
|
2
2
|
import type { GoogleLoginBody } from "../../../client/auth/types/GoogleLoginBody";
|
|
3
|
+
/**
|
|
4
|
+
* Provider token bodies, keyed by provider.
|
|
5
|
+
*
|
|
6
|
+
* @category auth
|
|
7
|
+
*/
|
|
3
8
|
export type SocialCredentials = {
|
|
9
|
+
/** Credential from Apple sign-in. */
|
|
4
10
|
apple: AppleLoginBody;
|
|
11
|
+
/** Credential from Google sign-in. */
|
|
5
12
|
google: GoogleLoginBody;
|
|
6
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Supported social sign-in providers.
|
|
16
|
+
*
|
|
17
|
+
* @category auth
|
|
18
|
+
*/
|
|
7
19
|
export type SocialProvider = keyof SocialCredentials;
|
|
8
20
|
export declare const socialLoginPath: (provider: SocialProvider, clientId: string, internalId: string) => string;
|
|
@@ -13,45 +13,98 @@ import { RequestOptions } from "../http/transmit";
|
|
|
13
13
|
import { AuthSessionsResource } from "./auth/auth-sessions-resource";
|
|
14
14
|
import { PatientRegistration, PractitionerRegistration, RegisterResult } from "./auth/registration";
|
|
15
15
|
import { SocialCredentials, SocialProvider } from "./auth/social-login";
|
|
16
|
+
/**
|
|
17
|
+
* The kind of account that signs in.
|
|
18
|
+
*
|
|
19
|
+
* @category auth
|
|
20
|
+
*/
|
|
16
21
|
export type ProfileType = "Patient" | "Practitioner" | "RelatedPerson";
|
|
22
|
+
/**
|
|
23
|
+
* Email and password for one profile type.
|
|
24
|
+
*
|
|
25
|
+
* @category auth
|
|
26
|
+
*/
|
|
17
27
|
export type LoginCredentials = {
|
|
28
|
+
/** Which kind of account to sign in to. */
|
|
18
29
|
profileType: ProfileType;
|
|
30
|
+
/** Account email address. */
|
|
19
31
|
email: string;
|
|
32
|
+
/** Account password. */
|
|
20
33
|
password: string;
|
|
21
34
|
};
|
|
22
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Hand it back to `verifyMfa`: it carries the PKCE verifier the token exchange needs.
|
|
37
|
+
*
|
|
38
|
+
* @category auth
|
|
39
|
+
*/
|
|
23
40
|
export type MfaChallenge = {
|
|
41
|
+
/** Account kind being signed in. */
|
|
24
42
|
profileType: ProfileType;
|
|
43
|
+
/** Server id of the pending login. */
|
|
25
44
|
loginId: string;
|
|
45
|
+
/** PKCE verifier for the token exchange. */
|
|
26
46
|
codeVerifier: string;
|
|
27
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Either a signed-in session, or an MFA challenge to complete with `verifyMfa`.
|
|
50
|
+
*
|
|
51
|
+
* @category auth
|
|
52
|
+
*/
|
|
28
53
|
export type LoginResult = {
|
|
54
|
+
/** Sign-in finished. */
|
|
29
55
|
status: "signed-in";
|
|
56
|
+
/** The new session. */
|
|
30
57
|
session: Session;
|
|
31
58
|
} | {
|
|
59
|
+
/** A second factor is needed. */
|
|
32
60
|
status: "mfa-required";
|
|
61
|
+
/** Pass to `verifyMfa` with the code. */
|
|
33
62
|
challenge: MfaChallenge;
|
|
34
63
|
};
|
|
35
64
|
export declare const ME_PATH = "auth/me";
|
|
65
|
+
/**
|
|
66
|
+
* Sign-in, registration, password and session management. Routes are under `auth` and `v2/auth`.
|
|
67
|
+
*
|
|
68
|
+
* @category auth
|
|
69
|
+
*/
|
|
36
70
|
export declare class AuthResource {
|
|
37
71
|
private readonly http;
|
|
38
72
|
private readonly tenantCode;
|
|
39
73
|
private readonly session;
|
|
40
74
|
private readonly clientId;
|
|
75
|
+
/** Server-side sessions of the signed-in account. */
|
|
41
76
|
readonly sessions: AuthSessionsResource;
|
|
42
77
|
/** `clientId` is the ClientApplication social sign-in and password resets go through. */
|
|
43
78
|
constructor(http: HttpClient, tenantCode: string, session: UserSession | null, clientId?: string | null);
|
|
79
|
+
/**
|
|
80
|
+
* Signs in with email and password. Calls `POST auth/tenant/{profileType}/login/start`, then `.../token` unless MFA is required.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const result = await ovok.auth.login({ profileType: "Patient", email, password });
|
|
84
|
+
* if (result.status === "mfa-required") await ovok.auth.verifyMfa(result.challenge, code);
|
|
85
|
+
*/
|
|
44
86
|
login(credentials: LoginCredentials, options?: RequestOptions): Promise<LoginResult>;
|
|
87
|
+
/** Completes an MFA sign-in with the code. Calls `POST auth/tenant/{profileType}/login/mfa`, then `.../token`. */
|
|
45
88
|
verifyMfa(challenge: MfaChallenge, code: string, options?: RequestOptions): Promise<LoginResult>;
|
|
46
89
|
/** A project that routes the email to a clinician invitation signs no one in. */
|
|
47
90
|
register(details: PatientRegistration, options?: RequestOptions): Promise<RegisterResult>;
|
|
91
|
+
/**
|
|
92
|
+
* Registers a practitioner in the client's tenant and signs them in. Calls `POST auth/tenant/Practitioner/register`.
|
|
93
|
+
*
|
|
94
|
+
* @throws OvokValidationError when `password` and `passwordConfirm` differ.
|
|
95
|
+
*/
|
|
48
96
|
registerPractitioner(details: PractitionerRegistration, options?: RequestOptions): Promise<Session>;
|
|
97
|
+
/** Signs in with an Apple or Google token. Calls `POST auth/external/{provider}`. */
|
|
49
98
|
socialLogin<P extends SocialProvider>(provider: P, credential: SocialCredentials[P], options?: RequestOptions): Promise<Session>;
|
|
99
|
+
/** Returns the current session, or null when signed out. */
|
|
50
100
|
current(): Promise<Session | null>;
|
|
101
|
+
/** Fetches the signed-in user's profile. Calls `GET auth/me`. */
|
|
51
102
|
me(options?: RequestOptions): Promise<OvokCurrentPatientProfile>;
|
|
52
103
|
/** The confirmation is the app's to check; Ovok Core never receives it. */
|
|
53
104
|
changePassword(change: ChangePasswordBody, options?: RequestOptions): Promise<ChangePasswordResponse>;
|
|
105
|
+
/** Sends a password-reset email. Calls `POST v2/auth/reset-password`. */
|
|
54
106
|
resetPassword(request: ResetPasswordBody, options?: RequestOptions): Promise<OperationOutcome>;
|
|
107
|
+
/** Sets a new password using the token from the reset email. Calls `POST v2/auth/reset-password/process`. */
|
|
55
108
|
completePasswordReset(body: CompletePasswordResetBody, options?: RequestOptions): Promise<OperationOutcome>;
|
|
56
109
|
/** Schedules the deletion; the account stays signed in until then. */
|
|
57
110
|
deleteAccount(request: RequestDeleteUserBody, options?: RequestOptions): Promise<RequestDeleteUserResponse>;
|