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 • 15.2 kB
Source Map (JSON)
{"version":3,"sources":["../src/apis/wsdot-highway-alerts/alertAreas/mapAreas.ts","../src/apis/wsdot-highway-alerts/eventCategories/eventCategories.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/alertById.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/alerts.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/alertsByMapArea.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/alertsByRegionId.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/searchAlerts.ts"],"names":["mapAreasMeta","mapAreasInputSchema","areaSchema","fetchMapAreas","createFetchFunction","wsdotHighwayAlertsApi","alertAreasGroup","useMapAreas","createHook","eventCategoriesMeta","eventCategoriesInputSchema","z","fetchEventCategories","eventCategoriesGroup","useEventCategories","alertByIdMeta","alertByIdInputSchema","alertSchema","fetchAlertById","highwayAlertsGroup","useAlertById","alertsMeta","alertsInputSchema","fetchAlerts","useAlerts","alertsByMapAreaMeta","alertsByMapAreaInputSchema","fetchAlertsByMapArea","useAlertsByMapArea","alertsByRegionIdMeta","alertsByRegionIDInputSchema","fetchAlertsByRegionId","useAlertsByRegionId","searchAlertsMeta","searchAlertsInputSchema","datesHelper","searchAlerts","useSearchAlerts"],"mappings":"4MAqBO,IAAMA,CAAAA,CAAe,CAC1B,YAAA,CAAc,eAAA,CACd,QAAA,CAAU,qBACV,WAAA,CAAaC,CAAAA,CACb,YAAA,CAAcC,CAAAA,CAAW,KAAA,EAAM,CAC/B,aAAc,EAAC,CACf,mBAAA,CACE,+DACJ,CAAA,CAKaC,CAAAA,CAEUC,EAAAA,CACrBC,CAAAA,CACAC,CAAAA,CACAN,CACF,CAAA,CAKaO,CAAAA,CAGwBC,EAAAA,CACnCH,CAAAA,CACAC,EACAN,CACF,EC/BO,IAAMS,CAAAA,CAAsB,CACjC,YAAA,CAAc,sBAAA,CAC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AAAA,CACAc,CAAAA,CACAM,CACF,CAAA,CAKaG,EAAAA,CAGyBpB,EAAAA,CACpCH,CAAAA,CACAc,CAAAA,CACAM,CACF,EC9BO,IAAMI,CAAAA,CAAuB,CAClC,aAAc,uBAAA,CACd,QAAA,CAAU,gDAAA,CACV,WAAA,CAAaC,CAAAA,CACb,YAAA,CAAcb,CAAAA,CAAY,KAAA,EAAM,CAChC,YAAA,CAAc,CAAE,QAAA,CAAU,CAAE,CAAA,CAC5B,oBAAqB,kDACvB,CAAA,CAKac,EAAAA,CAEW3B,EAAAA,CACtBC,CAAAA,CACAc,CAAAA,CACAU,CACF,CAAA,CAKaG,EAAAA,CAGyBxB,EAAAA,CACpCH,CAAAA,CACAc,CAAAA,CACAU,CACF,MC7BaI,CAAAA,CAAmB,CAC9B,YAAA,CAAc,cAAA,CACd,QAAA,CACE,iMAAA,CACF,WAAA,CAAaC,CAAAA,CACb,YAAA,CAAcjB,CAAAA,CAAY,KAAA,EAAM,CAChC,YAAA,CAAc,CACZ,WAAY,KAAA,CACZ,gBAAA,CAAkB,EAAA,CAClB,cAAA,CAAgB,EAAA,CAChB,eAAA,CAAiBkB,GAAAA,CAAY,SAAA,EAAU,CACvC,aAAA,CAAeA,GAAAA,CAAY,KAAA,EAC7B,CAAA,CACA,oBACE,mEACJ,CAAA,CAKaC,EAAAA,CAEWhC,EAAAA,CACtBC,CAAAA,CACAc,CAAAA,CACAc,CACF,CAAA,CAKaI,EAAAA,CAGyB7B,EAAAA,CACpCH,CAAAA,CACAc,CAAAA,CACAc,CACF","file":"chunk-RGO4KICH.mjs","sourcesContent":["import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { alertAreasGroup } from \"./shared/alertAreas.endpoints\";\nimport {\n type MapAreasInput,\n mapAreasInputSchema,\n} from \"./shared/alertAreas.input\";\nimport { type Area, areaSchema } from \"./shared/alertAreas.output\";\n\n/**\n * Metadata for the fetchMapAreas endpoint\n */\nexport const mapAreasMeta = {\n functionName: \"fetchMapAreas\",\n endpoint: \"/getMapAreasAsJson\",\n inputSchema: mapAreasInputSchema,\n outputSchema: areaSchema.array(),\n sampleParams: {},\n endpointDescription:\n \"List all available geographic map areas for filtering alerts.\",\n} satisfies EndpointMeta<MapAreasInput, Area[]>;\n\n/**\n * Fetch function for retrieving all available geographic map areas for filtering alerts\n */\nexport const fetchMapAreas: (\n params?: FetchFunctionParams<MapAreasInput>\n) => Promise<Area[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n alertAreasGroup,\n mapAreasMeta\n);\n\n/**\n * React Query hook for retrieving all available geographic map areas for filtering alerts\n */\nexport const useMapAreas: (\n params?: FetchFunctionParams<MapAreasInput>,\n options?: QueryHookOptions<Area[]>\n) => UseQueryResult<Area[], Error> = createHook(\n wsdotHighwayAlertsApi,\n alertAreasGroup,\n mapAreasMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { z } from \"@/shared/zod\";\nimport { eventCategoriesGroup } from \"./shared/eventCategories.endpoints\";\nimport {\n type EventCategoriesInput,\n eventCategoriesInputSchema,\n} from \"./shared/eventCategories.input\";\n\n/**\n * Metadata for the fetchEventCategories endpoint\n */\nexport const eventCategoriesMeta = {\n functionName: \"fetchEventCategories\",\n endpoint: \"/getEventCategoriesAsJson\",\n inputSchema: eventCategoriesInputSchema,\n outputSchema: z.string().array(),\n sampleParams: {},\n endpointDescription:\n \"List all available event category names for filtering alerts.\",\n} satisfies EndpointMeta<EventCategoriesInput, string[]>;\n\n/**\n * Fetch function for retrieving all available event category names for filtering alerts\n */\nexport const fetchEventCategories: (\n params?: FetchFunctionParams<EventCategoriesInput>\n) => Promise<string[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n eventCategoriesGroup,\n eventCategoriesMeta\n);\n\n/**\n * React Query hook for retrieving all available event category names for filtering alerts\n */\nexport const useEventCategories: (\n params?: FetchFunctionParams<EventCategoriesInput>,\n options?: QueryHookOptions<string[]>\n) => UseQueryResult<string[], Error> = createHook(\n wsdotHighwayAlertsApi,\n eventCategoriesGroup,\n eventCategoriesMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { highwayAlertsGroup } from \"./shared/highwayAlerts.endpoints\";\nimport {\n type AlertByIdInput,\n alertByIdInputSchema,\n} from \"./shared/highwayAlerts.input\";\nimport { type Alert, alertSchema } from \"./shared/highwayAlerts.output\";\n\n/**\n * Metadata for the fetchAlertById endpoint\n */\nexport const alertByIdMeta = {\n functionName: \"fetchAlertById\",\n endpoint: \"/getAlertAsJson?AlertID={AlertID}\",\n inputSchema: alertByIdInputSchema,\n outputSchema: alertSchema,\n sampleParams: { AlertID: 468632 },\n endpointDescription: \"Get highway alert details for a specific alert ID.\",\n} satisfies EndpointMeta<AlertByIdInput, Alert>;\n\n/**\n * Fetch function for retrieving highway alert details for a specific alert ID\n */\nexport const fetchAlertById: (\n params?: FetchFunctionParams<AlertByIdInput>\n) => Promise<Alert> = createFetchFunction(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertByIdMeta\n);\n\n/**\n * React Query hook for retrieving highway alert details for a specific alert ID\n */\nexport const useAlertById: (\n params?: FetchFunctionParams<AlertByIdInput>,\n options?: QueryHookOptions<Alert>\n) => UseQueryResult<Alert, Error> = createHook(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertByIdMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { highwayAlertsGroup } from \"./shared/highwayAlerts.endpoints\";\nimport {\n type AlertsInput,\n alertsInputSchema,\n} from \"./shared/highwayAlerts.input\";\nimport { type Alert, alertSchema } from \"./shared/highwayAlerts.output\";\n\n/**\n * Metadata for the fetchAlerts endpoint\n */\nexport const alertsMeta = {\n functionName: \"fetchAlerts\",\n endpoint: \"/getAlertsAsJson\",\n inputSchema: alertsInputSchema,\n outputSchema: alertSchema.array(),\n sampleParams: {},\n endpointDescription: \"List all current highway alerts statewide.\",\n} satisfies EndpointMeta<AlertsInput, Alert[]>;\n\n/**\n * Fetch function for retrieving all current highway alerts statewide\n */\nexport const fetchAlerts: (\n params?: FetchFunctionParams<AlertsInput>\n) => Promise<Alert[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsMeta\n);\n\n/**\n * React Query hook for retrieving all current highway alerts statewide\n */\nexport const useAlerts: (\n params?: FetchFunctionParams<AlertsInput>,\n options?: QueryHookOptions<Alert[]>\n) => UseQueryResult<Alert[], Error> = createHook(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { highwayAlertsGroup } from \"./shared/highwayAlerts.endpoints\";\nimport {\n type AlertsByMapAreaInput,\n alertsByMapAreaInputSchema,\n} from \"./shared/highwayAlerts.input\";\nimport { type Alert, alertSchema } from \"./shared/highwayAlerts.output\";\n\n/**\n * Metadata for the fetchAlertsByMapArea endpoint\n */\nexport const alertsByMapAreaMeta = {\n functionName: \"fetchAlertsByMapArea\",\n endpoint: \"/getAlertsByMapAreaAsJson?MapArea={MapArea}\",\n inputSchema: alertsByMapAreaInputSchema,\n outputSchema: alertSchema.array(),\n sampleParams: { MapArea: \"Seattle\" },\n endpointDescription: \"List highway alerts filtered by map area code.\",\n} satisfies EndpointMeta<AlertsByMapAreaInput, Alert[]>;\n\n/**\n * Fetch function for retrieving highway alerts filtered by map area code\n */\nexport const fetchAlertsByMapArea: (\n params?: FetchFunctionParams<AlertsByMapAreaInput>\n) => Promise<Alert[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsByMapAreaMeta\n);\n\n/**\n * React Query hook for retrieving highway alerts filtered by map area code\n */\nexport const useAlertsByMapArea: (\n params?: FetchFunctionParams<AlertsByMapAreaInput>,\n options?: QueryHookOptions<Alert[]>\n) => UseQueryResult<Alert[], Error> = createHook(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsByMapAreaMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } from \"../api\";\nimport type {\n EndpointMeta,\n FetchFunctionParams,\n QueryHookOptions,\n} from \"@/apis/types\";\nimport {\n createFetchFunction,\n createHook,\n} from \"@/shared/factories\";\nimport { highwayAlertsGroup } from \"./shared/highwayAlerts.endpoints\";\nimport {\n type AlertsByRegionIDInput,\n alertsByRegionIDInputSchema,\n} from \"./shared/highwayAlerts.input\";\nimport { type Alert, alertSchema } from \"./shared/highwayAlerts.output\";\n\n/**\n * Metadata for the fetchAlertsByRegionId endpoint\n */\nexport const alertsByRegionIdMeta = {\n functionName: \"fetchAlertsByRegionId\",\n endpoint: \"/getAlertsByRegionIDAsJson?RegionID={RegionID}\",\n inputSchema: alertsByRegionIDInputSchema,\n outputSchema: alertSchema.array(),\n sampleParams: { RegionID: 4 },\n endpointDescription: \"List highway alerts filtered by WSDOT region ID.\",\n} satisfies EndpointMeta<AlertsByRegionIDInput, Alert[]>;\n\n/**\n * Fetch function for retrieving highway alerts filtered by WSDOT region ID\n */\nexport const fetchAlertsByRegionId: (\n params?: FetchFunctionParams<AlertsByRegionIDInput>\n) => Promise<Alert[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsByRegionIdMeta\n);\n\n/**\n * React Query hook for retrieving highway alerts filtered by WSDOT region ID\n */\nexport const useAlertsByRegionId: (\n params?: FetchFunctionParams<AlertsByRegionIDInput>,\n options?: QueryHookOptions<Alert[]>\n) => UseQueryResult<Alert[], Error> = createHook(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n alertsByRegionIdMeta\n);\n","import type { UseQueryResult } from \"@tanstack/react-query\";\nimport { wsdotHighwayAlertsApi } 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 { highwayAlertsGroup } from \"./shared/highwayAlerts.endpoints\";\nimport {\n type SearchAlertsInput,\n searchAlertsInputSchema,\n} from \"./shared/highwayAlerts.input\";\nimport { type Alert, alertSchema } from \"./shared/highwayAlerts.output\";\n\n/**\n * Metadata for the searchAlerts endpoint\n */\nexport const searchAlertsMeta = {\n functionName: \"searchAlerts\",\n endpoint:\n \"/searchAlertsAsJson?StateRoute={StateRoute}&Region={Region}&SearchTimeStart={SearchTimeStart}&SearchTimeEnd={SearchTimeEnd}&StartingMilepost={StartingMilepost}&EndingMilepost={EndingMilepost}\",\n inputSchema: searchAlertsInputSchema,\n outputSchema: alertSchema.array(),\n sampleParams: {\n StateRoute: \"405\",\n StartingMilepost: 10,\n EndingMilepost: 20,\n SearchTimeStart: datesHelper.yesterday(),\n SearchTimeEnd: datesHelper.today(),\n },\n endpointDescription:\n \"Search highway alerts by route, region, time range, and milepost.\",\n} satisfies EndpointMeta<SearchAlertsInput, Alert[]>;\n\n/**\n * Fetch function for searching highway alerts by route, region, time range, and milepost\n */\nexport const searchAlerts: (\n params?: FetchFunctionParams<SearchAlertsInput>\n) => Promise<Alert[]> = createFetchFunction(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n searchAlertsMeta\n);\n\n/**\n * React Query hook for searching highway alerts by route, region, time range, and milepost\n */\nexport const useSearchAlerts: (\n params?: FetchFunctionParams<SearchAlertsInput>,\n options?: QueryHookOptions<Alert[]>\n) => UseQueryResult<Alert[], Error> = createHook(\n wsdotHighwayAlertsApi,\n highwayAlertsGroup,\n searchAlertsMeta\n);\n"]}