Interface OdataDeltaTransportOptions<TFeature>

interface OdataDeltaTransportOptions<TFeature> {
    entityId: ((entity: OdataDeltaEntity) => FeatureId);
    fetchImpl?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    };
    headers?: (() => Record<string, string>);
    initialQuery?: OdataDeltaInitialQuery;
    isDeltaLinkExpiredResponse?: ((status: number, body: unknown) => boolean);
    isRelationshipDeltaEntry?: ((entry: OdataDeltaEntity) => boolean);
    maxConsecutiveResnapshots?: number;
    maxPagesPerCycle?: number;
    maxSnapshotRows?: number;
    now?: (() => number);
    onPoll?: ((telemetry: OdataDeltaPollTelemetry) => void);
    pollIntervalMs: number;
    toFeature?: ((entity: OdataDeltaEntity) => TFeature);
    url: string;
}

Type Parameters

  • TFeature = unknown

Properties

entityId: ((entity: OdataDeltaEntity) => FeatureId)

Extract a stable entity id from a raw OData entity for RealtimeFeaturePatch.id.

fetchImpl?: {
    (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
    (input: string | URL | Request, init?: RequestInit): Promise<Response>;
}

Injectable fetch; defaults to globalThis.fetch.

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

      • input: string | URL | Request
      • Optionalinit: RequestInit

      Returns Promise<Response>

headers?: (() => Record<string, string>)

Request headers, recomputed for every request (e.g. a fresh bearer token).

initialQuery?: OdataDeltaInitialQuery

$filter / $select / $orderby / $top applied only to the initial snapshot request.

isDeltaLinkExpiredResponse?: ((status: number, body: unknown) => boolean)

Classify a non-ok response as an expired/rejected delta link that should trigger an explicit resnapshot rather than a generic transport failure.

status => status === 410
isRelationshipDeltaEntry?: ((entry: OdataDeltaEntity) => boolean)

Identify an OData delta-payload entry as an unsupported relationship (link) change rather than an entity change, per REQ-003. Relationship deltas fail explicitly instead of being silently dropped or misinterpreted as an entity upsert.

entry with string source, relationship, and target properties

maxConsecutiveResnapshots?: number

Consecutive expired-delta-link resnapshots tolerated before failing closed.

3
maxPagesPerCycle?: number

Safety bound on @odata.nextLink pages followed within one cycle.

500
maxSnapshotRows?: number

Safety bound on rows collected by one snapshot cycle.

50_000
now?: (() => number)
onPoll?: ((telemetry: OdataDeltaPollTelemetry) => void)
pollIntervalMs: number

Delay between the end of one accepted cycle and the start of the next.

toFeature?: ((entity: OdataDeltaEntity) => TFeature)

Project a raw OData entity into the feature payload.

the entity with @-prefixed annotations stripped

url: string

Absolute OData entity-set collection URL, e.g. "https://host/odata/Incidents". Every @odata.nextLink / @odata.deltaLink this transport follows, and any resumed resumeFrom.deltaToken, must resolve to this exact origin and path (REQ-002).