tsarr 2.9.0 → 2.9.1
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 +2704 -3072
- package/dist/clients/base.d.ts +131 -0
- package/dist/clients/base.d.ts.map +1 -0
- package/dist/clients/bazarr.d.ts +0 -1
- package/dist/clients/bazarr.d.ts.map +1 -1
- package/dist/clients/bazarr.js +8 -3
- package/dist/clients/lidarr.d.ts +25 -683
- package/dist/clients/lidarr.d.ts.map +1 -1
- package/dist/clients/lidarr.js +227 -197
- package/dist/clients/prowlarr.d.ts +26 -640
- package/dist/clients/prowlarr.d.ts.map +1 -1
- package/dist/clients/prowlarr.js +235 -176
- package/dist/clients/qbittorrent.d.ts +1 -17
- package/dist/clients/qbittorrent.d.ts.map +1 -1
- package/dist/clients/qbittorrent.js +8 -2
- package/dist/clients/radarr.d.ts +5 -659
- package/dist/clients/radarr.d.ts.map +1 -1
- package/dist/clients/radarr.js +227 -165
- package/dist/clients/readarr.d.ts +5 -637
- package/dist/clients/readarr.d.ts.map +1 -1
- package/dist/clients/readarr.js +227 -165
- package/dist/clients/seerr.d.ts +0 -1
- package/dist/clients/seerr.d.ts.map +1 -1
- package/dist/clients/seerr.js +8 -3
- package/dist/clients/sonarr.d.ts +182 -774
- package/dist/clients/sonarr.d.ts.map +1 -1
- package/dist/clients/sonarr.js +250 -158
- package/dist/core/client.d.ts +1 -0
- package/dist/core/client.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tsarr-2.9.1.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;AAErE,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;IAEF,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAMpC;;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,OAAO,CAAC;QAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;;;;IAS/F;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM;;;;;;;;;;IAI/B;;;;OAIG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;IAIxC;;;;O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
|
30
31
|
function createServarrClient(config) {
|
|
31
32
|
if (!config.apiKey) {
|
|
32
33
|
throw new ApiKeyError;
|
|
@@ -38,6 +39,7 @@ function createServarrClient(config) {
|
|
|
38
39
|
...config,
|
|
39
40
|
baseUrl: config.baseUrl.replace(/\/$/, "")
|
|
40
41
|
};
|
|
42
|
+
const timeoutMs = validatedConfig.timeout ?? DEFAULT_TIMEOUT_MS;
|
|
41
43
|
return {
|
|
42
44
|
config: validatedConfig,
|
|
43
45
|
getHeaders: () => ({
|
|
@@ -45,10 +47,180 @@ function createServarrClient(config) {
|
|
|
45
47
|
"Content-Type": "application/json",
|
|
46
48
|
...validatedConfig.headers
|
|
47
49
|
}),
|
|
48
|
-
getBaseUrl: () => validatedConfig.baseUrl
|
|
50
|
+
getBaseUrl: () => validatedConfig.baseUrl,
|
|
51
|
+
getTimeout: () => timeoutMs
|
|
49
52
|
};
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
// src/clients/base.ts
|
|
56
|
+
class ServarrBaseClient {
|
|
57
|
+
clientConfig;
|
|
58
|
+
constructor(config) {
|
|
59
|
+
this.clientConfig = createServarrClient(config);
|
|
60
|
+
this.configureRawClient();
|
|
61
|
+
}
|
|
62
|
+
getClientConfig() {
|
|
63
|
+
return {
|
|
64
|
+
baseUrl: this.clientConfig.getBaseUrl(),
|
|
65
|
+
headers: this.clientConfig.getHeaders(),
|
|
66
|
+
signal: AbortSignal.timeout(this.clientConfig.getTimeout())
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async getSystemStatus() {
|
|
70
|
+
return this.ops.getSystemStatus();
|
|
71
|
+
}
|
|
72
|
+
async getHealth() {
|
|
73
|
+
return this.ops.getHealth();
|
|
74
|
+
}
|
|
75
|
+
async getTags() {
|
|
76
|
+
return this.ops.getTags();
|
|
77
|
+
}
|
|
78
|
+
async addTag(tag) {
|
|
79
|
+
return this.ops.createTag({ body: tag });
|
|
80
|
+
}
|
|
81
|
+
async getTag(id) {
|
|
82
|
+
return this.ops.getTagById({ path: { id } });
|
|
83
|
+
}
|
|
84
|
+
async updateTag(id, tag) {
|
|
85
|
+
return this.ops.updateTagById({ path: { id: String(id) }, body: tag });
|
|
86
|
+
}
|
|
87
|
+
async deleteTag(id) {
|
|
88
|
+
return this.ops.deleteTagById({ path: { id } });
|
|
89
|
+
}
|
|
90
|
+
async getTagDetails() {
|
|
91
|
+
return this.ops.getTagDetails();
|
|
92
|
+
}
|
|
93
|
+
async getTagDetailById(id) {
|
|
94
|
+
return this.ops.getTagDetailById({ path: { id } });
|
|
95
|
+
}
|
|
96
|
+
async getNotifications() {
|
|
97
|
+
return this.ops.getNotifications();
|
|
98
|
+
}
|
|
99
|
+
async getNotification(id) {
|
|
100
|
+
return this.ops.getNotificationById({ path: { id } });
|
|
101
|
+
}
|
|
102
|
+
async addNotification(notification) {
|
|
103
|
+
return this.ops.createNotification({ body: notification });
|
|
104
|
+
}
|
|
105
|
+
async updateNotification(id, notification) {
|
|
106
|
+
return this.ops.updateNotificationById({ path: { id: String(id) }, body: notification });
|
|
107
|
+
}
|
|
108
|
+
async deleteNotification(id) {
|
|
109
|
+
return this.ops.deleteNotificationById({ path: { id } });
|
|
110
|
+
}
|
|
111
|
+
async getNotificationSchema() {
|
|
112
|
+
return this.ops.getNotificationSchema();
|
|
113
|
+
}
|
|
114
|
+
async testNotification(notification) {
|
|
115
|
+
return this.ops.testNotification({ body: notification });
|
|
116
|
+
}
|
|
117
|
+
async testAllNotifications() {
|
|
118
|
+
return this.ops.testAllNotifications();
|
|
119
|
+
}
|
|
120
|
+
async getDownloadClients() {
|
|
121
|
+
return this.ops.getDownloadClients();
|
|
122
|
+
}
|
|
123
|
+
async getDownloadClient(id) {
|
|
124
|
+
return this.ops.getDownloadClientById({ path: { id } });
|
|
125
|
+
}
|
|
126
|
+
async addDownloadClient(client) {
|
|
127
|
+
return this.ops.createDownloadClient({ body: client });
|
|
128
|
+
}
|
|
129
|
+
async updateDownloadClient(id, client) {
|
|
130
|
+
return this.ops.updateDownloadClientById({ path: { id: String(id) }, body: client });
|
|
131
|
+
}
|
|
132
|
+
async deleteDownloadClient(id) {
|
|
133
|
+
return this.ops.deleteDownloadClientById({ path: { id } });
|
|
134
|
+
}
|
|
135
|
+
async getDownloadClientSchema() {
|
|
136
|
+
return this.ops.getDownloadClientSchema();
|
|
137
|
+
}
|
|
138
|
+
async testDownloadClient(client) {
|
|
139
|
+
return this.ops.testDownloadClient({ body: client });
|
|
140
|
+
}
|
|
141
|
+
async testAllDownloadClients() {
|
|
142
|
+
return this.ops.testAllDownloadClients();
|
|
143
|
+
}
|
|
144
|
+
async getIndexers() {
|
|
145
|
+
return this.ops.getIndexers();
|
|
146
|
+
}
|
|
147
|
+
async getIndexer(id) {
|
|
148
|
+
return this.ops.getIndexerById({ path: { id } });
|
|
149
|
+
}
|
|
150
|
+
async addIndexer(indexer) {
|
|
151
|
+
return this.ops.createIndexer({ body: indexer });
|
|
152
|
+
}
|
|
153
|
+
async updateIndexer(id, indexer) {
|
|
154
|
+
return this.ops.updateIndexerById({ path: { id: String(id) }, body: indexer });
|
|
155
|
+
}
|
|
156
|
+
async deleteIndexer(id) {
|
|
157
|
+
return this.ops.deleteIndexerById({ path: { id } });
|
|
158
|
+
}
|
|
159
|
+
async getIndexerSchema() {
|
|
160
|
+
return this.ops.getIndexerSchema();
|
|
161
|
+
}
|
|
162
|
+
async testIndexer(indexer) {
|
|
163
|
+
return this.ops.testIndexer({ body: indexer });
|
|
164
|
+
}
|
|
165
|
+
async testAllIndexers() {
|
|
166
|
+
return this.ops.testAllIndexers();
|
|
167
|
+
}
|
|
168
|
+
async restartSystem() {
|
|
169
|
+
return this.ops.restartSystem();
|
|
170
|
+
}
|
|
171
|
+
async shutdownSystem() {
|
|
172
|
+
return this.ops.shutdownSystem();
|
|
173
|
+
}
|
|
174
|
+
async getSystemBackups() {
|
|
175
|
+
return this.ops.getBackups();
|
|
176
|
+
}
|
|
177
|
+
async deleteSystemBackup(id) {
|
|
178
|
+
return this.ops.deleteBackup({ path: { id } });
|
|
179
|
+
}
|
|
180
|
+
async restoreSystemBackup(id) {
|
|
181
|
+
return this.ops.restoreBackup({ path: { id } });
|
|
182
|
+
}
|
|
183
|
+
async uploadSystemBackup() {
|
|
184
|
+
return this.ops.uploadBackup();
|
|
185
|
+
}
|
|
186
|
+
async getLogFiles() {
|
|
187
|
+
return this.ops.getLogFiles();
|
|
188
|
+
}
|
|
189
|
+
async getLogFileByName(filename) {
|
|
190
|
+
return this.ops.getLogFileByName({ path: { filename } });
|
|
191
|
+
}
|
|
192
|
+
async runCommand(command) {
|
|
193
|
+
return this.ops.runCommand({ body: command });
|
|
194
|
+
}
|
|
195
|
+
async getCommands() {
|
|
196
|
+
return this.ops.getCommands();
|
|
197
|
+
}
|
|
198
|
+
async getHostConfig() {
|
|
199
|
+
return this.ops.getHostConfig();
|
|
200
|
+
}
|
|
201
|
+
async getHostConfigById(id) {
|
|
202
|
+
return this.ops.getHostConfigById({ path: { id } });
|
|
203
|
+
}
|
|
204
|
+
async updateHostConfig(id, config) {
|
|
205
|
+
return this.ops.updateHostConfig({ path: { id: String(id) }, body: config });
|
|
206
|
+
}
|
|
207
|
+
async getUiConfig() {
|
|
208
|
+
return this.ops.getUiConfig();
|
|
209
|
+
}
|
|
210
|
+
async getUiConfigById(id) {
|
|
211
|
+
return this.ops.getUiConfigById({ path: { id } });
|
|
212
|
+
}
|
|
213
|
+
async updateUiConfig(id, config) {
|
|
214
|
+
return this.ops.updateUiConfig({ path: { id: String(id) }, body: config });
|
|
215
|
+
}
|
|
216
|
+
updateConfig(newConfig) {
|
|
217
|
+
const updatedConfig = { ...this.clientConfig.config, ...newConfig };
|
|
218
|
+
this.clientConfig = createServarrClient(updatedConfig);
|
|
219
|
+
this.configureRawClient();
|
|
220
|
+
return this.clientConfig.config;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
52
224
|
// src/generated/radarr/core/bodySerializer.gen.ts
|
|
53
225
|
var jsonBodySerializer = {
|
|
54
226
|
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
|
|
@@ -2083,20 +2255,60 @@ var getApiV3ConfigUi = (options) => (options?.client ?? client).get({
|
|
|
2083
2255
|
...options
|
|
2084
2256
|
});
|
|
2085
2257
|
// src/clients/radarr.ts
|
|
2086
|
-
class RadarrClient {
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2258
|
+
class RadarrClient extends ServarrBaseClient {
|
|
2259
|
+
ops = {
|
|
2260
|
+
getSystemStatus: getApiV3SystemStatus,
|
|
2261
|
+
getHealth: getApiV3Health,
|
|
2262
|
+
getTags: getApiV3Tag,
|
|
2263
|
+
createTag: postApiV3Tag,
|
|
2264
|
+
getTagById: getApiV3TagById,
|
|
2265
|
+
updateTagById: putApiV3TagById,
|
|
2266
|
+
deleteTagById: deleteApiV3TagById,
|
|
2267
|
+
getTagDetails: getApiV3TagDetail,
|
|
2268
|
+
getTagDetailById: getApiV3TagDetailById,
|
|
2269
|
+
getNotifications: getApiV3Notification,
|
|
2270
|
+
createNotification: postApiV3Notification,
|
|
2271
|
+
getNotificationById: getApiV3NotificationById,
|
|
2272
|
+
updateNotificationById: putApiV3NotificationById,
|
|
2273
|
+
deleteNotificationById: deleteApiV3NotificationById,
|
|
2274
|
+
getNotificationSchema: getApiV3NotificationSchema,
|
|
2275
|
+
testNotification: postApiV3NotificationTest,
|
|
2276
|
+
testAllNotifications: postApiV3NotificationTestall,
|
|
2277
|
+
getDownloadClients: getApiV3Downloadclient,
|
|
2278
|
+
createDownloadClient: postApiV3Downloadclient,
|
|
2279
|
+
getDownloadClientById: getApiV3DownloadclientById,
|
|
2280
|
+
updateDownloadClientById: putApiV3DownloadclientById,
|
|
2281
|
+
deleteDownloadClientById: deleteApiV3DownloadclientById,
|
|
2282
|
+
getDownloadClientSchema: getApiV3DownloadclientSchema,
|
|
2283
|
+
testDownloadClient: postApiV3DownloadclientTest,
|
|
2284
|
+
testAllDownloadClients: postApiV3DownloadclientTestall,
|
|
2285
|
+
getIndexers: getApiV3Indexer,
|
|
2286
|
+
createIndexer: postApiV3Indexer,
|
|
2287
|
+
getIndexerById: getApiV3IndexerById,
|
|
2288
|
+
updateIndexerById: putApiV3IndexerById,
|
|
2289
|
+
deleteIndexerById: deleteApiV3IndexerById,
|
|
2290
|
+
getIndexerSchema: getApiV3IndexerSchema,
|
|
2291
|
+
testIndexer: postApiV3IndexerTest,
|
|
2292
|
+
testAllIndexers: postApiV3IndexerTestall,
|
|
2293
|
+
restartSystem: postApiV3SystemRestart,
|
|
2294
|
+
shutdownSystem: postApiV3SystemShutdown,
|
|
2295
|
+
getBackups: getApiV3SystemBackup,
|
|
2296
|
+
deleteBackup: deleteApiV3SystemBackupById,
|
|
2297
|
+
restoreBackup: postApiV3SystemBackupRestoreById,
|
|
2298
|
+
uploadBackup: postApiV3SystemBackupRestoreUpload,
|
|
2299
|
+
getLogFiles: getApiV3LogFile,
|
|
2300
|
+
getLogFileByName: getApiV3LogFileByFilename,
|
|
2301
|
+
runCommand: postApiV3Command,
|
|
2302
|
+
getCommands: getApiV3Command,
|
|
2303
|
+
getHostConfig: getApiV3ConfigHost,
|
|
2304
|
+
getHostConfigById: getApiV3ConfigHostById,
|
|
2305
|
+
updateHostConfig: putApiV3ConfigHostById,
|
|
2306
|
+
getUiConfig: getApiV3ConfigUi,
|
|
2307
|
+
getUiConfigById: getApiV3ConfigUiById,
|
|
2308
|
+
updateUiConfig: putApiV3ConfigUiById
|
|
2309
|
+
};
|
|
2310
|
+
configureRawClient() {
|
|
2311
|
+
client.setConfig(this.getClientConfig());
|
|
2100
2312
|
}
|
|
2101
2313
|
async getMovies() {
|
|
2102
2314
|
return getApiV3Movie();
|
|
@@ -2154,12 +2366,6 @@ class RadarrClient {
|
|
|
2154
2366
|
}
|
|
2155
2367
|
return getApiV3MovieLookupImdb({ query: { imdbId: value } });
|
|
2156
2368
|
}
|
|
2157
|
-
async runCommand(command) {
|
|
2158
|
-
return postApiV3Command({ body: command });
|
|
2159
|
-
}
|
|
2160
|
-
async getCommands() {
|
|
2161
|
-
return getApiV3Command();
|
|
2162
|
-
}
|
|
2163
2369
|
async getRootFolders() {
|
|
2164
2370
|
return getApiV3Rootfolder();
|
|
2165
2371
|
}
|
|
@@ -2248,60 +2454,12 @@ class RadarrClient {
|
|
|
2248
2454
|
async getCustomFormatSchema() {
|
|
2249
2455
|
return getApiV3CustomformatSchema();
|
|
2250
2456
|
}
|
|
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
2457
|
async updateDownloadClientsBulk(clients) {
|
|
2267
2458
|
return putApiV3DownloadclientBulk({ body: clients });
|
|
2268
2459
|
}
|
|
2269
2460
|
async deleteDownloadClientsBulk(ids) {
|
|
2270
2461
|
return deleteApiV3DownloadclientBulk({ body: { ids } });
|
|
2271
2462
|
}
|
|
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
2463
|
async getCalendar(startDate, endDate, unmonitored) {
|
|
2306
2464
|
const query = {};
|
|
2307
2465
|
if (startDate)
|
|
@@ -2396,30 +2554,6 @@ class RadarrClient {
|
|
|
2396
2554
|
async testAllImportLists() {
|
|
2397
2555
|
return postApiV3ImportlistTestall();
|
|
2398
2556
|
}
|
|
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
2557
|
async getHistory(page, pageSize, sortKey, sortDirection, movieId, downloadId) {
|
|
2424
2558
|
const query = {};
|
|
2425
2559
|
if (page !== undefined)
|
|
@@ -2485,15 +2619,6 @@ class RadarrClient {
|
|
|
2485
2619
|
query.pageSize = pageSize;
|
|
2486
2620
|
return getApiV3WantedCutoff(Object.keys(query).length > 0 ? { query } : {});
|
|
2487
2621
|
}
|
|
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
2622
|
async getNamingConfig() {
|
|
2498
2623
|
return getApiV3ConfigNaming();
|
|
2499
2624
|
}
|
|
@@ -2515,75 +2640,12 @@ class RadarrClient {
|
|
|
2515
2640
|
async updateMediaManagementConfig(id, config) {
|
|
2516
2641
|
return putApiV3ConfigMediamanagementById({ path: { id: String(id) }, body: config });
|
|
2517
2642
|
}
|
|
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
2643
|
async getSystemLogs() {
|
|
2546
2644
|
return getApiV3Log();
|
|
2547
2645
|
}
|
|
2548
|
-
async getLogFiles() {
|
|
2549
|
-
return getApiV3LogFile();
|
|
2550
|
-
}
|
|
2551
|
-
async getLogFileByName(filename) {
|
|
2552
|
-
return getApiV3LogFileByFilename({ path: { filename } });
|
|
2553
|
-
}
|
|
2554
2646
|
async getDiskSpace() {
|
|
2555
2647
|
return getApiV3Diskspace();
|
|
2556
2648
|
}
|
|
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
2649
|
}
|
|
2588
2650
|
export {
|
|
2589
2651
|
RadarrClient
|