import{A as s}from"./p-7e860896.js";import{D as i}from"./p-944da115.js";import{C as t}from"./p-d343a062.js";class r{constructor(r,o={}){this.query=(s,i)=>this.api.post(`${s}/query`,i),this.get=(s,r,o)=>new Promise(((e,a)=>this.query(s,{fields:[...o.fields||[],new i("_id")],filter:{comparison:t.Eq,id:"_id",value:r},limit:1,skip:0}).then((s=>e(s.results.pop()))).catch((s=>a(s))))),this.update=(s,i,t)=>this.api.post(`${s}/${i}/update`,t),this.addAuthInterceptor=s=>{this.api.addAuthInterceptor(s)},this.api=new s(r,o)}}export{r as D}