@ovok/core 0.4.6 → 0.4.8

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.
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ "use client";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.useReleaseNotes = exports.useLegalPage = exports.useCmsDocuments = exports.useCmsDocument = void 0;
38
+ const React = __importStar(require("react"));
39
+ const cms_1 = require("../client/cms");
40
+ const api_hooks_1 = require("./api-hooks");
41
+ const index_1 = require("./index");
42
+ /**
43
+ * A published CMS document by slug, in `options.locale` or else the runtime's
44
+ * language. Waits while `slug` is empty; a new CMS locale reads it again.
45
+ */
46
+ const useCmsDocument = (collection, slug, options = {}) => {
47
+ const client = (0, index_1.useClient)();
48
+ const { tenantCode, environment } = options;
49
+ const locale = React.useMemo(() => (0, cms_1.toCmsLocale)(options.locale || (0, cms_1.defaultCmsLocale)()), [options.locale]);
50
+ const load = React.useCallback(() => client.getCmsDocument(collection, slug, { locale, tenantCode, environment }), [client, collection, slug, locale, tenantCode, environment]);
51
+ return (0, api_hooks_1.useOvokRequest)(load, Boolean(slug));
52
+ };
53
+ exports.useCmsDocument = useCmsDocument;
54
+ /** A page of a CMS collection, in `options.locale` or else the runtime's language. */
55
+ const useCmsDocuments = (collection, options = {}) => {
56
+ const client = (0, index_1.useClient)();
57
+ const { tenantCode, environment, page, limit, sort } = options;
58
+ const locale = React.useMemo(() => (0, cms_1.toCmsLocale)(options.locale || (0, cms_1.defaultCmsLocale)()), [options.locale]);
59
+ const load = React.useCallback(() => client.listCmsDocuments(collection, { locale, tenantCode, environment, page, limit, sort }), [client, collection, locale, tenantCode, environment, page, limit, sort]);
60
+ return (0, api_hooks_1.useOvokRequest)(load);
61
+ };
62
+ exports.useCmsDocuments = useCmsDocuments;
63
+ /** A legal page by slug; with `tenantCode`, readable before sign-in. */
64
+ const useLegalPage = (slug, options = {}) => (0, exports.useCmsDocument)("legal-pages", slug, options);
65
+ exports.useLegalPage = useLegalPage;
66
+ /** Release notes, newest first unless `sort` says otherwise. Needs a session. */
67
+ const useReleaseNotes = (options = {}) => { var _a; return (0, exports.useCmsDocuments)("release-notes", { ...options, sort: (_a = options.sort) !== null && _a !== void 0 ? _a : "-publishedAt" }); };
68
+ exports.useReleaseNotes = useReleaseNotes;
@@ -6,10 +6,12 @@ export declare const OvokProvider: (props: React.PropsWithChildren<{
6
6
  client: OvokClient;
7
7
  }>) => React.JSX.Element;
8
8
  export { observationsToMeasurements, useEcgRecording, useObservations, useSaveMeasurement, useUrineTests, } from "./observation-hooks";
9
- export { useAdministeredProjects, useCarehubDeviceTelemetry, useCarehubDevices, useCarehubNotifications, useCarehubPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentCarehubNotifications, } from "./api-hooks";
9
+ export { useAdministeredProjects, useSlimDeviceTelemetry, useSlimDevices, useSlimNotifications, useSlimPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentSlimNotifications, } from "./api-hooks";
10
+ export type { OvokMutationState, OvokRequestState } from "./api-hooks";
10
11
  export { useConsentSignature, useContent, useCreateVideoCallAppointment, useCreateVideoCallUserAccess, useDocuments, useVideoCallAccess, useVideoCallAppointments, } from "./experience-hooks";
11
12
  export { useI18nextDocument, useLocales, useLocalizations, useUpdateI18nextDocument, useUpdateLocalization, useUpdateProjectTextSetting, } from "./platform-hooks";
12
13
  export { useEmailTemplates } from "./email-hooks";
14
+ export { useCmsDocument, useCmsDocuments, useLegalPage, useReleaseNotes, } from "./cms-hooks";
13
15
  export { useAcceptInvite, useInvitePatient, useInvitePractitioner, } from "./invites-hooks";
14
16
  export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientDashboard, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
