Skip to content

routier-collection


routier-collection / plugins/replication/src / HttpPluginOptions

Interface: HttpPluginOptions ​

Defined in: plugins/replication/src/HttpDbPlugin.ts:71

Plugin configuration.

Extends ​

Properties ​

getUrl() ​

getUrl: (collectionName) => string

Defined in: plugins/replication/src/HttpDbPlugin.ts:30

Parameters ​

collectionName ​

string

Returns ​

string

Inherited from ​

HttpConnectionOptions.getUrl


databaseName? ​

optional databaseName: string

Defined in: plugins/replication/src/HttpDbPlugin.ts:40

See IDbPlugin.databaseName. getUrl is a caller-supplied function of collection name, so there is no origin this plugin can read without inventing a collection to ask about — hence a plain option with a shared default.

Set it whenever an application talks to more than one HTTP backend over the same schema: leaving both on the default makes them one database as far as subscriptions are concerned, and each would be notified of the other's writes.

Inherited from ​

HttpConnectionOptions.databaseName


getHeaders()? ​

optional getHeaders: () => Record<string, string> | Promise<Record<string, string>>

Defined in: plugins/replication/src/HttpDbPlugin.ts:42

Headers for every request (e.g. Authorization). Can be async. Re-evaluated per retry attempt.

Returns ​

Record<string, string> | Promise<Record<string, string>>

Inherited from ​

HttpConnectionOptions.getHeaders


ignoreQueryForCollections? ​

optional ignoreQueryForCollections: string[]

Defined in: plugins/replication/src/HttpDbPlugin.ts:47

Collection names for which to ignore the query and select everything. No filter, sort, skip, or take is sent; server returns full allowed set.

Inherited from ​

HttpConnectionOptions.ignoreQueryForCollections


requestTimeoutMs? ​

optional requestTimeoutMs: number

Defined in: plugins/replication/src/HttpDbPlugin.ts:49

Per-request timeout (ms); a hung connection fails instead of stalling forever. Default 30_000; 0 disables.

Inherited from ​

HttpConnectionOptions.requestTimeoutMs


minRequestIntervalMs? ​

optional minRequestIntervalMs: number

Defined in: plugins/replication/src/HttpDbPlugin.ts:58

Minimum gap between requests to the same URL (reads) or collection (writes). Default 100.

This plugin is the only place HTTP actually leaves the process, so pacing lives here: a composing plugin cannot leak past it, and an app using this plugin directly gets the same protection. Concurrent GETs for one URL collapse into a single request. 0 removes the gap; calls for one key still never overlap.

Inherited from ​

HttpConnectionOptions.minRequestIntervalMs


writeBatchDelayMs? ​

optional writeBatchDelayMs: number

Defined in: plugins/replication/src/HttpDbPlugin.ts:66

Quiet window (ms) used to batch writes to the same URL. Default 25.

Every POST accepted during the window contributes its adds/updates/removes (and opIds) to one request. The timer restarts when another write arrives, so a burst of ten saves becomes one POST rather than ten serialized POSTs. Set to 0 to disable batching.

Inherited from ​

HttpConnectionOptions.writeBatchDelayMs


translateRemoteResponse()? ​

optional translateRemoteResponse: (schema, data) => unknown

Defined in: plugins/replication/src/HttpDbPlugin.ts:68

Parameters ​

schema ​

CompiledSchema<UnknownRecord>

data ​

unknown

Returns ​

unknown

Inherited from ​

HttpConnectionOptions.translateRemoteResponse


onEvent()? ​

optional onEvent: (event) => void

Defined in: plugins/replication/src/syncHooks.ts:59

Parameters ​

event ​

SyncEvent

Returns ​

void

Inherited from ​

SyncHooks.onEvent


onError()? ​

optional onError: (error) => void

Defined in: plugins/replication/src/syncHooks.ts:60

Parameters ​

error ​

HttpRequestError

Returns ​

void

Inherited from ​

SyncHooks.onError

Released under the MIT License.