@lasuillard/raindrop-client
Version:
Axios client built with OpenAPI generator for Raindrop.io.
1 lines • 45.6 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`axios`);l=c(l);var u=`https://api.raindrop.io`.replace(/\/+$/,``),d=class{basePath;axios;configuration;constructor(e,t=u,n=l.default){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath??t)}},f=class extends Error{field;constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}},p={},m=`https://example.com`,h=function(e,t,n){if(n==null)throw new f(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},g=async function(e,t){t&&t.accessToken&&(e.Authorization=`Bearer `+(typeof t.accessToken==`function`?await t.accessToken():await t.accessToken))};function _(e,t,n=``){t!=null&&(typeof t==`object`?Array.isArray(t)?t.forEach(t=>_(e,t,n)):Object.keys(t).forEach(r=>_(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}var v=function(e,...t){let n=new URLSearchParams(e.search);_(n,t),e.search=n.toString()},y=function(e,t,n){let r=typeof e!=`string`;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers[`Content-Type`]):r)?JSON.stringify(e===void 0?{}:b(e)):e||``};function b(e){if(typeof Set>`u`||typeof Map>`u`||typeof e!=`object`||!e)return e;if(e instanceof Set)return Array.from(e).map(e=>b(e));if(e instanceof Map){let t=[];return e.forEach((e,n)=>{t.push([n,b(e)])}),x(t)}return Array.isArray(e)?e.map(e=>b(e)):x(ee(e).map(([e,t])=>[e,b(t)]))}function ee(e){return Object.keys(e).map(t=>[t,e[t]])}function x(e){return[...e].reduce((e,[t,n])=>(e[t]=n,e),{})}var S=function(e){return e.pathname+e.search+e.hash},C=function(e,t,n,r){return(i=t,a=n)=>{let o={...e.options,url:(i.defaults.baseURL?``:r?.basePath??a)+e.url};return i.request(o)}},te={Collections:`collections`},w={AuthorizationCode:`authorization_code`},T={RefreshToken:`refresh_token`},ne={Member:`member`,Viewer:`viewer`},re={Bearer:`Bearer`},E=function(e){return{authorize:async(t,n,r={})=>{h(`authorize`,`redirectUri`,t),h(`authorize`,`clientId`,n);let i=new URL(`/v1/oauth/authorize`,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...r},s={},c={};t!==void 0&&(c.redirect_uri=t),n!==void 0&&(c.client_id=n),v(i,c);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...r.headers},{url:S(i),options:o}},getOrRefreshToken:async(t,n={})=>{let r=new URL(`/v1/oauth/access_token`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}}}},D=function(e){let t=E(e);return{async authorize(n,r,i){let a=await t.authorize(n,r,i),o=e?.serverIndex??0,s=p[`AuthenticationApi.authorize`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async getOrRefreshToken(n,r){let i=await t.getOrRefreshToken(n,r),a=e?.serverIndex??0,o=p[`AuthenticationApi.getOrRefreshToken`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)}}},ie=function(e,t,n){let r=D(e);return{authorize(e,i,a){return r.authorize(e,i,a).then(e=>e(n,t))},getOrRefreshToken(e,i){return r.getOrRefreshToken(e,i).then(e=>e(n,t))}}},O=class extends d{authorize(e,t,n){return D(this.configuration).authorize(e,t,n).then(e=>e(this.axios,this.basePath))}getOrRefreshToken(e,t){return D(this.configuration).getOrRefreshToken(e,t).then(e=>e(this.axios,this.basePath))}},k=function(e){return{acceptInvitation:async(t,n={})=>{h(`acceptInvitation`,`id`,t);let r=`/rest/v1/collection/{id}/join`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},changeCollaboratorAccessLevel:async(t,n,r,i={})=>{h(`changeCollaboratorAccessLevel`,`userId`,t),h(`changeCollaboratorAccessLevel`,`id`,n);let a=`/rest/v1/collection/{id}/sharing/{userId}`.replace(`{userId}`,encodeURIComponent(String(t))).replace(`{id}`,encodeURIComponent(String(n))),o=new URL(a,m),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l={};await g(l,e),l[`Content-Type`]=`application/json`,v(o,{});let u=s&&s.headers?s.headers:{};return c.headers={...l,...u,...i.headers},c.data=y(r,c,e),{url:S(o),options:c}},createCollection:async(t,n={})=>{let r=new URL(`/rest/v1/collection`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},deleteCollaborator:async(t,n,r={})=>{h(`deleteCollaborator`,`userId`,t),h(`deleteCollaborator`,`id`,n);let i=`/rest/v1/collection/{id}/sharing/{userId}`.replace(`{userId}`,encodeURIComponent(String(t))).replace(`{id}`,encodeURIComponent(String(n))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`DELETE`,...o,...r},c={};await g(c,e),v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},{url:S(a),options:s}},emptyTrash:async(t={})=>{let n=new URL(`/rest/v1/collection/-99`,m),r;e&&(r=e.baseOptions);let i={method:`DELETE`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},getChildCollections:async(t={})=>{let n=new URL(`/rest/v1/collections/childrens`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},getCollaborators:async(t,n={})=>{h(`getCollaborators`,`id`,t);let r=`/rest/v1/collection/{id}/sharing`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getCollection:async(t,n={})=>{h(`getCollection`,`id`,t);let r=`/rest/v1/collection/{id}`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getFeaturedCovers:async(t={})=>{let n=new URL(`/rest/v1/collections/covers`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},getRootCollections:async(t={})=>{let n=new URL(`/rest/v1/collections`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},getSystemCollectionStats:async(t={})=>{let n=new URL(`/rest/v1/user/stats`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},mergeCollections:async(t,n={})=>{let r=new URL(`/rest/v1/collections/merge`,m),i;e&&(i=e.baseOptions);let a={method:`PUT`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},removeAllEmptyCollections:async(t={})=>{let n=new URL(`/rest/v1/collections/clean`,m),r;e&&(r=e.baseOptions);let i={method:`PUT`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},removeCollection:async(t,n={})=>{h(`removeCollection`,`id`,t);let r=`/rest/v1/collection/{id}`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},removeCollections:async(t,n={})=>{let r=new URL(`/rest/v1/collections`,m),i;e&&(i=e.baseOptions);let a={method:`DELETE`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},reorderAllCollections:async(t,n={})=>{let r=new URL(`/rest/v1/collections`,m),i;e&&(i=e.baseOptions);let a={method:`PUT`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},searchCovers:async(t,n={})=>{h(`searchCovers`,`text`,t);let r=`/rest/v1/collections/covers/{text}`.replace(`{text}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},shareCollection:async(t,n,r={})=>{h(`shareCollection`,`id`,t);let i=`/rest/v1/collection/{id}/sharing`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`POST`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}},unshareOrLeaveCollection:async(t,n={})=>{h(`unshareOrLeaveCollection`,`id`,t);let r=`/rest/v1/collection/{id}/sharing`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},updateCollection:async(t,n,r={})=>{h(`updateCollection`,`id`,t);let i=`/rest/v1/collection/{id}`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}},uploadCollectionCover:async(t,n,r={})=>{h(`uploadCollectionCover`,`id`,t);let i=`/rest/v1/collection/{id}/cover`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={},l={},u=new(e&&e.formDataCtor||FormData);await g(c,e),n!==void 0&&u.append(`cover`,n),c[`Content-Type`]=`multipart/form-data`,v(a,l);let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},s.data=u,{url:S(a),options:s}}}},A=function(e){let t=k(e);return{async acceptInvitation(n,r){let i=await t.acceptInvitation(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.acceptInvitation`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async changeCollaboratorAccessLevel(n,r,i,a){let o=await t.changeCollaboratorAccessLevel(n,r,i,a),s=e?.serverIndex??0,c=p[`CollectionApi.changeCollaboratorAccessLevel`]?.[s]?.url;return(t,n)=>C(o,l.default,u,e)(t,c||n)},async createCollection(n,r){let i=await t.createCollection(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.createCollection`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async deleteCollaborator(n,r,i){let a=await t.deleteCollaborator(n,r,i),o=e?.serverIndex??0,s=p[`CollectionApi.deleteCollaborator`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async emptyTrash(n){let r=await t.emptyTrash(n),i=e?.serverIndex??0,a=p[`CollectionApi.emptyTrash`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async getChildCollections(n){let r=await t.getChildCollections(n),i=e?.serverIndex??0,a=p[`CollectionApi.getChildCollections`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async getCollaborators(n,r){let i=await t.getCollaborators(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.getCollaborators`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getCollection(n,r){let i=await t.getCollection(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.getCollection`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getFeaturedCovers(n){let r=await t.getFeaturedCovers(n),i=e?.serverIndex??0,a=p[`CollectionApi.getFeaturedCovers`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async getRootCollections(n){let r=await t.getRootCollections(n),i=e?.serverIndex??0,a=p[`CollectionApi.getRootCollections`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async getSystemCollectionStats(n){let r=await t.getSystemCollectionStats(n),i=e?.serverIndex??0,a=p[`CollectionApi.getSystemCollectionStats`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async mergeCollections(n,r){let i=await t.mergeCollections(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.mergeCollections`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async removeAllEmptyCollections(n){let r=await t.removeAllEmptyCollections(n),i=e?.serverIndex??0,a=p[`CollectionApi.removeAllEmptyCollections`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async removeCollection(n,r){let i=await t.removeCollection(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.removeCollection`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async removeCollections(n,r){let i=await t.removeCollections(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.removeCollections`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async reorderAllCollections(n,r){let i=await t.reorderAllCollections(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.reorderAllCollections`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async searchCovers(n,r){let i=await t.searchCovers(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.searchCovers`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async shareCollection(n,r,i){let a=await t.shareCollection(n,r,i),o=e?.serverIndex??0,s=p[`CollectionApi.shareCollection`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async unshareOrLeaveCollection(n,r){let i=await t.unshareOrLeaveCollection(n,r),a=e?.serverIndex??0,o=p[`CollectionApi.unshareOrLeaveCollection`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async updateCollection(n,r,i){let a=await t.updateCollection(n,r,i),o=e?.serverIndex??0,s=p[`CollectionApi.updateCollection`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async uploadCollectionCover(n,r,i){let a=await t.uploadCollectionCover(n,r,i),o=e?.serverIndex??0,s=p[`CollectionApi.uploadCollectionCover`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)}}},ae=function(e,t,n){let r=A(e);return{acceptInvitation(e,i){return r.acceptInvitation(e,i).then(e=>e(n,t))},changeCollaboratorAccessLevel(e,i,a,o){return r.changeCollaboratorAccessLevel(e,i,a,o).then(e=>e(n,t))},createCollection(e,i){return r.createCollection(e,i).then(e=>e(n,t))},deleteCollaborator(e,i,a){return r.deleteCollaborator(e,i,a).then(e=>e(n,t))},emptyTrash(e){return r.emptyTrash(e).then(e=>e(n,t))},getChildCollections(e){return r.getChildCollections(e).then(e=>e(n,t))},getCollaborators(e,i){return r.getCollaborators(e,i).then(e=>e(n,t))},getCollection(e,i){return r.getCollection(e,i).then(e=>e(n,t))},getFeaturedCovers(e){return r.getFeaturedCovers(e).then(e=>e(n,t))},getRootCollections(e){return r.getRootCollections(e).then(e=>e(n,t))},getSystemCollectionStats(e){return r.getSystemCollectionStats(e).then(e=>e(n,t))},mergeCollections(e,i){return r.mergeCollections(e,i).then(e=>e(n,t))},removeAllEmptyCollections(e){return r.removeAllEmptyCollections(e).then(e=>e(n,t))},removeCollection(e,i){return r.removeCollection(e,i).then(e=>e(n,t))},removeCollections(e,i){return r.removeCollections(e,i).then(e=>e(n,t))},reorderAllCollections(e,i){return r.reorderAllCollections(e,i).then(e=>e(n,t))},searchCovers(e,i){return r.searchCovers(e,i).then(e=>e(n,t))},shareCollection(e,i,a){return r.shareCollection(e,i,a).then(e=>e(n,t))},unshareOrLeaveCollection(e,i){return r.unshareOrLeaveCollection(e,i).then(e=>e(n,t))},updateCollection(e,i,a){return r.updateCollection(e,i,a).then(e=>e(n,t))},uploadCollectionCover(e,i,a){return r.uploadCollectionCover(e,i,a).then(e=>e(n,t))}}},j=class extends d{acceptInvitation(e,t){return A(this.configuration).acceptInvitation(e,t).then(e=>e(this.axios,this.basePath))}changeCollaboratorAccessLevel(e,t,n,r){return A(this.configuration).changeCollaboratorAccessLevel(e,t,n,r).then(e=>e(this.axios,this.basePath))}createCollection(e,t){return A(this.configuration).createCollection(e,t).then(e=>e(this.axios,this.basePath))}deleteCollaborator(e,t,n){return A(this.configuration).deleteCollaborator(e,t,n).then(e=>e(this.axios,this.basePath))}emptyTrash(e){return A(this.configuration).emptyTrash(e).then(e=>e(this.axios,this.basePath))}getChildCollections(e){return A(this.configuration).getChildCollections(e).then(e=>e(this.axios,this.basePath))}getCollaborators(e,t){return A(this.configuration).getCollaborators(e,t).then(e=>e(this.axios,this.basePath))}getCollection(e,t){return A(this.configuration).getCollection(e,t).then(e=>e(this.axios,this.basePath))}getFeaturedCovers(e){return A(this.configuration).getFeaturedCovers(e).then(e=>e(this.axios,this.basePath))}getRootCollections(e){return A(this.configuration).getRootCollections(e).then(e=>e(this.axios,this.basePath))}getSystemCollectionStats(e){return A(this.configuration).getSystemCollectionStats(e).then(e=>e(this.axios,this.basePath))}mergeCollections(e,t){return A(this.configuration).mergeCollections(e,t).then(e=>e(this.axios,this.basePath))}removeAllEmptyCollections(e){return A(this.configuration).removeAllEmptyCollections(e).then(e=>e(this.axios,this.basePath))}removeCollection(e,t){return A(this.configuration).removeCollection(e,t).then(e=>e(this.axios,this.basePath))}removeCollections(e,t){return A(this.configuration).removeCollections(e,t).then(e=>e(this.axios,this.basePath))}reorderAllCollections(e,t){return A(this.configuration).reorderAllCollections(e,t).then(e=>e(this.axios,this.basePath))}searchCovers(e,t){return A(this.configuration).searchCovers(e,t).then(e=>e(this.axios,this.basePath))}shareCollection(e,t,n){return A(this.configuration).shareCollection(e,t,n).then(e=>e(this.axios,this.basePath))}unshareOrLeaveCollection(e,t){return A(this.configuration).unshareOrLeaveCollection(e,t).then(e=>e(this.axios,this.basePath))}updateCollection(e,t,n){return A(this.configuration).updateCollection(e,t,n).then(e=>e(this.axios,this.basePath))}uploadCollectionCover(e,t,n){return A(this.configuration).uploadCollectionCover(e,t,n).then(e=>e(this.axios,this.basePath))}},M=function(e){return{getFilters:async(t,n,r,i={})=>{h(`getFilters`,`collectionId`,t);let a=`/rest/v1/filters/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),o=new URL(a,m),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l={},u={};await g(l,e),n!==void 0&&(u.tagsSort=n),r!==void 0&&(u.search=r),v(o,u);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},{url:S(o),options:c}}}},N=function(e){let t=M(e);return{async getFilters(n,r,i,a){let o=await t.getFilters(n,r,i,a),s=e?.serverIndex??0,c=p[`FilterApi.getFilters`]?.[s]?.url;return(t,n)=>C(o,l.default,u,e)(t,c||n)}}},oe=function(e,t,n){let r=N(e);return{getFilters(e,i,a,o){return r.getFilters(e,i,a,o).then(e=>e(n,t))}}},P=class extends d{getFilters(e,t,n,r){return N(this.configuration).getFilters(e,t,n,r).then(e=>e(this.axios,this.basePath))}},se={MinusCount:`-count`,Id:`_id`},F=function(e){return{getAllHighlights:async(t,n,r={})=>{let i=new URL(`/rest/v1/highlights`,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...r},s={},c={};await g(s,e),t!==void 0&&(c.page=t),n!==void 0&&(c.perpage=n),v(i,c);let l=a&&a.headers?a.headers:{};return o.headers={...s,...l,...r.headers},{url:S(i),options:o}},getHighlightsInCollection:async(t,n,r,i={})=>{h(`getHighlightsInCollection`,`collectionId`,t);let a=`/rest/v1/highlights/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),o=new URL(a,m),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l={},u={};await g(l,e),n!==void 0&&(u.page=n),r!==void 0&&(u.perpage=r),v(o,u);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},{url:S(o),options:c}},getRaindrop:async(t,n={})=>{h(`getRaindrop`,`id`,t);let r=`/rest/v1/raindrop/{id}`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},updateRaindrop:async(t,n,r={})=>{h(`updateRaindrop`,`id`,t);let i=`/rest/v1/raindrop/{id}`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}}}},I=function(e){let t=F(e);return{async getAllHighlights(n,r,i){let a=await t.getAllHighlights(n,r,i),o=e?.serverIndex??0,s=p[`HighlightApi.getAllHighlights`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async getHighlightsInCollection(n,r,i,a){let o=await t.getHighlightsInCollection(n,r,i,a),s=e?.serverIndex??0,c=p[`HighlightApi.getHighlightsInCollection`]?.[s]?.url;return(t,n)=>C(o,l.default,u,e)(t,c||n)},async getRaindrop(n,r){let i=await t.getRaindrop(n,r),a=e?.serverIndex??0,o=p[`HighlightApi.getRaindrop`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async updateRaindrop(n,r,i){let a=await t.updateRaindrop(n,r,i),o=e?.serverIndex??0,s=p[`HighlightApi.updateRaindrop`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)}}},ce=function(e,t,n){let r=I(e);return{getAllHighlights(e,i,a){return r.getAllHighlights(e,i,a).then(e=>e(n,t))},getHighlightsInCollection(e,i,a,o){return r.getHighlightsInCollection(e,i,a,o).then(e=>e(n,t))},getRaindrop(e,i){return r.getRaindrop(e,i).then(e=>e(n,t))},updateRaindrop(e,i,a){return r.updateRaindrop(e,i,a).then(e=>e(n,t))}}},L=class extends d{getAllHighlights(e,t,n){return I(this.configuration).getAllHighlights(e,t,n).then(e=>e(this.axios,this.basePath))}getHighlightsInCollection(e,t,n,r){return I(this.configuration).getHighlightsInCollection(e,t,n,r).then(e=>e(this.axios,this.basePath))}getRaindrop(e,t){return I(this.configuration).getRaindrop(e,t).then(e=>e(this.axios,this.basePath))}updateRaindrop(e,t,n){return I(this.configuration).updateRaindrop(e,t,n).then(e=>e(this.axios,this.basePath))}},R=function(e){return{checkURLsExist:async(t,n={})=>{let r=new URL(`/rest/v1/import/url/exists`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},importHTMLBookmarkFile:async(t,n={})=>{let r=new URL(`/rest/v1/import/file`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={},s={},c=new(e&&e.formDataCtor||FormData);await g(o,e),t!==void 0&&c.append(`import`,t),o[`Content-Type`]=`multipart/form-data`,v(r,s);let l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...n.headers},a.data=c,{url:S(r),options:a}},parseURL:async(t,n={})=>{let r=new URL(`/rest/v1/import/url/parse`,m),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...n},o={},s={};await g(o,e),t!==void 0&&(s.url=t),v(r,s);let c=i&&i.headers?i.headers:{};return a.headers={...o,...c,...n.headers},{url:S(r),options:a}}}},z=function(e){let t=R(e);return{async checkURLsExist(n,r){let i=await t.checkURLsExist(n,r),a=e?.serverIndex??0,o=p[`ImportApi.checkURLsExist`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async importHTMLBookmarkFile(n,r){let i=await t.importHTMLBookmarkFile(n,r),a=e?.serverIndex??0,o=p[`ImportApi.importHTMLBookmarkFile`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async parseURL(n,r){let i=await t.parseURL(n,r),a=e?.serverIndex??0,o=p[`ImportApi.parseURL`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)}}},le=function(e,t,n){let r=z(e);return{checkURLsExist(e,i){return r.checkURLsExist(e,i).then(e=>e(n,t))},importHTMLBookmarkFile(e,i){return r.importHTMLBookmarkFile(e,i).then(e=>e(n,t))},parseURL(e,i){return r.parseURL(e,i).then(e=>e(n,t))}}},B=class extends d{checkURLsExist(e,t){return z(this.configuration).checkURLsExist(e,t).then(e=>e(this.axios,this.basePath))}importHTMLBookmarkFile(e,t){return z(this.configuration).importHTMLBookmarkFile(e,t).then(e=>e(this.axios,this.basePath))}parseURL(e,t){return z(this.configuration).parseURL(e,t).then(e=>e(this.axios,this.basePath))}},V=function(e){return{createRaindrop:async(t,n={})=>{let r=new URL(`/rest/v1/raindrop`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},createRaindrops:async(t,n={})=>{let r=new URL(`/rest/v1/raindrops`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},getPermanentCopy:async(t,n={})=>{h(`getPermanentCopy`,`id`,t);let r=`/rest/v1/raindrop/{id}/cache`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getRaindrop:async(t,n={})=>{h(`getRaindrop`,`id`,t);let r=`/rest/v1/raindrop/{id}`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getRaindrops:async(t,n,r,i,a,o={})=>{h(`getRaindrops`,`collectionId`,t);let s=`/rest/v1/raindrops/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),c=new URL(s,m),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d={},f={};await g(d,e),n!==void 0&&(f.sort=n),r!==void 0&&(f.perpage=r),i!==void 0&&(f.page=i),a!==void 0&&(f.search=a),v(c,f);let p=l&&l.headers?l.headers:{};return u.headers={...d,...p,...o.headers},{url:S(c),options:u}},removeRaindrop:async(t,n={})=>{h(`removeRaindrop`,`id`,t);let r=`/rest/v1/raindrop/{id}`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},removeRaindrops:async(t,n,r,i={})=>{h(`removeRaindrops`,`collectionId`,t);let a=`/rest/v1/raindrops/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),o=new URL(a,m),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l={},u={};await g(l,e),n!==void 0&&(u.search=n),l[`Content-Type`]=`application/json`,v(o,u);let d=s&&s.headers?s.headers:{};return c.headers={...l,...d,...i.headers},c.data=y(r,c,e),{url:S(o),options:c}},suggestForExistingBookmark:async(t,n={})=>{h(`suggestForExistingBookmark`,`id`,t);let r=`/rest/v1/raindrop/{id}/suggest`.replace(`{id}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},suggestForNewBookmark:async(t,n={})=>{let r=new URL(`/rest/v1/raindrop/suggest`,m),i;e&&(i=e.baseOptions);let a={method:`POST`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}},updateRaindrop:async(t,n,r={})=>{h(`updateRaindrop`,`id`,t);let i=`/rest/v1/raindrop/{id}`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}},updateRaindrops:async(t,n,r={})=>{h(`updateRaindrops`,`collectionId`,t);let i=`/rest/v1/raindrops/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}},uploadFile:async(t,n,r={})=>{let i=new URL(`/rest/v1/raindrop/file`,m),a;e&&(a=e.baseOptions);let o={method:`PUT`,...a,...r},s={},c={},l=new(e&&e.formDataCtor||FormData);await g(s,e),t!==void 0&&l.append(`file`,t),n!==void 0&&l.append(`collectionId`,n),s[`Content-Type`]=`multipart/form-data`,v(i,c);let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...r.headers},o.data=l,{url:S(i),options:o}},uploadRaindropCover:async(t,n,r={})=>{h(`uploadRaindropCover`,`id`,t);let i=`/rest/v1/raindrop/{id}/cover`.replace(`{id}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={},l={},u=new(e&&e.formDataCtor||FormData);await g(c,e),n!==void 0&&u.append(`cover`,n),c[`Content-Type`]=`multipart/form-data`,v(a,l);let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},s.data=u,{url:S(a),options:s}}}},H=function(e){let t=V(e);return{async createRaindrop(n,r){let i=await t.createRaindrop(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.createRaindrop`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async createRaindrops(n,r){let i=await t.createRaindrops(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.createRaindrops`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getPermanentCopy(n,r){let i=await t.getPermanentCopy(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.getPermanentCopy`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getRaindrop(n,r){let i=await t.getRaindrop(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.getRaindrop`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getRaindrops(n,r,i,a,o,s){let c=await t.getRaindrops(n,r,i,a,o,s),d=e?.serverIndex??0,f=p[`RaindropApi.getRaindrops`]?.[d]?.url;return(t,n)=>C(c,l.default,u,e)(t,f||n)},async removeRaindrop(n,r){let i=await t.removeRaindrop(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.removeRaindrop`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async removeRaindrops(n,r,i,a){let o=await t.removeRaindrops(n,r,i,a),s=e?.serverIndex??0,c=p[`RaindropApi.removeRaindrops`]?.[s]?.url;return(t,n)=>C(o,l.default,u,e)(t,c||n)},async suggestForExistingBookmark(n,r){let i=await t.suggestForExistingBookmark(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.suggestForExistingBookmark`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async suggestForNewBookmark(n,r){let i=await t.suggestForNewBookmark(n,r),a=e?.serverIndex??0,o=p[`RaindropApi.suggestForNewBookmark`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async updateRaindrop(n,r,i){let a=await t.updateRaindrop(n,r,i),o=e?.serverIndex??0,s=p[`RaindropApi.updateRaindrop`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async updateRaindrops(n,r,i){let a=await t.updateRaindrops(n,r,i),o=e?.serverIndex??0,s=p[`RaindropApi.updateRaindrops`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async uploadFile(n,r,i){let a=await t.uploadFile(n,r,i),o=e?.serverIndex??0,s=p[`RaindropApi.uploadFile`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async uploadRaindropCover(n,r,i){let a=await t.uploadRaindropCover(n,r,i),o=e?.serverIndex??0,s=p[`RaindropApi.uploadRaindropCover`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)}}},ue=function(e,t,n){let r=H(e);return{createRaindrop(e,i){return r.createRaindrop(e,i).then(e=>e(n,t))},createRaindrops(e,i){return r.createRaindrops(e,i).then(e=>e(n,t))},getPermanentCopy(e,i){return r.getPermanentCopy(e,i).then(e=>e(n,t))},getRaindrop(e,i){return r.getRaindrop(e,i).then(e=>e(n,t))},getRaindrops(e,i,a,o,s,c){return r.getRaindrops(e,i,a,o,s,c).then(e=>e(n,t))},removeRaindrop(e,i){return r.removeRaindrop(e,i).then(e=>e(n,t))},removeRaindrops(e,i,a,o){return r.removeRaindrops(e,i,a,o).then(e=>e(n,t))},suggestForExistingBookmark(e,i){return r.suggestForExistingBookmark(e,i).then(e=>e(n,t))},suggestForNewBookmark(e,i){return r.suggestForNewBookmark(e,i).then(e=>e(n,t))},updateRaindrop(e,i,a){return r.updateRaindrop(e,i,a).then(e=>e(n,t))},updateRaindrops(e,i,a){return r.updateRaindrops(e,i,a).then(e=>e(n,t))},uploadFile(e,i,a){return r.uploadFile(e,i,a).then(e=>e(n,t))},uploadRaindropCover(e,i,a){return r.uploadRaindropCover(e,i,a).then(e=>e(n,t))}}},U=class extends d{createRaindrop(e,t){return H(this.configuration).createRaindrop(e,t).then(e=>e(this.axios,this.basePath))}createRaindrops(e,t){return H(this.configuration).createRaindrops(e,t).then(e=>e(this.axios,this.basePath))}getPermanentCopy(e,t){return H(this.configuration).getPermanentCopy(e,t).then(e=>e(this.axios,this.basePath))}getRaindrop(e,t){return H(this.configuration).getRaindrop(e,t).then(e=>e(this.axios,this.basePath))}getRaindrops(e,t,n,r,i,a){return H(this.configuration).getRaindrops(e,t,n,r,i,a).then(e=>e(this.axios,this.basePath))}removeRaindrop(e,t){return H(this.configuration).removeRaindrop(e,t).then(e=>e(this.axios,this.basePath))}removeRaindrops(e,t,n,r){return H(this.configuration).removeRaindrops(e,t,n,r).then(e=>e(this.axios,this.basePath))}suggestForExistingBookmark(e,t){return H(this.configuration).suggestForExistingBookmark(e,t).then(e=>e(this.axios,this.basePath))}suggestForNewBookmark(e,t){return H(this.configuration).suggestForNewBookmark(e,t).then(e=>e(this.axios,this.basePath))}updateRaindrop(e,t,n){return H(this.configuration).updateRaindrop(e,t,n).then(e=>e(this.axios,this.basePath))}updateRaindrops(e,t,n){return H(this.configuration).updateRaindrops(e,t,n).then(e=>e(this.axios,this.basePath))}uploadFile(e,t,n){return H(this.configuration).uploadFile(e,t,n).then(e=>e(this.axios,this.basePath))}uploadRaindropCover(e,t,n){return H(this.configuration).uploadRaindropCover(e,t,n).then(e=>e(this.axios,this.basePath))}},W=function(e){return{getTagsInCollection:async(t,n={})=>{let r=`/rest/v1/tags/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},removeTagsFromCollection:async(t,n,r={})=>{let i=`/rest/v1/tags/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`DELETE`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}},renameOrMergeTags:async(t,n,r={})=>{let i=`/rest/v1/tags/{collectionId}`.replace(`{collectionId}`,encodeURIComponent(String(t))),a=new URL(i,m),o;e&&(o=e.baseOptions);let s={method:`PUT`,...o,...r},c={};await g(c,e),c[`Content-Type`]=`application/json`,v(a,{});let l=o&&o.headers?o.headers:{};return s.headers={...c,...l,...r.headers},s.data=y(n,s,e),{url:S(a),options:s}}}},G=function(e){let t=W(e);return{async getTagsInCollection(n,r){let i=await t.getTagsInCollection(n,r),a=e?.serverIndex??0,o=p[`TagApi.getTagsInCollection`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async removeTagsFromCollection(n,r,i){let a=await t.removeTagsFromCollection(n,r,i),o=e?.serverIndex??0,s=p[`TagApi.removeTagsFromCollection`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)},async renameOrMergeTags(n,r,i){let a=await t.renameOrMergeTags(n,r,i),o=e?.serverIndex??0,s=p[`TagApi.renameOrMergeTags`]?.[o]?.url;return(t,n)=>C(a,l.default,u,e)(t,s||n)}}},de=function(e,t,n){let r=G(e);return{getTagsInCollection(e,i){return r.getTagsInCollection(e,i).then(e=>e(n,t))},removeTagsFromCollection(e,i,a){return r.removeTagsFromCollection(e,i,a).then(e=>e(n,t))},renameOrMergeTags(e,i,a){return r.renameOrMergeTags(e,i,a).then(e=>e(n,t))}}},K=class extends d{getTagsInCollection(e,t){return G(this.configuration).getTagsInCollection(e,t).then(e=>e(this.axios,this.basePath))}removeTagsFromCollection(e,t,n){return G(this.configuration).removeTagsFromCollection(e,t,n).then(e=>e(this.axios,this.basePath))}renameOrMergeTags(e,t,n){return G(this.configuration).renameOrMergeTags(e,t,n).then(e=>e(this.axios,this.basePath))}},q=function(e){return{connectSocialNetworkProvider:async(t,n={})=>{h(`connectSocialNetworkProvider`,`provider`,t);let r=`/rest/v1/user/connect/{provider}`.replace(`{provider}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},disconnectSocialNetworkProvider:async(t,n={})=>{h(`disconnectSocialNetworkProvider`,`provider`,t);let r=`/rest/v1/user/connect/{provider}/revoke`.replace(`{provider}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getCurrentUser:async(t={})=>{let n=new URL(`/rest/v1/user`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},getPublicUserByName:async(t,n={})=>{h(`getPublicUserByName`,`name`,t);let r=`/rest/v1/user/{name}`.replace(`{name}`,encodeURIComponent(String(t))),i=new URL(r,m),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s={};await g(s,e),v(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:S(i),options:o}},getSystemCollectionStats:async(t={})=>{let n=new URL(`/rest/v1/user/stats`,m),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a={};await g(a,e),v(n,{});let o=r&&r.headers?r.headers:{};return i.headers={...a,...o,...t.headers},{url:S(n),options:i}},updateCurrentUser:async(t,n={})=>{let r=new URL(`/rest/v1/user`,m),i;e&&(i=e.baseOptions);let a={method:`PUT`,...i,...n},o={};await g(o,e),o[`Content-Type`]=`application/json`,v(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=y(t,a,e),{url:S(r),options:a}}}},J=function(e){let t=q(e);return{async connectSocialNetworkProvider(n,r){let i=await t.connectSocialNetworkProvider(n,r),a=e?.serverIndex??0,o=p[`UserApi.connectSocialNetworkProvider`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async disconnectSocialNetworkProvider(n,r){let i=await t.disconnectSocialNetworkProvider(n,r),a=e?.serverIndex??0,o=p[`UserApi.disconnectSocialNetworkProvider`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getCurrentUser(n){let r=await t.getCurrentUser(n),i=e?.serverIndex??0,a=p[`UserApi.getCurrentUser`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async getPublicUserByName(n,r){let i=await t.getPublicUserByName(n,r),a=e?.serverIndex??0,o=p[`UserApi.getPublicUserByName`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)},async getSystemCollectionStats(n){let r=await t.getSystemCollectionStats(n),i=e?.serverIndex??0,a=p[`UserApi.getSystemCollectionStats`]?.[i]?.url;return(t,n)=>C(r,l.default,u,e)(t,a||n)},async updateCurrentUser(n,r){let i=await t.updateCurrentUser(n,r),a=e?.serverIndex??0,o=p[`UserApi.updateCurrentUser`]?.[a]?.url;return(t,n)=>C(i,l.default,u,e)(t,o||n)}}},fe=function(e,t,n){let r=J(e);return{connectSocialNetworkProvider(e,i){return r.connectSocialNetworkProvider(e,i).then(e=>e(n,t))},disconnectSocialNetworkProvider(e,i){return r.disconnectSocialNetworkProvider(e,i).then(e=>e(n,t))},getCurrentUser(e){return r.getCurrentUser(e).then(e=>e(n,t))},getPublicUserByName(e,i){return r.getPublicUserByName(e,i).then(e=>e(n,t))},getSystemCollectionStats(e){return r.getSystemCollectionStats(e).then(e=>e(n,t))},updateCurrentUser(e,i){return r.updateCurrentUser(e,i).then(e=>e(n,t))}}},Y=class extends d{connectSocialNetworkProvider(e,t){return J(this.configuration).connectSocialNetworkProvider(e,t).then(e=>e(this.axios,this.basePath))}disconnectSocialNetworkProvider(e,t){return J(this.configuration).disconnectSocialNetworkProvider(e,t).then(e=>e(this.axios,this.basePath))}getCurrentUser(e){return J(this.configuration).getCurrentUser(e).then(e=>e(this.axios,this.basePath))}getPublicUserByName(e,t){return J(this.configuration).getPublicUserByName(e,t).then(e=>e(this.axios,this.basePath))}getSystemCollectionStats(e){return J(this.configuration).getSystemCollectionStats(e).then(e=>e(this.axios,this.basePath))}updateCurrentUser(e,t){return J(this.configuration).updateCurrentUser(e,t).then(e=>e(this.axios,this.basePath))}},pe={Facebook:`facebook`,Google:`google`,Twitter:`twitter`,Vkontate:`vkontate`,Dropbox:`dropbox`,Gdrive:`gdrive`},me={Facebook:`facebook`,Google:`google`,Twitter:`twitter`,Vkontate:`vkontate`,Dropbox:`dropbox`,Gdrive:`gdrive`},X=class{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.serverIndex=e.serverIndex,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},he=o({AuthenticationApi:()=>O,AuthenticationApiAxiosParamCreator:()=>E,AuthenticationApiFactory:()=>ie,AuthenticationApiFp:()=>D,CollectionApi:()=>j,CollectionApiAxiosParamCreator:()=>k,CollectionApiFactory:()=>ae,CollectionApiFp:()=>A,CollectionRefRefEnum:()=>te,Configuration:()=>X,ConnectSocialNetworkProviderProviderEnum:()=>pe,DisconnectSocialNetworkProviderProviderEnum:()=>me,FilterApi:()=>P,FilterApiAxiosParamCreator:()=>M,FilterApiFactory:()=>oe,FilterApiFp:()=>N,GetFiltersTagsSortEnum:()=>se,HighlightApi:()=>L,HighlightApiAxiosParamCreator:()=>F,HighlightApiFactory:()=>ce,HighlightApiFp:()=>I,ImportApi:()=>B,ImportApiAxiosParamCreator:()=>R,ImportApiFactory:()=>le,ImportApiFp:()=>z,ObtainTokenGrantTypeEnum:()=>w,RaindropApi:()=>U,RaindropApiAxiosParamCreator:()=>V,RaindropApiFactory:()=>ue,RaindropApiFp:()=>H,RefreshTokenGrantTypeEnum:()=>T,Role:()=>ne,TagApi:()=>K,TagApiAxiosParamCreator:()=>W,TagApiFactory:()=>de,TagApiFp:()=>G,TokenResponseTokenTypeEnum:()=>re,UserApi:()=>Y,UserApiAxiosParamCreator:()=>q,UserApiFactory:()=>fe,UserApiFp:()=>J}),ge=class extends O{async exchangeToken(e,t){return this.getOrRefreshToken({...e,grant_type:w.AuthorizationCode},t).then(e=>{if(Z(e.data))throw Error(`Request failed with error: ${e.data.errorMessage}`);return e})}async refreshToken(e,t){return this.getOrRefreshToken({...e,grant_type:T.RefreshToken},t).then(e=>{if(Z(e.data))throw Error(`Request failed with error: ${e.data.errorMessage}`);return e})}};function Z(e){return`result`in e&&e.result===!1}var _e=o({TreeNode:()=>Q,makeTree:()=>ve}),Q=class{_data;_parent=null;_children=[];constructor(e,t){this._data=e,t&&this.addChildren(...t)}get data(){return this._data}get parent(){return this._parent}set parent(e){this._parent=e,e._children.push(this)}isRoot(){return this._parent===null}get children(){return this._children}addChildren(...e){this._children.push(...e);for(let t of e)t._parent=this}traverse(e){e(this);for(let t of this.children)t.traverse(e)}};function $(e,t,n){let r=n.filter(e=>e.parent===t);for(let t of r){let r=t.toNode();$(r,t.id,n),e.addChildren(r)}}function ve(e,t){let n=new Q(e);return $(n,null,t),n}var ye=class extends j{async getCollectionTree(){let[{data:e},{data:t}]=await Promise.all([this.getRootCollections(),this.getChildCollections()]),n=e.items.map(e=>({data:e,id:e._id.toString(),parent:null,toNode(){return new Q(this.data)}})),r=t.items.map(e=>({data:e,id:e._id.toString(),parent:e.parent?.$id.toString()||null,toNode(){return new Q(this.data)}})),i=n.concat(r);return i.sort((e,t)=>e.data.title.localeCompare(t.data.title)||e.data._id-t.data._id),ve(null,i.filter((e,t,n)=>n.findIndex(t=>t.id===e.id)===t))}},be=class extends U{async getAllRaindrops(e,t,n){let r=e??0,i=t?.sort??``,a=t?.pageSize??50,o=t?.search??``,{data:s}=await this.getRaindrops(r,i,a,0,o,n),c=s.count,l=Math.ceil(c/a),u=Array.from(Array(l).keys());u.shift();let d=await Promise.all(u.map(e=>this.getRaindrops(r,i,a,e,o,n).then(({data:e})=>e))),f=[...s.items];for(let e of d)f.push(...e.items);return f}},xe=class{client;configuration;auth;user;collection;filter;highlight;import;raindrop;tag;constructor(e,t){this.client=t??l.default,this.configuration=e??new X,this.auth=new ge(e,void 0,this.client),this.collection=new ye(e,void 0,this.client),this.filter=new P(e,void 0,this.client),this.highlight=new L(e,void 0,this.client),this.import=new B(e,void 0,this.client),this.raindrop=new be(e,void 0,this.client),this.tag=new K(e,void 0,this.client),this.user=new Y(e,void 0,this.client)}},Se=o({Raindrop:()=>xe}),Ce=o({tree:()=>_e}),we=xe;Object.defineProperty(exports,`client`,{enumerable:!0,get:function(){return Se}}),exports.default=we,Object.defineProperty(exports,`generated`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`utils`,{enumerable:!0,get:function(){return Ce}});