15
17
  export { useCreatePatientSharingInvite, usePatientSharing, usePatientSharingSettings, useRedeemPatientSharingInvite, useRevokePatientSharing, useUpdatePatientSharingSettings, } from "./patient-sharing-hooks";
@@ -34,8 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useInvitePractitioner = exports.useInvitePatient = exports.useAcceptInvite = exports.useEmailTemplates = exports.useUpdateProjectTextSetting = exports.useUpdateLocalization = exports.useUpdateI18nextDocument = exports.useLocalizations = exports.useLocales = exports.useI18nextDocument = exports.useVideoCallAppointments = exports.useVideoCallAccess = exports.useDocuments = exports.useCreateVideoCallUserAccess = exports.useCreateVideoCallAppointment = exports.useContent = exports.useConsentSignature = exports.useRecentCarehubNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useCarehubPatients = exports.useCarehubNotifications = exports.useCarehubDevices = exports.useCarehubDeviceTelemetry = exports.useAdministeredProjects = exports.useUrineTests = exports.useSaveMeasurement = exports.useObservations = exports.useEcgRecording = exports.observationsToMeasurements = exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
38
- exports.useUpdateSignalsSettings = exports.useSignalsThresholds = exports.useSignalsSettings = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useSetSignalsThreshold = exports.useRemoveSignalsThreshold = exports.useEnableSignalsForPatient = exports.useAcknowledgeSignalsAlert = exports.useUpdatePatientSharingSettings = exports.useRevokePatientSharing = exports.useRedeemPatientSharingInvite = exports.usePatientSharingSettings = exports.usePatientSharing = exports.useCreatePatientSharingInvite = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.usePatientMeasurementHistory = exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = void 0;
37
+ exports.useInvitePatient = exports.useAcceptInvite = exports.useReleaseNotes = exports.useLegalPage = exports.useCmsDocuments = exports.useCmsDocument = exports.useEmailTemplates = exports.useUpdateProjectTextSetting = exports.useUpdateLocalization = exports.useUpdateI18nextDocument = exports.useLocalizations = exports.useLocales = exports.useI18nextDocument = exports.useVideoCallAppointments = exports.useVideoCallAccess = exports.useDocuments = exports.useCreateVideoCallUserAccess = exports.useCreateVideoCallAppointment = exports.useContent = exports.useConsentSignature = exports.useRecentSlimNotifications = exports.usePublicApiEndpoints = exports.useProjectSettings = exports.useProjectFeatures = exports.useOvokRequest = exports.useOvokMutation = exports.useCapabilityStatement = exports.useSlimPatients = exports.useSlimNotifications = exports.useSlimDevices = exports.useSlimDeviceTelemetry = exports.useAdministeredProjects = exports.useUrineTests = exports.useSaveMeasurement = exports.useObservations = exports.useEcgRecording = exports.observationsToMeasurements = exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
38
+ exports.useUpdateSignalsSettings = exports.useSignalsThresholds = exports.useSignalsSettings = exports.useSignalsAlerts = exports.useSignalsAlert = exports.useSetSignalsThreshold = exports.useRemoveSignalsThreshold = exports.useEnableSignalsForPatient = exports.useAcknowledgeSignalsAlert = exports.useUpdatePatientSharingSettings = exports.useRevokePatientSharing = exports.useRedeemPatientSharingInvite = exports.usePatientSharingSettings = exports.usePatientSharing = exports.useCreatePatientSharingInvite = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientDashboard = exports.usePatientMeasurementHistory = exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = exports.useInvitePractitioner = void 0;
39
39
  /*
40
40
  * The only React-dependent module in the package.
41
41
  *
@@ -79,17 +79,17 @@ Object.defineProperty(exports, "useSaveMeasurement", { enumerable: true, get: fu
79
79
  Object.defineProperty(exports, "useUrineTests", { enumerable: true, get: function () { return observation_hooks_1.useUrineTests; } });
80
80
  var api_hooks_1 = require("./api-hooks");
81
81
  Object.defineProperty(exports, "useAdministeredProjects", { enumerable: true, get: function () { return api_hooks_1.useAdministeredProjects; } });
82
- Object.defineProperty(exports, "useCarehubDeviceTelemetry", { enumerable: true, get: function () { return api_hooks_1.useCarehubDeviceTelemetry; } });
83
- Object.defineProperty(exports, "useCarehubDevices", { enumerable: true, get: function () { return api_hooks_1.useCarehubDevices; } });
84
- Object.defineProperty(exports, "useCarehubNotifications", { enumerable: true, get: function () { return api_hooks_1.useCarehubNotifications; } });
85
- Object.defineProperty(exports, "useCarehubPatients", { enumerable: true, get: function () { return api_hooks_1.useCarehubPatients; } });
82
+ Object.defineProperty(exports, "useSlimDeviceTelemetry", { enumerable: true, get: function () { return api_hooks_1.useSlimDeviceTelemetry; } });
83
+ Object.defineProperty(exports, "useSlimDevices", { enumerable: true, get: function () { return api_hooks_1.useSlimDevices; } });
84
+ Object.defineProperty(exports, "useSlimNotifications", { enumerable: true, get: function () { return api_hooks_1.useSlimNotifications; } });
85
+ Object.defineProperty(exports, "useSlimPatients", { enumerable: true, get: function () { return api_hooks_1.useSlimPatients; } });
86
86
  Object.defineProperty(exports, "useCapabilityStatement", { enumerable: true, get: function () { return api_hooks_1.useCapabilityStatement; } });
87
87
  Object.defineProperty(exports, "useOvokMutation", { enumerable: true, get: function () { return api_hooks_1.useOvokMutation; } });
88
88
  Object.defineProperty(exports, "useOvokRequest", { enumerable: true, get: function () { return api_hooks_1.useOvokRequest; } });
89
89
  Object.defineProperty(exports, "useProjectFeatures", { enumerable: true, get: function () { return api_hooks_1.useProjectFeatures; } });
90
90
  Object.defineProperty(exports, "useProjectSettings", { enumerable: true, get: function () { return api_hooks_1.useProjectSettings; } });
91
91
  Object.defineProperty(exports, "usePublicApiEndpoints", { enumerable: true, get: function () { return api_hooks_1.usePublicApiEndpoints; } });
92
- Object.defineProperty(exports, "useRecentCarehubNotifications", { enumerable: true, get: function () { return api_hooks_1.useRecentCarehubNotifications; } });
92
+ Object.defineProperty(exports, "useRecentSlimNotifications", { enumerable: true, get: function () { return api_hooks_1.useRecentSlimNotifications; } });
93
93
  var experience_hooks_1 = require("./experience-hooks");
94
94
  Object.defineProperty(exports, "useConsentSignature", { enumerable: true, get: function () { return experience_hooks_1.useConsentSignature; } });
95
95
  Object.defineProperty(exports, "useContent", { enumerable: true, get: function () { return experience_hooks_1.useContent; } });
@@ -107,6 +107,11 @@ Object.defineProperty(exports, "useUpdateLocalization", { enumerable: true, get:
107
107
  Object.defineProperty(exports, "useUpdateProjectTextSetting", { enumerable: true, get: function () { return platform_hooks_1.useUpdateProjectTextSetting; } });
108
108
  var email_hooks_1 = require("./email-hooks");
109
109
  Object.defineProperty(exports, "useEmailTemplates", { enumerable: true, get: function () { return email_hooks_1.useEmailTemplates; } });
110
+ var cms_hooks_1 = require("./cms-hooks");
111
+ Object.defineProperty(exports, "useCmsDocument", { enumerable: true, get: function () { return cms_hooks_1.useCmsDocument; } });
112
+ Object.defineProperty(exports, "useCmsDocuments", { enumerable: true, get: function () { return cms_hooks_1.useCmsDocuments; } });
113
+ Object.defineProperty(exports, "useLegalPage", { enumerable: true, get: function () { return cms_hooks_1.useLegalPage; } });
114
+ Object.defineProperty(exports, "useReleaseNotes", { enumerable: true, get: function () { return cms_hooks_1.useReleaseNotes; } });
110
115
  var invites_hooks_1 = require("./invites-hooks");
111
116
  Object.defineProperty(exports, "useAcceptInvite", { enumerable: true, get: function () { return invites_hooks_1.useAcceptInvite; } });
112
117
  Object.defineProperty(exports, "useInvitePatient", { enumerable: true, get: function () { return invites_hooks_1.useInvitePatient; } });
package/dist/index.d.ts CHANGED
@@ -924,6 +924,7 @@ declare const Medplum: {
924
924
  export { Medplum };
925
925
  export { OvokClient } from "./client/ovok-client";
926
926
  export * from "./client/errors/rate-limit-error";
927
+ export * from "./client/errors/sign-in-required-error";
927
928
  export * from "./client/errors/ovok-error";
928
929
  export * from "./client/auth/errors";
929
930
  export type { RegisterBody } from "./client/auth/types/RegisterBody";
@@ -941,8 +942,9 @@ export * from "./conformance/api-requirements";
941
942
  export * from "./conformance/capability";
942
943
  export * from "./client/platform/types";
943
944
  export * from "./client/email";
945
+ export * from "./client/cms";
944
946
  export * from "./client/invites";
945
- export * from "./client/carehub/types";
947
+ export * from "./client/slim/types";
946
948
  export * from "./client/experience/types";
947
949
  export * from "./client/patient/types";
948
950
  export * from "./client/patient-sharing";
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ exports.Medplum = Medplum;
45
45
  var ovok_client_1 = require("./client/ovok-client");
46
46
  Object.defineProperty(exports, "OvokClient", { enumerable: true, get: function () { return ovok_client_1.OvokClient; } });
47
47
  __exportStar(require("./client/errors/rate-limit-error"), exports);
48
+ __exportStar(require("./client/errors/sign-in-required-error"), exports);
48
49
  __exportStar(require("./client/errors/ovok-error"), exports);
49
50
  __exportStar(require("./client/auth/errors"), exports);
50
51
  var ovok_client_2 = require("./client/ovok-client");
@@ -62,8 +63,9 @@ __exportStar(require("./conformance/api-requirements"), exports);
62
63
  __exportStar(require("./conformance/capability"), exports);
63
64
  __exportStar(require("./client/platform/types"), exports);
64
65
  __exportStar(require("./client/email"), exports);
66
+ __exportStar(require("./client/cms"), exports);
65
67
  __exportStar(require("./client/invites"), exports);
66
- __exportStar(require("./client/carehub/types"), exports);
68
+ __exportStar(require("./client/slim/types"), exports);
67
69
  __exportStar(require("./client/experience/types"), exports);
68
70
  __exportStar(require("./client/patient/types"), exports);
69
71
  __exportStar(require("./client/patient-sharing"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,71 +0,0 @@
1
- import { Bundle, Resource } from "@medplum/fhirtypes";
2
- import { OvokClient } from "../ovok-client";
3
- import { CarehubAssignDevice, CarehubCreateDevice, CarehubCreateLocation, CarehubCreatePatient, CarehubDevice, CarehubDeviceListItem, CarehubDeviceListQuery, CarehubDeviceTelemetry, CarehubExportPdf, CarehubExportPdfRequest, CarehubLiveQuery, CarehubLiveTelemetry, CarehubLocation, CarehubLocationQuery, CarehubNotification, CarehubNotificationsQuery, CarehubNotificationsResponse, CarehubObservationIds, CarehubPage, CarehubPatient, CarehubPatientListItem, CarehubPatientListQuery, CarehubRecentNotificationsResponse, CarehubSleepStatistics, CarehubThreshold, CarehubTrends, CarehubUpdateDevice, CarehubUpdateLocation, CarehubUpdatePatient, CarehubZone, CarehubZoneDetail } from "./types";
4
- export declare function listCarehubPatients(this: OvokClient, params?: CarehubPatientListQuery): Promise<CarehubPage<CarehubPatientListItem>>;
5
- export declare function getCarehubPatient(this: OvokClient, patientId: string): Promise<CarehubPatient>;
6
- export declare function getCarehubPatientEverything(this: OvokClient, patientId: string): Promise<Bundle<Resource>>;
7
- export declare function getCarehubPatientCurrentVitals(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
8
- export declare function createCarehubPatient(this: OvokClient, body: CarehubCreatePatient): Promise<CarehubPatient>;
9
- export declare function updateCarehubPatient(this: OvokClient, patientId: string, body: CarehubUpdatePatient): Promise<CarehubPatient>;
10
- export declare function deleteCarehubPatient(this: OvokClient, patientId: string): Promise<void>;
11
- export declare function listCarehubDevices(this: OvokClient, params?: CarehubDeviceListQuery): Promise<CarehubPage<CarehubDeviceListItem>>;
12
- export declare function getCarehubDevice(this: OvokClient, deviceId: string): Promise<CarehubDevice>;
13
- export declare function createCarehubDevice(this: OvokClient, body: CarehubCreateDevice): Promise<CarehubDevice>;
14
- export declare function updateCarehubDevice(this: OvokClient, deviceId: string, body: CarehubUpdateDevice): Promise<CarehubDevice>;
15
- export declare function deleteCarehubDevice(this: OvokClient, deviceId: string): Promise<void>;
16
- export declare function assignCarehubDeviceToProject(this: OvokClient, body: CarehubAssignDevice): Promise<CarehubDevice>;
17
- export declare function listCarehubLiveDevices(this: OvokClient, params?: CarehubLiveQuery): Promise<CarehubPage<Record<string, unknown>>>;
18
- export declare function listCarehubLiveTelemetry(this: OvokClient, params?: CarehubLiveQuery): Promise<CarehubLiveTelemetry>;
19
- export declare function getCarehubDeviceSleepStatus(this: OvokClient, deviceId: string): Promise<Record<string, unknown>>;
20
- export declare function getCarehubDeviceTelemetry(this: OvokClient, deviceId: string): Promise<CarehubDeviceTelemetry>;
21
- export declare function listCarehubEffectiveObservationIds(this: OvokClient): Promise<Record<string, CarehubObservationIds>>;
22
- export declare function listCarehubLastObservationIds(this: OvokClient): Promise<Record<string, CarehubObservationIds>>;
23
- export declare function getCarehubDeviceEffectiveObservationIds(this: OvokClient, deviceId: string): Promise<Omit<CarehubObservationIds, "batch">>;
24
- export declare function getCarehubDeviceLastObservationIds(this: OvokClient, deviceId: string): Promise<CarehubObservationIds>;
25
- export declare function listCarehubNotifications(this: OvokClient, params?: CarehubNotificationsQuery): Promise<CarehubNotificationsResponse>;
26
- export declare function getRecentCarehubNotifications(this: OvokClient, count?: number): Promise<CarehubRecentNotificationsResponse>;
27
- export declare function listCarehubOutOfBedNotifications(this: OvokClient, params?: Omit<CarehubNotificationsQuery, "type">): Promise<CarehubNotificationsResponse>;
28
- export declare function listCarehubMedicalNotifications(this: OvokClient, params?: CarehubNotificationsQuery): Promise<CarehubNotificationsResponse>;
29
- export declare function getRecentCarehubMedicalNotifications(this: OvokClient, count?: number): Promise<CarehubRecentNotificationsResponse>;
30
- export declare function getCarehubMedicalNotification(this: OvokClient, episodeId: string): Promise<CarehubNotification>;
31
- export declare function acknowledgeCarehubMedicalNotification(this: OvokClient, episodeId: string): Promise<CarehubNotification>;
32
- export declare function acknowledgeCarehubNotification(this: OvokClient, notificationId: string): Promise<CarehubNotification>;
33
- export declare function getCarehubThreshold(this: OvokClient): Promise<CarehubThreshold>;
34
- export declare function updateCarehubThreshold(this: OvokClient, body: Record<string, unknown>): Promise<CarehubThreshold>;
35
- export declare function getCarehubPatientThreshold(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
36
- export declare function updateCarehubPatientThreshold(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
37
- export declare function getCarehubThresholdV2(this: OvokClient): Promise<Record<string, unknown>>;
38
- export declare function updateCarehubThresholdV2(this: OvokClient, body: Record<string, unknown>): Promise<Record<string, unknown>>;
39
- export declare function getCarehubPatientThresholdV2(this: OvokClient, patientId: string): Promise<Record<string, unknown>>;
40
- export declare function updateCarehubPatientThresholdV2(this: OvokClient, patientId: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
41
- export declare function getCarehubTrends(this: OvokClient, params: {
42
- patientId: string;
43
- startDate: string;
44
- endDate: string;
45
- graphType: string;
46
- }): Promise<CarehubTrends>;
47
- export declare function getCarehubSleepStatistics(this: OvokClient, params: {
48
- endDate: string;
49
- lastDayCount?: number;
50
- patientId: string;
51
- }): Promise<CarehubSleepStatistics>;
52
- export declare function listCarehubLocations(this: OvokClient, params?: CarehubLocationQuery): Promise<CarehubPage<CarehubLocation>>;
53
- export declare function getCarehubLocation(this: OvokClient, locationId: string): Promise<CarehubLocation>;
54
- export declare function createCarehubLocation(this: OvokClient, body: CarehubCreateLocation): Promise<CarehubLocation>;
55
- export declare function updateCarehubLocation(this: OvokClient, locationId: string, body: CarehubUpdateLocation): Promise<CarehubLocation>;
56
- export declare function deleteCarehubLocation(this: OvokClient, locationId: string): Promise<void>;
57
- export declare function listCarehubZones(this: OvokClient, params?: {
58
- page?: number;
59
- count?: number;
60
- sortBy?: string;
61
- orderBy?: "ASC" | "DESC";
62
- search?: string;
63
- }): Promise<CarehubPage<CarehubZone>>;
64
- export declare function getCarehubZone(this: OvokClient, zoneId: string): Promise<CarehubZoneDetail>;
65
- export declare function getCarehubZoneDeviceCounts(this: OvokClient, params?: {
66
- all?: boolean;
67
- effectiveSleepStatus?: string;
68
- includeUnassigned?: boolean;
69
- includeEmpty?: boolean;
70
- }): Promise<Record<string, unknown>>;
71
- export declare function exportCarehubPatientPdf(this: OvokClient, body: CarehubExportPdfRequest): Promise<CarehubExportPdf>;
@@ -1,205 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listCarehubPatients = listCarehubPatients;
4
- exports.getCarehubPatient = getCarehubPatient;
5
- exports.getCarehubPatientEverything = getCarehubPatientEverything;
6
- exports.getCarehubPatientCurrentVitals = getCarehubPatientCurrentVitals;
7
- exports.createCarehubPatient = createCarehubPatient;
8
- exports.updateCarehubPatient = updateCarehubPatient;
9
- exports.deleteCarehubPatient = deleteCarehubPatient;
10
- exports.listCarehubDevices = listCarehubDevices;
11
- exports.getCarehubDevice = getCarehubDevice;
12
- exports.createCarehubDevice = createCarehubDevice;
13
- exports.updateCarehubDevice = updateCarehubDevice;
14
- exports.deleteCarehubDevice = deleteCarehubDevice;
15
- exports.assignCarehubDeviceToProject = assignCarehubDeviceToProject;
16
- exports.listCarehubLiveDevices = listCarehubLiveDevices;
17
- exports.listCarehubLiveTelemetry = listCarehubLiveTelemetry;
18
- exports.getCarehubDeviceSleepStatus = getCarehubDeviceSleepStatus;
19
- exports.getCarehubDeviceTelemetry = getCarehubDeviceTelemetry;
20
- exports.listCarehubEffectiveObservationIds = listCarehubEffectiveObservationIds;
21
- exports.listCarehubLastObservationIds = listCarehubLastObservationIds;
22
- exports.getCarehubDeviceEffectiveObservationIds = getCarehubDeviceEffectiveObservationIds;
23
- exports.getCarehubDeviceLastObservationIds = getCarehubDeviceLastObservationIds;
24
- exports.listCarehubNotifications = listCarehubNotifications;
25
- exports.getRecentCarehubNotifications = getRecentCarehubNotifications;
26
- exports.listCarehubOutOfBedNotifications = listCarehubOutOfBedNotifications;
27
- exports.listCarehubMedicalNotifications = listCarehubMedicalNotifications;
28
- exports.getRecentCarehubMedicalNotifications = getRecentCarehubMedicalNotifications;
29
- exports.getCarehubMedicalNotification = getCarehubMedicalNotification;
30
- exports.acknowledgeCarehubMedicalNotification = acknowledgeCarehubMedicalNotification;
31
- exports.acknowledgeCarehubNotification = acknowledgeCarehubNotification;
32
- exports.getCarehubThreshold = getCarehubThreshold;
33
- exports.updateCarehubThreshold = updateCarehubThreshold;
34
- exports.getCarehubPatientThreshold = getCarehubPatientThreshold;
35
- exports.updateCarehubPatientThreshold = updateCarehubPatientThreshold;
36
- exports.getCarehubThresholdV2 = getCarehubThresholdV2;
37
- exports.updateCarehubThresholdV2 = updateCarehubThresholdV2;
38
- exports.getCarehubPatientThresholdV2 = getCarehubPatientThresholdV2;
39
- exports.updateCarehubPatientThresholdV2 = updateCarehubPatientThresholdV2;
40
- exports.getCarehubTrends = getCarehubTrends;
41
- exports.getCarehubSleepStatistics = getCarehubSleepStatistics;
42
- exports.listCarehubLocations = listCarehubLocations;
43
- exports.getCarehubLocation = getCarehubLocation;
44
- exports.createCarehubLocation = createCarehubLocation;
45
- exports.updateCarehubLocation = updateCarehubLocation;
46
- exports.deleteCarehubLocation = deleteCarehubLocation;
47
- exports.listCarehubZones = listCarehubZones;
48
- exports.getCarehubZone = getCarehubZone;
49
- exports.getCarehubZoneDeviceCounts = getCarehubZoneDeviceCounts;
50
- exports.exportCarehubPatientPdf = exportCarehubPatientPdf;
51
- const query = (params) => {
52
- const values = new URLSearchParams();
53
- for (const [key, value] of Object.entries(params)) {
54
- if (value !== undefined) {
55
- values.set(key, String(value));
56
- }
57
- }
58
- const encoded = values.toString();
59
- return encoded === "" ? "" : `?${encoded}`;
60
- };
61
- const segment = (value) => encodeURIComponent(value);
62
- async function listCarehubPatients(params = {}) {
63
- return this.get(`/v1/slim/patient${query(params)}`);
64
- }
65
- async function getCarehubPatient(patientId) {
66
- return this.get(`/v1/slim/patient/${segment(patientId)}`);
67
- }
68
- async function getCarehubPatientEverything(patientId) {
69
- return this.get(`/v1/slim/patient/${segment(patientId)}/$everything`);
70
- }
71
- async function getCarehubPatientCurrentVitals(patientId) {
72
- return this.get(`/v1/slim/patient/${segment(patientId)}/current-vitals`);
73
- }
74
- async function createCarehubPatient(body) {
75
- return this.post("/v1/slim/patient", body);
76
- }
77
- async function updateCarehubPatient(patientId, body) {
78
- return (await this.put(`/v1/slim/patient/${segment(patientId)}`, body));
79
- }
80
- async function deleteCarehubPatient(patientId) {
81
- await this.delete(`/v1/slim/patient/${segment(patientId)}`);
82
- }
83
- async function listCarehubDevices(params = {}) {
84
- return this.get(`/v1/slim/device${query(params)}`);
85
- }
86
- async function getCarehubDevice(deviceId) {
87
- return this.get(`/v1/slim/device/${segment(deviceId)}`);
88
- }
89
- async function createCarehubDevice(body) {
90
- return this.post("/v1/slim/device", body);
91
- }
92
- async function updateCarehubDevice(deviceId, body) {
93
- return (await this.put(`/v1/slim/device/${segment(deviceId)}`, body));
94
- }
95
- async function deleteCarehubDevice(deviceId) {
96
- await this.delete(`/v1/slim/device/${segment(deviceId)}`);
97
- }
98
- async function assignCarehubDeviceToProject(body) {
99
- return (await this.put("/v1/slim/device/assign/project", body));
100
- }
101
- async function listCarehubLiveDevices(params = {}) {
102
- return this.get(`/v1/slim/device/live${query(params)}`);
103
- }
104
- async function listCarehubLiveTelemetry(params = {}) {
105
- return this.get(`/v1/slim/device/live/telemetry${query(params)}`);
106
- }
107
- async function getCarehubDeviceSleepStatus(deviceId) {
108
- return this.get(`/v1/slim/device/live/cloudwatch/${segment(deviceId)}`);
109
- }
110
- async function getCarehubDeviceTelemetry(deviceId) {
111
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}`);
112
- }
113
- async function listCarehubEffectiveObservationIds() {
114
- return this.get("/v1/slim/telemetry/effectiveIds");
115
- }
116
- async function listCarehubLastObservationIds() {
117
- return this.get("/v1/slim/telemetry/lastIds");
118
- }
119
- async function getCarehubDeviceEffectiveObservationIds(deviceId) {
120
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}/effectiveIds`);
121
- }
122
- async function getCarehubDeviceLastObservationIds(deviceId) {
123
- return this.get(`/v1/slim/telemetry/${segment(deviceId)}/lastIds`);
124
- }
125
- async function listCarehubNotifications(params = {}) {
126
- return this.get(`/v1/slim/notifications${query(params)}`);
127
- }
128
- async function getRecentCarehubNotifications(count) {
129
- return this.get(`/v1/slim/notifications/recent${query({ count })}`);
130
- }
131
- async function listCarehubOutOfBedNotifications(params = {}) {
132
- return this.get(`/v1/slim/notifications/oob${query(params)}`);
133
- }
134
- async function listCarehubMedicalNotifications(params = {}) {
135
- return this.get(`/v1/slim/notifications/medical${query(params)}`);
136
- }
137
- async function getRecentCarehubMedicalNotifications(count) {
138
- return this.get(`/v1/slim/notifications/recent/medical${query({ count })}`);
139
- }
140
- async function getCarehubMedicalNotification(episodeId) {
141
- return this.get(`/v1/slim/notifications/medical/${segment(episodeId)}`);
142
- }
143
- async function acknowledgeCarehubMedicalNotification(episodeId) {
144
- return this.post(`/v1/slim/notifications/medical/${segment(episodeId)}/ack`);
145
- }
146
- async function acknowledgeCarehubNotification(notificationId) {
147
- return (await this.patch(`/v1/slim/notifications/${segment(notificationId)}/ack`, []));
148
- }
149
- async function getCarehubThreshold() {
150
- return this.get("/v1/slim/threshold");
151
- }
152
- async function updateCarehubThreshold(body) {
153
- return (await this.put("/v1/slim/threshold", body));
154
- }
155
- async function getCarehubPatientThreshold(patientId) {
156
- return this.get(`/v1/slim/threshold/patient/${segment(patientId)}`);
157
- }
158
- async function updateCarehubPatientThreshold(patientId, body) {
159
- return (await this.put(`/v1/slim/threshold/patient/${segment(patientId)}`, body));
160
- }
161
- async function getCarehubThresholdV2() {
162
- return this.get("/v2/slim/threshold");
163
- }
164
- async function updateCarehubThresholdV2(body) {
165
- return (await this.put("/v2/slim/threshold", body));
166
- }
167
- async function getCarehubPatientThresholdV2(patientId) {
168
- return this.get(`/v2/slim/threshold/patient/${segment(patientId)}`);
169
- }
170
- async function updateCarehubPatientThresholdV2(patientId, body) {
171
- return (await this.put(`/v2/slim/threshold/patient/${segment(patientId)}`, body));
172
- }
173
- async function getCarehubTrends(params) {
174
- return this.get(`/v1/slim/trends/graphs${query(params)}`);
175
- }
176
- async function getCarehubSleepStatistics(params) {
177
- return this.get(`/v1/slim/sleep/statistics${query(params)}`);
178
- }
179
- async function listCarehubLocations(params = {}) {
180
- return this.get(`/v1/slim/location${query(params)}`);
181
- }
182
- async function getCarehubLocation(locationId) {
183
- return this.get(`/v1/slim/location/${segment(locationId)}`);
184
- }
185
- async function createCarehubLocation(body) {
186
- return this.post("/v1/slim/location", body);
187
- }
188
- async function updateCarehubLocation(locationId, body) {
189
- return (await this.put(`/v1/slim/location/${segment(locationId)}`, body));
190
- }
191
- async function deleteCarehubLocation(locationId) {
192
- await this.delete(`/v1/slim/location/${segment(locationId)}`);
193
- }
194
- async function listCarehubZones(params = {}) {
195
- return this.get(`/v1/slim/zones${query(params)}`);
196
- }
197
- async function getCarehubZone(zoneId) {
198
- return this.get(`/v1/slim/zones/${segment(zoneId)}`);
199
- }
200
- async function getCarehubZoneDeviceCounts(params = {}) {
201
- return this.get(`/v1/slim/zones/device-counts${query(params)}`);
202
- }
203
- async function exportCarehubPatientPdf(body) {
204
- return this.post("/v1/slim/export/pdf", body);
205
- }
File without changes