@sjvair/monitor-map 1.35.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/monitor-map/MonitorDetails.css +1 -1
- package/dist/monitor-map/assets/BackgroundRequests-b04b7b5c.js +1 -0
- package/dist/monitor-map/assets/BackgroundRequests-f82922f1.js +1 -0
- package/dist/monitor-map/assets/MonitorDetails-538b4f75.js +1 -0
- package/dist/monitor-map/assets/requests-6166d3b9.js +1 -0
- package/dist/monitor-map/main.css +1 -1
- package/dist/monitor-map/sjvairMonitorMap.js +2 -2
- package/dist/widget/MonitorDetails.css +1 -1
- package/dist/widget/assets/BackgroundRequests-4254499d.js +1 -0
- package/dist/widget/assets/BackgroundRequests-74ff392a.js +1 -0
- package/dist/widget/assets/MonitorDetails-4144a4d9.js +1 -0
- package/dist/widget/assets/requests-0dc8a1c5.js +1 -0
- package/dist/widget/main.css +1 -1
- package/dist/widget/sjvairMonitorMap.js +2 -2
- package/package.json +1 -1
- package/dist/monitor-map/assets/BackgroundRequests-169365cc.js +0 -1
- package/dist/monitor-map/assets/BackgroundRequests-2ee52a25.js +0 -1
- package/dist/monitor-map/assets/BackgroundRequests-d419dacc.js +0 -1
- package/dist/monitor-map/assets/MonitorDetails-1e5dafec.js +0 -1
- package/dist/monitor-map/assets/WorkerServiceClient-be11dec3.js +0 -1
- package/dist/monitor-map/assets/requests-37573cd5.js +0 -1
- package/dist/monitor-map/assets/requests-70248dba.js +0 -1
- package/dist/widget/assets/BackgroundRequests-23c22f31.js +0 -1
- package/dist/widget/assets/BackgroundRequests-7e711c96.js +0 -1
- package/dist/widget/assets/BackgroundRequests-bd2ad95d.js +0 -1
- package/dist/widget/assets/MonitorDetails-53d44c49.js +0 -1
- package/dist/widget/assets/WorkerServiceClient-be11dec3.js +0 -1
- package/dist/widget/assets/requests-37573cd5.js +0 -1
- package/dist/widget/assets/requests-fbfd30b5.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.defineProperty,s=(s,r,o)=>(((s,r,o)=>{r in s?e(s,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[r]=o})(s,"symbol"!=typeof r?r+"":r,o),o);class r{constructor(e,r,o){s(this,"id"),s(this,"parameters"),s(this,"taskName"),this.id=e,this.parameters=o,this.taskName=r}}class o{constructor(e){s(this,"globalTaskID",0),s(this,"responders",new Map),s(this,"worker"),this.worker=e,this.worker.onmessageerror=e=>console.error("worker failed: ",e),this.worker.onmessage=e=>{const{id:s,error:r,payload:o,success:t}=e.data,a=this.responders.get(s);t?a.resolve(o):r?a.reject(r):console.error(`Unknown response from background service "${this.constructor.name}"`,e),this.responders.delete(s)}}run(e,...s){const o=new r(++this.globalTaskID,e,JSON.parse(JSON.stringify(s)));return new Promise(((e,s)=>{this.responders.set(o.id,{resolve:e,reject:s}),this.worker.postMessage(o)}))}}export{o as W};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as t,a2 as a,d as e}from"../sjvairMonitorMap.js";async function n(){return t.get("/monitors").then((t=>{const e={};for(let n of t.data.data)n.position.coordinates[1]>42||(e[n.id]=new a(n));return e}))}async function r(a,n,s=1){const o=[],i={fields:a.dataFields.join(","),page:s,timestamp__gte:e.$defaultFormat(n.start),timestamp__lte:e.$defaultFormat(n.end)};return t.get(`monitors/${a.data.id}/entries/`,{params:i}).then((async t=>{const e=t.data;if(e.data.length&&(o.push(...e.data),e.has_next_page)){const t=await r(a,n,++s).catch((t=>{throw t}));t.length&&o.push(...t)}return o}))}async function s(){return t.get("alerts/subscriptions").then((t=>t.data.data))}async function o(a){const e=`https://api.weather.gov/points/${a.join(",")}`;return await t(e).then((async a=>{try{return(await t(a.data.properties.forecastHourly)).data.properties.periods[0].temperature}catch(e){throw e}}))}export{r as fetchEntries,n as fetchMonitors,s as fetchSubscriptions,o as fetchTempByCoords};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M as t}from"./MonitorDetails-53d44c49.js";import{fetchEntries as e}from"./requests-37573cd5.js";import{d as s}from"../sjvairMonitorMap.js";async function n(n,r){return e(n,r).then((e=>{const r=[],i="PurpleAir"===n.data.device?2:60,a=new Map(Object.keys(t).map((t=>[t,[]])));for(let t=e.length-1;t>=0;t--){const n=e[t];if(r.length>1){const t=s(n.timestamp).utc().tz("America/Los_Angeles").toISOString();let e=s(r[r.length-1]);for(;e.skewedDiff(t,i)>i+1;)e=e.add(i,"m"),o(r,a,n,e)}o(r,a,n)}return[r.map((t=>t.unix())),...a.values()].filter((t=>t.length))})).catch((t=>t))}function o(t,e,n,o){o?t.push(o.utc().tz("America/Los_Angeles")):t.push(s(n.timestamp).utc().tz("America/Los_Angeles"));for(let s of e.keys())if(s in n){const t=e.get(s);let r;if(o)r=null;else{const t=parseFloat(n[s]);r=t>=0?t:0}t.push(r)}}export{n as fetchChartData};
|