UNPKG

ws-dottie

Version:

Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration

3 lines 2.15 kB
import {b as b$1,a as a$1}from'./chunk-2S6SB7GP.mjs';import {e,a as a$2}from'./chunk-C3ZUMU65.mjs';import {a}from'./chunk-XEHBQAFR.mjs';var i,u,n=a(()=>{e();b$1();i=()=>a$1.string().refine(e=>u(e),{message:"Invalid date format. Expected .NET /Date(timestamp)/ format"}).transform(e=>{let o=a$2(e.replace(/\\\//g,"/"));if(!o)throw new Error(`Failed to parse .NET date: ${e}`);return o}),u=e=>e.length>=19&&(e.startsWith("/Date(")||e.startsWith("\\/Date("))&&(e.endsWith(")/")||e.endsWith(")\\/"));});var f,l,c=a(()=>{b$1();n();f=a$1.object({}).describe("Input parameters for cache flush date endpoint."),l=i().optional().describe("UTC datetime when static endpoint data was last updated, or undefined if no update has occurred.");});var g,d=a(()=>{b$1();g=a$1.object({Description:a$1.string().nullable().describe("Human-readable description of the roadway location, such as interchange names or cross streets."),Direction:a$1.string().nullable().describe("Traffic direction designation: N, S, B, NB, or SB, indicating which side of the highway is affected."),Latitude:a$1.number().describe("Latitude of the roadway location in decimal degrees."),Longitude:a$1.number().describe("Longitude of the roadway location in decimal degrees."),MilePost:a$1.number().describe("Milepost marker along the highway corridor, with 0 indicating route terminus."),RoadName:a$1.string().nullable().describe("Highway or route designation code, such as '005' for I-5 or '090' for I-90.")}).describe("Roadway location information including route, milepost, coordinates, and direction.");});var D,w,h=a(()=>{b$1();D=()=>a$1.string().refine(e=>w(e),{message:"Invalid date format. Expected ISO date string format"}).transform(e=>{let o=new Date(e);if(Number.isNaN(o.getTime()))throw new Error(`Failed to parse ISO date: ${e}`);return o}),w=e=>{if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d{1,3})?)?(Z|[+-]\d{2}:\d{2})?$/.test(e)){let m=new Date(e);return !Number.isNaN(m.getTime())}return true};});var b=a(()=>{c();d();n();h();}); export{i as a,f as b,l as c,c as d,g as e,D as f,b as g};//# sourceMappingURL=chunk-IZZORSYV.mjs.map //# sourceMappingURL=chunk-IZZORSYV.mjs.map