-
Notifications
You must be signed in to change notification settings - Fork 0
/
sunset-2.1.0.min.db.js
1 lines (1 loc) · 1.22 KB
/
sunset-2.1.0.min.db.js
1
"use strict";var hmMlab,connected,hmUpCare;(hmMlab=new Object).aouth={key:"4MxGe4zGExrm6o01X7-1c2LsC6-wpWKr",db:{main:"hicerp",prefix:"hicerp_"},account:"free"},hmMlab.api=((a,e=0,t=5)=>`https://api.mlab.com/api/1/databases/${hmMlab.aouth.db.main}/collections/${a}?apiKey=${hmMlab.aouth.key}&sk=${e}&l=${t}`),(hmUpCare=new Object).aouth={key:"4MxGe4zGExrm6o01X7-1c2LsC6-wpWKr",db:{main:"bank"},account:"free"},hmUpCare.api=(()=>"https://upload.uploadcare.com/base/"),connected=!!navigator.onLine,hmMlab.get=(a=>(connected&&$.getJSON(hmMlab.api(a),a=>a).fail(()=>[]),[])),hmMlab.create=((a,e)=>!!connected&&($.ajax({url:hmMlab.api(e),data:JSON.stringify(a),type:"POST",contentType:"application/json"}),!0)),hmMlab.update=((a,e,t={})=>{$.ajax({url:hmMlab.api(a)+`${e}`,data:JSON.stringify({$set:t}),type:"PUT",contentType:"application/json",success:a=>a,fail:a=>a})}),hmMlab.delete=(a=>(connected&&$.ajax({url:hmMlab.api(collection),data:JSON.stringify([a]),type:"PUT",contentType:"application/json"}),!1));let sunset=[];sunset.req=((a,e=0,t=5)=>hmMlab.api(a,e,t)),sunset.get=(a=>hmMlab.get(a)),sunset.new=((a,e)=>hmMlab.create(a,e)),sunset.upd=((a,e,t={})=>hmMlab.update(a,e,t)),sunset.updById=((a,e,t)=>sunset.upd(a,`&q={"_id":{"$oid":"${e}"}}`,t));