var __spreadArray=this&&this.__spreadArray||function(r,t,a){if(a||arguments.length===2)for(var i=0,e=t.length,n;i<e;i++){if(n||!(i in t)){if(!n)n=Array.prototype.slice.call(t,0,i);n[i]=t[i]}}return r.concat(n||Array.prototype.slice.call(t))};import{A as APIBase}from"./apiBase-648a161d.js";import{D as DataTransferField}from"./data-transfer-field-2f305919.js";import{C as Comparison}from"./filter-cbaa3d7d.js";var DataApiImpl=function(){function r(r,t){var a=this;if(t===void 0){t={}}this.query=function(r,t){return a.api.post("".concat(r,"/query"),t)};this.get=function(r,t,i){return new Promise((function(e,n){return a.query(r,{fields:__spreadArray(__spreadArray([],i.fields||[],true),[new DataTransferField("_id")],false),filter:{comparison:Comparison.Eq,id:"_id",value:t},limit:1,skip:0}).then((function(r){return e(r.results.pop())})).catch((function(r){return n(r)}))}))};this.update=function(r,t,i){return a.api.post("".concat(r,"/").concat(t,"/update"),i)};this.addAuthInterceptor=function(r){a.api.addAuthInterceptor(r)};this.api=new APIBase(r,t)}return r}();export{DataApiImpl as D};