tsarr 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/lidarr.d.ts +373 -0
- package/dist/clients/lidarr.d.ts.map +1 -0
- package/dist/clients/lidarr.js +626 -0
- package/dist/clients/prowlarr.d.ts +143 -0
- package/dist/clients/prowlarr.d.ts.map +1 -0
- package/dist/clients/prowlarr.js +408 -0
- package/dist/clients/radarr.d.ts +1007 -0
- package/dist/clients/radarr.d.ts.map +1 -0
- package/dist/clients/radarr.js +1059 -0
- package/dist/clients/readarr.d.ts +173 -0
- package/dist/clients/readarr.d.ts.map +1 -0
- package/dist/clients/readarr.js +432 -0
- package/dist/clients/sonarr.d.ts +181 -0
- package/dist/clients/sonarr.d.ts.map +1 -0
- package/dist/clients/sonarr.js +432 -0
- package/dist/core/client.d.ts +17 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/errors.d.ts +19 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/response.d.ts +13 -0
- package/dist/core/response.d.ts.map +1 -0
- package/dist/core/types.d.ts +12 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/generated/lidarr/index.d.ts +4 -0
- package/dist/generated/lidarr/index.d.ts.map +1 -0
- package/dist/generated/lidarr/schemas.gen.d.ts +4584 -0
- package/dist/generated/lidarr/schemas.gen.d.ts.map +1 -0
- package/dist/generated/lidarr/services.gen.d.ts +242 -0
- package/dist/generated/lidarr/services.gen.d.ts.map +1 -0
- package/dist/generated/lidarr/types.gen.d.ts +2618 -0
- package/dist/generated/lidarr/types.gen.d.ts.map +1 -0
- package/dist/generated/prowlarr/index.d.ts +4 -0
- package/dist/generated/prowlarr/index.d.ts.map +1 -0
- package/dist/generated/prowlarr/schemas.gen.d.ts +2151 -0
- package/dist/generated/prowlarr/schemas.gen.d.ts.map +1 -0
- package/dist/generated/prowlarr/services.gen.d.ts +135 -0
- package/dist/generated/prowlarr/services.gen.d.ts.map +1 -0
- package/dist/generated/prowlarr/types.gen.d.ts +1339 -0
- package/dist/generated/prowlarr/types.gen.d.ts.map +1 -0
- package/dist/generated/radarr/index.d.ts +4 -0
- package/dist/generated/radarr/index.d.ts.map +1 -0
- package/dist/generated/radarr/schemas.gen.d.ts +4402 -0
- package/dist/generated/radarr/schemas.gen.d.ts.map +1 -0
- package/dist/generated/radarr/services.gen.d.ts +250 -0
- package/dist/generated/radarr/services.gen.d.ts.map +1 -0
- package/dist/generated/radarr/types.gen.d.ts +2547 -0
- package/dist/generated/radarr/types.gen.d.ts.map +1 -0
- package/dist/generated/readarr/index.d.ts +4 -0
- package/dist/generated/readarr/index.d.ts.map +1 -0
- package/dist/generated/readarr/schemas.gen.d.ts +5250 -0
- package/dist/generated/readarr/schemas.gen.d.ts.map +1 -0
- package/dist/generated/readarr/services.gen.d.ts +240 -0
- package/dist/generated/readarr/services.gen.d.ts.map +1 -0
- package/dist/generated/readarr/types.gen.d.ts +2770 -0
- package/dist/generated/readarr/types.gen.d.ts.map +1 -0
- package/dist/generated/sonarr/index.d.ts +4 -0
- package/dist/generated/sonarr/index.d.ts.map +1 -0
- package/dist/generated/sonarr/schemas.gen.d.ts +612 -0
- package/dist/generated/sonarr/schemas.gen.d.ts.map +1 -0
- package/dist/generated/sonarr/services.gen.d.ts +27 -0
- package/dist/generated/sonarr/services.gen.d.ts.map +1 -0
- package/dist/generated/sonarr/types.gen.d.ts +282 -0
- package/dist/generated/sonarr/types.gen.d.ts.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/radarr/index.d.ts +2 -0
- package/dist/radarr/index.d.ts.map +1 -0
- package/dist/sonarr/index.d.ts +2 -0
- package/dist/sonarr/index.d.ts.map +1 -0
- package/dist/tsarr-1.1.2.tgz +0 -0
- package/package.json +5 -4
- package/dist/tsarr-1.1.0.tgz +0 -0
|
@@ -0,0 +1,1059 @@
|
|
|
1
|
+
// src/core/errors.ts
|
|
2
|
+
class TsArrError extends Error {
|
|
3
|
+
code;
|
|
4
|
+
statusCode;
|
|
5
|
+
details;
|
|
6
|
+
constructor(message, code, statusCode, details) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
this.details = details;
|
|
11
|
+
this.name = "TsArrError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class ApiKeyError extends TsArrError {
|
|
16
|
+
constructor(message = "Invalid or missing API key") {
|
|
17
|
+
super(message, "API_KEY_ERROR", 401);
|
|
18
|
+
this.name = "ApiKeyError";
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
class ConnectionError extends TsArrError {
|
|
23
|
+
constructor(message, details) {
|
|
24
|
+
super(message, "CONNECTION_ERROR", undefined, details);
|
|
25
|
+
this.name = "ConnectionError";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/core/client.ts
|
|
30
|
+
function createServarrClient(config) {
|
|
31
|
+
if (!config.apiKey) {
|
|
32
|
+
throw new ApiKeyError;
|
|
33
|
+
}
|
|
34
|
+
if (!config.baseUrl) {
|
|
35
|
+
throw new ConnectionError("No base URL provided");
|
|
36
|
+
}
|
|
37
|
+
const validatedConfig = {
|
|
38
|
+
...config,
|
|
39
|
+
baseUrl: config.baseUrl.replace(/\/$/, "")
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
config: validatedConfig,
|
|
43
|
+
getHeaders: () => ({
|
|
44
|
+
"X-Api-Key": validatedConfig.apiKey,
|
|
45
|
+
"Content-Type": "application/json",
|
|
46
|
+
...validatedConfig.headers
|
|
47
|
+
}),
|
|
48
|
+
getBaseUrl: () => validatedConfig.baseUrl
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// node_modules/@hey-api/client-fetch/dist/index.js
|
|
53
|
+
var T = /\{[^{}]+\}/g;
|
|
54
|
+
var h = ({ allowReserved: i, name: n, value: e }) => {
|
|
55
|
+
if (e == null)
|
|
56
|
+
return "";
|
|
57
|
+
if (typeof e == "object")
|
|
58
|
+
throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");
|
|
59
|
+
return `${n}=${i ? e : encodeURIComponent(e)}`;
|
|
60
|
+
};
|
|
61
|
+
var U = (i) => {
|
|
62
|
+
switch (i) {
|
|
63
|
+
case "label":
|
|
64
|
+
return ".";
|
|
65
|
+
case "matrix":
|
|
66
|
+
return ";";
|
|
67
|
+
case "simple":
|
|
68
|
+
return ",";
|
|
69
|
+
default:
|
|
70
|
+
return "&";
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var $ = (i) => {
|
|
74
|
+
switch (i) {
|
|
75
|
+
case "form":
|
|
76
|
+
return ",";
|
|
77
|
+
case "pipeDelimited":
|
|
78
|
+
return "|";
|
|
79
|
+
case "spaceDelimited":
|
|
80
|
+
return "%20";
|
|
81
|
+
default:
|
|
82
|
+
return ",";
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var D = (i) => {
|
|
86
|
+
switch (i) {
|
|
87
|
+
case "label":
|
|
88
|
+
return ".";
|
|
89
|
+
case "matrix":
|
|
90
|
+
return ";";
|
|
91
|
+
case "simple":
|
|
92
|
+
return ",";
|
|
93
|
+
default:
|
|
94
|
+
return "&";
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
var j = ({ allowReserved: i, explode: n, name: e, style: a, value: o }) => {
|
|
98
|
+
if (!n) {
|
|
99
|
+
let r = (i ? o : o.map((c) => encodeURIComponent(c))).join($(a));
|
|
100
|
+
switch (a) {
|
|
101
|
+
case "label":
|
|
102
|
+
return `.${r}`;
|
|
103
|
+
case "matrix":
|
|
104
|
+
return `;${e}=${r}`;
|
|
105
|
+
case "simple":
|
|
106
|
+
return r;
|
|
107
|
+
default:
|
|
108
|
+
return `${e}=${r}`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
let s = U(a), t = o.map((r) => a === "label" || a === "simple" ? i ? r : encodeURIComponent(r) : h({ allowReserved: i, name: e, value: r })).join(s);
|
|
112
|
+
return a === "label" || a === "matrix" ? s + t : t;
|
|
113
|
+
};
|
|
114
|
+
var C = ({ allowReserved: i, explode: n, name: e, style: a, value: o }) => {
|
|
115
|
+
if (o instanceof Date)
|
|
116
|
+
return `${e}=${o.toISOString()}`;
|
|
117
|
+
if (a !== "deepObject" && !n) {
|
|
118
|
+
let r = [];
|
|
119
|
+
Object.entries(o).forEach(([u, l]) => {
|
|
120
|
+
r = [...r, u, i ? l : encodeURIComponent(l)];
|
|
121
|
+
});
|
|
122
|
+
let c = r.join(",");
|
|
123
|
+
switch (a) {
|
|
124
|
+
case "form":
|
|
125
|
+
return `${e}=${c}`;
|
|
126
|
+
case "label":
|
|
127
|
+
return `.${c}`;
|
|
128
|
+
case "matrix":
|
|
129
|
+
return `;${e}=${c}`;
|
|
130
|
+
default:
|
|
131
|
+
return c;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
let s = D(a), t = Object.entries(o).map(([r, c]) => h({ allowReserved: i, name: a === "deepObject" ? `${e}[${r}]` : r, value: c })).join(s);
|
|
135
|
+
return a === "label" || a === "matrix" ? s + t : t;
|
|
136
|
+
};
|
|
137
|
+
var _ = ({ path: i, url: n }) => {
|
|
138
|
+
let e = n, a = n.match(T);
|
|
139
|
+
if (a)
|
|
140
|
+
for (let o of a) {
|
|
141
|
+
let s = false, t = o.substring(1, o.length - 1), r = "simple";
|
|
142
|
+
t.endsWith("*") && (s = true, t = t.substring(0, t.length - 1)), t.startsWith(".") ? (t = t.substring(1), r = "label") : t.startsWith(";") && (t = t.substring(1), r = "matrix");
|
|
143
|
+
let c = i[t];
|
|
144
|
+
if (c == null)
|
|
145
|
+
continue;
|
|
146
|
+
if (Array.isArray(c)) {
|
|
147
|
+
e = e.replace(o, j({ explode: s, name: t, style: r, value: c }));
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (typeof c == "object") {
|
|
151
|
+
e = e.replace(o, C({ explode: s, name: t, style: r, value: c }));
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (r === "matrix") {
|
|
155
|
+
e = e.replace(o, `;${h({ name: t, value: c })}`);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
let u = encodeURIComponent(r === "label" ? `.${c}` : c);
|
|
159
|
+
e = e.replace(o, u);
|
|
160
|
+
}
|
|
161
|
+
return e;
|
|
162
|
+
};
|
|
163
|
+
var b = ({ allowReserved: i, array: n, object: e } = {}) => (o) => {
|
|
164
|
+
let s = [];
|
|
165
|
+
if (o && typeof o == "object")
|
|
166
|
+
for (let t in o) {
|
|
167
|
+
let r = o[t];
|
|
168
|
+
if (r != null) {
|
|
169
|
+
if (Array.isArray(r)) {
|
|
170
|
+
s = [...s, j({ allowReserved: i, explode: true, name: t, style: "form", value: r, ...n })];
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (typeof r == "object") {
|
|
174
|
+
s = [...s, C({ allowReserved: i, explode: true, name: t, style: "deepObject", value: r, ...e })];
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
s = [...s, h({ allowReserved: i, name: t, value: r })];
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return s.join("&");
|
|
181
|
+
};
|
|
182
|
+
var A = (i) => {
|
|
183
|
+
if (!i)
|
|
184
|
+
return;
|
|
185
|
+
let n = i.split(";")[0].trim();
|
|
186
|
+
if (n.startsWith("application/json") || n.endsWith("+json"))
|
|
187
|
+
return "json";
|
|
188
|
+
if (n === "multipart/form-data")
|
|
189
|
+
return "formData";
|
|
190
|
+
if (["application/", "audio/", "image/", "video/"].some((e) => n.startsWith(e)))
|
|
191
|
+
return "blob";
|
|
192
|
+
if (n.startsWith("text/"))
|
|
193
|
+
return "text";
|
|
194
|
+
};
|
|
195
|
+
var w = ({ baseUrl: i, path: n, query: e, querySerializer: a, url: o }) => {
|
|
196
|
+
let s = o.startsWith("/") ? o : `/${o}`, t = i + s;
|
|
197
|
+
n && (t = _({ path: n, url: t }));
|
|
198
|
+
let r = e ? a(e) : "";
|
|
199
|
+
return r.startsWith("?") && (r = r.substring(1)), r && (t += `?${r}`), t;
|
|
200
|
+
};
|
|
201
|
+
var R = (i, n) => {
|
|
202
|
+
let e = { ...i, ...n };
|
|
203
|
+
return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = O(i.headers, n.headers), e;
|
|
204
|
+
};
|
|
205
|
+
var O = (...i) => {
|
|
206
|
+
let n = new Headers;
|
|
207
|
+
for (let e of i) {
|
|
208
|
+
if (!e || typeof e != "object")
|
|
209
|
+
continue;
|
|
210
|
+
let a = e instanceof Headers ? e.entries() : Object.entries(e);
|
|
211
|
+
for (let [o, s] of a)
|
|
212
|
+
if (s === null)
|
|
213
|
+
n.delete(o);
|
|
214
|
+
else if (Array.isArray(s))
|
|
215
|
+
for (let t of s)
|
|
216
|
+
n.append(o, t);
|
|
217
|
+
else
|
|
218
|
+
s !== undefined && n.set(o, typeof s == "object" ? JSON.stringify(s) : s);
|
|
219
|
+
}
|
|
220
|
+
return n;
|
|
221
|
+
};
|
|
222
|
+
var y = class {
|
|
223
|
+
_fns;
|
|
224
|
+
constructor() {
|
|
225
|
+
this._fns = [];
|
|
226
|
+
}
|
|
227
|
+
clear() {
|
|
228
|
+
this._fns = [];
|
|
229
|
+
}
|
|
230
|
+
exists(n) {
|
|
231
|
+
return this._fns.indexOf(n) !== -1;
|
|
232
|
+
}
|
|
233
|
+
eject(n) {
|
|
234
|
+
let e = this._fns.indexOf(n);
|
|
235
|
+
e !== -1 && (this._fns = [...this._fns.slice(0, e), ...this._fns.slice(e + 1)]);
|
|
236
|
+
}
|
|
237
|
+
use(n) {
|
|
238
|
+
this._fns = [...this._fns, n];
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
var P = () => ({ error: new y, request: new y, response: new y });
|
|
242
|
+
var E = { bodySerializer: (i) => JSON.stringify(i) };
|
|
243
|
+
var W = b({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } });
|
|
244
|
+
var B = { "Content-Type": "application/json" };
|
|
245
|
+
var x = (i = {}) => ({ ...E, baseUrl: "", fetch: globalThis.fetch, headers: B, parseAs: "auto", querySerializer: W, ...i });
|
|
246
|
+
var J = (i = {}) => {
|
|
247
|
+
let n = R(x(), i), e = () => ({ ...n }), a = (t) => (n = R(n, t), e()), o = P(), s = async (t) => {
|
|
248
|
+
let r = { ...n, ...t, headers: O(n.headers, t.headers) };
|
|
249
|
+
r.body && r.bodySerializer && (r.body = r.bodySerializer(r.body)), r.body || r.headers.delete("Content-Type");
|
|
250
|
+
let c = w({ baseUrl: r.baseUrl ?? "", path: r.path, query: r.query, querySerializer: typeof r.querySerializer == "function" ? r.querySerializer : b(r.querySerializer), url: r.url }), u = { redirect: "follow", ...r }, l = new Request(c, u);
|
|
251
|
+
for (let f of o.request._fns)
|
|
252
|
+
l = await f(l, r);
|
|
253
|
+
let I = r.fetch, p = await I(l);
|
|
254
|
+
for (let f of o.response._fns)
|
|
255
|
+
p = await f(p, l, r);
|
|
256
|
+
let g = { request: l, response: p };
|
|
257
|
+
if (p.ok) {
|
|
258
|
+
if (p.status === 204 || p.headers.get("Content-Length") === "0")
|
|
259
|
+
return { data: {}, ...g };
|
|
260
|
+
if (r.parseAs === "stream")
|
|
261
|
+
return { data: p.body, ...g };
|
|
262
|
+
let f = (r.parseAs === "auto" ? A(p.headers.get("Content-Type")) : r.parseAs) ?? "json", S = await p[f]();
|
|
263
|
+
return f === "json" && r.responseTransformer && (S = await r.responseTransformer(S)), { data: S, ...g };
|
|
264
|
+
}
|
|
265
|
+
let m = await p.text();
|
|
266
|
+
try {
|
|
267
|
+
m = JSON.parse(m);
|
|
268
|
+
} catch {}
|
|
269
|
+
let d = m;
|
|
270
|
+
for (let f of o.error._fns)
|
|
271
|
+
d = await f(m, p, l, r);
|
|
272
|
+
if (d = d || {}, r.throwOnError)
|
|
273
|
+
throw d;
|
|
274
|
+
return { error: d, ...g };
|
|
275
|
+
};
|
|
276
|
+
return { connect: (t) => s({ ...t, method: "CONNECT" }), delete: (t) => s({ ...t, method: "DELETE" }), get: (t) => s({ ...t, method: "GET" }), getConfig: e, head: (t) => s({ ...t, method: "HEAD" }), interceptors: o, options: (t) => s({ ...t, method: "OPTIONS" }), patch: (t) => s({ ...t, method: "PATCH" }), post: (t) => s({ ...t, method: "POST" }), put: (t) => s({ ...t, method: "PUT" }), request: s, setConfig: a, trace: (t) => s({ ...t, method: "TRACE" }) };
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// src/generated/radarr/services.gen.ts
|
|
280
|
+
var client = J(x());
|
|
281
|
+
var getApiV3Calendar = (options) => {
|
|
282
|
+
return (options?.client ?? client).get({
|
|
283
|
+
...options,
|
|
284
|
+
url: "/api/v3/calendar"
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
var getFeedV3CalendarRadarrIcs = (options) => {
|
|
288
|
+
return (options?.client ?? client).get({
|
|
289
|
+
...options,
|
|
290
|
+
url: "/feed/v3/calendar/radarr.ics"
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
var postApiV3Command = (options) => {
|
|
294
|
+
return (options?.client ?? client).post({
|
|
295
|
+
...options,
|
|
296
|
+
url: "/api/v3/command"
|
|
297
|
+
});
|
|
298
|
+
};
|
|
299
|
+
var getApiV3Command = (options) => {
|
|
300
|
+
return (options?.client ?? client).get({
|
|
301
|
+
...options,
|
|
302
|
+
url: "/api/v3/command"
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
var getApiV3Customformat = (options) => {
|
|
306
|
+
return (options?.client ?? client).get({
|
|
307
|
+
...options,
|
|
308
|
+
url: "/api/v3/customformat"
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
var postApiV3Customformat = (options) => {
|
|
312
|
+
return (options?.client ?? client).post({
|
|
313
|
+
...options,
|
|
314
|
+
url: "/api/v3/customformat"
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
var putApiV3CustomformatById = (options) => {
|
|
318
|
+
return (options?.client ?? client).put({
|
|
319
|
+
...options,
|
|
320
|
+
url: "/api/v3/customformat/{id}"
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
var deleteApiV3CustomformatById = (options) => {
|
|
324
|
+
return (options?.client ?? client).delete({
|
|
325
|
+
...options,
|
|
326
|
+
url: "/api/v3/customformat/{id}"
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
var getApiV3CustomformatById = (options) => {
|
|
330
|
+
return (options?.client ?? client).get({
|
|
331
|
+
...options,
|
|
332
|
+
url: "/api/v3/customformat/{id}"
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
var putApiV3CustomformatBulk = (options) => {
|
|
336
|
+
return (options?.client ?? client).put({
|
|
337
|
+
...options,
|
|
338
|
+
url: "/api/v3/customformat/bulk"
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
var deleteApiV3CustomformatBulk = (options) => {
|
|
342
|
+
return (options?.client ?? client).delete({
|
|
343
|
+
...options,
|
|
344
|
+
url: "/api/v3/customformat/bulk"
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
var getApiV3CustomformatSchema = (options) => {
|
|
348
|
+
return (options?.client ?? client).get({
|
|
349
|
+
...options,
|
|
350
|
+
url: "/api/v3/customformat/schema"
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
var getApiV3Downloadclient = (options) => {
|
|
354
|
+
return (options?.client ?? client).get({
|
|
355
|
+
...options,
|
|
356
|
+
url: "/api/v3/downloadclient"
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
var postApiV3Downloadclient = (options) => {
|
|
360
|
+
return (options?.client ?? client).post({
|
|
361
|
+
...options,
|
|
362
|
+
url: "/api/v3/downloadclient"
|
|
363
|
+
});
|
|
364
|
+
};
|
|
365
|
+
var putApiV3DownloadclientById = (options) => {
|
|
366
|
+
return (options?.client ?? client).put({
|
|
367
|
+
...options,
|
|
368
|
+
url: "/api/v3/downloadclient/{id}"
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
var deleteApiV3DownloadclientById = (options) => {
|
|
372
|
+
return (options?.client ?? client).delete({
|
|
373
|
+
...options,
|
|
374
|
+
url: "/api/v3/downloadclient/{id}"
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
var getApiV3DownloadclientById = (options) => {
|
|
378
|
+
return (options?.client ?? client).get({
|
|
379
|
+
...options,
|
|
380
|
+
url: "/api/v3/downloadclient/{id}"
|
|
381
|
+
});
|
|
382
|
+
};
|
|
383
|
+
var putApiV3DownloadclientBulk = (options) => {
|
|
384
|
+
return (options?.client ?? client).put({
|
|
385
|
+
...options,
|
|
386
|
+
url: "/api/v3/downloadclient/bulk"
|
|
387
|
+
});
|
|
388
|
+
};
|
|
389
|
+
var deleteApiV3DownloadclientBulk = (options) => {
|
|
390
|
+
return (options?.client ?? client).delete({
|
|
391
|
+
...options,
|
|
392
|
+
url: "/api/v3/downloadclient/bulk"
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
var getApiV3DownloadclientSchema = (options) => {
|
|
396
|
+
return (options?.client ?? client).get({
|
|
397
|
+
...options,
|
|
398
|
+
url: "/api/v3/downloadclient/schema"
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
var postApiV3DownloadclientTest = (options) => {
|
|
402
|
+
return (options?.client ?? client).post({
|
|
403
|
+
...options,
|
|
404
|
+
url: "/api/v3/downloadclient/test"
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
var postApiV3DownloadclientTestall = (options) => {
|
|
408
|
+
return (options?.client ?? client).post({
|
|
409
|
+
...options,
|
|
410
|
+
url: "/api/v3/downloadclient/testall"
|
|
411
|
+
});
|
|
412
|
+
};
|
|
413
|
+
var getApiV3Filesystem = (options) => {
|
|
414
|
+
return (options?.client ?? client).get({
|
|
415
|
+
...options,
|
|
416
|
+
url: "/api/v3/filesystem"
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
var getApiV3FilesystemMediafiles = (options) => {
|
|
420
|
+
return (options?.client ?? client).get({
|
|
421
|
+
...options,
|
|
422
|
+
url: "/api/v3/filesystem/mediafiles"
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
var getApiV3Health = (options) => {
|
|
426
|
+
return (options?.client ?? client).get({
|
|
427
|
+
...options,
|
|
428
|
+
url: "/api/v3/health"
|
|
429
|
+
});
|
|
430
|
+
};
|
|
431
|
+
var getApiV3History = (options) => {
|
|
432
|
+
return (options?.client ?? client).get({
|
|
433
|
+
...options,
|
|
434
|
+
url: "/api/v3/history"
|
|
435
|
+
});
|
|
436
|
+
};
|
|
437
|
+
var getApiV3HistorySince = (options) => {
|
|
438
|
+
return (options?.client ?? client).get({
|
|
439
|
+
...options,
|
|
440
|
+
url: "/api/v3/history/since"
|
|
441
|
+
});
|
|
442
|
+
};
|
|
443
|
+
var getApiV3HistoryMovie = (options) => {
|
|
444
|
+
return (options?.client ?? client).get({
|
|
445
|
+
...options,
|
|
446
|
+
url: "/api/v3/history/movie"
|
|
447
|
+
});
|
|
448
|
+
};
|
|
449
|
+
var postApiV3HistoryFailedById = (options) => {
|
|
450
|
+
return (options?.client ?? client).post({
|
|
451
|
+
...options,
|
|
452
|
+
url: "/api/v3/history/failed/{id}"
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
var getApiV3Importlist = (options) => {
|
|
456
|
+
return (options?.client ?? client).get({
|
|
457
|
+
...options,
|
|
458
|
+
url: "/api/v3/importlist"
|
|
459
|
+
});
|
|
460
|
+
};
|
|
461
|
+
var postApiV3Importlist = (options) => {
|
|
462
|
+
return (options?.client ?? client).post({
|
|
463
|
+
...options,
|
|
464
|
+
url: "/api/v3/importlist"
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
var putApiV3ImportlistById = (options) => {
|
|
468
|
+
return (options?.client ?? client).put({
|
|
469
|
+
...options,
|
|
470
|
+
url: "/api/v3/importlist/{id}"
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
var deleteApiV3ImportlistById = (options) => {
|
|
474
|
+
return (options?.client ?? client).delete({
|
|
475
|
+
...options,
|
|
476
|
+
url: "/api/v3/importlist/{id}"
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
var getApiV3ImportlistById = (options) => {
|
|
480
|
+
return (options?.client ?? client).get({
|
|
481
|
+
...options,
|
|
482
|
+
url: "/api/v3/importlist/{id}"
|
|
483
|
+
});
|
|
484
|
+
};
|
|
485
|
+
var getApiV3ImportlistSchema = (options) => {
|
|
486
|
+
return (options?.client ?? client).get({
|
|
487
|
+
...options,
|
|
488
|
+
url: "/api/v3/importlist/schema"
|
|
489
|
+
});
|
|
490
|
+
};
|
|
491
|
+
var postApiV3ImportlistTest = (options) => {
|
|
492
|
+
return (options?.client ?? client).post({
|
|
493
|
+
...options,
|
|
494
|
+
url: "/api/v3/importlist/test"
|
|
495
|
+
});
|
|
496
|
+
};
|
|
497
|
+
var postApiV3ImportlistTestall = (options) => {
|
|
498
|
+
return (options?.client ?? client).post({
|
|
499
|
+
...options,
|
|
500
|
+
url: "/api/v3/importlist/testall"
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
var getApiV3Indexer = (options) => {
|
|
504
|
+
return (options?.client ?? client).get({
|
|
505
|
+
...options,
|
|
506
|
+
url: "/api/v3/indexer"
|
|
507
|
+
});
|
|
508
|
+
};
|
|
509
|
+
var postApiV3Indexer = (options) => {
|
|
510
|
+
return (options?.client ?? client).post({
|
|
511
|
+
...options,
|
|
512
|
+
url: "/api/v3/indexer"
|
|
513
|
+
});
|
|
514
|
+
};
|
|
515
|
+
var putApiV3IndexerById = (options) => {
|
|
516
|
+
return (options?.client ?? client).put({
|
|
517
|
+
...options,
|
|
518
|
+
url: "/api/v3/indexer/{id}"
|
|
519
|
+
});
|
|
520
|
+
};
|
|
521
|
+
var deleteApiV3IndexerById = (options) => {
|
|
522
|
+
return (options?.client ?? client).delete({
|
|
523
|
+
...options,
|
|
524
|
+
url: "/api/v3/indexer/{id}"
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
var getApiV3IndexerById = (options) => {
|
|
528
|
+
return (options?.client ?? client).get({
|
|
529
|
+
...options,
|
|
530
|
+
url: "/api/v3/indexer/{id}"
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
var getApiV3IndexerSchema = (options) => {
|
|
534
|
+
return (options?.client ?? client).get({
|
|
535
|
+
...options,
|
|
536
|
+
url: "/api/v3/indexer/schema"
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
var postApiV3IndexerTest = (options) => {
|
|
540
|
+
return (options?.client ?? client).post({
|
|
541
|
+
...options,
|
|
542
|
+
url: "/api/v3/indexer/test"
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
var postApiV3IndexerTestall = (options) => {
|
|
546
|
+
return (options?.client ?? client).post({
|
|
547
|
+
...options,
|
|
548
|
+
url: "/api/v3/indexer/testall"
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
var getApiV3Movie = (options) => {
|
|
552
|
+
return (options?.client ?? client).get({
|
|
553
|
+
...options,
|
|
554
|
+
url: "/api/v3/movie"
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
var postApiV3Movie = (options) => {
|
|
558
|
+
return (options?.client ?? client).post({
|
|
559
|
+
...options,
|
|
560
|
+
url: "/api/v3/movie"
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
var putApiV3MovieById = (options) => {
|
|
564
|
+
return (options?.client ?? client).put({
|
|
565
|
+
...options,
|
|
566
|
+
url: "/api/v3/movie/{id}"
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
var deleteApiV3MovieById = (options) => {
|
|
570
|
+
return (options?.client ?? client).delete({
|
|
571
|
+
...options,
|
|
572
|
+
url: "/api/v3/movie/{id}"
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
var getApiV3MovieById = (options) => {
|
|
576
|
+
return (options?.client ?? client).get({
|
|
577
|
+
...options,
|
|
578
|
+
url: "/api/v3/movie/{id}"
|
|
579
|
+
});
|
|
580
|
+
};
|
|
581
|
+
var postApiV3MovieImport = (options) => {
|
|
582
|
+
return (options?.client ?? client).post({
|
|
583
|
+
...options,
|
|
584
|
+
url: "/api/v3/movie/import"
|
|
585
|
+
});
|
|
586
|
+
};
|
|
587
|
+
var getApiV3MovieLookup = (options) => {
|
|
588
|
+
return (options?.client ?? client).get({
|
|
589
|
+
...options,
|
|
590
|
+
url: "/api/v3/movie/lookup"
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
var getApiV3Notification = (options) => {
|
|
594
|
+
return (options?.client ?? client).get({
|
|
595
|
+
...options,
|
|
596
|
+
url: "/api/v3/notification"
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
var postApiV3Notification = (options) => {
|
|
600
|
+
return (options?.client ?? client).post({
|
|
601
|
+
...options,
|
|
602
|
+
url: "/api/v3/notification"
|
|
603
|
+
});
|
|
604
|
+
};
|
|
605
|
+
var putApiV3NotificationById = (options) => {
|
|
606
|
+
return (options?.client ?? client).put({
|
|
607
|
+
...options,
|
|
608
|
+
url: "/api/v3/notification/{id}"
|
|
609
|
+
});
|
|
610
|
+
};
|
|
611
|
+
var deleteApiV3NotificationById = (options) => {
|
|
612
|
+
return (options?.client ?? client).delete({
|
|
613
|
+
...options,
|
|
614
|
+
url: "/api/v3/notification/{id}"
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
var getApiV3NotificationById = (options) => {
|
|
618
|
+
return (options?.client ?? client).get({
|
|
619
|
+
...options,
|
|
620
|
+
url: "/api/v3/notification/{id}"
|
|
621
|
+
});
|
|
622
|
+
};
|
|
623
|
+
var getApiV3NotificationSchema = (options) => {
|
|
624
|
+
return (options?.client ?? client).get({
|
|
625
|
+
...options,
|
|
626
|
+
url: "/api/v3/notification/schema"
|
|
627
|
+
});
|
|
628
|
+
};
|
|
629
|
+
var postApiV3NotificationTest = (options) => {
|
|
630
|
+
return (options?.client ?? client).post({
|
|
631
|
+
...options,
|
|
632
|
+
url: "/api/v3/notification/test"
|
|
633
|
+
});
|
|
634
|
+
};
|
|
635
|
+
var postApiV3NotificationTestall = (options) => {
|
|
636
|
+
return (options?.client ?? client).post({
|
|
637
|
+
...options,
|
|
638
|
+
url: "/api/v3/notification/testall"
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
var postApiV3Qualityprofile = (options) => {
|
|
642
|
+
return (options?.client ?? client).post({
|
|
643
|
+
...options,
|
|
644
|
+
url: "/api/v3/qualityprofile"
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
var getApiV3Qualityprofile = (options) => {
|
|
648
|
+
return (options?.client ?? client).get({
|
|
649
|
+
...options,
|
|
650
|
+
url: "/api/v3/qualityprofile"
|
|
651
|
+
});
|
|
652
|
+
};
|
|
653
|
+
var deleteApiV3QualityprofileById = (options) => {
|
|
654
|
+
return (options?.client ?? client).delete({
|
|
655
|
+
...options,
|
|
656
|
+
url: "/api/v3/qualityprofile/{id}"
|
|
657
|
+
});
|
|
658
|
+
};
|
|
659
|
+
var putApiV3QualityprofileById = (options) => {
|
|
660
|
+
return (options?.client ?? client).put({
|
|
661
|
+
...options,
|
|
662
|
+
url: "/api/v3/qualityprofile/{id}"
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
var getApiV3QualityprofileById = (options) => {
|
|
666
|
+
return (options?.client ?? client).get({
|
|
667
|
+
...options,
|
|
668
|
+
url: "/api/v3/qualityprofile/{id}"
|
|
669
|
+
});
|
|
670
|
+
};
|
|
671
|
+
var getApiV3QualityprofileSchema = (options) => {
|
|
672
|
+
return (options?.client ?? client).get({
|
|
673
|
+
...options,
|
|
674
|
+
url: "/api/v3/qualityprofile/schema"
|
|
675
|
+
});
|
|
676
|
+
};
|
|
677
|
+
var deleteApiV3QueueById = (options) => {
|
|
678
|
+
return (options?.client ?? client).delete({
|
|
679
|
+
...options,
|
|
680
|
+
url: "/api/v3/queue/{id}"
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
var deleteApiV3QueueBulk = (options) => {
|
|
684
|
+
return (options?.client ?? client).delete({
|
|
685
|
+
...options,
|
|
686
|
+
url: "/api/v3/queue/bulk"
|
|
687
|
+
});
|
|
688
|
+
};
|
|
689
|
+
var getApiV3Queue = (options) => {
|
|
690
|
+
return (options?.client ?? client).get({
|
|
691
|
+
...options,
|
|
692
|
+
url: "/api/v3/queue"
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
var postApiV3QueueGrabById = (options) => {
|
|
696
|
+
return (options?.client ?? client).post({
|
|
697
|
+
...options,
|
|
698
|
+
url: "/api/v3/queue/grab/{id}"
|
|
699
|
+
});
|
|
700
|
+
};
|
|
701
|
+
var postApiV3QueueGrabBulk = (options) => {
|
|
702
|
+
return (options?.client ?? client).post({
|
|
703
|
+
...options,
|
|
704
|
+
url: "/api/v3/queue/grab/bulk"
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
var getApiV3QueueDetails = (options) => {
|
|
708
|
+
return (options?.client ?? client).get({
|
|
709
|
+
...options,
|
|
710
|
+
url: "/api/v3/queue/details"
|
|
711
|
+
});
|
|
712
|
+
};
|
|
713
|
+
var getApiV3QueueStatus = (options) => {
|
|
714
|
+
return (options?.client ?? client).get({
|
|
715
|
+
...options,
|
|
716
|
+
url: "/api/v3/queue/status"
|
|
717
|
+
});
|
|
718
|
+
};
|
|
719
|
+
var postApiV3Rootfolder = (options) => {
|
|
720
|
+
return (options?.client ?? client).post({
|
|
721
|
+
...options,
|
|
722
|
+
url: "/api/v3/rootfolder"
|
|
723
|
+
});
|
|
724
|
+
};
|
|
725
|
+
var getApiV3Rootfolder = (options) => {
|
|
726
|
+
return (options?.client ?? client).get({
|
|
727
|
+
...options,
|
|
728
|
+
url: "/api/v3/rootfolder"
|
|
729
|
+
});
|
|
730
|
+
};
|
|
731
|
+
var deleteApiV3RootfolderById = (options) => {
|
|
732
|
+
return (options?.client ?? client).delete({
|
|
733
|
+
...options,
|
|
734
|
+
url: "/api/v3/rootfolder/{id}"
|
|
735
|
+
});
|
|
736
|
+
};
|
|
737
|
+
var getApiV3SystemStatus = (options) => {
|
|
738
|
+
return (options?.client ?? client).get({
|
|
739
|
+
...options,
|
|
740
|
+
url: "/api/v3/system/status"
|
|
741
|
+
});
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
// src/clients/radarr.ts
|
|
745
|
+
class RadarrClient {
|
|
746
|
+
clientConfig;
|
|
747
|
+
constructor(config) {
|
|
748
|
+
this.clientConfig = createServarrClient(config);
|
|
749
|
+
client.setConfig({
|
|
750
|
+
baseUrl: this.clientConfig.getBaseUrl(),
|
|
751
|
+
headers: this.clientConfig.getHeaders()
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
async getSystemStatus() {
|
|
755
|
+
return getApiV3SystemStatus();
|
|
756
|
+
}
|
|
757
|
+
async getHealth() {
|
|
758
|
+
return getApiV3Health();
|
|
759
|
+
}
|
|
760
|
+
async getMovies() {
|
|
761
|
+
return getApiV3Movie();
|
|
762
|
+
}
|
|
763
|
+
async getMovie(id) {
|
|
764
|
+
return getApiV3MovieById({ path: { id } });
|
|
765
|
+
}
|
|
766
|
+
async addMovie(movie) {
|
|
767
|
+
return postApiV3Movie({ body: movie });
|
|
768
|
+
}
|
|
769
|
+
async updateMovie(id, movie) {
|
|
770
|
+
return putApiV3MovieById({ path: { id: String(id) }, body: movie });
|
|
771
|
+
}
|
|
772
|
+
async deleteMovie(id) {
|
|
773
|
+
return deleteApiV3MovieById({ path: { id } });
|
|
774
|
+
}
|
|
775
|
+
async searchMovies(term) {
|
|
776
|
+
return getApiV3MovieLookup({ query: { term } });
|
|
777
|
+
}
|
|
778
|
+
async runCommand(command) {
|
|
779
|
+
return postApiV3Command({ body: command });
|
|
780
|
+
}
|
|
781
|
+
async getCommands() {
|
|
782
|
+
return getApiV3Command();
|
|
783
|
+
}
|
|
784
|
+
async getRootFolders() {
|
|
785
|
+
return getApiV3Rootfolder();
|
|
786
|
+
}
|
|
787
|
+
async addRootFolder(path) {
|
|
788
|
+
return postApiV3Rootfolder({
|
|
789
|
+
body: { path }
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
async deleteRootFolder(id) {
|
|
793
|
+
return deleteApiV3RootfolderById({ path: { id } });
|
|
794
|
+
}
|
|
795
|
+
async getFilesystem(path) {
|
|
796
|
+
return getApiV3Filesystem(path ? { query: { path } } : {});
|
|
797
|
+
}
|
|
798
|
+
async getMediaFiles(path) {
|
|
799
|
+
return getApiV3FilesystemMediafiles({ query: { path } });
|
|
800
|
+
}
|
|
801
|
+
async importMovies(movies) {
|
|
802
|
+
return postApiV3MovieImport({ body: movies });
|
|
803
|
+
}
|
|
804
|
+
async getQualityProfiles() {
|
|
805
|
+
return getApiV3Qualityprofile();
|
|
806
|
+
}
|
|
807
|
+
async getQualityProfile(id) {
|
|
808
|
+
return getApiV3QualityprofileById({ path: { id } });
|
|
809
|
+
}
|
|
810
|
+
async addQualityProfile(profile) {
|
|
811
|
+
return postApiV3Qualityprofile({ body: profile });
|
|
812
|
+
}
|
|
813
|
+
async updateQualityProfile(id, profile) {
|
|
814
|
+
return putApiV3QualityprofileById({ path: { id: String(id) }, body: profile });
|
|
815
|
+
}
|
|
816
|
+
async deleteQualityProfile(id) {
|
|
817
|
+
return deleteApiV3QualityprofileById({ path: { id } });
|
|
818
|
+
}
|
|
819
|
+
async getQualityProfileSchema() {
|
|
820
|
+
return getApiV3QualityprofileSchema();
|
|
821
|
+
}
|
|
822
|
+
async getCustomFormats() {
|
|
823
|
+
return getApiV3Customformat();
|
|
824
|
+
}
|
|
825
|
+
async getCustomFormat(id) {
|
|
826
|
+
return getApiV3CustomformatById({ path: { id } });
|
|
827
|
+
}
|
|
828
|
+
async addCustomFormat(format) {
|
|
829
|
+
return postApiV3Customformat({ body: format });
|
|
830
|
+
}
|
|
831
|
+
async updateCustomFormat(id, format) {
|
|
832
|
+
return putApiV3CustomformatById({ path: { id: String(id) }, body: format });
|
|
833
|
+
}
|
|
834
|
+
async deleteCustomFormat(id) {
|
|
835
|
+
return deleteApiV3CustomformatById({ path: { id } });
|
|
836
|
+
}
|
|
837
|
+
async updateCustomFormatsBulk(formats) {
|
|
838
|
+
return putApiV3CustomformatBulk({ body: formats });
|
|
839
|
+
}
|
|
840
|
+
async deleteCustomFormatsBulk(ids) {
|
|
841
|
+
return deleteApiV3CustomformatBulk({ body: { ids } });
|
|
842
|
+
}
|
|
843
|
+
async getCustomFormatSchema() {
|
|
844
|
+
return getApiV3CustomformatSchema();
|
|
845
|
+
}
|
|
846
|
+
async getDownloadClients() {
|
|
847
|
+
return getApiV3Downloadclient();
|
|
848
|
+
}
|
|
849
|
+
async getDownloadClient(id) {
|
|
850
|
+
return getApiV3DownloadclientById({ path: { id } });
|
|
851
|
+
}
|
|
852
|
+
async addDownloadClient(client2) {
|
|
853
|
+
return postApiV3Downloadclient({ body: client2 });
|
|
854
|
+
}
|
|
855
|
+
async updateDownloadClient(id, client2) {
|
|
856
|
+
return putApiV3DownloadclientById({ path: { id }, body: client2 });
|
|
857
|
+
}
|
|
858
|
+
async deleteDownloadClient(id) {
|
|
859
|
+
return deleteApiV3DownloadclientById({ path: { id } });
|
|
860
|
+
}
|
|
861
|
+
async updateDownloadClientsBulk(clients) {
|
|
862
|
+
return putApiV3DownloadclientBulk({ body: clients });
|
|
863
|
+
}
|
|
864
|
+
async deleteDownloadClientsBulk(ids) {
|
|
865
|
+
return deleteApiV3DownloadclientBulk({ body: { ids } });
|
|
866
|
+
}
|
|
867
|
+
async getDownloadClientSchema() {
|
|
868
|
+
return getApiV3DownloadclientSchema();
|
|
869
|
+
}
|
|
870
|
+
async testDownloadClient(client2) {
|
|
871
|
+
return postApiV3DownloadclientTest({ body: client2 });
|
|
872
|
+
}
|
|
873
|
+
async testAllDownloadClients() {
|
|
874
|
+
return postApiV3DownloadclientTestall();
|
|
875
|
+
}
|
|
876
|
+
async getNotifications() {
|
|
877
|
+
return getApiV3Notification();
|
|
878
|
+
}
|
|
879
|
+
async getNotification(id) {
|
|
880
|
+
return getApiV3NotificationById({ path: { id } });
|
|
881
|
+
}
|
|
882
|
+
async addNotification(notification) {
|
|
883
|
+
return postApiV3Notification({ body: notification });
|
|
884
|
+
}
|
|
885
|
+
async updateNotification(id, notification) {
|
|
886
|
+
return putApiV3NotificationById({ path: { id }, body: notification });
|
|
887
|
+
}
|
|
888
|
+
async deleteNotification(id) {
|
|
889
|
+
return deleteApiV3NotificationById({ path: { id } });
|
|
890
|
+
}
|
|
891
|
+
async getNotificationSchema() {
|
|
892
|
+
return getApiV3NotificationSchema();
|
|
893
|
+
}
|
|
894
|
+
async testNotification(notification) {
|
|
895
|
+
return postApiV3NotificationTest({ body: notification });
|
|
896
|
+
}
|
|
897
|
+
async testAllNotifications() {
|
|
898
|
+
return postApiV3NotificationTestall();
|
|
899
|
+
}
|
|
900
|
+
async getCalendar(startDate, endDate, unmonitored) {
|
|
901
|
+
const query = {};
|
|
902
|
+
if (startDate)
|
|
903
|
+
query.start = startDate;
|
|
904
|
+
if (endDate)
|
|
905
|
+
query.end = endDate;
|
|
906
|
+
if (unmonitored !== undefined)
|
|
907
|
+
query.unmonitored = unmonitored;
|
|
908
|
+
return getApiV3Calendar(Object.keys(query).length > 0 ? { query } : {});
|
|
909
|
+
}
|
|
910
|
+
async getCalendarFeed(pastDays, futureDays, tags) {
|
|
911
|
+
const query = {};
|
|
912
|
+
if (pastDays !== undefined)
|
|
913
|
+
query.pastDays = pastDays;
|
|
914
|
+
if (futureDays !== undefined)
|
|
915
|
+
query.futureDays = futureDays;
|
|
916
|
+
if (tags)
|
|
917
|
+
query.tags = tags;
|
|
918
|
+
return getFeedV3CalendarRadarrIcs(Object.keys(query).length > 0 ? { query } : {});
|
|
919
|
+
}
|
|
920
|
+
async getQueue(page, pageSize, sortKey, sortDirection, includeUnknownMovieItems) {
|
|
921
|
+
const query = {};
|
|
922
|
+
if (page !== undefined)
|
|
923
|
+
query.page = page;
|
|
924
|
+
if (pageSize !== undefined)
|
|
925
|
+
query.pageSize = pageSize;
|
|
926
|
+
if (sortKey)
|
|
927
|
+
query.sortKey = sortKey;
|
|
928
|
+
if (sortDirection)
|
|
929
|
+
query.sortDirection = sortDirection;
|
|
930
|
+
if (includeUnknownMovieItems !== undefined)
|
|
931
|
+
query.includeUnknownMovieItems = includeUnknownMovieItems;
|
|
932
|
+
return getApiV3Queue(Object.keys(query).length > 0 ? { query } : {});
|
|
933
|
+
}
|
|
934
|
+
async removeQueueItem(id, removeFromClient, blocklist) {
|
|
935
|
+
const query = {};
|
|
936
|
+
if (removeFromClient !== undefined)
|
|
937
|
+
query.removeFromClient = removeFromClient;
|
|
938
|
+
if (blocklist !== undefined)
|
|
939
|
+
query.blocklist = blocklist;
|
|
940
|
+
return deleteApiV3QueueById({
|
|
941
|
+
path: { id },
|
|
942
|
+
...Object.keys(query).length > 0 ? { query } : {}
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
async removeQueueItemsBulk(ids, removeFromClient, blocklist) {
|
|
946
|
+
const body = { ids };
|
|
947
|
+
if (removeFromClient !== undefined)
|
|
948
|
+
body.removeFromClient = removeFromClient;
|
|
949
|
+
if (blocklist !== undefined)
|
|
950
|
+
body.blocklist = blocklist;
|
|
951
|
+
return deleteApiV3QueueBulk({ body });
|
|
952
|
+
}
|
|
953
|
+
async grabQueueItem(id) {
|
|
954
|
+
return postApiV3QueueGrabById({ path: { id } });
|
|
955
|
+
}
|
|
956
|
+
async grabQueueItemsBulk(ids) {
|
|
957
|
+
return postApiV3QueueGrabBulk({ body: { ids } });
|
|
958
|
+
}
|
|
959
|
+
async getQueueDetails(movieId, includeMovie) {
|
|
960
|
+
const query = {};
|
|
961
|
+
if (movieId !== undefined)
|
|
962
|
+
query.movieId = movieId;
|
|
963
|
+
if (includeMovie !== undefined)
|
|
964
|
+
query.includeMovie = includeMovie;
|
|
965
|
+
return getApiV3QueueDetails(Object.keys(query).length > 0 ? { query } : {});
|
|
966
|
+
}
|
|
967
|
+
async getQueueStatus() {
|
|
968
|
+
return getApiV3QueueStatus();
|
|
969
|
+
}
|
|
970
|
+
async getImportLists() {
|
|
971
|
+
return getApiV3Importlist();
|
|
972
|
+
}
|
|
973
|
+
async getImportList(id) {
|
|
974
|
+
return getApiV3ImportlistById({ path: { id } });
|
|
975
|
+
}
|
|
976
|
+
async addImportList(importList) {
|
|
977
|
+
return postApiV3Importlist({ body: importList });
|
|
978
|
+
}
|
|
979
|
+
async updateImportList(id, importList) {
|
|
980
|
+
return putApiV3ImportlistById({ path: { id }, body: importList });
|
|
981
|
+
}
|
|
982
|
+
async deleteImportList(id) {
|
|
983
|
+
return deleteApiV3ImportlistById({ path: { id } });
|
|
984
|
+
}
|
|
985
|
+
async getImportListSchema() {
|
|
986
|
+
return getApiV3ImportlistSchema();
|
|
987
|
+
}
|
|
988
|
+
async testImportList(importList) {
|
|
989
|
+
return postApiV3ImportlistTest({ body: importList });
|
|
990
|
+
}
|
|
991
|
+
async testAllImportLists() {
|
|
992
|
+
return postApiV3ImportlistTestall();
|
|
993
|
+
}
|
|
994
|
+
async getIndexers() {
|
|
995
|
+
return getApiV3Indexer();
|
|
996
|
+
}
|
|
997
|
+
async getIndexer(id) {
|
|
998
|
+
return getApiV3IndexerById({ path: { id } });
|
|
999
|
+
}
|
|
1000
|
+
async addIndexer(indexer) {
|
|
1001
|
+
return postApiV3Indexer({ body: indexer });
|
|
1002
|
+
}
|
|
1003
|
+
async updateIndexer(id, indexer) {
|
|
1004
|
+
return putApiV3IndexerById({ path: { id }, body: indexer });
|
|
1005
|
+
}
|
|
1006
|
+
async deleteIndexer(id) {
|
|
1007
|
+
return deleteApiV3IndexerById({ path: { id } });
|
|
1008
|
+
}
|
|
1009
|
+
async getIndexerSchema() {
|
|
1010
|
+
return getApiV3IndexerSchema();
|
|
1011
|
+
}
|
|
1012
|
+
async testIndexer(indexer) {
|
|
1013
|
+
return postApiV3IndexerTest({ body: indexer });
|
|
1014
|
+
}
|
|
1015
|
+
async testAllIndexers() {
|
|
1016
|
+
return postApiV3IndexerTestall();
|
|
1017
|
+
}
|
|
1018
|
+
async getHistory(page, pageSize, sortKey, sortDirection, movieId) {
|
|
1019
|
+
const query = {};
|
|
1020
|
+
if (page !== undefined)
|
|
1021
|
+
query.page = page;
|
|
1022
|
+
if (pageSize !== undefined)
|
|
1023
|
+
query.pageSize = pageSize;
|
|
1024
|
+
if (sortKey)
|
|
1025
|
+
query.sortKey = sortKey;
|
|
1026
|
+
if (sortDirection)
|
|
1027
|
+
query.sortDirection = sortDirection;
|
|
1028
|
+
if (movieId !== undefined)
|
|
1029
|
+
query.movieId = movieId;
|
|
1030
|
+
return getApiV3History(Object.keys(query).length > 0 ? { query } : {});
|
|
1031
|
+
}
|
|
1032
|
+
async getHistorySince(date, movieId) {
|
|
1033
|
+
const query = { date };
|
|
1034
|
+
if (movieId !== undefined)
|
|
1035
|
+
query.movieId = movieId;
|
|
1036
|
+
return getApiV3HistorySince({ query });
|
|
1037
|
+
}
|
|
1038
|
+
async getMovieHistory(movieId, eventType) {
|
|
1039
|
+
const query = { movieId };
|
|
1040
|
+
if (eventType !== undefined)
|
|
1041
|
+
query.eventType = eventType;
|
|
1042
|
+
return getApiV3HistoryMovie({ query });
|
|
1043
|
+
}
|
|
1044
|
+
async markHistoryItemFailed(id) {
|
|
1045
|
+
return postApiV3HistoryFailedById({ path: { id } });
|
|
1046
|
+
}
|
|
1047
|
+
updateConfig(newConfig) {
|
|
1048
|
+
const updatedConfig = { ...this.clientConfig.config, ...newConfig };
|
|
1049
|
+
this.clientConfig = createServarrClient(updatedConfig);
|
|
1050
|
+
client.setConfig({
|
|
1051
|
+
baseUrl: this.clientConfig.getBaseUrl(),
|
|
1052
|
+
headers: this.clientConfig.getHeaders()
|
|
1053
|
+
});
|
|
1054
|
+
return this.clientConfig.config;
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
export {
|
|
1058
|
+
RadarrClient
|
|
1059
|
+
};
|