Class HonuaOdataEntitySet

Runtime handle for one OData entity set. Returned by Source.protocol("odata") so callers can reach the dialect-specific surface ($batch, $apply, $search, $deltatoken) without leaking OData-shaped types into the canonical Source API.

Constructors

Properties

basePath: string
client: HonuaClient
entitySet: string
entitySetName: string

Unqualified entity-set name used as the CSDL metadata-lookup key. Equals entitySet for direct paths like "Parcels". For layer-scoped navigation paths like "Layers(1)/Features" it is the navigation suffix "Features" so capability and schema lookups still find the entry the server emits in <EntitySet Name="…">.

Methods

  • Insert a row via POST /<entitySet>.

    Type Parameters

    • T = Record<string, unknown>

    Parameters

    • body: Record<string, unknown>
    • options: {
          signal?: AbortSignal;
      } = {}
      • Optionalsignal?: AbortSignal

    Returns Promise<T>

  • Run an $apply aggregation. The OData server applies the transformation pipeline (aggregate, groupby, filter, compute); the SDK returns the rows unchanged so callers can shape them onto the canonical Result.aggregateRows.

    Parameters

    • transformations: string
    • params: {
          filter?: string;
          signal?: AbortSignal;
      } = {}
      • Optionalfilter?: string
      • Optionalsignal?: AbortSignal

    Returns Promise<HonuaOdataAggregateResult>

  • Submit a $batch request using the OData JSON batch format. Multipart/mixed fallback is intentionally not implemented; Honua Server emits both formats but the JSON envelope is sufficient for the canonical surface and avoids the multipart parser.

    atomicity: "all" stamps the same atomicityGroup token on every request so the server runs them in one change-set with rollback on any failure (per OData v4 §11.7.7.3 and Honua Server's ODataBatchHandler, which groups by request.AtomicityGroup). atomicity: "none" (default) leaves the field unset so each request runs independently.

    Parameters

    Returns Promise<HonuaOdataBatchResult>

  • Delete a row via DELETE /<entitySet>(<key>).

    Parameters

    • key: string
    • options: {
          signal?: AbortSignal;
      } = {}
      • Optionalsignal?: AbortSignal

    Returns Promise<void>

  • $deltatoken-driven change feed. Yields HonuaOdataDeltaPage per server response. The final page carries deltaLink; callers persist the encoded token for the next call to delta({ since }).

    Type Parameters

    • T = Record<string, unknown>

    Parameters

    • options: {
          signal?: AbortSignal;
          since?: string;
      } = {}
      • Optionalsignal?: AbortSignal
      • Optionalsince?: string

    Returns AsyncGenerator<HonuaOdataDeltaPage<T>, void, undefined>

  • Drain server-driven @odata.nextLink pages. When params.top is supplied it is treated as a hard cap on collected rows. Callers that want a lookahead row to detect truncation must add it themselves; the canonical Source.queryAll path does this with top = limit + 1, while ids-only projections enforce their own result cap. Returning top + 1 here would double-count for callers that already added the lookahead, so this helper respects top exactly.

    Type Parameters

    • T = Record<string, unknown>

    Parameters

    Returns Promise<{
        rows: readonly T[];
        totalCount?: number;
    }>

  • Last-resort raw passthrough — flows through HonuaClient.pipelineFetch so auth headers, retry, timeout, interceptors, telemetry, and normalized error mapping all apply. The returned Response is unconsumed; callers pick .json(), .text(), or .arrayBuffer().

    Parameters

    • method: string
    • path: string
    • init: RequestInit = {}

    Returns Promise<Response>

  • Update a row via PATCH /<entitySet>(<key>). The OData server in Honua Server intentionally does not implement PUT; the SDK issues PATCH with the full canonical body to match a PUT replacement on the canonical surface (documented in docs/protocol-capability-matrix.md under the OData section).

    Type Parameters

    • T = Record<string, unknown>

    Parameters

    • key: string
    • body: Record<string, unknown>
    • options: {
          signal?: AbortSignal;
      } = {}
      • Optionalsignal?: AbortSignal

    Returns Promise<undefined | T>