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 • 10.3 kB
Source Map (JSON)
{"version":3,"sources":["../src/apis/wsdot-weather-information/weatherInfo/currentWeatherForStations.ts","../src/apis/wsdot-weather-information/weatherInfo/searchWeatherInformation.ts","../src/apis/wsdot-weather-information/weatherInfo/weatherInformation.ts","../src/apis/wsdot-weather-information/weatherInfo/weatherInformationByStationId.ts"],"names":["currentWeatherForStationsMeta","currentWeatherForStationsInputSchema","weatherInfoSchema","fetchCurrentWeatherForStations","createFetchFunction","wsdotWeatherInformationApi","weatherInfoGroup","useCurrentWeatherForStations","createHook","searchWeatherInformationMeta","searchWeatherInformationInputSchema","datesHelper","searchWeatherInformation","useSearchWeatherInformation","weatherInformationMeta","weatherInformationInputSchema","fetchWeatherInformation","useWeatherInformation","weatherInformationByStationIdMeta","weatherInformationByStationIdInputSchema","fetchWeatherInformationByStationId","useWeatherInformationByStationId"],"mappings":"2JAwBO,IAAMA,CAAAA,CAAgC,CAC3C,YAAA,CAAc,gCAAA,CACd,SAAU,+DAAA,CACV,WAAA,CAAaC,GAAAA,CACb,YAAA,CAAcC,CAAAA,CAAkB,KAAA,EAAM,CACtC,YAAA,CAAc,CAAE,WAAA,CAAa,gBAAiB,CAAA,CAC9C,mBAAA,CACE,kEACJ,CAAA,CAKaC,CAAAA,CAEiBC,EAAAA,CAC5BC,EACAC,CAAAA,CACAN,CACF,CAAA,CAKaO,CAAAA,CAG+BC,GAC1CH,CAAAA,CACAC,CAAAA,CACAN,CACF,MC9BaS,CAAAA,CAA+B,CAC1C,YAAA,CAAc,0BAAA,CACd,QAAA,CACE,uHAAA,CACF,WAAA,CAAaC,GAAAA,CACb,aAAcR,CAAAA,CAAkB,KAAA,EAAM,CACtC,YAAA,CAAc,CACZ,SAAA,CAAW,IAAA,CACX,eAAA,CAAiB,IAAI,KACnB,CAAA,EAAGS,GAAAA,CAAY,SAAA,EAAW,CAAA,UAAA,CAC5B,CAAA,CAAE,WAAA,EAAY,CACd,cAAe,IAAI,IAAA,CAAK,CAAA,EAAGA,GAAAA,CAAY,OAAO,CAAA,UAAA,CAAY,CAAA,CAAE,WAAA,EAC9D,CAAA,CACA,mBAAA,CACE,0EACJ,CAAA,CAKaC,CAAAA,CAEiBR,EAAAA,CAC5BC,CAAAA,CACAC,CAAAA,CACAG,CACF,CAAA,CAKaI,CAAAA,CAG+BL,EAAAA,CAC1CH,CAAAA,CACAC,EACAG,CACF,ECvCO,IAAMK,CAAAA,CAAyB,CACpC,YAAA,CAAc,yBAAA,CACd,QAAA,CAAU,qCAAA,CACV,WAAA,CAAaC,CAAAA,CACb,YAAA,CAAcb,CAAAA,CAAkB,OAAM,CACtC,YAAA,CAAc,EAAC,CACf,oBAAqB,oDACvB,CAAA,CAKac,CAAAA,CAEiBZ,EAAAA,CAC5BC,EACAC,CAAAA,CACAQ,CACF,CAAA,CAKaG,CAAAA,CAG+BT,EAAAA,CAC1CH,CAAAA,CACAC,CAAAA,CACAQ,CACF,EC9BO,IAAMI,CAAAA,CAAoC,CAC/C,YAAA,CAAc,qCACd,QAAA,CACE,sEAAA,CACF,WAAA,CAAaC,GAAAA,CACb,aAAcjB,CAAAA,CACd,YAAA,CAAc,CAAE,SAAA,CAAW,IAAK,CAAA,CAChC,mBAAA,CACE,+DACJ,EAKakB,CAAAA,CAEehB,EAAAA,CAC1BC,CAAAA,CACAC,CAAAA,CACAY,CACF,CAAA,CAKaG,CAAAA,CAG6Bb,EAAAA,CACxCH,CAAAA,CACAC,EACAY,CACF","file":"chunk-OAOM44AX.mjs","sourcesContent":["import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotWeatherInformationApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { weatherInfoGroup } from \"./shared/weatherInfo.endpoints\";\nimport {\n type CurrentWeatherForStationsInput,\n currentWeatherForStationsInputSchema,\n} from \"./shared/weatherInfo.input\";\nimport {\n type WeatherInfo,\n weatherInfoSchema,\n} from \"./shared/weatherInfo.output\";\n\n/**\n * Metadata for the fetchCurrentWeatherForStations endpoint\n */\nexport const currentWeatherForStationsMeta = {\n functionName: \"fetchCurrentWeatherForStations\",\n endpoint: \"/GetCurrentWeatherForStationsAsJson?StationList={StationList}\",\n inputSchema: currentWeatherForStationsInputSchema,\n outputSchema: weatherInfoSchema.array(),\n sampleParams: { StationList: \"1909,1966,1970\" },\n endpointDescription:\n \"Get current weather information for multiple specified stations.\",\n} satisfies EndpointMeta<CurrentWeatherForStationsInput, WeatherInfo[]>;\n\n/**\n * Fetch function for retrieving current weather information for multiple specified stations\n */\nexport const fetchCurrentWeatherForStations: (\n params?: FetchFunctionParams<CurrentWeatherForStationsInput>\n) => Promise<WeatherInfo[]> = createFetchFunction(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n currentWeatherForStationsMeta\n);\n\n/**\n * React Query hook for retrieving current weather information for multiple specified stations\n */\nexport const useCurrentWeatherForStations: (\n params?: FetchFunctionParams<CurrentWeatherForStationsInput>,\n options?: QueryHookOptions<WeatherInfo[]>\n) => UseQueryResult<WeatherInfo[], Error> = createHook(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n currentWeatherForStationsMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotWeatherInformationApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { datesHelper } from \"@/shared/utils\";\nimport { weatherInfoGroup } from \"./shared/weatherInfo.endpoints\";\nimport {\n type SearchWeatherInformationInput,\n searchWeatherInformationInputSchema,\n} from \"./shared/weatherInfo.input\";\nimport {\n type WeatherInfo,\n weatherInfoSchema,\n} from \"./shared/weatherInfo.output\";\n\n/**\n * Metadata for the searchWeatherInformation endpoint\n */\nexport const searchWeatherInformationMeta = {\n functionName: \"searchWeatherInformation\",\n endpoint:\n \"/SearchWeatherInformationAsJson?StationID={StationID}&SearchStartTime={SearchStartTime}&SearchEndTime={SearchEndTime}\",\n inputSchema: searchWeatherInformationInputSchema,\n outputSchema: weatherInfoSchema.array(),\n sampleParams: {\n StationID: 1980,\n SearchStartTime: new Date(\n `${datesHelper.yesterday()}T00:00:00Z`\n ).toISOString(),\n SearchEndTime: new Date(`${datesHelper.today()}T23:59:59Z`).toISOString(),\n },\n endpointDescription:\n \"Search historical weather information for a station within a time range.\",\n} satisfies EndpointMeta<SearchWeatherInformationInput, WeatherInfo[]>;\n\n/**\n * Fetch function for retrieving historical weather information for a station within a time range\n */\nexport const searchWeatherInformation: (\n params?: FetchFunctionParams<SearchWeatherInformationInput>\n) => Promise<WeatherInfo[]> = createFetchFunction(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n searchWeatherInformationMeta\n);\n\n/**\n * React Query hook for retrieving historical weather information for a station within a time range\n */\nexport const useSearchWeatherInformation: (\n params?: FetchFunctionParams<SearchWeatherInformationInput>,\n options?: QueryHookOptions<WeatherInfo[]>\n) => UseQueryResult<WeatherInfo[], Error> = createHook(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n searchWeatherInformationMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotWeatherInformationApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { weatherInfoGroup } from \"./shared/weatherInfo.endpoints\";\nimport {\n type WeatherInformationInput,\n weatherInformationInputSchema,\n} from \"./shared/weatherInfo.input\";\nimport {\n type WeatherInfo,\n weatherInfoSchema,\n} from \"./shared/weatherInfo.output\";\n\n/**\n * Metadata for the fetchWeatherInformation endpoint\n */\nexport const weatherInformationMeta = {\n functionName: \"fetchWeatherInformation\",\n endpoint: \"/GetCurrentWeatherInformationAsJson\",\n inputSchema: weatherInformationInputSchema,\n outputSchema: weatherInfoSchema.array(),\n sampleParams: {},\n endpointDescription: \"List current weather information for all stations.\",\n} satisfies EndpointMeta<WeatherInformationInput, WeatherInfo[]>;\n\n/**\n * Fetch function for retrieving current weather information for all stations\n */\nexport const fetchWeatherInformation: (\n params?: FetchFunctionParams<WeatherInformationInput>\n) => Promise<WeatherInfo[]> = createFetchFunction(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n weatherInformationMeta\n);\n\n/**\n * React Query hook for retrieving current weather information for all stations\n */\nexport const useWeatherInformation: (\n params?: FetchFunctionParams<WeatherInformationInput>,\n options?: QueryHookOptions<WeatherInfo[]>\n) => UseQueryResult<WeatherInfo[], Error> = createHook(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n weatherInformationMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotWeatherInformationApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { weatherInfoGroup } from \"./shared/weatherInfo.endpoints\";\nimport {\n type WeatherInformationByStationIdInput,\n weatherInformationByStationIdInputSchema,\n} from \"./shared/weatherInfo.input\";\nimport {\n type WeatherInfo,\n weatherInfoSchema,\n} from \"./shared/weatherInfo.output\";\n\n/**\n * Metadata for the fetchWeatherInformationByStationId endpoint\n */\nexport const weatherInformationByStationIdMeta = {\n functionName: \"fetchWeatherInformationByStationId\",\n endpoint:\n \"/GetCurrentWeatherInformationByStationIDAsJson?StationID={StationID}\",\n inputSchema: weatherInformationByStationIdInputSchema,\n outputSchema: weatherInfoSchema,\n sampleParams: { StationID: 1909 },\n endpointDescription:\n \"Get current weather information for a specific station by ID.\",\n} satisfies EndpointMeta<WeatherInformationByStationIdInput, WeatherInfo>;\n\n/**\n * Fetch function for retrieving current weather information for a specific station by ID\n */\nexport const fetchWeatherInformationByStationId: (\n params?: FetchFunctionParams<WeatherInformationByStationIdInput>\n) => Promise<WeatherInfo> = createFetchFunction(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n weatherInformationByStationIdMeta\n);\n\n/**\n * React Query hook for retrieving current weather information for a specific station by ID\n */\nexport const useWeatherInformationByStationId: (\n params?: FetchFunctionParams<WeatherInformationByStationIdInput>,\n options?: QueryHookOptions<WeatherInfo>\n) => UseQueryResult<WeatherInfo, Error> = createHook(\n wsdotWeatherInformationApi,\n weatherInfoGroup,\n weatherInformationByStationIdMeta\n);\n"]}