ec.fdk 0.5.0 → 0.5.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/README.md +19 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +254 -216
- package/dist/lib/api.d.mts +12 -0
- package/dist/lib/api.d.mts.map +1 -1
- package/dist/lib/entries.d.mts +1 -0
- package/dist/lib/entries.d.mts.map +1 -1
- package/dist/lib/util.d.mts +18 -18
- package/dist/lib/util.d.mts.map +1 -1
- package/package.json +2 -5
- package/dist/storage.d.mts +0 -2
- package/dist/storage.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -232,6 +232,7 @@ Now what follows is the autogenerated doc from source:
|
|
|
232
232
|
|
|
233
233
|
* [.Sdk](#module_api.Sdk)
|
|
234
234
|
* [.entries([options])](#module_api.Sdk+entries) ⇒ [<code>Promise.<EntryList></code>](#EntryList)
|
|
235
|
+
* [.mapEntries([options])](#module_api.Sdk+mapEntries) ⇒ [<code>Promise.<EntryList></code>](#EntryList)
|
|
235
236
|
* [.getEntry(entryID)](#module_api.Sdk+getEntry) ⇒ [<code>Promise.<EntryResource></code>](#EntryResource)
|
|
236
237
|
* [.editEntrySafe(entryID, value)](#module_api.Sdk+editEntrySafe) ⇒ [<code>Promise.<EntryResource></code>](#EntryResource)
|
|
237
238
|
* [.getSchema(entryID)](#module_api.Sdk+getSchema) ⇒ [<code>Promise.<EntrySchema></code>](#EntrySchema)
|
|
@@ -281,6 +282,24 @@ const muffins = await sdk("stage").dm("83cc6374").model("muffin").entries()
|
|
|
281
282
|
// non-public model
|
|
282
283
|
const secrets = await sdk("stage").token(token).dm("83cc6374").model("secret").entries()
|
|
283
284
|
```
|
|
285
|
+
<a name="module_api.Sdk+mapEntries"></a>
|
|
286
|
+
|
|
287
|
+
#### sdk.mapEntries([options]) ⇒ [<code>Promise.<EntryList></code>](#EntryList)
|
|
288
|
+
<p>Maps over entry list.</p>
|
|
289
|
+
|
|
290
|
+
**Kind**: instance method of [<code>Sdk</code>](#module_api.Sdk)
|
|
291
|
+
|
|
292
|
+
| Param | Type | Description |
|
|
293
|
+
| --- | --- | --- |
|
|
294
|
+
| [options] | <code>object</code> | <p>options for entry list request.</p> |
|
|
295
|
+
|
|
296
|
+
**Example**
|
|
297
|
+
```js
|
|
298
|
+
// public model
|
|
299
|
+
const muffins = sdk("stage").dm("83cc6374").model("muffin")
|
|
300
|
+
const res = await muffin.mapEntries((entry) => muffin.editEntry(entry.id, { name: entry.name + "!" }));
|
|
301
|
+
console.log("res", res);
|
|
302
|
+
```
|
|
284
303
|
<a name="module_api.Sdk+getEntry"></a>
|
|
285
304
|
|
|
286
305
|
#### sdk.getEntry(entryID) ⇒ [<code>Promise.<EntryResource></code>](#EntryResource)
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var ft=Object.defineProperty,pt=Object.defineProperties;var yt=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;var C=(n,t,e)=>t in n?ft(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,o=(n,t)=>{for(var e in t||(t={}))mt.call(t,e)&&C(n,e,t[e]);if(z)for(var e of z(t))$t.call(t,e)&&C(n,e,t[e]);return n},f=(n,t)=>pt(n,yt(t));var a=(n,t,e)=>new Promise((s,r)=>{var l=c=>{try{d(e.next(c))}catch(u){r(u)}},i=c=>{try{d(e.throw(c))}catch(u){r(u)}},d=c=>c.done?s(c.value):Promise.resolve(c.value).then(l,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:l}=t;r&&(e.headers=f(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(),u=`${c.title}
|
|
2
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 b={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/"}};function p(n,t="stage",e="datamanager"){const s=b[e];if(!s)throw new Error(`subdomain "${e}" not found. Try one of ${Object.keys(b).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 w(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 z(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=p(`api/${e}/_auth/login?clientID=rest`,t);return yield h(u,{},{method:"POST",body:JSON.stringify({email:s,password:r}),headers:{"Content-Type":"application/json"}})})}function F(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 h(r,{},{method:"POST",body:JSON.stringify({email:e,password:s}),headers:{"Content-Type":"application/json"}})})}function J(n){return a(this,null,function*(){let{dmShortID:t,env:e,token:s}=n;g({dmShortID:t,env:e,token:s});const r=p(`api/${t}/_auth/logout?clientID=rest&token=${s}`,e);return yield h(r,{dmShortID:t,rawRes:!0},{method:"POST"})})}function R(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 h(s,{rawRes:!0,token:e},{method:"POST"})})}function U({dmShortID:n}){return g({dmShortID:n}),n}function I({env:n}){return g({env:n}),n}let $t=["created","creator","id","modified","private","_created","_creator","_embedded","_entryTitle","_id","_links","_modelTitle","_modelTitleField","_modified"];function M(n){let t={};for(let e in n)$t.includes(e)||(t[e]=n[e]);return t}function wt(n){return JSON.parse(JSON.stringify(n))}function V(n){return a(this,null,function*(){let{env:t,dmShortID:e}=n;g({env:t,dmShortID:e});const s=p(`api/${e}`,t);return h(s,n)})}function G(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=w(r),i=p(`api/${e}/${s}?${u}`,t),{count:d,total:c,_embedded:l}=yield h(i,n);let y=l?l[`${e}:${s}`]:[];return y=Array.isArray(y)?y:[y],{count:d,total:c,items:y}})}function H({env:n,dmShortID:t,model:e,entryID:s,token:r}){g({env:n,dmShortID:t,model:e,entryID:s});const u=w({_id:s}),i=p(`api/${t}/${e}?${u}`,n);return h(i,{dmShortID:t,token:r})}function Q(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=p(`api/${t}/${e}`,n);return yield h(i,{env:n,dmShortID:t,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=p(`api/${t}/${e}?_id=${s}`,n);return r=wt(r),r=M(r),yield h(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=p(`api/${t}/${e}?_id=${s}`,n);return h(u,{token:r,rawRes:!0},{method:"DELETE",headers:{"Content-Type":"application/json"}})}function W(r){return a(this,arguments,function*({env:n,dmShortID:t,model:e,withMetadata:s}){var y,$,D,q,v;g({env:n,dmShortID:t,model:e});const u=p(`api/schema/${t}/${e}`,n),i=yield h(u),d=(y=i==null?void 0:i.allOf)==null?void 0:y[1];if(typeof d.properties!="object")throw new Error(`getSchema: ${u} returned unexpected format: ${JSON.stringify(i)}`);const{properties:c}=d,l=M(c);for(let E in l){let m=l[E];if(m.required=d.required.includes(E),($=l[E])!=null&&$.oneOf&&((D=l[E])==null||delete D.oneOf),(q=m.title)!=null&&q.includes("<")&&((v=m.title)!=null&&v.includes(">"))){const _=m.title.split("<")[1].slice(0,-1),gt=m.title.split("<")[0];m.type=gt,_.includes(":")?m.resource=_.split(":")[1]:m.resource=_}else["asset","entry","assets","entries"].includes(m.title)?(m.type=m.title,m.resource=null):m.type=m.title;delete l[E].title}if(s){const E=c._modelTitle.title,m=c._modelTitleField.title;return{properties:l,meta:{modelTitleField:m,modelTitle:E}}}return l})}function S(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 X=S;function k(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(b.datamanager).find(s=>b.datamanager[s]===t)}const Y=n=>{const t=k(n),e=B(n),s=n._modelTitle,r=n.id;return{dmShortID:t,env:e,model:s,entryID:r}},Z=n=>L(Y(n)),tt=(n,t)=>P(f(o({},Y(n)),{value:t}));function et(n,t){const e=k(t);return t._embedded[`${e}:${t._modelTitle}/${n}/asset`]}function nt(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=w({assetID:s}),d=p(`a/${t}/${e}?${i}`,n);return(yield h(d,{dmShortID:t,token:r}))._embedded["ec:dm-asset"]})}function st(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=w(u),d=p(`a/${e}/${s}?${i}`,t),{count:c,total:l,_embedded:y}=yield h(d,{dmShortID:e,token:r});let $=y?y["ec:dm-asset"]:[];return $=Array.isArray($)?$:[$],{count:c,total:l,items:$}})}function rt(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=p(`a/${t}/${e}`,n),l=new FormData;return l.append("file",r,u),i&&Object.keys(i).forEach($=>{l.append($,i[$])}),(yield h(c,{token:s},{method:"POST",body:l}))._embedded["ec:dm-asset"]})}function it(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=p(`a/${t}/${e}/${s}`,n);yield h(i,{token:r,rawRes:!0},{method:"DELETE"})})}function ot(n){return a(this,null,function*(){let{env:t,dmID:e,token:s}=n;g({env:t,dmID:e});const r=p(`?dataManagerID=${e}`,t);return h(r,{token:s})})}function ct(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=w(e),r=p(`?${s}`,t),{count:u,total:i,_embedded:d}=yield h(r,n);let c=d?d["ec:datamanager"]:[];return c=Array.isArray(c)?c:[c],{count:u,total:i,items:c}})}function at(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=w(s),u=p(`model?${r}`,t),{count:i,total:d,_embedded:c}=yield h(u,n);let l=c?c["ec:model"]:[];return l=Array.isArray(l)?l:[l],{count:i,total:d,items:l}})}function ut(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=w(s),i=p(`${e}?${u}`,t,r),{count:d,total:c,_embedded:l}=yield h(i,n);let y=l?l[Object.keys(l)[0]]:[];return y=Array.isArray(y)?y:[y],{count:d,total:c,items:y}})}function lt(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=w(u),c=p(`${r}?${d}`,s,i);return h(c,n,t)})}const A=Object.freeze(Object.defineProperty({__proto__:null,assetList:st,createAsset:rt,createEntry:Q,deleteAsset:it,deleteEntry:L,deleteEntryObject:Z,dmList:ct,editEntry:P,editEntryObject:tt,entryList:G,filterOptions:X,getAsset:nt,getDatamanager:ot,getEcAuthKey:I,getEntry:H,getEntryAsset:et,getEntryEnv:B,getEntryShortID:k,getPublicAuthKey:U,getSchema:W,loginEc:F,loginPublic:z,logoutEc:R,logoutPublic:J,modelList:at,publicApi:V,raw:lt,resourceList:ut,sdkOptions:S},Symbol.toStringTag,{value:"Module"})),{entryList:Et,getEntry:bt,getAsset:At,assetList:kt,createAsset:Tt,deleteAsset:_t,createEntry:Ot,editEntry:K,deleteEntry:jt,getSchema:Pt,loginPublic:Lt,loginEc:St,logoutEc:Bt,logoutPublic:Dt,getEcAuthKey:O,getPublicAuthKey:j,dmList:qt,modelList:vt,publicApi:xt,getDatamanager:Ct,resourceList:Kt,raw:Nt}=A;function zt(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 T{constructor(t){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 Et(f(o({},this.config),{options:t,token:e}))})}entryList(t){return a(this,null,function*(){return this.entries(t)})}getEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return bt(f(o({},this.config),{entryID:t,token:e}))})}editEntrySafe(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(f(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 kt(f(o({},this.config),{options:t,token:e}))})}assetList(t){return a(this,null,function*(){return this.assets(t)})}createAsset(){return a(this,arguments,function*({file:t,name:e,options:s}={}){const r=yield this.getBestToken();return Tt(f(o({},this.config),{file:t,name:e,options:s,token:r}))})}deleteAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return _t(f(o({},this.config),{token:e,assetID:t}))})}getAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return At(f(o({},this.config),{assetID:t,token:e}))})}createEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return Ot(f(o({},this.config),{token:e,value:t}))})}editEntry(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(f(o({},this.config),{entryID:t,token:s,value:e}))})}deleteEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return jt(f(o({},this.config),{token:e,entryID:t}))})}resourceList(t){return a(this,null,function*(){const e=yield this.getBestToken();return Kt(f(o({},this.config),{options:t,token:e}))})}raw(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return Nt(f(o({},this.config),{options:t,token:s}),e)})}storageAdapter(t){return this.set({storageAdapter:t})}setAuth(t){return e=>{if(!this.config.storageAdapter)throw new Error("cannot setAuth: no storageAdapter defined!");const{set:s}=this.config.storageAdapter;return s(t,e.token),e}}unsetAuth(t){return e=>{if(!this.config.storageAdapter)throw new Error("cannot unsetAuth: no storageAdapter defined!");const{remove:s}=this.config.storageAdapter;return s(t),e}}getAuth(t){if(!this.config.storageAdapter)throw new Error("cannot getAuth: no storageAdapter defined!");const{get:e}=this.config.storageAdapter;return e(t)}loginEc(t){return St(o(o({},this.config),t)).then(this.setAuth(O(this.config)))}loginPublic(t){return Lt(o(o({},this.config),t)).then(this.setAuth(j(this.config)))}logoutPublic(){const t=this.getPublicToken();return Dt(f(o({},this.config),{token:t})).then(this.unsetAuth(j(this.config)))}logoutEc(){const t=this.getEcToken();return Bt(f(o({},this.config),{token:t})).then(this.unsetAuth(O(this.config)))}getPublicToken(){return this.config.token||this.getAuth(j(this.config))}getEcToken(){return this.config.token||this.getAuth(O(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})}dmID(t){return this.set({dmID:t})}dm(t){return this.dmShortID(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 Ct(f(o({},this.config),{dmID:t,token:e}))})}dmList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return qt(f(o({},this.config),{options:t,token:e}))})}modelList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return vt(f(o({},this.config),{options:t,token:e}))})}}const dt=n=>new T({env:n}),Ft=dt;exports.Sdk=T;exports.act=zt;exports.apiURL=p;exports.apis=b;exports.assetList=st;exports.createAsset=rt;exports.createEntry=Q;exports.deleteAsset=it;exports.deleteEntry=L;exports.deleteEntryObject=Z;exports.dmList=ct;exports.editEntry=P;exports.editEntryObject=tt;exports.entryList=G;exports.expect=g;exports.fdk=Ft;exports.fetcher=h;exports.filterOptions=X;exports.getAsset=nt;exports.getDatamanager=ot;exports.getEcAuthKey=I;exports.getEntry=H;exports.getEntryAsset=et;exports.getEntryEnv=B;exports.getEntryShortID=k;exports.getPublicAuthKey=U;exports.getSchema=W;exports.loginEc=F;exports.loginPublic=z;exports.logoutEc=R;exports.logoutPublic=J;exports.modelList=at;exports.publicApi=V;exports.query=w;exports.raw=lt;exports.resourceList=ut;exports.sdk=dt;exports.sdkOptions=S;
|
|
3
|
+
${c.verbose}`;throw new Error(u)}throw new Error(`unexpected fetch error: ${i.statusText}`)}return l?i:yield i.json()})}const b={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=b[e];if(!s)throw new Error(`subdomain "${e}" not found. Try one of ${Object.keys(b).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 E(n,t=!0){return Object.entries(n).sort((e,s)=>e[0].localeCompare(s[0])).map(([e,s])=>`${e}=${s}`).join("&")}function h(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 F(n){return a(this,null,function*(){let{env:t,dmShortID:e,email:s,password:r}=n;h({env:t,dmShortID:e,email:s,password:r});const l=y(`api/${e}/_auth/login?clientID=rest`,t);return yield p(l,{},{method:"POST",body:JSON.stringify({email:s,password:r}),headers:{"Content-Type":"application/json"}})})}function I(n){return a(this,null,function*(){let{env:t,email:e,password:s}=n;h({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 J(n){return a(this,null,function*(){let{dmShortID:t,env:e,token:s}=n;h({dmShortID:t,env:e,token:s});const r=y(`api/${t}/_auth/logout?clientID=rest&token=${s}`,e);return yield p(r,{dmShortID:t,rawRes:!0},{method:"POST"})})}function R(n){return a(this,null,function*(){let{env:t,token:e}=n;h({env:t,token:e});const s=`${N[t]}auth/logout?clientID=rest`;return yield p(s,{rawRes:!0,token:e},{method:"POST"})})}function U({dmShortID:n}){return h({dmShortID:n}),n}function M({env:n}){return h({env:n}),n}let Et=["created","creator","id","modified","private","_created","_creator","_embedded","_entryTitle","_id","_links","_modelTitle","_modelTitleField","_modified"];function V(n){let t={};for(let e in n)Et.includes(e)||(t[e]=n[e]);return t}function wt(n){return JSON.parse(JSON.stringify(n))}function G(n){return a(this,null,function*(){let{env:t,dmShortID:e}=n;h({env:t,dmShortID:e});const s=y(`api/${e}`,t);return p(s,n)})}function P(n){return a(this,null,function*(){let{env:t,dmShortID:e,model:s,options:r={}}=n;h({env:t,dmShortID:e,model:s}),r=o({size:50,page:1,_list:!0},r);const l=E(r),i=y(`api/${e}/${s}?${l}`,t),{count:d,total:c,_embedded:u}=yield p(i,n);let g=u?u[`${e}:${s}`]:[];return g=Array.isArray(g)?g:[g],{count:d,total:c,items:g}})}function H({env:n,dmShortID:t,model:e,entryID:s,token:r}){h({env:n,dmShortID:t,model:e,entryID:s});const l=E({_id:s}),i=y(`api/${t}/${e}?${l}`,n);return p(i,{dmShortID:t,token:r})}function Q(l){return a(this,arguments,function*({env:n,dmShortID:t,model:e,value:s,token:r}){h({env:n,dmShortID:t,model:e,value:s});const i=y(`api/${t}/${e}`,n);return yield p(i,{env:n,dmShortID:t,token:r},{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}})})}function S(d){return a(this,arguments,function*({env:n,dmShortID:t,model:e,entryID:s,value:r,token:l,safePut:i=!1}){h({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 u=y(`api/${t}/${e}?_id=${s}`,n);return r=wt(r),r=V(r),yield p(u,{token:l},{method:"PUT",headers:c,body:JSON.stringify(r)})})}function L({env:n,dmShortID:t,model:e,entryID:s,token:r}){h({env:n,dmShortID:t,model:e,entryID:s});const l=y(`api/${t}/${e}?_id=${s}`,n);return p(l,{token:r,rawRes:!0},{method:"DELETE",headers:{"Content-Type":"application/json"}})}function W(n,t){return a(this,null,function*(){let{env:e,dmShortID:s,model:r,options:l={}}=n;h({env:e,dmShortID:s,model:r}),n.options=o({size:50,page:1,_list:!0},l);let i=0,d,c=[];for(;d===void 0||i<d;){const u=yield P(n);for(let g of u.items)c.push(yield t(g));i+=u.items.length,d=u.total,n.options.page++}return c})}function X(r){return a(this,arguments,function*({env:n,dmShortID:t,model:e,withMetadata:s}){var g,$,v,q,x;h({env:n,dmShortID:t,model:e});const l=y(`api/schema/${t}/${e}`,n),i=yield p(l),d=(g=i==null?void 0:i.allOf)==null?void 0:g[1];if(typeof d.properties!="object")throw new Error(`getSchema: ${l} returned unexpected format: ${JSON.stringify(i)}`);const{properties:c}=d,u=V(c);for(let w in u){let m=u[w];if(m.required=d.required.includes(w),($=u[w])!=null&&$.oneOf&&((v=u[w])==null||delete v.oneOf),(q=m.title)!=null&&q.includes("<")&&((x=m.title)!=null&&x.includes(">"))){const _=m.title.split("<")[1].slice(0,-1),gt=m.title.split("<")[0];m.type=gt,_.includes(":")?m.resource=_.split(":")[1]:m.resource=_}else["asset","entry","assets","entries"].includes(m.title)?(m.type=m.title,m.resource=null):m.type=m.title;delete u[w].title}if(s){const w=c._modelTitle.title,m=c._modelTitleField.title;return{properties:u,meta:{modelTitleField:m,modelTitle:w}}}return u})}function B(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 Y=B;function A(n){return n._links.collection.href.split("/").slice(-2)[0]}function D(n){const t=n._links.collection.href.split("api/")[0];return Object.keys(b.datamanager).find(s=>b.datamanager[s]===t)}const Z=n=>{const t=A(n),e=D(n),s=n._modelTitle,r=n.id;return{dmShortID:t,env:e,model:s,entryID:r}},tt=n=>L(Z(n)),et=(n,t)=>S(f(o({},Z(n)),{value:t}));function nt(n,t){const e=A(t);return t._embedded[`${e}:${t._modelTitle}/${n}/asset`]}function st(l){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){h({env:n,dmShortID:t,assetGroup:e,assetID:s});const i=E({assetID:s}),d=y(`a/${t}/${e}?${i}`,n);return(yield p(d,{dmShortID:t,token:r}))._embedded["ec:dm-asset"]})}function rt(n){return a(this,null,function*(){let{env:t,dmShortID:e,assetGroup:s,token:r,options:l={}}=n;h({env:t,dmShortID:e,assetGroup:s}),l=o({size:50,page:1,_list:!0},l);const i=E(l),d=y(`a/${e}/${s}?${i}`,t),{count:c,total:u,_embedded:g}=yield p(d,{dmShortID:e,token:r});let $=g?g["ec:dm-asset"]:[];return $=Array.isArray($)?$:[$],{count:c,total:u,items:$}})}function it(d){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,token:s,file:r,name:l,options:i}){h({env:n,dmShortID:t,assetGroup:e,file:r});const c=y(`a/${t}/${e}`,n),u=new FormData;return u.append("file",r,l),i&&Object.keys(i).forEach($=>{u.append($,i[$])}),(yield p(c,{token:s},{method:"POST",body:u}))._embedded["ec:dm-asset"]})}function ot(l){return a(this,arguments,function*({env:n,dmShortID:t,assetGroup:e,assetID:s,token:r}){h({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 ct(n){return a(this,null,function*(){let{env:t,dmID:e,token:s}=n;h({env:t,dmID:e});const r=y(`?dataManagerID=${e}`,t);return p(r,{token:s})})}function at(n){return a(this,null,function*(){let{env:t,options:e={}}=n;h({env:t}),e=o({size:25,page:1,_list:!0},e);const s=E(e),r=y(`?${s}`,t),{count:l,total:i,_embedded:d}=yield p(r,n);let c=d?d["ec:datamanager"]:[];return c=Array.isArray(c)?c:[c],{count:l,total:i,items:c}})}function ut(n){return a(this,null,function*(){let{env:t,dmID:e,options:s={}}=n;h({env:t,dmID:e}),s=o({size:25,dataManagerID:e,page:1,_list:!0},s);const r=E(s),l=y(`model?${r}`,t),{count:i,total:d,_embedded:c}=yield p(l,n);let u=c?c["ec:model"]:[];return u=Array.isArray(u)?u:[u],{count:i,total:d,items:u}})}function lt(n){return a(this,null,function*(){let{env:t,resource:e,options:s={},subdomain:r="datamanager"}=n;h({env:t,subdomain:r,resource:e}),s=o({size:25,page:1,_list:!0},s);const l=E(s),i=y(`${e}?${l}`,t,r),{count:d,total:c,_embedded:u}=yield p(i,n);let g=u?u[Object.keys(u)[0]]:[];return g=Array.isArray(g)?g:[g],{count:d,total:c,items:g}})}function dt(e){return a(this,arguments,function*(n,t={}){let{env:s,route:r,options:l={},subdomain:i="datamanager"}=n;h({env:s,subdomain:i,route:r}),l=o({},l);const d=E(l),c=y(`${r}?${d}`,s,i);return p(c,n,t)})}const k=Object.freeze(Object.defineProperty({__proto__:null,assetList:rt,createAsset:it,createEntry:Q,deleteAsset:ot,deleteEntry:L,deleteEntryObject:tt,dmList:at,editEntry:S,editEntryObject:et,entryList:P,filterOptions:Y,getAsset:st,getDatamanager:ct,getEcAuthKey:M,getEntry:H,getEntryAsset:nt,getEntryEnv:D,getEntryShortID:A,getPublicAuthKey:U,getSchema:X,loginEc:I,loginPublic:F,logoutEc:R,logoutPublic:J,mapEntries:W,modelList:ut,publicApi:G,raw:dt,resourceList:lt,sdkOptions:B},Symbol.toStringTag,{value:"Module"})),{entryList:bt,mapEntries:kt,getEntry:At,getAsset:Tt,assetList:_t,createAsset:Ot,deleteAsset:jt,createEntry:Pt,editEntry:K,deleteEntry:St,getSchema:Lt,loginPublic:Bt,loginEc:Dt,logoutEc:vt,logoutPublic:qt,getEcAuthKey:O,getPublicAuthKey:j,dmList:xt,modelList:zt,publicApi:Ct,getDatamanager:Kt,resourceList:Nt,raw:Ft}=k;function It(n){const{action:t}=n;if(h({action:t}),!k[t])throw new Error(`"${t}" does not exist! try one of ${Object.keys(k).join(", ")}`);return k[t](n)}class T{constructor(t){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 bt(f(o({},this.config),{options:t,token:e}))})}entryList(t){return a(this,null,function*(){return this.entries(t)})}mapEntries(s){return a(this,arguments,function*(t,e={}){const r=yield this.getBestToken();return kt(f(o({},this.config),{options:e,token:r}),t)})}getEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return At(f(o({},this.config),{entryID:t,token:e}))})}editEntrySafe(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(f(o({},this.config),{entryID:t,token:s,value:e,safePut:!0}))})}getSchema(){return a(this,null,function*(){return Lt(this.config)})}assets(t){return a(this,null,function*(){const e=yield this.getBestToken();return _t(f(o({},this.config),{options:t,token:e}))})}assetList(t){return a(this,null,function*(){return this.assets(t)})}createAsset(){return a(this,arguments,function*({file:t,name:e,options:s}={}){const r=yield this.getBestToken();return Ot(f(o({},this.config),{file:t,name:e,options:s,token:r}))})}deleteAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return jt(f(o({},this.config),{token:e,assetID:t}))})}getAsset(t){return a(this,null,function*(){const e=yield this.getBestToken();return Tt(f(o({},this.config),{assetID:t,token:e}))})}createEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return Pt(f(o({},this.config),{token:e,value:t}))})}editEntry(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return K(f(o({},this.config),{entryID:t,token:s,value:e}))})}deleteEntry(t){return a(this,null,function*(){const e=yield this.getBestToken();return St(f(o({},this.config),{token:e,entryID:t}))})}resourceList(t){return a(this,null,function*(){const e=yield this.getBestToken();return Nt(f(o({},this.config),{options:t,token:e}))})}raw(t,e){return a(this,null,function*(){const s=yield this.getBestToken();return Ft(f(o({},this.config),{options:t,token:s}),e)})}storageAdapter(t){return this.set({storageAdapter:t})}setAuth(t){return e=>{if(!this.config.storageAdapter)throw new Error("cannot setAuth: no storageAdapter defined!");const{set:s}=this.config.storageAdapter;return s(t,e.token),e}}unsetAuth(t){return e=>{if(!this.config.storageAdapter)throw new Error("cannot unsetAuth: no storageAdapter defined!");const{remove:s}=this.config.storageAdapter;return s(t),e}}getAuth(t){if(!this.config.storageAdapter)throw new Error("cannot getAuth: no storageAdapter defined!");const{get:e}=this.config.storageAdapter;return e(t)}loginEc(t){return Dt(o(o({},this.config),t)).then(this.setAuth(O(this.config)))}loginPublic(t){return Bt(o(o({},this.config),t)).then(this.setAuth(j(this.config)))}logoutPublic(){const t=this.getPublicToken();return qt(f(o({},this.config),{token:t})).then(this.unsetAuth(j(this.config)))}logoutEc(){const t=this.getEcToken();return vt(f(o({},this.config),{token:t})).then(this.unsetAuth(O(this.config)))}getPublicToken(){return this.config.token||this.getAuth(j(this.config))}getEcToken(){return this.config.token||this.getAuth(O(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})}dmID(t){return this.set({dmID:t})}dm(t){return this.dmShortID(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 Ct(this.config)}getDatamanager(t){return a(this,null,function*(){const e=yield this.getBestToken();return Kt(f(o({},this.config),{dmID:t,token:e}))})}dmList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return xt(f(o({},this.config),{options:t,token:e}))})}modelList(){return a(this,arguments,function*(t={}){const e=yield this.getBestToken();return zt(f(o({},this.config),{options:t,token:e}))})}}const ht=n=>new T({env:n}),Jt=ht;exports.Sdk=T;exports.act=It;exports.apiURL=y;exports.apis=b;exports.assetList=rt;exports.createAsset=it;exports.createEntry=Q;exports.deleteAsset=ot;exports.deleteEntry=L;exports.deleteEntryObject=tt;exports.dmList=at;exports.editEntry=S;exports.editEntryObject=et;exports.entryList=P;exports.expect=h;exports.fdk=Jt;exports.fetcher=p;exports.filterOptions=Y;exports.getAsset=st;exports.getDatamanager=ct;exports.getEcAuthKey=M;exports.getEntry=H;exports.getEntryAsset=nt;exports.getEntryEnv=D;exports.getEntryShortID=A;exports.getPublicAuthKey=U;exports.getSchema=X;exports.loginEc=I;exports.loginPublic=F;exports.logoutEc=R;exports.logoutPublic=J;exports.mapEntries=W;exports.modelList=ut;exports.publicApi=G;exports.query=E;exports.raw=dt;exports.resourceList=lt;exports.sdk=ht;exports.sdkOptions=B;
|
package/dist/index.mjs
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
var R = Object.defineProperty, U = Object.defineProperties;
|
|
2
|
-
var
|
|
2
|
+
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var B = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
4
|
+
var V = Object.prototype.hasOwnProperty, G = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var D = (n, t, e) => t in n ? R(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, o = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
7
|
+
V.call(t, e) && D(n, e, t[e]);
|
|
8
8
|
if (B)
|
|
9
9
|
for (var e of B(t))
|
|
10
|
-
|
|
10
|
+
G.call(t, e) && D(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
12
|
+
}, f = (n, t) => U(n, M(t));
|
|
13
13
|
var c = (n, t, e) => new Promise((s, r) => {
|
|
14
|
-
var
|
|
14
|
+
var l = (a) => {
|
|
15
15
|
try {
|
|
16
16
|
d(e.next(a));
|
|
17
|
-
} catch (
|
|
18
|
-
r(
|
|
17
|
+
} catch (u) {
|
|
18
|
+
r(u);
|
|
19
19
|
}
|
|
20
20
|
}, i = (a) => {
|
|
21
21
|
try {
|
|
22
22
|
d(e.throw(a));
|
|
23
|
-
} catch (
|
|
24
|
-
r(
|
|
23
|
+
} catch (u) {
|
|
24
|
+
r(u);
|
|
25
25
|
}
|
|
26
|
-
}, d = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(
|
|
26
|
+
}, d = (a) => a.done ? s(a.value) : Promise.resolve(a.value).then(l, i);
|
|
27
27
|
d((e = e.apply(n, t)).next());
|
|
28
28
|
});
|
|
29
|
-
function
|
|
29
|
+
function p(s) {
|
|
30
30
|
return c(this, arguments, function* (n, t = {}, e = {}) {
|
|
31
31
|
var d;
|
|
32
|
-
const { token: r, rawRes:
|
|
33
|
-
r && (e.headers =
|
|
32
|
+
const { token: r, rawRes: l } = t;
|
|
33
|
+
r && (e.headers = f(o({}, e.headers || {}), {
|
|
34
34
|
Authorization: `Bearer ${r}`
|
|
35
35
|
}));
|
|
36
36
|
const i = yield fetch(n, e);
|
|
37
37
|
if (!i.ok) {
|
|
38
38
|
if ((d = i.headers.get("content-type")) != null && d.includes("application/json")) {
|
|
39
|
-
const a = yield i.json(),
|
|
39
|
+
const a = yield i.json(), u = `${a.title}
|
|
40
40
|
${a.detail}
|
|
41
41
|
${a.verbose}`;
|
|
42
|
-
throw new Error(
|
|
42
|
+
throw new Error(u);
|
|
43
43
|
}
|
|
44
44
|
throw new Error(`unexpected fetch error: ${i.statusText}`);
|
|
45
45
|
}
|
|
46
|
-
return
|
|
46
|
+
return l ? i : yield i.json();
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
const b = {
|
|
@@ -58,6 +58,10 @@ const b = {
|
|
|
58
58
|
appserver: {
|
|
59
59
|
live: "https://appserver.entrecode.de/",
|
|
60
60
|
stage: "https://appserver.cachena.entrecode.de/"
|
|
61
|
+
},
|
|
62
|
+
"dm-history": {
|
|
63
|
+
live: "https://dm-history.entrecode.de/",
|
|
64
|
+
stage: "https://dm-history.cachena.entrecode.de/"
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
function y(n, t = "stage", e = "datamanager") {
|
|
@@ -78,7 +82,7 @@ function y(n, t = "stage", e = "datamanager") {
|
|
|
78
82
|
function w(n, t = !0) {
|
|
79
83
|
return Object.entries(n).sort((e, s) => e[0].localeCompare(s[0])).map(([e, s]) => `${e}=${s}`).join("&");
|
|
80
84
|
}
|
|
81
|
-
function
|
|
85
|
+
function h(n) {
|
|
82
86
|
Object.entries(n).forEach(([t, e]) => {
|
|
83
87
|
if (e === void 0)
|
|
84
88
|
throw new Error(`expected ${t} to be set!`);
|
|
@@ -88,13 +92,13 @@ const v = {
|
|
|
88
92
|
stage: "https://accounts.cachena.entrecode.de/",
|
|
89
93
|
live: "https://accounts.entrecode.de/"
|
|
90
94
|
};
|
|
91
|
-
function
|
|
95
|
+
function H(n) {
|
|
92
96
|
return c(this, null, function* () {
|
|
93
97
|
let { env: t, dmShortID: e, email: s, password: r } = n;
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
return yield
|
|
97
|
-
|
|
98
|
+
h({ env: t, dmShortID: e, email: s, password: r });
|
|
99
|
+
const l = y(`api/${e}/_auth/login?clientID=rest`, t);
|
|
100
|
+
return yield p(
|
|
101
|
+
l,
|
|
98
102
|
{},
|
|
99
103
|
{
|
|
100
104
|
method: "POST",
|
|
@@ -106,12 +110,12 @@ function G(n) {
|
|
|
106
110
|
);
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
|
-
function
|
|
113
|
+
function Q(n) {
|
|
110
114
|
return c(this, null, function* () {
|
|
111
115
|
let { env: t, email: e, password: s } = n;
|
|
112
|
-
|
|
116
|
+
h({ env: t, email: e, password: s });
|
|
113
117
|
const r = `${v[t]}auth/login?clientID=rest`;
|
|
114
|
-
return yield
|
|
118
|
+
return yield p(
|
|
115
119
|
r,
|
|
116
120
|
{},
|
|
117
121
|
{
|
|
@@ -124,15 +128,15 @@ function H(n) {
|
|
|
124
128
|
);
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
|
-
function
|
|
131
|
+
function W(n) {
|
|
128
132
|
return c(this, null, function* () {
|
|
129
133
|
let { dmShortID: t, env: e, token: s } = n;
|
|
130
|
-
|
|
134
|
+
h({ dmShortID: t, env: e, token: s });
|
|
131
135
|
const r = y(
|
|
132
136
|
`api/${t}/_auth/logout?clientID=rest&token=${s}`,
|
|
133
137
|
e
|
|
134
138
|
);
|
|
135
|
-
return yield
|
|
139
|
+
return yield p(
|
|
136
140
|
r,
|
|
137
141
|
{ dmShortID: t, rawRes: !0 },
|
|
138
142
|
{
|
|
@@ -141,12 +145,12 @@ function Q(n) {
|
|
|
141
145
|
);
|
|
142
146
|
});
|
|
143
147
|
}
|
|
144
|
-
function
|
|
148
|
+
function X(n) {
|
|
145
149
|
return c(this, null, function* () {
|
|
146
150
|
let { env: t, token: e } = n;
|
|
147
|
-
|
|
151
|
+
h({ env: t, token: e });
|
|
148
152
|
const s = `${v[t]}auth/logout?clientID=rest`;
|
|
149
|
-
return yield
|
|
153
|
+
return yield p(
|
|
150
154
|
s,
|
|
151
155
|
{
|
|
152
156
|
rawRes: !0,
|
|
@@ -158,13 +162,13 @@ function W(n) {
|
|
|
158
162
|
);
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
165
|
+
function Y({ dmShortID: n }) {
|
|
166
|
+
return h({ dmShortID: n }), n;
|
|
163
167
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
168
|
+
function Z({ env: n }) {
|
|
169
|
+
return h({ env: n }), n;
|
|
166
170
|
}
|
|
167
|
-
let
|
|
171
|
+
let tt = [
|
|
168
172
|
"created",
|
|
169
173
|
"creator",
|
|
170
174
|
"id",
|
|
@@ -183,39 +187,39 @@ let Z = [
|
|
|
183
187
|
function x(n) {
|
|
184
188
|
let t = {};
|
|
185
189
|
for (let e in n)
|
|
186
|
-
|
|
190
|
+
tt.includes(e) || (t[e] = n[e]);
|
|
187
191
|
return t;
|
|
188
192
|
}
|
|
189
|
-
function
|
|
193
|
+
function et(n) {
|
|
190
194
|
return JSON.parse(JSON.stringify(n));
|
|
191
195
|
}
|
|
192
|
-
function
|
|
196
|
+
function nt(n) {
|
|
193
197
|
return c(this, null, function* () {
|
|
194
198
|
let { env: t, dmShortID: e } = n;
|
|
195
|
-
|
|
199
|
+
h({ env: t, dmShortID: e });
|
|
196
200
|
const s = y(`api/${e}`, t);
|
|
197
|
-
return
|
|
201
|
+
return p(s, n);
|
|
198
202
|
});
|
|
199
203
|
}
|
|
200
|
-
function
|
|
204
|
+
function z(n) {
|
|
201
205
|
return c(this, null, function* () {
|
|
202
206
|
let { env: t, dmShortID: e, model: s, options: r = {} } = n;
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
let
|
|
206
|
-
return
|
|
207
|
+
h({ env: t, dmShortID: e, model: s }), r = o({ size: 50, page: 1, _list: !0 }, r);
|
|
208
|
+
const l = w(r), i = y(`api/${e}/${s}?${l}`, t), { count: d, total: a, _embedded: u } = yield p(i, n);
|
|
209
|
+
let g = u ? u[`${e}:${s}`] : [];
|
|
210
|
+
return g = Array.isArray(g) ? g : [g], { count: d, total: a, items: g };
|
|
207
211
|
});
|
|
208
212
|
}
|
|
209
213
|
function st({ env: n, dmShortID: t, model: e, entryID: s, token: r }) {
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
return
|
|
214
|
+
h({ env: n, dmShortID: t, model: e, entryID: s });
|
|
215
|
+
const l = w({ _id: s }), i = y(`api/${t}/${e}?${l}`, n);
|
|
216
|
+
return p(i, { dmShortID: t, token: r });
|
|
213
217
|
}
|
|
214
|
-
function rt(
|
|
218
|
+
function rt(l) {
|
|
215
219
|
return c(this, arguments, function* ({ env: n, dmShortID: t, model: e, value: s, token: r }) {
|
|
216
|
-
|
|
220
|
+
h({ env: n, dmShortID: t, model: e, value: s });
|
|
217
221
|
const i = y(`api/${t}/${e}`, n);
|
|
218
|
-
return yield
|
|
222
|
+
return yield p(
|
|
219
223
|
i,
|
|
220
224
|
{ env: n, dmShortID: t, token: r },
|
|
221
225
|
{
|
|
@@ -235,10 +239,10 @@ function C(d) {
|
|
|
235
239
|
model: e,
|
|
236
240
|
entryID: s,
|
|
237
241
|
value: r,
|
|
238
|
-
token:
|
|
242
|
+
token: l,
|
|
239
243
|
safePut: i = !1
|
|
240
244
|
}) {
|
|
241
|
-
|
|
245
|
+
h({ env: n, dmShortID: t, model: e, entryID: s, value: r });
|
|
242
246
|
const a = {
|
|
243
247
|
"Content-Type": "application/json"
|
|
244
248
|
};
|
|
@@ -247,10 +251,10 @@ function C(d) {
|
|
|
247
251
|
throw new Error("expected _modified to be set!");
|
|
248
252
|
a["If-Unmodified-Since"] = new Date(r._modified).toUTCString();
|
|
249
253
|
}
|
|
250
|
-
const
|
|
251
|
-
return r =
|
|
252
|
-
|
|
253
|
-
{ token:
|
|
254
|
+
const u = y(`api/${t}/${e}?_id=${s}`, n);
|
|
255
|
+
return r = et(r), r = x(r), yield p(
|
|
256
|
+
u,
|
|
257
|
+
{ token: l },
|
|
254
258
|
{
|
|
255
259
|
method: "PUT",
|
|
256
260
|
headers: a,
|
|
@@ -260,10 +264,10 @@ function C(d) {
|
|
|
260
264
|
});
|
|
261
265
|
}
|
|
262
266
|
function K({ env: n, dmShortID: t, model: e, entryID: s, token: r }) {
|
|
263
|
-
|
|
264
|
-
const
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
+
h({ env: n, dmShortID: t, model: e, entryID: s });
|
|
268
|
+
const l = y(`api/${t}/${e}?_id=${s}`, n);
|
|
269
|
+
return p(
|
|
270
|
+
l,
|
|
267
271
|
{ token: r, rawRes: !0 },
|
|
268
272
|
{
|
|
269
273
|
method: "DELETE",
|
|
@@ -273,69 +277,83 @@ function K({ env: n, dmShortID: t, model: e, entryID: s, token: r }) {
|
|
|
273
277
|
}
|
|
274
278
|
);
|
|
275
279
|
}
|
|
276
|
-
function it(
|
|
280
|
+
function it(n, t) {
|
|
281
|
+
return c(this, null, function* () {
|
|
282
|
+
let { env: e, dmShortID: s, model: r, options: l = {} } = n;
|
|
283
|
+
h({ env: e, dmShortID: s, model: r }), n.options = o({ size: 50, page: 1, _list: !0 }, l);
|
|
284
|
+
let i = 0, d, a = [];
|
|
285
|
+
for (; d === void 0 || i < d; ) {
|
|
286
|
+
const u = yield z(n);
|
|
287
|
+
for (let g of u.items)
|
|
288
|
+
a.push(yield t(g));
|
|
289
|
+
i += u.items.length, d = u.total, n.options.page++;
|
|
290
|
+
}
|
|
291
|
+
return a;
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function ot(r) {
|
|
277
295
|
return c(this, arguments, function* ({ env: n, dmShortID: t, model: e, withMetadata: s }) {
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
const
|
|
296
|
+
var g, $, P, L, S;
|
|
297
|
+
h({ env: n, dmShortID: t, model: e });
|
|
298
|
+
const l = y(`api/schema/${t}/${e}`, n), i = yield p(l), d = (g = i == null ? void 0 : i.allOf) == null ? void 0 : g[1];
|
|
281
299
|
if (typeof d.properties != "object")
|
|
282
300
|
throw new Error(
|
|
283
|
-
`getSchema: ${
|
|
301
|
+
`getSchema: ${l} returned unexpected format: ${JSON.stringify(i)}`
|
|
284
302
|
);
|
|
285
|
-
const { properties: a } = d,
|
|
286
|
-
for (let E in
|
|
287
|
-
let m =
|
|
288
|
-
if (m.required = d.required.includes(E), ($ =
|
|
289
|
-
const k = m.title.split("<")[1].slice(0, -1),
|
|
290
|
-
m.type =
|
|
303
|
+
const { properties: a } = d, u = x(a);
|
|
304
|
+
for (let E in u) {
|
|
305
|
+
let m = u[E];
|
|
306
|
+
if (m.required = d.required.includes(E), ($ = u[E]) != null && $.oneOf && ((P = u[E]) == null || delete P.oneOf), (L = m.title) != null && L.includes("<") && ((S = m.title) != null && S.includes(">"))) {
|
|
307
|
+
const k = m.title.split("<")[1].slice(0, -1), I = m.title.split("<")[0];
|
|
308
|
+
m.type = I, k.includes(":") ? m.resource = k.split(":")[1] : m.resource = k;
|
|
291
309
|
} else
|
|
292
310
|
["asset", "entry", "assets", "entries"].includes(m.title) ? (m.type = m.title, m.resource = null) : m.type = m.title;
|
|
293
|
-
delete
|
|
311
|
+
delete u[E].title;
|
|
294
312
|
}
|
|
295
313
|
if (s) {
|
|
296
314
|
const E = a._modelTitle.title, m = a._modelTitleField.title;
|
|
297
|
-
return { properties:
|
|
315
|
+
return { properties: u, meta: { modelTitleField: m, modelTitle: E } };
|
|
298
316
|
}
|
|
299
|
-
return
|
|
317
|
+
return u;
|
|
300
318
|
});
|
|
301
319
|
}
|
|
302
320
|
function N(n) {
|
|
303
321
|
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), {});
|
|
304
322
|
}
|
|
305
|
-
const
|
|
323
|
+
const at = N;
|
|
306
324
|
function O(n) {
|
|
307
325
|
return n._links.collection.href.split("/").slice(-2)[0];
|
|
308
326
|
}
|
|
309
|
-
function
|
|
327
|
+
function F(n) {
|
|
310
328
|
const t = n._links.collection.href.split("api/")[0];
|
|
311
329
|
return Object.keys(b.datamanager).find(
|
|
312
330
|
(s) => b.datamanager[s] === t
|
|
313
331
|
);
|
|
314
332
|
}
|
|
315
|
-
const
|
|
316
|
-
const t = O(n), e =
|
|
333
|
+
const J = (n) => {
|
|
334
|
+
const t = O(n), e = F(n), s = n._modelTitle, r = n.id;
|
|
317
335
|
return { dmShortID: t, env: e, model: s, entryID: r };
|
|
318
|
-
},
|
|
336
|
+
}, ct = (n) => K(J(n)), ut = (n, t) => C(f(o({}, J(n)), {
|
|
319
337
|
value: t
|
|
320
338
|
}));
|
|
321
|
-
function
|
|
339
|
+
function lt(n, t) {
|
|
322
340
|
const e = O(t);
|
|
323
341
|
return t._embedded[`${e}:${t._modelTitle}/${n}/asset`];
|
|
324
342
|
}
|
|
325
|
-
function
|
|
343
|
+
function dt(l) {
|
|
326
344
|
return c(this, arguments, function* ({ env: n, dmShortID: t, assetGroup: e, assetID: s, token: r }) {
|
|
327
|
-
|
|
345
|
+
h({ env: n, dmShortID: t, assetGroup: e, assetID: s });
|
|
328
346
|
const i = w({ assetID: s }), d = y(`a/${t}/${e}?${i}`, n);
|
|
329
|
-
return (yield
|
|
347
|
+
return (yield p(d, { dmShortID: t, token: r }))._embedded["ec:dm-asset"];
|
|
330
348
|
});
|
|
331
349
|
}
|
|
332
|
-
function
|
|
350
|
+
function ht(n) {
|
|
333
351
|
return c(this, null, function* () {
|
|
334
|
-
let { env: t, dmShortID: e, assetGroup: s, token: r, options:
|
|
335
|
-
|
|
336
|
-
const i = w(
|
|
337
|
-
let $ =
|
|
338
|
-
return $ = Array.isArray($) ? $ : [$], { count: a, total:
|
|
352
|
+
let { env: t, dmShortID: e, assetGroup: s, token: r, options: l = {} } = n;
|
|
353
|
+
h({ env: t, dmShortID: e, assetGroup: s }), l = o({ size: 50, page: 1, _list: !0 }, l);
|
|
354
|
+
const i = w(l), d = y(`a/${e}/${s}?${i}`, t), { count: a, total: u, _embedded: g } = yield p(d, { dmShortID: e, token: r });
|
|
355
|
+
let $ = g ? g["ec:dm-asset"] : [];
|
|
356
|
+
return $ = Array.isArray($) ? $ : [$], { count: a, total: u, items: $ };
|
|
339
357
|
});
|
|
340
358
|
}
|
|
341
359
|
function gt(d) {
|
|
@@ -345,24 +363,24 @@ function gt(d) {
|
|
|
345
363
|
assetGroup: e,
|
|
346
364
|
token: s,
|
|
347
365
|
file: r,
|
|
348
|
-
name:
|
|
366
|
+
name: l,
|
|
349
367
|
options: i
|
|
350
368
|
}) {
|
|
351
|
-
|
|
352
|
-
const a = y(`a/${t}/${e}`, n),
|
|
353
|
-
return
|
|
354
|
-
|
|
355
|
-
}), (yield
|
|
369
|
+
h({ env: n, dmShortID: t, assetGroup: e, file: r });
|
|
370
|
+
const a = y(`a/${t}/${e}`, n), u = new FormData();
|
|
371
|
+
return u.append("file", r, l), i && Object.keys(i).forEach(($) => {
|
|
372
|
+
u.append($, i[$]);
|
|
373
|
+
}), (yield p(
|
|
356
374
|
a,
|
|
357
375
|
{ token: s },
|
|
358
376
|
{
|
|
359
377
|
method: "POST",
|
|
360
|
-
body:
|
|
378
|
+
body: u
|
|
361
379
|
}
|
|
362
380
|
))._embedded["ec:dm-asset"];
|
|
363
381
|
});
|
|
364
382
|
}
|
|
365
|
-
function
|
|
383
|
+
function ft(l) {
|
|
366
384
|
return c(this, arguments, function* ({
|
|
367
385
|
env: n,
|
|
368
386
|
dmShortID: t,
|
|
@@ -370,9 +388,9 @@ function ht(u) {
|
|
|
370
388
|
assetID: s,
|
|
371
389
|
token: r
|
|
372
390
|
}) {
|
|
373
|
-
|
|
391
|
+
h({ env: n, dmShortID: t, assetGroup: e, assetID: s });
|
|
374
392
|
const i = y(`a/${t}/${e}/${s}`, n);
|
|
375
|
-
yield
|
|
393
|
+
yield p(
|
|
376
394
|
i,
|
|
377
395
|
{ token: r, rawRes: !0 },
|
|
378
396
|
{
|
|
@@ -381,107 +399,109 @@ function ht(u) {
|
|
|
381
399
|
);
|
|
382
400
|
});
|
|
383
401
|
}
|
|
384
|
-
function
|
|
402
|
+
function pt(n) {
|
|
385
403
|
return c(this, null, function* () {
|
|
386
404
|
let { env: t, dmID: e, token: s } = n;
|
|
387
|
-
|
|
405
|
+
h({ env: t, dmID: e });
|
|
388
406
|
const r = y(`?dataManagerID=${e}`, t);
|
|
389
|
-
return
|
|
407
|
+
return p(r, { token: s });
|
|
390
408
|
});
|
|
391
409
|
}
|
|
392
|
-
function
|
|
410
|
+
function yt(n) {
|
|
393
411
|
return c(this, null, function* () {
|
|
394
412
|
let { env: t, options: e = {} } = n;
|
|
395
|
-
|
|
396
|
-
const s = w(e), r = y(`?${s}`, t), { count:
|
|
413
|
+
h({ env: t }), e = o({ size: 25, page: 1, _list: !0 }, e);
|
|
414
|
+
const s = w(e), r = y(`?${s}`, t), { count: l, total: i, _embedded: d } = yield p(r, n);
|
|
397
415
|
let a = d ? d["ec:datamanager"] : [];
|
|
398
|
-
return a = Array.isArray(a) ? a : [a], { count:
|
|
416
|
+
return a = Array.isArray(a) ? a : [a], { count: l, total: i, items: a };
|
|
399
417
|
});
|
|
400
418
|
}
|
|
401
|
-
function
|
|
419
|
+
function mt(n) {
|
|
402
420
|
return c(this, null, function* () {
|
|
403
421
|
let { env: t, dmID: e, options: s = {} } = n;
|
|
404
|
-
|
|
405
|
-
const r = w(s),
|
|
406
|
-
let
|
|
407
|
-
return
|
|
422
|
+
h({ env: t, dmID: e }), s = o({ size: 25, dataManagerID: e, page: 1, _list: !0 }, s);
|
|
423
|
+
const r = w(s), l = y(`model?${r}`, t), { count: i, total: d, _embedded: a } = yield p(l, n);
|
|
424
|
+
let u = a ? a["ec:model"] : [];
|
|
425
|
+
return u = Array.isArray(u) ? u : [u], { count: i, total: d, items: u };
|
|
408
426
|
});
|
|
409
427
|
}
|
|
410
|
-
function
|
|
428
|
+
function $t(n) {
|
|
411
429
|
return c(this, null, function* () {
|
|
412
430
|
let { env: t, resource: e, options: s = {}, subdomain: r = "datamanager" } = n;
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
return
|
|
431
|
+
h({ env: t, subdomain: r, resource: e }), s = o({ size: 25, page: 1, _list: !0 }, s);
|
|
432
|
+
const l = w(s), i = y(`${e}?${l}`, t, r), { count: d, total: a, _embedded: u } = yield p(i, n);
|
|
433
|
+
let g = u ? u[Object.keys(u)[0]] : [];
|
|
434
|
+
return g = Array.isArray(g) ? g : [g], { count: d, total: a, items: g };
|
|
417
435
|
});
|
|
418
436
|
}
|
|
419
|
-
function
|
|
437
|
+
function wt(e) {
|
|
420
438
|
return c(this, arguments, function* (n, t = {}) {
|
|
421
|
-
let { env: s, route: r, options:
|
|
422
|
-
|
|
423
|
-
const d = w(
|
|
424
|
-
return
|
|
439
|
+
let { env: s, route: r, options: l = {}, subdomain: i = "datamanager" } = n;
|
|
440
|
+
h({ env: s, subdomain: i, route: r }), l = o({}, l);
|
|
441
|
+
const d = w(l), a = y(`${r}?${d}`, s, i);
|
|
442
|
+
return p(a, n, t);
|
|
425
443
|
});
|
|
426
444
|
}
|
|
427
445
|
const A = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
428
446
|
__proto__: null,
|
|
429
|
-
assetList:
|
|
447
|
+
assetList: ht,
|
|
430
448
|
createAsset: gt,
|
|
431
449
|
createEntry: rt,
|
|
432
|
-
deleteAsset:
|
|
450
|
+
deleteAsset: ft,
|
|
433
451
|
deleteEntry: K,
|
|
434
|
-
deleteEntryObject:
|
|
435
|
-
dmList:
|
|
452
|
+
deleteEntryObject: ct,
|
|
453
|
+
dmList: yt,
|
|
436
454
|
editEntry: C,
|
|
437
|
-
editEntryObject:
|
|
438
|
-
entryList:
|
|
439
|
-
filterOptions:
|
|
440
|
-
getAsset:
|
|
441
|
-
getDatamanager:
|
|
442
|
-
getEcAuthKey:
|
|
455
|
+
editEntryObject: ut,
|
|
456
|
+
entryList: z,
|
|
457
|
+
filterOptions: at,
|
|
458
|
+
getAsset: dt,
|
|
459
|
+
getDatamanager: pt,
|
|
460
|
+
getEcAuthKey: Z,
|
|
443
461
|
getEntry: st,
|
|
444
|
-
getEntryAsset:
|
|
445
|
-
getEntryEnv:
|
|
462
|
+
getEntryAsset: lt,
|
|
463
|
+
getEntryEnv: F,
|
|
446
464
|
getEntryShortID: O,
|
|
447
|
-
getPublicAuthKey:
|
|
448
|
-
getSchema:
|
|
449
|
-
loginEc:
|
|
450
|
-
loginPublic:
|
|
451
|
-
logoutEc:
|
|
452
|
-
logoutPublic:
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
465
|
+
getPublicAuthKey: Y,
|
|
466
|
+
getSchema: ot,
|
|
467
|
+
loginEc: Q,
|
|
468
|
+
loginPublic: H,
|
|
469
|
+
logoutEc: X,
|
|
470
|
+
logoutPublic: W,
|
|
471
|
+
mapEntries: it,
|
|
472
|
+
modelList: mt,
|
|
473
|
+
publicApi: nt,
|
|
474
|
+
raw: wt,
|
|
475
|
+
resourceList: $t,
|
|
457
476
|
sdkOptions: N
|
|
458
477
|
}, Symbol.toStringTag, { value: "Module" })), {
|
|
459
|
-
entryList:
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
478
|
+
entryList: Et,
|
|
479
|
+
mapEntries: At,
|
|
480
|
+
getEntry: bt,
|
|
481
|
+
getAsset: kt,
|
|
482
|
+
assetList: Tt,
|
|
483
|
+
createAsset: _t,
|
|
484
|
+
deleteAsset: Ot,
|
|
485
|
+
createEntry: jt,
|
|
466
486
|
editEntry: q,
|
|
467
|
-
deleteEntry:
|
|
468
|
-
getSchema:
|
|
469
|
-
loginPublic:
|
|
470
|
-
loginEc:
|
|
471
|
-
logoutEc:
|
|
472
|
-
logoutPublic:
|
|
487
|
+
deleteEntry: Pt,
|
|
488
|
+
getSchema: Lt,
|
|
489
|
+
loginPublic: St,
|
|
490
|
+
loginEc: Bt,
|
|
491
|
+
logoutEc: Dt,
|
|
492
|
+
logoutPublic: qt,
|
|
473
493
|
getEcAuthKey: T,
|
|
474
494
|
getPublicAuthKey: _,
|
|
475
|
-
dmList:
|
|
476
|
-
modelList:
|
|
477
|
-
publicApi:
|
|
478
|
-
getDatamanager:
|
|
479
|
-
resourceList:
|
|
480
|
-
raw:
|
|
495
|
+
dmList: vt,
|
|
496
|
+
modelList: xt,
|
|
497
|
+
publicApi: zt,
|
|
498
|
+
getDatamanager: Ct,
|
|
499
|
+
resourceList: Kt,
|
|
500
|
+
raw: Nt
|
|
481
501
|
} = A;
|
|
482
|
-
function
|
|
502
|
+
function It(n) {
|
|
483
503
|
const { action: t } = n;
|
|
484
|
-
if (
|
|
504
|
+
if (h({ action: t }), !A[t])
|
|
485
505
|
throw new Error(
|
|
486
506
|
`"${t}" does not exist! try one of ${Object.keys(A).join(
|
|
487
507
|
", "
|
|
@@ -512,7 +532,7 @@ class j {
|
|
|
512
532
|
entries() {
|
|
513
533
|
return c(this, arguments, function* (t = {}) {
|
|
514
534
|
const e = yield this.getBestToken();
|
|
515
|
-
return
|
|
535
|
+
return Et(f(o({}, this.config), { options: t, token: e }));
|
|
516
536
|
});
|
|
517
537
|
}
|
|
518
538
|
entryList(t) {
|
|
@@ -520,6 +540,23 @@ class j {
|
|
|
520
540
|
return this.entries(t);
|
|
521
541
|
});
|
|
522
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Maps over entry list.
|
|
545
|
+
*
|
|
546
|
+
* @param {object=} options options for entry list request.
|
|
547
|
+
* @returns {Promise<EntryList>}
|
|
548
|
+
* @example
|
|
549
|
+
* // public model
|
|
550
|
+
* const muffins = sdk("stage").dm("83cc6374").model("muffin")
|
|
551
|
+
* const res = await muffin.mapEntries((entry) => muffin.editEntry(entry.id, { name: entry.name + "!" }));
|
|
552
|
+
* console.log("res", res);
|
|
553
|
+
*/
|
|
554
|
+
mapEntries(s) {
|
|
555
|
+
return c(this, arguments, function* (t, e = {}) {
|
|
556
|
+
const r = yield this.getBestToken();
|
|
557
|
+
return At(f(o({}, this.config), { options: e, token: r }), t);
|
|
558
|
+
});
|
|
559
|
+
}
|
|
523
560
|
/**
|
|
524
561
|
* Loads a single entry. Expects `dmShortID` / `model` to be set.
|
|
525
562
|
* If the model is not public, you also need to provide a `token`.
|
|
@@ -532,7 +569,7 @@ class j {
|
|
|
532
569
|
getEntry(t) {
|
|
533
570
|
return c(this, null, function* () {
|
|
534
571
|
const e = yield this.getBestToken();
|
|
535
|
-
return
|
|
572
|
+
return bt(f(o({}, this.config), { entryID: t, token: e }));
|
|
536
573
|
});
|
|
537
574
|
}
|
|
538
575
|
/**
|
|
@@ -552,7 +589,7 @@ class j {
|
|
|
552
589
|
editEntrySafe(t, e) {
|
|
553
590
|
return c(this, null, function* () {
|
|
554
591
|
const s = yield this.getBestToken();
|
|
555
|
-
return q(
|
|
592
|
+
return q(f(o({}, this.config), { entryID: t, token: s, value: e, safePut: !0 }));
|
|
556
593
|
});
|
|
557
594
|
}
|
|
558
595
|
/**
|
|
@@ -565,7 +602,7 @@ class j {
|
|
|
565
602
|
*/
|
|
566
603
|
getSchema() {
|
|
567
604
|
return c(this, null, function* () {
|
|
568
|
-
return
|
|
605
|
+
return Lt(this.config);
|
|
569
606
|
});
|
|
570
607
|
}
|
|
571
608
|
/**
|
|
@@ -584,7 +621,7 @@ class j {
|
|
|
584
621
|
assets(t) {
|
|
585
622
|
return c(this, null, function* () {
|
|
586
623
|
const e = yield this.getBestToken();
|
|
587
|
-
return
|
|
624
|
+
return Tt(f(o({}, this.config), { options: t, token: e }));
|
|
588
625
|
});
|
|
589
626
|
}
|
|
590
627
|
assetList(t) {
|
|
@@ -616,7 +653,7 @@ class j {
|
|
|
616
653
|
createAsset() {
|
|
617
654
|
return c(this, arguments, function* ({ file: t, name: e, options: s } = {}) {
|
|
618
655
|
const r = yield this.getBestToken();
|
|
619
|
-
return
|
|
656
|
+
return _t(f(o({}, this.config), { file: t, name: e, options: s, token: r }));
|
|
620
657
|
});
|
|
621
658
|
}
|
|
622
659
|
/**
|
|
@@ -631,7 +668,7 @@ class j {
|
|
|
631
668
|
deleteAsset(t) {
|
|
632
669
|
return c(this, null, function* () {
|
|
633
670
|
const e = yield this.getBestToken();
|
|
634
|
-
return
|
|
671
|
+
return Ot(f(o({}, this.config), { token: e, assetID: t }));
|
|
635
672
|
});
|
|
636
673
|
}
|
|
637
674
|
/**
|
|
@@ -646,7 +683,7 @@ class j {
|
|
|
646
683
|
getAsset(t) {
|
|
647
684
|
return c(this, null, function* () {
|
|
648
685
|
const e = yield this.getBestToken();
|
|
649
|
-
return
|
|
686
|
+
return kt(f(o({}, this.config), { assetID: t, token: e }));
|
|
650
687
|
});
|
|
651
688
|
}
|
|
652
689
|
/**
|
|
@@ -661,7 +698,7 @@ class j {
|
|
|
661
698
|
createEntry(t) {
|
|
662
699
|
return c(this, null, function* () {
|
|
663
700
|
const e = yield this.getBestToken();
|
|
664
|
-
return
|
|
701
|
+
return jt(f(o({}, this.config), { token: e, value: t }));
|
|
665
702
|
});
|
|
666
703
|
}
|
|
667
704
|
/**
|
|
@@ -677,7 +714,7 @@ class j {
|
|
|
677
714
|
editEntry(t, e) {
|
|
678
715
|
return c(this, null, function* () {
|
|
679
716
|
const s = yield this.getBestToken();
|
|
680
|
-
return q(
|
|
717
|
+
return q(f(o({}, this.config), { entryID: t, token: s, value: e }));
|
|
681
718
|
});
|
|
682
719
|
}
|
|
683
720
|
/**
|
|
@@ -692,7 +729,7 @@ class j {
|
|
|
692
729
|
deleteEntry(t) {
|
|
693
730
|
return c(this, null, function* () {
|
|
694
731
|
const e = yield this.getBestToken();
|
|
695
|
-
return
|
|
732
|
+
return Pt(f(o({}, this.config), { token: e, entryID: t }));
|
|
696
733
|
});
|
|
697
734
|
}
|
|
698
735
|
/**
|
|
@@ -707,7 +744,7 @@ class j {
|
|
|
707
744
|
resourceList(t) {
|
|
708
745
|
return c(this, null, function* () {
|
|
709
746
|
const e = yield this.getBestToken();
|
|
710
|
-
return
|
|
747
|
+
return Kt(f(o({}, this.config), { options: t, token: e }));
|
|
711
748
|
});
|
|
712
749
|
}
|
|
713
750
|
/**
|
|
@@ -724,7 +761,7 @@ class j {
|
|
|
724
761
|
raw(t, e) {
|
|
725
762
|
return c(this, null, function* () {
|
|
726
763
|
const s = yield this.getBestToken();
|
|
727
|
-
return
|
|
764
|
+
return Nt(f(o({}, this.config), { options: t, token: s }), e);
|
|
728
765
|
});
|
|
729
766
|
}
|
|
730
767
|
storageAdapter(t) {
|
|
@@ -753,24 +790,24 @@ class j {
|
|
|
753
790
|
return e(t);
|
|
754
791
|
}
|
|
755
792
|
loginEc(t) {
|
|
756
|
-
return
|
|
793
|
+
return Bt(o(o({}, this.config), t)).then(
|
|
757
794
|
this.setAuth(T(this.config))
|
|
758
795
|
);
|
|
759
796
|
}
|
|
760
797
|
loginPublic(t) {
|
|
761
|
-
return
|
|
798
|
+
return St(o(o({}, this.config), t)).then(
|
|
762
799
|
this.setAuth(_(this.config))
|
|
763
800
|
);
|
|
764
801
|
}
|
|
765
802
|
logoutPublic() {
|
|
766
803
|
const t = this.getPublicToken();
|
|
767
|
-
return
|
|
804
|
+
return qt(f(o({}, this.config), { token: t })).then(
|
|
768
805
|
this.unsetAuth(_(this.config))
|
|
769
806
|
);
|
|
770
807
|
}
|
|
771
808
|
logoutEc() {
|
|
772
809
|
const t = this.getEcToken();
|
|
773
|
-
return
|
|
810
|
+
return Dt(f(o({}, this.config), { token: t })).then(
|
|
774
811
|
this.unsetAuth(T(this.config))
|
|
775
812
|
);
|
|
776
813
|
}
|
|
@@ -881,7 +918,7 @@ class j {
|
|
|
881
918
|
* @returns any
|
|
882
919
|
*/
|
|
883
920
|
publicApi() {
|
|
884
|
-
return
|
|
921
|
+
return zt(this.config);
|
|
885
922
|
}
|
|
886
923
|
/**
|
|
887
924
|
* Loads a DatamanagerResource by its long id. Requires token.
|
|
@@ -890,7 +927,7 @@ class j {
|
|
|
890
927
|
getDatamanager(t) {
|
|
891
928
|
return c(this, null, function* () {
|
|
892
929
|
const e = yield this.getBestToken();
|
|
893
|
-
return
|
|
930
|
+
return Ct(f(o({}, this.config), { dmID: t, token: e }));
|
|
894
931
|
});
|
|
895
932
|
}
|
|
896
933
|
/**
|
|
@@ -904,7 +941,7 @@ class j {
|
|
|
904
941
|
dmList() {
|
|
905
942
|
return c(this, arguments, function* (t = {}) {
|
|
906
943
|
const e = yield this.getBestToken();
|
|
907
|
-
return
|
|
944
|
+
return vt(f(o({}, this.config), { options: t, token: e }));
|
|
908
945
|
});
|
|
909
946
|
}
|
|
910
947
|
/**
|
|
@@ -918,48 +955,49 @@ class j {
|
|
|
918
955
|
modelList() {
|
|
919
956
|
return c(this, arguments, function* (t = {}) {
|
|
920
957
|
const e = yield this.getBestToken();
|
|
921
|
-
return
|
|
958
|
+
return xt(f(o({}, this.config), { options: t, token: e }));
|
|
922
959
|
});
|
|
923
960
|
}
|
|
924
961
|
}
|
|
925
|
-
const
|
|
962
|
+
const Ft = (n) => new j({ env: n }), Rt = Ft;
|
|
926
963
|
export {
|
|
927
964
|
j as Sdk,
|
|
928
|
-
|
|
965
|
+
It as act,
|
|
929
966
|
y as apiURL,
|
|
930
967
|
b as apis,
|
|
931
|
-
|
|
968
|
+
ht as assetList,
|
|
932
969
|
gt as createAsset,
|
|
933
970
|
rt as createEntry,
|
|
934
|
-
|
|
971
|
+
ft as deleteAsset,
|
|
935
972
|
K as deleteEntry,
|
|
936
|
-
|
|
937
|
-
|
|
973
|
+
ct as deleteEntryObject,
|
|
974
|
+
yt as dmList,
|
|
938
975
|
C as editEntry,
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
976
|
+
ut as editEntryObject,
|
|
977
|
+
z as entryList,
|
|
978
|
+
h as expect,
|
|
979
|
+
Rt as fdk,
|
|
980
|
+
p as fetcher,
|
|
981
|
+
at as filterOptions,
|
|
982
|
+
dt as getAsset,
|
|
983
|
+
pt as getDatamanager,
|
|
984
|
+
Z as getEcAuthKey,
|
|
948
985
|
st as getEntry,
|
|
949
|
-
|
|
950
|
-
|
|
986
|
+
lt as getEntryAsset,
|
|
987
|
+
F as getEntryEnv,
|
|
951
988
|
O as getEntryShortID,
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
989
|
+
Y as getPublicAuthKey,
|
|
990
|
+
ot as getSchema,
|
|
991
|
+
Q as loginEc,
|
|
992
|
+
H as loginPublic,
|
|
993
|
+
X as logoutEc,
|
|
994
|
+
W as logoutPublic,
|
|
995
|
+
it as mapEntries,
|
|
996
|
+
mt as modelList,
|
|
997
|
+
nt as publicApi,
|
|
960
998
|
w as query,
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
999
|
+
wt as raw,
|
|
1000
|
+
$t as resourceList,
|
|
1001
|
+
Ft as sdk,
|
|
964
1002
|
N as sdkOptions
|
|
965
1003
|
};
|
package/dist/lib/api.d.mts
CHANGED
|
@@ -22,6 +22,18 @@ export class Sdk {
|
|
|
22
22
|
*/
|
|
23
23
|
entries(options?: object | undefined): Promise<EntryList>;
|
|
24
24
|
entryList(options: any): Promise<EntryList>;
|
|
25
|
+
/**
|
|
26
|
+
* Maps over entry list.
|
|
27
|
+
*
|
|
28
|
+
* @param {object=} options options for entry list request.
|
|
29
|
+
* @returns {Promise<EntryList>}
|
|
30
|
+
* @example
|
|
31
|
+
* // public model
|
|
32
|
+
* const muffins = sdk("stage").dm("83cc6374").model("muffin")
|
|
33
|
+
* const res = await muffin.mapEntries((entry) => muffin.editEntry(entry.id, { name: entry.name + "!" }));
|
|
34
|
+
* console.log("res", res);
|
|
35
|
+
*/
|
|
36
|
+
mapEntries(fn: any, options?: object | undefined): Promise<EntryList>;
|
|
25
37
|
/**
|
|
26
38
|
* Loads a single entry. Expects `dmShortID` / `model` to be set.
|
|
27
39
|
* If the model is not public, you also need to provide a `token`.
|
package/dist/lib/api.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.mts","sourceRoot":"","sources":["../../src/lib/api.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.mts","sourceRoot":"","sources":["../../src/lib/api.mjs"],"names":[],"mappings":"AAiCA,sCAWC;;AAED;;GAEG;AACH;IACE,yBAEC;IADC,YAAoB;IAGtB,mBAGC;IAED;;;;;;;;;;;;OAYG;IACH,kBATW,MAAM,eACJ,QAAQ,SAAS,CAAC,CAW9B;IACD,4CAEC;IAED;;;;;;;;;;OAUG;IACH,8BARW,MAAM,eACJ,QAAQ,SAAS,CAAC,CAU9B;IACD;;;;;;;;OAQG;IACH,kBALW,MAAM,GACJ,QAAQ,aAAa,CAAC,CAOlC;IACD;;;;;;;;;;;;;OAaG;IACH,uBATW,MAAM,SACN,MAAM,GACJ,QAAQ,aAAa,CAAC,CAUlC;IACD;;;;;;;OAOG;IACH,aAJa,QAAQ,WAAW,CAAC,CAMhC;IACD;;;;;;;;;;;;OAYG;IACH,iBATW,MAAM,eACJ,QAAQ,SAAS,CAAC,CAW9B;IACD,4CAEC;IACD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sCAjBW;QAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAClD,QAAQ,aAAa,CAAC,CAmBlC;IACD;;;;;;;;OAQG;IACH,qBALW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAOzB;IACD;;;;;;;;OAQG;IACH,kBALW,MAAM,GACJ,QAAQ,aAAa,CAAC,CAOlC;IAED;;;;;;;;OAQG;IACH,mBALW,MAAM,GACJ,QAAQ,aAAa,CAAC,CAOlC;IACD;;;;;;;;;OASG;IACH,mBANW,MAAM,SACN,MAAM,GACJ,QAAQ,aAAa,CAAC,CAOlC;IACD;;;;;;;;OAQG;IACH,qBALW,MAAM,GACJ,QAAQ,IAAI,CAAC,CAOzB;IAED;;;;;;;;OAQG;IACH,uBALW,MAAM,eACJ,QAAQ,YAAY,CAAC,CAOjC;IAED;;;;;;;;;;OAUG;IACH,cANW,MAAM,6BACN,MAAM,eACJ,QAAQ,GAAG,CAAC,CAOxB;IAED,yCAGC;IAED,sCASC;IACD,wCASC;IACD,uBAMC;IAED,mCAIC;IACD,uCAKC;IAED,6BAKC;IAED,yBAKC;IAED,sBAEC;IACD,kBAEC;IACD,0BAEC;IACD,sBAEC;IACD,uBAEC;IACD,oBAMC;IACD;;;;OAIG;IACH,aAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,aAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,qBAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,WAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,cAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,uBAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,uBAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,qBAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IACD;;;;OAIG;IACH,aAHW,MAAM,OAKhB;IAED;;;OAGG;IACH,0BAEC;IAED;;;OAGG;IACH,wCAGC;IAED;;;;;;;OAOG;IACH,iBALW,MAAM,eACJ,QAAQ,eAAe,CAAC,CAOpC;IACD;;;;;;;OAOG;IACH,oBALW,MAAM,eACJ,QAAQ,SAAS,CAAC,CAO9B;CACF;AAEM,mCAAqC;AAArC,mCAAqC;;SAK9B,MAAM;UACN,MAAM;;;;aAMN,MAAM;aACN,IAAI;WACJ,MAAM,GAAG,CAAC;UACV,MAAM,MAAM,GAAG,GAAG,CAAC;WACnB,MAAM;UACN,MAAM;cACN,MAAM;gBACN,MAAM;UACN,SAAS;;;;;;QAKT,MAAM;;;;cACN,IAAI;;;;cACJ,MAAM;;;;eACN,GAAG;;;;YACH,GAAG;;;;iBACH,MAAM;;;;sBACN,MAAM;;;;eACN,IAAI;;;;aACJ,IAAI;;;;cACJ,IAAI;;;;UACJ,GAAG;;;;;;aAOH,GAAG;;;;iBACH,MAAM;;;;cACN,OAAO;;;;cACP,OAAO;;;;UACP,MAAM;;;;cACN,MAAM;;;QAIC,MAAM,GAAE,gBAAgB;;;WAK/B,MAAM;WACN,MAAM;WACN,aAAa,EAAE;;;aAKf,MAAM;mBACN,MAAM;mBACN,MAAM;iBACN,MAAM;YACN,GAAG;cACH,MAAM;aACN,MAAM,EAAE;YACR,MAAM,EAAE;uBACR,MAAM,EAAE;aACR,MAAM;WACN,MAAM;;;;YACN,GAAG;;;WAKH,MAAM;WACN,MAAM;WACN,mBAAmB,EAAE;;;WAKrB,MAAM;WACN,MAAM;WACN,aAAa,EAAE;;;WAKf,MAAM;WACN,MAAM;WACN,GAAG,EAAE;;;;;;aAML,GAAG;iBACH,MAAM;iBACN,OAAO;aACP,OAAO;cACP,OAAO;cACP,OAAO;YACP,OAAO;WACP,MAAM;UACN,MAAM;gBACN,MAAM,GAAG,IAAI;;;YAKb,GAAG;aACH,MAAM;iBACN,MAAM;YACN,gBAAgB,EAAE;gBAClB,OAAO;cACP,MAAM;WACN,GAAG,EAAE;eACL,GAAG,EAAE;aACL,MAAM,EAAE;aACR,MAAM;cACN,MAAM;cACN,GAAG,EAAE;UACL,GAAG;WACH,MAAM;gBACN,MAAM;YACN,GAAG;;;WAMH,MAAM;WACN,MAAM;WACN,aAAa,EAAE"}
|
package/dist/lib/entries.d.mts
CHANGED
|
@@ -34,6 +34,7 @@ export function deleteEntry({ env, dmShortID, model, entryID, token }: {
|
|
|
34
34
|
entryID: any;
|
|
35
35
|
token: any;
|
|
36
36
|
}): Promise<any>;
|
|
37
|
+
export function mapEntries(config: any, fn: any): Promise<any[]>;
|
|
37
38
|
export function getSchema({ env, dmShortID, model, withMetadata }: {
|
|
38
39
|
env: any;
|
|
39
40
|
dmShortID: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.d.mts","sourceRoot":"","sources":["../../src/lib/entries.mjs"],"names":[],"mappings":"AAiCA,qDAMC;AAED;;;;GAYC;AAED;;;;;;iBAKC;AAED;;;;;;iBAeC;AAED;;;;;;;;iBAkCC;AAED;;;;;;iBAcC;AAED;;;;;gBA4CC;AAED;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,oCAJW,gBAAgB,GACd,OAAO,MAAM,EAAE,MAAM,CAAC,CAoBlC;AAED;;;;;;GAMG;AACH,uDAHa,MAAM,CAKlB;AACD;;;;;;GAMG;AACH,mDAHa,MAAM,CASlB;AAkBD;;;;;;GAMG;AACH,+EAGC;AAjGD;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,uCAJW,gBAAgB,GACd,OAAO,MAAM,EAAE,MAAM,CAAC,CAoBlC;AAmCM,4DAAuE;AAEvE,sEAIH;;UAnFU,MAAM,GAAG,MAAM,EAAE;YACjB,MAAM;aACN,OAAO;UACP,OAAO;SACP,OAAO;UACP,MAAM;QACN,MAAM;;;UAKN,SAAS;YACT,MAAM;UACN,MAAM;UACN,OAAO,MAAM,EAAE,SAAS,CAAC,GAAG,MAAM,GAAG,OAAO"}
|
|
1
|
+
{"version":3,"file":"entries.d.mts","sourceRoot":"","sources":["../../src/lib/entries.mjs"],"names":[],"mappings":"AAiCA,qDAMC;AAED;;;;GAYC;AAED;;;;;;iBAKC;AAED;;;;;;iBAeC;AAED;;;;;;;;iBAkCC;AAED;;;;;;iBAcC;AAED,iEAkBC;AAMD;;;;;gBA4CC;AAED;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,oCAJW,gBAAgB,GACd,OAAO,MAAM,EAAE,MAAM,CAAC,CAoBlC;AAED;;;;;;GAMG;AACH,uDAHa,MAAM,CAKlB;AACD;;;;;;GAMG;AACH,mDAHa,MAAM,CASlB;AAkBD;;;;;;GAMG;AACH,+EAGC;AAjGD;;;;;;;;;;GAUG;AACH;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,uCAJW,gBAAgB,GACd,OAAO,MAAM,EAAE,MAAM,CAAC,CAoBlC;AAmCM,4DAAuE;AAEvE,sEAIH;;UAnFU,MAAM,GAAG,MAAM,EAAE;YACjB,MAAM;aACN,OAAO;UACP,OAAO;SACP,OAAO;UACP,MAAM;QACN,MAAM;;;UAKN,SAAS;YACT,MAAM;UACN,MAAM;UACN,OAAO,MAAM,EAAE,SAAS,CAAC,GAAG,MAAM,GAAG,OAAO"}
|
package/dist/lib/util.d.mts
CHANGED
|
@@ -2,22 +2,22 @@ export function fetcher(url: any, config?: {}, options?: {}): Promise<any>;
|
|
|
2
2
|
export function apiURL(route: any, env?: string, subdomain?: string): any;
|
|
3
3
|
export function query(params: any, sort?: boolean): any;
|
|
4
4
|
export function expect(obj: any): void;
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
5
|
+
export const apis: {
|
|
6
|
+
datamanager: {
|
|
7
|
+
live: string;
|
|
8
|
+
stage: string;
|
|
9
|
+
};
|
|
10
|
+
accounts: {
|
|
11
|
+
live: string;
|
|
12
|
+
stage: string;
|
|
13
|
+
};
|
|
14
|
+
appserver: {
|
|
15
|
+
live: string;
|
|
16
|
+
stage: string;
|
|
17
|
+
};
|
|
18
|
+
"dm-history": {
|
|
19
|
+
live: string;
|
|
20
|
+
stage: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
23
|
//# sourceMappingURL=util.d.mts.map
|
package/dist/lib/util.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.mts","sourceRoot":"","sources":["../../src/lib/util.mjs"],"names":[],"mappings":"AAAA,2EAsBC;
|
|
1
|
+
{"version":3,"file":"util.d.mts","sourceRoot":"","sources":["../../src/lib/util.mjs"],"names":[],"mappings":"AAAA,2EAsBC;AAqBD,0EAgBC;AAED,wDAKC;AAED,uCAMC;AAlDD;;;;;;;;;;;;;;;;;EAiBE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ec.fdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "ec frontend sdk",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"directories": {
|
|
@@ -19,10 +19,7 @@
|
|
|
19
19
|
"url": "https://github.com/entrecode/ec.fdk/issues"
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/entrecode/ec.fdk#readme",
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"@nanostores/persistent": "^0.9.1",
|
|
24
|
-
"nanostores": "^0.9.3"
|
|
25
|
-
},
|
|
22
|
+
"dependencies": {},
|
|
26
23
|
"devDependencies": {
|
|
27
24
|
"jsdoc-json": "^2.0.2",
|
|
28
25
|
"jsdoc": "^4.0.2",
|
package/dist/storage.d.mts
DELETED
package/dist/storage.d.mts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.mts","sourceRoot":"","sources":["../src/storage.mjs"],"names":[],"mappings":""}
|