PageSourceSearch

https://wagefinder.org/_nuxt/DNuvGqKv.js

js wagefinder.org collected 2026-10-05 23:08:42 UTC 18,542 bytes, 2 lines download raw bytes

1import{d as D,c as i,b as e,n as R,t as l,F as w,r as A,u as p,f as y,g as U,h as j,o as r,l as E,i as Q,q as b,v as C,s as z,x as X,e as Z,y as M}from"./uLgvvaGz.js";import{u as Y}from"./BURO8ugC.js";import"./DxbH4QD5.js";const O=u=>typeof u=="object"&&u!==null&&!Array.isArray(u),ee=["data","results","classifications","versions","states","counties","zip_codes","items"],te=u=>O(u)&&("total_prevailing_wage"in u||"wage_rate"in u||"total_rate"in u);function se(u){const k={rows:[],values:[]};let m=null,s="";if(Array.isArray(u))m=u;else if(O(u)){const _=ee.find(x=>Array.isArray(u[x])),S=Object.keys(u).find(x=>Array.isArray(u[x])),c=_??S;c&&(m=u[c],s=c)}if(!m)return{kind:"object",...k,key:s};if(m.length&&m.every(_=>!O(_)))return{kind:"values",rows:[],values:m.map(String),key:s};const g=m.filter(O);return g.some(te)?{kind:"wages",rows:g,values:[],key:s}:{kind:"objects",rows:g,values:[],key:s}}function ne(u){return u==null?"—":Array.isArray(u)?`${u.length} item${u.length===1?"":"s"}`:typeof u=="object"?`{${Object.keys(u).length} fields}`:String(u)}const B=u=>u.replace(/_/g," ").replace(/\b\w/g,k=>k.toUpperCase()),oe=new Set(["name","classification","county","state","wage_rate","base_rate","fringe_rate","total_prevailing_wage","total_rate","source_type","construction_type","union_status","wage_version","rate_identifier","effective_date","decision_date"]);function ae(u){const k=[],m=(s,g)=>{if(!(g==null||g==="")){if(Array.isArray(g)){if(!g.length)return;k.push({label:s,list:g.map(_=>O(_)?Object.entries(_).map(([S,c])=>`${B(S)}: ${c}`).join(" · "):String(_))});return}if(O(g)){for(const[_,S]of Object.entries(g))m(`${s} — ${B(_)}`,S);return}k.push({label:s,value:String(g)})}};for(const[s,g]of Object.entries(u))oe.has(s)||m(B(s),g);return k}const le={class:"rv"},ie={class:"rv-bar"},re={class:"rv-toggle"},ue={key:0,class:"rv-raw"},de={key:1,class:"rv-body"},pe={key:0,class:"rv-empty"},ce={class:"rv-count"},ve={class:"rv-wage-head"},ye={class:"rv-wage-title"},ge={class:"rv-where"},me={class:"rv-wage-money"},fe={class:"rv-total"},he={class:"rv-unit"},be={class:"rv-pills"},ke={key:1,class:"rv-chip"},_e={key:2,class:"rv-chip"},we={key:3,class:"rv-chip"},Se={key:4,class:"rv-chip"},Ce={class:"rv-rates"},Te={class:"rv-val"},xe={class:"rv-val"},$e={class:"rv-val rv-val--gold"},Ue={key:0},Ae={class:"rv-val"},Ee={key:0,class:"rv-details"},Ve={class:"rv-extras"},Pe={class:"rv-extra-k"},Oe={key:0,class:"rv-extra-list"},Re={key:1,class:"rv-extra-v"},je={class:"rv-count"},Fe={class:"rv-table-wrap"},Ie={class:"rv-table"},Le={class:"rv-count"},We={class:"rv-values"},qe={key:4,class:"rv-kv"},Ne={class:"rv-kv-k"},ze={class:"rv-kv-v"},Be=D({__name:"ApiResultView",props:{body:{},meta:{},ok:{type:Boolean}},setup(u){const k=u,m=j("formatted"),s=j(!1),g=E(()=>k.body==null?"Run a request to see live data here.":JSON.stringify(k.body,null,2)),_=async()=>{try{await navigator.clipboard.writeText(g.value),s.value=!0,setTimeout(()=>s.value=!1,1500)}catch{}},S=O,c=E(()=>se(k.body)),x=E(()=>{const h=k.body;return S(h)?Object.entries(h).filter(([,d])=>d!==null&&["string","number","boolean"].includes(typeof d)).slice(0,5).map(([d,n])=>({k:d,v:String(n)})):[]}),F=E(()=>{const h=k.body;return S(h)?Object.entries(h).map(([d,n])=>({k:d,v:L(n)})):[{k:"value",v:String(h??"")}]}),V=E(()=>{const h=new Set;for(const d of c.value.rows){for(const n of Object.keys(d))h.add(n);if(h.size>12)break}return[...h].slice(0,12)}),L=ne,P=h=>{const d=parseFloat(String(h??""));return isNaN(d)?"—":d.toFixed(2)},W=h=>/per\s*day|\bdaily\b/i.test(String(h.name??""))||parseFloat(String(h.total_prevailing_wage??h.total_rate??"0"))>250,f=ae;return(h,d)=>(r(),i("div",le,[e("div",ie,[e("span",{class:R(["rv-status",u.ok?"rv-status--ok":"rv-status--bad"])},l(u.meta),3),(r(!0),i(w,null,A(p(x),n=>(r(),i("span",{key:n.k,class:"rv-chip rv-chip--meta"},[y(l(n.k)+": ",1),e("strong",null,l(n.v),1)]))),128)),d[2]||(d[2]=e("span",{class:"rv-spacer"},null,-1)),e("div",re,[e("button",{type:"button",class:R(["rv-tab",{active:p(m)==="formatted"}]),onClick:d[0]||(d[0]=n=>m.value="formatted")},"Formatted",2),e("button",{type:"button",class:R(["rv-tab",{active:p(m)==="raw"}]),onClick:d[1]||(d[1]=n=>m.value="raw")},"Raw JSON",2)]),e("button",{type:"button",class:"rv-copy",onClick:_},l(p(s)?"Copied":"Copy JSON"),1)]),p(m)==="raw"?(r(),i("pre",ue,[e("code",null,l(p(g)),1)])):(r(),i("div",de,[u.body==null?(r(),i("p",pe,"Run a request to see live data here.")):p(c).kind==="wages"?(r(),i(w,{key:1},[e("p",ce,[y(l(p(c).rows.length)+" wage "+l(p(c).rows.length===1?"record":"records")+" ",1),p(c).key?(r(),i(w,{key:0},[d[3]||(d[3]=y(" from ",-1)),e("code",null,l(p(c).key),1)],64)):U("",!0)]),(r(!0),i(w,null,A(p(c).rows,(n,T)=>(r(),i("div",{key:T,class:"rv-wage"},[e("div",ve,[e("div",ye,[e("strong",null,l(n.name||n.classification||"Classification"),1),e("span",ge,l([n.county,n.state].filter(
1Boolean).join(", ")||"—"),1)]),e("div",me,[e("span",fe,"$"+l(P(n.total_prevailing_wage??n.total_rate)),1),e("span",he,l(W(n)?"per day":"per hour"),1)])]),e("div",be,[n.source_type?(r(),i("span",{key:0,class:R(["rv-chip",`rv-chip--${n.source_type}`])},"#"+l(n.source_type),3)):U("",!0),n.construction_type?(r(),i("span",ke,l(n.construction_type),1)):U("",!0),n.union_status?(r(),i("span",_e,l(n.union_status),1)):U("",!0),n.wage_version?(r(),i("span",we,"version "+l(n.wage_version),1)):U("",!0),n.rate_identifier?(r(),i("span",Se,"ID "+l(n.rate_identifier),1)):U("",!0)]),e("div",Ce,[e("div",null,[d[4]||(d[4]=e("span",{class:"rv-lbl"},"Base",-1)),e("span",Te,"$"+l(P(n.wage_rate??n.base_rate)),1)]),e("div",null,[d[5]||(d[5]=e("span",{class:"rv-lbl"},"Fringe",-1)),e("span",xe,"$"+l(P(n.fringe_rate)),1)]),e("div",null,[d[6]||(d[6]=e("span",{class:"rv-lbl"},"Total",-1)),e("span",$e,"$"+l(P(n.total_prevailing_wage??n.total_rate)),1)]),n.effective_date||n.decision_date?(r(),i("div",Ue,[d[7]||(d[7]=e("span",{class:"rv-lbl"},"Effective",-1)),e("span",Ae,l(n.effective_date||n.decision_date),1)])):U("",!0)]),p(f)(n).length?(r(),i("details",Ee,[e("summary",null,"Full record — "+l(p(f)(n).length)+" more "+l(p(f)(n).length===1?"field":"fields"),1),e("div",Ve,[(r(!0),i(w,null,A(p(f)(n),$=>(r(),i("div",{key:$.label,class:"rv-extra"},[e("div",Pe,l($.label),1),$.list?(r(),i("ul",Oe,[(r(!0),i(w,null,A($.list,(q,N)=>(r(),i("li",{key:N},l(q),1))),128))])):(r(),i("div",Re,l($.value),1))]))),128))])])):U("",!0)]))),128))],64)):p(c).kind==="objects"?(r(),i(w,{key:2},[e("p",je,[y(l(p(c).rows.length)+" "+l(p(c).rows.length===1?"row":"rows"),1),p(c).key?(r(),i(w,{key:0},[d[8]||(d[8]=y(" from ",-1)),e("code",null,l(p(c).key),1)],64)):U("",!0)]),e("div",Fe,[e("table",Ie,[e("thead",null,[e("tr",null,[(r(!0),i(w,null,A(p(V),n=>(r(),i("th",{key:n},l(n),1))),128))])]),e("tbody",null,[(r(!0),i(w,null,A(p(c).rows,(n,T)=>(r(),i("tr",{key:T},[(r(!0),i(w,null,A(p(V),$=>(r(),i("td",{key:$},l(p(L)(n[$])),1))),128))]))),128))])])])],64)):p(c).kind==="values"?(r(),i(w,{key:3},[e("p",Le,[y(l(p(c).values.length)+" "+l(p(c).values.length===1?"value":"values"),1),p(c).key?(r(),i(w,{key:0},[d[9]||(d[9]=y(" from ",-1)),e("code",null,l(p(c).key),1)],64)):U("",!0)]),e("div",We,[(r(!0),i(w,null,A(p(c).values,(n,T)=>(r(),i("span",{key:T,class:"rv-chip"},l(n),1))),128))])],64)):(r(),i("div",qe,[(r(!0),i(w,null,A(p(F),n=>(r(),i("div",{key:n.k,class:"rv-kv-row"},[e("div",Ne,l(n.k),1),e("div",ze,l(n.v),1)]))),128))]))]))]))}}),Ge=Q(Be,[["__scopeId","data-v-6633fe17"]]),Ke={class:"wf-playground"},Me={class:"container wf-grid"},De={class:"wf-card glass"},He={class:"stack"},Je={class:"tags"},Qe=["onClick"],Xe={class:"row-2"},Ze={class:"row-2"},Ye={class:"row-2"},et={class:"row-2"},tt={class:"row-2"},st={class:"row-2"},nt={class:"row-2"},ot={class:"checkbox"},at={class:"wf-card glass"},lt={class:"preview"},it={class:"preview-top"},rt=["innerHTML"],ct=D({__name:"explorer",setup(u){Y({title:"API Explorer | WageFinder",description:"Interactive console for trying the WageFinder prevailing wage API endpoints.",noindex:!0});const k=[{key:"health",label:"Health",method:"GET",path:"/health"},{key:"states",label:"States",method:"GET",path:"/api/v1/states"},{key:"counties",label:"Counties",method:"GET",path:"/api/v1/states/{state}/counties"},{key:"types",label:"Types",method:"GET",path:"/api/v1/construction-types"},{key:"zipCodes",label:"ZIP Codes",method:"GET",path:"/api/v1/zip-codes"},{key:"classifications",label:"Classifications",method:"GET",path:"/api/v1/classifications"},{key:"search",label:"Search",method:"GET",path:"/api/v1/search"},{key:"wages",label:"Wages",method:"GET",path:"/api/v1/wages"},{key:"versions",label:"Versions",method:"GET",path:"/api/v1/versions"},{key:"wageBySlug",label:"Wage by Slug",method:"GET",path:"/api/v1/wages/{taxonomy_slug}"},{key:"usage",label:"Usage",method:"GET",path:"/api/v1/usage"}],m={baseUrl:"/api/wf/proxy",apiKey:"",customPath:"/health",method:"GET",limit:"25",state:"",county:"",constructionType:"",classification:"",unionStatus:"",sourceType:"",version:"",searchQuery:"",offset:"0",days:"7",taxonomySlug:"",zipCode:"",includeAuth:!1},s=M({...m}),g=j(k[0]),_=M({kind:"warn",text:"Ready to test"}),S=j("Waiting"),c=j(null),x=j(!1),F=E(()=>[s.state,s.county,s.constructionType,s.classification,s.unionStatus,s.sourceType,s.zipCode,s.version].filter(o=>String(o||"").trim()!=="").length),V=o=>o.trim().replace(/\s+/g,"-"),L=E(()=>["california","illinois"].includes(s.state.trim().toLowerCase())&&s.sourceType==="federal"&&!s.version.trim()),P=()=>{let o=(s.customPath||"").trim()||"/health";return o.includes("{state}")&&(o=o.replace("{state}",encodeURIComponent(s.state.trim()||"California"))),o.includes("{taxonomy_slug}")&&(o=o.replace("{taxonomy_slug}",encodeURIComponent(s.taxonomySlug.trim()||"california-san-diego-county-state-heavy-bridge-builder
1-highway-carpenter-union"))),o},W=()=>{const o=P(),t=new URLSearchParams,v=(a,I)=>String(I||"").trim()&&t.set(a,String(I).trim());return o==="/api/v1/classifications"&&(v("state",s.state),v("county",V(s.county)),v("construction_type",s.constructionType),v("limit",s.limit),v("offset",s.offset)),o==="/api/v1/wages"&&(v("state",s.state),v("county",V(s.county)),v("construction_type",s.constructionType),v("classification",s.classification),v("union_status",s.unionStatus),v("source_type",s.sourceType),v("zip_code",s.zipCode),v("version",s.version),v("limit",s.limit),v("offset",s.offset)),o==="/api/v1/search"&&(v("q",s.searchQuery),v("limit",String(Math.min(Number(s.limit)||10,50)))),o==="/api/v1/versions"&&v("state",s.state),o==="/api/v1/zip-codes"&&(v("state",s.state),v("county",V(s.county))),o==="/api/v1/usage"&&v("days",s.days),t},f=E(()=>{const o=s.method,t=(s.baseUrl||"").trim().replace(/\/$/,""),v=P(),a=W(),I=window.location.origin,G=t.startsWith("http")?new URL(t+v):new URL(t+v,I);a.forEach((H,J)=>G.searchParams.set(J,H));const K={};return s.includeAuth&&s.apiKey.trim()&&(K["WF-API-Key"]=s.apiKey.trim()),{method:o,path:v,url:G.toString(),headers:K}}),h=E(()=>JSON.stringify({method:f.value.method,url:f.value.url,headers:Object.keys(f.value.headers).length?f.value.headers:{"WF-API-Key":"(not included)"}},null,2)),d=E(()=>{const o=[],t=f.value.path;return t==="/api/v1/wages"&&o.push(`For <strong>/api/v1/wages</strong>, at least <strong>2 filters</strong> are required. Current: <strong>${F.value}</strong>.`),/\s/.test(s.county.trim())&&o.push(`County names are hyphenated in the API — sending <strong>${V(s.county).replace(/[<>&]/g,"")}</strong>.`),t==="/api/v1/wages"&&L.value&&o.push('<strong>California/Illinois + federal source:</strong> the default "latest version" follows the state source, so federal rows return 0 results. Set <strong>Version</strong> to a federal year (e.g. <strong>2026</strong>) — see the <strong>Versions</strong> endpoint for available values.'),t==="/api/v1/search"&&o.push("Free-text search (max limit 50). Supports tags <strong>#state #federal #city #union #non-union</strong> and UPPERCASE state codes (<strong>TX</strong> → Texas). Results are lightweight hits — use the returned <strong>taxonomy_slug</strong> with <strong>Wage by Slug</strong>."),t==="/api/v1/versions"&&o.push("Lists historical wage versions per state/source. Use a returned <strong>version</strong> value in the Wages request."),o.length||o.push("Tip: Start with <strong>Health</strong>, then try <strong>States</strong>, <strong>Search</strong>, or <strong>Wages</strong>. Use full state names (<strong>California</strong>, not CA) and hyphenated counties (<strong>Los-Angeles</strong>)."),o.join("<br>")}),n=o=>{g.value=o,s.customPath=o.path,s.method=o.method},T=(o,t)=>{_.kind=o,_.text=t},$=async()=>{if(f.value.path==="/api/v1/wages"&&F.value<2){T("warn","Need at least 2 wage filters"),S.value="Blocked by client-side validation",x.value=!1,c.value={error:"At least 2 filters are required for /api/v1/wages",current_filter_count:F.value};return}T("warn","Sending request..."),S.value="Loading…";try{const o=await fetch(f.value.url,{method:f.value.method,headers:f.value.headers}),v=(o.headers.get("content-type")||"").includes("application/json")?await o.json():await o.text();S.value=`${o.status} ${o.statusText}`,x.value=o.ok,c.value=v,T(o.ok?"success":"danger",o.ok?`Success ${o.status}`:`API returned ${o.status}`)}catch(o){S.value="Request failed",x.value=!1,c.value={error:o instanceof Error?o.message:String(o),hint:"If this is a browser CORS issue, point Base URL to your proxy or same-origin backend."},T("danger","Network or CORS error")}},q=async()=>{const o=[`curl -X ${f.value.method} "${f.value.url}"`];Object.entries(f.value.headers).forEach(([t,v])=>o.push(`-H "${t}: ${v}"`)),await navigator.clipboard.writeText(o.join(` \\
2  `)),T("success","cURL copied")},N=()=>{Object.assign(s,m),g.value=k[0],S.value="Waiting",c.value=null,x.value=!1,T("warn","Ready to test")};return(o,t)=>{const v=Ge;return r(),i("div",null,[t[42]||(t[42]=e("section",{class:"page-hero page-hero--blue"},[e("div",{class:"container"},[e("h1",null,"WageFinder API Explorer"),e("p",null,"Build and test requests against the WageFinder API. Select an endpoint, fill in your parameters, and see live results.")])],-1)),e("section",Ke,[e("div",Me,[e("div",De,[t[40]||(t[40]=e("h4",null,"Request Builder",-1)),e("div",He,[e("label",null,[t[18]||(t[18]=y("Base URL ",-1)),b(e("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>s.baseUrl=a)},null,512),[[C,s.baseUrl]])]),e("label",null,[t[19]||(t[19]=y("API Key ",-1)),b(e("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>s.apiKey=a),type:"password",placeholder:"Optional — server key used automatically"},null,512),[[C,s.apiKey]])]),e("div",null,[t[20]||(t[20]=e("p",{class:"label"},"Endpoint",-1)),e("div",Je,[(r(),i(w,null,A(k,a=>e("button",{key:a.key,class:R(["tag",{active:a.key===g.value.key}]),type:"button",onClick:I=>n(a)},l(a.label),11,Qe)),64))])]),e("label",null,[t[21]||(t[21]=y("Path ",-1)),b(e("input",{"onUpdate:modelValue":t[2]||(t[2]=a=>s.customPath=a)},null,512),[[C,s.customPath]])]),e("div",Xe,[e("label",null,[t[23]||(t[23]=y("Method",-1)),b(e("select",{"onUpdate:modelValue":t[3]||(t[3]=a=>s.method=a)},[...t[22]||(t[22]=[e("option",{value:"GET"},"GET",-1),e("option",{value:"POST"},"POST",-1)])],512),[[z,s.method]])]),e("label",null,[t[24]||(t[24]=y("Limit ",-1)),b(e("input",{"onUpdate:modelValue":t[4]||(t[4]=a=>s.limit=a),type:"number",min:"1",max:"100"},null,512),[[C,s.limit]])])]),e("div",Ze,[e("label",null,[t[25]||(t[25]=y("State ",-1)),b(e("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>s.state=a),placeholder:"California"},null,512),[[C,s.state]])]),e("label",null,[t[26]||(t[26]=y("County ",-1)),b(e("input",{"onUpdate:modelValue":t[6]||(t[6]=a=>s.county=a),placeholder:"Los-Angeles"},null,512),[[C,s.county]])])]),e("div",Ye,[e("label",null,[t[27]||(t[27]=y("Construction Type ",-1)),b(e("input",{"onUpdate:modelValue":t[7]||(t[7]=a=>s.constructionType=a),placeholder:"Building"},null,512),[[C,s.constructionType]])]),e("label",null,[t[28]||(t[28]=y("
2Classification ",-1)),b(e("input",{"onUpdate:modelValue":t[8]||(t[8]=a=>s.classification=a),placeholder:"electrician"},null,512),[[C,s.classification]])])]),e("div",et,[e("label",null,[t[30]||(t[30]=y("Union Status",-1)),b(e("select",{"onUpdate:modelValue":t[9]||(t[9]=a=>s.unionStatus=a)},[...t[29]||(t[29]=[e("option",{value:""},"Any",-1),e("option",{value:"union"},"union",-1),e("option",{value:"non-union"},"non-union",-1)])],512),[[z,s.unionStatus]])]),e("label",null,[t[32]||(t[32]=y("Source Type",-1)),b(e("select",{"onUpdate:modelValue":t[10]||(t[10]=a=>s.sourceType=a)},[...t[31]||(t[31]=[e("option",{value:""},"Any",-1),e("option",{value:"federal"},"federal",-1),e("option",{value:"state"},"state",-1),e("option",{value:"city"},"city",-1)])],512),[[z,s.sourceType]])])]),e("div",tt,[e("label",null,[t[33]||(t[33]=y("Version ",-1)),b(e("input",{"onUpdate:modelValue":t[11]||(t[11]=a=>s.version=a),placeholder:"2026 / 2025-1"},null,512),[[C,s.version]])]),e("label",null,[t[34]||(t[34]=y("Search Query ",-1)),b(e("input",{"onUpdate:modelValue":t[12]||(t[12]=a=>s.searchQuery=a),placeholder:"carpenter san diego"},null,512),[[C,s.searchQuery]])])]),e("div",st,[e("label",null,[t[35]||(t[35]=y("Offset ",-1)),b(e("input",{"onUpdate:modelValue":t[13]||(t[13]=a=>s.offset=a),type:"number",min:"0"},null,512),[[C,s.offset]])]),e("label",null,[t[36]||(t[36]=y("Usage Days ",-1)),b(e("input",{"onUpdate:modelValue":t[14]||(t[14]=a=>s.days=a),type:"number",min:"1",max:"30"},null,512),[[C,s.days]])])]),e("div",nt,[e("label",null,[t[37]||(t[37]=y("Taxonomy Slug ",-1)),b(e("input",{"onUpdate:modelValue":t[15]||(t[15]=a=>s.taxonomySlug=a)},null,512),[[C,s.taxonomySlug]])]),e("label",null,[t[38]||(t[38]=y("ZIP Code ",-1)),b(e("input",{"onUpdate:modelValue":t[16]||(t[16]=a=>s.zipCode=a)},null,512),[[C,s.zipCode]])])]),e("label",ot,[b(e("input",{"onUpdate:modelValue":t[17]||(t[17]=a=>s.includeAuth=a),type:"checkbox"},null,512),[[X,s.includeAuth]]),t[39]||(t[39]=y(" Override with custom API key header",-1))]),e("div",{class:"toolbar"},[e("button",{class:"brand-btn",type:"button",onClick:$},"Send Request"),e("button",{class:"ghost-btn",type:"button",onClick:q},"Copy cURL"),e("button",{class:"ghost-btn",type:"button",onClick:N},"Reset")])])]),e("div",at,[t[41]||(t[41]=e("h4",null,"Live Response",-1)),e("div",{class:R(["pill",_.kind])},l(_.text),3),e("div",lt,[e("div",it,l(`${f.value.method} ${f.value.path}`),1),e("pre",null,l(h.value),1)]),Z(v,{body:c.value,meta:S.value,ok:x.value},null,8,["body","meta","ok"]),e("div",{class:"note",innerHTML:d.value},null,8,rt)])])])])}}});export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.