import { DateTime } from "luxon"; import { z } from "zod/v4"; import { FDSNSourceId, StationSourceId, NetworkSourceId } from "./fdsnsourceid.mjs"; export declare const SEEDLINK_PATH = "seedlink"; export declare const DATALINK_PATH = "datalink"; declare const RingserverId: z.ZodObject<{ software: z.ZodString; organization: z.ZodString; server_start: z.ZodString; datalink_protocol: z.ZodArray; seedlink_protocol: z.ZodArray; }, z.core.$strip>; export type RingserverIdType = z.infer; declare const StreamStat: z.ZodObject<{ id: z.ZodString; start_time: z.ZodPipe, string>>; end_time: z.ZodPipe, string>>; earliest_packet_id: z.ZodNumber; earliest_packet_time: z.ZodPipe, string>>; latest_packet_time: z.ZodPipe, string>>; latest_packet_id: z.ZodNumber; data_latency: z.ZodNumber; }, z.core.$strip>; export type StreamStatType = z.infer; declare const StreamsResult: z.ZodObject<{ software: z.ZodString; organization: z.ZodString; stream: z.ZodArray, string>>; end_time: z.ZodPipe, string>>; earliest_packet_id: z.ZodNumber; earliest_packet_time: z.ZodPipe, string>>; latest_packet_time: z.ZodPipe, string>>; latest_packet_id: z.ZodNumber; data_latency: z.ZodNumber; }, z.core.$strip>>; accessTime: z.ZodOptional, DateTime>>; }, z.core.$strip>; export type StreamsResultType = z.infer; export declare const IRIS_HOST = "rtserve.iris.washington.edu"; export declare const EARTHSCOPE_HOST = "rtserve.earthscope.org"; /** * 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 optional new value if setting * @returns new value if getting, this if setting */ port(value?: number): RingserverConnection; getPort(): number | undefined; /** * Gets/Sets the protocol, http or https. This should match the protocol * of the page loaded, but is autocalculated and generally need not be set. * * @param value protocol, usually http or https * @returns the query when setting, the current value when no argument */ protocol(value?: string): RingserverConnection; getProtocol(): string | 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; /** * 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(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/json url. * * @returns the id url */ formIdURL(): string; /** * Forms the ringserver streams/json 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; /** * 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; /** * extracts the source id from a ringserver id, ie the source id from * NN_SSSSS_LL_CCC/type or FDSN:NN_SSSSS_LL_B_S_S/type * @param id ringserver/datalink style id * @return FDSN source id or null */ export declare function sidForId(id: string): FDSNSourceId | StationSourceId | NetworkSourceId | null; export {}; //# sourceMappingURL=ringserverweb4.d.mts.map