@ovok/core 0.4.49-dev.495 → 0.4.49-dev.497

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 (243) hide show
  1. package/dist/client/observation/measurement-fields.d.ts +1 -1
  2. package/dist/client/observation/methods/observationsToMeasurements.d.ts +1 -1
  3. package/dist/client/observation/methods/observationsToMeasurements.js +59 -59
  4. package/dist/client/observation/services/base-observation-service.d.ts +1 -1
  5. package/dist/client/observation/services/blood-oxygen.d.ts +1 -1
  6. package/dist/client/observation/services/blood-oxygen.js +7 -7
  7. package/dist/client/observation/services/blood-pressure.d.ts +1 -1
  8. package/dist/client/observation/services/blood-pressure.js +16 -16
  9. package/dist/client/observation/services/component-observation-services.d.ts +1 -1
  10. package/dist/client/observation/services/component-observation-services.js +3 -3
  11. package/dist/client/observation/services/creator.d.ts +1 -1
  12. package/dist/client/observation/services/creator.js +10 -10
  13. package/dist/client/observation/services/ecg-observation-fragments.d.ts +1 -1
  14. package/dist/client/observation/services/ecg.d.ts +1 -1
  15. package/dist/client/observation/services/ecg.js +10 -10
  16. package/dist/client/observation/services/lipid-panel.d.ts +1 -1
  17. package/dist/client/observation/services/lipid-panel.js +13 -13
  18. package/dist/client/observation/services/single-value-services.d.ts +1 -1
  19. package/dist/client/observation/services/single-value-services.js +19 -19
  20. package/dist/client/observation/services/step-count.d.ts +1 -1
  21. package/dist/client/observation/services/step-count.js +5 -5
  22. package/dist/client/observation/services/uric-acid-service.d.ts +1 -1
  23. package/dist/client/observation/services/uric-acid-service.js +7 -7
  24. package/dist/client/offline/offline-measurement-queue.d.ts +1 -2
  25. package/dist/client/wearables/types.d.ts +5 -0
  26. package/dist/conformance/capability-requirements.js +1 -1
  27. package/dist/next/auth/access-token.d.ts +9 -0
  28. package/dist/next/auth/access-token.js +18 -0
  29. package/dist/next/auth/client-credentials.d.ts +16 -0
  30. package/dist/next/auth/client-credentials.js +40 -0
  31. package/dist/next/auth/credentials.d.ts +5 -0
  32. package/dist/next/auth/credentials.js +7 -0
  33. package/dist/next/auth/saved-accounts-store.d.ts +26 -0
  34. package/dist/next/auth/saved-accounts-store.js +93 -0
  35. package/dist/next/auth/session-store.d.ts +12 -0
  36. package/dist/next/auth/session-store.js +33 -0
  37. package/dist/next/auth/session.d.ts +28 -0
  38. package/dist/next/auth/session.js +27 -0
  39. package/dist/next/auth/token-endpoint.d.ts +12 -0
  40. package/dist/next/auth/token-endpoint.js +28 -0
  41. package/dist/next/auth/user-session.d.ts +39 -0
  42. package/dist/next/auth/user-session.js +183 -0
  43. package/dist/next/config/ovok-config.d.ts +42 -0
  44. package/dist/next/config/ovok-config.js +2 -0
  45. package/dist/next/config/settings.d.ts +6 -0
  46. package/dist/next/config/settings.js +74 -0
  47. package/dist/next/errors/error-from-response.d.ts +2 -0
  48. package/dist/next/errors/error-from-response.js +35 -0
  49. package/dist/next/errors/ovok-account-error.d.ts +5 -0
  50. package/dist/next/errors/ovok-account-error.js +13 -0
  51. package/dist/next/errors/ovok-errors.d.ts +42 -0
  52. package/dist/next/errors/ovok-errors.js +74 -0
  53. package/dist/next/http/http-client.d.ts +36 -0
  54. package/dist/next/http/http-client.js +116 -0
  55. package/dist/next/http/retry-after.d.ts +1 -0
  56. package/dist/next/http/retry-after.js +16 -0
  57. package/dist/next/http/retry-policy.d.ts +13 -0
  58. package/dist/next/http/retry-policy.js +27 -0
  59. package/dist/next/http/transmit.d.ts +14 -0
  60. package/dist/next/http/transmit.js +57 -0
  61. package/dist/next/http/url.d.ts +6 -0
  62. package/dist/next/http/url.js +22 -0
  63. package/dist/next/index.d.ts +74 -0
  64. package/dist/next/index.js +35 -0
  65. package/dist/next/ovok.d.ts +54 -0
  66. package/dist/next/ovok.js +77 -0
  67. package/dist/next/paging/bundle-page.d.ts +4 -0
  68. package/dist/next/paging/bundle-page.js +25 -0
  69. package/dist/next/paging/cursor-pages.d.ts +7 -0
  70. package/dist/next/paging/cursor-pages.js +14 -0
  71. package/dist/next/paging/numbered-pages.d.ts +15 -0
  72. package/dist/next/paging/numbered-pages.js +20 -0
  73. package/dist/next/paging/page.d.ts +12 -0
  74. package/dist/next/paging/page.js +17 -0
  75. package/dist/next/resources/accounts/accounts-resource.d.ts +8 -0
  76. package/dist/next/resources/accounts/accounts-resource.js +13 -0
  77. package/dist/next/resources/ai/ai-chat-resource.d.ts +8 -0
  78. package/dist/next/resources/ai/ai-chat-resource.js +12 -0
  79. package/dist/next/resources/ai/ai-resource.d.ts +16 -0
  80. package/dist/next/resources/ai/ai-resource.js +19 -0
  81. package/dist/next/resources/ai/chat-messages-resource.d.ts +9 -0
  82. package/dist/next/resources/ai/chat-messages-resource.js +18 -0
  83. package/dist/next/resources/ai/chat-sessions-resource.d.ts +14 -0
  84. package/dist/next/resources/ai/chat-sessions-resource.js +23 -0
  85. package/dist/next/resources/auth/auth-sessions-resource.d.ts +13 -0
  86. package/dist/next/resources/auth/auth-sessions-resource.js +25 -0
  87. package/dist/next/resources/auth/registration.d.ts +35 -0
  88. package/dist/next/resources/auth/registration.js +24 -0
  89. package/dist/next/resources/auth/social-login.d.ts +8 -0
  90. package/dist/next/resources/auth/social-login.js +7 -0
  91. package/dist/next/resources/auth-resource.d.ts +63 -0
  92. package/dist/next/resources/auth-resource.js +119 -0
  93. package/dist/next/resources/bots/bots-resource.d.ts +10 -0
  94. package/dist/next/resources/bots/bots-resource.js +15 -0
  95. package/dist/next/resources/cms/cms-delivery.d.ts +22 -0
  96. package/dist/next/resources/cms/cms-delivery.js +36 -0
  97. package/dist/next/resources/cms/cms-documents-resource.d.ts +11 -0
  98. package/dist/next/resources/cms/cms-documents-resource.js +17 -0
  99. package/dist/next/resources/cms/cms-resource.d.ts +17 -0
  100. package/dist/next/resources/cms/cms-resource.js +38 -0
  101. package/dist/next/resources/cms/payload-pages.d.ts +6 -0
  102. package/dist/next/resources/cms/payload-pages.js +15 -0
  103. package/dist/next/resources/cms/release-notes-resource.d.ts +10 -0
  104. package/dist/next/resources/cms/release-notes-resource.js +15 -0
  105. package/dist/next/resources/cms/translation-tree.d.ts +3 -0
  106. package/dist/next/resources/cms/translation-tree.js +45 -0
  107. package/dist/next/resources/consent/consent-resource.d.ts +23 -0
  108. package/dist/next/resources/consent/consent-resource.js +43 -0
  109. package/dist/next/resources/content/content-resource.d.ts +19 -0
  110. package/dist/next/resources/content/content-resource.js +41 -0
  111. package/dist/next/resources/documents/documents-resource.d.ts +26 -0
  112. package/dist/next/resources/documents/documents-resource.js +41 -0
  113. package/dist/next/resources/email/email-resource.d.ts +6 -0
  114. package/dist/next/resources/email/email-resource.js +10 -0
  115. package/dist/next/resources/email/email-templates-resource.d.ts +8 -0
  116. package/dist/next/resources/email/email-templates-resource.js +13 -0
  117. package/dist/next/resources/fhir-resource.d.ts +28 -0
  118. package/dist/next/resources/fhir-resource.js +64 -0
  119. package/dist/next/resources/health-resource.d.ts +17 -0
  120. package/dist/next/resources/health-resource.js +14 -0
  121. package/dist/next/resources/invites/invite-flow-resource.d.ts +12 -0
  122. package/dist/next/resources/invites/invite-flow-resource.js +19 -0
  123. package/dist/next/resources/invites/invites-resource.d.ts +22 -0
  124. package/dist/next/resources/invites/invites-resource.js +29 -0
  125. package/dist/next/resources/localization/i18next-resource.d.ts +10 -0
  126. package/dist/next/resources/localization/i18next-resource.js +18 -0
  127. package/dist/next/resources/localization/locales-resource.d.ts +9 -0
  128. package/dist/next/resources/localization/locales-resource.js +16 -0
  129. package/dist/next/resources/localization/localizations-resource.d.ts +17 -0
  130. package/dist/next/resources/localization/localizations-resource.js +27 -0
  131. package/dist/next/resources/measurements/measurements-resource.d.ts +42 -0
  132. package/dist/next/resources/measurements/measurements-resource.js +77 -0
  133. package/dist/next/resources/measurements/observation-builder.d.ts +5 -0
  134. package/dist/next/resources/measurements/observation-builder.js +57 -0
  135. package/dist/next/resources/measurements/save-error.d.ts +5 -0
  136. package/dist/next/resources/measurements/save-error.js +18 -0
  137. package/dist/next/resources/measurements/signed-in-account.d.ts +11 -0
  138. package/dist/next/resources/measurements/signed-in-account.js +26 -0
  139. package/dist/next/resources/patient/fhir-records.d.ts +19 -0
  140. package/dist/next/resources/patient/fhir-records.js +33 -0
  141. package/dist/next/resources/patient/patient-resource.d.ts +21 -0
  142. package/dist/next/resources/patient/patient-resource.js +38 -0
  143. package/dist/next/resources/projects/project-features-resource.d.ts +9 -0
  144. package/dist/next/resources/projects/project-features-resource.js +17 -0
  145. package/dist/next/resources/projects/project-members-resource.d.ts +19 -0
  146. package/dist/next/resources/projects/project-members-resource.js +25 -0
  147. package/dist/next/resources/projects/project-settings-resource.d.ts +10 -0
  148. package/dist/next/resources/projects/project-settings-resource.js +21 -0
  149. package/dist/next/resources/projects/projects-resource.d.ts +20 -0
  150. package/dist/next/resources/projects/projects-resource.js +21 -0
  151. package/dist/next/resources/questionnaires/questionnaires-resource.d.ts +18 -0
  152. package/dist/next/resources/questionnaires/questionnaires-resource.js +36 -0
  153. package/dist/next/resources/session/saved-accounts-resource.d.ts +13 -0
  154. package/dist/next/resources/session/saved-accounts-resource.js +44 -0
  155. package/dist/next/resources/session/session-resource.d.ts +11 -0
  156. package/dist/next/resources/session/session-resource.js +15 -0
  157. package/dist/next/resources/sharing/sharing-invites-resource.d.ts +9 -0
  158. package/dist/next/resources/sharing/sharing-invites-resource.js +17 -0
  159. package/dist/next/resources/sharing/sharing-resource.d.ts +10 -0
  160. package/dist/next/resources/sharing/sharing-resource.js +14 -0
  161. package/dist/next/resources/sharing/sharing-settings-resource.d.ts +9 -0
  162. package/dist/next/resources/sharing/sharing-settings-resource.js +16 -0
  163. package/dist/next/resources/sharing/sharing-shares-resource.d.ts +9 -0
  164. package/dist/next/resources/sharing/sharing-shares-resource.js +27 -0
  165. package/dist/next/resources/signals/signals-gateway-resource.d.ts +14 -0
  166. package/dist/next/resources/signals/signals-gateway-resource.js +44 -0
  167. package/dist/next/resources/signals/signals-resource.d.ts +13 -0
  168. package/dist/next/resources/signals/signals-resource.js +19 -0
  169. package/dist/next/resources/signals/undeliverable-resource.d.ts +26 -0
  170. package/dist/next/resources/signals/undeliverable-resource.js +18 -0
  171. package/dist/next/resources/slim/live-reads.d.ts +13 -0
  172. package/dist/next/resources/slim/live-reads.js +87 -0
  173. package/dist/next/resources/slim/slim-alarms-resource.d.ts +13 -0
  174. package/dist/next/resources/slim/slim-alarms-resource.js +25 -0
  175. package/dist/next/resources/slim/slim-change-history-resource.d.ts +9 -0
  176. package/dist/next/resources/slim/slim-change-history-resource.js +19 -0
  177. package/dist/next/resources/slim/slim-child-projects-resource.d.ts +17 -0
  178. package/dist/next/resources/slim/slim-child-projects-resource.js +22 -0
  179. package/dist/next/resources/slim/slim-devices-resource.d.ts +29 -0
  180. package/dist/next/resources/slim/slim-devices-resource.js +81 -0
  181. package/dist/next/resources/slim/slim-exports-resource.d.ts +8 -0
  182. package/dist/next/resources/slim/slim-exports-resource.js +14 -0
  183. package/dist/next/resources/slim/slim-locations-resource.d.ts +14 -0
  184. package/dist/next/resources/slim/slim-locations-resource.js +30 -0
  185. package/dist/next/resources/slim/slim-medical-notifications-resource.d.ts +18 -0
  186. package/dist/next/resources/slim/slim-medical-notifications-resource.js +46 -0
  187. package/dist/next/resources/slim/slim-notification-notes-resource.d.ts +12 -0
  188. package/dist/next/resources/slim/slim-notification-notes-resource.js +34 -0
  189. package/dist/next/resources/slim/slim-notifications-resource.d.ts +19 -0
  190. package/dist/next/resources/slim/slim-notifications-resource.js +26 -0
  191. package/dist/next/resources/slim/slim-organizations-resource.d.ts +11 -0
  192. package/dist/next/resources/slim/slim-organizations-resource.js +25 -0
  193. package/dist/next/resources/slim/slim-out-of-bed-resource.d.ts +13 -0
  194. package/dist/next/resources/slim/slim-out-of-bed-resource.js +20 -0
  195. package/dist/next/resources/slim/slim-paths.d.ts +6 -0
  196. package/dist/next/resources/slim/slim-paths.js +9 -0
  197. package/dist/next/resources/slim/slim-patient-thresholds-resource.d.ts +10 -0
  198. package/dist/next/resources/slim/slim-patient-thresholds-resource.js +20 -0
  199. package/dist/next/resources/slim/slim-patients-resource.d.ts +20 -0
  200. package/dist/next/resources/slim/slim-patients-resource.js +39 -0
  201. package/dist/next/resources/slim/slim-policies-resource.d.ts +12 -0
  202. package/dist/next/resources/slim/slim-policies-resource.js +29 -0
  203. package/dist/next/resources/slim/slim-practitioners-resource.d.ts +8 -0
  204. package/dist/next/resources/slim/slim-practitioners-resource.js +14 -0
  205. package/dist/next/resources/slim/slim-projects-resource.d.ts +16 -0
  206. package/dist/next/resources/slim/slim-projects-resource.js +35 -0
  207. package/dist/next/resources/slim/slim-queries.d.ts +34 -0
  208. package/dist/next/resources/slim/slim-queries.js +2 -0
  209. package/dist/next/resources/slim/slim-resource.d.ts +39 -0
  210. package/dist/next/resources/slim/slim-resource.js +44 -0
  211. package/dist/next/resources/slim/slim-sleep-resource.d.ts +9 -0
  212. package/dist/next/resources/slim/slim-sleep-resource.js +15 -0
  213. package/dist/next/resources/slim/slim-thresholds-resource.d.ts +11 -0
  214. package/dist/next/resources/slim/slim-thresholds-resource.js +18 -0
  215. package/dist/next/resources/slim/slim-trends-resource.d.ts +11 -0
  216. package/dist/next/resources/slim/slim-trends-resource.js +19 -0
  217. package/dist/next/resources/slim/slim-users-resource.d.ts +11 -0
  218. package/dist/next/resources/slim/slim-users-resource.js +15 -0
  219. package/dist/next/resources/slim/slim-zones-resource.d.ts +12 -0
  220. package/dist/next/resources/slim/slim-zones-resource.js +24 -0
  221. package/dist/next/resources/video-calls/video-call-access-resource.d.ts +11 -0
  222. package/dist/next/resources/video-calls/video-call-access-resource.js +19 -0
  223. package/dist/next/resources/video-calls/video-call-appointments-resource.d.ts +10 -0
  224. package/dist/next/resources/video-calls/video-call-appointments-resource.js +21 -0
  225. package/dist/next/resources/video-calls/video-call-emails-resource.d.ts +10 -0
  226. package/dist/next/resources/video-calls/video-call-emails-resource.js +19 -0
  227. package/dist/next/resources/video-calls/video-calls-resource.d.ts +14 -0
  228. package/dist/next/resources/video-calls/video-calls-resource.js +20 -0
  229. package/dist/next/resources/wearables/wearable-connections-resource.d.ts +12 -0
  230. package/dist/next/resources/wearables/wearable-connections-resource.js +25 -0
  231. package/dist/next/resources/wearables/wearable-providers-resource.d.ts +12 -0
  232. package/dist/next/resources/wearables/wearable-providers-resource.js +27 -0
  233. package/dist/next/resources/wearables/wearables-resource.d.ts +8 -0
  234. package/dist/next/resources/wearables/wearables-resource.js +14 -0
  235. package/dist/next/storage/ovok-storage.d.ts +11 -0
  236. package/dist/next/storage/ovok-storage.js +19 -0
  237. package/dist/types/MeasurementTypes.d.ts +5 -0
  238. package/dist/types/MeasurementTypes.js +21 -0
  239. package/dist/types/index.d.ts +1 -5
  240. package/dist/types/index.js +1 -5
  241. package/next/index.d.ts +1 -0
  242. package/next/index.js +3 -0
  243. package/package.json +3 -2
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CmsResource = void 0;
4
+ const cms_delivery_1 = require("./cms-delivery");
5
+ const cms_documents_resource_1 = require("./cms-documents-resource");
6
+ const release_notes_resource_1 = require("./release-notes-resource");
7
+ const translation_tree_1 = require("./translation-tree");
8
+ const LEGAL_PAGES = "legal-pages";
9
+ const TRANSLATIONS = "translations";
10
+ const FIRST_PAGE = 1;
11
+ const LARGEST_PAGE_SIZE = 50;
12
+ const MAX_TRANSLATION_PAGES = 20;
13
+ class CmsResource {
14
+ constructor(http, tenantCode) {
15
+ this.delivery = new cms_delivery_1.CmsDelivery(http, tenantCode);
16
+ this.documents = new cms_documents_resource_1.CmsDocumentsResource(this.delivery);
17
+ this.releaseNotes = new release_notes_resource_1.ReleaseNotesResource(this.documents);
18
+ }
19
+ /** "terms-and-conditions", "data-privacy", …: readable before sign-in. */
20
+ legalPage(slug, params = {}, options) {
21
+ return this.documents.retrieve(LEGAL_PAGES, slug, params, options);
22
+ }
23
+ /** The `translations` collection as one tree, readable before sign-in; nothing is kept on the device. */
24
+ async translations(locale, options) {
25
+ return (0, translation_tree_1.translationTree)(await this.translationDocuments(locale, options));
26
+ }
27
+ async translationDocuments(locale, options) {
28
+ const documents = [];
29
+ for (let page = FIRST_PAGE, hasNextPage = true; hasNextPage && page <= MAX_TRANSLATION_PAGES; page++) {
30
+ const params = { locale, page, limit: LARGEST_PAGE_SIZE };
31
+ const result = await this.delivery.listPage(TRANSLATIONS, params, options);
32
+ documents.push(...result.docs);
33
+ hasNextPage = result.hasNextPage;
34
+ }
35
+ return documents;
36
+ }
37
+ }
38
+ exports.CmsResource = CmsResource;
@@ -0,0 +1,6 @@
1
+ import type { OvokCmsPage } from "../../../client/cms/types";
2
+ import { PagePromise } from "../../paging/page";
3
+ type LoadPayloadPage<T> = (page: number | undefined) => Promise<OvokCmsPage<T>>;
4
+ /** Payload CMS's list envelope: 1-based pages, with `nextPage` null on the last. */
5
+ export declare function payloadPages<T>(load: LoadPayloadPage<T>, firstPage: number | undefined): PagePromise<T>;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.payloadPages = payloadPages;
4
+ const page_1 = require("../../paging/page");
5
+ /** Payload CMS's list envelope: 1-based pages, with `nextPage` null on the last. */
6
+ function payloadPages(load, firstPage) {
7
+ return (0, page_1.pagePromise)(() => loadPayloadPage(load, firstPage));
8
+ }
9
+ async function loadPayloadPage(load, page) {
10
+ const { docs, totalDocs, nextPage } = await load(page);
11
+ return {
12
+ page: { data: docs, hasMore: nextPage !== null, total: totalDocs },
13
+ next: nextPage === null ? null : () => loadPayloadPage(load, nextPage),
14
+ };
15
+ }
@@ -0,0 +1,10 @@
1
+ import type { OvokCmsDocument } from "../../../client/cms/types";
2
+ import { RequestOptions } from "../../http/transmit";
3
+ import { PagePromise } from "../../paging/page";
4
+ import { CmsListParams } from "./cms-delivery";
5
+ import { CmsDocumentsResource } from "./cms-documents-resource";
6
+ export declare class ReleaseNotesResource {
7
+ private readonly documents;
8
+ constructor(documents: CmsDocumentsResource);
9
+ list(params?: CmsListParams, options?: RequestOptions): PagePromise<OvokCmsDocument>;
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReleaseNotesResource = void 0;
4
+ const RELEASE_NOTES = "release-notes";
5
+ const NEWEST_FIRST = "-publishedAt";
6
+ class ReleaseNotesResource {
7
+ constructor(documents) {
8
+ this.documents = documents;
9
+ }
10
+ list(params = {}, options) {
11
+ var _a;
12
+ return this.documents.list(RELEASE_NOTES, { ...params, sort: (_a = params.sort) !== null && _a !== void 0 ? _a : NEWEST_FIRST }, options);
13
+ }
14
+ }
15
+ exports.ReleaseNotesResource = ReleaseNotesResource;
@@ -0,0 +1,3 @@
1
+ import type { OvokCmsDocument, OvokTranslations } from "../../../client/cms/types";
2
+ /** A group per document slug, holding each row's `value` at its `key`, nested at the dots; the first row wins. */
3
+ export declare function translationTree(documents: OvokCmsDocument[]): OvokTranslations;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.translationTree = translationTree;
4
+ const KEY_SEPARATOR = ".";
5
+ /** Keys that would reach a prototype instead of the tree; keys are CMS input. */
6
+ const UNSAFE_KEYS = ["__proto__", "constructor", "prototype"];
7
+ const isText = (value) => typeof value === "string" && value !== "";
8
+ const hasOwn = (tree, key) => Object.prototype.hasOwnProperty.call(tree, key);
9
+ /** A group per document slug, holding each row's `value` at its `key`, nested at the dots; the first row wins. */
10
+ function translationTree(documents) {
11
+ const translations = {};
12
+ for (const { slug, strings } of documents) {
13
+ const rows = Array.isArray(strings) ? strings : [];
14
+ if (isText(slug)) {
15
+ rows.forEach((row) => addRow(translations, slug, row));
16
+ }
17
+ }
18
+ return translations;
19
+ }
20
+ const addRow = (translations, slug, row) => {
21
+ const { key, value } = row !== null && row !== void 0 ? row : {};
22
+ if (isText(key) && isText(value)) {
23
+ setText(translations, [slug, ...key.split(KEY_SEPARATOR)], value);
24
+ }
25
+ };
26
+ const setText = (tree, path, text) => {
27
+ const reachesPrototype = path.some((key) => UNSAFE_KEYS.includes(key));
28
+ const group = reachesPrototype ? null : groupAt(tree, path.slice(0, -1));
29
+ const leaf = path[path.length - 1];
30
+ if (group !== null && !hasOwn(group, leaf)) {
31
+ group[leaf] = text;
32
+ }
33
+ };
34
+ /** The group at `keys`, made where missing; null when a text is in the way. */
35
+ const groupAt = (tree, keys) => {
36
+ let group = tree;
37
+ for (const key of keys) {
38
+ const next = hasOwn(group, key) ? group[key] : (group[key] = {});
39
+ if (typeof next === "string") {
40
+ return null;
41
+ }
42
+ group = next;
43
+ }
44
+ return group;
45
+ };
@@ -0,0 +1,23 @@
1
+ import type { LegalConsentResponse, MedicalConsentResponse } from "../../../client/consent/types";
2
+ import type { OvokConsentSignatureResponse } from "../../../client/experience/types";
3
+ import { HttpClient } from "../../http/http-client";
4
+ import { RequestOptions } from "../../http/transmit";
5
+ export declare class LegalConsentResource {
6
+ private readonly http;
7
+ constructor(http: HttpClient);
8
+ retrieve(options?: RequestOptions): Promise<LegalConsentResponse>;
9
+ set(accepted: boolean, options?: RequestOptions): Promise<LegalConsentResponse>;
10
+ }
11
+ export declare class MedicalConsentResource {
12
+ private readonly http;
13
+ constructor(http: HttpClient);
14
+ retrieve(options?: RequestOptions): Promise<MedicalConsentResponse>;
15
+ set(accepted: boolean, options?: RequestOptions): Promise<MedicalConsentResponse>;
16
+ }
17
+ export declare class ConsentResource {
18
+ private readonly http;
19
+ readonly legal: LegalConsentResource;
20
+ readonly medical: MedicalConsentResource;
21
+ constructor(http: HttpClient);
22
+ requestSignature(consentId: string, options?: RequestOptions): Promise<OvokConsentSignatureResponse>;
23
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsentResource = exports.MedicalConsentResource = exports.LegalConsentResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const LEGAL_CONSENT_PATH = "v1/me/consent/legal";
6
+ const MEDICAL_CONSENT_PATH = "v1/me/consent/medical";
7
+ class LegalConsentResource {
8
+ constructor(http) {
9
+ this.http = http;
10
+ }
11
+ retrieve(options) {
12
+ return this.http.get(LEGAL_CONSENT_PATH, options);
13
+ }
14
+ set(accepted, options) {
15
+ const body = { termsAndConditionsConsent: accepted };
16
+ return this.http.post(LEGAL_CONSENT_PATH, body, options);
17
+ }
18
+ }
19
+ exports.LegalConsentResource = LegalConsentResource;
20
+ class MedicalConsentResource {
21
+ constructor(http) {
22
+ this.http = http;
23
+ }
24
+ retrieve(options) {
25
+ return this.http.get(MEDICAL_CONSENT_PATH, options);
26
+ }
27
+ set(accepted, options) {
28
+ const body = { medicalSettingsNotificationsConsent: accepted };
29
+ return this.http.post(MEDICAL_CONSENT_PATH, body, options);
30
+ }
31
+ }
32
+ exports.MedicalConsentResource = MedicalConsentResource;
33
+ class ConsentResource {
34
+ constructor(http) {
35
+ this.http = http;
36
+ this.legal = new LegalConsentResource(http);
37
+ this.medical = new MedicalConsentResource(http);
38
+ }
39
+ requestSignature(consentId, options) {
40
+ return this.http.post(`consent/signature/${(0, url_1.pathSegment)(consentId)}`, undefined, options);
41
+ }
42
+ }
43
+ exports.ConsentResource = ConsentResource;
@@ -0,0 +1,19 @@
1
+ import type { OvokContent, OvokContentBody, OvokContentQuery, OvokContentSearchResponse, OvokMappedContentSearchResponse } from "../../../client/experience/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export type CopyFromParentResult = {
5
+ success: boolean;
6
+ };
7
+ export declare class ContentResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ search(type: string, language: string, params?: OvokContentQuery, options?: RequestOptions): Promise<OvokContentSearchResponse>;
11
+ retrieve(type: string, language: string, key: string, options?: RequestOptions): Promise<OvokContent>;
12
+ create(type: string, language: string, body: OvokContentBody, options?: RequestOptions): Promise<OvokContent>;
13
+ update(type: string, language: string, key: string, body: OvokContentBody, options?: RequestOptions): Promise<OvokContent>;
14
+ delete(type: string, language: string, key: string, options?: RequestOptions): Promise<void>;
15
+ /** Pairs each default-language item with its `language` translation. */
16
+ map(type: string, language: string, params?: OvokContentQuery, options?: RequestOptions): Promise<OvokMappedContentSearchResponse>;
17
+ copyFromParent(type: string, language: string, key: string, options?: RequestOptions): Promise<CopyFromParentResult>;
18
+ copyAllFromParent(type: string, language: string, options?: RequestOptions): Promise<CopyFromParentResult>;
19
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContentResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const url_1 = require("../../http/url");
6
+ const CONTENT_PATH = "cms";
7
+ const COPY_FROM_PARENT = "copy-from-parent-project";
8
+ const typePath = (type) => `${CONTENT_PATH}/${(0, url_1.pathSegment)(type)}`;
9
+ const languagePath = (type, language) => `${typePath(type)}/${(0, url_1.pathSegment)(language)}`;
10
+ const keyPath = (type, language, key) => `${languagePath(type, language)}/${(0, url_1.pathSegment)(key)}`;
11
+ class ContentResource {
12
+ constructor(http) {
13
+ this.http = http;
14
+ }
15
+ search(type, language, params = {}, options) {
16
+ return this.http.get(`${languagePath(type, language)}${(0, query_string_1.toQueryString)(params)}`, options);
17
+ }
18
+ retrieve(type, language, key, options) {
19
+ return this.http.get(keyPath(type, language, key), options);
20
+ }
21
+ create(type, language, body, options) {
22
+ return this.http.post(languagePath(type, language), body, options);
23
+ }
24
+ update(type, language, key, body, options) {
25
+ return this.http.put(keyPath(type, language, key), body, options);
26
+ }
27
+ delete(type, language, key, options) {
28
+ return this.http.delete(keyPath(type, language, key), options);
29
+ }
30
+ /** Pairs each default-language item with its `language` translation. */
31
+ map(type, language, params = {}, options) {
32
+ return this.http.get(`${typePath(type)}/map/${(0, url_1.pathSegment)(language)}${(0, query_string_1.toQueryString)(params)}`, options);
33
+ }
34
+ copyFromParent(type, language, key, options) {
35
+ return this.http.post(`${keyPath(type, language, key)}/${COPY_FROM_PARENT}`, undefined, options);
36
+ }
37
+ copyAllFromParent(type, language, options) {
38
+ return this.http.post(`${languagePath(type, language)}/${COPY_FROM_PARENT}`, undefined, options);
39
+ }
40
+ }
41
+ exports.ContentResource = ContentResource;
@@ -0,0 +1,26 @@
1
+ import type { OvokDocumentFile, OvokDocumentMetadataUpdate, OvokDocumentReplacement, OvokDocumentSearchQuery, OvokDocumentSearchResponse, OvokDocumentUploadRequest } from "../../../client/experience/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export type DocumentDownloadParams = {
5
+ width?: string | number;
6
+ height?: string | number;
7
+ fit?: string;
8
+ };
9
+ export type DeletedDocument = {
10
+ message: string;
11
+ };
12
+ export declare class DocumentsResource {
13
+ private readonly http;
14
+ private readonly baseUrl;
15
+ constructor(http: HttpClient, baseUrl: string);
16
+ list(params?: OvokDocumentSearchQuery, options?: RequestOptions): Promise<OvokDocumentSearchResponse>;
17
+ createUpload(body: OvokDocumentUploadRequest, options?: RequestOptions): Promise<OvokDocumentFile>;
18
+ replaceUpload(documentId: string, body: OvokDocumentReplacement, options?: RequestOptions): Promise<OvokDocumentFile>;
19
+ updateMetadata(documentId: string, body: OvokDocumentMetadataUpdate, options?: RequestOptions): Promise<OvokDocumentFile>;
20
+ delete(documentId: string, options?: RequestOptions): Promise<DeletedDocument>;
21
+ /** The signed-in route: fetched with the bearer, it redirects to a signed download URL. */
22
+ downloadUrl(documentId: string, params?: DocumentDownloadParams): string;
23
+ /** Needs no bearer, so it fits an image, download or media element. */
24
+ publicDownloadUrl(publicToken: string, params?: DocumentDownloadParams): string;
25
+ private urlFor;
26
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentsResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const url_1 = require("../../http/url");
6
+ const DOCUMENT_PATH = "document";
7
+ const PUBLIC_DOCUMENT_PATH = "document/public";
8
+ const documentPath = (documentId) => `${DOCUMENT_PATH}/${(0, url_1.pathSegment)(documentId)}`;
9
+ class DocumentsResource {
10
+ constructor(http, baseUrl) {
11
+ this.http = http;
12
+ this.baseUrl = baseUrl;
13
+ }
14
+ list(params = {}, options) {
15
+ return this.http.get(`${DOCUMENT_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
16
+ }
17
+ createUpload(body, options) {
18
+ return this.http.post(DOCUMENT_PATH, body, options);
19
+ }
20
+ replaceUpload(documentId, body, options) {
21
+ return this.http.post(documentPath(documentId), body, options);
22
+ }
23
+ updateMetadata(documentId, body, options) {
24
+ return this.http.patch(documentPath(documentId), body, options);
25
+ }
26
+ delete(documentId, options) {
27
+ return this.http.delete(documentPath(documentId), options);
28
+ }
29
+ /** The signed-in route: fetched with the bearer, it redirects to a signed download URL. */
30
+ downloadUrl(documentId, params = {}) {
31
+ return this.urlFor(documentPath(documentId), params);
32
+ }
33
+ /** Needs no bearer, so it fits an image, download or media element. */
34
+ publicDownloadUrl(publicToken, params = {}) {
35
+ return this.urlFor(`${PUBLIC_DOCUMENT_PATH}/${(0, url_1.pathSegment)(publicToken)}`, params);
36
+ }
37
+ urlFor(path, params) {
38
+ return `${(0, url_1.joinPath)(this.baseUrl, path)}${(0, query_string_1.toQueryString)(params)}`;
39
+ }
40
+ }
41
+ exports.DocumentsResource = DocumentsResource;
@@ -0,0 +1,6 @@
1
+ import { HttpClient } from "../../http/http-client";
2
+ import { EmailTemplatesResource } from "./email-templates-resource";
3
+ export declare class EmailResource {
4
+ readonly templates: EmailTemplatesResource;
5
+ constructor(http: HttpClient);
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailResource = void 0;
4
+ const email_templates_resource_1 = require("./email-templates-resource");
5
+ class EmailResource {
6
+ constructor(http) {
7
+ this.templates = new email_templates_resource_1.EmailTemplatesResource(http);
8
+ }
9
+ }
10
+ exports.EmailResource = EmailResource;
@@ -0,0 +1,8 @@
1
+ import type { OvokEmailTemplates } from "../../../client/email/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class EmailTemplatesResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ list(options?: RequestOptions): Promise<OvokEmailTemplates>;
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailTemplatesResource = void 0;
4
+ const EMAIL_TEMPLATES_PATH = "v1/email/templates";
5
+ class EmailTemplatesResource {
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ list(options) {
10
+ return this.http.get(EMAIL_TEMPLATES_PATH, options);
11
+ }
12
+ }
13
+ exports.EmailTemplatesResource = EmailTemplatesResource;
@@ -0,0 +1,28 @@
1
+ import type { Bundle, ExtractResource, Resource, ResourceType } from "@medplum/fhirtypes";
2
+ import { HttpClient } from "../http/http-client";
3
+ import { RequestOptions } from "../http/transmit";
4
+ import { QueryParams } from "../http/url";
5
+ import { PagePromise } from "../paging/page";
6
+ export type PatchOperation = {
7
+ op: "add" | "remove" | "replace" | "copy" | "move" | "test";
8
+ path: string;
9
+ value?: unknown;
10
+ from?: string;
11
+ };
12
+ export type CreateOptions = RequestOptions & {
13
+ ifNoneExist?: string;
14
+ };
15
+ export declare class FhirResource {
16
+ private readonly http;
17
+ constructor(http: HttpClient);
18
+ read<K extends ResourceType>(type: K, id: string, options?: RequestOptions): Promise<ExtractResource<K>>;
19
+ search<K extends ResourceType>(type: K, params?: QueryParams, options?: RequestOptions): PagePromise<ExtractResource<K>>;
20
+ searchOne<K extends ResourceType>(type: K, params?: QueryParams, options?: RequestOptions): Promise<ExtractResource<K> | null>;
21
+ /** With `ifNoneExist`, a retry cannot create a duplicate, so the request is safe to repeat. */
22
+ create<T extends Resource>(resource: T, options?: CreateOptions): Promise<T>;
23
+ update<T extends Resource>(resource: T, options?: RequestOptions): Promise<T>;
24
+ patch<K extends ResourceType>(type: K, id: string, operations: PatchOperation[], options?: RequestOptions): Promise<ExtractResource<K>>;
25
+ delete(type: ResourceType, id: string, options?: RequestOptions): Promise<void>;
26
+ batch(bundle: Bundle, options?: RequestOptions): Promise<Bundle>;
27
+ private searchPage;
28
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FhirResource = void 0;
4
+ const ovok_errors_1 = require("../errors/ovok-errors");
5
+ const url_1 = require("../http/url");
6
+ const bundle_page_1 = require("../paging/bundle-page");
7
+ const page_1 = require("../paging/page");
8
+ const FHIR_JSON = "application/fhir+json";
9
+ const READ_HEADERS = { Accept: FHIR_JSON };
10
+ const WRITE_HEADERS = { Accept: FHIR_JSON, "Content-Type": FHIR_JSON };
11
+ const PATCH_HEADERS = { Accept: FHIR_JSON, "Content-Type": "application/json-patch+json" };
12
+ class FhirResource {
13
+ constructor(http) {
14
+ this.http = http;
15
+ }
16
+ read(type, id, options) {
17
+ return this.http.send({ method: "GET", path: resourcePath(type, id), headers: READ_HEADERS }, options);
18
+ }
19
+ search(type, params = {}, options) {
20
+ return (0, page_1.pagePromise)(() => this.searchPage(type, (0, url_1.toSearchQuery)(params), options));
21
+ }
22
+ async searchOne(type, params = {}, options) {
23
+ var _a;
24
+ const page = await this.search(type, { ...params, _count: 1 }, options);
25
+ return (_a = page.data[0]) !== null && _a !== void 0 ? _a : null;
26
+ }
27
+ /** With `ifNoneExist`, a retry cannot create a duplicate, so the request is safe to repeat. */
28
+ create(resource, options = {}) {
29
+ const { ifNoneExist, ...requestOptions } = options;
30
+ const condition = ifNoneExist === undefined ? {} : { "If-None-Exist": ifNoneExist };
31
+ return this.http.send({
32
+ method: "POST",
33
+ path: resource.resourceType,
34
+ body: resource,
35
+ headers: { ...WRITE_HEADERS, ...condition },
36
+ idempotent: ifNoneExist !== undefined,
37
+ }, requestOptions);
38
+ }
39
+ update(resource, options) {
40
+ const path = resourcePath(resource.resourceType, requireId(resource));
41
+ return this.http.send({ method: "PUT", path, body: resource, headers: WRITE_HEADERS }, options);
42
+ }
43
+ patch(type, id, operations, options) {
44
+ return this.http.send({ method: "PATCH", path: resourcePath(type, id), body: operations, headers: PATCH_HEADERS }, options);
45
+ }
46
+ delete(type, id, options) {
47
+ return this.http.send({ method: "DELETE", path: resourcePath(type, id), headers: READ_HEADERS }, options);
48
+ }
49
+ batch(bundle, options) {
50
+ return this.http.send({ method: "POST", path: "", body: bundle, headers: WRITE_HEADERS }, options);
51
+ }
52
+ async searchPage(type, query, options) {
53
+ const bundle = await this.http.send({ method: "GET", path: `${type}${query}`, headers: READ_HEADERS }, options);
54
+ return (0, bundle_page_1.bundlePage)(bundle, (nextQuery) => this.searchPage(type, nextQuery, options));
55
+ }
56
+ }
57
+ exports.FhirResource = FhirResource;
58
+ const resourcePath = (type, id) => `${type}/${(0, url_1.pathSegment)(id)}`;
59
+ const requireId = (resource) => {
60
+ if (resource.id === undefined) {
61
+ throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)(`update needs ${resource.resourceType}.id.`));
62
+ }
63
+ return resource.id;
64
+ };
@@ -0,0 +1,17 @@
1
+ import { HttpClient } from "../http/http-client";
2
+ import { RequestOptions } from "../http/transmit";
3
+ export type HealthCheck = {
4
+ ok: boolean;
5
+ dependencies: Record<string, {
6
+ ok: boolean;
7
+ }>;
8
+ version?: string | null;
9
+ buildEnv?: string | null;
10
+ commitHash?: string | null;
11
+ };
12
+ export declare class HealthResource {
13
+ private readonly http;
14
+ constructor(http: HttpClient);
15
+ /** Always answers 200: read `ok`, not the status. */
16
+ check(options?: RequestOptions): Promise<HealthCheck>;
17
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HealthResource = void 0;
4
+ const HEALTHCHECK_PATH = "healthcheck";
5
+ class HealthResource {
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ /** Always answers 200: read `ok`, not the status. */
10
+ check(options) {
11
+ return this.http.get(HEALTHCHECK_PATH, options);
12
+ }
13
+ }
14
+ exports.HealthResource = HealthResource;
@@ -0,0 +1,12 @@
1
+ import type { InviteSent } from "../../../client/invites/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ /** One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`. */
5
+ export declare class InviteFlowResource<Invite, Acceptance, Accepted> {
6
+ private readonly http;
7
+ private readonly path;
8
+ private readonly acceptPath;
9
+ constructor(http: HttpClient, path: string);
10
+ create(body: Invite, options?: RequestOptions): Promise<InviteSent>;
11
+ accept(body: Acceptance, options?: RequestOptions): Promise<Accepted>;
12
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InviteFlowResource = void 0;
4
+ const ACCEPT_SEGMENT = "accept";
5
+ /** One invite kind: `create` sends it to `path`, `accept` redeems it at `path/accept`. */
6
+ class InviteFlowResource {
7
+ constructor(http, path) {
8
+ this.http = http;
9
+ this.path = path;
10
+ this.acceptPath = `${path}/${ACCEPT_SEGMENT}`;
11
+ }
12
+ create(body, options) {
13
+ return this.http.post(this.path, body, options);
14
+ }
15
+ accept(body, options) {
16
+ return this.http.post(this.acceptPath, body, options);
17
+ }
18
+ }
19
+ exports.InviteFlowResource = InviteFlowResource;
@@ -0,0 +1,22 @@
1
+ import type { AcceptInviteBody, AcceptRecordShareBody, InviteBody, RecordShareAccepted, RecordShareBody } from "../../../client/invites/types";
2
+ import type { PatientSharingPractitionerShare } from "../../../client/patient-sharing/types";
3
+ import type { UserSession } from "../../auth/user-session";
4
+ import { HttpClient } from "../../http/http-client";
5
+ import { RequestOptions } from "../../http/transmit";
6
+ import { InviteFlowResource } from "./invite-flow-resource";
7
+ export type RecordShareFlow = InviteFlowResource<RecordShareBody, AcceptRecordShareBody, RecordShareAccepted>;
8
+ export type PersonInviteFlow = InviteFlowResource<InviteBody, AcceptInviteBody, PatientSharingPractitionerShare>;
9
+ export declare class InvitesResource {
10
+ private readonly session;
11
+ /** A patient shares their record with a practitioner, or some codes with a carer. */
12
+ readonly recordShares: RecordShareFlow;
13
+ /** A practitioner invites a patient into their care. */
14
+ readonly care: PersonInviteFlow;
15
+ /** @deprecated Use `recordShares` with `recipient: "practitioner"`; the route sunsets on 2026-12-01. */
16
+ readonly practitioners: PersonInviteFlow;
17
+ /** @deprecated Use `care`; the route sunsets on 2026-12-01. */
18
+ readonly patients: PersonInviteFlow;
19
+ constructor(http: HttpClient, session?: UserSession | null);
20
+ /** Accepts a record share as a practitioner or a care invite as a patient. */
21
+ accept(body: AcceptInviteBody, options?: RequestOptions): Promise<PatientSharingPractitionerShare>;
22
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvitesResource = void 0;
4
+ const ovok_errors_1 = require("../../errors/ovok-errors");
5
+ const invite_flow_resource_1 = require("./invite-flow-resource");
6
+ const INVITES_PATH = "v1/invites";
7
+ class InvitesResource {
8
+ constructor(http, session = null) {
9
+ this.session = session;
10
+ this.recordShares = new invite_flow_resource_1.InviteFlowResource(http, `${INVITES_PATH}/record-share`);
11
+ this.care = new invite_flow_resource_1.InviteFlowResource(http, `${INVITES_PATH}/care`);
12
+ this.practitioners = new invite_flow_resource_1.InviteFlowResource(http, `${INVITES_PATH}/practitioner`);
13
+ this.patients = new invite_flow_resource_1.InviteFlowResource(http, `${INVITES_PATH}/patient`);
14
+ }
15
+ /** Accepts a record share as a practitioner or a care invite as a patient. */
16
+ async accept(body, options) {
17
+ var _a, _b;
18
+ const profileReference = (_b = (await ((_a = this.session) === null || _a === void 0 ? void 0 : _a.current()))) === null || _b === void 0 ? void 0 : _b.profile.reference;
19
+ const profileType = profileReference === null || profileReference === void 0 ? void 0 : profileReference.split("/", 1)[0];
20
+ if (profileType === "Practitioner") {
21
+ return this.recordShares.accept(body, options);
22
+ }
23
+ if (profileType === "Patient") {
24
+ return this.care.accept(body, options);
25
+ }
26
+ throw new ovok_errors_1.OvokConfigError((0, ovok_errors_1.detailsFor)("Accepting an invite requires a signed-in Patient or Practitioner profile."));
27
+ }
28
+ }
29
+ exports.InvitesResource = InvitesResource;
@@ -0,0 +1,10 @@
1
+ import type { OvokI18nDocument, OvokI18nValue } from "../../../client/platform/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class I18nextResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ retrieve(language: string, options?: RequestOptions): Promise<OvokI18nDocument>;
8
+ /** The server queues the write (202), so a read right after may not show it yet. */
9
+ update(language: string, document: Record<string, OvokI18nValue>, options?: RequestOptions): Promise<void>;
10
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I18nextResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const i18nextPath = (language) => `localization/i18next/${(0, url_1.pathSegment)(language)}`;
6
+ class I18nextResource {
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ retrieve(language, options) {
11
+ return this.http.get(i18nextPath(language), options);
12
+ }
13
+ /** The server queues the write (202), so a read right after may not show it yet. */
14
+ update(language, document, options) {
15
+ return this.http.patch(i18nextPath(language), document, options);
16
+ }
17
+ }
18
+ exports.I18nextResource = I18nextResource;
@@ -0,0 +1,9 @@
1
+ import type { OvokLocales } from "../../../client/platform/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class LocalesResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ retrieve(options?: RequestOptions): Promise<OvokLocales>;
8
+ update(locales: OvokLocales, options?: RequestOptions): Promise<OvokLocales>;
9
+ }