tsarr 2.9.0 → 2.10.0
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/README.md +7 -5
- package/dist/cli/commands/bazarr.d.ts +2 -0
- package/dist/cli/commands/bazarr.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/lidarr.d.ts +2 -0
- package/dist/cli/commands/lidarr.d.ts.map +1 -1
- package/dist/cli/commands/radarr.d.ts.map +1 -1
- package/dist/cli/commands/readarr.d.ts +2 -0
- package/dist/cli/commands/readarr.d.ts.map +1 -1
- package/dist/cli/commands/sonarr.d.ts.map +1 -1
- package/dist/cli/index.js +2138 -2405
- package/dist/clients/base.d.ts +136 -0
- package/dist/clients/base.d.ts.map +1 -0
- package/dist/clients/bazarr.d.ts +1 -1
- package/dist/clients/bazarr.d.ts.map +1 -1
- package/dist/clients/bazarr.js +100 -3
- package/dist/clients/lidarr.d.ts +24 -681
- package/dist/clients/lidarr.d.ts.map +1 -1
- package/dist/clients/lidarr.js +323 -196
- package/dist/clients/prowlarr.d.ts +25 -638
- package/dist/clients/prowlarr.d.ts.map +1 -1
- package/dist/clients/prowlarr.js +331 -175
- package/dist/clients/qbittorrent.d.ts +1 -17
- package/dist/clients/qbittorrent.d.ts.map +1 -1
- package/dist/clients/qbittorrent.js +97 -2
- package/dist/clients/radarr.d.ts +4 -657
- package/dist/clients/radarr.d.ts.map +1 -1
- package/dist/clients/radarr.js +323 -164
- package/dist/clients/readarr.d.ts +4 -635
- package/dist/clients/readarr.d.ts.map +1 -1
- package/dist/clients/readarr.js +323 -164
- package/dist/clients/seerr.d.ts +1 -1
- package/dist/clients/seerr.d.ts.map +1 -1
- package/dist/clients/seerr.js +100 -3
- package/dist/clients/sonarr.d.ts +181 -772
- package/dist/clients/sonarr.d.ts.map +1 -1
- package/dist/clients/sonarr.js +346 -157
- package/dist/core/client.d.ts +3 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/fetch.d.ts +23 -0
- package/dist/core/fetch.d.ts.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/types.d.ts +7 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tsarr-2.10.0.tgz +0 -0
- package/package.json +2 -4
- package/dist/tsarr-2.9.0.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radarr.d.ts","sourceRoot":"","sources":["../../src/clients/radarr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radarr.d.ts","sourceRoot":"","sources":["../../src/clients/radarr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC7B,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AAEvC,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAmEhC;gBAEU,MAAM,EAAE,mBAAmB;IAMvC;;OAEG;IACG,SAAS;;;;;;;;;;IAIf;;OAEG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAIzB;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,aAAa;;;;;;;;;;IAI7B,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;;;;;;;;;;IAI5C,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,O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;;;;CAGnB;AAGD,cAAc,mBAAmB,CAAC"}
|
package/dist/clients/radarr.js
CHANGED
|
@@ -26,7 +26,95 @@ class ConnectionError extends TsarrError {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// src/core/fetch.ts
|
|
30
|
+
var DEFAULT_TIMEOUT = 30000;
|
|
31
|
+
var DEFAULT_MAX_RETRIES = 3;
|
|
32
|
+
var DEFAULT_INITIAL_DELAY = 1000;
|
|
33
|
+
var DEFAULT_MAX_DELAY = 1e4;
|
|
34
|
+
var RETRYABLE_STATUS_CODES = new Set([408, 429, 502, 503, 504]);
|
|
35
|
+
function isRetryable(error) {
|
|
36
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
if (error instanceof TypeError) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
function getRetryDelay(attempt, initialDelayMs, maxDelayMs) {
|
|
45
|
+
const delay = initialDelayMs * 2 ** attempt;
|
|
46
|
+
const jitter = delay * 0.2 * Math.random();
|
|
47
|
+
return Math.min(delay + jitter, maxDelayMs);
|
|
48
|
+
}
|
|
49
|
+
function createResilientFetch(options = {}) {
|
|
50
|
+
const timeout = options.timeout ?? DEFAULT_TIMEOUT;
|
|
51
|
+
const maxRetries = options.retry ? options.retry.maxRetries ?? DEFAULT_MAX_RETRIES : 0;
|
|
52
|
+
const initialDelayMs = options.retry?.initialDelayMs ?? DEFAULT_INITIAL_DELAY;
|
|
53
|
+
const maxDelayMs = options.retry?.maxDelayMs ?? DEFAULT_MAX_DELAY;
|
|
54
|
+
const resilientFetch = async (input, init) => {
|
|
55
|
+
let lastError;
|
|
56
|
+
const template = createRequestTemplate(input, init);
|
|
57
|
+
for (let attempt = 0;attempt <= maxRetries; attempt++) {
|
|
58
|
+
const controller = new AbortController;
|
|
59
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
60
|
+
const callerSignal = init?.signal;
|
|
61
|
+
if (callerSignal?.aborted) {
|
|
62
|
+
clearTimeout(timeoutId);
|
|
63
|
+
throw callerSignal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
64
|
+
}
|
|
65
|
+
const onCallerAbort = () => controller.abort(callerSignal.reason);
|
|
66
|
+
callerSignal?.addEventListener("abort", onCallerAbort, { once: true });
|
|
67
|
+
try {
|
|
68
|
+
const response = await globalThis.fetch(new Request(template.clone(), { signal: controller.signal }));
|
|
69
|
+
clearTimeout(timeoutId);
|
|
70
|
+
callerSignal?.removeEventListener("abort", onCallerAbort);
|
|
71
|
+
if (RETRYABLE_STATUS_CODES.has(response.status) && attempt < maxRetries) {
|
|
72
|
+
lastError = new ConnectionError(`Request failed with status ${response.status}`);
|
|
73
|
+
const delay = getRetryDelay(attempt, initialDelayMs, maxDelayMs);
|
|
74
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
return response;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
clearTimeout(timeoutId);
|
|
80
|
+
callerSignal?.removeEventListener("abort", onCallerAbort);
|
|
81
|
+
if (callerSignal?.aborted) {
|
|
82
|
+
throw callerSignal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
83
|
+
}
|
|
84
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
85
|
+
lastError = new ConnectionError(`Request timed out after ${timeout}ms`);
|
|
86
|
+
if (attempt < maxRetries) {
|
|
87
|
+
const delay = getRetryDelay(attempt, initialDelayMs, maxDelayMs);
|
|
88
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
throw lastError;
|
|
92
|
+
}
|
|
93
|
+
if (isRetryable(error) && attempt < maxRetries) {
|
|
94
|
+
lastError = error;
|
|
95
|
+
const delay = getRetryDelay(attempt, initialDelayMs, maxDelayMs);
|
|
96
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
throw lastError;
|
|
103
|
+
};
|
|
104
|
+
return Object.assign(resilientFetch, {
|
|
105
|
+
preconnect: globalThis.fetch.preconnect?.bind(globalThis.fetch)
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function createRequestTemplate(input, init) {
|
|
109
|
+
const { signal: _signal, ...requestInit } = init ?? {};
|
|
110
|
+
if (input instanceof Request) {
|
|
111
|
+
return init ? new Request(input.clone(), requestInit) : input.clone();
|
|
112
|
+
}
|
|
113
|
+
return new Request(input, requestInit);
|
|
114
|
+
}
|
|
115
|
+
|
|
29
116
|
// src/core/client.ts
|
|
117
|
+
var DEFAULT_TIMEOUT_MS = 30000;
|
|
30
118
|
function createServarrClient(config) {
|
|
31
119
|
if (!config.apiKey) {
|
|
32
120
|
throw new ApiKeyError;
|
|
@@ -38,6 +126,11 @@ function createServarrClient(config) {
|
|
|
38
126
|
...config,
|
|
39
127
|
baseUrl: config.baseUrl.replace(/\/$/, "")
|
|
40
128
|
};
|
|
129
|
+
const timeoutMs = validatedConfig.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
130
|
+
const resilientFetch = createResilientFetch({
|
|
131
|
+
timeout: timeoutMs,
|
|
132
|
+
retry: validatedConfig.retry
|
|
133
|
+
});
|
|
41
134
|
return {
|
|
42
135
|
config: validatedConfig,
|
|
43
136
|
getHeaders: () => ({
|
|
@@ -45,10 +138,186 @@ function createServarrClient(config) {
|
|
|
45
138
|
"Content-Type": "application/json",
|
|
46
139
|
...validatedConfig.headers
|
|
47
140
|
}),
|
|
48
|
-
getBaseUrl: () => validatedConfig.baseUrl
|
|
141
|
+
getBaseUrl: () => validatedConfig.baseUrl,
|
|
142
|
+
getTimeout: () => timeoutMs,
|
|
143
|
+
getFetch: () => resilientFetch
|
|
49
144
|
};
|
|
50
145
|
}
|
|
51
146
|
|
|
147
|
+
// src/clients/base.ts
|
|
148
|
+
class ServarrBaseClient {
|
|
149
|
+
clientConfig;
|
|
150
|
+
rawClient;
|
|
151
|
+
constructor(config, rawClient) {
|
|
152
|
+
this.rawClient = rawClient;
|
|
153
|
+
this.clientConfig = createServarrClient(config);
|
|
154
|
+
this.configureRawClient();
|
|
155
|
+
}
|
|
156
|
+
configureRawClient() {
|
|
157
|
+
this.rawClient.setConfig(this.getClientConfig());
|
|
158
|
+
}
|
|
159
|
+
getClientConfig() {
|
|
160
|
+
return {
|
|
161
|
+
baseUrl: this.clientConfig.getBaseUrl(),
|
|
162
|
+
headers: this.clientConfig.getHeaders(),
|
|
163
|
+
fetch: this.clientConfig.getFetch()
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async getSystemStatus() {
|
|
167
|
+
return this.ops.getSystemStatus();
|
|
168
|
+
}
|
|
169
|
+
async getHealth() {
|
|
170
|
+
return this.ops.getHealth();
|
|
171
|
+
}
|
|
172
|
+
async getTags() {
|
|
173
|
+
return this.ops.getTags();
|
|
174
|
+
}
|
|
175
|
+
async addTag(tag) {
|
|
176
|
+
return this.ops.createTag({ body: tag });
|
|
177
|
+
}
|
|
178
|
+
async getTag(id) {
|
|
179
|
+
return this.ops.getTagById({ path: { id } });
|
|
180
|
+
}
|
|
181
|
+
async updateTag(id, tag) {
|
|
182
|
+
return this.ops.updateTagById({ path: { id: String(id) }, body: tag });
|
|
183
|
+
}
|
|
184
|
+
async deleteTag(id) {
|
|
185
|
+
return this.ops.deleteTagById({ path: { id } });
|
|
186
|
+
}
|
|
187
|
+
async getTagDetails() {
|
|
188
|
+
return this.ops.getTagDetails();
|
|
189
|
+
}
|
|
190
|
+
async getTagDetailById(id) {
|
|
191
|
+
return this.ops.getTagDetailById({ path: { id } });
|
|
192
|
+
}
|
|
193
|
+
async getNotifications() {
|
|
194
|
+
return this.ops.getNotifications();
|
|
195
|
+
}
|
|
196
|
+
async getNotification(id) {
|
|
197
|
+
return this.ops.getNotificationById({ path: { id } });
|
|
198
|
+
}
|
|
199
|
+
async addNotification(notification) {
|
|
200
|
+
return this.ops.createNotification({ body: notification });
|
|
201
|
+
}
|
|
202
|
+
async updateNotification(id, notification) {
|
|
203
|
+
return this.ops.updateNotificationById({ path: { id: String(id) }, body: notification });
|
|
204
|
+
}
|
|
205
|
+
async deleteNotification(id) {
|
|
206
|
+
return this.ops.deleteNotificationById({ path: { id } });
|
|
207
|
+
}
|
|
208
|
+
async getNotificationSchema() {
|
|
209
|
+
return this.ops.getNotificationSchema();
|
|
210
|
+
}
|
|
211
|
+
async testNotification(notification) {
|
|
212
|
+
return this.ops.testNotification({ body: notification });
|
|
213
|
+
}
|
|
214
|
+
async testAllNotifications() {
|
|
215
|
+
return this.ops.testAllNotifications();
|
|
216
|
+
}
|
|
217
|
+
async getDownloadClients() {
|
|
218
|
+
return this.ops.getDownloadClients();
|
|
219
|
+
}
|
|
220
|
+
async getDownloadClient(id) {
|
|
221
|
+
return this.ops.getDownloadClientById({ path: { id } });
|
|
222
|
+
}
|
|
223
|
+
async addDownloadClient(client) {
|
|
224
|
+
return this.ops.createDownloadClient({ body: client });
|
|
225
|
+
}
|
|
226
|
+
async updateDownloadClient(id, client) {
|
|
227
|
+
return this.ops.updateDownloadClientById({ path: { id: String(id) }, body: client });
|
|
228
|
+
}
|
|
229
|
+
async deleteDownloadClient(id) {
|
|
230
|
+
return this.ops.deleteDownloadClientById({ path: { id } });
|
|
231
|
+
}
|
|
232
|
+
async getDownloadClientSchema() {
|
|
233
|
+
return this.ops.getDownloadClientSchema();
|
|
234
|
+
}
|
|
235
|
+
async testDownloadClient(client) {
|
|
236
|
+
return this.ops.testDownloadClient({ body: client });
|
|
237
|
+
}
|
|
238
|
+
async testAllDownloadClients() {
|
|
239
|
+
return this.ops.testAllDownloadClients();
|
|
240
|
+
}
|
|
241
|
+
async getIndexers() {
|
|
242
|
+
return this.ops.getIndexers();
|
|
243
|
+
}
|
|
244
|
+
async getIndexer(id) {
|
|
245
|
+
return this.ops.getIndexerById({ path: { id } });
|
|
246
|
+
}
|
|
247
|
+
async addIndexer(indexer) {
|
|
248
|
+
return this.ops.createIndexer({ body: indexer });
|
|
249
|
+
}
|
|
250
|
+
async updateIndexer(id, indexer) {
|
|
251
|
+
return this.ops.updateIndexerById({ path: { id: String(id) }, body: indexer });
|
|
252
|
+
}
|
|
253
|
+
async deleteIndexer(id) {
|
|
254
|
+
return this.ops.deleteIndexerById({ path: { id } });
|
|
255
|
+
}
|
|
256
|
+
async getIndexerSchema() {
|
|
257
|
+
return this.ops.getIndexerSchema();
|
|
258
|
+
}
|
|
259
|
+
async testIndexer(indexer) {
|
|
260
|
+
return this.ops.testIndexer({ body: indexer });
|
|
261
|
+
}
|
|
262
|
+
async testAllIndexers() {
|
|
263
|
+
return this.ops.testAllIndexers();
|
|
264
|
+
}
|
|
265
|
+
async restartSystem() {
|
|
266
|
+
return this.ops.restartSystem();
|
|
267
|
+
}
|
|
268
|
+
async shutdownSystem() {
|
|
269
|
+
return this.ops.shutdownSystem();
|
|
270
|
+
}
|
|
271
|
+
async getSystemBackups() {
|
|
272
|
+
return this.ops.getBackups();
|
|
273
|
+
}
|
|
274
|
+
async deleteSystemBackup(id) {
|
|
275
|
+
return this.ops.deleteBackup({ path: { id } });
|
|
276
|
+
}
|
|
277
|
+
async restoreSystemBackup(id) {
|
|
278
|
+
return this.ops.restoreBackup({ path: { id } });
|
|
279
|
+
}
|
|
280
|
+
async uploadSystemBackup() {
|
|
281
|
+
return this.ops.uploadBackup();
|
|
282
|
+
}
|
|
283
|
+
async getLogFiles() {
|
|
284
|
+
return this.ops.getLogFiles();
|
|
285
|
+
}
|
|
286
|
+
async getLogFileByName(filename) {
|
|
287
|
+
return this.ops.getLogFileByName({ path: { filename } });
|
|
288
|
+
}
|
|
289
|
+
async runCommand(command) {
|
|
290
|
+
return this.ops.runCommand({ body: command });
|
|
291
|
+
}
|
|
292
|
+
async getCommands() {
|
|
293
|
+
return this.ops.getCommands();
|
|
294
|
+
}
|
|
295
|
+
async getHostConfig() {
|
|
296
|
+
return this.ops.getHostConfig();
|
|
297
|
+
}
|
|
298
|
+
async getHostConfigById(id) {
|
|
299
|
+
return this.ops.getHostConfigById({ path: { id } });
|
|
300
|
+
}
|
|
301
|
+
async updateHostConfig(id, config) {
|
|
302
|
+
return this.ops.updateHostConfig({ path: { id: String(id) }, body: config });
|
|
303
|
+
}
|
|
304
|
+
async getUiConfig() {
|
|
305
|
+
return this.ops.getUiConfig();
|
|
306
|
+
}
|
|
307
|
+
async getUiConfigById(id) {
|
|
308
|
+
return this.ops.getUiConfigById({ path: { id } });
|
|
309
|
+
}
|
|
310
|
+
async updateUiConfig(id, config) {
|
|
311
|
+
return this.ops.updateUiConfig({ path: { id: String(id) }, body: config });
|
|
312
|
+
}
|
|
313
|
+
updateConfig(newConfig) {
|
|
314
|
+
const updatedConfig = { ...this.clientConfig.config, ...newConfig };
|
|
315
|
+
this.clientConfig = createServarrClient(updatedConfig);
|
|
316
|
+
this.configureRawClient();
|
|
317
|
+
return this.clientConfig.config;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
52
321
|
// src/generated/radarr/core/bodySerializer.gen.ts
|
|
53
322
|
var jsonBodySerializer = {
|
|
54
323
|
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
|
|
@@ -2083,20 +2352,60 @@ var getApiV3ConfigUi = (options) => (options?.client ?? client).get({
|
|
|
2083
2352
|
...options
|
|
2084
2353
|
});
|
|
2085
2354
|
// src/clients/radarr.ts
|
|
2086
|
-
class RadarrClient {
|
|
2087
|
-
|
|
2355
|
+
class RadarrClient extends ServarrBaseClient {
|
|
2356
|
+
ops = {
|
|
2357
|
+
getSystemStatus: getApiV3SystemStatus,
|
|
2358
|
+
getHealth: getApiV3Health,
|
|
2359
|
+
getTags: getApiV3Tag,
|
|
2360
|
+
createTag: postApiV3Tag,
|
|
2361
|
+
getTagById: getApiV3TagById,
|
|
2362
|
+
updateTagById: putApiV3TagById,
|
|
2363
|
+
deleteTagById: deleteApiV3TagById,
|
|
2364
|
+
getTagDetails: getApiV3TagDetail,
|
|
2365
|
+
getTagDetailById: getApiV3TagDetailById,
|
|
2366
|
+
getNotifications: getApiV3Notification,
|
|
2367
|
+
createNotification: postApiV3Notification,
|
|
2368
|
+
getNotificationById: getApiV3NotificationById,
|
|
2369
|
+
updateNotificationById: putApiV3NotificationById,
|
|
2370
|
+
deleteNotificationById: deleteApiV3NotificationById,
|
|
2371
|
+
getNotificationSchema: getApiV3NotificationSchema,
|
|
2372
|
+
testNotification: postApiV3NotificationTest,
|
|
2373
|
+
testAllNotifications: postApiV3NotificationTestall,
|
|
2374
|
+
getDownloadClients: getApiV3Downloadclient,
|
|
2375
|
+
createDownloadClient: postApiV3Downloadclient,
|
|
2376
|
+
getDownloadClientById: getApiV3DownloadclientById,
|
|
2377
|
+
updateDownloadClientById: putApiV3DownloadclientById,
|
|
2378
|
+
deleteDownloadClientById: deleteApiV3DownloadclientById,
|
|
2379
|
+
getDownloadClientSchema: getApiV3DownloadclientSchema,
|
|
2380
|
+
testDownloadClient: postApiV3DownloadclientTest,
|
|
2381
|
+
testAllDownloadClients: postApiV3DownloadclientTestall,
|
|
2382
|
+
getIndexers: getApiV3Indexer,
|
|
2383
|
+
createIndexer: postApiV3Indexer,
|
|
2384
|
+
getIndexerById: getApiV3IndexerById,
|
|
2385
|
+
updateIndexerById: putApiV3IndexerById,
|
|
2386
|
+
deleteIndexerById: deleteApiV3IndexerById,
|
|
2387
|
+
getIndexerSchema: getApiV3IndexerSchema,
|
|
2388
|
+
testIndexer: postApiV3IndexerTest,
|
|
2389
|
+
testAllIndexers: postApiV3IndexerTestall,
|
|
2390
|
+
restartSystem: postApiV3SystemRestart,
|
|
2391
|
+
shutdownSystem: postApiV3SystemShutdown,
|
|
2392
|
+
getBackups: getApiV3SystemBackup,
|
|
2393
|
+
deleteBackup: deleteApiV3SystemBackupById,
|
|
2394
|
+
restoreBackup: postApiV3SystemBackupRestoreById,
|
|
2395
|
+
uploadBackup: postApiV3SystemBackupRestoreUpload,
|
|
2396
|
+
getLogFiles: getApiV3LogFile,
|
|
2397
|
+
getLogFileByName: getApiV3LogFileByFilename,
|
|
2398
|
+
runCommand: postApiV3Command,
|
|
2399
|
+
getCommands: getApiV3Command,
|
|
2400
|
+
getHostConfig: getApiV3ConfigHost,
|
|
2401
|
+
getHostConfigById: getApiV3ConfigHostById,
|
|
2402
|
+
updateHostConfig: putApiV3ConfigHostById,
|
|
2403
|
+
getUiConfig: getApiV3ConfigUi,
|
|
2404
|
+
getUiConfigById: getApiV3ConfigUiById,
|
|
2405
|
+
updateUiConfig: putApiV3ConfigUiById
|
|
2406
|
+
};
|
|
2088
2407
|
constructor(config) {
|
|
2089
|
-
|
|
2090
|
-
client.setConfig({
|
|
2091
|
-
baseUrl: this.clientConfig.getBaseUrl(),
|
|
2092
|
-
headers: this.clientConfig.getHeaders()
|
|
2093
|
-
});
|
|
2094
|
-
}
|
|
2095
|
-
async getSystemStatus() {
|
|
2096
|
-
return getApiV3SystemStatus();
|
|
2097
|
-
}
|
|
2098
|
-
async getHealth() {
|
|
2099
|
-
return getApiV3Health();
|
|
2408
|
+
super(config, client);
|
|
2100
2409
|
}
|
|
2101
2410
|
async getMovies() {
|
|
2102
2411
|
return getApiV3Movie();
|
|
@@ -2154,12 +2463,6 @@ class RadarrClient {
|
|
|
2154
2463
|
}
|
|
2155
2464
|
return getApiV3MovieLookupImdb({ query: { imdbId: value } });
|
|
2156
2465
|
}
|
|
2157
|
-
async runCommand(command) {
|
|
2158
|
-
return postApiV3Command({ body: command });
|
|
2159
|
-
}
|
|
2160
|
-
async getCommands() {
|
|
2161
|
-
return getApiV3Command();
|
|
2162
|
-
}
|
|
2163
2466
|
async getRootFolders() {
|
|
2164
2467
|
return getApiV3Rootfolder();
|
|
2165
2468
|
}
|
|
@@ -2248,60 +2551,12 @@ class RadarrClient {
|
|
|
2248
2551
|
async getCustomFormatSchema() {
|
|
2249
2552
|
return getApiV3CustomformatSchema();
|
|
2250
2553
|
}
|
|
2251
|
-
async getDownloadClients() {
|
|
2252
|
-
return getApiV3Downloadclient();
|
|
2253
|
-
}
|
|
2254
|
-
async getDownloadClient(id) {
|
|
2255
|
-
return getApiV3DownloadclientById({ path: { id } });
|
|
2256
|
-
}
|
|
2257
|
-
async addDownloadClient(client2) {
|
|
2258
|
-
return postApiV3Downloadclient({ body: client2 });
|
|
2259
|
-
}
|
|
2260
|
-
async updateDownloadClient(id, client2) {
|
|
2261
|
-
return putApiV3DownloadclientById({ path: { id }, body: client2 });
|
|
2262
|
-
}
|
|
2263
|
-
async deleteDownloadClient(id) {
|
|
2264
|
-
return deleteApiV3DownloadclientById({ path: { id } });
|
|
2265
|
-
}
|
|
2266
2554
|
async updateDownloadClientsBulk(clients) {
|
|
2267
2555
|
return putApiV3DownloadclientBulk({ body: clients });
|
|
2268
2556
|
}
|
|
2269
2557
|
async deleteDownloadClientsBulk(ids) {
|
|
2270
2558
|
return deleteApiV3DownloadclientBulk({ body: { ids } });
|
|
2271
2559
|
}
|
|
2272
|
-
async getDownloadClientSchema() {
|
|
2273
|
-
return getApiV3DownloadclientSchema();
|
|
2274
|
-
}
|
|
2275
|
-
async testDownloadClient(client2) {
|
|
2276
|
-
return postApiV3DownloadclientTest({ body: client2 });
|
|
2277
|
-
}
|
|
2278
|
-
async testAllDownloadClients() {
|
|
2279
|
-
return postApiV3DownloadclientTestall();
|
|
2280
|
-
}
|
|
2281
|
-
async getNotifications() {
|
|
2282
|
-
return getApiV3Notification();
|
|
2283
|
-
}
|
|
2284
|
-
async getNotification(id) {
|
|
2285
|
-
return getApiV3NotificationById({ path: { id } });
|
|
2286
|
-
}
|
|
2287
|
-
async addNotification(notification) {
|
|
2288
|
-
return postApiV3Notification({ body: notification });
|
|
2289
|
-
}
|
|
2290
|
-
async updateNotification(id, notification) {
|
|
2291
|
-
return putApiV3NotificationById({ path: { id }, body: notification });
|
|
2292
|
-
}
|
|
2293
|
-
async deleteNotification(id) {
|
|
2294
|
-
return deleteApiV3NotificationById({ path: { id } });
|
|
2295
|
-
}
|
|
2296
|
-
async getNotificationSchema() {
|
|
2297
|
-
return getApiV3NotificationSchema();
|
|
2298
|
-
}
|
|
2299
|
-
async testNotification(notification) {
|
|
2300
|
-
return postApiV3NotificationTest({ body: notification });
|
|
2301
|
-
}
|
|
2302
|
-
async testAllNotifications() {
|
|
2303
|
-
return postApiV3NotificationTestall();
|
|
2304
|
-
}
|
|
2305
2560
|
async getCalendar(startDate, endDate, unmonitored) {
|
|
2306
2561
|
const query = {};
|
|
2307
2562
|
if (startDate)
|
|
@@ -2396,30 +2651,6 @@ class RadarrClient {
|
|
|
2396
2651
|
async testAllImportLists() {
|
|
2397
2652
|
return postApiV3ImportlistTestall();
|
|
2398
2653
|
}
|
|
2399
|
-
async getIndexers() {
|
|
2400
|
-
return getApiV3Indexer();
|
|
2401
|
-
}
|
|
2402
|
-
async getIndexer(id) {
|
|
2403
|
-
return getApiV3IndexerById({ path: { id } });
|
|
2404
|
-
}
|
|
2405
|
-
async addIndexer(indexer) {
|
|
2406
|
-
return postApiV3Indexer({ body: indexer });
|
|
2407
|
-
}
|
|
2408
|
-
async updateIndexer(id, indexer) {
|
|
2409
|
-
return putApiV3IndexerById({ path: { id }, body: indexer });
|
|
2410
|
-
}
|
|
2411
|
-
async deleteIndexer(id) {
|
|
2412
|
-
return deleteApiV3IndexerById({ path: { id } });
|
|
2413
|
-
}
|
|
2414
|
-
async getIndexerSchema() {
|
|
2415
|
-
return getApiV3IndexerSchema();
|
|
2416
|
-
}
|
|
2417
|
-
async testIndexer(indexer) {
|
|
2418
|
-
return postApiV3IndexerTest({ body: indexer });
|
|
2419
|
-
}
|
|
2420
|
-
async testAllIndexers() {
|
|
2421
|
-
return postApiV3IndexerTestall();
|
|
2422
|
-
}
|
|
2423
2654
|
async getHistory(page, pageSize, sortKey, sortDirection, movieId, downloadId) {
|
|
2424
2655
|
const query = {};
|
|
2425
2656
|
if (page !== undefined)
|
|
@@ -2485,15 +2716,6 @@ class RadarrClient {
|
|
|
2485
2716
|
query.pageSize = pageSize;
|
|
2486
2717
|
return getApiV3WantedCutoff(Object.keys(query).length > 0 ? { query } : {});
|
|
2487
2718
|
}
|
|
2488
|
-
async getHostConfig() {
|
|
2489
|
-
return getApiV3ConfigHost();
|
|
2490
|
-
}
|
|
2491
|
-
async getHostConfigById(id) {
|
|
2492
|
-
return getApiV3ConfigHostById({ path: { id } });
|
|
2493
|
-
}
|
|
2494
|
-
async updateHostConfig(id, config) {
|
|
2495
|
-
return putApiV3ConfigHostById({ path: { id: String(id) }, body: config });
|
|
2496
|
-
}
|
|
2497
2719
|
async getNamingConfig() {
|
|
2498
2720
|
return getApiV3ConfigNaming();
|
|
2499
2721
|
}
|
|
@@ -2515,75 +2737,12 @@ class RadarrClient {
|
|
|
2515
2737
|
async updateMediaManagementConfig(id, config) {
|
|
2516
2738
|
return putApiV3ConfigMediamanagementById({ path: { id: String(id) }, body: config });
|
|
2517
2739
|
}
|
|
2518
|
-
async getUiConfig() {
|
|
2519
|
-
return getApiV3ConfigUi();
|
|
2520
|
-
}
|
|
2521
|
-
async getUiConfigById(id) {
|
|
2522
|
-
return getApiV3ConfigUiById({ path: { id } });
|
|
2523
|
-
}
|
|
2524
|
-
async updateUiConfig(id, config) {
|
|
2525
|
-
return putApiV3ConfigUiById({ path: { id: String(id) }, body: config });
|
|
2526
|
-
}
|
|
2527
|
-
async restartSystem() {
|
|
2528
|
-
return postApiV3SystemRestart();
|
|
2529
|
-
}
|
|
2530
|
-
async shutdownSystem() {
|
|
2531
|
-
return postApiV3SystemShutdown();
|
|
2532
|
-
}
|
|
2533
|
-
async getSystemBackups() {
|
|
2534
|
-
return getApiV3SystemBackup();
|
|
2535
|
-
}
|
|
2536
|
-
async deleteSystemBackup(id) {
|
|
2537
|
-
return deleteApiV3SystemBackupById({ path: { id } });
|
|
2538
|
-
}
|
|
2539
|
-
async restoreSystemBackup(id) {
|
|
2540
|
-
return postApiV3SystemBackupRestoreById({ path: { id } });
|
|
2541
|
-
}
|
|
2542
|
-
async uploadSystemBackup() {
|
|
2543
|
-
return postApiV3SystemBackupRestoreUpload();
|
|
2544
|
-
}
|
|
2545
2740
|
async getSystemLogs() {
|
|
2546
2741
|
return getApiV3Log();
|
|
2547
2742
|
}
|
|
2548
|
-
async getLogFiles() {
|
|
2549
|
-
return getApiV3LogFile();
|
|
2550
|
-
}
|
|
2551
|
-
async getLogFileByName(filename) {
|
|
2552
|
-
return getApiV3LogFileByFilename({ path: { filename } });
|
|
2553
|
-
}
|
|
2554
2743
|
async getDiskSpace() {
|
|
2555
2744
|
return getApiV3Diskspace();
|
|
2556
2745
|
}
|
|
2557
|
-
async getTags() {
|
|
2558
|
-
return getApiV3Tag();
|
|
2559
|
-
}
|
|
2560
|
-
async addTag(tag) {
|
|
2561
|
-
return postApiV3Tag({ body: tag });
|
|
2562
|
-
}
|
|
2563
|
-
async getTag(id) {
|
|
2564
|
-
return getApiV3TagById({ path: { id } });
|
|
2565
|
-
}
|
|
2566
|
-
async updateTag(id, tag) {
|
|
2567
|
-
return putApiV3TagById({ path: { id: String(id) }, body: tag });
|
|
2568
|
-
}
|
|
2569
|
-
async deleteTag(id) {
|
|
2570
|
-
return deleteApiV3TagById({ path: { id } });
|
|
2571
|
-
}
|
|
2572
|
-
async getTagDetails() {
|
|
2573
|
-
return getApiV3TagDetail();
|
|
2574
|
-
}
|
|
2575
|
-
async getTagDetailById(id) {
|
|
2576
|
-
return getApiV3TagDetailById({ path: { id } });
|
|
2577
|
-
}
|
|
2578
|
-
updateConfig(newConfig) {
|
|
2579
|
-
const updatedConfig = { ...this.clientConfig.config, ...newConfig };
|
|
2580
|
-
this.clientConfig = createServarrClient(updatedConfig);
|
|
2581
|
-
client.setConfig({
|
|
2582
|
-
baseUrl: this.clientConfig.getBaseUrl(),
|
|
2583
|
-
headers: this.clientConfig.getHeaders()
|
|
2584
|
-
});
|
|
2585
|
-
return this.clientConfig.config;
|
|
2586
|
-
}
|
|
2587
2746
|
}
|
|
2588
2747
|
export {
|
|
2589
2748
|
RadarrClient
|