@deltares/fews-ssd-requests
Version:
Library for making requests to the FEWS SSD webservice
52 lines (51 loc) • 2.25 kB
TypeScript
/**
* The SsdWebserviceProvider class is used to obtain
* Schematic Status Display (SSD) data and process it
*/
import type { ActionRequest } from "./response/requests/actionRequest.js";
import { ElementAction } from "./response/action/elementAction.js";
import { TimeSeriesResponse as FewsPiTimeSeriesResponse } from '@deltares/fews-pi-requests';
import { type TransformRequestFunction } from "@deltares/fews-web-oc-utils";
import { ExcludeGroups, SsdActionsResponse, SsdGetCapabilitiesResponse } from "./response/index.js";
export declare class SsdWebserviceProvider {
private _ssdUrl;
private _piUrl;
private readonly SSD_ENDPOINT;
private readonly PI_ENDPOINT;
private piWebservice;
private ssdWebservice;
/**
* Constructor for SsdWebserviceProvider
*
* @param url the base url where the SSD servive is available
* @param {Object} [options] Optional constructor options
* @param {TransformRequestFunction} [options.transformRequestFn] A function that can be used to modify the Request
* before it is sent to the server. This function takes a Request as a parameter and returns the modified Request.
* If this option is not specified, the Request will be sent as is.
*/
constructor(url: string, options?: {
transformRequestFn?: TransformRequestFunction;
});
getSvg(url: string): Promise<SVGElement>;
/**
* Retrieve the SSD actions for a specific SVG element on a specific panel
* Raises an error if the element is not part of the FEWS namespace
*/
getActionFromElement(element: SVGElement, actionRequest: ActionRequest): Promise<ElementAction>;
/**
* Retrieve a PI timeseries using the request path supplied in a action
*/
fetchPiRequest(request: string): Promise<FewsPiTimeSeriesResponse>;
/**
* Retrieve the SSD actions for a specific object id on a specific panel
*/
getAction(actionRequest: ActionRequest): Promise<SsdActionsResponse>;
/**
* Get the url to retrieve an SSD panel
*/
urlForPanel(panelName: string, date: Date): string;
/**
* Retrieve the SSD capabilities
*/
getCapabilities(excludeGroups?: ExcludeGroups): Promise<SsdGetCapabilitiesResponse>;
}