UNPKG

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 22.4 kB
{"version":3,"sources":["../src/apis/wsdot-highway-alerts/apiMeta.ts","../src/apis/wsdot-highway-alerts/alertAreas/shared/alertAreas.endpoints.ts","../src/apis/wsdot-highway-alerts/alertAreas/mapAreas.ts","../src/apis/wsdot-highway-alerts/eventCategories/shared/eventCategories.endpoints.ts","../src/apis/wsdot-highway-alerts/eventCategories/eventCategories.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","../src/apis/wsdot-highway-alerts/highwayAlerts/shared/highwayAlerts.endpoints.ts","../src/apis/wsdot-highway-alerts/highwayAlerts/alertById.ts"],"names":["wsdotHighwayAlertsApiMeta","init_apiMeta","__esmMin","alertAreas_endpoints_exports","__export","alertAreasGroup","init_alertAreas_endpoints","init_mapAreas","mapAreasMeta","fetch","useHook","fetchMapAreas","useMapAreas","init_factories","init_alertAreas_input","init_alertAreas_output","mapAreasInputSchema","areaSchema","createFetchAndHook","eventCategories_endpoints_exports","eventCategoriesGroup","init_eventCategories_endpoints","init_eventCategories","eventCategoriesMeta","fetchEventCategories","useEventCategories","init_zod","init_eventCategories_input","eventCategoriesInputSchema","z","i","alertsMeta","fetchAlerts","useAlerts","init_alerts","init_highwayAlerts_input","init_highwayAlerts_output","alertsInputSchema","alertSchema","alertsByMapAreaMeta","fetchAlertsByMapArea","useAlertsByMapArea","init_alertsByMapArea","alertsByMapAreaInputSchema","alertsByRegionIdMeta","fetchAlertsByRegionId","useAlertsByRegionId","init_alertsByRegionId","alertsByRegionIDInputSchema","searchAlertsMeta","searchAlerts","useSearchAlerts","init_searchAlerts","init_utils","searchAlertsInputSchema","datesHelper","highwayAlerts_endpoints_exports","highwayAlertsGroup","init_highwayAlerts_endpoints","init_alertById","alertByIdMeta","fetchAlertById","useAlertById","alertByIdInputSchema"],"mappings":"uXAAA,IAKaA,CAAAA,CALbC,CAAAA,CAAAC,CAAAA,CAAA,IAAA,CAKaF,CAAAA,CAAqC,CAChD,IAAA,CAAM,sBAAA,CACN,OAAA,CACE,0EACJ,EAAA,CAAA,ECTA,IAAAG,CAAAA,CAAA,EAAA,CAAAC,GAAAA,CAAAD,CAAAA,CAAA,CAAA,eAAA,CAAA,IAAAE,CAAAA,CAAAA,CAAAA,CAAA,IAMaA,CAAAA,CANbC,CAAAA,CAAAJ,CAAAA,CAAA,IAAA,CACAK,CAAAA,EAAAA,CAKaF,CAAAA,CAAqC,CAChD,IAAA,CAAM,YAAA,CACN,cAAe,UAAA,CACf,aAAA,CAAe,CACb,OAAA,CAAS,8DAAA,CACT,WAAA,CACE,6GAAA,CACF,QAAA,CAAU,CACR,+CAAA,CACA,4CAAA,CACA,yDACF,CAAA,CACA,eAAA,CAAiB,IACnB,CAAA,CACA,SAAA,CAAW,CAACG,CAAY,CAC1B,EAAA,CAAA,ECrBA,IAgBaA,CAAAA,CAULC,CAAAA,CAAOC,CAAAA,CAWFC,EAAAA,CAKAC,EAAAA,CA1CbL,CAAAA,CAAAL,CAAAA,CAAA,IAAA,CACAW,GAAAA,EAAAA,CAKAZ,CAAAA,EAAAA,CACAa,MAIAC,GAAAA,EAAAA,CAKaP,CAAAA,CAAe,CAC1B,YAAA,CAAc,eAAA,CACd,QAAA,CAAU,oBAAA,CACV,WAAA,CAAaQ,GAAAA,CACb,YAAA,CAAcC,CAAAA,CAAW,KAAA,EAAM,CAC/B,YAAA,CAAc,EAAC,CACf,mBAAA,CACE,+DACJ,CAAA,CAEM,CAAE,KAAA,CAAAR,CAAAA,CAAO,OAAA,CAAAC,CAAAA,CAAAA,CAAYQ,CAAAA,CAA0C,CACnE,GAAA,CAAKlB,CAAAA,CACL,QAAA,CAAUQ,CAAAA,CACV,gBAAA,C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ACA,eAAA,CAAiB,IACnB,CAAA,CACA,SAAA,CAAW,CACT1B,CAAAA,CACAkB,CAAAA,CACAL,CAAAA,CACAL,CAAAA,CACAqB,CACF,CACF,EAAA,CAAA,EClCA,IAgBaA,CAAAA,CASLnD,EAAAA,CAAOC,EAAAA,CAYFmD,EAAAA,CAKAC,EAAAA,CA1CbH,CAAAA,CAAAzD,CAAAA,CAAA,IAAA,CACAW,GAAAA,EAAAA,CAKAZ,CAAAA,EAAAA,CACAkC,CAAAA,EAAAA,CAIAC,GAAAA,EAAAA,CAKawB,CAAAA,CAAgB,CAC3B,YAAA,CAAc,iBACd,QAAA,CAAU,mCAAA,CACV,WAAA,CAAaG,GAAAA,CACb,YAAA,CAAczB,CAAAA,CACd,YAAA,CAAc,CAAE,OAAA,CAAS,MAAO,CAAA,CAChC,mBAAA,CAAqB,oDACvB,CAAA,CAEM,CAAE,KAAA,CAAA7B,GAAO,OAAA,CAAAC,EAAAA,CAAAA,CAAYQ,CAAAA,CAA0C,CACnE,GAAA,CAAKlB,CAAAA,CACL,QAAA,CAAU4D,CAAAA,CACV,gBAAA,CAAkB,IAEhB,CAAA,CAAA,EAAA,CAAA9B,GAAA,CAAA,CAAA,CAAA,EAA4C,kBAAA,CACzC,aACP,CAAC,CAAA,CAKY+B,EAAAA,CAAsDpD,GAKtDqD,EAAAA,CAAmDpD,GAAAA,CAAAA","file":"chunk-MK2VM6M4.mjs","sourcesContent":["import type { ApiMeta } from \"@/apis/types\";\n\n/**\n * API metadata for WSDOT Highway Alerts API\n */\nexport const wsdotHighwayAlertsApiMeta: ApiMeta = {\n name: \"wsdot-highway-alerts\",\n baseUrl:\n \"https://www.wsdot.wa.gov/traffic/api/highwayalerts/highwayalertsrest.svc\",\n};\n","import type { EndpointGroupMeta } from \"@/apis/types\";\nimport { mapAreasMeta } from \"../mapAreas\";\n\n/**\n * Endpoint group metadata for alert areas endpoints\n */\nexport const alertAreasGroup: EndpointGroupMeta = {\n name: \"alertAreas\",\n cacheStrategy: \"FREQUENT\",\n documentation: {\n summary: \"Geographic map areas for filtering highway alerts by region.\",\n description:\n \"Area codes and names used to organize and filter highway alerts across Washington State geographic regions.\",\n useCases: [\n \"Filter highway alerts by geographic map area.\",\n \"Obtain valid area codes for alert queries.\",\n \"Display regional alert organization in user interfaces.\",\n ],\n updateFrequency: \"5m\",\n },\n endpoints: [mapAreasMeta],\n};\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<MapAreasInput, Area[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: mapAreasMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/alertAreas.endpoints\").alertAreasGroup.cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving all available geographic map areas for filtering alerts\n */\nexport const fetchMapAreas: FetchFactory<MapAreasInput, Area[]> = fetch;\n\n/**\n * React Query hook for retrieving all available geographic map areas for filtering alerts\n */\nexport const useMapAreas: HookFactory<MapAreasInput, Area[]> = useHook;\n","import type { EndpointGroupMeta } from \"@/apis/types\";\nimport { eventCategoriesMeta } from \"../eventCategories\";\n\n/**\n * Endpoint group metadata for event categories endpoints\n */\nexport const eventCategoriesGroup: EndpointGroupMeta = {\n name: \"event-categories\",\n cacheStrategy: \"FREQUENT\",\n documentation: {\n summary: \"Event category classifications for highway alerts.\",\n description:\n \"Standardized category names used to classify and filter highway alerts by incident type, such as construction, collisions, maintenance, and weather events.\",\n useCases: [\n \"Filter highway alerts by event category type.\",\n \"Obtain valid category names for alert searches.\",\n \"Categorize alerts in user interfaces by incident type.\",\n ],\n updateFrequency: \"5m\",\n },\n endpoints: [eventCategoriesMeta],\n};\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { z } from \"@/shared/zod\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<EventCategoriesInput, string[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: eventCategoriesMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/eventCategories.endpoints\").eventCategoriesGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving all available event category names for filtering alerts\n */\nexport const fetchEventCategories: FetchFactory<\n EventCategoriesInput,\n string[]\n> = fetch;\n\n/**\n * React Query hook for retrieving all available event category names for filtering alerts\n */\nexport const useEventCategories: HookFactory<EventCategoriesInput, string[]> =\n useHook;\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<AlertsInput, Alert[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: alertsMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/highwayAlerts.endpoints\").highwayAlertsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving all current highway alerts statewide\n */\nexport const fetchAlerts: FetchFactory<AlertsInput, Alert[]> = fetch;\n\n/**\n * React Query hook for retrieving all current highway alerts statewide\n */\nexport const useAlerts: HookFactory<AlertsInput, Alert[]> = useHook;\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<AlertsByMapAreaInput, Alert[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: alertsByMapAreaMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/highwayAlerts.endpoints\").highwayAlertsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving highway alerts filtered by map area code\n */\nexport const fetchAlertsByMapArea: FetchFactory<AlertsByMapAreaInput, Alert[]> =\n fetch;\n\n/**\n * React Query hook for retrieving highway alerts filtered by map area code\n */\nexport const useAlertsByMapArea: HookFactory<AlertsByMapAreaInput, Alert[]> =\n useHook;\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<AlertsByRegionIDInput, Alert[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: alertsByRegionIdMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/highwayAlerts.endpoints\").highwayAlertsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving highway alerts filtered by WSDOT region ID\n */\nexport const fetchAlertsByRegionId: FetchFactory<\n AlertsByRegionIDInput,\n Alert[]\n> = fetch;\n\n/**\n * React Query hook for retrieving highway alerts filtered by WSDOT region ID\n */\nexport const useAlertsByRegionId: HookFactory<AlertsByRegionIDInput, Alert[]> =\n useHook;\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { datesHelper } from \"@/shared/utils\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<SearchAlertsInput, Alert[]>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: searchAlertsMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/highwayAlerts.endpoints\").highwayAlertsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for searching highway alerts by route, region, time range, and milepost\n */\nexport const searchAlerts: FetchFactory<SearchAlertsInput, Alert[]> = fetch;\n\n/**\n * React Query hook for searching highway alerts by route, region, time range, and milepost\n */\nexport const useSearchAlerts: HookFactory<SearchAlertsInput, Alert[]> = useHook;\n","import type { EndpointGroupMeta } from \"@/apis/types\";\nimport { alertByIdMeta } from \"../alertById\";\nimport { alertsMeta } from \"../alerts\";\nimport { alertsByMapAreaMeta } from \"../alertsByMapArea\";\nimport { alertsByRegionIdMeta } from \"../alertsByRegionId\";\nimport { searchAlertsMeta } from \"../searchAlerts\";\n\n/**\n * Endpoint group metadata for highway alerts endpoints\n */\nexport const highwayAlertsGroup: EndpointGroupMeta = {\n name: \"highwayAlerts\",\n // Using FREQUENT strategy because highway alerts can change every few minutes as incidents occur\n cacheStrategy: \"FREQUENT\",\n documentation: {\n summary:\n \"Real-time highway alerts for traffic incidents and road conditions.\",\n description:\n \"Traffic incidents, construction, maintenance, and other events affecting Washington State highways, including location details, impact levels, timestamps, and event classifications.\",\n useCases: [\n \"Monitor real-time traffic incidents and road conditions.\",\n \"Plan alternate routes based on current highway alerts.\",\n \"Display active alerts filtered by location, region, or category.\",\n \"Track alert status and estimated resolution times.\",\n ],\n updateFrequency: \"5m\",\n },\n endpoints: [\n alertsMeta,\n searchAlertsMeta,\n alertsByRegionIdMeta,\n alertsByMapAreaMeta,\n alertByIdMeta,\n ],\n};\n","import type { EndpointMeta } from \"@/apis/types\";\nimport {\n createFetchAndHook,\n type FetchFactory,\n type HookFactory,\n} from \"@/shared/factories\";\nimport { wsdotHighwayAlertsApiMeta } from \"../apiMeta\";\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\nconst { fetch, useHook } = createFetchAndHook<AlertByIdInput, Alert>({\n api: wsdotHighwayAlertsApiMeta,\n endpoint: alertByIdMeta,\n getCacheStrategy: () =>\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"./shared/highwayAlerts.endpoints\").highwayAlertsGroup\n .cacheStrategy,\n});\n\n/**\n * Fetch function for retrieving highway alert details for a specific alert ID\n */\nexport const fetchAlertById: FetchFactory<AlertByIdInput, Alert> = fetch;\n\n/**\n * React Query hook for retrieving highway alert details for a specific alert ID\n */\nexport const useAlertById: HookFactory<AlertByIdInput, Alert> = useHook;\n"]}