@honua/sdk-js
    Preparing search index...

    Class HonuaClientExperimental

    A native client whose transport and adapters can be bundled for the browser.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    applyEdits applyServiceEdits cancelOgcProcessJob checkCompatibility clearAuthCredentials clearMetadataCache createOgcItem deleteOgcItem describeLayer describeService executeOgcProcess exportMap featureLayer fetchOgcRecordRaw fetchOgcRecordsRaw fetchOgcTile fetchWmtsTile findMap geometryService geoprocessing geoprocessingRunner geospatialGrpcProcessRunner getAuthHeaders getAuthToken getCatalogItem getCompatibility getFeatureServiceMetadata getLayerMetadata getMapLayerMetadata getMapLegend getMapServiceMetadata getOgcCollection getOgcCollectionTileset getOgcFeaturesConformance getOgcFeaturesLanding getOgcItem getOgcMapImage getOgcMapsConformance getOgcMapsLanding getOgcProcess getOgcProcessesConformance getOgcProcessesLanding getOgcProcessJob getOgcProcessJobResults getOgcQueryables getOgcRecord getOgcRecordCollection getOgcRecordsConformance getOgcRecordsLanding getOgcTileMatrixSet getOgcTilesConformance getOgcTilesLanding getStacCollection getStacItem getStacLanding getWmsCapabilities getWmsFeatureInfo getWmsLegend getWmsMap getWmtsCapabilities getWmtsFeatureInfo identifyMap imageService listCatalog listOgcCollections listOgcCollectionTilesets listOgcItems listOgcProcesses listOgcRecordCollections listOgcTileMatrixSets listServices listStacCollections loadGrpcAdapter loadGrpcWebRuntime mapLayer mapService odata ogcFeatures ogcMaps ogcProcesses ogcProcessRunner ogcRecords ogcTiles patchOgcItem pipelineFetch pipelineRequestJson processRunner queryFeatures queryFeaturesStream queryMapLayer queryMapRelatedRecords queryRelatedRecords refreshAuthCredentials replaceOgcItem request requestText resolveOgcFeaturesLayout revokeAuthCredentials scanMigrationSource searchOgcRecords searchStac service stac supportsFeature wfs wms wmts

    Constructors

    Properties

    attachments: Readonly<
        {
            abortUpload: (
                request: MessageInit<AbortAttachmentUploadRequest>,
                options?: CallOptions,
            ) => Promise<Message<"geospatial.v1.AbortAttachmentUploadResponse">>;
            beginUpload: (
                request: MessageInit<BeginAttachmentUploadRequest>,
                options?: CallOptions,
            ) => Promise<BeginAttachmentUploadResponse>;
            commitUpload: (
                request: MessageInit<CommitAttachmentUploadRequest>,
                options?: CallOptions,
            ) => Promise<CommitAttachmentUploadResponse>;
            delete: (
                request: MessageInit<DeleteAttachmentRequest>,
                options?: CallOptions,
            ) => Promise<DeleteAttachmentResponse>;
            downloadUrl: (
                request: MessageInit<GetAttachmentUrlRequest>,
                options?: CallOptions,
            ) => Promise<GetAttachmentUrlResponse>;
            list: (
                request: MessageInit<ListAttachmentsRequest>,
                options?: CallOptions,
            ) => Promise<ListAttachmentsResponse>;
            upload: (
                request: MessageInit<UploadAttachmentRequest>,
                options?: CallOptions,
            ) => Promise<UploadAttachmentResponse>;
            uploadChunk: (
                request: MessageInit<UploadAttachmentChunkRequest>,
                options?: CallOptions,
            ) => Promise<UploadAttachmentChunkResponse>;
        },
    > = ...

    Native unary attachment operations; requires transport: grpc-web.

    minimumSupportedServerReleaseChannel: "preview" = MINIMUM_SUPPORTED_SERVER_RELEASE_CHANNEL
    minimumSupportedServerVersion: "2026.1.0-0" = HONUA_MINIMUM_SUPPORTED_SERVER_VERSION

    The minimum Honua server version this SDK is contractually tested against.

    Accessors

    • get serverBaseUrl(): string
      Experimental

      Normalized base URL the client was constructed with (trailing slashes trimmed). Helpers that build absolute URLs without going through request() (e.g. tile URL generators) read this so they produce the same origin and base path the server actually serves from.

      Returns string

    Methods

    • Experimental

      Apply edits to several layers of one service in one call (parent and child rows together). gRPC-Web uses ApplyServiceEdits with no REST fallback; REST uses the service-level applyEdits.

      Parameters

      • request: ApplyServiceEditsRequest

      Returns Promise<HonuaApplyServiceEditsResponse>

    • Experimental

      Read typed fields, domains, templates and capabilities over gRPC-Web.

      Parameters

      • request: { layerId: number; serviceId: string; signal?: AbortSignal }

      Returns Promise<DescribeLayerResponse>

    • Experimental

      Read the native service descriptor without a REST metadata request.

      Parameters

      • request: {
            pageSize?: number;
            pageToken?: string;
            serviceId: string;
            signal?: AbortSignal;
        }

      Returns Promise<DescribeServiceResponse>

    • Experimental

      Construct a typed wrapper for a single FeatureServer layer.

      The returned HonuaFeatureLayer carries the same serviceId / layerId on every call so you can write await layer.queryFeatures({ where: "..." }) without restating the address.

      Type Parameters

      • T = Record<string, unknown>

        The attribute shape of features in this layer.

      Parameters

      • serviceId: string
      • layerId: number

      Returns HonuaFeatureLayer<T>

      const parcels = client.featureLayer<{ NAME: string; STATUS: string }>("parcels", 0);
      const { features } = await parcels.queryFeatures({ where: "STATUS = 'ACTIVE'" });
    • Experimental

      Resolve the auth headers the client would attach to an outgoing request right now, refreshing provider credentials first if they are expiring.

      Transports that build their own connection outside the REST/gRPC pipeline — notably realtime SSE streams, which must re-authenticate on every (re)connect so a refreshed token is picked up after a drop — call this per connect to obtain fresh credentials. Returns an empty object when no credentials are configured.

      Returns Promise<Record<string, string>>

    • Experimental

      Resolve just the current bearer/authorization token value (without the Bearer scheme prefix when a plain bearer token is configured), or undefined if none. Convenience for realtime transports that must carry the token as a query parameter (native EventSource cannot set headers).

      Returns Promise<string | undefined>

    • Experimental

      Parameters

      • request: {
            collectionId: string | number;
            extraParams?: Record<string, string | number | boolean>;
            itemId: string | number;
            responseFormat?: string;
            signal?: AbortSignal;
        }

      Returns Promise<HonuaStacItemResponse>

    • Experimental

      Fetch and parse a WMS GetCapabilities document for the addressed service. The XML body decodes through requestText; the parsed shape is the typed WmsCapabilities envelope (no XML node leaks through the public surface).

      Parameters

      • request: {
            extraParams?: Record<string, string | number | boolean>;
            serviceId: string;
            signal?: AbortSignal;
            version?: string;
        }

      Returns Promise<WmsCapabilities>

    • Experimental

      Override in the explicit browser entrypoint to bind the optional runtime.

      Returns Promise<
          {
              createClient: <T extends DescService>(
                  service: T,
                  transport: Transport,
              ) => Client<T>;
              createGrpcWebTransport: (options: GrpcWebTransportOptions) => Transport;
              FeatureService: GenService<
                  {
                      abortAttachmentUpload: {
                          input: GenMessage<AbortAttachmentUploadRequest>;
                          methodKind: "unary";
                          output: GenMessage<
                              Message<"geospatial.v1.AbortAttachmentUploadResponse">,
                          >;
                      };
                      applyEdits: {
                          input: GenMessage<ApplyEditsRequest>;
                          methodKind: "unary";
                          output: GenMessage<ApplyEditsResponse>;
                      };
                      applyServiceEdits: {
                          input: GenMessage<ApplyServiceEditsRequest>;
                          methodKind: "unary";
                          output: GenMessage<ApplyServiceEditsResponse>;
                      };
                      beginAttachmentUpload: {
                          input: GenMessage<BeginAttachmentUploadRequest>;
                          methodKind: "unary";
                          output: GenMessage<BeginAttachmentUploadResponse>;
                      };
                      commitAttachmentUpload: {
                          input: GenMessage<CommitAttachmentUploadRequest>;
                          methodKind: "unary";
                          output: GenMessage<CommitAttachmentUploadResponse>;
                      };
                      deleteAttachment: {
                          input: GenMessage<DeleteAttachmentRequest>;
                          methodKind: "unary";
                          output: GenMessage<DeleteAttachmentResponse>;
                      };
                      describeLayer: {
                          input: GenMessage<DescribeLayerRequest>;
                          methodKind: "unary";
                          output: GenMessage<DescribeLayerResponse>;
                      };
                      describeService: {
                          input: GenMessage<DescribeServiceRequest>;
                          methodKind: "unary";
                          output: GenMessage<DescribeServiceResponse>;
                      };
                      getAttachmentUrl: {
                          input: GenMessage<GetAttachmentUrlRequest>;
                          methodKind: "unary";
                          output: GenMessage<GetAttachmentUrlResponse>;
                      };
                      listAttachments: {
                          input: GenMessage<ListAttachmentsRequest>;
                          methodKind: "unary";
                          output: GenMessage<ListAttachmentsResponse>;
                      };
                      queryFeatures: {
                          input: GenMessage<QueryFeaturesRequest>;
                          methodKind: "unary";
                          output: GenMessage<QueryFeaturesResponse>;
                      };
                      queryFeaturesStream: {
                          input: GenMessage<QueryFeaturesRequest>;
                          methodKind: "server_streaming";
                          output: GenMessage<FeaturePage>;
                      };
                      queryRelatedRecords: {
                          input: GenMessage<QueryRelatedRecordsRequest>;
                          methodKind: "unary";
                          output: GenMessage<QueryRelatedRecordsResponse>;
                      };
                      uploadAttachment: {
                          input: GenMessage<UploadAttachmentRequest>;
                          methodKind: "unary";
                          output: GenMessage<UploadAttachmentResponse>;
                      };
                      uploadAttachmentChunk: {
                          input: GenMessage<UploadAttachmentChunkRequest>;
                          methodKind: "unary";
                          output: GenMessage<UploadAttachmentChunkResponse>;
                      };
                  },
              >;
          },
      >

    • Experimental

      Construct the OGC API Features client wrapper.

      Use this to walk collections (landing(), conformance(), collections()), read items (items(), item()), and apply edits (create* / replace* / patch* / delete*) against an OGC API Features endpoint exposed by the Honua server.

      Returns HonuaOgcFeatures

      const features = client.ogcFeatures();
      const collections = await features.collections();
      const items = await features.items("parcels", { limit: 100 });
    • Experimental

      Pipeline-aware request that returns the raw Response after the shared auth / retry / timeout / interceptor pipeline finishes successfully. Used by adapters that need to consume non-JSON bodies (OData $metadata XML, raw passthrough) without inheriting the Accept: application/json default of pipelineRequestJson.

      The returned Response is unconsumed — the caller picks .json(), .text(), or .arrayBuffer(). Non-2xx responses still throw the normalized HonuaHttpError (and trigger retries) so error handling matches every other client method. The request deadline and caller cancellation remain active while consuming the response body. Consume or cancel the body to release that lifecycle.

      Parameters

      • method: QueryMethod
      • path: string
      • Optionalinit: RequestInit
      • OptionalcallerSignal: AbortSignal
      • options: {
            beforeAttempt?: (
                request: Readonly<HonuaRequestContext>,
                attempt: number,
            ) => void | Promise<void>;
            beforeReplay?: (
                request: Readonly<HonuaRequestContext>,
                statusCode: number | undefined,
                reason: "authentication" | "retry",
            ) => void | Promise<void>;
            discardErrorBody?: boolean;
            errorBody?: (
                response: Response,
                deadlineSignal: AbortSignal | undefined,
            ) => Promise<unknown>;
            okStatuses?: readonly number[];
            prepareResponse?: (
                response: Response,
                deadlineSignal: AbortSignal | undefined,
            ) => Promise<Response>;
            redirect?: "error" | "manual" | "safe-follow";
        } = {}
        • OptionalbeforeAttempt?: (
              request: Readonly<HonuaRequestContext>,
              attempt: number,
          ) => void | Promise<void>

          Invoked immediately before every physical fetch attempt, including retry and replay-safe authentication attempts. Bounded callers use this guard to reserve request and byte budgets before network I/O.

        • OptionalbeforeReplay?: (
              request: Readonly<HonuaRequestContext>,
              statusCode: number | undefined,
              reason: "authentication" | "retry",
          ) => void | Promise<void>

          Invoked before credential refresh or retry backoff can lead to another physical request. Single-attempt binary lanes throw here so a response that cannot be replayed never waits on work whose only purpose is replay.

        • OptionaldiscardErrorBody?: boolean
        • OptionalerrorBody?: (
              response: Response,
              deadlineSignal: AbortSignal | undefined,
          ) => Promise<unknown>

          Builds the body retained by HonuaHttpError for unsuccessful responses. Bounded protocol clients use this hook to consume failure bodies under the same byte ceiling as successful responses.

        • OptionalokStatuses?: readonly number[]
        • OptionalprepareResponse?: (
              response: Response,
              deadlineSignal: AbortSignal | undefined,
          ) => Promise<Response>

          Validate and replace a successful response before after interceptors run. The callback remains inside the request timeout and receives its combined caller/deadline signal. Bounded binary lanes use this to consume the network stream under a hard ceiling, then return an in-memory response that interceptors may inspect safely.

        • Optionalredirect?: "error" | "manual" | "safe-follow"

      Returns Promise<Response>

    • Experimental

      Pipeline-aware JSON request that bypasses the GeoServices f=json convention used by request. Adapters whose protocols do not model f= (OData, OGC API, …) call this directly so they keep the shared auth / retry / timeout / interceptor pipeline without sending a query parameter the server would reject as InvalidQueryOption.

      Caller-supplied query parameters belong on path itself; init carries the body, headers, and abort signal. The default Accept header is application/json; pass an explicit Accept in init.headers to override.

      Type Parameters

      • T = unknown

      Parameters

      • method: QueryMethod
      • path: string
      • Optionalinit: { body?: BodyInit | null; headers?: HeadersInit }
      • Optionalsignal: AbortSignal

      Returns Promise<T>

    • Experimental

      Run a GeoServices FeatureServer/query request against a Honua-hosted layer.

      This is the canonical low-level read path. It maps directly to the FeatureServer query endpoint and accepts the full ArcGIS query shape (where, outFields, geometry, spatialRel, orderByFields, resultRecordCount, outSr, ...).

      For cross-protocol code (OGC, WFS, OData, STAC), prefer the protocol-neutral createDataset contract — it normalizes capability differences and gives you Source.query(...) plus paginated Source.queryAll(...) with explicit exceededTransferLimit reporting.

      Parameters

      Returns Promise<HonuaQueryResponse>

      const { features, exceededTransferLimit } = await client.queryFeatures({
      serviceId: "parcels",
      layerId: 0,
      where: "STATUS = 'ACTIVE'",
      outFields: ["OBJECTID", "NAME"],
      returnGeometry: true,
      outSr: 4326,
      resultRecordCount: 500,
      });

      if (exceededTransferLimit) {
      // re-issue with `resultOffset` or use queryFeaturesStream / dataset.source().queryAll()
      }
    • Experimental

      Consume the native gRPC FeatureService server stream. Each yielded chunk is a HonuaFeature[] slice. The server controls batching and may apply a total result limit, including its default when resultRecordCount is absent. Use featureLayer(...).queryFeaturesStream() or Source.stream() to page through the full match set with a caller-selected per-batch budget.

      Parameters

      Returns AsyncGenerator<HonuaFeature[], void, undefined>

      for await (const page of client.queryFeaturesStream({ serviceId: "parcels", layerId: 0, where: "1=1" })) {
      process(page);
      }
    • Experimental

      Fetch a text response (e.g. XML / JSON / plain) with an explicit Accept negotiation. Used by the WFS adapter for GetCapabilities, Transaction responses, and ExceptionReport bodies, and by the WMS / WMTS Capabilities pipelines. Routes through the same interceptor / retry / abort pipeline as requestJson / requestBytes, so adapter callers do not need to bypass HonuaClient to reach fetch directly.

      Parameters

      • method: QueryMethod
      • path: string
      • Optionaloptions: {
            accept?: string;
            body?: BodyInit;
            contentType?: string;
            maxResponseBytes?: number;
            signal?: AbortSignal;
        }
        • Optionalaccept?: string
        • Optionalbody?: BodyInit
        • OptionalcontentType?: string
        • OptionalmaxResponseBytes?: number

          Maximum response-body bytes accepted before text decoding/parsing.

        • Optionalsignal?: AbortSignal

      Returns Promise<{ contentType: string; status: number; text: string }>

    • Experimental

      Resolve (and memoize) the OGC API Features endpoint layout for the given discovery mode. honua-facade (default) returns the fixed /ogc/features/... fast path with no network access; ogc-api and auto discover the layout from the server's landing page per OGC API

      • Common so the same typed surface works against pygeoapi / ldproxy / GeoServer. Discovery is cached per mode for the life of the client (the layout is a function of the fixed baseUrl).

      Parameters

      • mode: OgcApiLayoutMode = "honua-facade"

      Returns Promise<OgcEndpointLayout>