ws-dottie
Version:
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
1 lines • 4.79 kB
Source Map (JSON)
{"version":3,"sources":["../src/apis/wsdot-weather-stations/apiMeta.ts","../src/apis/wsdot-weather-stations/weatherStations/shared/weatherStations.endpoints.ts","../src/apis/wsdot-weather-stations/weatherStations/weatherStations.ts"],"names":["wsdotWeatherStationsApiMeta","init_apiMeta","__esmMin","weatherStations_endpoints_exports","__export","weatherStationsGroup","init_weatherStations_endpoints","init_weatherStations","weatherStationsMeta","fetch","useHook","fetchWeatherStations","useWeatherStations","init_factories","init_weatherStations_input","init_weatherStations_output","weatherStationsInputSchema","weatherStationSchema","createFetchAndHook","m"],"mappings":"uJAAA,IAKaA,CAAAA,CALbC,EAAAC,CAAAA,CAAA,IAAA,CAKaF,EAAuC,CAClD,IAAA,CAAM,wBAAA,CACN,OAAA,CACE,0EACJ,EAAA,CAAA,ECTA,IAAAG,CAAAA,CAAA,EAAA,CAAAC,EAAAD,CAAAA,CAAA,CAAA,oBAAA,CAAA,IAAAE,IAAA,IAMaA,CAAAA,CANbC,CAAAA,CAAAJ,CAAAA,CAAA,IAAA,CACAK,CAAAA,EAAAA,CAKaF,EAA0C,CACrD,IAAA,CAAM,mBACN,aAAA,CAAe,UAAA,CACf,cAAe,CACb,OAAA,CACE,iHAAA,CACF,WAAA,CACE,iIAAA,CACF,QAAA,CAAU,CACR,iEAAA,CACA,kEAAA,CACA,kDACF,CAAA,CACA,eAAA,CAAiB,OACnB,CAAA,CACA,SAAA,CAAW,CAACG,CAAmB,CACjC,EAAA,CAAA,MCHaA,CAAAA,CAaLC,CAAAA,CAAOC,EAeFC,CAAAA,CAQAC,CAAAA,CAvDbL,EAAAL,CAAAA,CAAA,IAAA,CACAW,CAAAA,EAAAA,CAKAZ,CAAAA,EAAAA,CACAa,GAAAA,EAAAA,CAIAC,CAAAA,EAAAA,CAQaP,EAAsB,CACjC,YAAA,CAAc,uBACd,QAAA,CAAU,2BAAA,CACV,YAAaQ,GAAAA,CACb,YAAA,CAAcC,CAAAA,CAAqB,KAAA,EAAM,CACzC,YAAA,CAAc,EAAC,CACf,mBAAA,CACE,2DACJ,CAAA,CAKM,CAAE,MAAAR,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAAA,CAAYQ,GAAAA,CAGzB,CACA,GAAA,CAAKlB,EACL,QAAA,CAAUQ,CAAAA,CACV,gBAAA,CAAkB,IAEhB,CAAA,CAAA,EAAA,CAAAW,GAAA,CAAA,CAAA,CAAA,EAA8C,oBAAA,CAC3C,aACP,CAAC,CAAA,CAKYR,CAAAA,CAGTF,CAAAA,CAKSG,CAAAA,CAGTF,EAAAA,CAAAA","file":"chunk-FNQGPRGL.mjs","sourcesContent":["import type { ApiMeta } from \"@/apis/types\";\n\n/**\n * API metadata for WSDOT Weather Stations API\n */\nexport const wsdotWeatherStationsApiMeta: ApiMeta = {\n name: \"wsdot-weather-stations\",\n baseUrl:\n \"https://wsdot.wa.gov/traffic/api/WeatherStations/WeatherStationsREST.svc\",\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\nimport { weatherStationsMeta } from \"../weatherStations\";\n\n/**\n * Endpoint group metadata for weather stations endpoints\n */\nexport const weatherStationsGroup: EndpointGroupMeta = {\n name: \"weather-stations\",\n cacheStrategy: \"FREQUENT\",\n documentation: {\n summary:\n \"Weather station metadata and location information for WSDOT Road Weather Information System stations statewide.\",\n description:\n \"Station identifiers, names, and location coordinates for weather stations that collect atmospheric and pavement condition data.\",\n useCases: [\n \"Discover weather stations by location for weather data queries.\",\n \"Identify station identifiers and names for weather data lookups.\",\n \"Support location-based weather station searches.\",\n ],\n updateFrequency: \"daily\",\n },\n endpoints: [weatherStationsMeta],\n};\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotWeatherStationsApiMeta } from \"../apiMeta\";\nimport {\n type WeatherStationsInput,\n weatherStationsInputSchema,\n} from \"./shared/weatherStations.input\";\nimport {\n type WeatherStation,\n weatherStationSchema,\n} from \"./shared/weatherStations.output\";\n\n/**\n * Metadata for the fetchWeatherStations endpoint\n */\nexport const weatherStationsMeta = {\n functionName: \"fetchWeatherStations\",\n endpoint: \"/GetCurrentStationsAsJson\",\n inputSchema: weatherStationsInputSchema,\n outputSchema: weatherStationSchema.array(),\n sampleParams: {},\n endpointDescription:\n \"List weather station metadata for all stations statewide.\",\n} satisfies EndpointMeta<WeatherStationsInput, WeatherStation[]>;\n\n/**\n * Fetch function for retrieving weather station metadata for all stations statewide\n */\nconst { fetch, useHook } = createFetchAndHook<\n WeatherStationsInput,\n WeatherStation[]\n>({\n api: wsdotWeatherStationsApiMeta,\n endpoint: weatherStationsMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/weatherStations.endpoints\").weatherStationsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving weather station metadata for all stations statewide\n */\nexport const fetchWeatherStations: FetchFactory<\n WeatherStationsInput,\n WeatherStation[]\n> = fetch;\n\n/**\n * React Query hook for retrieving weather station metadata for all stations statewide\n */\nexport const useWeatherStations: HookFactory<\n WeatherStationsInput,\n WeatherStation[]\n> = useHook;\n"]}