var __spreadArray=this&&this.__spreadArray||function(r,t){for(var i=0,a=t.length,e=r.length;i<a;i++,e++)r[e]=t[i];return r};import{A as APIBase}from"./kimlikApi-ac700c81.js";import{D as DataTransferField}from"./data-transfer-field-918730a3.js";import{C as Comparison}from"./filter-cbaa3d7d.js";var DataApiImpl=function(){function r(r,t){var i=this;if(t===void 0){t={}}this.query=function(r,t){return i.api.post(r+"/query",t)};this.get=function(r,t,a){return new Promise((function(e,n){return i.query(r,{fields:__spreadArray(__spreadArray([],a.fields||[]),[new DataTransferField("_id")]),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,a){return i.api.post(r+"/"+t+"/update",a)};this.addAuthInterceptor=function(r){i.api.addAuthInterceptor(r)};this.api=new APIBase(r,t)}return r}();export{DataApiImpl as D};