@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,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimDevicesResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const ovok_errors_1 = require("../../errors/ovok-errors");
6
+ const url_1 = require("../../http/url");
7
+ const numbered_pages_1 = require("../../paging/numbered-pages");
8
+ const live_reads_1 = require("./live-reads");
9
+ const slim_paths_1 = require("./slim-paths");
10
+ const DEVICES_PATH = `${slim_paths_1.SLIM_PATH}/device`;
11
+ const ASSIGN_TO_PROJECT_PATH = `${DEVICES_PATH}/assign/project`;
12
+ const LIVE_PATH = `${DEVICES_PATH}/live`;
13
+ const LIVE_TELEMETRY_PATH = `${LIVE_PATH}/telemetry`;
14
+ const TELEMETRY_PATH = `${slim_paths_1.SLIM_PATH}/telemetry`;
15
+ const EFFECTIVE_IDS = "effectiveIds";
16
+ const LAST_IDS = "lastIds";
17
+ const MIN_LIVE_COUNT = 1;
18
+ const MAX_LIVE_COUNT = 100;
19
+ const LIVE_COUNT_MESSAGE = `count must be an integer from ${MIN_LIVE_COUNT} to ${MAX_LIVE_COUNT}.`;
20
+ const devicePath = (deviceId) => `${DEVICES_PATH}/${(0, url_1.pathSegment)(deviceId)}`;
21
+ const telemetryPath = (deviceId) => `${TELEMETRY_PATH}/${(0, url_1.pathSegment)(deviceId)}`;
22
+ class SlimDevicesResource {
23
+ constructor(http, session = null) {
24
+ this.http = http;
25
+ this.liveReads = new live_reads_1.LiveReads(http);
26
+ session === null || session === void 0 ? void 0 : session.onChange(() => this.liveReads.clear());
27
+ }
28
+ list(params = {}, options) {
29
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), DEVICES_PATH, params);
30
+ }
31
+ retrieve(deviceId, options) {
32
+ return this.http.get(devicePath(deviceId), options);
33
+ }
34
+ /** 409 when another customer holds the serial; 422 when this project already uses it. */
35
+ create(body, options) {
36
+ return this.http.post(DEVICES_PATH, body, options);
37
+ }
38
+ /** Renaming moves the serial: live values return only after a reading under the new serial. */
39
+ update(deviceId, body, options) {
40
+ return this.http.put(devicePath(deviceId), body, options);
41
+ }
42
+ delete(deviceId, options) {
43
+ return this.http.delete(devicePath(deviceId), options);
44
+ }
45
+ assignToProject(body, options) {
46
+ return this.http.put(ASSIGN_TO_PROJECT_PATH, body, options);
47
+ }
48
+ live(params = {}, options) {
49
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.readLive(path, params, options), LIVE_PATH, params);
50
+ }
51
+ liveTelemetry(params = {}, options) {
52
+ return this.readLive(`${LIVE_TELEMETRY_PATH}${(0, query_string_1.toQueryString)(params)}`, params, options);
53
+ }
54
+ telemetry(deviceId, options) {
55
+ return this.liveReads.get(telemetryPath(deviceId), options);
56
+ }
57
+ effectiveObservationIds(deviceId, options) {
58
+ return this.http.get(`${telemetryPath(deviceId)}/${EFFECTIVE_IDS}`, options);
59
+ }
60
+ effectiveObservationIdsByDevice(options) {
61
+ return this.http.get(`${TELEMETRY_PATH}/${EFFECTIVE_IDS}`, options);
62
+ }
63
+ lastObservationIds(deviceId, options) {
64
+ return this.http.get(`${telemetryPath(deviceId)}/${LAST_IDS}`, options);
65
+ }
66
+ lastObservationIdsByDevice(options) {
67
+ return this.http.get(`${TELEMETRY_PATH}/${LAST_IDS}`, options);
68
+ }
69
+ async readLive(path, params, options) {
70
+ requireLiveCount(params);
71
+ return this.liveReads.get(path, options);
72
+ }
73
+ }
74
+ exports.SlimDevicesResource = SlimDevicesResource;
75
+ const isLiveCount = (count) => count === undefined || (Number.isInteger(count) && count >= MIN_LIVE_COUNT && count <= MAX_LIVE_COUNT);
76
+ const requireLiveCount = ({ count }) => {
77
+ if (isLiveCount(count)) {
78
+ return;
79
+ }
80
+ throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)(LIVE_COUNT_MESSAGE));
81
+ };
@@ -0,0 +1,8 @@
1
+ import type { SlimExportPdf, SlimExportPdfRequest } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimExportsResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ patientPdf(body: SlimExportPdfRequest, options?: RequestOptions): Promise<SlimExportPdf>;
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimExportsResource = void 0;
4
+ const slim_paths_1 = require("./slim-paths");
5
+ const PATIENT_PDF_PATH = `${slim_paths_1.SLIM_PATH}/export/pdf`;
6
+ class SlimExportsResource {
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ patientPdf(body, options) {
11
+ return this.http.post(PATIENT_PDF_PATH, body, options);
12
+ }
13
+ }
14
+ exports.SlimExportsResource = SlimExportsResource;
@@ -0,0 +1,14 @@
1
+ import type { SlimCreateLocation, SlimLocation, SlimLocationQuery, SlimUpdateLocation } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ import { PagePromise } from "../../paging/page";
5
+ export declare class SlimLocationsResource {
6
+ private readonly http;
7
+ constructor(http: HttpClient);
8
+ list(params?: SlimLocationQuery, options?: RequestOptions): PagePromise<SlimLocation>;
9
+ retrieve(locationId: string, options?: RequestOptions): Promise<SlimLocation>;
10
+ create(body: SlimCreateLocation, options?: RequestOptions): Promise<SlimLocation>;
11
+ /** A 422 "Device not found" means the requested device is unreadable and nothing was saved. */
12
+ update(locationId: string, body: SlimUpdateLocation, options?: RequestOptions): Promise<SlimLocation>;
13
+ delete(locationId: string, options?: RequestOptions): Promise<void>;
14
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimLocationsResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const numbered_pages_1 = require("../../paging/numbered-pages");
6
+ const slim_paths_1 = require("./slim-paths");
7
+ const LOCATIONS_PATH = `${slim_paths_1.SLIM_PATH}/location`;
8
+ const locationPath = (locationId) => `${LOCATIONS_PATH}/${(0, url_1.pathSegment)(locationId)}`;
9
+ class SlimLocationsResource {
10
+ constructor(http) {
11
+ this.http = http;
12
+ }
13
+ list(params = {}, options) {
14
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), LOCATIONS_PATH, params);
15
+ }
16
+ retrieve(locationId, options) {
17
+ return this.http.get(locationPath(locationId), options);
18
+ }
19
+ create(body, options) {
20
+ return this.http.post(LOCATIONS_PATH, body, options);
21
+ }
22
+ /** A 422 "Device not found" means the requested device is unreadable and nothing was saved. */
23
+ update(locationId, body, options) {
24
+ return this.http.put(locationPath(locationId), body, options);
25
+ }
26
+ delete(locationId, options) {
27
+ return this.http.delete(locationPath(locationId), options);
28
+ }
29
+ }
30
+ exports.SlimLocationsResource = SlimLocationsResource;
@@ -0,0 +1,18 @@
1
+ import type { SlimMedicalNotificationDetail, SlimMedicalNotificationRow, SlimMedicalNotificationsQuery } from "../../../client/notifications/types";
2
+ import type { SlimRecentNotificationsResponse } from "../../../client/slim/types";
3
+ import { HttpClient } from "../../http/http-client";
4
+ import { RequestOptions } from "../../http/transmit";
5
+ import { PagePromise } from "../../paging/page";
6
+ import { SlimRecentQuery } from "./slim-queries";
7
+ export declare class SlimMedicalNotificationsResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /** `params.cursor` is where the first page starts. */
11
+ list(params?: SlimMedicalNotificationsQuery, options?: RequestOptions): PagePromise<SlimMedicalNotificationRow>;
12
+ /** During a Signals outage this may answer the last good page from up to 10 minutes ago. */
13
+ recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentNotificationsResponse>;
14
+ retrieve(episodeId: string, options?: RequestOptions): Promise<SlimMedicalNotificationDetail>;
15
+ /** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
16
+ acknowledge(episodeId: string, options?: RequestOptions): Promise<SlimMedicalNotificationRow>;
17
+ private page;
18
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimMedicalNotificationsResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const ovok_errors_1 = require("../../errors/ovok-errors");
6
+ const url_1 = require("../../http/url");
7
+ const cursor_pages_1 = require("../../paging/cursor-pages");
8
+ const slim_paths_1 = require("./slim-paths");
9
+ const MEDICAL_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/medical`;
10
+ const RECENT_MEDICAL_PATH = `${slim_paths_1.RECENT_NOTIFICATIONS_PATH}/medical`;
11
+ const MEDICAL_CODE = /^(?:\d{1,7}-\d|PI)$/;
12
+ const MAX_MEDICAL_CODES = 32;
13
+ const MEDICAL_CODES_MESSAGE = `codes must contain at most ${MAX_MEDICAL_CODES} valid LOINC codes or PI.`;
14
+ const episodePath = (episodeId) => `${MEDICAL_PATH}/${(0, url_1.pathSegment)(episodeId)}`;
15
+ class SlimMedicalNotificationsResource {
16
+ constructor(http) {
17
+ this.http = http;
18
+ }
19
+ /** `params.cursor` is where the first page starts. */
20
+ list(params = {}, options) {
21
+ return (0, cursor_pages_1.cursorPages)((cursor) => this.page({ ...params, cursor: cursor !== null && cursor !== void 0 ? cursor : params.cursor }, options));
22
+ }
23
+ /** During a Signals outage this may answer the last good page from up to 10 minutes ago. */
24
+ recent(params = {}, options) {
25
+ return this.http.get(`${RECENT_MEDICAL_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
26
+ }
27
+ retrieve(episodeId, options) {
28
+ return this.http.get(episodePath(episodeId), options);
29
+ }
30
+ /** Can take about 12 s; the server makes it safe to repeat, so a 503 is retried. */
31
+ acknowledge(episodeId, options) {
32
+ return this.http.send({ method: "POST", path: `${episodePath(episodeId)}/ack`, idempotent: true }, options);
33
+ }
34
+ async page(params, options) {
35
+ requireMedicalCodes(params);
36
+ return this.http.get(`${MEDICAL_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
37
+ }
38
+ }
39
+ exports.SlimMedicalNotificationsResource = SlimMedicalNotificationsResource;
40
+ const isMedicalCodeList = (codes) => codes.length > 0 && codes.length <= MAX_MEDICAL_CODES && codes.every((code) => MEDICAL_CODE.test(code));
41
+ const requireMedicalCodes = ({ codes }) => {
42
+ if (codes === undefined || isMedicalCodeList(codes)) {
43
+ return;
44
+ }
45
+ throw new ovok_errors_1.OvokValidationError((0, ovok_errors_1.detailsFor)(MEDICAL_CODES_MESSAGE));
46
+ };
@@ -0,0 +1,12 @@
1
+ import type { CreateNotificationNote, NotificationNote, NotificationNotes, NotificationTargetKind, UpdateNotificationNote } from "../../../client/notifications/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimNotificationNotesResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ list(kind: NotificationTargetKind, targetId: string, options?: RequestOptions): Promise<NotificationNotes>;
8
+ create(body: CreateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
9
+ update(noteId: string, body: UpdateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
10
+ patch(noteId: string, body: UpdateNotificationNote, options?: RequestOptions): Promise<NotificationNote>;
11
+ delete(noteId: string, options?: RequestOptions): Promise<void>;
12
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimNotificationNotesResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const slim_paths_1 = require("./slim-paths");
6
+ const NOTES_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/notes`;
7
+ const TARGET_SEGMENT = {
8
+ oob: "oob",
9
+ alarm: "alarms",
10
+ medical: "medical",
11
+ alert: "raw-alerts",
12
+ };
13
+ const notePath = (noteId) => `${NOTES_PATH}/${(0, url_1.pathSegment)(noteId)}`;
14
+ class SlimNotificationNotesResource {
15
+ constructor(http) {
16
+ this.http = http;
17
+ }
18
+ list(kind, targetId, options) {
19
+ return this.http.get(`${slim_paths_1.NOTIFICATIONS_PATH}/${TARGET_SEGMENT[kind]}/${(0, url_1.pathSegment)(targetId)}/notes`, options);
20
+ }
21
+ create(body, options) {
22
+ return this.http.post(NOTES_PATH, body, options);
23
+ }
24
+ update(noteId, body, options) {
25
+ return this.http.put(notePath(noteId), body, options);
26
+ }
27
+ patch(noteId, body, options) {
28
+ return this.http.patch(notePath(noteId), body, options);
29
+ }
30
+ delete(noteId, options) {
31
+ return this.http.delete(notePath(noteId), options);
32
+ }
33
+ }
34
+ exports.SlimNotificationNotesResource = SlimNotificationNotesResource;
@@ -0,0 +1,19 @@
1
+ import type { SlimNotificationsQuery, SlimNotificationsResponse, SlimRecentNotificationsResponse } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ import { SlimAlarmsResource } from "./slim-alarms-resource";
5
+ import { SlimMedicalNotificationsResource } from "./slim-medical-notifications-resource";
6
+ import { SlimNotificationNotesResource } from "./slim-notification-notes-resource";
7
+ import { SlimOutOfBedResource } from "./slim-out-of-bed-resource";
8
+ import { SlimRecentQuery } from "./slim-queries";
9
+ export declare class SlimNotificationsResource {
10
+ private readonly http;
11
+ readonly alarms: SlimAlarmsResource;
12
+ readonly outOfBed: SlimOutOfBedResource;
13
+ readonly medical: SlimMedicalNotificationsResource;
14
+ readonly notes: SlimNotificationNotesResource;
15
+ constructor(http: HttpClient);
16
+ /** @deprecated Use outOfBed.list, alarms.list or medical.list. */
17
+ list(params?: SlimNotificationsQuery, options?: RequestOptions): Promise<SlimNotificationsResponse>;
18
+ recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentNotificationsResponse>;
19
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimNotificationsResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const slim_alarms_resource_1 = require("./slim-alarms-resource");
6
+ const slim_medical_notifications_resource_1 = require("./slim-medical-notifications-resource");
7
+ const slim_notification_notes_resource_1 = require("./slim-notification-notes-resource");
8
+ const slim_out_of_bed_resource_1 = require("./slim-out-of-bed-resource");
9
+ const slim_paths_1 = require("./slim-paths");
10
+ class SlimNotificationsResource {
11
+ constructor(http) {
12
+ this.http = http;
13
+ this.alarms = new slim_alarms_resource_1.SlimAlarmsResource(http);
14
+ this.outOfBed = new slim_out_of_bed_resource_1.SlimOutOfBedResource(http);
15
+ this.medical = new slim_medical_notifications_resource_1.SlimMedicalNotificationsResource(http);
16
+ this.notes = new slim_notification_notes_resource_1.SlimNotificationNotesResource(http);
17
+ }
18
+ /** @deprecated Use outOfBed.list, alarms.list or medical.list. */
19
+ list(params = {}, options) {
20
+ return this.http.get(`${slim_paths_1.NOTIFICATIONS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
21
+ }
22
+ recent(params = {}, options) {
23
+ return this.http.get(`${slim_paths_1.RECENT_NOTIFICATIONS_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
24
+ }
25
+ }
26
+ exports.SlimNotificationsResource = SlimNotificationsResource;
@@ -0,0 +1,11 @@
1
+ import type { SlimOrganization, SlimOrganizationInput } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimOrganizationsResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ retrieve(organizationId: string, options?: RequestOptions): Promise<SlimOrganization>;
8
+ create(body: SlimOrganizationInput, options?: RequestOptions): Promise<SlimOrganization>;
9
+ update(organizationId: string, body: SlimOrganizationInput, options?: RequestOptions): Promise<SlimOrganization>;
10
+ delete(organizationId: string, options?: RequestOptions): Promise<void>;
11
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimOrganizationsResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const slim_paths_1 = require("./slim-paths");
6
+ const ORGANIZATIONS_PATH = `${slim_paths_1.SLIM_PATH}/organization`;
7
+ const organizationPath = (organizationId) => `${ORGANIZATIONS_PATH}/${(0, url_1.pathSegment)(organizationId)}`;
8
+ class SlimOrganizationsResource {
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ retrieve(organizationId, options) {
13
+ return this.http.get(organizationPath(organizationId), options);
14
+ }
15
+ create(body, options) {
16
+ return this.http.post(ORGANIZATIONS_PATH, body, options);
17
+ }
18
+ update(organizationId, body, options) {
19
+ return this.http.put(organizationPath(organizationId), body, options);
20
+ }
21
+ delete(organizationId, options) {
22
+ return this.http.delete(organizationPath(organizationId), options);
23
+ }
24
+ }
25
+ exports.SlimOrganizationsResource = SlimOrganizationsResource;
@@ -0,0 +1,13 @@
1
+ import type { SlimRecentOutOfBed } from "../../../client/notifications/types";
2
+ import type { SlimNotificationsQuery, SlimNotificationsResponse } from "../../../client/slim/types";
3
+ import { HttpClient } from "../../http/http-client";
4
+ import { RequestOptions } from "../../http/transmit";
5
+ import { SlimRecentQuery } from "./slim-queries";
6
+ export type SlimOutOfBedQuery = Omit<SlimNotificationsQuery, "type">;
7
+ export declare class SlimOutOfBedResource {
8
+ private readonly http;
9
+ constructor(http: HttpClient);
10
+ /** Omitting status lists new and reviewed rows. */
11
+ list(params?: SlimOutOfBedQuery, options?: RequestOptions): Promise<SlimNotificationsResponse>;
12
+ recent(params?: SlimRecentQuery, options?: RequestOptions): Promise<SlimRecentOutOfBed>;
13
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimOutOfBedResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const slim_paths_1 = require("./slim-paths");
6
+ const OUT_OF_BED_PATH = `${slim_paths_1.NOTIFICATIONS_PATH}/oob`;
7
+ const RECENT_OUT_OF_BED_PATH = `${slim_paths_1.RECENT_NOTIFICATIONS_PATH}/oob`;
8
+ class SlimOutOfBedResource {
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ /** Omitting status lists new and reviewed rows. */
13
+ list(params = {}, options) {
14
+ return this.http.get(`${OUT_OF_BED_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
15
+ }
16
+ recent(params = {}, options) {
17
+ return this.http.get(`${RECENT_OUT_OF_BED_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
18
+ }
19
+ }
20
+ exports.SlimOutOfBedResource = SlimOutOfBedResource;
@@ -0,0 +1,6 @@
1
+ export declare const SLIM_PATH = "v1/slim";
2
+ export declare const SLIM_V2_PATH = "v2/slim";
3
+ export declare const NOTIFICATIONS_PATH = "v1/slim/notifications";
4
+ export declare const RECENT_NOTIFICATIONS_PATH = "v1/slim/notifications/recent";
5
+ export declare const THRESHOLD_V2_PATH = "v2/slim/threshold";
6
+ export declare const PROJECT_PATH = "v1/slim/project";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROJECT_PATH = exports.THRESHOLD_V2_PATH = exports.RECENT_NOTIFICATIONS_PATH = exports.NOTIFICATIONS_PATH = exports.SLIM_V2_PATH = exports.SLIM_PATH = void 0;
4
+ exports.SLIM_PATH = "v1/slim";
5
+ exports.SLIM_V2_PATH = "v2/slim";
6
+ exports.NOTIFICATIONS_PATH = `${exports.SLIM_PATH}/notifications`;
7
+ exports.RECENT_NOTIFICATIONS_PATH = `${exports.NOTIFICATIONS_PATH}/recent`;
8
+ exports.THRESHOLD_V2_PATH = `${exports.SLIM_V2_PATH}/threshold`;
9
+ exports.PROJECT_PATH = `${exports.SLIM_PATH}/project`;
@@ -0,0 +1,10 @@
1
+ import type { SlimPatientThresholdV2, SlimThresholdV2Update } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimPatientThresholdsResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ retrieve(patientId: string, options?: RequestOptions): Promise<SlimPatientThresholdV2>;
8
+ /** Never retried: a 409 means another save for this resident is running and nothing changed. */
9
+ update(patientId: string, body: SlimThresholdV2Update, options?: RequestOptions): Promise<SlimPatientThresholdV2>;
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimPatientThresholdsResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const slim_paths_1 = require("./slim-paths");
6
+ const PATIENT_THRESHOLDS_PATH = `${slim_paths_1.THRESHOLD_V2_PATH}/patient`;
7
+ const patientThresholdPath = (patientId) => `${PATIENT_THRESHOLDS_PATH}/${(0, url_1.pathSegment)(patientId)}`;
8
+ class SlimPatientThresholdsResource {
9
+ constructor(http) {
10
+ this.http = http;
11
+ }
12
+ retrieve(patientId, options) {
13
+ return this.http.get(patientThresholdPath(patientId), options);
14
+ }
15
+ /** Never retried: a 409 means another save for this resident is running and nothing changed. */
16
+ update(patientId, body, options) {
17
+ return this.http.send({ method: "PUT", path: patientThresholdPath(patientId), body, idempotent: false }, options);
18
+ }
19
+ }
20
+ exports.SlimPatientThresholdsResource = SlimPatientThresholdsResource;
@@ -0,0 +1,20 @@
1
+ import type { SlimCreatePatient, SlimPatient, SlimPatientListItem, SlimPatientListQuery, SlimUpdatePatient } from "../../../client/slim/types";
2
+ import type { Bundle, Resource } from "@medplum/fhirtypes";
3
+ import { HttpClient } from "../../http/http-client";
4
+ import { RequestOptions } from "../../http/transmit";
5
+ import { PagePromise } from "../../paging/page";
6
+ import { SlimPatientThresholdsResource } from "./slim-patient-thresholds-resource";
7
+ export declare class SlimPatientsResource {
8
+ private readonly http;
9
+ readonly thresholds: SlimPatientThresholdsResource;
10
+ constructor(http: HttpClient);
11
+ list(params?: SlimPatientListQuery, options?: RequestOptions): PagePromise<SlimPatientListItem>;
12
+ retrieve(patientId: string, options?: RequestOptions): Promise<SlimPatient>;
13
+ create(body: SlimCreatePatient, options?: RequestOptions): Promise<SlimPatient>;
14
+ /** Replaces the editable fields: omitting locationId unassigns the resident's devices. */
15
+ update(patientId: string, body: SlimUpdatePatient, options?: RequestOptions): Promise<SlimPatient>;
16
+ /** 409 while the resident has a device: unassign it first with an update that omits locationId. */
17
+ delete(patientId: string, options?: RequestOptions): Promise<void>;
18
+ everything(patientId: string, options?: RequestOptions): Promise<Bundle<Resource>>;
19
+ currentVitals(patientId: string, options?: RequestOptions): Promise<Record<string, unknown>>;
20
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimPatientsResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const numbered_pages_1 = require("../../paging/numbered-pages");
6
+ const slim_paths_1 = require("./slim-paths");
7
+ const slim_patient_thresholds_resource_1 = require("./slim-patient-thresholds-resource");
8
+ const PATIENTS_PATH = `${slim_paths_1.SLIM_PATH}/patient`;
9
+ const patientPath = (patientId) => `${PATIENTS_PATH}/${(0, url_1.pathSegment)(patientId)}`;
10
+ class SlimPatientsResource {
11
+ constructor(http) {
12
+ this.http = http;
13
+ this.thresholds = new slim_patient_thresholds_resource_1.SlimPatientThresholdsResource(http);
14
+ }
15
+ list(params = {}, options) {
16
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), PATIENTS_PATH, params);
17
+ }
18
+ retrieve(patientId, options) {
19
+ return this.http.get(patientPath(patientId), options);
20
+ }
21
+ create(body, options) {
22
+ return this.http.post(PATIENTS_PATH, body, options);
23
+ }
24
+ /** Replaces the editable fields: omitting locationId unassigns the resident's devices. */
25
+ update(patientId, body, options) {
26
+ return this.http.put(patientPath(patientId), body, options);
27
+ }
28
+ /** 409 while the resident has a device: unassign it first with an update that omits locationId. */
29
+ delete(patientId, options) {
30
+ return this.http.delete(patientPath(patientId), options);
31
+ }
32
+ everything(patientId, options) {
33
+ return this.http.get(`${patientPath(patientId)}/$everything`, options);
34
+ }
35
+ currentVitals(patientId, options) {
36
+ return this.http.get(`${patientPath(patientId)}/current-vitals`, options);
37
+ }
38
+ }
39
+ exports.SlimPatientsResource = SlimPatientsResource;
@@ -0,0 +1,12 @@
1
+ import type { SlimCreatePolicy, SlimPolicyList, SlimPolicyListQuery, SlimPolicyResponse, SlimUpdatePolicy } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimPoliciesResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ list(params?: SlimPolicyListQuery, options?: RequestOptions): Promise<SlimPolicyList>;
8
+ retrieve(policyId: string, options?: RequestOptions): Promise<SlimPolicyResponse>;
9
+ create(body: SlimCreatePolicy, options?: RequestOptions): Promise<SlimPolicyResponse>;
10
+ update(policyId: string, body: SlimUpdatePolicy, options?: RequestOptions): Promise<SlimPolicyResponse>;
11
+ delete(policyId: string, options?: RequestOptions): Promise<void>;
12
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimPoliciesResource = void 0;
4
+ const query_string_1 = require("../../../client/query-string");
5
+ const url_1 = require("../../http/url");
6
+ const slim_paths_1 = require("./slim-paths");
7
+ const POLICIES_PATH = `${slim_paths_1.SLIM_PATH}/policy`;
8
+ const policyPath = (policyId) => `${POLICIES_PATH}/${(0, url_1.pathSegment)(policyId)}`;
9
+ class SlimPoliciesResource {
10
+ constructor(http) {
11
+ this.http = http;
12
+ }
13
+ list(params = {}, options) {
14
+ return this.http.get(`${POLICIES_PATH}${(0, query_string_1.toQueryString)(params)}`, options);
15
+ }
16
+ retrieve(policyId, options) {
17
+ return this.http.get(policyPath(policyId), options);
18
+ }
19
+ create(body, options) {
20
+ return this.http.post(POLICIES_PATH, body, options);
21
+ }
22
+ update(policyId, body, options) {
23
+ return this.http.put(policyPath(policyId), body, options);
24
+ }
25
+ delete(policyId, options) {
26
+ return this.http.delete(policyPath(policyId), options);
27
+ }
28
+ }
29
+ exports.SlimPoliciesResource = SlimPoliciesResource;
@@ -0,0 +1,8 @@
1
+ import type { SlimPractitionerInviteInput, SlimPractitionerInviteResponse } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ export declare class SlimPractitionersResource {
5
+ private readonly http;
6
+ constructor(http: HttpClient);
7
+ invite(body: SlimPractitionerInviteInput, options?: RequestOptions): Promise<SlimPractitionerInviteResponse>;
8
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimPractitionersResource = void 0;
4
+ const slim_paths_1 = require("./slim-paths");
5
+ const INVITE_PRACTITIONER_PATH = `${slim_paths_1.SLIM_PATH}/invite/practitioner`;
6
+ class SlimPractitionersResource {
7
+ constructor(http) {
8
+ this.http = http;
9
+ }
10
+ invite(body, options) {
11
+ return this.http.post(INVITE_PRACTITIONER_PATH, body, options);
12
+ }
13
+ }
14
+ exports.SlimPractitionersResource = SlimPractitionersResource;
@@ -0,0 +1,16 @@
1
+ import type { SlimChildProjectInput, SlimProject, SlimProjectDeviceCounts, SlimProjectPatientCounts, SlimProjectUser, SlimProjectUsersQuery } from "../../../client/slim/types";
2
+ import { HttpClient } from "../../http/http-client";
3
+ import { RequestOptions } from "../../http/transmit";
4
+ import { PagePromise } from "../../paging/page";
5
+ import { SlimChildProjectsResource } from "./slim-child-projects-resource";
6
+ export declare class SlimProjectsResource {
7
+ private readonly http;
8
+ readonly children: SlimChildProjectsResource;
9
+ constructor(http: HttpClient);
10
+ retrieve(projectId: string, options?: RequestOptions): Promise<SlimProject>;
11
+ update(projectId: string, body: SlimChildProjectInput, options?: RequestOptions): Promise<SlimProject>;
12
+ users(projectId: string, params?: SlimProjectUsersQuery, options?: RequestOptions): PagePromise<SlimProjectUser>;
13
+ currentUsers(params?: SlimProjectUsersQuery, options?: RequestOptions): PagePromise<SlimProjectUser>;
14
+ deviceCounts(projectId: string, options?: RequestOptions): Promise<SlimProjectDeviceCounts>;
15
+ patientCounts(projectId: string, options?: RequestOptions): Promise<SlimProjectPatientCounts>;
16
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlimProjectsResource = void 0;
4
+ const url_1 = require("../../http/url");
5
+ const numbered_pages_1 = require("../../paging/numbered-pages");
6
+ const slim_child_projects_resource_1 = require("./slim-child-projects-resource");
7
+ const slim_paths_1 = require("./slim-paths");
8
+ const USERS = "users";
9
+ const CURRENT_USERS_PATH = `${slim_paths_1.PROJECT_PATH}/${USERS}`;
10
+ const projectPath = (projectId) => `${slim_paths_1.PROJECT_PATH}/${(0, url_1.pathSegment)(projectId)}`;
11
+ class SlimProjectsResource {
12
+ constructor(http) {
13
+ this.http = http;
14
+ this.children = new slim_child_projects_resource_1.SlimChildProjectsResource(http);
15
+ }
16
+ retrieve(projectId, options) {
17
+ return this.http.get(projectPath(projectId), options);
18
+ }
19
+ update(projectId, body, options) {
20
+ return this.http.put(projectPath(projectId), body, options);
21
+ }
22
+ users(projectId, params = {}, options) {
23
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), `${projectPath(projectId)}/${USERS}`, params);
24
+ }
25
+ currentUsers(params = {}, options) {
26
+ return (0, numbered_pages_1.numberedRoutePages)((path) => this.http.get(path, options), CURRENT_USERS_PATH, params);
27
+ }
28
+ deviceCounts(projectId, options) {
29
+ return this.http.get(`${projectPath(projectId)}/device-counts`, options);
30
+ }
31
+ patientCounts(projectId, options) {
32
+ return this.http.get(`${projectPath(projectId)}/patient-counts`, options);
33
+ }
34
+ }
35
+ exports.SlimProjectsResource = SlimProjectsResource;