import{iz as n,H as s,Y as d}from"./app-k0jcl5PQ.js";const i={namespace:"localcache",idAttribute:"deviceId"},p={devices(){return{url:"/api/localcache/v1/customers/devices",key:"localcache:devices",normalizeOptions:i}},device(e){return{url:`/api/localcache/v1/devices/${e}`,key:`localcache:devices:${e}`,normalizeOptions:i}},updateDevice(e,a,l,c,r){return{url:`/api/localcache/v1/devices/${e}`,key:"localcache:devices:update",type:s.PUT,data:a,normalizeOptions:i,success:l,error:c,always:r}},deleteDevice(e,a,l,c){return{url:`/api/localcache/v1/devices/${e}`,key:"localcache:devices:delete",type:s.DELETE,normalizeOptions:i,success:a,error:l,always:c}},updates(e){return{url:`/api/localcache/v1/devices/${e}/update`,key:`localcache:devices:${e}:updates`,normalize:!1}},deviceUpdate(e){return{url:`/api/localcache/v1/devices/${e}/deviceupdate`,key:`localcache:devices:${e}:deviceupdate`,normalize:!1}},update(e,a){return{url:`/api/localcache/v1/devices/${e}/update`,key:"localcache:update",type:s.POST,data:{versionString:a},normalize:!1,invalidationKeys:["localcache"]}},stats(e){const a={bytesDownloaded:"httpprovider.bytes_downloaded",bytesRead:"store.bytes_read",storageFree:"store.storage_free",storageUsed:"store.storage_used",count:"store.objects"},l={key:Object.values(a)};return{url:d.urlBuilder(`/api/localcache/v1/devices/${e}/stats/latest`,l),key:`localcache:devices:${e}:stats`,normalize:!1,formatData:c=>{if(!c)return{};const r=c.reduce((t,o)=>(t[o.key]=o.value,t),{});return Object.keys(a).reduce((t,o)=>(t[o]=r[a[o]],t),{})}}},channels(e){return{url:`/api/localcache/v1/devices/${e}/channels`,key:`localcache:devices:${e}:channels`,normalize:!1}},config(e){return{url:`/api/localcache/v1/configs/devices/${e}`,key:`localcache:devices:${e}:config`,normalize:!1,formatData:a=>a==null?void 0:a.configuration}},updateConfig(e,a,l,c){const r={downloadQuality:a.downloadQuality,autoUpdate:a.autoUpdate,downloadTime:{start:a.downloadStartTime,end:a.downloadEndTime}};return{url:`/api/localcache/v1/configs/devices/${e}`,key:"localcache:update:config",type:s.PUT,data:r,invalidationKeys:[`localcache:devices:${e}:config`],normalize:!1,success:l,error:c}},address(e){return{url:`/api/localcache/v1/devices/${e}/address`,key:`localcache:devices:${e}:address`,normalize:!1}},ping(e,a){return{url:`${a}/ping`,key:`localcache:devices:${e}:ping`,normalize:!1,cacheDuration:n.SHORT}}};export{p as L};
//# sourceMappingURL=F6ooBnzv.chunk.js.map
