UNPKG

geonet

Version:

A Node.js API wrapper for GeoNet — Aotearoa's geological hazard monitoring system.

30 lines (29 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StrongService = void 0; const base_1 = require("../../@types/base"); const BaseService_1 = require("./BaseService"); /** * StrongService class for fetching strong motion information for a specified quake from the GeoNet API. * @extends BaseService * @since 1.0.0 */ class StrongService extends BaseService_1.BaseService { /** * Fetches strong intensity data for a given public ID. * * @param {string} publicID - The public ID for the earthquake. * @returns {Promise<StrongResponse>} - A promise that resolves to the strong intensity data. * @throws {Error} - Throws an error if the public ID is not provided. * @since 1.0.0 */ async getStrong(publicID) { if (!publicID || typeof (publicID) !== "string") throw new Error("Public ID not provided, or was not a string."); return await this.GET({ endpoint: `/intensity/strong/processed/${publicID}`, format: base_1.JSONFormatTypes.APPLICATION_JSON }); } } exports.StrongService = StrongService;