@lasuillard/raindrop-client
Version:
Axios client built with OpenAPI generator for Raindrop.io.
2 lines (1 loc) • 45.5 kB
JavaScript
"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;