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
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
| Parameter | Type |
|---|---|
handler | (token, meta?) => void |
Returns
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
| Parameter | Type |
|---|---|
opts? | { signal?: AbortSignal; } |
opts.signal? | AbortSignal |
Returns
Promise<boolean>
Inherited from
pullDataset()
pullDataset(name, opts): Promise<DatasetPage>;
Defined in: contract.ts:65
Parameters
| Parameter | Type |
|---|---|
name | string |
opts | { signal?: AbortSignal; since?: string; } |
opts.signal? | AbortSignal |
opts.since? | string |
Returns
Promise<DatasetPage>
Inherited from
pullForms()
pullForms(opts): Promise<FormsPage>;
Defined in: contract.ts:64
Parameters
| Parameter | Type |
|---|---|
opts | { signal?: AbortSignal; since?: string; } |
opts.signal? | AbortSignal |
opts.since? | string |
Returns
Promise<FormsPage>
Inherited from
pushSubmissions()
pushSubmissions(batch, opts): Promise<SubmissionAck[]>;
Defined in: contract.ts:58
Parameters
| Parameter | Type |
|---|---|
batch | Submission[] |
opts | { idempotencyKey: string; signal?: AbortSignal; } |
opts.idempotencyKey | string |
opts.signal? | AbortSignal |
Returns
Promise<SubmissionAck[]>
Inherited from
registerDevice()?
optional registerDevice(info): Promise<{
policy?: Partial<SyncPolicy>;
}>;
Defined in: contract.ts:67
Optional: register the device and read back server policy.
Parameters
| Parameter | Type |
|---|---|
info | { appVersion?: string; deviceId: string; platform: string; } |
info.appVersion? | string |
info.deviceId | string |
info.platform | string |
Returns
Promise<{
policy?: Partial<SyncPolicy>;
}>
Inherited from
uploadAttachment()
uploadAttachment(upload, opts): Promise<{
remoteId: string;
}>;
Defined in: contract.ts:60
Resumable; onProgress reports bytes sent so far for this attachment.
Parameters
| Parameter | Type |
|---|---|
upload | AttachmentUpload |
opts | { onProgress?: (sentBytes) => void; signal?: AbortSignal; } |
opts.onProgress? | (sentBytes) => void |
opts.signal? | AbortSignal |
Returns
Promise<{
remoteId: string;
}>