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

MemoryStorage

Methods

getItem()
getItem(key): string | null;

Returns the stored value, or null when the key is absent.

Parameters
ParameterType
keystring
Returns

string | null

Implementation of

OvokStorage.getItem

removeItem()
removeItem(key): void;

Deletes a key.

Parameters
ParameterType
keystring
Returns

void

Implementation of

OvokStorage.removeItem

setItem()
setItem(key, value): void;

Stores a value under a key.

Parameters
ParameterType
keystring
valuestring
Returns

void

Implementation of

OvokStorage.setItem


Ovok

One client per tenant; each namespace mirrors an area of the Ovok API.

Constructors

Constructor
new Ovok(config): Ovok;
Parameters
ParameterType
configOvokConfig
Returns

Ovok

Properties

PropertyModifierTypeDescription
accountsreadonlyAccountsResourceAccounts of the signed-in user.
aireadonlyAiResourceAI sessions.
authreadonlyAuthResourceSign-in, registration and password routes.
botsreadonlyBotsResourceBot execution.
cmsreadonlyCmsResourceContent management.
consentreadonlyConsentResourceConsent of the signed-in user.
contentreadonlyContentResourceProject content.
documentsreadonlyDocumentsResourceDocuments.
emailreadonlyEmailResourceEmail templates.
fhirreadonlyFhirResourceFHIR resource operations.
healthreadonlyHealthResourceServer health check.
invitesreadonlyInvitesResourceInvites to share records or join care.
localesreadonlyLocalesResourceProject languages.
localizationsreadonlyLocalizationsResourceTranslations.
measurementsreadonlyMeasurementsResourceSaving and reading measurements.
patientreadonlyPatientResourceThe signed-in patient's data.
projectsreadonlyProjectsResourceProject administration.
questionnaireResponsesreadonlyQuestionnaireResponsesResourceQuestionnaire responses.
questionnairesreadonlyQuestionnairesResourceQuestionnaires.
realtimereadonlyRealtimeResourceReal-time subscriptions.
sessionreadonlySessionResourceThe current user session.
sharingreadonlySharingResourcePatient sharing.
signalsreadonlySignalsResourceSignals data.
slimreadonlySlimResourceSlim API routes.
videoCallsreadonlyVideoCallsResourceVideo calls.
wearablesreadonlyWearablesResourceWearable 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
ParameterType
keystring
Returns

string | Promise<string | null> | null

removeItem()
removeItem(key): void | Promise<void>;

Deletes a key.

Parameters
ParameterType
keystring
Returns

void | Promise<void>

setItem()
setItem(key, value): void | Promise<void>;

Stores a value under a key.

Parameters
ParameterType
keystring
valuestring
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

PropertyTypeDescription
baseUrlstringAbsolute http(s) URL of the Ovok API.
fetch?OvokFetchCustom fetch implementation. Defaults to the global fetch.
fhirPath?stringPath of the FHIR API under baseUrl. Defaults to fhir.
maxNetworkRetries?numberRetries after a network failure. Defaults to 2.
onUnauthenticated?(reason) => voidCalled when the session can no longer be refreshed.
storage?OvokStorageWhere the session is kept. Defaults to in-memory storage.
tenantCodestringCode of the tenant the client works in.
timeoutMs?numberRequest 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

ParameterType
urlstring
initRequestInit

Returns

Promise<Response>


OvokMachineClientConfig

type OvokMachineClientConfig = object;

Client configuration for server-side machine credentials.

Properties

PropertyTypeDescription
clientIdstringID of the client application.
clientSecretstringSecret of the client application.

OvokUnauthenticatedReason

type OvokUnauthenticatedReason = object;

Why the client lost its session.

Properties

PropertyTypeDescription
statusnumberHTTP 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

PropertyTypeDescription
clientId?stringID of the client application, when one is used.
clientSecret?undefinedNot allowed for user clients.

Page

type Page<T> = object;

One page of a list result.

Type Parameters

Type Parameter
T

Properties

PropertyTypeDescription
dataT[]Items on this page.
hasMorebooleantrue when another page follows.
totalnumber | nullTotal 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

Type Parameter
T

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

PropertyTypeDescription
signal?AbortSignalAborts the request when signalled.
timeoutMs?numberTimeout in milliseconds; overrides the client's default.

Last updated on

On this page