@lasuillard/raindrop-client
Version:
Axios client built with OpenAPI generator for Raindrop.io.
1,535 lines • 99.6 kB
JavaScript
import h from "axios";
const 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 {
/**
*
* @param {string} redirectUri
* @param {string} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {string} redirectUri
* @param {string} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {string} redirectUri
* @param {string} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
authorize(a, r, o) {
return s.authorize(a, r, o).then((l) => l(e, t));
},
/**
*
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getOrRefreshToken(a, r) {
return s.getOrRefreshToken(a, r).then((o) => o(e, t));
}
};
};
let _ = class extends S {
/**
*
* @param {string} redirectUri
* @param {string} clientId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthenticationApi
*/
authorize(t, e, s) {
return B(this.configuration).authorize(t, e, s).then((a) => a(this.axios, this.basePath));
}
/**
*
* @param {GetOrRefreshTokenRequest} [getOrRefreshTokenRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthenticationApi
*/
getOrRefreshToken(t, e) {
return B(this.configuration).getOrRefreshToken(t, e).then((s) => s(this.axios, this.basePath));
}
};
const M = function(n) {
return {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} userId
* @param {number} id
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {CreateCollectionRequest} [createCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} userId
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {string} text
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {ShareCollectionRequest} [shareCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {UpdateCollectionRequest} [updateCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {File} [cover]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} userId
* @param {number} id
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {CreateCollectionRequest} [createCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} userId
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {string} text
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {ShareCollectionRequest} [shareCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {UpdateCollectionRequest} [updateCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {File} [cover]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
acceptInvitation(a, r) {
return s.acceptInvitation(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} userId
* @param {number} id
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
changeCollaboratorAccessLevel(a, r, o, l) {
return s.changeCollaboratorAccessLevel(a, r, o, l).then((c) => c(e, t));
},
/**
*
* @param {CreateCollectionRequest} [createCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createCollection(a, r) {
return s.createCollection(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} userId
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteCollaborator(a, r, o) {
return s.deleteCollaborator(a, r, o).then((l) => l(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
emptyTrash(a) {
return s.emptyTrash(a).then((r) => r(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getChildCollections(a) {
return s.getChildCollections(a).then((r) => r(e, t));
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCollaborators(a, r) {
return s.getCollaborators(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCollection(a, r) {
return s.getCollection(a, r).then((o) => o(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFeaturedCovers(a) {
return s.getFeaturedCovers(a).then((r) => r(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRootCollections(a) {
return s.getRootCollections(a).then((r) => r(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getSystemCollectionStats(a) {
return s.getSystemCollectionStats(a).then((r) => r(e, t));
},
/**
*
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
mergeCollections(a, r) {
return s.mergeCollections(a, r).then((o) => o(e, t));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeAllEmptyCollections(a) {
return s.removeAllEmptyCollections(a).then((r) => r(e, t));
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeCollection(a, r) {
return s.removeCollection(a, r).then((o) => o(e, t));
},
/**
*
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeCollections(a, r) {
return s.removeCollections(a, r).then((o) => o(e, t));
},
/**
*
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
reorderAllCollections(a, r) {
return s.reorderAllCollections(a, r).then((o) => o(e, t));
},
/**
*
* @param {string} text
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchCovers(a, r) {
return s.searchCovers(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} id
* @param {ShareCollectionRequest} [shareCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
shareCollection(a, r, o) {
return s.shareCollection(a, r, o).then((l) => l(e, t));
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
unshareOrLeaveCollection(a, r) {
return s.unshareOrLeaveCollection(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} id
* @param {UpdateCollectionRequest} [updateCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateCollection(a, r, o) {
return s.updateCollection(a, r, o).then((l) => l(e, t));
},
/**
*
* @param {number} id
* @param {File} [cover]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
uploadCollectionCover(a, r, o) {
return s.uploadCollectionCover(a, r, o).then((l) => l(e, t));
}
};
};
let G = class extends S {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
acceptInvitation(t, e) {
return A(this.configuration).acceptInvitation(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} userId
* @param {number} id
* @param {ChangeCollaboratorAccessLevelRequest} [changeCollaboratorAccessLevelRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
changeCollaboratorAccessLevel(t, e, s, a) {
return A(this.configuration).changeCollaboratorAccessLevel(t, e, s, a).then((r) => r(this.axios, this.basePath));
}
/**
*
* @param {CreateCollectionRequest} [createCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
createCollection(t, e) {
return A(this.configuration).createCollection(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} userId
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
deleteCollaborator(t, e, s) {
return A(this.configuration).deleteCollaborator(t, e, s).then((a) => a(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
emptyTrash(t) {
return A(this.configuration).emptyTrash(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getChildCollections(t) {
return A(this.configuration).getChildCollections(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getCollaborators(t, e) {
return A(this.configuration).getCollaborators(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getCollection(t, e) {
return A(this.configuration).getCollection(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getFeaturedCovers(t) {
return A(this.configuration).getFeaturedCovers(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getRootCollections(t) {
return A(this.configuration).getRootCollections(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
getSystemCollectionStats(t) {
return A(this.configuration).getSystemCollectionStats(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {MergeCollectionsRequest} [mergeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
mergeCollections(t, e) {
return A(this.configuration).mergeCollections(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
removeAllEmptyCollections(t) {
return A(this.configuration).removeAllEmptyCollections(t).then((e) => e(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
removeCollection(t, e) {
return A(this.configuration).removeCollection(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {RemoveCollectionsRequest} [removeCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
removeCollections(t, e) {
return A(this.configuration).removeCollections(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {ReorderAllCollectionsRequest} [reorderAllCollectionsRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
reorderAllCollections(t, e) {
return A(this.configuration).reorderAllCollections(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {string} text
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
searchCovers(t, e) {
return A(this.configuration).searchCovers(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {ShareCollectionRequest} [shareCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
shareCollection(t, e, s) {
return A(this.configuration).shareCollection(t, e, s).then((a) => a(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
unshareOrLeaveCollection(t, e) {
return A(this.configuration).unshareOrLeaveCollection(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {UpdateCollectionRequest} [updateCollectionRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
updateCollection(t, e, s) {
return A(this.configuration).updateCollection(t, e, s).then((a) => a(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {File} [cover]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CollectionApi
*/
uploadCollectionCover(t, e, s) {
return A(this.configuration).uploadCollectionCover(t, e, s).then((a) => a(this.axios, this.basePath));
}
};
const D = function(n) {
return {
/**
*
* @param {number} collectionId
* @param {GetFiltersTagsSortEnum} [tagsSort]
* @param {string} [search]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} collectionId
* @param {GetFiltersTagsSortEnum} [tagsSort]
* @param {string} [search]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} collectionId
* @param {GetFiltersTagsSortEnum} [tagsSort]
* @param {string} [search]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFilters(a, r, o, l) {
return s.getFilters(a, r, o, l).then((c) => c(e, t));
}
};
};
class z extends S {
/**
*
* @param {number} collectionId
* @param {GetFiltersTagsSortEnum} [tagsSort]
* @param {string} [search]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FilterApi
*/
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 {
/**
*
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} collectionId
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {number} id
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} collectionId
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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);
},
/**
*
* @param {number} id
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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 {
/**
*
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAllHighlights(a, r, o) {
return s.getAllHighlights(a, r, o).then((l) => l(e, t));
},
/**
*
* @param {number} collectionId
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getHighlightsInCollection(a, r, o, l) {
return s.getHighlightsInCollection(a, r, o, l).then((c) => c(e, t));
},
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRaindrop(a, r) {
return s.getRaindrop(a, r).then((o) => o(e, t));
},
/**
*
* @param {number} id
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateRaindrop(a, r, o) {
return s.updateRaindrop(a, r, o).then((l) => l(e, t));
}
};
};
class K extends S {
/**
*
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HighlightApi
*/
getAllHighlights(t, e, s) {
return g(this.configuration).getAllHighlights(t, e, s).then((a) => a(this.axios, this.basePath));
}
/**
*
* @param {number} collectionId
* @param {number} [page]
* @param {number} [perpage]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HighlightApi
*/
getHighlightsInCollection(t, e, s, a) {
return g(this.configuration).getHighlightsInCollection(t, e, s, a).then((r) => r(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HighlightApi
*/
getRaindrop(t, e) {
return g(this.configuration).getRaindrop(t, e).then((s) => s(this.axios, this.basePath));
}
/**
*
* @param {number} id
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof HighlightApi
*/
updateRaindrop(t, e, s) {
return g(this.configuration).updateRaindrop(t, e, s).then((a) => a(this.axios, this.basePath));
}
}
const Y = function(n) {
return {
/**
*
* @param {CheckURLsExistRequest} [checkURLsExistRequest]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {File} [_import]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
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
};
},
/**
*
* @param {string} [url]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
parseURL: async (t, e = {}) =>