Ovok client
Generated reference for @ovok/core: Ovok client.
- Stable unknown
- Release candidate since 0.4.49-rc.4
- Development since 0.4.49-dev.517+4645a0a
Classes
MemoryStorage
In-memory OvokStorage that loses its data when the process ends.
Implements
Constructors
Constructor
new MemoryStorage(): MemoryStorage;Returns
Methods
getItem()
getItem(key): string | null;Returns the stored value, or null when the key is absent.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
string | null
Implementation of
removeItem()
removeItem(key): void;Deletes a key.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
void
Implementation of
setItem()
setItem(key, value): void;Stores a value under a key.
Parameters
| Parameter | Type |
|---|---|
key | string |
value | string |
Returns
void
Implementation of
Ovok
One client per tenant; each namespace mirrors an area of the Ovok API.
Constructors
Constructor
new Ovok(config): Ovok;Parameters
| Parameter | Type |
|---|---|
config | OvokConfig |
Returns
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
accounts | readonly | AccountsResource | Accounts of the signed-in user. |
ai | readonly | AiResource | AI sessions. |
auth | readonly | AuthResource | Sign-in, registration and password routes. |
bots | readonly | BotsResource | Bot execution. |
cms | readonly | CmsResource | Content management. |
consent | readonly | ConsentResource | Consent of the signed-in user. |
content | readonly | ContentResource | Project content. |
documents | readonly | DocumentsResource | Documents. |
email | readonly | EmailResource | Email templates. |
fhir | readonly | FhirResource | FHIR resource operations. |
health | readonly | HealthResource | Server health check. |
invites | readonly | InvitesResource | Invites to share records or join care. |
locales | readonly | LocalesResource | Project languages. |
localizations | readonly | LocalizationsResource | Translations. |
measurements | readonly | MeasurementsResource | Saving and reading measurements. |
patient | readonly | PatientResource | The signed-in patient's data. |
projects | readonly | ProjectsResource | Project administration. |
questionnaireResponses | readonly | QuestionnaireResponsesResource | Questionnaire responses. |
questionnaires | readonly | QuestionnairesResource | Questionnaires. |
realtime | readonly | RealtimeResource | Real-time subscriptions. |
session | readonly | SessionResource | The current user session. |
sharing | readonly | SharingResource | Patient sharing. |
signals | readonly | SignalsResource | Signals data. |
slim | readonly | SlimResource | Slim API routes. |
videoCalls | readonly | VideoCallsResource | Video calls. |
wearables | readonly | WearablesResource | Wearable connections. |
Interfaces
OvokStorage
Key-value storage the client keeps sessions in; every method may be sync or async.
Methods
getItem()
getItem(key): string | Promise<string | null> | null;Returns the stored value, or null when the key is absent.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
string | Promise<string | null> | null
removeItem()
removeItem(key): void | Promise<void>;Deletes a key.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
void | Promise<void>
setItem()
setItem(key, value): void | Promise<void>;Stores a value under a key.
Parameters
| Parameter | Type |
|---|---|
key | string |
value | string |
Returns
void | Promise<void>
Type Aliases
HttpMethod
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";HTTP methods the client sends.
OvokBaseConfig
type OvokBaseConfig = object;Options shared by every client configuration.
Properties
| Property | Type | Description |
|---|---|---|
baseUrl | string | Absolute http(s) URL of the Ovok API. |
fetch? | OvokFetch | Custom fetch implementation. Defaults to the global fetch. |
fhirPath? | string | Path of the FHIR API under baseUrl. Defaults to fhir. |
maxNetworkRetries? | number | Retries after a network failure. Defaults to 2. |
onUnauthenticated? | (reason) => void | Called when the session can no longer be refreshed. |
storage? | OvokStorage | Where the session is kept. Defaults to in-memory storage. |
tenantCode | string | Code of the tenant the client works in. |
timeoutMs? | number | Request timeout, in milliseconds. Defaults to 30000. |
OvokConfig
type OvokConfig = OvokBaseConfig & (
| OvokUserClientConfig
| OvokMachineClientConfig);Configuration of the Ovok client. A clientSecret (with clientId) selects server-side machine credentials,
which are rejected in a browser.
OvokFetch
type OvokFetch = (url, init) => Promise<Response>;Fetch implementation used for every request.
Parameters
| Parameter | Type |
|---|---|
url | string |
init | RequestInit |
Returns
Promise<Response>
OvokMachineClientConfig
type OvokMachineClientConfig = object;Client configuration for server-side machine credentials.
Properties
| Property | Type | Description |
|---|---|---|
clientId | string | ID of the client application. |
clientSecret | string | Secret of the client application. |
OvokUnauthenticatedReason
type OvokUnauthenticatedReason = object;Why the client lost its session.
Properties
| Property | Type | Description |
|---|---|---|
status | number | HTTP status of the rejection. |
type | "refresh-rejected" | The refresh token was rejected by the server. |
OvokUserClientConfig
type OvokUserClientConfig = object;Client configuration for end users, without a secret.
Properties
| Property | Type | Description |
|---|---|---|
clientId? | string | ID of the client application, when one is used. |
clientSecret? | undefined | Not allowed for user clients. |
Page
type Page<T> = object;One page of a list result.
Type Parameters
Properties
| Property | Type | Description |
|---|---|---|
data | T[] | Items on this page. |
hasMore | boolean | true when another page follows. |
total | number | null | Total number of items, or null when the server does not report it. |
PagePromise
type PagePromise<T> = Promise<Page<T>> & AsyncIterable<T>;Await it for the first page, or for await over it to walk every page.
Type Parameters
QueryParams
type QueryParams = Record<string, QueryValue>;Query parameters by name.
QueryValue
type QueryValue = string | number | boolean | readonly string[] | undefined;A query parameter value; an array repeats the parameter, and undefined omits it.
RequestOptions
type RequestOptions = object;Per-request options.
Properties
Last updated on