@ovok/core 0.4.49-dev.503 → 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.
Files changed (394) hide show
  1. package/README.md +23 -666
  2. package/dist/client/ai-fhir/methods/AIFhirResources.d.ts +3 -1
  3. package/dist/client/ai-fhir/methods/AIFhirResources.js +3 -1
  4. package/dist/client/ai-fhir/types/AIFhirPlan.d.ts +8 -0
  5. package/dist/client/ai-fhir/types/AIFhirPlanRequest.d.ts +8 -0
  6. package/dist/client/ai-fhir/types/AIFhirRequest.d.ts +5 -0
  7. package/dist/client/ai-fhir/types/AIFhirResponse.d.ts +6 -0
  8. package/dist/client/auth/errors.d.ts +15 -2
  9. package/dist/client/auth/errors.js +12 -2
  10. package/dist/client/auth/methods/appleLogin.d.ts +1 -0
  11. package/dist/client/auth/methods/appleLogin.js +1 -0
  12. package/dist/client/auth/methods/changePassword.d.ts +1 -0
  13. package/dist/client/auth/methods/changePassword.js +1 -0
  14. package/dist/client/auth/methods/googleLogin.d.ts +1 -0
  15. package/dist/client/auth/methods/googleLogin.js +1 -0
  16. package/dist/client/auth/methods/login.d.ts +6 -0
  17. package/dist/client/auth/methods/login.js +6 -0
  18. package/dist/client/auth/methods/register.d.ts +5 -0
  19. package/dist/client/auth/methods/register.js +5 -0
  20. package/dist/client/auth/methods/registerPractitioner.d.ts +5 -0
  21. package/dist/client/auth/methods/registerPractitioner.js +5 -0
  22. package/dist/client/auth/methods/reloadSession.d.ts +3 -0
  23. package/dist/client/auth/methods/requestDeleteUser.d.ts +4 -5
  24. package/dist/client/auth/methods/requestDeleteUser.js +4 -5
  25. package/dist/client/auth/methods/setPasswordFromReset.d.ts +1 -0
  26. package/dist/client/auth/methods/setPasswordFromReset.js +1 -0
  27. package/dist/client/auth/session-fetch.d.ts +11 -0
  28. package/dist/client/auth/types/Account.d.ts +8 -1
  29. package/dist/client/auth/types/AppleLoginBody.d.ts +16 -0
  30. package/dist/client/auth/types/AppleLoginBody.js +5 -0
  31. package/dist/client/auth/types/AuthResponse.d.ts +12 -0
  32. package/dist/client/auth/types/ChangePasswordBody.d.ts +7 -0
  33. package/dist/client/auth/types/ChangePasswordResponse.d.ts +5 -0
  34. package/dist/client/auth/types/CompletePasswordResetBody.d.ts +8 -0
  35. package/dist/client/auth/types/GoogleLoginBody.d.ts +5 -0
  36. package/dist/client/auth/types/LoginBody.d.ts +15 -1
  37. package/dist/client/auth/types/LoginError.d.ts +21 -2
  38. package/dist/client/auth/types/LoginError.js +8 -2
  39. package/dist/client/auth/types/LoginResponse.d.ts +8 -1
  40. package/dist/client/auth/types/RegisterBody.d.ts +12 -0
  41. package/dist/client/auth/types/RegisterPractitionerBody.d.ts +5 -0
  42. package/dist/client/auth/types/RegisterResponse.d.ts +7 -0
  43. package/dist/client/auth/types/RequestDeleteUserBody.d.ts +7 -7
  44. package/dist/client/auth/types/RequestDeleteUserResponse.d.ts +14 -0
  45. package/dist/client/auth/types/ResetPasswordBody.d.ts +5 -0
  46. package/dist/client/auth/types/Session.d.ts +14 -2
  47. package/dist/client/change-history/methods.d.ts +6 -0
  48. package/dist/client/change-history/methods.js +6 -0
  49. package/dist/client/change-history/types.d.ts +82 -0
  50. package/dist/client/chat/ai/methods/createAiSession.d.ts +6 -0
  51. package/dist/client/chat/ai/methods/createAiSession.js +6 -0
  52. package/dist/client/chat/ai/types/CreateAiSessionResponse.d.ts +17 -0
  53. package/dist/client/chat/ai/types/SessionMessagesResponse.d.ts +9 -0
  54. package/dist/client/cms/locale.d.ts +12 -2
  55. package/dist/client/cms/locale.js +9 -2
  56. package/dist/client/cms/methods.d.ts +6 -2
  57. package/dist/client/cms/methods.js +7 -3
  58. package/dist/client/cms/types.d.ts +44 -4
  59. package/dist/client/consent/methods.d.ts +16 -0
  60. package/dist/client/consent/methods.js +16 -0
  61. package/dist/client/consent/types.d.ts +53 -1
  62. package/dist/client/consent/types.js +10 -1
  63. package/dist/client/email/methods.d.ts +3 -0
  64. package/dist/client/email/methods.js +3 -0
  65. package/dist/client/email/types.d.ts +33 -0
  66. package/dist/client/errors/field-errors.d.ts +3 -0
  67. package/dist/client/errors/field-errors.js +3 -0
  68. package/dist/client/errors/ovok-error-utils.d.ts +6 -0
  69. package/dist/client/errors/ovok-error-utils.js +6 -0
  70. package/dist/client/errors/ovok-error.d.ts +36 -4
  71. package/dist/client/errors/ovok-error.js +15 -4
  72. package/dist/client/errors/rate-limit-error.d.ts +11 -2
  73. package/dist/client/errors/rate-limit-error.js +10 -2
  74. package/dist/client/errors/sign-in-required-error.d.ts +5 -2
  75. package/dist/client/errors/sign-in-required-error.js +5 -2
  76. package/dist/client/experience/methods.d.ts +38 -0
  77. package/dist/client/experience/methods.js +35 -0
  78. package/dist/client/experience/types.d.ts +316 -0
  79. package/dist/client/experience/types.js +1 -0
  80. package/dist/client/invites/methods.d.ts +27 -9
  81. package/dist/client/invites/methods.js +27 -9
  82. package/dist/client/invites/parse-accept-invite-link.d.ts +3 -1
  83. package/dist/client/invites/parse-accept-invite-link.js +3 -1
  84. package/dist/client/invites/types.d.ts +55 -0
  85. package/dist/client/invites/types.js +12 -0
  86. package/dist/client/notifications/methods.d.ts +15 -0
  87. package/dist/client/notifications/methods.js +15 -0
  88. package/dist/client/notifications/types.d.ts +249 -2
  89. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.d.ts +3 -0
  90. package/dist/client/observation/methods/generateObservationBodiesByMeasurement.js +3 -0
  91. package/dist/client/observation/methods/getLatestObservationsByCodes.d.ts +3 -0
  92. package/dist/client/observation/methods/getLatestObservationsByCodes.js +3 -0
  93. package/dist/client/observation/methods/observationsToMeasurements.d.ts +23 -1
  94. package/dist/client/observation/methods/observationsToMeasurements.js +8 -1
  95. package/dist/client/observation/methods/saveMeasurement.d.ts +3 -1
  96. package/dist/client/observation/methods/saveMeasurement.js +3 -1
  97. package/dist/client/observation/observation-bundle-utils.d.ts +6 -0
  98. package/dist/client/observation/observation-bundle-utils.js +6 -0
  99. package/dist/client/observation/series.d.ts +25 -3
  100. package/dist/client/observation/series.js +6 -2
  101. package/dist/client/observation/services/creator.d.ts +5 -0
  102. package/dist/client/observation/services/creator.js +5 -0
  103. package/dist/client/observation/services/uric-acid-service.js +0 -1
  104. package/dist/client/observation/types/GetLatestObservationsByCodeParams.d.ts +10 -0
  105. package/dist/client/observation/types/MeasurementTypeKey.d.ts +26 -0
  106. package/dist/client/observation/types/MeasurementTypeKey.js +26 -0
  107. package/dist/client/observation/types/ObservationCode.d.ts +64 -1
  108. package/dist/client/observation/types/ObservationCode.js +64 -1
  109. package/dist/client/observation/types/UrineAnalytes.d.ts +14 -0
  110. package/dist/client/observation/types/UrineAnalytes.js +1 -0
  111. package/dist/client/observation/types/generate-measurement/Sample.d.ts +33 -0
  112. package/dist/client/observation/types/generate-observation-body/GenerateObservationBodyParams.d.ts +9 -0
  113. package/dist/client/observation/types/measurement/BabySleepMeasurement.d.ts +3 -0
  114. package/dist/client/observation/types/measurement/BloodGlucoseMeasurement.d.ts +7 -0
  115. package/dist/client/observation/types/measurement/BloodPressureMeasurement.d.ts +10 -0
  116. package/dist/client/observation/types/measurement/BloodPressureStates.d.ts +10 -0
  117. package/dist/client/observation/types/measurement/BloodPressureStates.js +10 -0
  118. package/dist/client/observation/types/measurement/BodyTemperatureMeasurement.d.ts +7 -0
  119. package/dist/client/observation/types/measurement/BodyWeightMeasurmement.d.ts +8 -0
  120. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.d.ts +18 -0
  121. package/dist/client/observation/types/measurement/EcgDiagnosticFlag.js +18 -0
  122. package/dist/client/observation/types/measurement/EcgMeasurement.d.ts +9 -0
  123. package/dist/client/observation/types/measurement/HeartRateMeasurement.d.ts +7 -0
  124. package/dist/client/observation/types/measurement/HeartRateVariabilityMeasurement.d.ts +7 -0
  125. package/dist/client/observation/types/measurement/LipidPanelMeasurement.d.ts +12 -0
  126. package/dist/client/observation/types/measurement/Measurement.d.ts +9 -0
  127. package/dist/client/observation/types/measurement/MeasurementDevice.d.ts +10 -0
  128. package/dist/client/observation/types/measurement/MeasurementSeries.d.ts +2 -0
  129. package/dist/client/observation/types/measurement/PulseOximeterMeasurement.d.ts +10 -0
  130. package/dist/client/observation/types/measurement/RespiratoryRateMeasurement.d.ts +7 -0
  131. package/dist/client/observation/types/measurement/RespiratoryTherapyMeasurement.d.ts +3 -0
  132. package/dist/client/observation/types/measurement/RestingHeartRateMeasurement.d.ts +7 -0
  133. package/dist/client/observation/types/measurement/SpirometryMeasurement.d.ts +23 -0
  134. package/dist/client/observation/types/measurement/StepCountMeasurement.d.ts +9 -0
  135. package/dist/client/observation/types/measurement/UrineAnalyzeMeasurement.d.ts +29 -0
  136. package/dist/client/observation/types/measurement/Vo2MaxMeasurement.d.ts +7 -0
  137. package/dist/client/observation/types/measurement/WalkingHeartRateAverageMeasurement.d.ts +7 -0
  138. package/dist/client/observation/types/service/MeasurementField.d.ts +5 -1
  139. package/dist/client/observation/utils/getObservationValueDisplay.d.ts +2 -0
  140. package/dist/client/offline/offline-measurement-queue.d.ts +56 -1
  141. package/dist/client/offline/offline-measurement-queue.js +21 -0
  142. package/dist/client/offline/shared-measurement-queue.d.ts +16 -1
  143. package/dist/client/offline/shared-measurement-queue.js +3 -1
  144. package/dist/client/ovok-client.d.ts +27 -6
  145. package/dist/client/ovok-client.js +8 -5
  146. package/dist/client/patient/methods.d.ts +21 -0
  147. package/dist/client/patient/methods.js +21 -0
  148. package/dist/client/patient/types.d.ts +131 -0
  149. package/dist/client/patient-sharing/methods.d.ts +18 -0
  150. package/dist/client/patient-sharing/methods.js +18 -0
  151. package/dist/client/patient-sharing/types.d.ts +89 -1
  152. package/dist/client/platform/methods.d.ts +22 -0
  153. package/dist/client/platform/methods.js +20 -0
  154. package/dist/client/platform/types.d.ts +194 -1
  155. package/dist/client/platform/types.js +24 -0
  156. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.d.ts +3 -0
  157. package/dist/client/questionnaire-response/methods/createQuestionnaireResponseWithObservations.js +3 -0
  158. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.d.ts +3 -0
  159. package/dist/client/questionnaire-response/methods/extractQuestionnaireObservations.js +3 -0
  160. package/dist/client/questionnaire-response/methods/populateQuestionnaire.d.ts +3 -0
  161. package/dist/client/questionnaire-response/methods/populateQuestionnaire.js +3 -0
  162. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.d.ts +3 -0
  163. package/dist/client/questionnaire-response/methods/submitQuestionnaireResponse.js +3 -0
  164. package/dist/client/questionnaire-response/types.d.ts +6 -0
  165. package/dist/client/signals/errors.d.ts +13 -2
  166. package/dist/client/signals/errors.js +9 -2
  167. package/dist/client/signals/methods.d.ts +9 -0
  168. package/dist/client/signals/methods.js +9 -0
  169. package/dist/client/signals/types.d.ts +31 -0
  170. package/dist/client/slim/methods.d.ts +268 -21
  171. package/dist/client/slim/methods.js +264 -21
  172. package/dist/client/slim/paging.d.ts +22 -2
  173. package/dist/client/slim/paging.js +6 -2
  174. package/dist/client/slim/types.d.ts +920 -1
  175. package/dist/client/storage.d.ts +15 -1
  176. package/dist/client/storage.js +7 -1
  177. package/dist/client/wearables/methods.d.ts +24 -0
  178. package/dist/client/wearables/methods.js +24 -0
  179. package/dist/client/wearables/types.d.ts +74 -0
  180. package/dist/conformance/api-requirements.d.ts +31 -5
  181. package/dist/conformance/api-requirements.js +47 -10
  182. package/dist/conformance/capability-requirements.d.ts +4 -26
  183. package/dist/conformance/capability-requirements.js +5 -27
  184. package/dist/conformance/capability.d.ts +9 -1
  185. package/dist/conformance/capability.js +3 -1
  186. package/dist/hooks/account-hooks.d.ts +35 -0
  187. package/dist/hooks/account-hooks.js +33 -0
  188. package/dist/hooks/api-hooks.d.ts +74 -4
  189. package/dist/hooks/api-hooks.js +56 -4
  190. package/dist/hooks/cms-hooks.d.ts +9 -3
  191. package/dist/hooks/cms-hooks.js +9 -3
  192. package/dist/hooks/email-hooks.d.ts +3 -0
  193. package/dist/hooks/email-hooks.js +3 -0
  194. package/dist/hooks/experience-hooks.d.ts +26 -0
  195. package/dist/hooks/experience-hooks.js +24 -0
  196. package/dist/hooks/index.d.ts +18 -0
  197. package/dist/hooks/index.js +18 -0
  198. package/dist/hooks/invites-hooks.d.ts +21 -2
  199. package/dist/hooks/invites-hooks.js +21 -2
  200. package/dist/hooks/notification-ack-hooks.d.ts +6 -2
  201. package/dist/hooks/notification-ack-hooks.js +6 -2
  202. package/dist/hooks/notification-hooks.d.ts +27 -3
  203. package/dist/hooks/notification-hooks.js +27 -3
  204. package/dist/hooks/notification-note-hooks.d.ts +41 -0
  205. package/dist/hooks/notification-note-hooks.js +33 -0
  206. package/dist/hooks/observation-hooks.d.ts +29 -0
  207. package/dist/hooks/observation-hooks.js +23 -1
  208. package/dist/hooks/patient-hooks.d.ts +53 -0
  209. package/dist/hooks/patient-hooks.js +48 -0
  210. package/dist/hooks/patient-sharing-hooks.d.ts +18 -0
  211. package/dist/hooks/patient-sharing-hooks.js +18 -0
  212. package/dist/hooks/platform-hooks.d.ts +32 -0
  213. package/dist/hooks/platform-hooks.js +23 -0
  214. package/dist/hooks/poll-hooks.d.ts +17 -1
  215. package/dist/hooks/poll-hooks.js +3 -1
  216. package/dist/hooks/signals-hooks.d.ts +3 -0
  217. package/dist/hooks/signals-hooks.js +3 -0
  218. package/dist/hooks/wearables-hooks.d.ts +23 -0
  219. package/dist/hooks/wearables-hooks.js +21 -0
  220. package/dist/index.d.ts +1 -965
  221. package/dist/index.js +1 -71
  222. package/dist/next/auth/saved-accounts-store.d.ts +10 -0
  223. package/dist/next/auth/session.d.ts +17 -0
  224. package/dist/next/auth/user-session.d.ts +5 -0
  225. package/dist/next/config/ovok-config.d.ts +45 -0
  226. package/dist/next/errors/ovok-account-error.d.ts +14 -1
  227. package/dist/next/errors/ovok-account-error.js +8 -1
  228. package/dist/next/errors/ovok-errors.d.ts +88 -0
  229. package/dist/next/errors/ovok-errors.js +67 -0
  230. package/dist/next/http/http-client.d.ts +5 -0
  231. package/dist/next/http/transmit.d.ts +7 -0
  232. package/dist/next/http/url.d.ts +10 -0
  233. package/dist/next/ovok.d.ts +31 -1
  234. package/dist/next/ovok.js +5 -1
  235. package/dist/next/paging/page.d.ts +13 -1
  236. package/dist/next/react/context.d.ts +7 -0
  237. package/dist/next/react/context.js +7 -0
  238. package/dist/next/react/index.d.ts +24 -0
  239. package/dist/next/react/index.js +18 -0
  240. package/dist/next/react/query-hooks.d.ts +69 -0
  241. package/dist/next/react/query-hooks.js +31 -0
  242. package/dist/next/resources/accounts/accounts-resource.d.ts +6 -0
  243. package/dist/next/resources/accounts/accounts-resource.js +6 -0
  244. package/dist/next/resources/ai/ai-chat-resource.d.ts +7 -0
  245. package/dist/next/resources/ai/ai-chat-resource.js +5 -0
  246. package/dist/next/resources/ai/ai-resource.d.ts +13 -0
  247. package/dist/next/resources/ai/ai-resource.js +6 -0
  248. package/dist/next/resources/ai/chat-messages-resource.d.ts +7 -0
  249. package/dist/next/resources/ai/chat-messages-resource.js +7 -0
  250. package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
  251. package/dist/next/resources/ai/chat-sessions-resource.js +8 -0
  252. package/dist/next/resources/auth/auth-sessions-resource.d.ts +6 -1
  253. package/dist/next/resources/auth/auth-sessions-resource.js +6 -1
  254. package/dist/next/resources/auth/registration.d.ts +18 -1
  255. package/dist/next/resources/auth/social-login.d.ts +12 -0
  256. package/dist/next/resources/auth-resource.d.ts +54 -1
  257. package/dist/next/resources/auth-resource.js +23 -0
  258. package/dist/next/resources/bots/bots-resource.d.ts +15 -0
  259. package/dist/next/resources/bots/bots-resource.js +5 -0
  260. package/dist/next/resources/cms/cms-delivery.d.ts +14 -2
  261. package/dist/next/resources/cms/cms-documents-resource.d.ts +7 -1
  262. package/dist/next/resources/cms/cms-documents-resource.js +7 -1
  263. package/dist/next/resources/cms/cms-resource.d.ts +7 -0
  264. package/dist/next/resources/cms/cms-resource.js +5 -0
  265. package/dist/next/resources/cms/release-notes-resource.d.ts +6 -0
  266. package/dist/next/resources/cms/release-notes-resource.js +6 -0
  267. package/dist/next/resources/consent/consent-resource.d.ts +22 -0
  268. package/dist/next/resources/consent/consent-resource.js +20 -0
  269. package/dist/next/resources/content/content-resource.d.ts +18 -0
  270. package/dist/next/resources/content/content-resource.js +12 -0
  271. package/dist/next/resources/documents/documents-resource.d.ts +24 -0
  272. package/dist/next/resources/documents/documents-resource.js +10 -0
  273. package/dist/next/resources/email/email-resource.d.ts +6 -0
  274. package/dist/next/resources/email/email-resource.js +5 -0
  275. package/dist/next/resources/email/email-templates-resource.d.ts +6 -0
  276. package/dist/next/resources/email/email-templates-resource.js +6 -0
  277. package/dist/next/resources/fhir-resource.d.ts +36 -0
  278. package/dist/next/resources/fhir-resource.js +21 -0
  279. package/dist/next/resources/health-resource.d.ts +16 -0
  280. package/dist/next/resources/health-resource.js +5 -0
  281. package/dist/next/resources/invites/invite-flow-resource.d.ts +7 -1
  282. package/dist/next/resources/invites/invite-flow-resource.js +7 -1
  283. package/dist/next/resources/invites/invites-resource.d.ts +15 -0
  284. package/dist/next/resources/invites/invites-resource.js +5 -0
  285. package/dist/next/resources/localization/i18next-resource.d.ts +6 -0
  286. package/dist/next/resources/localization/i18next-resource.js +6 -0
  287. package/dist/next/resources/localization/locales-resource.d.ts +7 -0
  288. package/dist/next/resources/localization/locales-resource.js +7 -0
  289. package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
  290. package/dist/next/resources/localization/localizations-resource.js +9 -0
  291. package/dist/next/resources/measurements/measurements-resource.d.ts +53 -1
  292. package/dist/next/resources/measurements/measurements-resource.js +14 -0
  293. package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
  294. package/dist/next/resources/measurements/offline-measurement-queue-types.d.ts +32 -0
  295. package/dist/next/resources/patient/fhir-records.d.ts +19 -1
  296. package/dist/next/resources/patient/fhir-records.js +19 -1
  297. package/dist/next/resources/patient/patient-resource.d.ts +15 -0
  298. package/dist/next/resources/patient/patient-resource.js +6 -0
  299. package/dist/next/resources/projects/project-features-resource.d.ts +7 -0
  300. package/dist/next/resources/projects/project-features-resource.js +7 -0
  301. package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
  302. package/dist/next/resources/projects/project-members-resource.js +9 -0
  303. package/dist/next/resources/projects/project-settings-resource.d.ts +8 -0
  304. package/dist/next/resources/projects/project-settings-resource.js +8 -0
  305. package/dist/next/resources/projects/projects-resource.d.ts +15 -0
  306. package/dist/next/resources/projects/projects-resource.js +5 -0
  307. package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +13 -0
  308. package/dist/next/resources/questionnaires/questionnaires-resource.js +13 -0
  309. package/dist/next/resources/realtime/realtime-resource.d.ts +11 -0
  310. package/dist/next/resources/realtime/realtime-resource.js +11 -0
  311. package/dist/next/resources/realtime/realtime-types.d.ts +16 -0
  312. package/dist/next/resources/session/saved-accounts-resource.d.ts +16 -0
  313. package/dist/next/resources/session/saved-accounts-resource.js +16 -0
  314. package/dist/next/resources/session/session-resource.d.ts +8 -0
  315. package/dist/next/resources/session/session-resource.js +7 -0
  316. package/dist/next/resources/sharing/sharing-invites-resource.d.ts +7 -0
  317. package/dist/next/resources/sharing/sharing-invites-resource.js +7 -0
  318. package/dist/next/resources/sharing/sharing-resource.d.ts +8 -0
  319. package/dist/next/resources/sharing/sharing-resource.js +5 -0
  320. package/dist/next/resources/sharing/sharing-settings-resource.d.ts +7 -0
  321. package/dist/next/resources/sharing/sharing-settings-resource.js +7 -0
  322. package/dist/next/resources/sharing/sharing-shares-resource.d.ts +7 -0
  323. package/dist/next/resources/sharing/sharing-shares-resource.js +7 -0
  324. package/dist/next/resources/signals/signals-gateway-resource.d.ts +15 -0
  325. package/dist/next/resources/signals/signals-gateway-resource.js +6 -0
  326. package/dist/next/resources/signals/signals-resource.d.ts +7 -0
  327. package/dist/next/resources/signals/signals-resource.js +5 -0
  328. package/dist/next/resources/signals/undeliverable-resource.d.ts +35 -0
  329. package/dist/next/resources/signals/undeliverable-resource.js +6 -0
  330. package/dist/next/resources/slim/slim-alarms-resource.d.ts +7 -0
  331. package/dist/next/resources/slim/slim-alarms-resource.js +7 -0
  332. package/dist/next/resources/slim/slim-change-history-resource.d.ts +6 -0
  333. package/dist/next/resources/slim/slim-change-history-resource.js +6 -0
  334. package/dist/next/resources/slim/slim-child-projects-resource.d.ts +21 -0
  335. package/dist/next/resources/slim/slim-child-projects-resource.js +8 -0
  336. package/dist/next/resources/slim/slim-devices-resource.d.ts +31 -0
  337. package/dist/next/resources/slim/slim-devices-resource.js +16 -0
  338. package/dist/next/resources/slim/slim-exports-resource.d.ts +6 -0
  339. package/dist/next/resources/slim/slim-exports-resource.js +6 -0
  340. package/dist/next/resources/slim/slim-locations-resource.d.ts +9 -0
  341. package/dist/next/resources/slim/slim-locations-resource.js +9 -0
  342. package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +6 -0
  343. package/dist/next/resources/slim/slim-medical-notifications-resource.js +6 -0
  344. package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +10 -0
  345. package/dist/next/resources/slim/slim-notification-notes-resource.js +10 -0
  346. package/dist/next/resources/slim/slim-notifications-resource.d.ts +10 -0
  347. package/dist/next/resources/slim/slim-notifications-resource.js +6 -0
  348. package/dist/next/resources/slim/slim-organizations-resource.d.ts +9 -0
  349. package/dist/next/resources/slim/slim-organizations-resource.js +9 -0
  350. package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +12 -0
  351. package/dist/next/resources/slim/slim-out-of-bed-resource.js +7 -0
  352. package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +6 -0
  353. package/dist/next/resources/slim/slim-patient-thresholds-resource.js +6 -0
  354. package/dist/next/resources/slim/slim-patients-resource.d.ts +11 -0
  355. package/dist/next/resources/slim/slim-patients-resource.js +10 -0
  356. package/dist/next/resources/slim/slim-policies-resource.d.ts +10 -0
  357. package/dist/next/resources/slim/slim-policies-resource.js +10 -0
  358. package/dist/next/resources/slim/slim-practitioners-resource.d.ts +6 -0
  359. package/dist/next/resources/slim/slim-practitioners-resource.js +6 -0
  360. package/dist/next/resources/slim/slim-projects-resource.d.ts +12 -0
  361. package/dist/next/resources/slim/slim-projects-resource.js +11 -0
  362. package/dist/next/resources/slim/slim-queries.d.ts +51 -0
  363. package/dist/next/resources/slim/slim-resource.d.ts +21 -0
  364. package/dist/next/resources/slim/slim-resource.js +6 -0
  365. package/dist/next/resources/slim/slim-sleep-resource.d.ts +6 -0
  366. package/dist/next/resources/slim/slim-sleep-resource.js +6 -0
  367. package/dist/next/resources/slim/slim-thresholds-resource.d.ts +5 -0
  368. package/dist/next/resources/slim/slim-thresholds-resource.js +5 -0
  369. package/dist/next/resources/slim/slim-trends-resource.d.ts +6 -0
  370. package/dist/next/resources/slim/slim-trends-resource.js +6 -0
  371. package/dist/next/resources/slim/slim-users-resource.d.ts +12 -0
  372. package/dist/next/resources/slim/slim-users-resource.js +6 -0
  373. package/dist/next/resources/slim/slim-zones-resource.d.ts +8 -0
  374. package/dist/next/resources/slim/slim-zones-resource.js +8 -0
  375. package/dist/next/resources/video-calls/video-call-access-resource.d.ts +13 -0
  376. package/dist/next/resources/video-calls/video-call-access-resource.js +8 -0
  377. package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +8 -0
  378. package/dist/next/resources/video-calls/video-call-appointments-resource.js +8 -0
  379. package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +8 -0
  380. package/dist/next/resources/video-calls/video-call-emails-resource.js +8 -0
  381. package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
  382. package/dist/next/resources/video-calls/video-calls-resource.js +6 -0
  383. package/dist/next/resources/wearables/wearable-connections-resource.d.ts +8 -0
  384. package/dist/next/resources/wearables/wearable-connections-resource.js +8 -0
  385. package/dist/next/resources/wearables/wearable-providers-resource.d.ts +10 -0
  386. package/dist/next/resources/wearables/wearable-providers-resource.js +10 -0
  387. package/dist/next/resources/wearables/wearables-resource.d.ts +7 -0
  388. package/dist/next/resources/wearables/wearables-resource.js +5 -0
  389. package/dist/next/storage/ovok-storage.d.ts +16 -0
  390. package/dist/next/storage/ovok-storage.js +8 -0
  391. package/dist/types/ValidationError.d.ts +9 -0
  392. package/dist/utils/patch/getPatchOperationType.d.ts +3 -0
  393. package/dist/utils/patch/getPatchOperationType.js +3 -0
  394. package/package.json +51 -12
