import { DateTime, Duration } from "luxon"; import { NslcId } from "./fdsnsourceid.mjs"; export declare const SEEDLINK_PATH = "seedlink"; export declare const DATALINK_PATH = "datalink"; export type RingserverVersion = { ringserverVersion: string; serverId: string; }; export type StreamsResult = { accessTime: DateTime; streams: Array; }; export declare const IRIS_HOST = "rtserve.iris.washington.edu"; /** * Web connection to a Ringserver. * * * @param host optional host to connect to, defaults to IRIS. This maybe a full URL. * @param port optional host to connect to, defaults to 80 */ export declare class RingserverConnection { /** @private */ _protocol: string; /** @private */ _host: string; /** @private */ _port: number; /** @private */ _prefix: string; /** @private */ _timeoutSec: number; isFDSNSourceId: boolean; dlproto: string; constructor(host?: string, port?: number); /** * Gets/Sets the remote host to connect to. * * @param value optional new value if setting * @returns new value if getting, this if setting */ host(value?: string): RingserverConnection; getHost(): string; /** * Gets/Sets the remote port to connect to. * * @param value new value to set * @returns this */ port(value?: number): RingserverConnection; getPort(): number | undefined; /** * Sets the prefix for the URL path. * * @param value optional new value if setting * @returns new value if getting, this if setting */ prefix(value?: string): RingserverConnection; getPrefix(): string; /** * Get/Set the timeout in seconds for the request. Default is 30. * * @param value optional new value if setting * @returns new value if getting, this if setting */ timeout(value?: number): RingserverConnection; getTimeout(): number | undefined; /** * Pulls id result from ringserver /id parsed into an object with * 'ringserverVersion' and 'serverId' fields. Also sets the * isFDSNSourceId value as ringserver v4 uses new FDSN style ids * while * * @returns Result as a Promise. */ pullId(): Promise; /** * Use numeric level (1-6) to pull just IDs from ringserver. * In a default ringserver, * level=1 would return all networks like * CO * and level=2 would return all stations like * CO_JSC * If level is falsy/missing, level=6 is used. * The optional matchPattern is a regular expression, so for example * '.+_JSC_00_HH.' would get all HH? channels from any station name JSC. * * @param level 1-6 * @param matchPattern regular expression to match * @returns Result as a Promise. */ pullStreamIds(level: number, matchPattern?: string): Promise>; /** * Pull streams, including start and end times, from the ringserver. * The optional matchPattern is a regular expression, so for example * '.+_JSC_00_HH.' would get all HH? channels from any station name JSC. * Result returned is an Promise. * * @param matchPattern regular expression to match * @returns promise to object with 'accessTime' as a DateTime * and 'streams' as an array of StreamStat objects. */ pullStreams(matchPattern?: string): Promise; getDataLinkURL(): string; getSeedLinkURL(): string; /** * Forms base url from protocol, host and port. * * @returns the string url */ formBaseURL(): string; /** * Forms the ringserver id url. * * @returns the id url */ formIdURL(): string; /** * Forms the ringserver streams url using the query parameters. * * @param queryParams optional string of query parameters * @returns the streams url */ formStreamsURL(queryParams?: string): string; /** * Forms the ringserver stream ids url using the query parameters. * * @param queryParams optional string of query parameters * @returns the stream ids url */ formStreamIdsURL(queryParams: string): string; } /** * Extract one StreamStat per station from an array of channel level * StreamStats. The start and end times are the min and max times for all * the channels within the station. Can be used to get most time of most * recent packet from the stations to give an idea of current latency. * * @param streams array of channel level StreamStats * @returns array of station level StreamStats */ export declare function stationsFromStreams(streams: Array): Array; /** * Holds ringserver/datalink id split into nslc and type. * * @deprecated * @param type [description] * @param nslc [description] */ export declare class NslcWithType { type: string; nslc: NslcId; constructor(type: string, nslc: NslcId); } /** * extracts the type from a ringserver id, ie the type from * xxx/type. * @param id ringserver/datalink style id * @return type, usually MSEED, MSEED3, JSON or TEXT */ export declare function typeForId(id: string): string | null; /** * Split type, networkCode, stationCode, locationCode and channelCode * from a ringserver id formatted like net_sta_loc_chan/type * or FDSN:net_sta_loc_b_s_s/type for new FDSN SourceIds * * @deprecated * @param id id string to split * @returns object with the split fields */ export declare function nslcSplit(id: string): NslcWithType; /** * Object to hold start and end times for a key, usually channel or station. * * @param key id, usually station or channel * @param start start time * @param end end time */ export declare class StreamStat { key: string; startRaw: string; endRaw: string; start: DateTime; end: DateTime; constructor(key: string, start: string, end: string); /** * Calculates latency time difference between last packet and current time. * * @param accessTime time latency is calculated relative to * @returns latency */ calcLatency(accessTime?: DateTime): Duration; } //# sourceMappingURL=ringserverweb.d.mts.map