@lasuillard/raindrop-client 0.6.0 → 0.6.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.js +1 -1
- package/dist/index.es.js +65 -61
- package/package.json +7 -7
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("axios"),p="https://api.raindrop.io".replace(/\/+$/,"");class S{constructor(t,e=p,s=h){this.basePath=e,this.axios=s,t&&(this.configuration=t,this.basePath=t.basePath??e)}configuration}class ce extends Error{constructor(t,e){super(e),this.field=t,this.name="RequiredError"}}const u={},m="https://example.com",P=function(n,t,e){if(e==null)throw new ce(t,`Required parameter ${t} was null or undefined when calling ${n}.`)},C=async function(n,t){if(t&&t.accessToken){const e=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;n.Authorization="Bearer "+e}};function E(n,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>E(n,s,e)):Object.keys(t).forEach(s=>E(n,t[s],`${e}${e!==""?".":""}${s}`)):n.has(e)?n.append(e,t):n.set(e,t))}const V=function(n,...t){const e=new URLSearchParams(n.search);E(e,t),n.search=e.toString()},y=function(n,t,e){const s=typeof n!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(n!==void 0?U(n):{}):n||""};function U(n){if(typeof Set>"u"||typeof Map>"u"||typeof n!="object"||!n)return n;if(n instanceof Set)return Array.from(n).map(t=>U(t));if(n instanceof Map){const t=[];return n.forEach((e,s)=>{t.push([s,U(e)])}),H(t)}return Array.isArray(n)?n.map(t=>U(t)):H(ie(n).map(([t,e])=>[t,U(e)]))}function ie(n){return Object.keys(n).map(t=>[t,n[t]])}function H(n){return[...n].reduce((t,[e,s])=>(t[e]=s,t),{})}const O=function(n){return n.pathname+n.search+n.hash},v=function(n,t,e,s){return(a=t,r=e)=>{const o={...n.options,url:(a.defaults.baseURL?"":s?.basePath??r)+n.url};return a.request(o)}},de={Collections:"collections"},Q={AuthorizationCode:"authorization_code"},N={RefreshToken:"refresh_token"},he={Member:"member",Viewer:"viewer"},pe={Bearer:"Bearer"},$=function(n){return{authorize:async(t,e,s={})=>{P("authorize","redirectUri",t),P("authorize","clientId",e);const a="/v1/oauth/authorize",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"GET",...o,...s},c={},i={};t!==void 0&&(i.redirect_uri=t),e!==void 0&&(i.client_id=e),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},getOrRefreshToken:async(t,e={})=>{const s="/v1/oauth/access_token",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}}}},B=function(n){const t=$(n);return{async authorize(e,s,a){const r=await t.authorize(e,s,a),o=n?.serverIndex??0,l=u["AuthenticationApi.authorize"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async getOrRefreshToken(e,s){const a=await t.getOrRefreshToken(e,s),r=n?.serverIndex??0,o=u["AuthenticationApi.getOrRefreshToken"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},ue=function(n,t,e){const s=B(n);return{authorize(a,r,o){return s.authorize(a,r,o).then(l=>l(e,t))},getOrRefreshToken(a,r){return s.getOrRefreshToken(a,r).then(o=>o(e,t))}}};let _=class extends S{authorize(t,e,s){return B(this.configuration).authorize(t,e,s).then(a=>a(this.axios,this.basePath))}getOrRefreshToken(t,e){return B(this.configuration).getOrRefreshToken(t,e).then(s=>s(this.axios,this.basePath))}};const M=function(n){return{acceptInvitation:async(t,e={})=>{P("acceptInvitation","id",t);const s="/rest/v1/collection/{id}/join".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},changeCollaboratorAccessLevel:async(t,e,s,a={})=>{P("changeCollaboratorAccessLevel","userId",t),P("changeCollaboratorAccessLevel","id",e);const r="/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"PUT",...l,...a},i={},d={};await C(i,n),i["Content-Type"]="application/json",V(o,d);let A=l&&l.headers?l.headers:{};return c.headers={...i,...A,...a.headers},c.data=y(s,c,n),{url:O(o),options:c}},createCollection:async(t,e={})=>{const s="/rest/v1/collection",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},deleteCollaborator:async(t,e,s={})=>{P("deleteCollaborator","userId",t),P("deleteCollaborator","id",e);const a="/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"DELETE",...o,...s},c={},i={};await C(c,n),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},emptyTrash:async(t={})=>{const e="/rest/v1/collection/-99",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"DELETE",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getChildCollections:async(t={})=>{const e="/rest/v1/collections/childrens",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getCollaborators:async(t,e={})=>{P("getCollaborators","id",t);const s="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getCollection:async(t,e={})=>{P("getCollection","id",t);const s="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getFeaturedCovers:async(t={})=>{const e="/rest/v1/collections/covers",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getRootCollections:async(t={})=>{const e="/rest/v1/collections",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getSystemCollectionStats:async(t={})=>{const e="/rest/v1/user/stats",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},mergeCollections:async(t,e={})=>{const s="/rest/v1/collections/merge",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},removeAllEmptyCollections:async(t={})=>{const e="/rest/v1/collections/clean",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"PUT",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},removeCollection:async(t,e={})=>{P("removeCollection","id",t);const s="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeCollections:async(t,e={})=>{const s="/rest/v1/collections",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},reorderAllCollections:async(t,e={})=>{const s="/rest/v1/collections",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},searchCovers:async(t,e={})=>{P("searchCovers","text",t);const s="/rest/v1/collections/covers/{text}".replace("{text}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},shareCollection:async(t,e,s={})=>{P("shareCollection","id",t);const a="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"POST",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},unshareOrLeaveCollection:async(t,e={})=>{P("unshareOrLeaveCollection","id",t);const s="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},updateCollection:async(t,e,s={})=>{P("updateCollection","id",t);const a="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},uploadCollectionCover:async(t,e,s={})=>{P("uploadCollectionCover","id",t);const a="/rest/v1/collection/{id}/cover".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),e!==void 0&&d.append("cover",e),c["Content-Type"]="multipart/form-data",V(r,i);let A=o&&o.headers?o.headers:{};return l.headers={...c,...A,...s.headers},l.data=d,{url:O(r),options:l}}}},R=function(n){const t=M(n);return{async acceptInvitation(e,s){const a=await t.acceptInvitation(e,s),r=n?.serverIndex??0,o=u["CollectionApi.acceptInvitation"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async changeCollaboratorAccessLevel(e,s,a,r){const o=await t.changeCollaboratorAccessLevel(e,s,a,r),l=n?.serverIndex??0,c=u["CollectionApi.changeCollaboratorAccessLevel"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async createCollection(e,s){const a=await t.createCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.createCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async deleteCollaborator(e,s,a){const r=await t.deleteCollaborator(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.deleteCollaborator"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async emptyTrash(e){const s=await t.emptyTrash(e),a=n?.serverIndex??0,r=u["CollectionApi.emptyTrash"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getChildCollections(e){const s=await t.getChildCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.getChildCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getCollaborators(e,s){const a=await t.getCollaborators(e,s),r=n?.serverIndex??0,o=u["CollectionApi.getCollaborators"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getCollection(e,s){const a=await t.getCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.getCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getFeaturedCovers(e){const s=await t.getFeaturedCovers(e),a=n?.serverIndex??0,r=u["CollectionApi.getFeaturedCovers"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getRootCollections(e){const s=await t.getRootCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.getRootCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getSystemCollectionStats(e){const s=await t.getSystemCollectionStats(e),a=n?.serverIndex??0,r=u["CollectionApi.getSystemCollectionStats"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async mergeCollections(e,s){const a=await t.mergeCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.mergeCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeAllEmptyCollections(e){const s=await t.removeAllEmptyCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.removeAllEmptyCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async removeCollection(e,s){const a=await t.removeCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.removeCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeCollections(e,s){const a=await t.removeCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.removeCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async reorderAllCollections(e,s){const a=await t.reorderAllCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.reorderAllCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async searchCovers(e,s){const a=await t.searchCovers(e,s),r=n?.serverIndex??0,o=u["CollectionApi.searchCovers"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async shareCollection(e,s,a){const r=await t.shareCollection(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.shareCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async unshareOrLeaveCollection(e,s){const a=await t.unshareOrLeaveCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.unshareOrLeaveCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateCollection(e,s,a){const r=await t.updateCollection(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.updateCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadCollectionCover(e,s,a){const r=await t.uploadCollectionCover(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.uploadCollectionCover"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},me=function(n,t,e){const s=R(n);return{acceptInvitation(a,r){return s.acceptInvitation(a,r).then(o=>o(e,t))},changeCollaboratorAccessLevel(a,r,o,l){return s.changeCollaboratorAccessLevel(a,r,o,l).then(c=>c(e,t))},createCollection(a,r){return s.createCollection(a,r).then(o=>o(e,t))},deleteCollaborator(a,r,o){return s.deleteCollaborator(a,r,o).then(l=>l(e,t))},emptyTrash(a){return s.emptyTrash(a).then(r=>r(e,t))},getChildCollections(a){return s.getChildCollections(a).then(r=>r(e,t))},getCollaborators(a,r){return s.getCollaborators(a,r).then(o=>o(e,t))},getCollection(a,r){return s.getCollection(a,r).then(o=>o(e,t))},getFeaturedCovers(a){return s.getFeaturedCovers(a).then(r=>r(e,t))},getRootCollections(a){return s.getRootCollections(a).then(r=>r(e,t))},getSystemCollectionStats(a){return s.getSystemCollectionStats(a).then(r=>r(e,t))},mergeCollections(a,r){return s.mergeCollections(a,r).then(o=>o(e,t))},removeAllEmptyCollections(a){return s.removeAllEmptyCollections(a).then(r=>r(e,t))},removeCollection(a,r){return s.removeCollection(a,r).then(o=>o(e,t))},removeCollections(a,r){return s.removeCollections(a,r).then(o=>o(e,t))},reorderAllCollections(a,r){return s.reorderAllCollections(a,r).then(o=>o(e,t))},searchCovers(a,r){return s.searchCovers(a,r).then(o=>o(e,t))},shareCollection(a,r,o){return s.shareCollection(a,r,o).then(l=>l(e,t))},unshareOrLeaveCollection(a,r){return s.unshareOrLeaveCollection(a,r).then(o=>o(e,t))},updateCollection(a,r,o){return s.updateCollection(a,r,o).then(l=>l(e,t))},uploadCollectionCover(a,r,o){return s.uploadCollectionCover(a,r,o).then(l=>l(e,t))}}};let G=class extends S{acceptInvitation(t,e){return R(this.configuration).acceptInvitation(t,e).then(s=>s(this.axios,this.basePath))}changeCollaboratorAccessLevel(t,e,s,a){return R(this.configuration).changeCollaboratorAccessLevel(t,e,s,a).then(r=>r(this.axios,this.basePath))}createCollection(t,e){return R(this.configuration).createCollection(t,e).then(s=>s(this.axios,this.basePath))}deleteCollaborator(t,e,s){return R(this.configuration).deleteCollaborator(t,e,s).then(a=>a(this.axios,this.basePath))}emptyTrash(t){return R(this.configuration).emptyTrash(t).then(e=>e(this.axios,this.basePath))}getChildCollections(t){return R(this.configuration).getChildCollections(t).then(e=>e(this.axios,this.basePath))}getCollaborators(t,e){return R(this.configuration).getCollaborators(t,e).then(s=>s(this.axios,this.basePath))}getCollection(t,e){return R(this.configuration).getCollection(t,e).then(s=>s(this.axios,this.basePath))}getFeaturedCovers(t){return R(this.configuration).getFeaturedCovers(t).then(e=>e(this.axios,this.basePath))}getRootCollections(t){return R(this.configuration).getRootCollections(t).then(e=>e(this.axios,this.basePath))}getSystemCollectionStats(t){return R(this.configuration).getSystemCollectionStats(t).then(e=>e(this.axios,this.basePath))}mergeCollections(t,e){return R(this.configuration).mergeCollections(t,e).then(s=>s(this.axios,this.basePath))}removeAllEmptyCollections(t){return R(this.configuration).removeAllEmptyCollections(t).then(e=>e(this.axios,this.basePath))}removeCollection(t,e){return R(this.configuration).removeCollection(t,e).then(s=>s(this.axios,this.basePath))}removeCollections(t,e){return R(this.configuration).removeCollections(t,e).then(s=>s(this.axios,this.basePath))}reorderAllCollections(t,e){return R(this.configuration).reorderAllCollections(t,e).then(s=>s(this.axios,this.basePath))}searchCovers(t,e){return R(this.configuration).searchCovers(t,e).then(s=>s(this.axios,this.basePath))}shareCollection(t,e,s){return R(this.configuration).shareCollection(t,e,s).then(a=>a(this.axios,this.basePath))}unshareOrLeaveCollection(t,e){return R(this.configuration).unshareOrLeaveCollection(t,e).then(s=>s(this.axios,this.basePath))}updateCollection(t,e,s){return R(this.configuration).updateCollection(t,e,s).then(a=>a(this.axios,this.basePath))}uploadCollectionCover(t,e,s){return R(this.configuration).uploadCollectionCover(t,e,s).then(a=>a(this.axios,this.basePath))}};const z=function(n){return{getFilters:async(t,e,s,a={})=>{P("getFilters","collectionId",t);const r="/rest/v1/filters/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"GET",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.tagsSort=e),s!==void 0&&(d.search=s),V(o,d);let A=l&&l.headers?l.headers:{};return c.headers={...i,...A,...a.headers},{url:O(o),options:c}}}},j=function(n){const t=z(n);return{async getFilters(e,s,a,r){const o=await t.getFilters(e,s,a,r),l=n?.serverIndex??0,c=u["FilterApi.getFilters"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)}}},Ve=function(n,t,e){const s=j(n);return{getFilters(a,r,o,l){return s.getFilters(a,r,o,l).then(c=>c(e,t))}}};class D extends S{getFilters(t,e,s,a){return j(this.configuration).getFilters(t,e,s,a).then(r=>r(this.axios,this.basePath))}}const Oe={MinusCount:"-count",Id:"_id"},J=function(n){return{getAllHighlights:async(t,e,s={})=>{const a="/rest/v1/highlights",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"GET",...o,...s},c={},i={};await C(c,n),t!==void 0&&(i.page=t),e!==void 0&&(i.perpage=e),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},getHighlightsInCollection:async(t,e,s,a={})=>{P("getHighlightsInCollection","collectionId",t);const r="/rest/v1/highlights/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"GET",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.page=e),s!==void 0&&(d.perpage=s),V(o,d);let A=l&&l.headers?l.headers:{};return c.headers={...i,...A,...a.headers},{url:O(o),options:c}},getRaindrop:async(t,e={})=>{P("getRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},updateRaindrop:async(t,e,s={})=>{P("updateRaindrop","id",t);const a="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}}}},g=function(n){const t=J(n);return{async getAllHighlights(e,s,a){const r=await t.getAllHighlights(e,s,a),o=n?.serverIndex??0,l=u["HighlightApi.getAllHighlights"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async getHighlightsInCollection(e,s,a,r){const o=await t.getHighlightsInCollection(e,s,a,r),l=n?.serverIndex??0,c=u["HighlightApi.getHighlightsInCollection"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async getRaindrop(e,s){const a=await t.getRaindrop(e,s),r=n?.serverIndex??0,o=u["HighlightApi.getRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateRaindrop(e,s,a){const r=await t.updateRaindrop(e,s,a),o=n?.serverIndex??0,l=u["HighlightApi.updateRaindrop"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},ve=function(n,t,e){const s=g(n);return{getAllHighlights(a,r,o){return s.getAllHighlights(a,r,o).then(l=>l(e,t))},getHighlightsInCollection(a,r,o,l){return s.getHighlightsInCollection(a,r,o,l).then(c=>c(e,t))},getRaindrop(a,r){return s.getRaindrop(a,r).then(o=>o(e,t))},updateRaindrop(a,r,o){return s.updateRaindrop(a,r,o).then(l=>l(e,t))}}};class K extends S{getAllHighlights(t,e,s){return g(this.configuration).getAllHighlights(t,e,s).then(a=>a(this.axios,this.basePath))}getHighlightsInCollection(t,e,s,a){return g(this.configuration).getHighlightsInCollection(t,e,s,a).then(r=>r(this.axios,this.basePath))}getRaindrop(t,e){return g(this.configuration).getRaindrop(t,e).then(s=>s(this.axios,this.basePath))}updateRaindrop(t,e,s){return g(this.configuration).updateRaindrop(t,e,s).then(a=>a(this.axios,this.basePath))}}const Y=function(n){return{checkURLsExist:async(t,e={})=>{const s="/rest/v1/import/url/exists",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},importHTMLBookmarkFile:async(t,e={})=>{const s="/rest/v1/import/file",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={},i=new(n&&n.formDataCtor||FormData);await C(l,n),t!==void 0&&i.append("import",t),l["Content-Type"]="multipart/form-data",V(a,c);let d=r&&r.headers?r.headers:{};return o.headers={...l,...d,...e.headers},o.data=i,{url:O(a),options:o}},parseURL:async(t,e={})=>{const s="/rest/v1/import/url/parse",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),t!==void 0&&(c.url=t),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}}}},I=function(n){const t=Y(n);return{async checkURLsExist(e,s){const a=await t.checkURLsExist(e,s),r=n?.serverIndex??0,o=u["ImportApi.checkURLsExist"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async importHTMLBookmarkFile(e,s){const a=await t.importHTMLBookmarkFile(e,s),r=n?.serverIndex??0,o=u["ImportApi.importHTMLBookmarkFile"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async parseURL(e,s){const a=await t.parseURL(e,s),r=n?.serverIndex??0,o=u["ImportApi.parseURL"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},Ce=function(n,t,e){const s=I(n);return{checkURLsExist(a,r){return s.checkURLsExist(a,r).then(o=>o(e,t))},importHTMLBookmarkFile(a,r){return s.importHTMLBookmarkFile(a,r).then(o=>o(e,t))},parseURL(a,r){return s.parseURL(a,r).then(o=>o(e,t))}}};class W extends S{checkURLsExist(t,e){return I(this.configuration).checkURLsExist(t,e).then(s=>s(this.axios,this.basePath))}importHTMLBookmarkFile(t,e){return I(this.configuration).importHTMLBookmarkFile(t,e).then(s=>s(this.axios,this.basePath))}parseURL(t,e){return I(this.configuration).parseURL(t,e).then(s=>s(this.axios,this.basePath))}}const X=function(n){return{createRaindrop:async(t,e={})=>{const s="/rest/v1/raindrop",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},createRaindrops:async(t,e={})=>{const s="/rest/v1/raindrops",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},getPermanentCopy:async(t,e={})=>{P("getPermanentCopy","id",t);const s="/rest/v1/raindrop/{id}/cache".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getRaindrop:async(t,e={})=>{P("getRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getRaindrops:async(t,e,s,a,r,o={})=>{P("getRaindrops","collectionId",t);const l="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),c=new URL(l,m);let i;n&&(i=n.baseOptions);const d={method:"GET",...i,...o},A={},x={};await C(A,n),e!==void 0&&(x.sort=e),s!==void 0&&(x.perpage=s),a!==void 0&&(x.page=a),r!==void 0&&(x.search=r),V(c,x);let F=i&&i.headers?i.headers:{};return d.headers={...A,...F,...o.headers},{url:O(c),options:d}},removeRaindrop:async(t,e={})=>{P("removeRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeRaindrops:async(t,e,s,a={})=>{P("removeRaindrops","collectionId",t);const r="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"DELETE",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.search=e),i["Content-Type"]="application/json",V(o,d);let A=l&&l.headers?l.headers:{};return c.headers={...i,...A,...a.headers},c.data=y(s,c,n),{url:O(o),options:c}},suggestForExistingBookmark:async(t,e={})=>{P("suggestForExistingBookmark","id",t);const s="/rest/v1/raindrop/{id}/suggest".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},suggestForNewBookmark:async(t,e={})=>{const s="/rest/v1/raindrop/suggest",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},updateRaindrop:async(t,e,s={})=>{P("updateRaindrop","id",t);const a="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},updateRaindrops:async(t,e,s={})=>{P("updateRaindrops","collectionId",t);const a="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},uploadFile:async(t,e,s={})=>{const a="/rest/v1/raindrop/file",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),t!==void 0&&d.append("file",t),e!==void 0&&d.append("collectionId",e),c["Content-Type"]="multipart/form-data",V(r,i);let A=o&&o.headers?o.headers:{};return l.headers={...c,...A,...s.headers},l.data=d,{url:O(r),options:l}},uploadRaindropCover:async(t,e,s={})=>{P("uploadRaindropCover","id",t);const a="/rest/v1/raindrop/{id}/cover".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),e!==void 0&&d.append("cover",e),c["Content-Type"]="multipart/form-data",V(r,i);let A=o&&o.headers?o.headers:{};return l.headers={...c,...A,...s.headers},l.data=d,{url:O(r),options:l}}}},b=function(n){const t=X(n);return{async createRaindrop(e,s){const a=await t.createRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.createRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async createRaindrops(e,s){const a=await t.createRaindrops(e,s),r=n?.serverIndex??0,o=u["RaindropApi.createRaindrops"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getPermanentCopy(e,s){const a=await t.getPermanentCopy(e,s),r=n?.serverIndex??0,o=u["RaindropApi.getPermanentCopy"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getRaindrop(e,s){const a=await t.getRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.getRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getRaindrops(e,s,a,r,o,l){const c=await t.getRaindrops(e,s,a,r,o,l),i=n?.serverIndex??0,d=u["RaindropApi.getRaindrops"]?.[i]?.url;return(A,x)=>v(c,h,p,n)(A,d||x)},async removeRaindrop(e,s){const a=await t.removeRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.removeRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeRaindrops(e,s,a,r){const o=await t.removeRaindrops(e,s,a,r),l=n?.serverIndex??0,c=u["RaindropApi.removeRaindrops"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async suggestForExistingBookmark(e,s){const a=await t.suggestForExistingBookmark(e,s),r=n?.serverIndex??0,o=u["RaindropApi.suggestForExistingBookmark"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async suggestForNewBookmark(e,s){const a=await t.suggestForNewBookmark(e,s),r=n?.serverIndex??0,o=u["RaindropApi.suggestForNewBookmark"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateRaindrop(e,s,a){const r=await t.updateRaindrop(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.updateRaindrop"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async updateRaindrops(e,s,a){const r=await t.updateRaindrops(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.updateRaindrops"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadFile(e,s,a){const r=await t.uploadFile(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.uploadFile"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadRaindropCover(e,s,a){const r=await t.uploadRaindropCover(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.uploadRaindropCover"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},Pe=function(n,t,e){const s=b(n);return{createRaindrop(a,r){return s.createRaindrop(a,r).then(o=>o(e,t))},createRaindrops(a,r){return s.createRaindrops(a,r).then(o=>o(e,t))},getPermanentCopy(a,r){return s.getPermanentCopy(a,r).then(o=>o(e,t))},getRaindrop(a,r){return s.getRaindrop(a,r).then(o=>o(e,t))},getRaindrops(a,r,o,l,c,i){return s.getRaindrops(a,r,o,l,c,i).then(d=>d(e,t))},removeRaindrop(a,r){return s.removeRaindrop(a,r).then(o=>o(e,t))},removeRaindrops(a,r,o,l){return s.removeRaindrops(a,r,o,l).then(c=>c(e,t))},suggestForExistingBookmark(a,r){return s.suggestForExistingBookmark(a,r).then(o=>o(e,t))},suggestForNewBookmark(a,r){return s.suggestForNewBookmark(a,r).then(o=>o(e,t))},updateRaindrop(a,r,o){return s.updateRaindrop(a,r,o).then(l=>l(e,t))},updateRaindrops(a,r,o){return s.updateRaindrops(a,r,o).then(l=>l(e,t))},uploadFile(a,r,o){return s.uploadFile(a,r,o).then(l=>l(e,t))},uploadRaindropCover(a,r,o){return s.uploadRaindropCover(a,r,o).then(l=>l(e,t))}}};let Z=class extends S{createRaindrop(t,e){return b(this.configuration).createRaindrop(t,e).then(s=>s(this.axios,this.basePath))}createRaindrops(t,e){return b(this.configuration).createRaindrops(t,e).then(s=>s(this.axios,this.basePath))}getPermanentCopy(t,e){return b(this.configuration).getPermanentCopy(t,e).then(s=>s(this.axios,this.basePath))}getRaindrop(t,e){return b(this.configuration).getRaindrop(t,e).then(s=>s(this.axios,this.basePath))}getRaindrops(t,e,s,a,r,o){return b(this.configuration).getRaindrops(t,e,s,a,r,o).then(l=>l(this.axios,this.basePath))}removeRaindrop(t,e){return b(this.configuration).removeRaindrop(t,e).then(s=>s(this.axios,this.basePath))}removeRaindrops(t,e,s,a){return b(this.configuration).removeRaindrops(t,e,s,a).then(r=>r(this.axios,this.basePath))}suggestForExistingBookmark(t,e){return b(this.configuration).suggestForExistingBookmark(t,e).then(s=>s(this.axios,this.basePath))}suggestForNewBookmark(t,e){return b(this.configuration).suggestForNewBookmark(t,e).then(s=>s(this.axios,this.basePath))}updateRaindrop(t,e,s){return b(this.configuration).updateRaindrop(t,e,s).then(a=>a(this.axios,this.basePath))}updateRaindrops(t,e,s){return b(this.configuration).updateRaindrops(t,e,s).then(a=>a(this.axios,this.basePath))}uploadFile(t,e,s){return b(this.configuration).uploadFile(t,e,s).then(a=>a(this.axios,this.basePath))}uploadRaindropCover(t,e,s){return b(this.configuration).uploadRaindropCover(t,e,s).then(a=>a(this.axios,this.basePath))}};const f=function(n){return{getTagsInCollection:async(t,e={})=>{const s="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeTagsFromCollection:async(t,e,s={})=>{const a="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"DELETE",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},renameOrMergeTags:async(t,e,s={})=>{const a="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}}}},T=function(n){const t=f(n);return{async getTagsInCollection(e,s){const a=await t.getTagsInCollection(e,s),r=n?.serverIndex??0,o=u["TagApi.getTagsInCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeTagsFromCollection(e,s,a){const r=await t.removeTagsFromCollection(e,s,a),o=n?.serverIndex??0,l=u["TagApi.removeTagsFromCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async renameOrMergeTags(e,s,a){const r=await t.renameOrMergeTags(e,s,a),o=n?.serverIndex??0,l=u["TagApi.renameOrMergeTags"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},Re=function(n,t,e){const s=T(n);return{getTagsInCollection(a,r){return s.getTagsInCollection(a,r).then(o=>o(e,t))},removeTagsFromCollection(a,r,o){return s.removeTagsFromCollection(a,r,o).then(l=>l(e,t))},renameOrMergeTags(a,r,o){return s.renameOrMergeTags(a,r,o).then(l=>l(e,t))}}};class ee extends S{getTagsInCollection(t,e){return T(this.configuration).getTagsInCollection(t,e).then(s=>s(this.axios,this.basePath))}removeTagsFromCollection(t,e,s){return T(this.configuration).removeTagsFromCollection(t,e,s).then(a=>a(this.axios,this.basePath))}renameOrMergeTags(t,e,s){return T(this.configuration).renameOrMergeTags(t,e,s).then(a=>a(this.axios,this.basePath))}}const re=function(n){return{connectSocialNetworkProvider:async(t,e={})=>{P("connectSocialNetworkProvider","provider",t);const s="/rest/v1/user/connect/{provider}".replace("{provider}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},disconnectSocialNetworkProvider:async(t,e={})=>{P("disconnectSocialNetworkProvider","provider",t);const s="/rest/v1/user/connect/{provider}/revoke".replace("{provider}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getCurrentUser:async(t={})=>{const e="/rest/v1/user",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getPublicUserByName:async(t,e={})=>{P("getPublicUserByName","name",t);const s="/rest/v1/user/{name}".replace("{name}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getSystemCollectionStats:async(t={})=>{const e="/rest/v1/user/stats",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},updateCurrentUser:async(t,e={})=>{const s="/rest/v1/user",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}}}},w=function(n){const t=re(n);return{async connectSocialNetworkProvider(e,s){const a=await t.connectSocialNetworkProvider(e,s),r=n?.serverIndex??0,o=u["UserApi.connectSocialNetworkProvider"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async disconnectSocialNetworkProvider(e,s){const a=await t.disconnectSocialNetworkProvider(e,s),r=n?.serverIndex??0,o=u["UserApi.disconnectSocialNetworkProvider"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getCurrentUser(e){const s=await t.getCurrentUser(e),a=n?.serverIndex??0,r=u["UserApi.getCurrentUser"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getPublicUserByName(e,s){const a=await t.getPublicUserByName(e,s),r=n?.serverIndex??0,o=u["UserApi.getPublicUserByName"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getSystemCollectionStats(e){const s=await t.getSystemCollectionStats(e),a=n?.serverIndex??0,r=u["UserApi.getSystemCollectionStats"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async updateCurrentUser(e,s){const a=await t.updateCurrentUser(e,s),r=n?.serverIndex??0,o=u["UserApi.updateCurrentUser"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},Ae=function(n,t,e){const s=w(n);return{connectSocialNetworkProvider(a,r){return s.connectSocialNetworkProvider(a,r).then(o=>o(e,t))},disconnectSocialNetworkProvider(a,r){return s.disconnectSocialNetworkProvider(a,r).then(o=>o(e,t))},getCurrentUser(a){return s.getCurrentUser(a).then(r=>r(e,t))},getPublicUserByName(a,r){return s.getPublicUserByName(a,r).then(o=>o(e,t))},getSystemCollectionStats(a){return s.getSystemCollectionStats(a).then(r=>r(e,t))},updateCurrentUser(a,r){return s.updateCurrentUser(a,r).then(o=>o(e,t))}}};class te extends S{connectSocialNetworkProvider(t,e){return w(this.configuration).connectSocialNetworkProvider(t,e).then(s=>s(this.axios,this.basePath))}disconnectSocialNetworkProvider(t,e){return w(this.configuration).disconnectSocialNetworkProvider(t,e).then(s=>s(this.axios,this.basePath))}getCurrentUser(t){return w(this.configuration).getCurrentUser(t).then(e=>e(this.axios,this.basePath))}getPublicUserByName(t,e){return w(this.configuration).getPublicUserByName(t,e).then(s=>s(this.axios,this.basePath))}getSystemCollectionStats(t){return w(this.configuration).getSystemCollectionStats(t).then(e=>e(this.axios,this.basePath))}updateCurrentUser(t,e){return w(this.configuration).updateCurrentUser(t,e).then(s=>s(this.axios,this.basePath))}}const ye={Facebook:"facebook",Google:"google",Twitter:"twitter",Vkontate:"vkontate",Dropbox:"dropbox",Gdrive:"gdrive"},be={Facebook:"facebook",Google:"google",Twitter:"twitter",Vkontate:"vkontate",Dropbox:"dropbox",Gdrive:"gdrive"};class ae{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(e.test(t)||t.toLowerCase()==="application/json-patch+json")}}const xe=Object.freeze(Object.defineProperty({__proto__:null,AuthenticationApi:_,AuthenticationApiAxiosParamCreator:$,AuthenticationApiFactory:ue,AuthenticationApiFp:B,CollectionApi:G,CollectionApiAxiosParamCreator:M,CollectionApiFactory:me,CollectionApiFp:R,CollectionRefRefEnum:de,Configuration:ae,ConnectSocialNetworkProviderProviderEnum:ye,DisconnectSocialNetworkProviderProviderEnum:be,FilterApi:D,FilterApiAxiosParamCreator:z,FilterApiFactory:Ve,FilterApiFp:j,GetFiltersTagsSortEnum:Oe,HighlightApi:K,HighlightApiAxiosParamCreator:J,HighlightApiFactory:ve,HighlightApiFp:g,ImportApi:W,ImportApiAxiosParamCreator:Y,ImportApiFactory:Ce,ImportApiFp:I,ObtainTokenGrantTypeEnum:Q,RaindropApi:Z,RaindropApiAxiosParamCreator:X,RaindropApiFactory:Pe,RaindropApiFp:b,RefreshTokenGrantTypeEnum:N,Role:he,TagApi:ee,TagApiAxiosParamCreator:f,TagApiFactory:Re,TagApiFp:T,TokenResponseTokenTypeEnum:pe,UserApi:te,UserApiAxiosParamCreator:re,UserApiFactory:Ae,UserApiFp:w},Symbol.toStringTag,{value:"Module"}));class we extends _{async exchangeToken(t,e){return this.getOrRefreshToken({...t,grant_type:Q.AuthorizationCode},e).then(s=>{if(q(s.data))throw new Error(`Request failed with error: ${s.data.errorMessage}`);return s})}async refreshToken(t,e){return this.getOrRefreshToken({...t,grant_type:N.RefreshToken},e).then(s=>{if(q(s.data))throw new Error(`Request failed with error: ${s.data.errorMessage}`);return s})}}function q(n){return"result"in n&&n.result===!1}class k{_data;_parent=null;_children=[];constructor(t,e){this._data=t,e&&this.addChildren(...e)}get data(){return this._data}get parent(){return this._parent}set parent(t){this._parent=t,t._children.push(this)}isRoot(){return this._parent===null}get children(){return this._children}addChildren(...t){this._children.push(...t);for(const e of t)e._parent=this}traverse(t){t(this);for(const e of this.children)e.traverse(t)}}function oe(n,t,e){const s=e.filter(a=>a.parent===t);for(const a of s){const r=a.toNode();oe(r,a.id,e),n.addChildren(r)}}function se(n,t){const e=new k(n);return oe(e,null,t),e}const Se=Object.freeze(Object.defineProperty({__proto__:null,TreeNode:k,makeTree:se},Symbol.toStringTag,{value:"Module"}));class ge extends G{async getCollectionTree(){const[{data:t},{data:e}]=await Promise.all([this.getRootCollections(),this.getChildCollections()]),s=t.items.map(l=>({data:l,id:l._id.toString(),parent:null,toNode(){return new k(this.data)}})),a=e.items.map(l=>({data:l,id:l._id.toString(),parent:l.parent?.$id.toString()||null,toNode(){return new k(this.data)}})),r=s.concat(a);return r.sort((l,c)=>l.data.title.localeCompare(c.data.title)||l.data._id-c.data._id),se(null,r)}}class Ue extends Z{async getAllRaindrops(t,e,s){const a=t??0,r=e?.sort??"",o=e?.pageSize??50,l=e?.search??"",{data:c}=await this.getRaindrops(a,r,o,0,l,s),i=c.count,d=Math.ceil(i/o),A=Array.from(Array(d).keys());A.shift();const x=await Promise.all(A.map(L=>this.getRaindrops(a,r,o,L,l,s).then(({data:le})=>le))),F=[...c.items];for(const L of x)F.push(...L.items);return F}}class ne{client;configuration;auth;user;collection;filter;highlight;import;raindrop;tag;constructor(t,e){this.client=e??h,this.configuration=t??new ae,this.auth=new we(t,void 0,this.client),this.collection=new ge(t,void 0,this.client),this.filter=new D(t,void 0,this.client),this.highlight=new K(t,void 0,this.client),this.import=new W(t,void 0,this.client),this.raindrop=new Ue(t,void 0,this.client),this.tag=new ee(t,void 0,this.client),this.user=new te(t,void 0,this.client)}}const Ie=Object.freeze(Object.defineProperty({__proto__:null,Raindrop:ne},Symbol.toStringTag,{value:"Module"})),Te=Object.freeze(Object.defineProperty({__proto__:null,tree:Se},Symbol.toStringTag,{value:"Module"})),Fe=ne;exports.client=Ie;exports.default=Fe;exports.generated=xe;exports.utils=Te;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("axios"),p="https://api.raindrop.io".replace(/\/+$/,"");class S{constructor(t,e=p,s=h){this.basePath=e,this.axios=s,t&&(this.configuration=t,this.basePath=t.basePath??e)}configuration}class ce extends Error{constructor(t,e){super(e),this.field=t,this.name="RequiredError"}}const u={},m="https://example.com",P=function(n,t,e){if(e==null)throw new ce(t,`Required parameter ${t} was null or undefined when calling ${n}.`)},C=async function(n,t){if(t&&t.accessToken){const e=typeof t.accessToken=="function"?await t.accessToken():await t.accessToken;n.Authorization="Bearer "+e}};function E(n,t,e=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(s=>E(n,s,e)):Object.keys(t).forEach(s=>E(n,t[s],`${e}${e!==""?".":""}${s}`)):n.has(e)?n.append(e,t):n.set(e,t))}const V=function(n,...t){const e=new URLSearchParams(n.search);E(e,t),n.search=e.toString()},y=function(n,t,e){const s=typeof n!="string";return(s&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):s)?JSON.stringify(n!==void 0?U(n):{}):n||""};function U(n){if(typeof Set>"u"||typeof Map>"u"||typeof n!="object"||!n)return n;if(n instanceof Set)return Array.from(n).map(t=>U(t));if(n instanceof Map){const t=[];return n.forEach((e,s)=>{t.push([s,U(e)])}),H(t)}return Array.isArray(n)?n.map(t=>U(t)):H(ie(n).map(([t,e])=>[t,U(e)]))}function ie(n){return Object.keys(n).map(t=>[t,n[t]])}function H(n){return[...n].reduce((t,[e,s])=>(t[e]=s,t),{})}const O=function(n){return n.pathname+n.search+n.hash},v=function(n,t,e,s){return(a=t,r=e)=>{const o={...n.options,url:(a.defaults.baseURL?"":s?.basePath??r)+n.url};return a.request(o)}},de={Collections:"collections"},Q={AuthorizationCode:"authorization_code"},N={RefreshToken:"refresh_token"},he={Member:"member",Viewer:"viewer"},pe={Bearer:"Bearer"},$=function(n){return{authorize:async(t,e,s={})=>{P("authorize","redirectUri",t),P("authorize","clientId",e);const a="/v1/oauth/authorize",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"GET",...o,...s},c={},i={};t!==void 0&&(i.redirect_uri=t),e!==void 0&&(i.client_id=e),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},getOrRefreshToken:async(t,e={})=>{const s="/v1/oauth/access_token",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}}}},B=function(n){const t=$(n);return{async authorize(e,s,a){const r=await t.authorize(e,s,a),o=n?.serverIndex??0,l=u["AuthenticationApi.authorize"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async getOrRefreshToken(e,s){const a=await t.getOrRefreshToken(e,s),r=n?.serverIndex??0,o=u["AuthenticationApi.getOrRefreshToken"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},ue=function(n,t,e){const s=B(n);return{authorize(a,r,o){return s.authorize(a,r,o).then(l=>l(e,t))},getOrRefreshToken(a,r){return s.getOrRefreshToken(a,r).then(o=>o(e,t))}}};let _=class extends S{authorize(t,e,s){return B(this.configuration).authorize(t,e,s).then(a=>a(this.axios,this.basePath))}getOrRefreshToken(t,e){return B(this.configuration).getOrRefreshToken(t,e).then(s=>s(this.axios,this.basePath))}};const M=function(n){return{acceptInvitation:async(t,e={})=>{P("acceptInvitation","id",t);const s="/rest/v1/collection/{id}/join".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},changeCollaboratorAccessLevel:async(t,e,s,a={})=>{P("changeCollaboratorAccessLevel","userId",t),P("changeCollaboratorAccessLevel","id",e);const r="/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"PUT",...l,...a},i={},d={};await C(i,n),i["Content-Type"]="application/json",V(o,d);let R=l&&l.headers?l.headers:{};return c.headers={...i,...R,...a.headers},c.data=y(s,c,n),{url:O(o),options:c}},createCollection:async(t,e={})=>{const s="/rest/v1/collection",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},deleteCollaborator:async(t,e,s={})=>{P("deleteCollaborator","userId",t),P("deleteCollaborator","id",e);const a="/rest/v1/collection/{id}/sharing/{userId}".replace("{userId}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"DELETE",...o,...s},c={},i={};await C(c,n),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},emptyTrash:async(t={})=>{const e="/rest/v1/collection/-99",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"DELETE",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getChildCollections:async(t={})=>{const e="/rest/v1/collections/childrens",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getCollaborators:async(t,e={})=>{P("getCollaborators","id",t);const s="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getCollection:async(t,e={})=>{P("getCollection","id",t);const s="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getFeaturedCovers:async(t={})=>{const e="/rest/v1/collections/covers",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getRootCollections:async(t={})=>{const e="/rest/v1/collections",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getSystemCollectionStats:async(t={})=>{const e="/rest/v1/user/stats",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},mergeCollections:async(t,e={})=>{const s="/rest/v1/collections/merge",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},removeAllEmptyCollections:async(t={})=>{const e="/rest/v1/collections/clean",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"PUT",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},removeCollection:async(t,e={})=>{P("removeCollection","id",t);const s="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeCollections:async(t,e={})=>{const s="/rest/v1/collections",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},reorderAllCollections:async(t,e={})=>{const s="/rest/v1/collections",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},searchCovers:async(t,e={})=>{P("searchCovers","text",t);const s="/rest/v1/collections/covers/{text}".replace("{text}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},shareCollection:async(t,e,s={})=>{P("shareCollection","id",t);const a="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"POST",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},unshareOrLeaveCollection:async(t,e={})=>{P("unshareOrLeaveCollection","id",t);const s="/rest/v1/collection/{id}/sharing".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},updateCollection:async(t,e,s={})=>{P("updateCollection","id",t);const a="/rest/v1/collection/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},uploadCollectionCover:async(t,e,s={})=>{P("uploadCollectionCover","id",t);const a="/rest/v1/collection/{id}/cover".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),e!==void 0&&d.append("cover",e),c["Content-Type"]="multipart/form-data",V(r,i);let R=o&&o.headers?o.headers:{};return l.headers={...c,...R,...s.headers},l.data=d,{url:O(r),options:l}}}},A=function(n){const t=M(n);return{async acceptInvitation(e,s){const a=await t.acceptInvitation(e,s),r=n?.serverIndex??0,o=u["CollectionApi.acceptInvitation"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async changeCollaboratorAccessLevel(e,s,a,r){const o=await t.changeCollaboratorAccessLevel(e,s,a,r),l=n?.serverIndex??0,c=u["CollectionApi.changeCollaboratorAccessLevel"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async createCollection(e,s){const a=await t.createCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.createCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async deleteCollaborator(e,s,a){const r=await t.deleteCollaborator(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.deleteCollaborator"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async emptyTrash(e){const s=await t.emptyTrash(e),a=n?.serverIndex??0,r=u["CollectionApi.emptyTrash"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getChildCollections(e){const s=await t.getChildCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.getChildCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getCollaborators(e,s){const a=await t.getCollaborators(e,s),r=n?.serverIndex??0,o=u["CollectionApi.getCollaborators"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getCollection(e,s){const a=await t.getCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.getCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getFeaturedCovers(e){const s=await t.getFeaturedCovers(e),a=n?.serverIndex??0,r=u["CollectionApi.getFeaturedCovers"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getRootCollections(e){const s=await t.getRootCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.getRootCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getSystemCollectionStats(e){const s=await t.getSystemCollectionStats(e),a=n?.serverIndex??0,r=u["CollectionApi.getSystemCollectionStats"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async mergeCollections(e,s){const a=await t.mergeCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.mergeCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeAllEmptyCollections(e){const s=await t.removeAllEmptyCollections(e),a=n?.serverIndex??0,r=u["CollectionApi.removeAllEmptyCollections"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async removeCollection(e,s){const a=await t.removeCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.removeCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeCollections(e,s){const a=await t.removeCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.removeCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async reorderAllCollections(e,s){const a=await t.reorderAllCollections(e,s),r=n?.serverIndex??0,o=u["CollectionApi.reorderAllCollections"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async searchCovers(e,s){const a=await t.searchCovers(e,s),r=n?.serverIndex??0,o=u["CollectionApi.searchCovers"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async shareCollection(e,s,a){const r=await t.shareCollection(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.shareCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async unshareOrLeaveCollection(e,s){const a=await t.unshareOrLeaveCollection(e,s),r=n?.serverIndex??0,o=u["CollectionApi.unshareOrLeaveCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateCollection(e,s,a){const r=await t.updateCollection(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.updateCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadCollectionCover(e,s,a){const r=await t.uploadCollectionCover(e,s,a),o=n?.serverIndex??0,l=u["CollectionApi.uploadCollectionCover"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},me=function(n,t,e){const s=A(n);return{acceptInvitation(a,r){return s.acceptInvitation(a,r).then(o=>o(e,t))},changeCollaboratorAccessLevel(a,r,o,l){return s.changeCollaboratorAccessLevel(a,r,o,l).then(c=>c(e,t))},createCollection(a,r){return s.createCollection(a,r).then(o=>o(e,t))},deleteCollaborator(a,r,o){return s.deleteCollaborator(a,r,o).then(l=>l(e,t))},emptyTrash(a){return s.emptyTrash(a).then(r=>r(e,t))},getChildCollections(a){return s.getChildCollections(a).then(r=>r(e,t))},getCollaborators(a,r){return s.getCollaborators(a,r).then(o=>o(e,t))},getCollection(a,r){return s.getCollection(a,r).then(o=>o(e,t))},getFeaturedCovers(a){return s.getFeaturedCovers(a).then(r=>r(e,t))},getRootCollections(a){return s.getRootCollections(a).then(r=>r(e,t))},getSystemCollectionStats(a){return s.getSystemCollectionStats(a).then(r=>r(e,t))},mergeCollections(a,r){return s.mergeCollections(a,r).then(o=>o(e,t))},removeAllEmptyCollections(a){return s.removeAllEmptyCollections(a).then(r=>r(e,t))},removeCollection(a,r){return s.removeCollection(a,r).then(o=>o(e,t))},removeCollections(a,r){return s.removeCollections(a,r).then(o=>o(e,t))},reorderAllCollections(a,r){return s.reorderAllCollections(a,r).then(o=>o(e,t))},searchCovers(a,r){return s.searchCovers(a,r).then(o=>o(e,t))},shareCollection(a,r,o){return s.shareCollection(a,r,o).then(l=>l(e,t))},unshareOrLeaveCollection(a,r){return s.unshareOrLeaveCollection(a,r).then(o=>o(e,t))},updateCollection(a,r,o){return s.updateCollection(a,r,o).then(l=>l(e,t))},uploadCollectionCover(a,r,o){return s.uploadCollectionCover(a,r,o).then(l=>l(e,t))}}};let G=class extends S{acceptInvitation(t,e){return A(this.configuration).acceptInvitation(t,e).then(s=>s(this.axios,this.basePath))}changeCollaboratorAccessLevel(t,e,s,a){return A(this.configuration).changeCollaboratorAccessLevel(t,e,s,a).then(r=>r(this.axios,this.basePath))}createCollection(t,e){return A(this.configuration).createCollection(t,e).then(s=>s(this.axios,this.basePath))}deleteCollaborator(t,e,s){return A(this.configuration).deleteCollaborator(t,e,s).then(a=>a(this.axios,this.basePath))}emptyTrash(t){return A(this.configuration).emptyTrash(t).then(e=>e(this.axios,this.basePath))}getChildCollections(t){return A(this.configuration).getChildCollections(t).then(e=>e(this.axios,this.basePath))}getCollaborators(t,e){return A(this.configuration).getCollaborators(t,e).then(s=>s(this.axios,this.basePath))}getCollection(t,e){return A(this.configuration).getCollection(t,e).then(s=>s(this.axios,this.basePath))}getFeaturedCovers(t){return A(this.configuration).getFeaturedCovers(t).then(e=>e(this.axios,this.basePath))}getRootCollections(t){return A(this.configuration).getRootCollections(t).then(e=>e(this.axios,this.basePath))}getSystemCollectionStats(t){return A(this.configuration).getSystemCollectionStats(t).then(e=>e(this.axios,this.basePath))}mergeCollections(t,e){return A(this.configuration).mergeCollections(t,e).then(s=>s(this.axios,this.basePath))}removeAllEmptyCollections(t){return A(this.configuration).removeAllEmptyCollections(t).then(e=>e(this.axios,this.basePath))}removeCollection(t,e){return A(this.configuration).removeCollection(t,e).then(s=>s(this.axios,this.basePath))}removeCollections(t,e){return A(this.configuration).removeCollections(t,e).then(s=>s(this.axios,this.basePath))}reorderAllCollections(t,e){return A(this.configuration).reorderAllCollections(t,e).then(s=>s(this.axios,this.basePath))}searchCovers(t,e){return A(this.configuration).searchCovers(t,e).then(s=>s(this.axios,this.basePath))}shareCollection(t,e,s){return A(this.configuration).shareCollection(t,e,s).then(a=>a(this.axios,this.basePath))}unshareOrLeaveCollection(t,e){return A(this.configuration).unshareOrLeaveCollection(t,e).then(s=>s(this.axios,this.basePath))}updateCollection(t,e,s){return A(this.configuration).updateCollection(t,e,s).then(a=>a(this.axios,this.basePath))}uploadCollectionCover(t,e,s){return A(this.configuration).uploadCollectionCover(t,e,s).then(a=>a(this.axios,this.basePath))}};const D=function(n){return{getFilters:async(t,e,s,a={})=>{P("getFilters","collectionId",t);const r="/rest/v1/filters/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"GET",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.tagsSort=e),s!==void 0&&(d.search=s),V(o,d);let R=l&&l.headers?l.headers:{};return c.headers={...i,...R,...a.headers},{url:O(o),options:c}}}},j=function(n){const t=D(n);return{async getFilters(e,s,a,r){const o=await t.getFilters(e,s,a,r),l=n?.serverIndex??0,c=u["FilterApi.getFilters"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)}}},Ve=function(n,t,e){const s=j(n);return{getFilters(a,r,o,l){return s.getFilters(a,r,o,l).then(c=>c(e,t))}}};class z extends S{getFilters(t,e,s,a){return j(this.configuration).getFilters(t,e,s,a).then(r=>r(this.axios,this.basePath))}}const Oe={MinusCount:"-count",Id:"_id"},J=function(n){return{getAllHighlights:async(t,e,s={})=>{const a="/rest/v1/highlights",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"GET",...o,...s},c={},i={};await C(c,n),t!==void 0&&(i.page=t),e!==void 0&&(i.perpage=e),V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},{url:O(r),options:l}},getHighlightsInCollection:async(t,e,s,a={})=>{P("getHighlightsInCollection","collectionId",t);const r="/rest/v1/highlights/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"GET",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.page=e),s!==void 0&&(d.perpage=s),V(o,d);let R=l&&l.headers?l.headers:{};return c.headers={...i,...R,...a.headers},{url:O(o),options:c}},getRaindrop:async(t,e={})=>{P("getRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},updateRaindrop:async(t,e,s={})=>{P("updateRaindrop","id",t);const a="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}}}},g=function(n){const t=J(n);return{async getAllHighlights(e,s,a){const r=await t.getAllHighlights(e,s,a),o=n?.serverIndex??0,l=u["HighlightApi.getAllHighlights"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async getHighlightsInCollection(e,s,a,r){const o=await t.getHighlightsInCollection(e,s,a,r),l=n?.serverIndex??0,c=u["HighlightApi.getHighlightsInCollection"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async getRaindrop(e,s){const a=await t.getRaindrop(e,s),r=n?.serverIndex??0,o=u["HighlightApi.getRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateRaindrop(e,s,a){const r=await t.updateRaindrop(e,s,a),o=n?.serverIndex??0,l=u["HighlightApi.updateRaindrop"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},ve=function(n,t,e){const s=g(n);return{getAllHighlights(a,r,o){return s.getAllHighlights(a,r,o).then(l=>l(e,t))},getHighlightsInCollection(a,r,o,l){return s.getHighlightsInCollection(a,r,o,l).then(c=>c(e,t))},getRaindrop(a,r){return s.getRaindrop(a,r).then(o=>o(e,t))},updateRaindrop(a,r,o){return s.updateRaindrop(a,r,o).then(l=>l(e,t))}}};class K extends S{getAllHighlights(t,e,s){return g(this.configuration).getAllHighlights(t,e,s).then(a=>a(this.axios,this.basePath))}getHighlightsInCollection(t,e,s,a){return g(this.configuration).getHighlightsInCollection(t,e,s,a).then(r=>r(this.axios,this.basePath))}getRaindrop(t,e){return g(this.configuration).getRaindrop(t,e).then(s=>s(this.axios,this.basePath))}updateRaindrop(t,e,s){return g(this.configuration).updateRaindrop(t,e,s).then(a=>a(this.axios,this.basePath))}}const Y=function(n){return{checkURLsExist:async(t,e={})=>{const s="/rest/v1/import/url/exists",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},importHTMLBookmarkFile:async(t,e={})=>{const s="/rest/v1/import/file",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={},i=new(n&&n.formDataCtor||FormData);await C(l,n),t!==void 0&&i.append("import",t),l["Content-Type"]="multipart/form-data",V(a,c);let d=r&&r.headers?r.headers:{};return o.headers={...l,...d,...e.headers},o.data=i,{url:O(a),options:o}},parseURL:async(t,e={})=>{const s="/rest/v1/import/url/parse",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),t!==void 0&&(c.url=t),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}}}},I=function(n){const t=Y(n);return{async checkURLsExist(e,s){const a=await t.checkURLsExist(e,s),r=n?.serverIndex??0,o=u["ImportApi.checkURLsExist"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async importHTMLBookmarkFile(e,s){const a=await t.importHTMLBookmarkFile(e,s),r=n?.serverIndex??0,o=u["ImportApi.importHTMLBookmarkFile"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async parseURL(e,s){const a=await t.parseURL(e,s),r=n?.serverIndex??0,o=u["ImportApi.parseURL"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},Ce=function(n,t,e){const s=I(n);return{checkURLsExist(a,r){return s.checkURLsExist(a,r).then(o=>o(e,t))},importHTMLBookmarkFile(a,r){return s.importHTMLBookmarkFile(a,r).then(o=>o(e,t))},parseURL(a,r){return s.parseURL(a,r).then(o=>o(e,t))}}};class W extends S{checkURLsExist(t,e){return I(this.configuration).checkURLsExist(t,e).then(s=>s(this.axios,this.basePath))}importHTMLBookmarkFile(t,e){return I(this.configuration).importHTMLBookmarkFile(t,e).then(s=>s(this.axios,this.basePath))}parseURL(t,e){return I(this.configuration).parseURL(t,e).then(s=>s(this.axios,this.basePath))}}const X=function(n){return{createRaindrop:async(t,e={})=>{const s="/rest/v1/raindrop",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},createRaindrops:async(t,e={})=>{const s="/rest/v1/raindrops",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},getPermanentCopy:async(t,e={})=>{P("getPermanentCopy","id",t);const s="/rest/v1/raindrop/{id}/cache".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getRaindrop:async(t,e={})=>{P("getRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getRaindrops:async(t,e,s,a,r,o={})=>{P("getRaindrops","collectionId",t);const l="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),c=new URL(l,m);let i;n&&(i=n.baseOptions);const d={method:"GET",...i,...o},R={},x={};await C(R,n),e!==void 0&&(x.sort=e),s!==void 0&&(x.perpage=s),a!==void 0&&(x.page=a),r!==void 0&&(x.search=r),V(c,x);let F=i&&i.headers?i.headers:{};return d.headers={...R,...F,...o.headers},{url:O(c),options:d}},removeRaindrop:async(t,e={})=>{P("removeRaindrop","id",t);const s="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"DELETE",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeRaindrops:async(t,e,s,a={})=>{P("removeRaindrops","collectionId",t);const r="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),o=new URL(r,m);let l;n&&(l=n.baseOptions);const c={method:"DELETE",...l,...a},i={},d={};await C(i,n),e!==void 0&&(d.search=e),i["Content-Type"]="application/json",V(o,d);let R=l&&l.headers?l.headers:{};return c.headers={...i,...R,...a.headers},c.data=y(s,c,n),{url:O(o),options:c}},suggestForExistingBookmark:async(t,e={})=>{P("suggestForExistingBookmark","id",t);const s="/rest/v1/raindrop/{id}/suggest".replace("{id}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},suggestForNewBookmark:async(t,e={})=>{const s="/rest/v1/raindrop/suggest",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"POST",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}},updateRaindrop:async(t,e,s={})=>{P("updateRaindrop","id",t);const a="/rest/v1/raindrop/{id}".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},updateRaindrops:async(t,e,s={})=>{P("updateRaindrops","collectionId",t);const a="/rest/v1/raindrops/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},uploadFile:async(t,e,s={})=>{const a="/rest/v1/raindrop/file",r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),t!==void 0&&d.append("file",t),e!==void 0&&d.append("collectionId",e),c["Content-Type"]="multipart/form-data",V(r,i);let R=o&&o.headers?o.headers:{};return l.headers={...c,...R,...s.headers},l.data=d,{url:O(r),options:l}},uploadRaindropCover:async(t,e,s={})=>{P("uploadRaindropCover","id",t);const a="/rest/v1/raindrop/{id}/cover".replace("{id}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={},d=new(n&&n.formDataCtor||FormData);await C(c,n),e!==void 0&&d.append("cover",e),c["Content-Type"]="multipart/form-data",V(r,i);let R=o&&o.headers?o.headers:{};return l.headers={...c,...R,...s.headers},l.data=d,{url:O(r),options:l}}}},b=function(n){const t=X(n);return{async createRaindrop(e,s){const a=await t.createRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.createRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async createRaindrops(e,s){const a=await t.createRaindrops(e,s),r=n?.serverIndex??0,o=u["RaindropApi.createRaindrops"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getPermanentCopy(e,s){const a=await t.getPermanentCopy(e,s),r=n?.serverIndex??0,o=u["RaindropApi.getPermanentCopy"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getRaindrop(e,s){const a=await t.getRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.getRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getRaindrops(e,s,a,r,o,l){const c=await t.getRaindrops(e,s,a,r,o,l),i=n?.serverIndex??0,d=u["RaindropApi.getRaindrops"]?.[i]?.url;return(R,x)=>v(c,h,p,n)(R,d||x)},async removeRaindrop(e,s){const a=await t.removeRaindrop(e,s),r=n?.serverIndex??0,o=u["RaindropApi.removeRaindrop"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeRaindrops(e,s,a,r){const o=await t.removeRaindrops(e,s,a,r),l=n?.serverIndex??0,c=u["RaindropApi.removeRaindrops"]?.[l]?.url;return(i,d)=>v(o,h,p,n)(i,c||d)},async suggestForExistingBookmark(e,s){const a=await t.suggestForExistingBookmark(e,s),r=n?.serverIndex??0,o=u["RaindropApi.suggestForExistingBookmark"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async suggestForNewBookmark(e,s){const a=await t.suggestForNewBookmark(e,s),r=n?.serverIndex??0,o=u["RaindropApi.suggestForNewBookmark"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async updateRaindrop(e,s,a){const r=await t.updateRaindrop(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.updateRaindrop"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async updateRaindrops(e,s,a){const r=await t.updateRaindrops(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.updateRaindrops"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadFile(e,s,a){const r=await t.uploadFile(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.uploadFile"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async uploadRaindropCover(e,s,a){const r=await t.uploadRaindropCover(e,s,a),o=n?.serverIndex??0,l=u["RaindropApi.uploadRaindropCover"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},Pe=function(n,t,e){const s=b(n);return{createRaindrop(a,r){return s.createRaindrop(a,r).then(o=>o(e,t))},createRaindrops(a,r){return s.createRaindrops(a,r).then(o=>o(e,t))},getPermanentCopy(a,r){return s.getPermanentCopy(a,r).then(o=>o(e,t))},getRaindrop(a,r){return s.getRaindrop(a,r).then(o=>o(e,t))},getRaindrops(a,r,o,l,c,i){return s.getRaindrops(a,r,o,l,c,i).then(d=>d(e,t))},removeRaindrop(a,r){return s.removeRaindrop(a,r).then(o=>o(e,t))},removeRaindrops(a,r,o,l){return s.removeRaindrops(a,r,o,l).then(c=>c(e,t))},suggestForExistingBookmark(a,r){return s.suggestForExistingBookmark(a,r).then(o=>o(e,t))},suggestForNewBookmark(a,r){return s.suggestForNewBookmark(a,r).then(o=>o(e,t))},updateRaindrop(a,r,o){return s.updateRaindrop(a,r,o).then(l=>l(e,t))},updateRaindrops(a,r,o){return s.updateRaindrops(a,r,o).then(l=>l(e,t))},uploadFile(a,r,o){return s.uploadFile(a,r,o).then(l=>l(e,t))},uploadRaindropCover(a,r,o){return s.uploadRaindropCover(a,r,o).then(l=>l(e,t))}}};let Z=class extends S{createRaindrop(t,e){return b(this.configuration).createRaindrop(t,e).then(s=>s(this.axios,this.basePath))}createRaindrops(t,e){return b(this.configuration).createRaindrops(t,e).then(s=>s(this.axios,this.basePath))}getPermanentCopy(t,e){return b(this.configuration).getPermanentCopy(t,e).then(s=>s(this.axios,this.basePath))}getRaindrop(t,e){return b(this.configuration).getRaindrop(t,e).then(s=>s(this.axios,this.basePath))}getRaindrops(t,e,s,a,r,o){return b(this.configuration).getRaindrops(t,e,s,a,r,o).then(l=>l(this.axios,this.basePath))}removeRaindrop(t,e){return b(this.configuration).removeRaindrop(t,e).then(s=>s(this.axios,this.basePath))}removeRaindrops(t,e,s,a){return b(this.configuration).removeRaindrops(t,e,s,a).then(r=>r(this.axios,this.basePath))}suggestForExistingBookmark(t,e){return b(this.configuration).suggestForExistingBookmark(t,e).then(s=>s(this.axios,this.basePath))}suggestForNewBookmark(t,e){return b(this.configuration).suggestForNewBookmark(t,e).then(s=>s(this.axios,this.basePath))}updateRaindrop(t,e,s){return b(this.configuration).updateRaindrop(t,e,s).then(a=>a(this.axios,this.basePath))}updateRaindrops(t,e,s){return b(this.configuration).updateRaindrops(t,e,s).then(a=>a(this.axios,this.basePath))}uploadFile(t,e,s){return b(this.configuration).uploadFile(t,e,s).then(a=>a(this.axios,this.basePath))}uploadRaindropCover(t,e,s){return b(this.configuration).uploadRaindropCover(t,e,s).then(a=>a(this.axios,this.basePath))}};const f=function(n){return{getTagsInCollection:async(t,e={})=>{const s="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},removeTagsFromCollection:async(t,e,s={})=>{const a="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"DELETE",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}},renameOrMergeTags:async(t,e,s={})=>{const a="/rest/v1/tags/{collectionId}".replace("{collectionId}",encodeURIComponent(String(t))),r=new URL(a,m);let o;n&&(o=n.baseOptions);const l={method:"PUT",...o,...s},c={},i={};await C(c,n),c["Content-Type"]="application/json",V(r,i);let d=o&&o.headers?o.headers:{};return l.headers={...c,...d,...s.headers},l.data=y(e,l,n),{url:O(r),options:l}}}},T=function(n){const t=f(n);return{async getTagsInCollection(e,s){const a=await t.getTagsInCollection(e,s),r=n?.serverIndex??0,o=u["TagApi.getTagsInCollection"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async removeTagsFromCollection(e,s,a){const r=await t.removeTagsFromCollection(e,s,a),o=n?.serverIndex??0,l=u["TagApi.removeTagsFromCollection"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)},async renameOrMergeTags(e,s,a){const r=await t.renameOrMergeTags(e,s,a),o=n?.serverIndex??0,l=u["TagApi.renameOrMergeTags"]?.[o]?.url;return(c,i)=>v(r,h,p,n)(c,l||i)}}},Re=function(n,t,e){const s=T(n);return{getTagsInCollection(a,r){return s.getTagsInCollection(a,r).then(o=>o(e,t))},removeTagsFromCollection(a,r,o){return s.removeTagsFromCollection(a,r,o).then(l=>l(e,t))},renameOrMergeTags(a,r,o){return s.renameOrMergeTags(a,r,o).then(l=>l(e,t))}}};class ee extends S{getTagsInCollection(t,e){return T(this.configuration).getTagsInCollection(t,e).then(s=>s(this.axios,this.basePath))}removeTagsFromCollection(t,e,s){return T(this.configuration).removeTagsFromCollection(t,e,s).then(a=>a(this.axios,this.basePath))}renameOrMergeTags(t,e,s){return T(this.configuration).renameOrMergeTags(t,e,s).then(a=>a(this.axios,this.basePath))}}const re=function(n){return{connectSocialNetworkProvider:async(t,e={})=>{P("connectSocialNetworkProvider","provider",t);const s="/rest/v1/user/connect/{provider}".replace("{provider}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},disconnectSocialNetworkProvider:async(t,e={})=>{P("disconnectSocialNetworkProvider","provider",t);const s="/rest/v1/user/connect/{provider}/revoke".replace("{provider}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getCurrentUser:async(t={})=>{const e="/rest/v1/user",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},getPublicUserByName:async(t,e={})=>{P("getPublicUserByName","name",t);const s="/rest/v1/user/{name}".replace("{name}",encodeURIComponent(String(t))),a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"GET",...r,...e},l={},c={};await C(l,n),V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},{url:O(a),options:o}},getSystemCollectionStats:async(t={})=>{const e="/rest/v1/user/stats",s=new URL(e,m);let a;n&&(a=n.baseOptions);const r={method:"GET",...a,...t},o={},l={};await C(o,n),V(s,l);let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...t.headers},{url:O(s),options:r}},updateCurrentUser:async(t,e={})=>{const s="/rest/v1/user",a=new URL(s,m);let r;n&&(r=n.baseOptions);const o={method:"PUT",...r,...e},l={},c={};await C(l,n),l["Content-Type"]="application/json",V(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...l,...i,...e.headers},o.data=y(t,o,n),{url:O(a),options:o}}}},w=function(n){const t=re(n);return{async connectSocialNetworkProvider(e,s){const a=await t.connectSocialNetworkProvider(e,s),r=n?.serverIndex??0,o=u["UserApi.connectSocialNetworkProvider"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async disconnectSocialNetworkProvider(e,s){const a=await t.disconnectSocialNetworkProvider(e,s),r=n?.serverIndex??0,o=u["UserApi.disconnectSocialNetworkProvider"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getCurrentUser(e){const s=await t.getCurrentUser(e),a=n?.serverIndex??0,r=u["UserApi.getCurrentUser"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async getPublicUserByName(e,s){const a=await t.getPublicUserByName(e,s),r=n?.serverIndex??0,o=u["UserApi.getPublicUserByName"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)},async getSystemCollectionStats(e){const s=await t.getSystemCollectionStats(e),a=n?.serverIndex??0,r=u["UserApi.getSystemCollectionStats"]?.[a]?.url;return(o,l)=>v(s,h,p,n)(o,r||l)},async updateCurrentUser(e,s){const a=await t.updateCurrentUser(e,s),r=n?.serverIndex??0,o=u["UserApi.updateCurrentUser"]?.[r]?.url;return(l,c)=>v(a,h,p,n)(l,o||c)}}},Ae=function(n,t,e){const s=w(n);return{connectSocialNetworkProvider(a,r){return s.connectSocialNetworkProvider(a,r).then(o=>o(e,t))},disconnectSocialNetworkProvider(a,r){return s.disconnectSocialNetworkProvider(a,r).then(o=>o(e,t))},getCurrentUser(a){return s.getCurrentUser(a).then(r=>r(e,t))},getPublicUserByName(a,r){return s.getPublicUserByName(a,r).then(o=>o(e,t))},getSystemCollectionStats(a){return s.getSystemCollectionStats(a).then(r=>r(e,t))},updateCurrentUser(a,r){return s.updateCurrentUser(a,r).then(o=>o(e,t))}}};class te extends S{connectSocialNetworkProvider(t,e){return w(this.configuration).connectSocialNetworkProvider(t,e).then(s=>s(this.axios,this.basePath))}disconnectSocialNetworkProvider(t,e){return w(this.configuration).disconnectSocialNetworkProvider(t,e).then(s=>s(this.axios,this.basePath))}getCurrentUser(t){return w(this.configuration).getCurrentUser(t).then(e=>e(this.axios,this.basePath))}getPublicUserByName(t,e){return w(this.configuration).getPublicUserByName(t,e).then(s=>s(this.axios,this.basePath))}getSystemCollectionStats(t){return w(this.configuration).getSystemCollectionStats(t).then(e=>e(this.axios,this.basePath))}updateCurrentUser(t,e){return w(this.configuration).updateCurrentUser(t,e).then(s=>s(this.axios,this.basePath))}}const ye={Facebook:"facebook",Google:"google",Twitter:"twitter",Vkontate:"vkontate",Dropbox:"dropbox",Gdrive:"gdrive"},be={Facebook:"facebook",Google:"google",Twitter:"twitter",Vkontate:"vkontate",Dropbox:"dropbox",Gdrive:"gdrive"};class ae{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(e.test(t)||t.toLowerCase()==="application/json-patch+json")}}const xe=Object.freeze(Object.defineProperty({__proto__:null,AuthenticationApi:_,AuthenticationApiAxiosParamCreator:$,AuthenticationApiFactory:ue,AuthenticationApiFp:B,CollectionApi:G,CollectionApiAxiosParamCreator:M,CollectionApiFactory:me,CollectionApiFp:A,CollectionRefRefEnum:de,Configuration:ae,ConnectSocialNetworkProviderProviderEnum:ye,DisconnectSocialNetworkProviderProviderEnum:be,FilterApi:z,FilterApiAxiosParamCreator:D,FilterApiFactory:Ve,FilterApiFp:j,GetFiltersTagsSortEnum:Oe,HighlightApi:K,HighlightApiAxiosParamCreator:J,HighlightApiFactory:ve,HighlightApiFp:g,ImportApi:W,ImportApiAxiosParamCreator:Y,ImportApiFactory:Ce,ImportApiFp:I,ObtainTokenGrantTypeEnum:Q,RaindropApi:Z,RaindropApiAxiosParamCreator:X,RaindropApiFactory:Pe,RaindropApiFp:b,RefreshTokenGrantTypeEnum:N,Role:he,TagApi:ee,TagApiAxiosParamCreator:f,TagApiFactory:Re,TagApiFp:T,TokenResponseTokenTypeEnum:pe,UserApi:te,UserApiAxiosParamCreator:re,UserApiFactory:Ae,UserApiFp:w},Symbol.toStringTag,{value:"Module"}));class we extends _{async exchangeToken(t,e){return this.getOrRefreshToken({...t,grant_type:Q.AuthorizationCode},e).then(s=>{if(q(s.data))throw new Error(`Request failed with error: ${s.data.errorMessage}`);return s})}async refreshToken(t,e){return this.getOrRefreshToken({...t,grant_type:N.RefreshToken},e).then(s=>{if(q(s.data))throw new Error(`Request failed with error: ${s.data.errorMessage}`);return s})}}function q(n){return"result"in n&&n.result===!1}class k{_data;_parent=null;_children=[];constructor(t,e){this._data=t,e&&this.addChildren(...e)}get data(){return this._data}get parent(){return this._parent}set parent(t){this._parent=t,t._children.push(this)}isRoot(){return this._parent===null}get children(){return this._children}addChildren(...t){this._children.push(...t);for(const e of t)e._parent=this}traverse(t){t(this);for(const e of this.children)e.traverse(t)}}function oe(n,t,e){const s=e.filter(a=>a.parent===t);for(const a of s){const r=a.toNode();oe(r,a.id,e),n.addChildren(r)}}function se(n,t){const e=new k(n);return oe(e,null,t),e}const Se=Object.freeze(Object.defineProperty({__proto__:null,TreeNode:k,makeTree:se},Symbol.toStringTag,{value:"Module"}));class ge extends G{async getCollectionTree(){const[{data:t},{data:e}]=await Promise.all([this.getRootCollections(),this.getChildCollections()]),s=t.items.map(c=>({data:c,id:c._id.toString(),parent:null,toNode(){return new k(this.data)}})),a=e.items.map(c=>({data:c,id:c._id.toString(),parent:c.parent?.$id.toString()||null,toNode(){return new k(this.data)}})),r=s.concat(a);r.sort((c,i)=>c.data.title.localeCompare(i.data.title)||c.data._id-i.data._id);const o=r.filter((c,i,d)=>d.findIndex(R=>R.id===c.id)===i);return se(null,o)}}class Ue extends Z{async getAllRaindrops(t,e,s){const a=t??0,r=e?.sort??"",o=e?.pageSize??50,l=e?.search??"",{data:c}=await this.getRaindrops(a,r,o,0,l,s),i=c.count,d=Math.ceil(i/o),R=Array.from(Array(d).keys());R.shift();const x=await Promise.all(R.map(L=>this.getRaindrops(a,r,o,L,l,s).then(({data:le})=>le))),F=[...c.items];for(const L of x)F.push(...L.items);return F}}class ne{client;configuration;auth;user;collection;filter;highlight;import;raindrop;tag;constructor(t,e){this.client=e??h,this.configuration=t??new ae,this.auth=new we(t,void 0,this.client),this.collection=new ge(t,void 0,this.client),this.filter=new z(t,void 0,this.client),this.highlight=new K(t,void 0,this.client),this.import=new W(t,void 0,this.client),this.raindrop=new Ue(t,void 0,this.client),this.tag=new ee(t,void 0,this.client),this.user=new te(t,void 0,this.client)}}const Ie=Object.freeze(Object.defineProperty({__proto__:null,Raindrop:ne},Symbol.toStringTag,{value:"Module"})),Te=Object.freeze(Object.defineProperty({__proto__:null,tree:Se},Symbol.toStringTag,{value:"Module"})),Fe=ne;exports.client=Ie;exports.default=Fe;exports.generated=xe;exports.utils=Te;
|
package/dist/index.es.js
CHANGED
|
@@ -218,8 +218,8 @@ const M = function(n) {
|
|
|
218
218
|
n && (l = n.baseOptions);
|
|
219
219
|
const c = { method: "PUT", ...l, ...a }, i = {}, d = {};
|
|
220
220
|
await C(i, n), i["Content-Type"] = "application/json", V(o, d);
|
|
221
|
-
let
|
|
222
|
-
return c.headers = { ...i, ...
|
|
221
|
+
let R = l && l.headers ? l.headers : {};
|
|
222
|
+
return c.headers = { ...i, ...R, ...a.headers }, c.data = y(s, c, n), {
|
|
223
223
|
url: O(o),
|
|
224
224
|
options: c
|
|
225
225
|
};
|
|
@@ -567,14 +567,14 @@ const M = function(n) {
|
|
|
567
567
|
n && (o = n.baseOptions);
|
|
568
568
|
const l = { method: "PUT", ...o, ...s }, c = {}, i = {}, d = new (n && n.formDataCtor || FormData)();
|
|
569
569
|
await C(c, n), e !== void 0 && d.append("cover", e), c["Content-Type"] = "multipart/form-data", V(r, i);
|
|
570
|
-
let
|
|
571
|
-
return l.headers = { ...c, ...
|
|
570
|
+
let R = o && o.headers ? o.headers : {};
|
|
571
|
+
return l.headers = { ...c, ...R, ...s.headers }, l.data = d, {
|
|
572
572
|
url: O(r),
|
|
573
573
|
options: l
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
},
|
|
577
|
+
}, A = function(n) {
|
|
578
578
|
const t = M(n);
|
|
579
579
|
return {
|
|
580
580
|
/**
|
|
@@ -789,7 +789,7 @@ const M = function(n) {
|
|
|
789
789
|
}
|
|
790
790
|
};
|
|
791
791
|
}, me = function(n, t, e) {
|
|
792
|
-
const s =
|
|
792
|
+
const s = A(n);
|
|
793
793
|
return {
|
|
794
794
|
/**
|
|
795
795
|
*
|
|
@@ -991,7 +991,7 @@ let G = class extends S {
|
|
|
991
991
|
* @memberof CollectionApi
|
|
992
992
|
*/
|
|
993
993
|
acceptInvitation(t, e) {
|
|
994
|
-
return
|
|
994
|
+
return A(this.configuration).acceptInvitation(t, e).then((s) => s(this.axios, this.basePath));
|
|
995
995
|
}
|
|
996
996
|
/**
|
|
997
997
|
*
|
|
@@ -1003,7 +1003,7 @@ let G = class extends S {
|
|
|
1003
1003
|
* @memberof CollectionApi
|
|
1004
1004
|
*/
|
|
1005
1005
|
changeCollaboratorAccessLevel(t, e, s, a) {
|
|
1006
|
-
return
|
|
1006
|
+
return A(this.configuration).changeCollaboratorAccessLevel(t, e, s, a).then((r) => r(this.axios, this.basePath));
|
|
1007
1007
|
}
|
|
1008
1008
|
/**
|
|
1009
1009
|
*
|
|
@@ -1013,7 +1013,7 @@ let G = class extends S {
|
|
|
1013
1013
|
* @memberof CollectionApi
|
|
1014
1014
|
*/
|
|
1015
1015
|
createCollection(t, e) {
|
|
1016
|
-
return
|
|
1016
|
+
return A(this.configuration).createCollection(t, e).then((s) => s(this.axios, this.basePath));
|
|
1017
1017
|
}
|
|
1018
1018
|
/**
|
|
1019
1019
|
*
|
|
@@ -1024,7 +1024,7 @@ let G = class extends S {
|
|
|
1024
1024
|
* @memberof CollectionApi
|
|
1025
1025
|
*/
|
|
1026
1026
|
deleteCollaborator(t, e, s) {
|
|
1027
|
-
return
|
|
1027
|
+
return A(this.configuration).deleteCollaborator(t, e, s).then((a) => a(this.axios, this.basePath));
|
|
1028
1028
|
}
|
|
1029
1029
|
/**
|
|
1030
1030
|
*
|
|
@@ -1033,7 +1033,7 @@ let G = class extends S {
|
|
|
1033
1033
|
* @memberof CollectionApi
|
|
1034
1034
|
*/
|
|
1035
1035
|
emptyTrash(t) {
|
|
1036
|
-
return
|
|
1036
|
+
return A(this.configuration).emptyTrash(t).then((e) => e(this.axios, this.basePath));
|
|
1037
1037
|
}
|
|
1038
1038
|
/**
|
|
1039
1039
|
*
|
|
@@ -1042,7 +1042,7 @@ let G = class extends S {
|
|
|
1042
1042
|
* @memberof CollectionApi
|
|
1043
1043
|
*/
|
|
1044
1044
|
getChildCollections(t) {
|
|
1045
|
-
return
|
|
1045
|
+
return A(this.configuration).getChildCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1046
1046
|
}
|
|
1047
1047
|
/**
|
|
1048
1048
|
*
|
|
@@ -1052,7 +1052,7 @@ let G = class extends S {
|
|
|
1052
1052
|
* @memberof CollectionApi
|
|
1053
1053
|
*/
|
|
1054
1054
|
getCollaborators(t, e) {
|
|
1055
|
-
return
|
|
1055
|
+
return A(this.configuration).getCollaborators(t, e).then((s) => s(this.axios, this.basePath));
|
|
1056
1056
|
}
|
|
1057
1057
|
/**
|
|
1058
1058
|
*
|
|
@@ -1062,7 +1062,7 @@ let G = class extends S {
|
|
|
1062
1062
|
* @memberof CollectionApi
|
|
1063
1063
|
*/
|
|
1064
1064
|
getCollection(t, e) {
|
|
1065
|
-
return
|
|
1065
|
+
return A(this.configuration).getCollection(t, e).then((s) => s(this.axios, this.basePath));
|
|
1066
1066
|
}
|
|
1067
1067
|
/**
|
|
1068
1068
|
*
|
|
@@ -1071,7 +1071,7 @@ let G = class extends S {
|
|
|
1071
1071
|
* @memberof CollectionApi
|
|
1072
1072
|
*/
|
|
1073
1073
|
getFeaturedCovers(t) {
|
|
1074
|
-
return
|
|
1074
|
+
return A(this.configuration).getFeaturedCovers(t).then((e) => e(this.axios, this.basePath));
|
|
1075
1075
|
}
|
|
1076
1076
|
/**
|
|
1077
1077
|
*
|
|
@@ -1080,7 +1080,7 @@ let G = class extends S {
|
|
|
1080
1080
|
* @memberof CollectionApi
|
|
1081
1081
|
*/
|
|
1082
1082
|
getRootCollections(t) {
|
|
1083
|
-
return
|
|
1083
|
+
return A(this.configuration).getRootCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1084
1084
|
}
|
|
1085
1085
|
/**
|
|
1086
1086
|
*
|
|
@@ -1089,7 +1089,7 @@ let G = class extends S {
|
|
|
1089
1089
|
* @memberof CollectionApi
|
|
1090
1090
|
*/
|
|
1091
1091
|
getSystemCollectionStats(t) {
|
|
1092
|
-
return
|
|
1092
|
+
return A(this.configuration).getSystemCollectionStats(t).then((e) => e(this.axios, this.basePath));
|
|
1093
1093
|
}
|
|
1094
1094
|
/**
|
|
1095
1095
|
*
|
|
@@ -1099,7 +1099,7 @@ let G = class extends S {
|
|
|
1099
1099
|
* @memberof CollectionApi
|
|
1100
1100
|
*/
|
|
1101
1101
|
mergeCollections(t, e) {
|
|
1102
|
-
return
|
|
1102
|
+
return A(this.configuration).mergeCollections(t, e).then((s) => s(this.axios, this.basePath));
|
|
1103
1103
|
}
|
|
1104
1104
|
/**
|
|
1105
1105
|
*
|
|
@@ -1108,7 +1108,7 @@ let G = class extends S {
|
|
|
1108
1108
|
* @memberof CollectionApi
|
|
1109
1109
|
*/
|
|
1110
1110
|
removeAllEmptyCollections(t) {
|
|
1111
|
-
return
|
|
1111
|
+
return A(this.configuration).removeAllEmptyCollections(t).then((e) => e(this.axios, this.basePath));
|
|
1112
1112
|
}
|
|
1113
1113
|
/**
|
|
1114
1114
|
*
|
|
@@ -1118,7 +1118,7 @@ let G = class extends S {
|
|
|
1118
1118
|
* @memberof CollectionApi
|
|
1119
1119
|
*/
|
|
1120
1120
|
removeCollection(t, e) {
|
|
1121
|
-
return
|
|
1121
|
+
return A(this.configuration).removeCollection(t, e).then((s) => s(this.axios, this.basePath));
|
|
1122
1122
|
}
|
|
1123
1123
|
/**
|
|
1124
1124
|
*
|
|
@@ -1128,7 +1128,7 @@ let G = class extends S {
|
|
|
1128
1128
|
* @memberof CollectionApi
|
|
1129
1129
|
*/
|
|
1130
1130
|
removeCollections(t, e) {
|
|
1131
|
-
return
|
|
1131
|
+
return A(this.configuration).removeCollections(t, e).then((s) => s(this.axios, this.basePath));
|
|
1132
1132
|
}
|
|
1133
1133
|
/**
|
|
1134
1134
|
*
|
|
@@ -1138,7 +1138,7 @@ let G = class extends S {
|
|
|
1138
1138
|
* @memberof CollectionApi
|
|
1139
1139
|
*/
|
|
1140
1140
|
reorderAllCollections(t, e) {
|
|
1141
|
-
return
|
|
1141
|
+
return A(this.configuration).reorderAllCollections(t, e).then((s) => s(this.axios, this.basePath));
|
|
1142
1142
|
}
|
|
1143
1143
|
/**
|
|
1144
1144
|
*
|
|
@@ -1148,7 +1148,7 @@ let G = class extends S {
|
|
|
1148
1148
|
* @memberof CollectionApi
|
|
1149
1149
|
*/
|
|
1150
1150
|
searchCovers(t, e) {
|
|
1151
|
-
return
|
|
1151
|
+
return A(this.configuration).searchCovers(t, e).then((s) => s(this.axios, this.basePath));
|
|
1152
1152
|
}
|
|
1153
1153
|
/**
|
|
1154
1154
|
*
|
|
@@ -1159,7 +1159,7 @@ let G = class extends S {
|
|
|
1159
1159
|
* @memberof CollectionApi
|
|
1160
1160
|
*/
|
|
1161
1161
|
shareCollection(t, e, s) {
|
|
1162
|
-
return
|
|
1162
|
+
return A(this.configuration).shareCollection(t, e, s).then((a) => a(this.axios, this.basePath));
|
|
1163
1163
|
}
|
|
1164
1164
|
/**
|
|
1165
1165
|
*
|
|
@@ -1169,7 +1169,7 @@ let G = class extends S {
|
|
|
1169
1169
|
* @memberof CollectionApi
|
|
1170
1170
|
*/
|
|
1171
1171
|
unshareOrLeaveCollection(t, e) {
|
|
1172
|
-
return
|
|
1172
|
+
return A(this.configuration).unshareOrLeaveCollection(t, e).then((s) => s(this.axios, this.basePath));
|
|
1173
1173
|
}
|
|
1174
1174
|
/**
|
|
1175
1175
|
*
|
|
@@ -1180,7 +1180,7 @@ let G = class extends S {
|
|
|
1180
1180
|
* @memberof CollectionApi
|
|
1181
1181
|
*/
|
|
1182
1182
|
updateCollection(t, e, s) {
|
|
1183
|
-
return
|
|
1183
|
+
return A(this.configuration).updateCollection(t, e, s).then((a) => a(this.axios, this.basePath));
|
|
1184
1184
|
}
|
|
1185
1185
|
/**
|
|
1186
1186
|
*
|
|
@@ -1191,10 +1191,10 @@ let G = class extends S {
|
|
|
1191
1191
|
* @memberof CollectionApi
|
|
1192
1192
|
*/
|
|
1193
1193
|
uploadCollectionCover(t, e, s) {
|
|
1194
|
-
return
|
|
1194
|
+
return A(this.configuration).uploadCollectionCover(t, e, s).then((a) => a(this.axios, this.basePath));
|
|
1195
1195
|
}
|
|
1196
1196
|
};
|
|
1197
|
-
const
|
|
1197
|
+
const D = function(n) {
|
|
1198
1198
|
return {
|
|
1199
1199
|
/**
|
|
1200
1200
|
*
|
|
@@ -1211,15 +1211,15 @@ const z = function(n) {
|
|
|
1211
1211
|
n && (l = n.baseOptions);
|
|
1212
1212
|
const c = { method: "GET", ...l, ...a }, i = {}, d = {};
|
|
1213
1213
|
await C(i, n), e !== void 0 && (d.tagsSort = e), s !== void 0 && (d.search = s), V(o, d);
|
|
1214
|
-
let
|
|
1215
|
-
return c.headers = { ...i, ...
|
|
1214
|
+
let R = l && l.headers ? l.headers : {};
|
|
1215
|
+
return c.headers = { ...i, ...R, ...a.headers }, {
|
|
1216
1216
|
url: O(o),
|
|
1217
1217
|
options: c
|
|
1218
1218
|
};
|
|
1219
1219
|
}
|
|
1220
1220
|
};
|
|
1221
1221
|
}, j = function(n) {
|
|
1222
|
-
const t =
|
|
1222
|
+
const t = D(n);
|
|
1223
1223
|
return {
|
|
1224
1224
|
/**
|
|
1225
1225
|
*
|
|
@@ -1250,7 +1250,7 @@ const z = function(n) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
1252
|
};
|
|
1253
|
-
class
|
|
1253
|
+
class z extends S {
|
|
1254
1254
|
/**
|
|
1255
1255
|
*
|
|
1256
1256
|
* @param {number} collectionId
|
|
@@ -1303,8 +1303,8 @@ const Oe = {
|
|
|
1303
1303
|
n && (l = n.baseOptions);
|
|
1304
1304
|
const c = { method: "GET", ...l, ...a }, i = {}, d = {};
|
|
1305
1305
|
await C(i, n), e !== void 0 && (d.page = e), s !== void 0 && (d.perpage = s), V(o, d);
|
|
1306
|
-
let
|
|
1307
|
-
return c.headers = { ...i, ...
|
|
1306
|
+
let R = l && l.headers ? l.headers : {};
|
|
1307
|
+
return c.headers = { ...i, ...R, ...a.headers }, {
|
|
1308
1308
|
url: O(o),
|
|
1309
1309
|
options: c
|
|
1310
1310
|
};
|
|
@@ -1734,10 +1734,10 @@ const X = function(n) {
|
|
|
1734
1734
|
const l = "/rest/v1/raindrops/{collectionId}".replace("{collectionId}", encodeURIComponent(String(t))), c = new URL(l, m);
|
|
1735
1735
|
let i;
|
|
1736
1736
|
n && (i = n.baseOptions);
|
|
1737
|
-
const d = { method: "GET", ...i, ...o },
|
|
1738
|
-
await C(
|
|
1737
|
+
const d = { method: "GET", ...i, ...o }, R = {}, x = {};
|
|
1738
|
+
await C(R, n), e !== void 0 && (x.sort = e), s !== void 0 && (x.perpage = s), a !== void 0 && (x.page = a), r !== void 0 && (x.search = r), V(c, x);
|
|
1739
1739
|
let F = i && i.headers ? i.headers : {};
|
|
1740
|
-
return d.headers = { ...
|
|
1740
|
+
return d.headers = { ...R, ...F, ...o.headers }, {
|
|
1741
1741
|
url: O(c),
|
|
1742
1742
|
options: d
|
|
1743
1743
|
};
|
|
@@ -1776,8 +1776,8 @@ const X = function(n) {
|
|
|
1776
1776
|
n && (l = n.baseOptions);
|
|
1777
1777
|
const c = { method: "DELETE", ...l, ...a }, i = {}, d = {};
|
|
1778
1778
|
await C(i, n), e !== void 0 && (d.search = e), i["Content-Type"] = "application/json", V(o, d);
|
|
1779
|
-
let
|
|
1780
|
-
return c.headers = { ...i, ...
|
|
1779
|
+
let R = l && l.headers ? l.headers : {};
|
|
1780
|
+
return c.headers = { ...i, ...R, ...a.headers }, c.data = y(s, c, n), {
|
|
1781
1781
|
url: O(o),
|
|
1782
1782
|
options: c
|
|
1783
1783
|
};
|
|
@@ -1872,8 +1872,8 @@ const X = function(n) {
|
|
|
1872
1872
|
n && (o = n.baseOptions);
|
|
1873
1873
|
const l = { method: "PUT", ...o, ...s }, c = {}, i = {}, d = new (n && n.formDataCtor || FormData)();
|
|
1874
1874
|
await C(c, n), t !== void 0 && d.append("file", t), e !== void 0 && d.append("collectionId", e), c["Content-Type"] = "multipart/form-data", V(r, i);
|
|
1875
|
-
let
|
|
1876
|
-
return l.headers = { ...c, ...
|
|
1875
|
+
let R = o && o.headers ? o.headers : {};
|
|
1876
|
+
return l.headers = { ...c, ...R, ...s.headers }, l.data = d, {
|
|
1877
1877
|
url: O(r),
|
|
1878
1878
|
options: l
|
|
1879
1879
|
};
|
|
@@ -1892,8 +1892,8 @@ const X = function(n) {
|
|
|
1892
1892
|
n && (o = n.baseOptions);
|
|
1893
1893
|
const l = { method: "PUT", ...o, ...s }, c = {}, i = {}, d = new (n && n.formDataCtor || FormData)();
|
|
1894
1894
|
await C(c, n), e !== void 0 && d.append("cover", e), c["Content-Type"] = "multipart/form-data", V(r, i);
|
|
1895
|
-
let
|
|
1896
|
-
return l.headers = { ...c, ...
|
|
1895
|
+
let R = o && o.headers ? o.headers : {};
|
|
1896
|
+
return l.headers = { ...c, ...R, ...s.headers }, l.data = d, {
|
|
1897
1897
|
url: O(r),
|
|
1898
1898
|
options: l
|
|
1899
1899
|
};
|
|
@@ -1954,7 +1954,7 @@ const X = function(n) {
|
|
|
1954
1954
|
*/
|
|
1955
1955
|
async getRaindrops(e, s, a, r, o, l) {
|
|
1956
1956
|
const c = await t.getRaindrops(e, s, a, r, o, l), i = n?.serverIndex ?? 0, d = u["RaindropApi.getRaindrops"]?.[i]?.url;
|
|
1957
|
-
return (
|
|
1957
|
+
return (R, x) => v(c, h, p, n)(R, d || x);
|
|
1958
1958
|
},
|
|
1959
1959
|
/**
|
|
1960
1960
|
*
|
|
@@ -2870,13 +2870,13 @@ const Be = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2870
2870
|
CollectionApi: G,
|
|
2871
2871
|
CollectionApiAxiosParamCreator: M,
|
|
2872
2872
|
CollectionApiFactory: me,
|
|
2873
|
-
CollectionApiFp:
|
|
2873
|
+
CollectionApiFp: A,
|
|
2874
2874
|
CollectionRefRefEnum: de,
|
|
2875
2875
|
Configuration: ae,
|
|
2876
2876
|
ConnectSocialNetworkProviderProviderEnum: ye,
|
|
2877
2877
|
DisconnectSocialNetworkProviderProviderEnum: be,
|
|
2878
|
-
FilterApi:
|
|
2879
|
-
FilterApiAxiosParamCreator:
|
|
2878
|
+
FilterApi: z,
|
|
2879
|
+
FilterApiAxiosParamCreator: D,
|
|
2880
2880
|
FilterApiFactory: Ve,
|
|
2881
2881
|
FilterApiFp: j,
|
|
2882
2882
|
GetFiltersTagsSortEnum: Oe,
|
|
@@ -3017,24 +3017,28 @@ class Se extends G {
|
|
|
3017
3017
|
const [{ data: t }, { data: e }] = await Promise.all([
|
|
3018
3018
|
this.getRootCollections(),
|
|
3019
3019
|
this.getChildCollections()
|
|
3020
|
-
]), s = t.items.map((
|
|
3021
|
-
data:
|
|
3022
|
-
id:
|
|
3020
|
+
]), s = t.items.map((c) => ({
|
|
3021
|
+
data: c,
|
|
3022
|
+
id: c._id.toString(),
|
|
3023
3023
|
parent: null,
|
|
3024
3024
|
toNode() {
|
|
3025
3025
|
return new k(this.data);
|
|
3026
3026
|
}
|
|
3027
|
-
})), a = e.items.map((
|
|
3028
|
-
data:
|
|
3029
|
-
id:
|
|
3030
|
-
parent:
|
|
3027
|
+
})), a = e.items.map((c) => ({
|
|
3028
|
+
data: c,
|
|
3029
|
+
id: c._id.toString(),
|
|
3030
|
+
parent: c.parent?.$id.toString() || null,
|
|
3031
3031
|
toNode() {
|
|
3032
3032
|
return new k(this.data);
|
|
3033
3033
|
}
|
|
3034
3034
|
})), r = s.concat(a);
|
|
3035
|
-
|
|
3036
|
-
(
|
|
3037
|
-
)
|
|
3035
|
+
r.sort(
|
|
3036
|
+
(c, i) => c.data.title.localeCompare(i.data.title) || c.data._id - i.data._id
|
|
3037
|
+
);
|
|
3038
|
+
const o = r.filter(
|
|
3039
|
+
(c, i, d) => d.findIndex((R) => R.id === c.id) === i
|
|
3040
|
+
);
|
|
3041
|
+
return se(null, o);
|
|
3038
3042
|
}
|
|
3039
3043
|
}
|
|
3040
3044
|
class ge extends Z {
|
|
@@ -3053,10 +3057,10 @@ class ge extends Z {
|
|
|
3053
3057
|
0,
|
|
3054
3058
|
l,
|
|
3055
3059
|
s
|
|
3056
|
-
), i = c.count, d = Math.ceil(i / o),
|
|
3057
|
-
|
|
3060
|
+
), i = c.count, d = Math.ceil(i / o), R = Array.from(Array(d).keys());
|
|
3061
|
+
R.shift();
|
|
3058
3062
|
const x = await Promise.all(
|
|
3059
|
-
|
|
3063
|
+
R.map(
|
|
3060
3064
|
(L) => this.getRaindrops(
|
|
3061
3065
|
a,
|
|
3062
3066
|
r,
|
|
@@ -3087,7 +3091,7 @@ class ne {
|
|
|
3087
3091
|
raindrop;
|
|
3088
3092
|
tag;
|
|
3089
3093
|
constructor(t, e) {
|
|
3090
|
-
this.client = e ?? h, this.configuration = t ?? new ae(), this.auth = new xe(t, void 0, this.client), this.collection = new Se(t, void 0, this.client), this.filter = new
|
|
3094
|
+
this.client = e ?? h, this.configuration = t ?? new ae(), this.auth = new xe(t, void 0, this.client), this.collection = new Se(t, void 0, this.client), this.filter = new z(t, void 0, this.client), this.highlight = new K(t, void 0, this.client), this.import = new W(t, void 0, this.client), this.raindrop = new ge(t, void 0, this.client), this.tag = new ee(t, void 0, this.client), this.user = new te(t, void 0, this.client);
|
|
3091
3095
|
}
|
|
3092
3096
|
}
|
|
3093
3097
|
const ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lasuillard/raindrop-client",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Axios client built with OpenAPI generator for Raindrop.io.",
|
|
5
5
|
"keywords": ["raindrop.io", "axios", "openapi"],
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,20 +42,20 @@
|
|
|
42
42
|
"@pollyjs/core": "^6.0.6",
|
|
43
43
|
"@pollyjs/persister-fs": "^6.0.6",
|
|
44
44
|
"@types/node": "^22.0.2",
|
|
45
|
-
"@vitest/coverage-v8": "^
|
|
46
|
-
"@vitest/ui": "^
|
|
45
|
+
"@vitest/coverage-v8": "^3.0.4",
|
|
46
|
+
"@vitest/ui": "^3.0.4",
|
|
47
47
|
"axios-mock-adapter": "^2.0.0",
|
|
48
48
|
"axios-rate-limit": "^1.4.0",
|
|
49
49
|
"dotenv": "^16.4.5",
|
|
50
50
|
"slugify": "^1.6.6",
|
|
51
51
|
"tslib": "^2.6.2",
|
|
52
|
-
"typedoc": "^0.
|
|
53
|
-
"typedoc-plugin-missing-exports": "^
|
|
52
|
+
"typedoc": "^0.28.1",
|
|
53
|
+
"typedoc-plugin-missing-exports": "^4.0.0",
|
|
54
54
|
"typescript": "^5.4.3",
|
|
55
|
-
"vite": "^
|
|
55
|
+
"vite": "^6.0.1",
|
|
56
56
|
"vite-plugin-dts": "^4.2.1",
|
|
57
57
|
"vite-tsconfig-paths": "^5.0.1",
|
|
58
|
-
"vitest": "^
|
|
58
|
+
"vitest": "^3.0.4"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"axios": "^1.6.8"
|