@ovok/core 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -7
- package/dist/client/patient/methods.d.ts +13 -1
- package/dist/client/patient/methods.js +48 -0
- package/dist/client/patient/types.d.ts +8 -1
- package/dist/conformance/capability-requirements.js +27 -3
- package/dist/hooks/experience-hooks.d.ts +13 -0
- package/dist/hooks/experience-hooks.js +75 -0
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/index.js +23 -1
- package/dist/hooks/patient-hooks.d.ts +8 -1
- package/dist/hooks/patient-hooks.js +51 -1
- package/dist/hooks/platform-hooks.d.ts +17 -0
- package/dist/hooks/platform-hooks.js +63 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,9 @@ not included until Ovok publishes a supported billing contract.
|
|
|
77
77
|
|
|
78
78
|
Patient applications can read their authenticated profile and health data through typed methods
|
|
79
79
|
backed by the existing `../ovok-core` routes. The profile response includes the Patient resource,
|
|
80
|
-
project context, menu configuration, access policy, and active sessions.
|
|
80
|
+
project context, menu configuration, access policy, and active sessions. The resource facade also
|
|
81
|
+
covers measurement history/detail, CarePlans, questionnaires and responses, assigned devices, and
|
|
82
|
+
CommunicationRequest-backed notifications.
|
|
81
83
|
|
|
82
84
|
```typescript
|
|
83
85
|
const me = await client.getCurrentPatientProfile();
|
|
@@ -92,12 +94,27 @@ const history = await client.getPatientDeviceTelemetryHistory(deviceId, {
|
|
|
92
94
|
to: "2026-09-26T00:00:00.000Z",
|
|
93
95
|
pageSize: 50,
|
|
94
96
|
});
|
|
97
|
+
const measurements = await client.listPatientMeasurementHistory({
|
|
98
|
+
patient: `Patient/${me.profile.id}`,
|
|
99
|
+
_sort: "-date",
|
|
100
|
+
_count: 50,
|
|
101
|
+
});
|
|
102
|
+
const carePlans = await client.listPatientCarePlans({
|
|
103
|
+
patient: `Patient/${me.profile.id}`,
|
|
104
|
+
status: "active",
|
|
105
|
+
});
|
|
106
|
+
const notifications = await client.listPatientNotifications({
|
|
107
|
+
patient: `Patient/${me.profile.id}`,
|
|
108
|
+
_sort: "-authored",
|
|
109
|
+
});
|
|
95
110
|
```
|
|
96
111
|
|
|
97
112
|
These helpers use bearer-authenticated `/auth/me` and `/fhir/*` contracts and are additive to the
|
|
98
|
-
native observation and offline-measurement APIs. The
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
native observation and offline-measurement APIs. The returned resource lists are subject to the
|
|
114
|
+
patient's backend AccessPolicy. Device pairing/claiming and notification acknowledgement are not
|
|
115
|
+
invented here because `../ovok-core` does not currently expose patient-scoped contracts for them.
|
|
116
|
+
The exported `OVOK_CORE_API_REQUIREMENTS` lists ordinary HTTP routes, while
|
|
117
|
+
`OVOK_CORE_REQUIREMENTS` covers the FHIR operations. Billing is intentionally absent.
|
|
101
118
|
|
|
102
119
|
Questionnaire applications can use the Ovok-specific patient-scoped operations and keep the
|
|
103
120
|
response write atomic with its extracted Observations:
|
|
@@ -168,9 +185,9 @@ download elements; the backend remains responsible for authorization and signed
|
|
|
168
185
|
## React hooks
|
|
169
186
|
|
|
170
187
|
The package exports additive hooks for capability discovery, project configuration, patient profile
|
|
171
|
-
and health data, questionnaires, scheduling resources, CareHub lists, telemetry,
|
|
172
|
-
Every request hook returns `data`,
|
|
173
|
-
`data`, `loading`, `error`, `mutate`, and `reset`.
|
|
188
|
+
and health data, questionnaires, scheduling resources, CareHub lists, telemetry, notifications,
|
|
189
|
+
documents, content, video consultations, and localization. Every request hook returns `data`,
|
|
190
|
+
`loading`, `error`, and `reload`; mutations expose `data`, `loading`, `error`, `mutate`, and `reset`.
|
|
174
191
|
|
|
175
192
|
```tsx
|
|
176
193
|
const { data: patients, loading, error } = useCarehubPatients({
|
|
@@ -184,6 +201,9 @@ const saveSettings = useOvokMutation((client, settings: OvokProjectSettings) =>
|
|
|
184
201
|
const { data: me } = useCurrentPatientProfile();
|
|
185
202
|
const { data: appointments } = usePatientAppointments({ status: "booked" });
|
|
186
203
|
const populateQuestionnaire = usePopulateQuestionnaire();
|
|
204
|
+
const { data: articles } = useContent("blog", "en-US", { _count: 10 });
|
|
205
|
+
const { data: calls } = useVideoCallAppointments();
|
|
206
|
+
const { data: translations } = useLocalizations("en-US");
|
|
187
207
|
```
|
|
188
208
|
|
|
189
209
|
Hooks are additive to the existing `OvokProvider`, observation hooks, auth methods, and offline
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OvokClient } from "../ovok-client";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDevice, OvokPatientMeasurement, OvokPatientNotification, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "./types";
|
|
3
3
|
export declare function getCurrentPatientProfile(this: OvokClient): Promise<OvokCurrentPatientProfile>;
|
|
4
4
|
export declare function getPatientLatestObservations(this: OvokClient, params?: OvokPatientLatestObservationsQuery): Promise<OvokPatientObservationBundle>;
|
|
5
5
|
export declare function getPatientDeviceTelemetry(this: OvokClient, deviceId: string): Promise<OvokPatientObservationBundle>;
|
|
@@ -10,3 +10,15 @@ export declare function createPatientAppointment(this: OvokClient, appointment:
|
|
|
10
10
|
export declare function updatePatientAppointment(this: OvokClient, appointment: OvokPatientAppointment): Promise<OvokPatientAppointment>;
|
|
11
11
|
export declare function listPatientSchedules(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSchedule[]>;
|
|
12
12
|
export declare function listPatientSlots(this: OvokClient, params?: OvokPatientSchedulingQuery): Promise<OvokPatientSlot[]>;
|
|
13
|
+
export declare function listPatientMeasurementHistory(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientMeasurement[]>;
|
|
14
|
+
export declare function getPatientMeasurement(this: OvokClient, measurementId: string): Promise<OvokPatientMeasurement>;
|
|
15
|
+
export declare function listPatientCarePlans(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientCarePlan[]>;
|
|
16
|
+
export declare function getPatientCarePlan(this: OvokClient, carePlanId: string): Promise<OvokPatientCarePlan>;
|
|
17
|
+
export declare function listPatientQuestionnaires(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaire[]>;
|
|
18
|
+
export declare function getPatientQuestionnaire(this: OvokClient, questionnaireId: string): Promise<OvokPatientQuestionnaire>;
|
|
19
|
+
export declare function listPatientQuestionnaireResponses(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientQuestionnaireResponse[]>;
|
|
20
|
+
export declare function getPatientQuestionnaireResponse(this: OvokClient, questionnaireResponseId: string): Promise<OvokPatientQuestionnaireResponse>;
|
|
21
|
+
export declare function listPatientDevices(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientDevice[]>;
|
|
22
|
+
export declare function getPatientDevice(this: OvokClient, deviceId: string): Promise<OvokPatientDevice>;
|
|
23
|
+
export declare function listPatientNotifications(this: OvokClient, params?: OvokPatientResourceQuery): Promise<OvokPatientNotification[]>;
|
|
24
|
+
export declare function getPatientNotification(this: OvokClient, notificationId: string): Promise<OvokPatientNotification>;
|
|
@@ -10,6 +10,18 @@ exports.createPatientAppointment = createPatientAppointment;
|
|
|
10
10
|
exports.updatePatientAppointment = updatePatientAppointment;
|
|
11
11
|
exports.listPatientSchedules = listPatientSchedules;
|
|
12
12
|
exports.listPatientSlots = listPatientSlots;
|
|
13
|
+
exports.listPatientMeasurementHistory = listPatientMeasurementHistory;
|
|
14
|
+
exports.getPatientMeasurement = getPatientMeasurement;
|
|
15
|
+
exports.listPatientCarePlans = listPatientCarePlans;
|
|
16
|
+
exports.getPatientCarePlan = getPatientCarePlan;
|
|
17
|
+
exports.listPatientQuestionnaires = listPatientQuestionnaires;
|
|
18
|
+
exports.getPatientQuestionnaire = getPatientQuestionnaire;
|
|
19
|
+
exports.listPatientQuestionnaireResponses = listPatientQuestionnaireResponses;
|
|
20
|
+
exports.getPatientQuestionnaireResponse = getPatientQuestionnaireResponse;
|
|
21
|
+
exports.listPatientDevices = listPatientDevices;
|
|
22
|
+
exports.getPatientDevice = getPatientDevice;
|
|
23
|
+
exports.listPatientNotifications = listPatientNotifications;
|
|
24
|
+
exports.getPatientNotification = getPatientNotification;
|
|
13
25
|
const segment = (value) => encodeURIComponent(value);
|
|
14
26
|
const query = (params) => {
|
|
15
27
|
const values = new URLSearchParams();
|
|
@@ -56,3 +68,39 @@ async function listPatientSchedules(params = {}) {
|
|
|
56
68
|
async function listPatientSlots(params = {}) {
|
|
57
69
|
return this.searchResources("Slot", params);
|
|
58
70
|
}
|
|
71
|
+
async function listPatientMeasurementHistory(params = {}) {
|
|
72
|
+
return (await this.searchResources("Observation", params));
|
|
73
|
+
}
|
|
74
|
+
async function getPatientMeasurement(measurementId) {
|
|
75
|
+
return this.readResource("Observation", measurementId);
|
|
76
|
+
}
|
|
77
|
+
async function listPatientCarePlans(params = {}) {
|
|
78
|
+
return (await this.searchResources("CarePlan", params));
|
|
79
|
+
}
|
|
80
|
+
async function getPatientCarePlan(carePlanId) {
|
|
81
|
+
return this.readResource("CarePlan", carePlanId);
|
|
82
|
+
}
|
|
83
|
+
async function listPatientQuestionnaires(params = {}) {
|
|
84
|
+
return (await this.searchResources("Questionnaire", params));
|
|
85
|
+
}
|
|
86
|
+
async function getPatientQuestionnaire(questionnaireId) {
|
|
87
|
+
return this.readResource("Questionnaire", questionnaireId);
|
|
88
|
+
}
|
|
89
|
+
async function listPatientQuestionnaireResponses(params = {}) {
|
|
90
|
+
return (await this.searchResources("QuestionnaireResponse", params));
|
|
91
|
+
}
|
|
92
|
+
async function getPatientQuestionnaireResponse(questionnaireResponseId) {
|
|
93
|
+
return this.readResource("QuestionnaireResponse", questionnaireResponseId);
|
|
94
|
+
}
|
|
95
|
+
async function listPatientDevices(params = {}) {
|
|
96
|
+
return (await this.searchResources("Device", params));
|
|
97
|
+
}
|
|
98
|
+
async function getPatientDevice(deviceId) {
|
|
99
|
+
return this.readResource("Device", deviceId);
|
|
100
|
+
}
|
|
101
|
+
async function listPatientNotifications(params = {}) {
|
|
102
|
+
return (await this.searchResources("CommunicationRequest", params));
|
|
103
|
+
}
|
|
104
|
+
async function getPatientNotification(notificationId) {
|
|
105
|
+
return this.readResource("CommunicationRequest", notificationId);
|
|
106
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Appointment, Bundle, Observation, Schedule, Slot } from "@medplum/fhirtypes";
|
|
1
|
+
import { Appointment, Bundle, CarePlan, CommunicationRequest, Device, Observation, Questionnaire, QuestionnaireResponse, Schedule, Slot } from "@medplum/fhirtypes";
|
|
2
2
|
export type OvokCurrentPatientProfile = {
|
|
3
3
|
project: {
|
|
4
4
|
resourceType: "Project";
|
|
@@ -69,9 +69,16 @@ export type OvokPatientTelemetryHistoryQuery = {
|
|
|
69
69
|
pageSize?: number;
|
|
70
70
|
};
|
|
71
71
|
export type OvokPatientSchedulingQuery = Record<string, string | number | boolean | undefined>;
|
|
72
|
+
export type OvokPatientResourceQuery = OvokPatientSchedulingQuery;
|
|
72
73
|
export type OvokPatientAppointment = Appointment;
|
|
73
74
|
export type OvokPatientSchedule = Schedule;
|
|
74
75
|
export type OvokPatientSlot = Slot;
|
|
76
|
+
export type OvokPatientMeasurement = Observation;
|
|
77
|
+
export type OvokPatientCarePlan = CarePlan;
|
|
78
|
+
export type OvokPatientDevice = Device;
|
|
79
|
+
export type OvokPatientNotification = CommunicationRequest;
|
|
80
|
+
export type OvokPatientQuestionnaire = Questionnaire;
|
|
81
|
+
export type OvokPatientQuestionnaireResponse = QuestionnaireResponse;
|
|
75
82
|
export type OvokPatientObservationBundle = Bundle<Observation>;
|
|
76
83
|
export type OvokPatientTelemetryHistory = {
|
|
77
84
|
deviceId: string;
|
|
@@ -48,7 +48,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
48
48
|
description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
|
|
49
49
|
software: {
|
|
50
50
|
name: "@ovok/core",
|
|
51
|
-
version: "0.3.
|
|
51
|
+
version: "0.3.15",
|
|
52
52
|
},
|
|
53
53
|
fhirVersion: "4.0.1",
|
|
54
54
|
format: ["json"],
|
|
@@ -72,7 +72,11 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
72
72
|
resource: [
|
|
73
73
|
{
|
|
74
74
|
type: "Observation",
|
|
75
|
-
interaction: [
|
|
75
|
+
interaction: [
|
|
76
|
+
{ code: "search-type" },
|
|
77
|
+
{ code: "read" },
|
|
78
|
+
{ code: "create" },
|
|
79
|
+
],
|
|
76
80
|
operation: [
|
|
77
81
|
{
|
|
78
82
|
name: "lastn",
|
|
@@ -90,7 +94,11 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
90
94
|
},
|
|
91
95
|
{
|
|
92
96
|
type: "QuestionnaireResponse",
|
|
93
|
-
interaction: [
|
|
97
|
+
interaction: [
|
|
98
|
+
{ code: "search-type" },
|
|
99
|
+
{ code: "read" },
|
|
100
|
+
{ code: "create" },
|
|
101
|
+
],
|
|
94
102
|
documentation: "Created as an entry of the transaction Bundle above, never on its own by this library.",
|
|
95
103
|
operation: [
|
|
96
104
|
{
|
|
@@ -102,6 +110,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
102
110
|
},
|
|
103
111
|
{
|
|
104
112
|
type: "Questionnaire",
|
|
113
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
105
114
|
operation: [
|
|
106
115
|
{
|
|
107
116
|
name: "populate",
|
|
@@ -110,6 +119,21 @@ exports.OVOK_CORE_REQUIREMENTS = {
|
|
|
110
119
|
},
|
|
111
120
|
],
|
|
112
121
|
},
|
|
122
|
+
{
|
|
123
|
+
type: "CarePlan",
|
|
124
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
125
|
+
documentation: "Patient care-plan helpers read plans through the authenticated FHIR surface.",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
type: "Device",
|
|
129
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
130
|
+
documentation: "Patient device helpers read devices assigned to the authenticated patient.",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: "CommunicationRequest",
|
|
134
|
+
interaction: [{ code: "search-type" }, { code: "read" }],
|
|
135
|
+
documentation: "Patient notification helpers read CommunicationRequest resources visible to the authenticated patient.",
|
|
136
|
+
},
|
|
113
137
|
{
|
|
114
138
|
type: "Appointment",
|
|
115
139
|
interaction: [
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OvokConsentSignatureResponse, OvokContentQuery, OvokContentSearchResponse, OvokDocumentSearchQuery, OvokDocumentSearchResponse, OvokVideoCallAccess, OvokVideoCallAppointment, OvokVideoCallAppointmentInput, OvokVideoCallAppointmentQuery } from "../client/experience/types";
|
|
2
|
+
import { OvokMutationState, OvokRequestState } from "./api-hooks";
|
|
3
|
+
export declare const useConsentSignature: () => OvokMutationState<{
|
|
4
|
+
consentId: string;
|
|
5
|
+
}, OvokConsentSignatureResponse>;
|
|
6
|
+
export declare const useDocuments: (params?: OvokDocumentSearchQuery) => OvokRequestState<OvokDocumentSearchResponse>;
|
|
7
|
+
export declare const useContent: (type: string, language: string, params?: OvokContentQuery) => OvokRequestState<OvokContentSearchResponse>;
|
|
8
|
+
export declare const useVideoCallAppointments: (params?: OvokVideoCallAppointmentQuery) => OvokRequestState<OvokVideoCallAppointment[]>;
|
|
9
|
+
export declare const useVideoCallAccess: (appointmentId?: string) => OvokRequestState<Record<string, unknown>>;
|
|
10
|
+
export declare const useCreateVideoCallAppointment: () => OvokMutationState<OvokVideoCallAppointmentInput, OvokVideoCallAppointment>;
|
|
11
|
+
export declare const useCreateVideoCallUserAccess: () => OvokMutationState<{
|
|
12
|
+
appointmentId: string;
|
|
13
|
+
}, OvokVideoCallAccess>;
|
|
@@ -0,0 +1,75 @@
|
|
|
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.useCreateVideoCallUserAccess = exports.useCreateVideoCallAppointment = exports.useVideoCallAccess = exports.useVideoCallAppointments = exports.useContent = exports.useDocuments = exports.useConsentSignature = void 0;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const api_hooks_1 = require("./api-hooks");
|
|
40
|
+
const index_1 = require("./index");
|
|
41
|
+
const useConsentSignature = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.requestConsentSignature(params.consentId));
|
|
42
|
+
exports.useConsentSignature = useConsentSignature;
|
|
43
|
+
const useDocuments = (params = {}) => {
|
|
44
|
+
const client = (0, index_1.useClient)();
|
|
45
|
+
const serialized = JSON.stringify(params);
|
|
46
|
+
const load = React.useCallback(() => client.listDocuments(params), [client, serialized]);
|
|
47
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
48
|
+
};
|
|
49
|
+
exports.useDocuments = useDocuments;
|
|
50
|
+
const useContent = (type, language, params = {}) => {
|
|
51
|
+
const client = (0, index_1.useClient)();
|
|
52
|
+
const serialized = JSON.stringify(params);
|
|
53
|
+
const load = React.useCallback(() => client.searchContent(type, language, params), [client, language, serialized, type]);
|
|
54
|
+
return (0, api_hooks_1.useOvokRequest)(load, type.length > 0 && language.length > 0);
|
|
55
|
+
};
|
|
56
|
+
exports.useContent = useContent;
|
|
57
|
+
const useVideoCallAppointments = (params = {}) => {
|
|
58
|
+
const client = (0, index_1.useClient)();
|
|
59
|
+
const serialized = JSON.stringify(params);
|
|
60
|
+
const load = React.useCallback(() => client.listVideoCallAppointments(params), [client, serialized]);
|
|
61
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
62
|
+
};
|
|
63
|
+
exports.useVideoCallAppointments = useVideoCallAppointments;
|
|
64
|
+
const useVideoCallAccess = (appointmentId) => {
|
|
65
|
+
const client = (0, index_1.useClient)();
|
|
66
|
+
const load = React.useCallback(() => appointmentId
|
|
67
|
+
? client.getVideoCallAccessPermission(appointmentId)
|
|
68
|
+
: Promise.reject(new Error("appointmentId is required")), [appointmentId, client]);
|
|
69
|
+
return (0, api_hooks_1.useOvokRequest)(load, appointmentId !== undefined);
|
|
70
|
+
};
|
|
71
|
+
exports.useVideoCallAccess = useVideoCallAccess;
|
|
72
|
+
const useCreateVideoCallAppointment = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.createVideoCallAppointment(params));
|
|
73
|
+
exports.useCreateVideoCallAppointment = useCreateVideoCallAppointment;
|
|
74
|
+
const useCreateVideoCallUserAccess = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.createVideoCallUserAccess(params.appointmentId));
|
|
75
|
+
exports.useCreateVideoCallUserAccess = useCreateVideoCallUserAccess;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ export declare const OvokProvider: (props: React.PropsWithChildren<{
|
|
|
7
7
|
}>) => React.JSX.Element;
|
|
8
8
|
export { observationsToMeasurements, useEcgRecording, useObservations, useSaveMeasurement, useUrineTests, } from "./observation-hooks";
|
|
9
9
|
export { useAdministeredProjects, useCarehubDeviceTelemetry, useCarehubDevices, useCarehubNotifications, useCarehubPatients, useCapabilityStatement, useOvokMutation, useOvokRequest, useProjectFeatures, useProjectSettings, usePublicApiEndpoints, useRecentCarehubNotifications, } from "./api-hooks";
|
|
10
|
-
export {
|
|
10
|
+
export { useConsentSignature, useContent, useCreateVideoCallAppointment, useCreateVideoCallUserAccess, useDocuments, useVideoCallAccess, useVideoCallAppointments, } from "./experience-hooks";
|
|
11
|
+
export { useI18nextDocument, useLocales, useLocalizations, useUpdateI18nextDocument, useUpdateLocalization, } from "./platform-hooks";
|
|
12
|
+
export { useCurrentPatientProfile, useExtractQuestionnaireObservations, usePatientAppointments, usePatientCarePlans, usePatientDevices, usePatientDeviceTelemetry, usePatientDeviceTelemetryHistory, usePatientMeasurement, usePatientMeasurementHistory, usePatientLatestObservations, usePatientNotifications, usePatientQuestionnaireResponses, usePatientQuestionnaires, usePatientSchedules, usePatientSlots, usePopulateQuestionnaire, useSubmitQuestionnaireResponse, } from "./patient-hooks";
|
package/dist/hooks/index.js
CHANGED
|
@@ -34,7 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
37
|
+
exports.usePatientMeasurement = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientDevices = exports.usePatientCarePlans = exports.usePatientAppointments = exports.useExtractQuestionnaireObservations = exports.useCurrentPatientProfile = 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.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientQuestionnaires = exports.usePatientQuestionnaireResponses = exports.usePatientNotifications = exports.usePatientLatestObservations = exports.usePatientMeasurementHistory = void 0;
|
|
38
39
|
/*
|
|
39
40
|
* The only React-dependent module in the package.
|
|
40
41
|
*
|
|
@@ -89,13 +90,34 @@ Object.defineProperty(exports, "useProjectFeatures", { enumerable: true, get: fu
|
|
|
89
90
|
Object.defineProperty(exports, "useProjectSettings", { enumerable: true, get: function () { return api_hooks_1.useProjectSettings; } });
|
|
90
91
|
Object.defineProperty(exports, "usePublicApiEndpoints", { enumerable: true, get: function () { return api_hooks_1.usePublicApiEndpoints; } });
|
|
91
92
|
Object.defineProperty(exports, "useRecentCarehubNotifications", { enumerable: true, get: function () { return api_hooks_1.useRecentCarehubNotifications; } });
|
|
93
|
+
var experience_hooks_1 = require("./experience-hooks");
|
|
94
|
+
Object.defineProperty(exports, "useConsentSignature", { enumerable: true, get: function () { return experience_hooks_1.useConsentSignature; } });
|
|
95
|
+
Object.defineProperty(exports, "useContent", { enumerable: true, get: function () { return experience_hooks_1.useContent; } });
|
|
96
|
+
Object.defineProperty(exports, "useCreateVideoCallAppointment", { enumerable: true, get: function () { return experience_hooks_1.useCreateVideoCallAppointment; } });
|
|
97
|
+
Object.defineProperty(exports, "useCreateVideoCallUserAccess", { enumerable: true, get: function () { return experience_hooks_1.useCreateVideoCallUserAccess; } });
|
|
98
|
+
Object.defineProperty(exports, "useDocuments", { enumerable: true, get: function () { return experience_hooks_1.useDocuments; } });
|
|
99
|
+
Object.defineProperty(exports, "useVideoCallAccess", { enumerable: true, get: function () { return experience_hooks_1.useVideoCallAccess; } });
|
|
100
|
+
Object.defineProperty(exports, "useVideoCallAppointments", { enumerable: true, get: function () { return experience_hooks_1.useVideoCallAppointments; } });
|
|
101
|
+
var platform_hooks_1 = require("./platform-hooks");
|
|
102
|
+
Object.defineProperty(exports, "useI18nextDocument", { enumerable: true, get: function () { return platform_hooks_1.useI18nextDocument; } });
|
|
103
|
+
Object.defineProperty(exports, "useLocales", { enumerable: true, get: function () { return platform_hooks_1.useLocales; } });
|
|
104
|
+
Object.defineProperty(exports, "useLocalizations", { enumerable: true, get: function () { return platform_hooks_1.useLocalizations; } });
|
|
105
|
+
Object.defineProperty(exports, "useUpdateI18nextDocument", { enumerable: true, get: function () { return platform_hooks_1.useUpdateI18nextDocument; } });
|
|
106
|
+
Object.defineProperty(exports, "useUpdateLocalization", { enumerable: true, get: function () { return platform_hooks_1.useUpdateLocalization; } });
|
|
92
107
|
var patient_hooks_1 = require("./patient-hooks");
|
|
93
108
|
Object.defineProperty(exports, "useCurrentPatientProfile", { enumerable: true, get: function () { return patient_hooks_1.useCurrentPatientProfile; } });
|
|
94
109
|
Object.defineProperty(exports, "useExtractQuestionnaireObservations", { enumerable: true, get: function () { return patient_hooks_1.useExtractQuestionnaireObservations; } });
|
|
95
110
|
Object.defineProperty(exports, "usePatientAppointments", { enumerable: true, get: function () { return patient_hooks_1.usePatientAppointments; } });
|
|
111
|
+
Object.defineProperty(exports, "usePatientCarePlans", { enumerable: true, get: function () { return patient_hooks_1.usePatientCarePlans; } });
|
|
112
|
+
Object.defineProperty(exports, "usePatientDevices", { enumerable: true, get: function () { return patient_hooks_1.usePatientDevices; } });
|
|
96
113
|
Object.defineProperty(exports, "usePatientDeviceTelemetry", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetry; } });
|
|
97
114
|
Object.defineProperty(exports, "usePatientDeviceTelemetryHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientDeviceTelemetryHistory; } });
|
|
115
|
+
Object.defineProperty(exports, "usePatientMeasurement", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurement; } });
|
|
116
|
+
Object.defineProperty(exports, "usePatientMeasurementHistory", { enumerable: true, get: function () { return patient_hooks_1.usePatientMeasurementHistory; } });
|
|
98
117
|
Object.defineProperty(exports, "usePatientLatestObservations", { enumerable: true, get: function () { return patient_hooks_1.usePatientLatestObservations; } });
|
|
118
|
+
Object.defineProperty(exports, "usePatientNotifications", { enumerable: true, get: function () { return patient_hooks_1.usePatientNotifications; } });
|
|
119
|
+
Object.defineProperty(exports, "usePatientQuestionnaireResponses", { enumerable: true, get: function () { return patient_hooks_1.usePatientQuestionnaireResponses; } });
|
|
120
|
+
Object.defineProperty(exports, "usePatientQuestionnaires", { enumerable: true, get: function () { return patient_hooks_1.usePatientQuestionnaires; } });
|
|
99
121
|
Object.defineProperty(exports, "usePatientSchedules", { enumerable: true, get: function () { return patient_hooks_1.usePatientSchedules; } });
|
|
100
122
|
Object.defineProperty(exports, "usePatientSlots", { enumerable: true, get: function () { return patient_hooks_1.usePatientSlots; } });
|
|
101
123
|
Object.defineProperty(exports, "usePopulateQuestionnaire", { enumerable: true, get: function () { return patient_hooks_1.usePopulateQuestionnaire; } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Bundle, Observation, Parameters, QuestionnaireResponse } from "@medplum/fhirtypes";
|
|
2
|
-
import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientLatestObservationsQuery, OvokPatientObservationBundle, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "../client/patient/types";
|
|
2
|
+
import { OvokCurrentPatientProfile, OvokPatientAppointment, OvokPatientCarePlan, OvokPatientDevice, OvokPatientLatestObservationsQuery, OvokPatientMeasurement, OvokPatientNotification, OvokPatientObservationBundle, OvokPatientQuestionnaire, OvokPatientQuestionnaireResponse, OvokPatientResourceQuery, OvokPatientSchedule, OvokPatientSchedulingQuery, OvokPatientSlot, OvokPatientTelemetryHistory, OvokPatientTelemetryHistoryQuery } from "../client/patient/types";
|
|
3
3
|
import { OvokQuestionnaireOperationResponse } from "../client/questionnaire-response/types";
|
|
4
4
|
import { OvokMutationState, OvokRequestState } from "./api-hooks";
|
|
5
5
|
export declare const useCurrentPatientProfile: () => OvokRequestState<OvokCurrentPatientProfile>;
|
|
@@ -9,6 +9,13 @@ export declare const usePatientDeviceTelemetryHistory: (deviceId: string | undef
|
|
|
9
9
|
export declare const usePatientAppointments: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientAppointment[]>;
|
|
10
10
|
export declare const usePatientSchedules: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSchedule[]>;
|
|
11
11
|
export declare const usePatientSlots: (params?: OvokPatientSchedulingQuery) => OvokRequestState<OvokPatientSlot[]>;
|
|
12
|
+
export declare const usePatientMeasurementHistory: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientMeasurement[]>;
|
|
13
|
+
export declare const usePatientMeasurement: (measurementId?: string) => OvokRequestState<OvokPatientMeasurement>;
|
|
14
|
+
export declare const usePatientCarePlans: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientCarePlan[]>;
|
|
15
|
+
export declare const usePatientQuestionnaires: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientQuestionnaire[]>;
|
|
16
|
+
export declare const usePatientQuestionnaireResponses: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientQuestionnaireResponse[]>;
|
|
17
|
+
export declare const usePatientDevices: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientDevice[]>;
|
|
18
|
+
export declare const usePatientNotifications: (params?: OvokPatientResourceQuery) => OvokRequestState<OvokPatientNotification[]>;
|
|
12
19
|
export declare const usePopulateQuestionnaire: () => OvokMutationState<{
|
|
13
20
|
questionnaireId: string;
|
|
14
21
|
parameters?: Parameters;
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.useExtractQuestionnaireObservations = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = exports.useCurrentPatientProfile = void 0;
|
|
37
|
+
exports.useExtractQuestionnaireObservations = exports.useSubmitQuestionnaireResponse = exports.usePopulateQuestionnaire = exports.usePatientNotifications = exports.usePatientDevices = exports.usePatientQuestionnaireResponses = exports.usePatientQuestionnaires = exports.usePatientCarePlans = exports.usePatientMeasurement = exports.usePatientMeasurementHistory = exports.usePatientSlots = exports.usePatientSchedules = exports.usePatientAppointments = exports.usePatientDeviceTelemetryHistory = exports.usePatientDeviceTelemetry = exports.usePatientLatestObservations = exports.useCurrentPatientProfile = void 0;
|
|
38
38
|
const React = __importStar(require("react"));
|
|
39
39
|
const api_hooks_1 = require("./api-hooks");
|
|
40
40
|
const index_1 = require("./index");
|
|
@@ -89,6 +89,56 @@ const usePatientSlots = (params = {}) => {
|
|
|
89
89
|
return (0, api_hooks_1.useOvokRequest)(load);
|
|
90
90
|
};
|
|
91
91
|
exports.usePatientSlots = usePatientSlots;
|
|
92
|
+
const usePatientMeasurementHistory = (params = {}) => {
|
|
93
|
+
const client = (0, index_1.useClient)();
|
|
94
|
+
const serialized = JSON.stringify(params);
|
|
95
|
+
const load = React.useCallback(() => client.listPatientMeasurementHistory(params), [client, serialized]);
|
|
96
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
97
|
+
};
|
|
98
|
+
exports.usePatientMeasurementHistory = usePatientMeasurementHistory;
|
|
99
|
+
const usePatientMeasurement = (measurementId) => {
|
|
100
|
+
const client = (0, index_1.useClient)();
|
|
101
|
+
const load = React.useCallback(() => measurementId
|
|
102
|
+
? client.getPatientMeasurement(measurementId)
|
|
103
|
+
: Promise.reject(new Error("measurementId is required")), [client, measurementId]);
|
|
104
|
+
return (0, api_hooks_1.useOvokRequest)(load, measurementId !== undefined);
|
|
105
|
+
};
|
|
106
|
+
exports.usePatientMeasurement = usePatientMeasurement;
|
|
107
|
+
const usePatientCarePlans = (params = {}) => {
|
|
108
|
+
const client = (0, index_1.useClient)();
|
|
109
|
+
const serialized = JSON.stringify(params);
|
|
110
|
+
const load = React.useCallback(() => client.listPatientCarePlans(params), [client, serialized]);
|
|
111
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
112
|
+
};
|
|
113
|
+
exports.usePatientCarePlans = usePatientCarePlans;
|
|
114
|
+
const usePatientQuestionnaires = (params = {}) => {
|
|
115
|
+
const client = (0, index_1.useClient)();
|
|
116
|
+
const serialized = JSON.stringify(params);
|
|
117
|
+
const load = React.useCallback(() => client.listPatientQuestionnaires(params), [client, serialized]);
|
|
118
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
119
|
+
};
|
|
120
|
+
exports.usePatientQuestionnaires = usePatientQuestionnaires;
|
|
121
|
+
const usePatientQuestionnaireResponses = (params = {}) => {
|
|
122
|
+
const client = (0, index_1.useClient)();
|
|
123
|
+
const serialized = JSON.stringify(params);
|
|
124
|
+
const load = React.useCallback(() => client.listPatientQuestionnaireResponses(params), [client, serialized]);
|
|
125
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
126
|
+
};
|
|
127
|
+
exports.usePatientQuestionnaireResponses = usePatientQuestionnaireResponses;
|
|
128
|
+
const usePatientDevices = (params = {}) => {
|
|
129
|
+
const client = (0, index_1.useClient)();
|
|
130
|
+
const serialized = JSON.stringify(params);
|
|
131
|
+
const load = React.useCallback(() => client.listPatientDevices(params), [client, serialized]);
|
|
132
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
133
|
+
};
|
|
134
|
+
exports.usePatientDevices = usePatientDevices;
|
|
135
|
+
const usePatientNotifications = (params = {}) => {
|
|
136
|
+
const client = (0, index_1.useClient)();
|
|
137
|
+
const serialized = JSON.stringify(params);
|
|
138
|
+
const load = React.useCallback(() => client.listPatientNotifications(params), [client, serialized]);
|
|
139
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
140
|
+
};
|
|
141
|
+
exports.usePatientNotifications = usePatientNotifications;
|
|
92
142
|
const usePopulateQuestionnaire = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.populateQuestionnaire(params.questionnaireId, params.parameters));
|
|
93
143
|
exports.usePopulateQuestionnaire = usePopulateQuestionnaire;
|
|
94
144
|
const useSubmitQuestionnaireResponse = () => {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OvokI18nDocument, OvokLocalization, OvokLocalizationQuery, OvokLocalizationUpdate, OvokI18nValue, OvokLocales } from "../client/platform/types";
|
|
2
|
+
import { OvokMutationState, OvokRequestState } from "./api-hooks";
|
|
3
|
+
export declare const useLocales: () => OvokRequestState<OvokLocales>;
|
|
4
|
+
export declare const useLocalizations: (language: string, params?: OvokLocalizationQuery) => OvokRequestState<{
|
|
5
|
+
total: number;
|
|
6
|
+
resources: OvokLocalization[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useI18nextDocument: (language: string) => OvokRequestState<OvokI18nDocument>;
|
|
9
|
+
export declare const useUpdateLocalization: () => OvokMutationState<{
|
|
10
|
+
language: string;
|
|
11
|
+
key: string;
|
|
12
|
+
body: OvokLocalizationUpdate;
|
|
13
|
+
}, OvokLocalization>;
|
|
14
|
+
export declare const useUpdateI18nextDocument: () => OvokMutationState<{
|
|
15
|
+
language: string;
|
|
16
|
+
document: Record<string, OvokI18nValue>;
|
|
17
|
+
}, void>;
|
|
@@ -0,0 +1,63 @@
|
|
|
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.useUpdateI18nextDocument = exports.useUpdateLocalization = exports.useI18nextDocument = exports.useLocalizations = exports.useLocales = void 0;
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const api_hooks_1 = require("./api-hooks");
|
|
40
|
+
const index_1 = require("./index");
|
|
41
|
+
const useLocales = () => {
|
|
42
|
+
const client = (0, index_1.useClient)();
|
|
43
|
+
const load = React.useCallback(() => client.getLocales(), [client]);
|
|
44
|
+
return (0, api_hooks_1.useOvokRequest)(load);
|
|
45
|
+
};
|
|
46
|
+
exports.useLocales = useLocales;
|
|
47
|
+
const useLocalizations = (language, params = {}) => {
|
|
48
|
+
const client = (0, index_1.useClient)();
|
|
49
|
+
const serialized = JSON.stringify(params);
|
|
50
|
+
const load = React.useCallback(() => client.listLocalizations(language, params), [client, language, serialized]);
|
|
51
|
+
return (0, api_hooks_1.useOvokRequest)(load, language.length > 0);
|
|
52
|
+
};
|
|
53
|
+
exports.useLocalizations = useLocalizations;
|
|
54
|
+
const useI18nextDocument = (language) => {
|
|
55
|
+
const client = (0, index_1.useClient)();
|
|
56
|
+
const load = React.useCallback(() => client.getI18nextDocument(language), [client, language]);
|
|
57
|
+
return (0, api_hooks_1.useOvokRequest)(load, language.length > 0);
|
|
58
|
+
};
|
|
59
|
+
exports.useI18nextDocument = useI18nextDocument;
|
|
60
|
+
const useUpdateLocalization = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.updateLocalization(params.language, params.key, params.body));
|
|
61
|
+
exports.useUpdateLocalization = useUpdateLocalization;
|
|
62
|
+
const useUpdateI18nextDocument = () => (0, api_hooks_1.useOvokMutation)((client, params) => client.updateI18nextDocument(params.language, params.document));
|
|
63
|
+
exports.useUpdateI18nextDocument = useUpdateI18nextDocument;
|