lookup/services#

Classes#

ServiceClients#

Defined in: editor/src/lookup/services.ts:52

The clients of the services, one per endpoint, kept so each manifest is read once.

Constructors#

Constructor#

new ServiceClients(fetcher): ServiceClients

Defined in: editor/src/lookup/services.ts:56

Parameters#
fetcher#

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Returns#

ServiceClients

Methods#

clientOf()#

clientOf(service): ReconciliationClient

Defined in: editor/src/lookup/services.ts:61

The client of service, its errors naming the service’s system.

Parameters#
service#

Service

Returns#

ReconciliationClient

Interfaces#

Service#

Defined in: editor/src/lookup/services.ts:18

A Reconciliation Service API endpoint a profile file names.

Properties#

endpoint#

readonly endpoint: string

Defined in: editor/src/lookup/services.ts:23

The endpoint’s absolute URL.

id#

readonly id: string

Defined in: editor/src/lookup/services.ts:19

name#

readonly name: string

Defined in: editor/src/lookup/services.ts:21

What the editor calls it: the label of its system.

Variables#

SERVICE_PREFIX#

const SERVICE_PREFIX: "service:" = "service:"

Defined in: editor/src/lookup/services.ts:27

What a service’s system ID begins with.


SERVICE_RECONCILE_LIMIT#

const SERVICE_RECONCILE_LIMIT: 3 = 3

Defined in: editor/src/lookup/services.ts:32

The most candidates a reconciliation query asks a service for.


SERVICE_SEARCH_LIMIT#

const SERVICE_SEARCH_LIMIT: 10 = 10

Defined in: editor/src/lookup/services.ts:30

The candidates a search asks a service for.

Functions#

isServiceSystem()#

isServiceSystem(system): boolean

Defined in: editor/src/lookup/services.ts:40

Whether system names a service rather than a catalogue system.

Parameters#

system#

string

Returns#

boolean


reconcileService()#

reconcileService(clients, service, texts, signal?): Promise<readonly (Candidate | null)[]>

Defined in: editor/src/lookup/services.ts:125

The best candidate for each text, with the service’s match, null where it finds none: one request for all texts; blank texts are not asked, and only blank texts ask nothing.

Parameters#

clients#

ServiceClients

service#

Service

texts#

readonly string[]

signal?#

AbortSignal

Returns#

Promise<readonly (Candidate | null)[]>


searchService()#

searchService(clients, service, text, signal?): Promise<readonly Candidate[]>

Defined in: editor/src/lookup/services.ts:98

The entities service finds for text: its suggestions where its manifest offers them, else the candidates of one reconciliation query (at most SERVICE_SEARCH_LIMIT); blank text asks nothing.

Parameters#

clients#

ServiceClients

service#

Service

text#

string

signal?#

AbortSignal

Returns#

Promise<readonly Candidate[]>


serviceOf()#

serviceOf(services, system): Service | undefined

Defined in: editor/src/lookup/services.ts:45

The service whose system is system, among services.

Parameters#

services#

readonly Service[]

system#

string

Returns#

Service | undefined


serviceSystem()#

serviceSystem(id): string

Defined in: editor/src/lookup/services.ts:35

The system of the service id.

Parameters#

id#

string

Returns#

string