package/README.md CHANGED
@@ -1,699 +1,56 @@
1
1
  # Ovok Core
2
2
 
3
- [![npm version](https://badge.fury.io/js/@ovok%2Fcore.svg)](https://badge.fury.io/js/@ovok%2Fcore)
3
+ [![npm version](https://badge.fury.io/js/@ovok%2Fcore.svg)](https://badge.fury.io/js/@ovok/core)
4
4
  [![Documentation](https://img.shields.io/badge/docs-sdk.ovok.com-blue)](https://sdk.ovok.com/)
5
5
 
6
- Core TypeScript SDK for healthcare applications. Provides authentication, AI-FHIR integration, observations, and healthcare data management.
6
+ The TypeScript client for Ovok APIs. The package root exports the `Ovok` client and its resource namespaces.
7
7
 
8
- ## Features
9
-
10
- - 🔐 Authentication & user management
11
- - 🤖 AI-FHIR resources and planning
12
- - 📊 Healthcare observations and measurements
13
- - 💬 Chat AI integration
14
- - 🤖 Bot execution framework
15
- - 📋 Questionnaire responses
16
- - 📥 Opt-in durable offline measurement queue with idempotent retries
17
- - 🧭 Runtime discovery of the backend FHIR and public API capabilities
18
- - 🧩 Typed accounts, projects, localization, and patient-observation APIs
19
- - 🏥 Typed Slim patient, device, telemetry, notification, and monitoring APIs
20
- - 🚨 Typed Signals enrollment and delivery-repair APIs
21
- - ⌚ Typed cloud wearable-provider configuration and patient connections
22
-
23
- ## Installation
8
+ ## Install
24
9
 
25
10
  ```bash
26
11
  npm install @ovok/core
27
- # or
28
- yarn add @ovok/core
29
- # or
30
- pnpm add @ovok/core
31
12
  ```
32
13
 
33
- ### Release channels
34
-
35
14
  | Channel | Branch | Install |
36
15
  | --- | --- | --- |
37
16
  | Stable | `main` | `npm install @ovok/core` |
38
17
  | Release candidate | `staging` | `npm install @ovok/core@next` |
39
18
  | Development | `development` | `npm install @ovok/core@dev` |
40
19
 
41
- Development builds are versioned `X.Y.Z-dev.<commit count>`. Their git tag and GitHub release add the commit as `+<short sha>`.
42
-
43
- ## Quick Start
44
-
45
- ```typescript
46
- import { OvokClient } from "@ovok/core";
47
-
48
- const client = new OvokClient({
49
- baseUrl: "https://api.development.ovok.com",
50
- fhirUrlPath: "/fhir/R4/",
51
- // configuration
52
- });
53
- ```
54
-
55
- `baseUrl` is the Ovok API origin. `fhirUrlPath` selects the FHIR version path
56
- used by the client; `apiUrl` is not a supported client option.
57
-
58
- ## Documentation
59
-
60
- Full documentation and examples available at **[sdk.ovok.com](https://sdk.ovok.com/)**
61
-
62
- SDK-specific guides are maintained in [`/docs`](./docs/index.mdx) and are written to complement the platform documentation at [docs.ovok.com](https://docs.ovok.com/). The Docusaurus-compatible navigation is in [`docs/sidebars.cjs`](./docs/sidebars.cjs); the package repository does not bundle a docs-site runtime.
63
-
64
- ### Publish the SDK docs into Ovok Docs
65
-
66
- The [sync workflow](./.github/workflows/sync-core-docs.yml) mirrors these pages into `Actimi/ovok-docs` under `docs/production/web-sdk` and updates its production sidebar after changes reach this repository's `main` branch. It pushes a bot commit to the docs repository's `dev` branch.
67
-
68
- The workflow requires a dedicated write-enabled deploy key for `Actimi/ovok-docs`: register its public key on that repository with write access, then save the private key in this repository's Actions secrets as `OVOK_DOCS_DEPLOY_KEY`. This key is separate from `DEPLOY_KEY`, which only authenticates this SDK repository.
69
-
70
- ## Backend capability discovery
71
-
72
- `@ovok/core` can read the capability statement composed by `../ovok-core` and expose the
73
- non-FHIR public routes published in Ovok's `ovok-public-api` extension:
74
-
75
- ```typescript
76
- const statement = await client.getCapabilityStatement();
77
- const publicEndpoints = await client.getPublicApiEndpoints();
78
- ```
79
-
80
- The exported `OVOK_CORE_REQUIREMENTS` describes the FHIR operations used by the SDK, while
81
- `OVOK_CORE_API_REQUIREMENTS` describes its ordinary HTTP dependencies. Billing is intentionally
82
- not part of this SDK contract yet.
83
-
84
- ## Platform APIs
85
-
86
- The client includes typed methods for application-level account and project flows already served
87
- by Ovok: project switching and membership, project settings and feature flags, locales and
88
- localization, and the existing patient-observation read surface.
89
-
90
- ```typescript
91
- const projects = await client.listAdministeredProjects();
92
- const settings = await client.getProjectSettings();
93
- const features = await client.getProjectFeatures();
94
- const locales = await client.getLocales();
95
- ```
96
-
97
- The `values` property contains the six project text settings: `PATIENT_APP_URL`,
98
- `PRACTITIONER_APP_URL`, `PATIENT_SIGNUP_URL`, `CLINICIAN_DASHBOARD_URL`,
99
- `DEFAULT_PRACTITIONER_ACCESS_POLICY`, and `CLINICIAN_INVITE_ACCESS_POLICY`. Unset
100
- values are `null`. Set or clear one with `updateProjectTextSetting(key, value)`;
101
- pass `null` to clear it. `useUpdateProjectTextSetting()` exposes the same operation
102
- as a mutation. The `useProjectSettings()` request hook returns the current values.
103
- Mobile clients should configure `PATIENT_APP_URL` so password-reset and invite
104
- emails can link back to the patient app. Email links for each audience use that
105
- audience's configured app URL; they do not use a mobile request's `Origin` header.
106
-
107
- Any project practitioner can read settings; only a project admin can update text
108
- values. URL values are trimmed, limited to 2048 characters, and must use HTTPS
109
- (HTTP is allowed for localhost), an allowed origin, and no credentials, query,
110
- or fragment. Empty strings are invalid; pass `null` to clear a value. Access
111
- policies must be `AccessPolicy/<id>` references in the project. The older
112
- `PATIENT_SIGNUP_URL` and `CLINICIAN_DASHBOARD_URL` settings remain available as
113
- fallbacks; `PATIENT_SIGNUP_URL` can also be a full continuation link. For an
114
- audience's base URL, Core checks its project app URL, the parent project's app
115
- URL, the older setting, the request origin for self-service email only, then
116
- the configured environment fallback. It never uses a request origin to build a
117
- link for the other audience. An older Core server may omit `values` and return
118
- 404 for the write route, so only rely on these methods after the matching Core
119
- release is deployed.
120
- The server can return `INVALID_SETTING_VALUE` (422), `APP_URL_NOT_ALLOWED`
121
- (400), or `UNKNOWN_SETTING` (400; the response lists accepted keys). A code-less
122
- 409 means settings changed and the screen should reload before retrying. A 403
123
- means the caller is not a project admin. `readOvokError(error)` reads the status,
124
- code, user-facing message, and validation field errors from an API error.
125
- `IOT_ENABLED` is not a supported project setting.
126
-
127
- The email-template catalog is available to authenticated project practitioners:
128
-
129
- ```typescript
130
- const { data: templateCatalog, loading, error, reload } = useEmailTemplates();
131
- const templates = templateCatalog?.templates;
132
- ```
133
-
134
- The equivalent client call is `client.getEmailTemplates()`, which reads
135
- `GET /v1/email/templates`. Each template includes its name, audience, parameter
136
- schema, full example, and provider syntax for SendGrid, Brevo, Resend, and SMTP.
137
- Use this catalog to explain template variables to administrators; it does not
138
- edit the project's email ConceptMap. Core validates the parameters when an email
139
- is sent. A send with invalid parameters is refused; SMTP uses strict Handlebars,
140
- Resend renders nulls as empty strings and lists as newline-delimited values.
141
- Every template also includes nullable `baseUrl`, `projectName`, and `tenantCode`
142
- params. The list can grow, so treat template names as strings. The older
143
- unversioned `/email/templates` route has a different response shape and is not
144
- used. An older server may return 404 until the matching Core release is
145
- deployed. The request requires a project practitioner (401 without a session,
146
- 403 for a non-practitioner).
147
-
148
- All methods preserve the backend HTTP verbs and return the backend response shapes. Billing is
149
- not included until Ovok publishes a supported billing contract.
150
-
151
- ## Patient application APIs
152
-
153
- Patient applications can read their authenticated profile and health data through typed methods
154
- backed by the existing `../ovok-core` routes. The profile response includes the Patient resource,
155
- project context, menu configuration, access policy, and active sessions. The resource facade also
156
- covers measurement history/detail, CarePlans, questionnaires and responses, assigned devices, and
157
- CommunicationRequest-backed notifications.
158
-
159
- ```typescript
160
- const me = await client.getCurrentPatientProfile();
161
- const dashboard = await client.getPatientDashboard({
162
- latestObservations: { code: ["8867-4", "9279-1"], max: 5 },
163
- measurementHistory: { _sort: "-date", _count: 50 },
164
- carePlans: { status: "active" },
165
- });
166
- const latest = await client.getPatientLatestObservations({
167
- patient: `Patient/${me.profile.id}`,
168
- code: ["8867-4", "9279-1"],
169
- max: 5,
170
- });
171
- const currentTelemetry = await client.getSlimDeviceTelemetry(deviceId);
172
- const measurements = await client.listPatientMeasurementHistory({
173
- patient: `Patient/${me.profile.id}`,
174
- _sort: "-date",
175
- _count: 50,
176
- });
177
- const carePlans = await client.listPatientCarePlans({
178
- patient: `Patient/${me.profile.id}`,
179
- status: "active",
180
- });
181
- const notifications = await client.listPatientNotifications({
182
- patient: `Patient/${me.profile.id}`,
183
- _sort: "-authored",
184
- });
185
- ```
186
-
187
- These helpers use bearer-authenticated `/auth/me` and `/fhir/*` contracts and are additive to the
188
- native observation and offline-measurement APIs. Live device telemetry comes from the Slim routes
189
- (`getSlimDeviceTelemetry`, `listSlimLiveTelemetry`). The returned resource lists are subject to the
190
- patient's backend AccessPolicy. Device pairing/claiming and notification acknowledgement are not
191
- invented here because `../ovok-core` does not currently expose patient-scoped contracts for them.
192
- The exported `OVOK_CORE_API_REQUIREMENTS` lists ordinary HTTP routes, while
193
- `OVOK_CORE_REQUIREMENTS` covers the FHIR operations. Billing is intentionally absent.
194
-
195
- Questionnaire applications can use the Ovok-specific patient-scoped operations and keep the
196
- response write atomic with its extracted Observations:
197
-
198
- ```typescript
199
- const populated = await client.populateQuestionnaire(questionnaireId);
200
- const saved = await client.submitQuestionnaireResponse(questionnaireResponse, observations);
201
- const extracted = await client.extractQuestionnaireObservations(questionnaireResponseId);
202
- ```
203
-
204
- Scheduling uses standard FHIR resources exposed by the backend. The SDK intentionally does not
205
- build on Ovok's deprecated `/appointment` or `/schedule` controllers:
206
-
207
- ```typescript
208
- const appointments = await client.listPatientAppointments({
209
- patient: `Patient/${patientId}`,
210
- status: "booked",
211
- });
212
- const schedules = await client.listPatientSchedules({
213
- actor: `Practitioner/${practitionerId}`,
214
- });
215
- const slots = await client.listPatientSlots({
216
- schedule: `Schedule/${scheduleId}`,
217
- status: "free",
218
- });
219
- ```
220
-
221
- ## Signals APIs
222
-
223
- The Signals client methods and hooks cover patient enrollment and delivery repair. Ovok forwards
224
- eligible observations for enabled patients; continue saving readings through the existing
225
- Observation APIs and do not submit the same readings to Signals separately.
226
-
227
- ```ts
228
- const enrollment = await client.enableSignalsForPatient(patientId);
229
- const undeliverable = await client.listUnconfirmedLimits();
230
- const repair = await client.repushUnconfirmedLimits();
231
- ```
232
-
233
- `listUnconfirmedLimits` reads `/signals/config/undeliverable`; `repushUnconfirmedLimits` posts to
234
- `/signals/config/undeliverable/repair`. The response reports attempted, repaired,
235
- still-undeliverable, skipped, and not-reached counts. React applications can use
236
- `useUnconfirmedLimits()` and `useRepushUnconfirmedLimits()` for these operations.
237
-
238
- Use `enableSignalsForPatient` to enroll an existing patient. It is idempotent, always returns
239
- `enabled: true` on success, and requires the caller to have `signals_config:update` and update
240
- access to that patient. A 409 conflict and 503 failures (including `signals_mint_failed`) are
241
- retryable; use a bounded retry with backoff and do not retry other statuses automatically. The
242
- SDK maps backend responses to `SignalsError`; read the `code`, `status`, `fieldErrors`, and
243
- `message` properties. React applications can call
244
- `useEnableSignalsForPatient().mutate(patientId)`.
245
-
246
- Use `listNotificationNotes`, `createNotificationNote`, `updateNotificationNote`,
247
- `patchNotificationNote`, and `deleteNotificationNote` for notification notes. The `alarm` target
248
- represents an alert episode, and `alert` represents an individual raw alert. These methods use the
249
- `/v1/slim/notifications` routes.
250
-
251
- ## Slim APIs
252
-
253
- Slim methods cover the verified `/v1/slim/*` and `/v2/slim/*` application routes for
254
- patients, devices, telemetry, notifications, thresholds, trends, sleep, locations, zones, and
255
- PDF export. These routes require the backend's bearer session and Slim permissions.
256
-
257
- ```typescript
258
- const residents = await client.listSlimPatients({ residentState: "active" });
259
- const devices = await client.listSlimDevices({ active: true });
260
- const telemetry = await client.getSlimDeviceTelemetry(deviceId);
261
- const alerts = await client.listSlimMedicalNotifications({ limit: 25, codes: ["8867-4"] });
262
- const alarms = await client.listSlimAlarms({ status: "active", sort: "newest" });
263
- ```
264
-
265
- Slim is intentionally represented as typed application APIs rather than changing the FHIR
266
- observation save/offline behavior used by native integrations.
267
-
268
- Use the separate `/oob`, `/alarms`, and `/medical` feeds instead of the deprecated mixed
269
- `listSlimNotifications` endpoint. The medical React hook reads every cursor page; it stops only
270
- when `nextCursor` is `null`. Feed `noteCount` is nullable: `null` means the count is unknown, not
271
- zero. Notification notes are practitioner-authored and do not acknowledge or otherwise change an
272
- alert. After a note mutation, mounted note and alert-feed hooks reload their data.
273
-
274
- Writes can return `OvokApiError`, which keeps the HTTP status, machine code, problem `type`, `traceId`,
275
- validation field errors (each with its `FIELD_*` code), and any missing-baseline details. In particular, reload the affected record before retrying a 409;
276
- do not automatically replay a stale assignment. A 409 `signals_project_migrating` should be shown
277
- as a temporary home-migration conflict, not retried in a loop. Threshold writes can return 422
278
- validation errors or 424 when the baseline has not been collected. Hooks never replay a write with
279
- a stale body; transient 503 transport retries do not clear the session.
280
- The unconfirmed-limit list and repush routes require project-admin access; a 403 remains an error.
281
-
282
- Resident deletion returns 409 while the resident has a device; unassign the device with
283
- `updateSlimPatient()` before deleting. Resident, room, and device writes can also return 422 when
284
- their device, room, and zone assignments disagree; show the server message and reload before
285
- retrying. Device serial conflicts return 409 when another customer holds the serial and 422 when
286
- another device in the project already uses it. Renaming a device moves its serial: old-serial
287
- readings stop reaching it, and live values return after a reading arrives under the new serial.
288
- Resident updates replace the editable fields; omitting `locationId` unassigns its devices, and names
289
- are trimmed by the server.
290
-
291
- A resident threshold save can return 409 while another save is running; nothing changed, so wait
292
- briefly and send it again. A home threshold save can return 502 when Signals did not take every
293
- resident's limits; nothing was written. A home with no saved limits reads as the default template
294
- with heart rate 40–110 and respiratory rate 8–25 enabled, and `id: null`.
295
-
296
- Notification feeds and episode reads can wait 5 seconds for Signals before returning 503
297
- `signals_unavailable`; realtime trends can wait 12 seconds. Realtime trends may also be shed
298
- immediately under load. Wait for `retryAfterMs` before trying again. The paged medical feed returns
299
- 503 during an outage, while recent medical notifications may return the last good page, up to 10
300
- minutes old, without a marker. Episode `values` contains only readings the episode counted, not
301
- valueless or history readings. Acknowledgements can take about 12 seconds and are safe to repeat.
302
- Realtime trends allow 20 calls per minute per caller; load once per view instead of polling.
303
-
304
- `getLegalConsent()` returns the signed-in practitioner's own terms status. If
305
- `needsLegalConsentReacceptance(response.legal)` is true, show the current terms before continuing.
306
-
307
- ```ts
308
- if (needsLegalConsentReacceptance(legalConsent.legal)) {
309
- // Show the current terms and request acceptance.
310
- }
311
-
312
- try {
313
- await client.updateSlimPatientThresholdV2(patientId, body);
314
- } catch (error) {
315
- if (isOvokApiError(error) && error.status === 424) {
316
- console.info(error.missing);
317
- }
318
- throw error;
319
- }
320
- ```
321
-
322
- ## Application APIs
323
-
324
- The client also exposes typed application APIs for consent signatures, document upload credentials,
325
- document download endpoints, CMS content, LiveKit video calls, translation, AI chat, and AI FHIR
326
- search, and cloud wearable-provider connections. These methods are additive and do not change the
327
- native observation or offline contracts. See the [wearable connection guide](docs/integrations/wearable-connections.md)
328
- for provider setup, patient consent, and the app-return flow.
20
+ ## Quick start
329
21
 
330
22
  ```ts
331
- const content = await client.searchContent("blog", "en-US", { search: "welcome" });
332
- const appointment = await client.createVideoCallAppointment({
333
- start: "2026-01-01T10:00:00.000Z",
334
- end: "2026-01-01T11:00:00.000Z",
335
- comment: "Check-in",
336
- videoCallParticipants: [{ email: "patient@example.com" }],
337
- });
338
- const translation = await client.translate({
339
- sourceLanguage: "en",
340
- targetLanguage: "de",
341
- text: ["Welcome"],
342
- });
343
- ```
344
-
345
- Document download methods return the backend endpoint URL so applications can use it in media or
346
- download elements; the backend remains responsible for authorization and signed redirects.
23
+ import { Ovok } from '@ovok/core';
347
24
 
348
- ## React hooks
349
-
350
- The package exports additive hooks for capability discovery, project configuration, patient profile
351
- and health data, questionnaires, scheduling resources, Slim lists, telemetry, notifications,
352
- documents, content, video consultations, wearable connections, and localization. Every request hook returns `data`,
353
- `loading`, `error`, and `reload`; mutations expose `data`, `loading`, `error`, `mutate`, and `reset`.
354
-
355
- ```tsx
356
- const { data: patients, loading, error } = useSlimPatients({
357
- residentState: "active",
25
+ const ovok = new Ovok({
26
+ baseUrl: 'https://api.sandbox.ovok.com',
27
+ tenantCode: 'your-tenant',
358
28
  });
359
29
 
360
- const saveSettings = useOvokMutation((client, settings: OvokProjectSettings) =>
361
- client.updateProjectSetting("PATIENT_LOGIN_ENABLED", settings.settings.PATIENT_LOGIN_ENABLED),
362
- );
363
-
364
- const { data: me } = useCurrentPatientProfile();
365
- const { data: appointments } = usePatientAppointments({ status: "booked" });
366
- const populateQuestionnaire = usePopulateQuestionnaire();
367
- const { data: articles } = useContent("blog", "en-US", { _count: 10 });
368
- const { data: calls } = useVideoCallAppointments();
369
- const { data: translations } = useLocalizations("en-US");
30
+ const health = await ovok.health.check();
370
31
  ```
371
32
 
372
- Hooks are additive to the existing `OvokProvider`, observation hooks, auth methods, and offline
373
- queue. Billing remains outside the SDK contract.
33
+ The client exposes APIs through namespaces such as `auth`, `fhir`, `measurements`, `projects`, and `wearables`. See the [SDK guide](https://sdk.ovok.com/) for configuration and usage.
374
34
 
375
- ## CMS content
35
+ ## React
376
36
 
377
- Published Ovok CMS documents (legal pages, release notes, or any other collection) are read with
378
- `getCmsDocument(collection, slug)` and `listCmsDocuments(collection)`, or the `useCmsDocument`,
379
- `useCmsDocuments`, `useLegalPage`, and `useReleaseNotes` hooks. They are separate from the older
380
- `searchContent` and `useContent` reads.
37
+ React exports live in the separate `@ovok/core/next/react` entry:
381
38
 
382
39
  ```tsx
383
- const { data: terms, error } = useLegalPage("terms-and-conditions", { tenantCode });
384
- const { data: notes } = useReleaseNotes({ limit: 10 });
385
- const faq = await client.listCmsDocuments("faq", { page: 2 });
386
- ```
387
-
388
- The backend allows three kinds of read:
389
-
390
- - **Signed in**: the session reads its own tenant's content with no API key. Naming another
391
- tenant without a key is refused with 403.
392
- - **Legal pages and translations**: no key and no session are needed. Before sign-in, pass the
393
- tenant's `tenantCode`.
394
- - **Anything else**: it needs the public API key, and is a 401 without one. This SDK does not
395
- send a key.
396
-
397
- Signed out, a read rejects with `SignInRequiredError` (`isSignInRequiredError(error)`) before
398
- any request is sent, unless it passes `allowSignedOut: true` and a `tenantCode`. `getLegalPage`,
399
- `getTranslations` and their hooks turn `allowSignedOut` on by default; pass it yourself only for
400
- another collection the backend serves without a key or session. A 401 from an ordinary request can
401
- clear the session storage and call `onUnauthenticated`; a 401 from password sign-in is instead a
402
- `LoginError` and leaves the active account untouched. A hook that rendered before sign-in needs
403
- `reload()` once the session exists.
404
-
405
- `locale` takes an app language or a CMS locale (`en`, `de`, `fr`, `es`). `toCmsLocale` maps
406
- `de-CH` to `de`, and a language the CMS does not carry to `en`. The hooks default to the
407
- runtime's language (`defaultCmsLocale()`), and `""` counts as unset. A change of language that
408
- maps to the same CMS locale does not read again. Lists use the CMS envelope (`OvokCmsPage`):
409
- `prevPage` and `nextPage` are `null` at either end, and `limit` is at most 50. Release notes are
410
- newest first unless `sort` says otherwise. The backend merges in a shared tenant's documents.
411
-
412
- ### Translations
413
-
414
- `getTranslations()` and `useTranslations()` read the whole `translations` collection as one tree
415
- (`OvokTranslations`): each document's `slug` is a group, and each of its `strings` rows puts its
416
- `value` at its `key`, nested at the dots.
417
-
418
- ```tsx
419
- const { data: translations } = useTranslations({ tenantCode });
420
- // { "sign-in": { title: "Anmelden", errors: { required: "Pflichtfeld" } } }
421
- ```
422
-
423
- The CMS answers a row with no text in the locale in English. A row with no text at all, and a row
424
- whose key is taken (or clashes with a nested key), are left out. Nothing is kept on the device, so
425
- offline the app shows its own and the SDK's built-in text.
426
-
427
- These routes ship with an Ovok Core backend release. Deploy that backend before releasing this
428
- SDK version.
429
-
430
- ## Offline measurements
431
-
432
- Pass a durable client storage adapter and opt in to queue measurements while offline:
433
-
434
- ```typescript
435
- const client = new OvokClient({
436
- storage,
437
- offlineQueue: { enabled: true },
438
- // other Ovok client configuration
439
- });
440
-
441
- const result = await client.saveMeasurement({
442
- patientId: "patient-id",
443
- measurement: {
444
- measurementTypeKey: MeasurementTypeKey.temperature,
445
- bodyTemp: 36.5,
446
- },
447
- });
448
-
449
- // result.status is "saved" or "queued".
450
- // Call this from the host app's connectivity and app-resume listeners.
451
- await client.flushOfflineMeasurementQueue();
452
- ```
453
-
454
- Queued observations are persisted in `storage`, retried with exponential backoff, and sent as
455
- conditional creates using a stable identifier. A retry after a process death therefore cannot
456
- create a second copy of the same observation. The queue is opt-in and requires durable storage.
457
-
458
- ## Rate limits
459
-
460
- Ovok-defined methods, including measurement saves, reject with `RateLimitError` when the server
461
- returns 429. A 429 or 503 with a retry delay is returned without an automatic retry; wait for
462
- `retryAfterMs` before trying again. Use `isRateLimitError(error)` and `retryAfterMs` to show a
463
- translated wait message without parsing backend text. Inherited FHIR methods keep their
464
- `OperationOutcomeError`; use `readOvokError(error)` to read their status and delay.
465
-
466
- ## Session management
467
-
468
- `logout()` revokes the current server session and clears the local login even when the server is
469
- unreachable. Use `getSessions()` to show the account's active sessions and `revokeSessions("other")`
470
- or a session id to sign out elsewhere. Access-token and refresh-token lifetimes remain controlled
471
- by the server's `ClientApplication` configuration.
472
-
473
- ```typescript
474
- await client.logout();
475
-
476
- const sessions = await client.getSessions();
477
- await client.revokeSessions("other");
478
- ```
479
-
480
- Pass `onUnauthenticated` in the client options to react when a request can no longer refresh its
481
- session.
40
+ 'use client';
482
41
 
483
- ## Multi-factor authentication
42
+ import { OvokProvider } from '@ovok/core/next/react';
43
+ import { Ovok } from '@ovok/core';
44
+ import { useState, type PropsWithChildren } from 'react';
484
45
 
485
- When password login requires MFA, `login()` returns a verification step instead of an
486
- `AuthResponse`. Submit the one-time code with `verify()` and use the returned `AuthResponse`:
46
+ export function AppProviders({ children }: PropsWithChildren) {
47
+ const [client] = useState(() => new Ovok({
48
+ baseUrl: 'https://api.sandbox.ovok.com',
49
+ tenantCode: 'your-tenant',
50
+ }));
487
51
 
488
- ```typescript
489
- const result = await client.login(loginBody);
490
-
491
- if ("nextStep" in result && result.nextStep === "mfa") {
492
- const authenticated = await result.verify(oneTimeCode);
493
- }
494
- ```
495
-
496
- ### Password sign-in errors
497
-
498
- Password sign-in failures throw `LoginError`. A 401 has `code: "invalid_credentials"` and the
499
- server's message; it does not refresh tokens, clear an existing account, or call
500
- `onUnauthenticated`. A 429 has `code: "rate_limited"` and includes `retryAfterMs` when the server
501
- provides a retry delay. Show the error or a wait message to the user, then honor that delay before
502
- another attempt. The backend controls the lockout threshold and duration.
503
-
504
- ## Patient registration invitations
505
-
506
- When a project invites people with a business email address to join as clinicians,
507
- `register()` can return a clinician-invite step instead of an authenticated session. Check
508
- `nextStep` before reading tokens or setting the active login:
509
-
510
- ```typescript
511
- const result = await client.register(registerBody);
512
-
513
- if ("nextStep" in result && result.nextStep === "clinician-invite") {
514
- showCheckYourEmailMessage();
515
- return;
52
+ return <OvokProvider client={client}>{children}</OvokProvider>;
516
53
  }
517
-
518
- await client.setActiveLogin(result);
519
- ```
520
-
521
- The invitation email's “continue as patient” link includes a
522
- `continueAsPatientToken` query parameter. The host app owns its deep-link and universal-link
523
- configuration: read that parameter from the incoming URL and pass it to `register()` to finish
524
- registration as a patient:
525
-
526
- ```typescript
527
- await client.register({ ...registerBody, continueAsPatientToken });
528
- ```
529
-
530
- The token is optional and is sent only when provided. An invalid or expired token is rejected
531
- with HTTP 400 and the message “The continue-as-patient link is invalid or has expired.”
532
-
533
- ### Practitioner self-registration
534
-
535
- `registerPractitioner()` posts a new practitioner account to
536
- `POST /auth/tenant/Practitioner/register` and returns an `AuthResponse`. It checks
537
- `passwordConfirm` locally and never sends that confirmation field. Email is
538
- lowercased by Core and password must be 1–128 characters. The route is limited to
539
- five requests per minute, and validation failures return 422 field errors. The project
540
- must enable `PRACTITIONER_REGISTRATION_ENABLED` and configure a default
541
- practitioner access policy (prefer `DEFAULT_PRACTITIONER_ACCESS_POLICY`, falling
542
- back to `CLINICIAN_INVITE_ACCESS_POLICY`). Registration does not verify the
543
- email address and does not send an email; do not treat the address as verified.
544
- Core deliberately holds registration failures for at least a second, so a brief
545
- spinner while the request is pending is expected.
546
-
547
- ```typescript
548
- const result = await client.registerPractitioner(registerBody);
549
- await client.setActiveLogin(result);
550
- ```
551
-
552
- Both patient and practitioner registration intentionally return the same
553
- `400 Registration failed.` when an email already belongs to an account. Show a
554
- neutral form-level message with sign-in and password-reset links. Do not identify
555
- the email as taken or retry automatically. `isRegistrationFailed(error)` matches
556
- this exact response. The practitioner route can also return 403 when registration
557
- is disabled, 409 `practitioner_registration_not_configured` when no default
558
- policy is configured, 404 for an unknown tenant, 422 for invalid fields, and 429
559
- when its five-per-minute limit is reached. `readOvokError(error)` exposes the
560
- status/code/message and field errors for these responses.
561
-
562
- ## Patient sharing and invitations
563
-
564
- Patient sharing settings are read and written through `getPatientSharingSettings()`
565
- and `updatePatientSharingSettings()`. The update always includes `enabled`; when
566
- changing only practitioner sharing, send the current `enabled` value too.
567
- `practitionerSharingEnabled` is a separate, off-by-default setting, not a
568
- `ProjectSettingKey`. It controls new practitioner invitations and acceptances;
569
- turning it off does not revoke existing shares. A project admin can toggle it
570
- through `PUT /v1/patient-sharing/settings`; concurrent settings changes return
571
- 409 and should be reloaded, and non-admins receive 403. Do not enable it for a project
572
- whose practitioners use the Slim dashboard. Map the email templates
573
- `PATIENT_INVITE`, `PATIENT_ASSIGNMENT_REQUEST`,
574
- `PRACTITIONER_INVITED_BY_PATIENT`, and `PRACTITIONER_PATIENT_SHARED` before
575
- turning the feature on; an unmapped email can still produce the uniform 202
576
- response without sending a message. `useUpdatePatientSharingSettings()` is the
577
- corresponding mutation hook.
578
-
579
- `listPatientSharing()` returns `outgoing`, `incoming`, `practitioners`,
580
- `relatedPersons`, and `received`. `practitioners` lists active shares of a patient's
581
- whole record with practitioners; `relatedPersons` lists the Observation codes a
582
- patient shares with carers. `received` is for a signed-in carer: the shares patients
583
- gave them, each with the sharing patient and its `codes`. A carer gets only
584
- `received`, and a patient always gets an empty `received`. For compatibility with
585
- older servers, the SDK defaults any missing `practitioners`, `relatedPersons` or
586
- `received` array to `[]`. Listing is for patients and carers; a practitioner gets 403.
587
- `revokePatientSharing(consentId)` uses the existing DELETE route
588
- to end a share immediately or decline a pending invite. A carer calls it with a
589
- `received` share's `consentId` to leave that share. It returns 204; 404
590
- (`Share not found.`) means the caller is not a party, and a 409 means the share
591
- already ended or kept changing; reload the list and retry. A
592
- practitioner's whole-record share has no measurement-code list.
593
-
594
- Invitations are named by purpose, all backed by `/v1/invites/*`:
595
-
596
- ```typescript
597
- // A patient shares their record with a practitioner…
598
- await client.shareRecord({ recipient: "practitioner", email, firstName, lastName });
599
- // …or shares some Observation codes with a carer (a related person).
600
- await client.shareRecord({ recipient: "related-person", email, firstName, lastName, codes: ["8480-6"] });
601
- await client.acceptRecordShare({ inviteId, code }); // practitioner or existing carer, signed in
602
- await client.acceptRecordShare({ inviteId, code, password }); // new carer, signed out
603
-
604
- // A practitioner invites a patient into their care.
605
- await client.inviteToCare({ email, firstName, lastName });
606
- await client.acceptCareInvite({ inviteId, code }); // patient, signed in
607
-
608
- // Or dispatch acceptance using the signed-in Practitioner or Patient profile:
609
- await client.acceptInvite({ inviteId, code });
610
54
  ```
611
55
 
612
- `useShareRecord()`, `useAcceptRecordShare()`, `useInviteToCare()`,
613
- `useAcceptCareInvite()`, and `useAcceptInvite()` provide React mutation states.
614
-
615
- `invitePractitioner()`, `invitePatient()`, `acceptPractitionerInvite()`,
616
- `acceptPatientInvite()`, `useInvitePractitioner()`, and `useInvitePatient()` are
617
- deprecated. Their routes (`/v1/invites/practitioner`, `/v1/invites/patient` and
618
- their `/accept` routes) sunset on 2026-12-01; move to `shareRecord()`,
619
- `inviteToCare()`, `acceptRecordShare()`, and `acceptCareInvite()` before then.
620
-
621
- A carer accepts a record share from the patient app. A carer new to the project
622
- accepts signed out and sends a `password`; that creates their account, and they
623
- then sign in with `login({ type: "RelatedPerson", email, password, tenantCode })`.
624
- There is no carer registration route. A 422 `password_required` means the invite
625
- needs a password; a 409 `address_has_account` means the address already has an
626
- account, so the patient must send a new invite. Carer sharing needs patient
627
- sharing enabled and `RELATED_PERSON_INVITATION_ENABLED` not set to `false`; carer
628
- sign-in needs `RELATED_PERSON_LOGIN_ENABLED` not set to `false`. Map the
629
- `RELATED_PERSON_INVITED` and `RELATED_PERSON_RECORD_SHARED` email templates
630
- before inviting carers. The invite methods always return `{ status: "sent" }`
631
- (HTTP 202), whether or not an email is ultimately sent. Show only “If that
632
- address can be invited, an email is on its way”; the response must not reveal
633
- whether the address has an account. Both names are trimmed by Core, and email
634
- addresses are normalized there. A new address receives an account and a
635
- set-password link; an existing account receives an accept link. If sending the
636
- email fails, Core rolls back the invite. Email is limited to 254 characters;
637
- the trimmed first and last names must each be 1–200 characters.
638
-
639
- The project must enable `PRACTITIONER_SHARING_ENABLED` and the invitee's
640
- `PATIENT_INVITATION_ENABLED` or `PRACTITIONER_INVITATION_ENABLED` setting. An
641
- invite can also fail with 401 (no session), 403 (feature/role gate), 422 (invalid
642
- body), 409 `invitation_not_configured` (missing default policy),
643
- `app_url_not_configured` (missing audience app URL), or
644
- `practitioner_without_access_policy` (a full-access practitioner cannot be
645
- narrowed to a share policy). Accepting a record share can also return 409
646
- `related_person_without_access_policy` or `sharing_not_configured` (patient
647
- sharing lost its template; turn it on again). A code-less 409 means another invite for the same
648
- address or practitioner is still being written; offer retry. A 429 means the
649
- inviter has 20 pending invites. Use
650
- `readOvokError(error)` and `OVOK_INVITE_ERROR_CODES` to branch on stable codes.
651
-
652
- ### Accept-invite page
653
-
654
- Every app that can receive invitations needs a page at
655
- `<app URL>/accept-invite?invite=<uuid>&code=<secret>`. Practitioner links use
656
- `PRACTITIONER_APP_URL`; patient and carer links use `PATIENT_APP_URL`. The secret is valid
657
- for seven days. `parseAcceptInviteLink(url)` returns a body only when the UUID and
658
- 16–128 character code are present and valid; otherwise show “This link is
659
- incomplete” and make no request. Once parsed, remove the code from the address
660
- bar/history and do not send it to logs or analytics.
661
-
662
- If the visitor is signed out, send them through sign-in and restore the link on
663
- return. There is no preview endpoint. Once signed in, call `acceptInvite()`; it
664
- chooses the route from the `Patient` or `Practitioner` profile and rejects other
665
- profile types. Carers call `acceptRecordShare()` directly: signed in when they
666
- already have an account, otherwise signed out with a new password. Never accept on page load. For a patient accepting, explain that
667
- their whole record will be shared and wait for an explicit Accept action. A
668
- patient can decline with `revokePatientSharing(inviteId)`; practitioners have no
669
- decline route and can ignore the link. After a successful acceptance, show who
670
- shares with whom (use a generic name when either is null), provide a way into the
671
- app, and refresh `/auth/me` because practitioner access may have changed.
672
-
673
- Render accept failures without attempting to distinguish private cases:
674
-
675
- - 404 `Invite not found.` means an unknown id, bad code, or invite for another
676
- account. Say the invite is not for the signed-in account and offer sign-out.
677
- - 409 `This invite was already used.` means accepted or cancelled; the other
678
- code-less 409 (`This invite kept changing; try again.`) can be retried.
679
- - 410 means expired; ask the sender for a new invite.
680
- - 409 `The patient who shared their record is no longer a member of this
681
- project.`, `The practitioner who invited you is no longer a member of this
682
- project.`, or `More than one account in this project acts as that practitioner.`
683
- cannot be accepted; ask the sender to resolve it.
684
- - 401 requires sign-in; 403 means the wrong account type or a disabled gate;
685
- 422 means the link values are invalid.
686
-
687
- ## Large measurements
688
-
689
- `saveMeasurement` and `saveObservations` use conditional creates for idempotent saves. The API
690
- limits a serializable transaction with conditional operations to eight entries, so the SDK keeps
691
- the first observation in a transaction and sends additional observations in a FHIR batch request.
692
- This supports measurements such as urine strips and long ECG recordings without changing retry
693
- behavior. The first observation should remain first when supplying observations manually.
694
-
695
- The offline queue applies the same split when it flushes a measurement. A partial retry is safe:
696
- the first conditional create finds the existing observation and the batch only creates missing
697
- members. Applications building their own bundles can use the exported
698
- `MAX_CONDITIONAL_OBSERVATION_ENTRIES` limit. See the [Ovok FHIR documentation](https://docs.ovok.com/api/fhir/r4)
699
- for the transaction and batch semantics supported by the API.
56
+ The `@ovok/core/next` entry remains available as an alias for the package-root client.