ec.fdk 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";var pt=Object.defineProperty,yt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var kt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var z=(n,t,e)=>t in n?pt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,o=(n,t)=>{for(var e in t||(t={}))kt.call(t,e)&&z(n,e,t[e]);if(x)for(var e of x(t))$t.call(t,e)&&z(n,e,t[e]);return n},h=(n,t)=>yt(n,mt(t));var c=(n,t,e)=>new Promise((s,r)=>{var u=a=>{try{d(e.next(a))}catch(l){r(l)}},i=a=>{try{d(e.throw(a))}catch(l){r(l)}},d=a=>a.done?s(a.value):Promise.resolve(a.value).then(u,i);d((e=e.apply(n,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(s){return c(this,arguments,function*(n,t={},e={}){var d;const{token:r,rawRes:u}=t;r&&(e.headers=h(o({},e.headers||{}),{Authorization:`Bearer ${r}`}));const i=yield fetch(n,e);if(!i.ok){if((d=i.headers.get("content-type"))!=null&&d.includes("application/json")){const a=yield i.json(),l=`${a.title}
2
- ${a.detail}
3
- ${a.verbose}`;throw new Error(l)}throw new Error(`unexpected fetch error: ${i.statusText}`)}return u?i:yield i.json()})}const E={datamanager:{live:"https://datamanager.entrecode.de/",stage:"https://datamanager.cachena.entrecode.de/"},accounts:{live:"https://accounts.entrecode.de/",stage:"https://accounts.cachena.entrecode.de/"},appserver:{live:"https://appserver.entrecode.de/",stage:"https://appserver.cachena.entrecode.de/"},"dm-history":{live:"https://dm-history.entrecode.de/",stage:"https://dm-history.cachena.entrecode.de/"}};function y(n,t="stage",e="datamanager"){const s=E[e];if(!s)throw new Error(`subdomain "${e}" not found. Try one of ${Object.keys(E).join(", ")}`);const r=s[t];if(!r)throw new Error(`env "${t}" not found. Try one of ${Object.keys(s[t]).join(", ")}`);return r+n}function $(n,t=!0){return Object.entries(n).sort((e,s)=>e[0].localeCompare(s[0])).map(([e,s])=>`${e}=${s}`).join("&")}function g(n){Object.entries(n).forEach(([t,e])=>{if(e===void 0)throw new Error(`expected ${t} to be set!`)})}const N={stage:"https://accounts.cachena.entrecode.de/",live:"https://accounts.entrecode.de/"};function J(n){return c(this,null,function*(){let{env:t,dmShortID:e,email:s,password:r}=n;g({env:t,dmShortID:e,email:s,password:r});const u=y(`api/${e}/_auth/login?clientID=rest`,t);return yield p(u,{},{method:"POST",body:JSON.stringify({email:s,password:r}),headers:{"Content-Type":"application/json"}})})}function R(n){return c(this,null,function*(){let{env:t,email:e,password:s}=n;g({env:t,email:e,password:s});const r=`${N[t]}auth/login?clientID=rest`;return yield p(r,{},{method:"POST",body:JSON.stringify({email:e,password:s}),headers:{"Content-Type":"application/json"}})})}function U(n){return c(this,null,function*(){let{dmShortID:t,env:e,token:s}=n;g({dmShortID:t,env:e,token:s});const r=y(`api/${t}/_auth/logout?clientID=rest&token=${s}`,e);return yield p(r,{rawRes:!0},{method:"POST"})})}function M(n){return c(this,null,function*(){let{env:t,token:e}=n;g({env:t,token:e});const s=`${N[t]}auth/logout?clientID=rest`;return yield p(s,{rawRes:!0,token:e},{method:"POST"})})}function V({dmShortID:n}){return g({dmShortID:n}),n}function G({env:n}){return g({env:n}),n}let wt=["created","creator","id","modified","private","_created","_creator","_embedded","_entryTitle","_id","_links","_modelTitle","_modelTitleField","_modified"];function H(n){let t={};for(let e in n)wt.includes(e)||(t[e]=n[e]);return t}function Et(n){return JSON.parse(JSON.stringify(n))}function Q(n){return c(this,null,function*(){let{env:t,dmShortID:e}=n;g({env:t,dmShortID:e});const s=y(`api/${e}`,t);return p(s,n)})}function S(n){return c(this,null,function*(){let{env:t,dmShortID:e,model:s,options:r={}}=n;g({env:t,dmShortID:e,model:s}),r=o({size:50,page:1,_list:!0},r);const u=$(r),i=y(`api/${e}/${s}?${u}`,t),{count:d,total:a,_embedded:l}=yield p(i,n);let f=l?l[`${e}:${s}`]:[];return f=Array.isArray(f)?f:[f],{count:d,total:a,items:f}})}function W({env:n,dmShortID:t,model:e,entryID:s,token:r}){g({env:n,dmShortID:t,model:e,entryID:s});const u=$({_id:s}),i=y(`api/${t}/${e}?${u}`,n);return p(i,{token:r})}function X(u){return c(this,arguments,function*({env:n,dmShortID:t,model:e,value:s,token:r}){g({env:n,dmShortID:t,model:e,value:s});const i=y(`api/${t}/${e}`,n);return yield p(i,{token:r},{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}})})}function P(d){return c(this,arguments,function*({env:n,dmShortID:t,model:e,entryID:s,value:r,token:u,safePut:i=!1}){g({env:n,dmShortID:t,model:e,entryID:s,value:r});const a={"Content-Type":"application/json"};if(i){if(!("_modified"in r))throw new Error("expected _modified to be set!");a["If-Unmodified-Since"]=new Date(r._modified).toUTCString()}const l=y(`api/${t}/${e}?_id=${s}`,n);return r=Et(r),r=H(r),yield p(l,{token:u},{method:"PUT",headers:a,body:JSON.stringify(r)})})}function L({env:n,dmShortID:t,model:e,entryID:s,token:r}){g({env:n,dmShortID:t,model:e,entryID:s});const u=y(`api/${t}/${e}?_id=${s}`,n);return p(u,{token:r,rawRes:!0},{method:"DELETE",headers:{"Content-Type":"application/json"}})}function Y(n,t){return c(this,null,function*(){let{env:e,dmShortID:s,model:r,options:u={}}=n;g({env:e,dmShortID:s,model:r}),n.options=o({size:50,page:1,_list:!0},u);let i=0,d,a=[];for(;d===void 0||i<d;){const l=yield S(n);for(let f of l.items)a.push(yield t(f));i+=l.items.length,d=l.total,n.options.page++}return a})}function Z(r){return c(this,arguments,function*({env:n,dmShortID:t,model:e,withMetadata:s}){var f,k,D,q,I;g({env:n,dmShortID:t,model:e});const u=y(`api/schema/${t}/${e}`,n),i=yield p(u),d=(f=i==null?void 0:i.allOf)==null?void 0:f[1];if(typeof d.properties!="object")throw new Error(`getSchema: ${u} returned unexpected format: ${JSON.stringify(i)}`);const{properties:a}=d,l=H(a);for(let w in l){let m=l[w];if(m.required=d.required.includes(w),(k=l[w])!=null&&k.oneOf&&((D=l[w])==null||delete D.oneOf),(q=m.title)!=null&&q.includes("<")&&((I=m.title)!=null&&I.includes(">"))){const j=m.title.split("<")[1].slice(0,-1),ft=m.title.split("<")[0];m.type=ft,j.includes(":")?m.resource=j.split(":")[1]:m.resource=j}else["asset","entry","assets","entries"].includes(m.title)?(m.type=m.title,m.resource=null):m.type=m.title;delete l[w].title}if(s){const w=a._modelTitle.title,m=a._modelTitleField.title;return{properties:l,meta:{modelTitleField:m,modelTitle:w}}}return l})}function v(n){return Object.entries(n).map(([t,e])=>typeof e!="object"?{[t]:String(e)}:o(o(o(o(o(o(o({},e.sort&&{sort:Array.isArray(e)?e.join(","):e}),e.search&&{[t+"~"]:e.search}),e.notNull&&{[t+"!"]:""}),e.null&&{[t]:""}),e.any&&{[t]:e.any.join(",")}),e.from&&{[t+"From"]:e.from}),e.to&&{[t+"To"]:e.to})).reduce((t,e)=>o(o({},t),e),{})}const tt=v;function _(n){return n._links.collection.href.split("/").slice(-2)[0]}function B(n){const t=n._links.collection.href.split("api/")[0];return Object.keys(E.datamanager).find(s=>E.datamanager[s]===t)}const et=n=>{const t=_(n),e=B(n),s=n._modelTitle,r=n.id;return{dmShortID:t,env:e,model:s,entryID:r}},nt=n=>L(et(n)),st=(n,t)=>P(h(o({},et(n)),{value:t}));function rt(n,t){const e=_(t);return t._embedded[`${e}:${t._modelTitle}/${n}/asset`]}function ot(u){return c(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){g({env:n,dmShortID:t,assetGroup:e,assetID:s});const i=$({assetID:s}),d=y(`a/${t}/${e}?${i}`,n),{_embedded:a}=yield p(d,{token:r});return a?a["ec:dm-asset"]:void 0})}function it(n){return c(this,null,function*(){let{env:t,dmShortID:e,assetGroup:s,token:r,options:u={}}=n;g({env:t,dmShortID:e,assetGroup:s}),u=o({size:50,page:1,_list:!0},u);const i=$(u),d=y(`a/${e}/${s}?${i}`,t),{count:a,total:l,_embedded:f}=yield p(d,{token:r});let k=f?f["ec:dm-asset"]:[];return k=Array.isArray(k)?k:[k],{count:a,total:l,items:k}})}function at(d){return c(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,token:s,file:r,name:u,options:i}){g({env:n,dmShortID:t,assetGroup:e,file:r});const a=y(`a/${t}/${e}`,n),l=new FormData;return l.append("file",r,u),i&&Object.keys(i).forEach(k=>{l.append(k,i[k])}),(yield p(a,{token:s},{method:"POST",body:l}))._embedded["ec:dm-asset"]})}function ct(u){return c(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){g({env:n,dmShortID:t,assetGroup:e,assetID:s});const i=y(`a/${t}/${e}/${s}`,n);yield p(i,{token:r,rawRes:!0},{method:"DELETE"})})}function ut(n){return c(this,null,function*(){let{env:t,dmID:e,token:s}=n;g({env:t,dmID:e});const r=y(`?dataManagerID=${e}`,t);return p(r,{token:s})})}function lt(n){return c(this,null,function*(){let{env:t,options:e={}}=n;g({env:t}),e=o({size:25,page:1,_list:!0},e);const s=$(e),r=y(`?${s}`,t),{count:u,total:i,_embedded:d}=yield p(r,n);let a=d?d["ec:datamanager"]:[];return a=Array.isArray(a)?a:[a],{count:u,total:i,items:a}})}function dt(n){return c(this,null,function*(){let{env:t,dmID:e,options:s={}}=n;g({env:t,dmID:e}),s=o({size:25,dataManagerID:e,page:1,_list:!0},s);const r=$(s),u=y(`model?${r}`,t),{count:i,total:d,_embedded:a}=yield p(u,n);let l=a?a["ec:model"]:[];return l=Array.isArray(l)?l:[l],{count:i,total:d,items:l}})}function gt(n){return c(this,null,function*(){let{env:t,resource:e,options:s={},subdomain:r="datamanager"}=n;g({env:t,subdomain:r,resource:e}),s=o({size:25,page:1,_list:!0},s);const u=$(s),i=y(`${e}?${u}`,t,r),{count:d,total:a,_embedded:l}=yield p(i,n);let f=l?l[Object.keys(l)[0]]:[];return f=Array.isArray(f)?f:[f],{count:d,total:a,items:f}})}function ht(e){return c(this,arguments,function*(n,t={}){let{env:s,route:r,options:u={},subdomain:i="datamanager"}=n;g({env:s,subdomain:i,route:r}),u=o({},u);const d=$(u),a=y(`${r}?${d}`,s,i);return p(a,n,t)})}const A=Object.freeze(Object.defineProperty({__proto__:null,assetList:it,createAsset:at,createEntry:X,deleteAsset:ct,deleteEntry:L,deleteEntryObject:nt,dmList:lt,editEntry:P,editEntryObject:st,entryList:S,filterOptions:tt,getAsset:ot,getDatamanager:ut,getEcAuthKey:G,getEntry:W,getEntryAsset:rt,getEntryEnv:B,getEntryShortID:_,getPublicAuthKey:V,getSchema:Z,loginEc:R,loginPublic:J,logoutEc:M,logoutPublic:U,mapEntries:Y,modelList:dt,publicApi:Q,raw:ht,resourceList:gt,sdkOptions:v},Symbol.toStringTag,{value:"Module"})),{entryList:C,mapEntries:Tt,getEntry:bt,getAsset:At,assetList:F,createAsset:_t,deleteAsset:Ot,createEntry:jt,editEntry:K,deleteEntry:St,getSchema:Pt,loginPublic:Lt,loginEc:vt,logoutEc:Bt,logoutPublic:Dt,getEcAuthKey:T,getPublicAuthKey:b,dmList:qt,modelList:It,publicApi:xt,getDatamanager:zt,resourceList:Ct,raw:Ft}=A;function Kt(n){const{action:t}=n;if(g({action:t}),!A[t])throw new Error(`"${t}" does not exist! try one of ${Object.keys(A).join(", ")}`);return A[t](n)}class O{constructor(t={}){if(!t.storageAdapter){let e=new Map;t.storageAdapter={get:s=>e.get(s),set:(s,r)=>e.set(s,r),remove:s=>e.delete(s)}}this.config=t}set(t){return new O(o(o({},this.config),t))}entries(){return c(this,arguments,function*(t={}){const e=yield this.getBestToken();return C(h(o({},this.config),{options:t,token:e}))})}entryList(t){return c(this,null,function*(){const e=yield this.getBestToken();return C(h(o({},this.config),{options:t,token:e}))})}mapEntries(s){return c(this,arguments,function*(t,e={}){const r=yield this.getBestToken();return Tt(h(o({},this.config),{options:e,token:r}),t)})}getEntry(t){return c(this,null,function*(){const e=yield this.getBestToken();return bt(h(o({},this.config),{entryID:t,token:e}))})}editEntrySafe(t,e){return c(this,null,function*(){const s=yield this.getBestToken();return K(h(o({},this.config),{entryID:t,token:s,value:e,safePut:!0}))})}getSchema(){return c(this,null,function*(){return Pt(this.config)})}assets(t){return c(this,null,function*(){const e=yield this.getBestToken();return F(h(o({},this.config),{options:t,token:e}))})}assetList(t){return c(this,null,function*(){const e=yield this.getBestToken();return F(h(o({},this.config),{options:t,token:e}))})}createAsset(t){return c(this,null,function*(){const{file:e,name:s,options:r}=t,u=yield this.getBestToken();return _t(h(o({},this.config),{file:e,name:s,options:r,token:u}))})}deleteAsset(t){return c(this,null,function*(){const e=yield this.getBestToken();return Ot(h(o({},this.config),{token:e,assetID:t}))})}getAsset(t){return c(this,null,function*(){const e=yield this.getBestToken();return At(h(o({},this.config),{assetID:t,token:e}))})}createEntry(t){return c(this,null,function*(){const e=yield this.getBestToken();return jt(h(o({},this.config),{token:e,value:t}))})}editEntry(t,e){return c(this,null,function*(){const s=yield this.getBestToken();return K(h(o({},this.config),{entryID:t,token:s,value:e}))})}deleteEntry(t){return c(this,null,function*(){const e=yield this.getBestToken();return St(h(o({},this.config),{token:e,entryID:t}))})}resourceList(t){return c(this,null,function*(){const e=yield this.getBestToken();return Ct(h(o({},this.config),{options:t,token:e}))})}raw(t,e){return c(this,null,function*(){const s=yield this.getBestToken();return Ft(h(o({},this.config),{options:t,token:s}),e)})}storageAdapter(t){return this.set({storageAdapter:t})}removeToken(t){if(!this.config.storageAdapter)throw new Error("cannot removeToken: no storageAdapter defined!");const{remove:e}=this.config.storageAdapter;e(t)}getToken(t){if(!this.config.storageAdapter)throw new Error("cannot getAuth: no storageAdapter defined!");const{get:e}=this.config.storageAdapter;return e(t)}getPublicToken(){return this.config.token||this.getToken(b(this.config))}getEcToken(){return this.config.token||this.getToken(T(this.config))}setToken(t,e){if(!this.config.storageAdapter)throw new Error("cannot setEcToken: no storageAdapter defined!");return this.config.storageAdapter.get(t,e)}setEcToken(t){this.setToken(T(this.config),t)}setPublicToken(t){this.setToken(b(this.config),t)}loginEc(t){return vt(o(o({},this.config),t)).then(e=>this.setToken(T(this.config),e.token))}loginPublic(t){return Lt(o(o({},this.config),t)).then(e=>this.setToken(b(this.config),e.token))}logoutPublic(){const t=this.getPublicToken();return Dt(h(o({},this.config),{token:t})).then(()=>this.removeToken(b(this.config)))}logoutEc(){const t=this.getEcToken();return Bt(h(o({},this.config),{token:t})).then(()=>this.removeToken(T(this.config)))}hasPublicToken(){return!!this.getPublicToken()}hasEcToken(){return!!this.getEcToken()}hasAnyToken(){return!!this.getEcToken()||!!this.getPublicToken()}getBestToken(){try{return this.getEcToken()||this.getPublicToken()}catch(t){return}}model(t){return this.set({model:t})}token(t){return this.set({token:t})}dmShortID(t){return this.set({dmShortID:t})}dm(t){return this.dmShortID(t)}dmID(t){return this.set({dmID:t})}assetGroup(t){return this.set({assetGroup:t})}assetgroup(t){return this.assetGroup(t)}subdomain(t){return this.set({subdomain:t})}resource(t){return this.set({resource:t})}route(t){return this.set({route:t})}publicApi(){return xt(this.config)}getDatamanager(t){return c(this,null,function*(){const e=yield this.getBestToken();return zt(h(o({},this.config),{dmID:t,token:e}))})}dmList(){return c(this,arguments,function*(t={}){const e=yield this.getBestToken();return qt(h(o({},this.config),{options:t,token:e}))})}modelList(){return c(this,arguments,function*(t={}){const e=yield this.getBestToken();return It(h(o({},this.config),{options:t,token:e}))})}}const Nt=n=>new O({env:n});exports.Fdk=O;exports.act=Kt;exports.apiURL=y;exports.apis=E;exports.assetList=it;exports.createAsset=at;exports.createEntry=X;exports.deleteAsset=ct;exports.deleteEntry=L;exports.deleteEntryObject=nt;exports.dmList=lt;exports.editEntry=P;exports.editEntryObject=st;exports.entryList=S;exports.expect=g;exports.fdk=Nt;exports.fetcher=p;exports.filterOptions=tt;exports.getAsset=ot;exports.getDatamanager=ut;exports.getEcAuthKey=G;exports.getEntry=W;exports.getEntryAsset=rt;exports.getEntryEnv=B;exports.getEntryShortID=_;exports.getPublicAuthKey=V;exports.getSchema=Z;exports.loginEc=R;exports.loginPublic=J;exports.logoutEc=M;exports.logoutPublic=U;exports.mapEntries=Y;exports.modelList=dt;exports.publicApi=Q;exports.query=$;exports.raw=ht;exports.resourceList=gt;exports.sdkOptions=v;
1
+ "use strict";var pt=Object.defineProperty,yt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var kt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var z=(n,t,e)=>t in n?pt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,o=(n,t)=>{for(var e in t||(t={}))kt.call(t,e)&&z(n,e,t[e]);if(x)for(var e of x(t))$t.call(t,e)&&z(n,e,t[e]);return n},h=(n,t)=>yt(n,mt(t));var a=(n,t,e)=>new Promise((s,r)=>{var u=c=>{try{d(e.next(c))}catch(l){r(l)}},i=c=>{try{d(e.throw(c))}catch(l){r(l)}},d=c=>c.done?s(c.value):Promise.resolve(c.value).then(u,i);d((e=e.apply(n,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(s){return a(this,arguments,function*(n,t={},e={}){var d;const{token:r,rawRes:u}=t;r&&(e.headers=h(o({},e.headers||{}),{Authorization:`Bearer ${r}`}));const i=yield fetch(n,e);if(!i.ok){if((d=i.headers.get("content-type"))!=null&&d.includes("application/json")){const c=yield i.json(),l=`${c.title}
2
+ ${c.detail}
3
+ ${c.verbose}`;throw new Error(l)}throw new Error(`unexpected fetch error: ${i.statusText}`)}return u?i:yield i.json()})}const E={datamanager:{live:"https://datamanager.entrecode.de/",stage:"https://datamanager.cachena.entrecode.de/"},accounts:{live:"https://accounts.entrecode.de/",stage:"https://accounts.cachena.entrecode.de/"},appserver:{live:"https://appserver.entrecode.de/",stage:"https://appserver.cachena.entrecode.de/"},"dm-history":{live:"https://dm-history.entrecode.de/",stage:"https://dm-history.cachena.entrecode.de/"}};function y(n,t="stage",e="datamanager"){const s=E[e];if(!s)throw new Error(`subdomain "${e}" not found. Try one of ${Object.keys(E).join(", ")}`);const r=s[t];if(!r)throw new Error(`env "${t}" not found. Try one of ${Object.keys(s[t]).join(", ")}`);return r+n}function $(n,t=!0){return Object.entries(n).sort((e,s)=>e[0].localeCompare(s[0])).map(([e,s])=>`${e}=${s}`).join("&")}function g(n){Object.entries(n).forEach(([t,e])=>{if(e===void 0)throw new Error(`expected ${t} to be set!`)})}const N={stage:"https://accounts.cachena.entrecode.de/",live:"https://accounts.entrecode.de/"};function J(n){return a(this,null,function*(){let{env:t,dmShortID:e,email:s,password:r}=n;g({env:t,dmShortID:e,email:s,password:r});const u=y(`api/${e}/_auth/login?clientID=rest`,t);return yield p(u,{},{method:"POST",body:JSON.stringify({email:s,password:r}),headers:{"Content-Type":"application/json"}})})}function R(n){return a(this,null,function*(){let{env:t,email:e,password:s}=n;g({env:t,email:e,password:s});const r=`${N[t]}auth/login?clientID=rest`;return yield p(r,{},{method:"POST",body:JSON.stringify({email:e,password:s}),headers:{"Content-Type":"application/json"}})})}function U(n){return a(this,null,function*(){let{dmShortID:t,env:e,token:s}=n;g({dmShortID:t,env:e,token:s});const r=y(`api/${t}/_auth/logout?clientID=rest&token=${s}`,e);return yield p(r,{rawRes:!0},{method:"POST"})})}function M(n){return a(this,null,function*(){let{env:t,token:e}=n;g({env:t,token:e});const s=`${N[t]}auth/logout?clientID=rest`;return yield p(s,{rawRes:!0,token:e},{method:"POST"})})}function V({dmShortID:n}){return g({dmShortID:n}),n}function G({env:n}){return g({env:n}),n}let wt=["created","creator","id","modified","private","_created","_creator","_embedded","_entryTitle","_id","_links","_modelTitle","_modelTitleField","_modified"];function H(n){let t={};for(let e in n)wt.includes(e)||(t[e]=n[e]);return t}function Et(n){return JSON.parse(JSON.stringify(n))}function Q(n){return a(this,null,function*(){let{env:t,dmShortID:e}=n;g({env:t,dmShortID:e});const s=y(`api/${e}`,t);return p(s,n)})}function S(n){return a(this,null,function*(){let{env:t,dmShortID:e,model:s,options:r={}}=n;g({env:t,dmShortID:e,model:s}),r=o({size:50,page:1,_list:!0},r);const u=$(r),i=y(`api/${e}/${s}?${u}`,t),{count:d,total:c,_embedded:l}=yield p(i,n);let f=l?l[`${e}:${s}`]:[];return f=Array.isArray(f)?f:[f],{count:d,total:c,items:f}})}function W({env:n,dmShortID:t,model:e,entryID:s,token:r}){g({env:n,dmShortID:t,model:e,entryID:s});const u=$({_id:s}),i=y(`api/${t}/${e}?${u}`,n);return p(i,{token:r})}function X(u){return a(this,arguments,function*({env:n,dmShortID:t,model:e,value:s,token:r}){g({env:n,dmShortID:t,model:e,value:s});const i=y(`api/${t}/${e}`,n);return yield p(i,{token:r},{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}})})}function P(d){return a(this,arguments,function*({env:n,dmShortID:t,model:e,entryID:s,value:r,token:u,safePut:i=!1}){g({env:n,dmShortID:t,model:e,entryID:s,value:r});const c={"Content-Type":"application/json"};if(i){if(!("_modified"in r))throw new Error("expected _modified to be set!");c["If-Unmodified-Since"]=new Date(r._modified).toUTCString()}const l=y(`api/${t}/${e}?_id=${s}`,n);return r=Et(r),r=H(r),yield p(l,{token:u},{method:"PUT",headers:c,body:JSON.stringify(r)})})}function L({env:n,dmShortID:t,model:e,entryID:s,token:r}){g({env:n,dmShortID:t,model:e,entryID:s});const u=y(`api/${t}/${e}?_id=${s}`,n);return p(u,{token:r,rawRes:!0},{method:"DELETE",headers:{"Content-Type":"application/json"}})}function Y(n,t){return a(this,null,function*(){let{env:e,dmShortID:s,model:r,options:u={}}=n;g({env:e,dmShortID:s,model:r}),n.options=o({size:50,page:1,_list:!0},u);let i=0,d,c=[];for(;d===void 0||i<d;){const l=yield S(n);for(let f of l.items)c.push(yield t(f));i+=l.items.length,d=l.total,n.options.page++}return c})}function Z(r){return a(this,arguments,function*({env:n,dmShortID:t,model:e,withMetadata:s}){var f,k,D,q,I;g({env:n,dmShortID:t,model:e});const u=y(`api/schema/${t}/${e}`,n),i=yield p(u),d=(f=i==null?void 0:i.allOf)==null?void 0:f[1];if(typeof d.properties!="object")throw new Error(`getSchema: ${u} returned unexpected format: ${JSON.stringify(i)}`);const{properties:c}=d,l=H(c);for(let w in l){let m=l[w];if(m.required=d.required.includes(w),(k=l[w])!=null&&k.oneOf&&((D=l[w])==null||delete D.oneOf),(q=m.title)!=null&&q.includes("<")&&((I=m.title)!=null&&I.includes(">"))){const j=m.title.split("<")[1].slice(0,-1),ft=m.title.split("<")[0];m.type=ft,j.includes(":")?m.resource=j.split(":")[1]:m.resource=j}else["asset","entry","assets","entries"].includes(m.title)?(m.type=m.title,m.resource=null):m.type=m.title;delete l[w].title}if(s){const w=c._modelTitle.title,m=c._modelTitleField.title;return{properties:l,meta:{modelTitleField:m,modelTitle:w}}}return l})}function v(n){return Object.entries(n).map(([t,e])=>typeof e!="object"?{[t]:String(e)}:o(o(o(o(o(o(o({},e.sort&&{sort:Array.isArray(e)?e.join(","):e}),e.search&&{[t+"~"]:e.search}),e.notNull&&{[t+"!"]:""}),e.null&&{[t]:""}),e.any&&{[t]:e.any.join(",")}),e.from&&{[t+"From"]:e.from}),e.to&&{[t+"To"]:e.to})).reduce((t,e)=>o(o({},t),e),{})}const tt=v;function O(n){return n._links.collection.href.split("/").slice(-2)[0]}function B(n){const t=n._links.collection.href.split("api/")[0];return Object.keys(E.datamanager).find(s=>E.datamanager[s]===t)}const et=n=>{const t=O(n),e=B(n),s=n._modelTitle,r=n.id;return{dmShortID:t,env:e,model:s,entryID:r}},nt=n=>L(et(n)),st=(n,t)=>P(h(o({},et(n)),{value:t}));function rt(n,t){const e=O(t);return t._embedded[`${e}:${t._modelTitle}/${n}/asset`]}function ot(u){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){g({env:n,dmShortID:t,assetGroup:e,assetID:s});const i=$({assetID:s}),d=y(`a/${t}/${e}?${i}`,n),{_embedded:c}=yield p(d,{token:r});return c?c["ec:dm-asset"]:void 0})}function it(n){return a(this,null,function*(){let{env:t,dmShortID:e,assetGroup:s,token:r,options:u={}}=n;g({env:t,dmShortID:e,assetGroup:s}),u=o({size:50,page:1,_list:!0},u);const i=$(u),d=y(`a/${e}/${s}?${i}`,t),{count:c,total:l,_embedded:f}=yield p(d,{token:r});let k=f?f["ec:dm-asset"]:[];return k=Array.isArray(k)?k:[k],{count:c,total:l,items:k}})}function ct(d){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,token:s,file:r,name:u,options:i}){g({env:n,dmShortID:t,assetGroup:e,file:r});const c=y(`a/${t}/${e}`,n),l=new FormData;return l.append("file",r,u),i&&Object.keys(i).forEach(k=>{l.append(k,i[k])}),(yield p(c,{token:s},{method:"POST",body:l}))._embedded["ec:dm-asset"]})}function at(u){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){g({env:n,dmShortID:t,assetGroup:e,assetID:s});const i=y(`a/${t}/${e}/${s}`,n);yield p(i,{token:r,rawRes:!0},{method:"DELETE"})})}function ut(n){return a(this,null,function*(){let{env:t,dmID:e,token:s}=n;g({env:t,dmID:e});const r=y(`?dataManagerID=${e}`,t);return p(r,{token:s})})}function lt(n){return a(this,null,function*(){let{env:t,options:e={}}=n;g({env:t}),e=o({size:25,page:1,_list:!0},e);const s=$(e),r=y(`?${s}`,t),{count:u,total:i,_embedded:d}=yield p(r,n);let c=d?d["ec:datamanager"]:[];return c=Array.isArray(c)?c:[c],{count:u,total:i,items:c}})}function dt(n){return a(this,null,function*(){let{env:t,dmID:e,options:s={}}=n;g({env:t,dmID:e}),s=o({size:25,dataManagerID:e,page:1,_list:!0},s);const r=$(s),u=y(`model?${r}`,t),{count:i,total:d,_embedded:c}=yield p(u,n);let l=c?c["ec:model"]:[];return l=Array.isArray(l)?l:[l],{count:i,total:d,items:l}})}function gt(n){return a(this,null,function*(){let{env:t,resource:e,options:s={},subdomain:r="datamanager"}=n;g({env:t,subdomain:r,resource:e}),s=o({size:25,page:1,_list:!0},s);const u=$(s),i=y(`${e}?${u}`,t,r),{count:d,total:c,_embedded:l}=yield p(i,n);let f=l?l[Object.keys(l)[0]]:[];return f=Array.isArray(f)?f:[f],{count:d,total:c,items:f}})}function ht(e){return a(this,arguments,function*(n,t={}){let{env:s,route:r,options:u={},subdomain:i="datamanager"}=n;g({env:s,subdomain:i,route:r}),u=o({},u);const d=$(u),c=y(`${r}?${d}`,s,i);return p(c,n,t)})}const _=Object.freeze(Object.defineProperty({__proto__:null,assetList:it,createAsset:ct,createEntry:X,deleteAsset:at,deleteEntry:L,deleteEntryObject:nt,dmList:lt,editEntry:P,editEntryObject:st,entryList:S,filterOptions:tt,getAsset:ot,getDatamanager:ut,getEcAuthKey:G,getEntry:W,getEntryAsset:rt,getEntryEnv:B,getEntryShortID:O,getPublicAuthKey:V,getSchema:Z,loginEc:R,loginPublic:J,logoutEc:M,logoutPublic:U,mapEntries:Y,modelList:dt,publicApi:Q,raw:ht,resourceList:gt,sdkOptions:v},Symbol.toStringTag,{value:"Module"})),{entryList:C,mapEntries:Tt,getEntry:bt,getAsset:At,assetList:F,createAsset:_t,deleteAsset:Ot,createEntry:jt,editEntry:K,deleteEntry:St,getSchema:Pt,loginPublic:Lt,loginEc:vt,logoutEc:Bt,logoutPublic:Dt,getEcAuthKey:b,getPublicAuthKey:A,dmList:qt,modelList:It,publicApi:xt,getDatamanager:zt,resourceList:Ct,raw:Ft}=_;function Kt(n){const{action:t}=n;if(g({action:t}),!_[t])throw new Error(`"${t}" does not exist! try one of ${Object.keys(_).join(", ")}`);return _[t](n)}class T{constructor(t={}){if(!t.storageAdapter){let e=new Map;t.storageAdapter={get:s=>e.get(s),set:(s,r)=>e.set(s,r),remove:s=>e.delete(s)}}this.config=t}set(t){return new T(o(o({},this.config),t))}entries(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return C(h(o({},this.config),{options:t,token:e}))})}entryList(t){return a(this,null,function*(){const e=yield this.getBestToken();return C(h(o({},this.config),{options:t,token:e}))})}mapEntries(s){return a(this,arguments,function*(t,e={}){const r=yield this.getBestToken();return Tt(h(o({},this.config),{options:e,token:r}),t)})}getEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return bt(h(o({},this.config),{entryID:t,token:e}))})}editEntrySafe(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(h(o({},this.config),{entryID:t,token:s,value:e,safePut:!0}))})}getSchema(){return a(this,null,function*(){return Pt(this.config)})}assets(t){return a(this,null,function*(){const e=yield this.getBestToken();return F(h(o({},this.config),{options:t,token:e}))})}assetList(t){return a(this,null,function*(){const e=yield this.getBestToken();return F(h(o({},this.config),{options:t,token:e}))})}createAsset(t){return a(this,null,function*(){const{file:e,name:s,options:r}=t,u=yield this.getBestToken();return _t(h(o({},this.config),{file:e,name:s,options:r,token:u}))})}deleteAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return Ot(h(o({},this.config),{token:e,assetID:t}))})}getAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return At(h(o({},this.config),{assetID:t,token:e}))})}createEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return jt(h(o({},this.config),{token:e,value:t}))})}editEntry(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(h(o({},this.config),{entryID:t,token:s,value:e}))})}deleteEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return St(h(o({},this.config),{token:e,entryID:t}))})}resourceList(t){return a(this,null,function*(){const e=yield this.getBestToken();return Ct(h(o({},this.config),{options:t,token:e}))})}raw(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return Ft(h(o({},this.config),{options:t,token:s}),e)})}storageAdapter(t){return this.set({storageAdapter:t})}removeToken(t){if(!this.config.storageAdapter)throw new Error("cannot removeToken: no storageAdapter defined!");const{remove:e}=this.config.storageAdapter;e(t)}getToken(t){if(!this.config.storageAdapter)throw new Error("cannot getAuth: no storageAdapter defined!");const{get:e}=this.config.storageAdapter;return e(t)}getPublicToken(){return this.config.token||this.getToken(A(this.config))}getEcToken(){return this.config.token||this.getToken(b(this.config))}setToken(t,e){if(!this.config.storageAdapter)throw new Error("cannot setEcToken: no storageAdapter defined!");return this.config.storageAdapter.get(t,e)}setEcToken(t){this.setToken(b(this.config),t)}setPublicToken(t){this.setToken(A(this.config),t)}loginEc(t){return vt(o(o({},this.config),t)).then(e=>this.setToken(b(this.config),e.token))}loginPublic(t){return Lt(o(o({},this.config),t)).then(e=>this.setToken(A(this.config),e.token))}logoutPublic(){const t=this.getPublicToken();return Dt(h(o({},this.config),{token:t})).then(()=>this.removeToken(A(this.config)))}logoutEc(){const t=this.getEcToken();return Bt(h(o({},this.config),{token:t})).then(()=>this.removeToken(b(this.config)))}hasPublicToken(){return!!this.getPublicToken()}hasEcToken(){return!!this.getEcToken()}hasAnyToken(){return!!this.getEcToken()||!!this.getPublicToken()}getBestToken(){try{return this.getEcToken()||this.getPublicToken()}catch(t){return}}model(t){return this.set({model:t})}token(t){return this.set({token:t})}dmShortID(t){return this.set({dmShortID:t})}dm(t){return this.dmShortID(t)}dmID(t){return this.set({dmID:t})}assetGroup(t){return this.set({assetGroup:t})}assetgroup(t){return this.assetGroup(t)}subdomain(t){return this.set({subdomain:t})}resource(t){return this.set({resource:t})}route(t){return this.set({route:t})}publicApi(){return xt(this.config)}getDatamanager(t){return a(this,null,function*(){const e=yield this.getBestToken();return zt(h(o({},this.config),{dmID:t,token:e}))})}dmList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return qt(h(o({},this.config),{options:t,token:e}))})}modelList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return It(h(o({},this.config),{options:t,token:e}))})}}const Nt=n=>new T({env:n}),Jt=n=>new T({env:n});exports.Fdk=T;exports.act=Kt;exports.apiURL=y;exports.apis=E;exports.assetList=it;exports.createAsset=ct;exports.createEntry=X;exports.deleteAsset=at;exports.deleteEntry=L;exports.deleteEntryObject=nt;exports.dmList=lt;exports.editEntry=P;exports.editEntryObject=st;exports.entryList=S;exports.expect=g;exports.fdk=Nt;exports.fetcher=p;exports.filterOptions=tt;exports.getAsset=ot;exports.getDatamanager=ut;exports.getEcAuthKey=G;exports.getEntry=W;exports.getEntryAsset=rt;exports.getEntryEnv=B;exports.getEntryShortID=O;exports.getPublicAuthKey=V;exports.getSchema=Z;exports.loginEc=R;exports.loginPublic=J;exports.logoutEc=M;exports.logoutPublic=U;exports.mapEntries=Y;exports.modelList=dt;exports.publicApi=Q;exports.query=$;exports.raw=ht;exports.resourceList=gt;exports.sdk=Jt;exports.sdkOptions=v;
package/dist/index.mjs CHANGED
@@ -322,8 +322,8 @@ function ct(r) {
322
322
  for (let w in l) {
323
323
  let m = l[w];
324
324
  if (m.required = d.required.includes(w), ($ = l[w]) != null && $.oneOf && ((j = l[w]) == null || delete j.oneOf), (S = m.title) != null && S.includes("<") && ((L = m.title) != null && L.includes(">"))) {
325
- const _ = m.title.split("<")[1].slice(0, -1), U = m.title.split("<")[0];
326
- m.type = U, _.includes(":") ? m.resource = _.split(":")[1] : m.resource = _;
325
+ const O = m.title.split("<")[1].slice(0, -1), U = m.title.split("<")[0];
326
+ m.type = U, O.includes(":") ? m.resource = O.split(":")[1] : m.resource = O;
327
327
  } else
328
328
  ["asset", "entry", "assets", "entries"].includes(m.title) ? (m.type = m.title, m.resource = null) : m.type = m.title;
329
329
  delete l[w].title;
@@ -339,7 +339,7 @@ function F(n) {
339
339
  return Object.entries(n).map(([t, e]) => typeof e != "object" ? { [t]: String(e) } : o(o(o(o(o(o(o({}, e.sort && { sort: Array.isArray(e) ? e.join(",") : e }), e.search && { [t + "~"]: e.search }), e.notNull && { [t + "!"]: "" }), e.null && { [t]: "" }), e.any && { [t]: e.any.join(",") }), e.from && { [t + "From"]: e.from }), e.to && { [t + "To"]: e.to })).reduce((t, e) => o(o({}, t), e), {});
340
340
  }
341
341
  const ut = F;
342
- function O(n) {
342
+ function P(n) {
343
343
  return n._links.collection.href.split("/").slice(-2)[0];
344
344
  }
345
345
  function J(n) {
@@ -349,13 +349,13 @@ function J(n) {
349
349
  );
350
350
  }
351
351
  const R = (n) => {
352
- const t = O(n), e = J(n), s = n._modelTitle, r = n.id;
352
+ const t = P(n), e = J(n), s = n._modelTitle, r = n.id;
353
353
  return { dmShortID: t, env: e, model: s, entryID: r };
354
354
  }, lt = (n) => N(R(n)), dt = (n, t) => K(h(o({}, R(n)), {
355
355
  value: t
356
356
  }));
357
357
  function gt(n, t) {
358
- const e = O(t);
358
+ const e = P(t);
359
359
  return t._embedded[`${e}:${t._modelTitle}/${n}/asset`];
360
360
  }
361
361
  function ht(u) {
@@ -485,7 +485,7 @@ const b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
485
485
  getEntry: ot,
486
486
  getEntryAsset: gt,
487
487
  getEntryEnv: J,
488
- getEntryShortID: O,
488
+ getEntryShortID: P,
489
489
  getPublicAuthKey: tt,
490
490
  getSchema: ct,
491
491
  loginEc: X,
@@ -533,7 +533,7 @@ function Ft(n) {
533
533
  );
534
534
  return b[t](n);
535
535
  }
536
- class P {
536
+ class _ {
537
537
  /** @ignore */
538
538
  constructor(t = {}) {
539
539
  if (!t.storageAdapter) {
@@ -548,7 +548,7 @@ class P {
548
548
  }
549
549
  /** @ignore */
550
550
  set(t) {
551
- return new P(o(o({}, this.config), t));
551
+ return new _(o(o({}, this.config), t));
552
552
  }
553
553
  /** @ignore */
554
554
  entries() {
@@ -1022,9 +1022,9 @@ class P {
1022
1022
  });
1023
1023
  }
1024
1024
  }
1025
- const Jt = (n) => new P({ env: n });
1025
+ const Jt = (n) => new _({ env: n }), Rt = (n) => new _({ env: n });
1026
1026
  export {
1027
- P as Fdk,
1027
+ _ as Fdk,
1028
1028
  Ft as act,
1029
1029
  y as apiURL,
1030
1030
  A as apis,
@@ -1048,7 +1048,7 @@ export {
1048
1048
  ot as getEntry,
1049
1049
  gt as getEntryAsset,
1050
1050
  J as getEntryEnv,
1051
- O as getEntryShortID,
1051
+ P as getEntryShortID,
1052
1052
  tt as getPublicAuthKey,
1053
1053
  ct as getSchema,
1054
1054
  X as loginEc,
@@ -1061,5 +1061,6 @@ export {
1061
1061
  k as query,
1062
1062
  Tt as raw,
1063
1063
  wt as resourceList,
1064
+ Rt as sdk,
1064
1065
  F as sdkOptions
1065
1066
  };
@@ -36,7 +36,7 @@ export declare function raw<T = any>(config: {
36
36
  env?: string;
37
37
  route?: string;
38
38
  subdomain?: string;
39
- options?: string;
39
+ options?: Record<string, any>;
40
40
  token?: string;
41
41
  rawRes?: boolean;
42
42
  }, fetchOptions?: {}): Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/lib/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,SAAS,EAET,YAAY,EACb,MAAM,WAAW,CAAC;AAGnB,cAAc;AACd,wBAAsB,cAAc,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMzE;AAED,cAAc;AACd,wBAAsB,MAAM,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,eAAe,CAAC,CAY7D;AAED,eAAe;AACf,wBAAsB,SAAS,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,SAAS,CAAC,CAW1D;AAED,cAAc;AACd,wBAAsB,YAAY,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,YAAY,CAAC,CAWhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,GAAG,CAAC,CAAC,GAAG,GAAG,EAC/B,MAAM,EAAE;IACN,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,EACD,YAAY,KAAK,GAChB,OAAO,CAAC,CAAC,CAAC,CAQZ"}
1
+ {"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/lib/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,SAAS,EAET,YAAY,EACb,MAAM,WAAW,CAAC;AAGnB,cAAc;AACd,wBAAsB,cAAc,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMzE;AAED,cAAc;AACd,wBAAsB,MAAM,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,eAAe,CAAC,CAY7D;AAED,eAAe;AACf,wBAAsB,SAAS,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,SAAS,CAAC,CAW1D;AAED,cAAc;AACd,wBAAsB,YAAY,CAAC,MAAM,KAAA,GAAG,OAAO,CAAC,YAAY,CAAC,CAWhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,GAAG,CAAC,CAAC,GAAG,GAAG,EAC/B,MAAM,EAAE;IACN,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,EACD,YAAY,KAAK,GAChB,OAAO,CAAC,CAAC,CAAC,CAQZ"}
package/dist/lib/api.d.ts CHANGED
@@ -380,4 +380,6 @@ export declare class Fdk {
380
380
  * // do something with api...
381
381
  */
382
382
  export declare const fdk: (env: "live" | "stage") => Fdk;
383
+ /** @ignore */
384
+ export declare const sdk: (env: "live" | "stage") => Fdk;
383
385
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EACl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+1,6 @@
1
1
  {
2
2
  "name": "ec.fdk",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "ec frontend sdk",
5
5
  "main": "dist/index.cjs",
6
6
  "directories": {