Skip to main content

Interface: RspTransport

Defined in: rsp-transport.ts:70

What the engine needs from a server. Implementations must translate their own errors into RasdError with the codes in docs/10 §1.4 so the retry classifier can act on them.

Extends​

Properties​

kind​

readonly kind: "rsp";

Defined in: rsp-transport.ts:71

Overrides​

SyncTransport.kind


lastLicenseToken​

readonly lastLicenseToken: string | null;

Defined in: rsp-transport.ts:73

The most recent X-Rasd-License value, or null if none was ever sent.

Methods​

onLicenseToken()​

onLicenseToken(handler): Unsubscribe;

Defined in: types.ts:49

Parameters​

ParameterType
handler(token, meta?) => void

Returns​

Unsubscribe

Inherited from​

LicenseAwareTransport.onLicenseToken


probe()?​

optional probe(opts?): Promise<boolean>;

Defined in: contract.ts:82

Optional: is the real server reachable right now?

navigator.onLine answers "is there a network interface", which on the connection that matters most — hotel, office and airport wifi behind a captive portal — is true while nothing can actually reach the API. The engine calls this before it will push, so a portal parks the queue instead of feeding it to a login page.

Resolve false rather than throwing for an unreachable server; throwing is reserved for a probe that could not be attempted at all. A transport that omits this keeps the old behaviour (trust navigator.onLine), so a third-party transport does not break by not implementing it.

Parameters​

ParameterType
opts?{ signal?: AbortSignal; }
opts.signal?AbortSignal

Returns​

Promise<boolean>

Inherited from​

SyncTransport.probe


pullDataset()​

pullDataset(name, opts): Promise<DatasetPage>;

Defined in: contract.ts:65

Parameters​

ParameterType
namestring
opts{ signal?: AbortSignal; since?: string; }
opts.signal?AbortSignal
opts.since?string

Returns​

Promise<DatasetPage>

Inherited from​

SyncTransport.pullDataset


pullForms()​

pullForms(opts): Promise<FormsPage>;

Defined in: contract.ts:64

Parameters​

ParameterType
opts{ signal?: AbortSignal; since?: string; }
opts.signal?AbortSignal
opts.since?string

Returns​

Promise<FormsPage>

Inherited from​

SyncTransport.pullForms


pushSubmissions()​

pushSubmissions(batch, opts): Promise<SubmissionAck[]>;

Defined in: contract.ts:58

Parameters​

ParameterType
batchSubmission[]
opts{ idempotencyKey: string; signal?: AbortSignal; }
opts.idempotencyKeystring
opts.signal?AbortSignal

Returns​

Promise<SubmissionAck[]>

Inherited from​

SyncTransport.pushSubmissions


registerDevice()?​

optional registerDevice(info): Promise<{
policy?: Partial<SyncPolicy>;
}>;

Defined in: contract.ts:67

Optional: register the device and read back server policy.

Parameters​

ParameterType
info{ appVersion?: string; deviceId: string; platform: string; }
info.appVersion?string
info.deviceIdstring
info.platformstring

Returns​

Promise<{ policy?: Partial<SyncPolicy>; }>

Inherited from​

SyncTransport.registerDevice


uploadAttachment()​

uploadAttachment(upload, opts): Promise<{
remoteId: string;
}>;

Defined in: contract.ts:60

Resumable; onProgress reports bytes sent so far for this attachment.

Parameters​

ParameterType
uploadAttachmentUpload
opts{ onProgress?: (sentBytes) => void; signal?: AbortSignal; }
opts.onProgress?(sentBytes) => void
opts.signal?AbortSignal

Returns​

Promise<{ remoteId: string; }>

Inherited from​

SyncTransport.uploadAttachment