@ovok/core 0.4.49-dev.504 → 0.4.49-dev.515
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
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { CreateWearableProviderRequest, UpdateWearableProviderRequest, WearableConnectionAuthorization, WearableConnections, WearableProvider, WearableProviderSettings, WearableProviderSettingsList } from "../client/wearables";
|
|
2
2
|
import { OvokMutationState, OvokRequestState } from "./api-hooks";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the wearable provider settings via `client.listWearableProviders`; reloads when providers change.
|
|
5
|
+
*/
|
|
3
6
|
export declare const useWearableProviders: () => OvokRequestState<WearableProviderSettingsList>;
|
|
7
|
+
/**
|
|
8
|
+
* Loads the patient's wearable connections via `client.listWearableConnections`; reloads when connections change.
|
|
9
|
+
*/
|
|
4
10
|
export declare const useWearableConnections: () => OvokRequestState<WearableConnections>;
|
|
11
|
+
/**
|
|
12
|
+
* Mutation that configures a wearable provider via `client.createWearableProvider`.
|
|
13
|
+
*/
|
|
5
14
|
export declare const useCreateWearableProvider: () => OvokMutationState<CreateWearableProviderRequest, WearableProviderSettings>;
|
|
15
|
+
/**
|
|
16
|
+
* Mutation that changes a wearable provider's settings via `client.updateWearableProvider`.
|
|
17
|
+
*/
|
|
6
18
|
export declare const useUpdateWearableProvider: () => OvokMutationState<{
|
|
19
|
+
/** Provider to update. */
|
|
7
20
|
provider: WearableProvider;
|
|
21
|
+
/** Fields to change. */
|
|
8
22
|
body: UpdateWearableProviderRequest;
|
|
9
23
|
}, WearableProviderSettings>;
|
|
24
|
+
/**
|
|
25
|
+
* Mutation that removes a wearable provider via `client.deleteWearableProvider`; its parameter is the provider.
|
|
26
|
+
*/
|
|
10
27
|
export declare const useDeleteWearableProvider: () => OvokMutationState<WearableProvider, void>;
|
|
28
|
+
/**
|
|
29
|
+
* Mutation that starts connecting a provider via `client.authorizeWearableConnection`; resolves with the authorization URL.
|
|
30
|
+
*/
|
|
11
31
|
export declare const useAuthorizeWearableConnection: () => OvokMutationState<WearableProvider, WearableConnectionAuthorization>;
|
|
32
|
+
/**
|
|
33
|
+
* Mutation that disconnects a provider via `client.deleteWearableConnection`; its parameter is the provider.
|
|
34
|
+
*/
|
|
12
35
|
export declare const useDeleteWearableConnection: () => OvokMutationState<WearableProvider, void>;
|
|
@@ -39,6 +39,9 @@ const React = __importStar(require("react"));
|
|
|
39
39
|
const api_hooks_1 = require("./api-hooks");
|
|
40
40
|
const wearable_invalidation_1 = require("./wearable-invalidation");
|
|
41
41
|
const index_1 = require("./index");
|
|
42
|
+
/**
|
|
43
|
+
* Loads the wearable provider settings via `client.listWearableProviders`; reloads when providers change.
|
|
44
|
+
*/
|
|
42
45
|
const useWearableProviders = () => {
|
|
43
46
|
const client = (0, index_1.useClient)();
|
|
44
47
|
const state = (0, api_hooks_1.useOvokClientRequest)((current, signal) => current.listWearableProviders({ signal }));
|
|
@@ -46,6 +49,9 @@ const useWearableProviders = () => {
|
|
|
46
49
|
return state;
|
|
47
50
|
};
|
|
48
51
|
exports.useWearableProviders = useWearableProviders;
|
|
52
|
+
/**
|
|
53
|
+
* Loads the patient's wearable connections via `client.listWearableConnections`; reloads when connections change.
|
|
54
|
+
*/
|
|
49
55
|
const useWearableConnections = () => {
|
|
50
56
|
const client = (0, index_1.useClient)();
|
|
51
57
|
const state = (0, api_hooks_1.useOvokClientRequest)((current, signal) => current.listWearableConnections({ signal }));
|
|
@@ -53,25 +59,40 @@ const useWearableConnections = () => {
|
|
|
53
59
|
return state;
|
|
54
60
|
};
|
|
55
61
|
exports.useWearableConnections = useWearableConnections;
|
|
62
|
+
/**
|
|
63
|
+
* Mutation that configures a wearable provider via `client.createWearableProvider`.
|
|
64
|
+
*/
|
|
56
65
|
const useCreateWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, body) => {
|
|
57
66
|
const settings = await client.createWearableProvider(body);
|
|
58
67
|
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
59
68
|
return settings;
|
|
60
69
|
});
|
|
61
70
|
exports.useCreateWearableProvider = useCreateWearableProvider;
|
|
71
|
+
/**
|
|
72
|
+
* Mutation that changes a wearable provider's settings via `client.updateWearableProvider`.
|
|
73
|
+
*/
|
|
62
74
|
const useUpdateWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, { provider, body }) => {
|
|
63
75
|
const settings = await client.updateWearableProvider(provider, body);
|
|
64
76
|
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
65
77
|
return settings;
|
|
66
78
|
});
|
|
67
79
|
exports.useUpdateWearableProvider = useUpdateWearableProvider;
|
|
80
|
+
/**
|
|
81
|
+
* Mutation that removes a wearable provider via `client.deleteWearableProvider`; its parameter is the provider.
|
|
82
|
+
*/
|
|
68
83
|
const useDeleteWearableProvider = () => (0, api_hooks_1.useOvokMutation)(async (client, provider) => {
|
|
69
84
|
await client.deleteWearableProvider(provider);
|
|
70
85
|
(0, wearable_invalidation_1.notifyWearableChanges)(client, "providers");
|
|
71
86
|
});
|
|
72
87
|
exports.useDeleteWearableProvider = useDeleteWearableProvider;
|
|
88
|
+
/**
|
|
89
|
+
* Mutation that starts connecting a provider via `client.authorizeWearableConnection`; resolves with the authorization URL.
|
|
90
|
+
*/
|
|
73
91
|
const useAuthorizeWearableConnection = () => (0, api_hooks_1.useOvokMutation)((client, provider) => client.authorizeWearableConnection(provider));
|
|
74
92
|
exports.useAuthorizeWearableConnection = useAuthorizeWearableConnection;
|
|
93
|
+
/**
|
|
94
|
+
* Mutation that disconnects a provider via `client.deleteWearableConnection`; its parameter is the provider.
|
|
95
|
+
*/
|
|
75
96
|
const useDeleteWearableConnection = () => (0, api_hooks_1.useOvokMutation)(async (client, provider) => {
|
|
76
97
|
await client.deleteWearableConnection(provider);
|
|
77
98
|
(0, wearable_invalidation_1.notifyWearableChanges)(client, "connections");
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { OvokStorage } from "../storage/ovok-storage";
|
|
2
2
|
import { OvokReference, Session } from "./session";
|
|
3
|
+
/**
|
|
4
|
+
* An account saved on this device, without its tokens.
|
|
5
|
+
*
|
|
6
|
+
* @category session
|
|
7
|
+
*/
|
|
3
8
|
export type SavedAccount = {
|
|
9
|
+
/** Stable account id: the profile reference. */
|
|
4
10
|
id: string;
|
|
11
|
+
/** The account's profile. */
|
|
5
12
|
profile: OvokReference;
|
|
13
|
+
/** The account's project. */
|
|
6
14
|
project: OvokReference;
|
|
15
|
+
/** Whether this is the account currently signed in. */
|
|
7
16
|
active: boolean;
|
|
17
|
+
/** Whether the saved session has expired and needs a new sign-in. */
|
|
8
18
|
expired: boolean;
|
|
9
19
|
};
|
|
10
20
|
export type StoredSavedAccount = {
|
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import { OAuthTokenResponse } from "./token-endpoint";
|
|
2
|
+
/**
|
|
3
|
+
* A FHIR reference with an optional display name.
|
|
4
|
+
*
|
|
5
|
+
* @category session
|
|
6
|
+
*/
|
|
2
7
|
export type OvokReference = {
|
|
8
|
+
/** FHIR reference, such as `Patient/123`. */
|
|
3
9
|
reference: string;
|
|
10
|
+
/** Display name, or null when none is known. */
|
|
4
11
|
display: string | null;
|
|
5
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* A signed-in session: tokens, expiry, project and profile.
|
|
15
|
+
*
|
|
16
|
+
* @category session
|
|
17
|
+
*/
|
|
6
18
|
export type Session = {
|
|
19
|
+
/** Bearer token for API requests. */
|
|
7
20
|
accessToken: string;
|
|
21
|
+
/** Token used to renew the session, or null when it cannot be renewed. */
|
|
8
22
|
refreshToken: string | null;
|
|
23
|
+
/** Access token expiry, in milliseconds since the Unix epoch. */
|
|
9
24
|
expiresAt: number;
|
|
25
|
+
/** The project the session belongs to. */
|
|
10
26
|
project: OvokReference;
|
|
27
|
+
/** The signed-in profile. */
|
|
11
28
|
profile: OvokReference;
|
|
12
29
|
};
|
|
13
30
|
export type LoginTokens = {
|
|
@@ -6,6 +6,11 @@ import { LoginTokens, Session } from "./session";
|
|
|
6
6
|
import { SessionStore } from "./session-store";
|
|
7
7
|
import { TokenEndpoint } from "./token-endpoint";
|
|
8
8
|
type SessionSettings = Pick<OvokSettings, "clientId" | "onUnauthenticated">;
|
|
9
|
+
/**
|
|
10
|
+
* Called with the new session, or null when the user signs out.
|
|
11
|
+
*
|
|
12
|
+
* @category session
|
|
13
|
+
*/
|
|
9
14
|
export type SessionChangeListener = (session: Session | null) => void;
|
|
10
15
|
export declare class UserSession implements Credentials {
|
|
11
16
|
private readonly store;
|
|
@@ -1,27 +1,72 @@
|
|
|
1
1
|
import { OvokStorage } from "../storage/ovok-storage";
|
|
2
|
+
/**
|
|
3
|
+
* Fetch implementation used for every request.
|
|
4
|
+
*
|
|
5
|
+
* @category Ovok client
|
|
6
|
+
*/
|
|
2
7
|
export type OvokFetch = (url: string, init: RequestInit) => Promise<Response>;
|
|
8
|
+
/**
|
|
9
|
+
* Why the client lost its session.
|
|
10
|
+
*
|
|
11
|
+
* @category Ovok client
|
|
12
|
+
*/
|
|
3
13
|
export type OvokUnauthenticatedReason = {
|
|
14
|
+
/** The refresh token was rejected by the server. */
|
|
4
15
|
type: "refresh-rejected";
|
|
16
|
+
/** HTTP status of the rejection. */
|
|
5
17
|
status: number;
|
|
6
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Options shared by every client configuration.
|
|
21
|
+
*
|
|
22
|
+
* @category Ovok client
|
|
23
|
+
*/
|
|
7
24
|
type OvokBaseConfig = {
|
|
25
|
+
/** Absolute http(s) URL of the Ovok API. */
|
|
8
26
|
baseUrl: string;
|
|
27
|
+
/** Code of the tenant the client works in. */
|
|
9
28
|
tenantCode: string;
|
|
29
|
+
/** Path of the FHIR API under `baseUrl`. Defaults to `fhir`. */
|
|
10
30
|
fhirPath?: string;
|
|
31
|
+
/** Where the session is kept. Defaults to in-memory storage. */
|
|
11
32
|
storage?: OvokStorage;
|
|
33
|
+
/** Custom fetch implementation. Defaults to the global `fetch`. */
|
|
12
34
|
fetch?: OvokFetch;
|
|
35
|
+
/** Request timeout, in milliseconds. Defaults to 30000. */
|
|
13
36
|
timeoutMs?: number;
|
|
37
|
+
/** Retries after a network failure. Defaults to 2. */
|
|
14
38
|
maxNetworkRetries?: number;
|
|
39
|
+
/** Called when the session can no longer be refreshed. */
|
|
15
40
|
onUnauthenticated?: (reason: OvokUnauthenticatedReason) => void;
|
|
16
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Client configuration for end users, without a secret.
|
|
44
|
+
*
|
|
45
|
+
* @category Ovok client
|
|
46
|
+
*/
|
|
17
47
|
type OvokUserClientConfig = {
|
|
48
|
+
/** ID of the client application, when one is used. */
|
|
18
49
|
clientId?: string;
|
|
50
|
+
/** Not allowed for user clients. */
|
|
19
51
|
clientSecret?: undefined;
|
|
20
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Client configuration for server-side machine credentials.
|
|
55
|
+
*
|
|
56
|
+
* @category Ovok client
|
|
57
|
+
*/
|
|
21
58
|
type OvokMachineClientConfig = {
|
|
59
|
+
/** ID of the client application. */
|
|
22
60
|
clientId: string;
|
|
61
|
+
/** Secret of the client application. */
|
|
23
62
|
clientSecret: string;
|
|
24
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* Configuration of the `Ovok` client. A `clientSecret` (with `clientId`) selects server-side machine credentials,
|
|
66
|
+
* which are rejected in a browser.
|
|
67
|
+
*
|
|
68
|
+
* @category Ovok client
|
|
69
|
+
*/
|
|
25
70
|
export type OvokConfig = OvokBaseConfig & (OvokUserClientConfig | OvokMachineClientConfig);
|
|
26
71
|
export type MachineClient = {
|
|
27
72
|
clientId: string;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a saved account cannot be used.
|
|
3
|
+
*
|
|
4
|
+
* @category Errors
|
|
5
|
+
*/
|
|
1
6
|
export type OvokAccountErrorCode = "account_not_found" | "account_expired";
|
|
7
|
+
/**
|
|
8
|
+
* A saved account is missing or its session expired.
|
|
9
|
+
*
|
|
10
|
+
* @category Errors
|
|
11
|
+
*/
|
|
2
12
|
export declare class OvokAccountError extends Error {
|
|
13
|
+
/** `account_not_found` when no saved account matches, `account_expired` when its session ended. */
|
|
3
14
|
readonly code: OvokAccountErrorCode;
|
|
4
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
/** `account_not_found` when no saved account matches, `account_expired` when its session ended. */
|
|
17
|
+
code: OvokAccountErrorCode);
|
|
5
18
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OvokAccountError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A saved account is missing or its session expired.
|
|
6
|
+
*
|
|
7
|
+
* @category Errors
|
|
8
|
+
*/
|
|
4
9
|
class OvokAccountError extends Error {
|
|
5
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
/** `account_not_found` when no saved account matches, `account_expired` when its session ended. */
|
|
12
|
+
code) {
|
|
6
13
|
super(code === "account_not_found"
|
|
7
14
|
? "Saved account was not found."
|
|
8
15
|
: "This account's session has expired. Sign in again.");
|
|
@@ -1,41 +1,129 @@
|
|
|
1
1
|
import { ValidationError } from "../../types/ValidationError";
|
|
2
|
+
/**
|
|
3
|
+
* Normalized description of a failed Ovok call.
|
|
4
|
+
*
|
|
5
|
+
* @category Errors
|
|
6
|
+
*/
|
|
2
7
|
export type OvokErrorDetails = {
|
|
8
|
+
/** HTTP status, or `null` when there was no response. */
|
|
3
9
|
status: number | null;
|
|
10
|
+
/** Machine-readable error code from the API, if any. */
|
|
4
11
|
code: string | null;
|
|
12
|
+
/** Error type from the API, if any. */
|
|
5
13
|
type: string | null;
|
|
14
|
+
/** Human-readable message. */
|
|
6
15
|
message: string;
|
|
16
|
+
/** Trace id of the request, for support. */
|
|
7
17
|
traceId: string | null;
|
|
18
|
+
/** Request id, for support. */
|
|
8
19
|
requestId: string | null;
|
|
20
|
+
/** Milliseconds to wait before retrying, from `Retry-After`. */
|
|
9
21
|
retryAfterMs: number | null;
|
|
22
|
+
/** Per-field validation failures. */
|
|
10
23
|
fieldErrors: ValidationError[];
|
|
11
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Base class of every error the `next` clients throw; the subclass reflects the HTTP status.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* try {
|
|
31
|
+
* await request();
|
|
32
|
+
* } catch (error) {
|
|
33
|
+
* if (error instanceof OvokNotFoundError) {
|
|
34
|
+
* showMissing();
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @category Errors
|
|
40
|
+
*/
|
|
12
41
|
export declare class OvokError extends Error {
|
|
42
|
+
/** HTTP status, or `null` when there was no response. */
|
|
13
43
|
readonly status: number | null;
|
|
44
|
+
/** Machine-readable error code from the API, if any. */
|
|
14
45
|
readonly code: string | null;
|
|
46
|
+
/** Error type from the API, if any. */
|
|
15
47
|
readonly type: string | null;
|
|
48
|
+
/** Trace id of the request, for support. */
|
|
16
49
|
readonly traceId: string | null;
|
|
50
|
+
/** Request id, for support. */
|
|
17
51
|
readonly requestId: string | null;
|
|
52
|
+
/** Milliseconds to wait before retrying, from `Retry-After`. */
|
|
18
53
|
readonly retryAfterMs: number | null;
|
|
54
|
+
/** Per-field validation failures. */
|
|
19
55
|
readonly fieldErrors: ValidationError[];
|
|
56
|
+
/** Underlying error, if any. */
|
|
20
57
|
readonly cause: unknown;
|
|
58
|
+
/**
|
|
59
|
+
* Creates an error from normalized details.
|
|
60
|
+
*
|
|
61
|
+
* @param details - Normalized failure description.
|
|
62
|
+
* @param cause - Underlying error.
|
|
63
|
+
*/
|
|
21
64
|
constructor(details: OvokErrorDetails, cause?: unknown);
|
|
22
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The request was invalid (400 or 422).
|
|
68
|
+
*
|
|
69
|
+
* @category Errors
|
|
70
|
+
*/
|
|
23
71
|
export declare class OvokValidationError extends OvokError {
|
|
24
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Credentials were missing or invalid (401).
|
|
75
|
+
*
|
|
76
|
+
* @category Errors
|
|
77
|
+
*/
|
|
25
78
|
export declare class OvokAuthenticationError extends OvokError {
|
|
26
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* The caller is signed in but not allowed (403).
|
|
82
|
+
*
|
|
83
|
+
* @category Errors
|
|
84
|
+
*/
|
|
27
85
|
export declare class OvokPermissionError extends OvokError {
|
|
28
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* The resource does not exist (404).
|
|
89
|
+
*
|
|
90
|
+
* @category Errors
|
|
91
|
+
*/
|
|
29
92
|
export declare class OvokNotFoundError extends OvokError {
|
|
30
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* The request conflicts with the current state (409).
|
|
96
|
+
*
|
|
97
|
+
* @category Errors
|
|
98
|
+
*/
|
|
31
99
|
export declare class OvokConflictError extends OvokError {
|
|
32
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* The caller was rate limited (429); see `retryAfterMs`.
|
|
103
|
+
*
|
|
104
|
+
* @category Errors
|
|
105
|
+
*/
|
|
33
106
|
export declare class OvokRateLimitError extends OvokError {
|
|
34
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* The server failed (5xx).
|
|
110
|
+
*
|
|
111
|
+
* @category Errors
|
|
112
|
+
*/
|
|
35
113
|
export declare class OvokServiceError extends OvokError {
|
|
36
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The server could not be reached.
|
|
117
|
+
*
|
|
118
|
+
* @category Errors
|
|
119
|
+
*/
|
|
37
120
|
export declare class OvokConnectionError extends OvokError {
|
|
38
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* The client is misconfigured.
|
|
124
|
+
*
|
|
125
|
+
* @category Errors
|
|
126
|
+
*/
|
|
39
127
|
export declare class OvokConfigError extends OvokError {
|
|
40
128
|
}
|
|
41
129
|
export declare function errorForStatus(details: OvokErrorDetails): OvokError;
|
|
@@ -2,7 +2,29 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.detailsFor = exports.OvokConfigError = exports.OvokConnectionError = exports.OvokServiceError = exports.OvokRateLimitError = exports.OvokConflictError = exports.OvokNotFoundError = exports.OvokPermissionError = exports.OvokAuthenticationError = exports.OvokValidationError = exports.OvokError = void 0;
|
|
4
4
|
exports.errorForStatus = errorForStatus;
|
|
5
|
+
/**
|
|
6
|
+
* Base class of every error the `next` clients throw; the subclass reflects the HTTP status.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* try {
|
|
11
|
+
* await request();
|
|
12
|
+
* } catch (error) {
|
|
13
|
+
* if (error instanceof OvokNotFoundError) {
|
|
14
|
+
* showMissing();
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @category Errors
|
|
20
|
+
*/
|
|
5
21
|
class OvokError extends Error {
|
|
22
|
+
/**
|
|
23
|
+
* Creates an error from normalized details.
|
|
24
|
+
*
|
|
25
|
+
* @param details - Normalized failure description.
|
|
26
|
+
* @param cause - Underlying error.
|
|
27
|
+
*/
|
|
6
28
|
constructor(details, cause) {
|
|
7
29
|
super(details.message);
|
|
8
30
|
this.name = new.target.name;
|
|
@@ -17,30 +39,75 @@ class OvokError extends Error {
|
|
|
17
39
|
}
|
|
18
40
|
}
|
|
19
41
|
exports.OvokError = OvokError;
|
|
42
|
+
/**
|
|
43
|
+
* The request was invalid (400 or 422).
|
|
44
|
+
*
|
|
45
|
+
* @category Errors
|
|
46
|
+
*/
|
|
20
47
|
class OvokValidationError extends OvokError {
|
|
21
48
|
}
|
|
22
49
|
exports.OvokValidationError = OvokValidationError;
|
|
50
|
+
/**
|
|
51
|
+
* Credentials were missing or invalid (401).
|
|
52
|
+
*
|
|
53
|
+
* @category Errors
|
|
54
|
+
*/
|
|
23
55
|
class OvokAuthenticationError extends OvokError {
|
|
24
56
|
}
|
|
25
57
|
exports.OvokAuthenticationError = OvokAuthenticationError;
|
|
58
|
+
/**
|
|
59
|
+
* The caller is signed in but not allowed (403).
|
|
60
|
+
*
|
|
61
|
+
* @category Errors
|
|
62
|
+
*/
|
|
26
63
|
class OvokPermissionError extends OvokError {
|
|
27
64
|
}
|
|
28
65
|
exports.OvokPermissionError = OvokPermissionError;
|
|
66
|
+
/**
|
|
67
|
+
* The resource does not exist (404).
|
|
68
|
+
*
|
|
69
|
+
* @category Errors
|
|
70
|
+
*/
|
|
29
71
|
class OvokNotFoundError extends OvokError {
|
|
30
72
|
}
|
|
31
73
|
exports.OvokNotFoundError = OvokNotFoundError;
|
|
74
|
+
/**
|
|
75
|
+
* The request conflicts with the current state (409).
|
|
76
|
+
*
|
|
77
|
+
* @category Errors
|
|
78
|
+
*/
|
|
32
79
|
class OvokConflictError extends OvokError {
|
|
33
80
|
}
|
|
34
81
|
exports.OvokConflictError = OvokConflictError;
|
|
82
|
+
/**
|
|
83
|
+
* The caller was rate limited (429); see `retryAfterMs`.
|
|
84
|
+
*
|
|
85
|
+
* @category Errors
|
|
86
|
+
*/
|
|
35
87
|
class OvokRateLimitError extends OvokError {
|
|
36
88
|
}
|
|
37
89
|
exports.OvokRateLimitError = OvokRateLimitError;
|
|
90
|
+
/**
|
|
91
|
+
* The server failed (5xx).
|
|
92
|
+
*
|
|
93
|
+
* @category Errors
|
|
94
|
+
*/
|
|
38
95
|
class OvokServiceError extends OvokError {
|
|
39
96
|
}
|
|
40
97
|
exports.OvokServiceError = OvokServiceError;
|
|
98
|
+
/**
|
|
99
|
+
* The server could not be reached.
|
|
100
|
+
*
|
|
101
|
+
* @category Errors
|
|
102
|
+
*/
|
|
41
103
|
class OvokConnectionError extends OvokError {
|
|
42
104
|
}
|
|
43
105
|
exports.OvokConnectionError = OvokConnectionError;
|
|
106
|
+
/**
|
|
107
|
+
* The client is misconfigured.
|
|
108
|
+
*
|
|
109
|
+
* @category Errors
|
|
110
|
+
*/
|
|
44
111
|
class OvokConfigError extends OvokError {
|
|
45
112
|
}
|
|
46
113
|
exports.OvokConfigError = OvokConfigError;
|
|
@@ -2,6 +2,11 @@ import { Credentials } from "../auth/credentials";
|
|
|
2
2
|
import { OvokSettings } from "../config/ovok-config";
|
|
3
3
|
import { RetryPolicy } from "./retry-policy";
|
|
4
4
|
import { RequestOptions } from "./transmit";
|
|
5
|
+
/**
|
|
6
|
+
* HTTP methods the client sends.
|
|
7
|
+
*
|
|
8
|
+
* @category Ovok client
|
|
9
|
+
*/
|
|
5
10
|
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
6
11
|
export type HttpRequest = {
|
|
7
12
|
method: HttpMethod;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { OvokSettings } from "../config/ovok-config";
|
|
2
|
+
/**
|
|
3
|
+
* Per-request options.
|
|
4
|
+
*
|
|
5
|
+
* @category Ovok client
|
|
6
|
+
*/
|
|
2
7
|
export type RequestOptions = {
|
|
8
|
+
/** Aborts the request when signalled. */
|
|
3
9
|
signal?: AbortSignal;
|
|
10
|
+
/** Timeout in milliseconds; overrides the client's default. */
|
|
4
11
|
timeoutMs?: number;
|
|
5
12
|
};
|
|
6
13
|
export type TransmitRequest = {
|
package/dist/next/http/url.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A query parameter value; an array repeats the parameter, and undefined omits it.
|
|
3
|
+
*
|
|
4
|
+
* @category Ovok client
|
|
5
|
+
*/
|
|
1
6
|
export type QueryValue = string | number | boolean | readonly string[] | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Query parameters by name.
|
|
9
|
+
*
|
|
10
|
+
* @category Ovok client
|
|
11
|
+
*/
|
|
2
12
|
export type QueryParams = Record<string, QueryValue>;
|
|
3
13
|
export declare const joinPath: (...parts: string[]) => string;
|
|
4
14
|
export declare const pathSegment: (value: string) => string;
|
package/dist/next/ovok.d.ts
CHANGED
|
@@ -24,33 +24,63 @@ import { SignalsResource } from "./resources/signals/signals-resource";
|
|
|
24
24
|
import { SlimResource } from "./resources/slim/slim-resource";
|
|
25
25
|
import { VideoCallsResource } from "./resources/video-calls/video-calls-resource";
|
|
26
26
|
import { WearablesResource } from "./resources/wearables/wearables-resource";
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* One client per tenant; each namespace mirrors an area of the Ovok API.
|
|
29
|
+
*
|
|
30
|
+
* @category Ovok client
|
|
31
|
+
*/
|
|
28
32
|
export declare class Ovok {
|
|
33
|
+
/** Sign-in, registration and password routes. */
|
|
29
34
|
readonly auth: AuthResource;
|
|
35
|
+
/** The current user session. */
|
|
30
36
|
readonly session: SessionResource;
|
|
37
|
+
/** FHIR resource operations. */
|
|
31
38
|
readonly fhir: FhirResource;
|
|
39
|
+
/** Server health check. */
|
|
32
40
|
readonly health: HealthResource;
|
|
41
|
+
/** The signed-in patient's data. */
|
|
33
42
|
readonly patient: PatientResource;
|
|
43
|
+
/** Saving and reading measurements. */
|
|
34
44
|
readonly measurements: MeasurementsResource;
|
|
45
|
+
/** Questionnaires. */
|
|
35
46
|
readonly questionnaires: QuestionnairesResource;
|
|
47
|
+
/** Questionnaire responses. */
|
|
36
48
|
readonly questionnaireResponses: QuestionnaireResponsesResource;
|
|
49
|
+
/** Real-time subscriptions. */
|
|
37
50
|
readonly realtime: RealtimeResource;
|
|
51
|
+
/** Consent of the signed-in user. */
|
|
38
52
|
readonly consent: ConsentResource;
|
|
53
|
+
/** Invites to share records or join care. */
|
|
39
54
|
readonly invites: InvitesResource;
|
|
55
|
+
/** Patient sharing. */
|
|
40
56
|
readonly sharing: SharingResource;
|
|
57
|
+
/** Signals data. */
|
|
41
58
|
readonly signals: SignalsResource;
|
|
59
|
+
/** Slim API routes. */
|
|
42
60
|
readonly slim: SlimResource;
|
|
61
|
+
/** Project administration. */
|
|
43
62
|
readonly projects: ProjectsResource;
|
|
63
|
+
/** Accounts of the signed-in user. */
|
|
44
64
|
readonly accounts: AccountsResource;
|
|
65
|
+
/** Project languages. */
|
|
45
66
|
readonly locales: LocalesResource;
|
|
67
|
+
/** Translations. */
|
|
46
68
|
readonly localizations: LocalizationsResource;
|
|
69
|
+
/** Content management. */
|
|
47
70
|
readonly cms: CmsResource;
|
|
71
|
+
/** Project content. */
|
|
48
72
|
readonly content: ContentResource;
|
|
73
|
+
/** Documents. */
|
|
49
74
|
readonly documents: DocumentsResource;
|
|
75
|
+
/** Video calls. */
|
|
50
76
|
readonly videoCalls: VideoCallsResource;
|
|
77
|
+
/** AI sessions. */
|
|
51
78
|
readonly ai: AiResource;
|
|
79
|
+
/** Wearable connections. */
|
|
52
80
|
readonly wearables: WearablesResource;
|
|
81
|
+
/** Email templates. */
|
|
53
82
|
readonly email: EmailResource;
|
|
83
|
+
/** Bot execution. */
|
|
54
84
|
readonly bots: BotsResource;
|
|
55
85
|
constructor(config: OvokConfig);
|
|
56
86
|
}
|
package/dist/next/ovok.js
CHANGED
|
@@ -35,7 +35,11 @@ const signals_resource_1 = require("./resources/signals/signals-resource");
|
|
|
35
35
|
const slim_resource_1 = require("./resources/slim/slim-resource");
|
|
36
36
|
const video_calls_resource_1 = require("./resources/video-calls/video-calls-resource");
|
|
37
37
|
const wearables_resource_1 = require("./resources/wearables/wearables-resource");
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* One client per tenant; each namespace mirrors an area of the Ovok API.
|
|
40
|
+
*
|
|
41
|
+
* @category Ovok client
|
|
42
|
+
*/
|
|
39
43
|
class Ovok {
|
|
40
44
|
constructor(config) {
|
|
41
45
|
var _a, _b;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One page of a list result.
|
|
3
|
+
*
|
|
4
|
+
* @category Ovok client
|
|
5
|
+
*/
|
|
1
6
|
export type Page<T> = {
|
|
7
|
+
/** Items on this page. */
|
|
2
8
|
data: T[];
|
|
9
|
+
/** `true` when another page follows. */
|
|
3
10
|
hasMore: boolean;
|
|
11
|
+
/** Total number of items, or `null` when the server does not report it. */
|
|
4
12
|
total: number | null;
|
|
5
13
|
};
|
|
6
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Await it for the first page, or `for await` over it to walk every page.
|
|
16
|
+
*
|
|
17
|
+
* @category Ovok client
|
|
18
|
+
*/
|
|
7
19
|
export type PagePromise<T> = Promise<Page<T>> & AsyncIterable<T>;
|
|
8
20
|
export type LoadedPage<T> = {
|
|
9
21
|
page: Page<T>;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { Ovok } from "../ovok";
|
|
3
3
|
export declare const OvokContext: React.Context<Ovok | null>;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the Ovok client from the nearest `OvokProvider`.
|
|
6
|
+
*
|
|
7
|
+
* @throws Error when used outside an `OvokProvider`.
|
|
8
|
+
*
|
|
9
|
+
* @category React
|
|
10
|
+
*/
|
|
4
11
|
export declare const useOvok: () => Ovok;
|
|
@@ -36,6 +36,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.useOvok = exports.OvokContext = void 0;
|
|
37
37
|
const React = __importStar(require("react"));
|
|
38
38
|
exports.OvokContext = React.createContext(null);
|
|
39
|
+
/**
|
|
40
|
+
* Returns the Ovok client from the nearest `OvokProvider`.
|
|
41
|
+
*
|
|
42
|
+
* @throws Error when used outside an `OvokProvider`.
|
|
43
|
+
*
|
|
44
|
+
* @category React
|
|
45
|
+
*/
|
|
39
46
|
const useOvok = () => {
|
|
40
47
|
const client = React.useContext(exports.OvokContext);
|
|
41
48
|
if (client === null) {
|