tsarr 2.8.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 +2722 -3054
- 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.8.0.tgz +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lidarr.d.ts","sourceRoot":"","sources":["../../src/clients/lidarr.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lidarr.d.ts","sourceRoot":"","sources":["../../src/clients/lidarr.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,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC9B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,iBAAiB;IACjD,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAmEhC;IAEF,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAMpC;;OAEG;IACG,UAAU;;;;;;;;;;IAIV,SAAS,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAIpB,SAAS,CAAC,MAAM,EAAE,cAAc;;;;;;;;;;IAIhC,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;;;;;;;;;;IAI/C,YAAY,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAKvB,SAAS;;;;;;;;;;IAIT,QAAQ,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAMzB;;OAEG;IACG,aAAa,CAAC,IAAI,EAAE,MAAM;;;;;;;;;;IAK1B,cAAc;;;;;;;;;;IAId,aAAa,CAAC,IAAI,EAAE,MAAM;;;;;;;;;;IAM1B,gBAAgB,CAAC,EAAE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IACG,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAI9B;;OAEG;IACG,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE;;;;;;;;;;IAItC;;OAEG;IACG,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,yBAAyB,CAAC,EAAE,OAAO;;;;;;;;;;IAS5E;;OAEG;IACG,cAAc;;;;;;;;;;IAMpB;;OAEG;IACG,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;;;;;;;;;;IAU7F;;OAEG;IACG,mBAAmB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;IAIpC;;OAEG;IACG,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE;;;;;;;;;;IAI5C;;OAEG;IACG,gBAAgB,CACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,OAAO;;;;;;;;;;IAYrB;;OAEG;IACG,eAAe,CACnB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,OAAO;;;;;;;;;;CAWtB;AAGD,cAAc,mBAAmB,CAAC"}
|
package/dist/clients/lidarr.js
CHANGED
|
@@ -27,6 +27,7 @@ class ConnectionError extends TsarrError {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// src/core/client.ts
|
|
30
|
+
var DEFAULT_TIMEOUT_MS = 30000;
|
|
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/lidarr/core/bodySerializer.gen.ts
|
|
53
225
|
var jsonBodySerializer = {
|
|
54
226
|
bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
|
|
@@ -1231,32 +1403,6 @@ var postApiV1Downloadclient = (options) => (options?.client ?? client).post({
|
|
|
1231
1403
|
...options?.headers
|
|
1232
1404
|
}
|
|
1233
1405
|
});
|
|
1234
|
-
var deleteApiV1DownloadclientBulk = (options) => (options?.client ?? client).delete({
|
|
1235
|
-
security: [{ name: "X-Api-Key", type: "apiKey" }, {
|
|
1236
|
-
in: "query",
|
|
1237
|
-
name: "apikey",
|
|
1238
|
-
type: "apiKey"
|
|
1239
|
-
}],
|
|
1240
|
-
url: "/api/v1/downloadclient/bulk",
|
|
1241
|
-
...options,
|
|
1242
|
-
headers: {
|
|
1243
|
-
"Content-Type": "application/json",
|
|
1244
|
-
...options?.headers
|
|
1245
|
-
}
|
|
1246
|
-
});
|
|
1247
|
-
var putApiV1DownloadclientBulk = (options) => (options?.client ?? client).put({
|
|
1248
|
-
security: [{ name: "X-Api-Key", type: "apiKey" }, {
|
|
1249
|
-
in: "query",
|
|
1250
|
-
name: "apikey",
|
|
1251
|
-
type: "apiKey"
|
|
1252
|
-
}],
|
|
1253
|
-
url: "/api/v1/downloadclient/bulk",
|
|
1254
|
-
...options,
|
|
1255
|
-
headers: {
|
|
1256
|
-
"Content-Type": "application/json",
|
|
1257
|
-
...options?.headers
|
|
1258
|
-
}
|
|
1259
|
-
});
|
|
1260
1406
|
var getApiV1DownloadclientSchema = (options) => (options?.client ?? client).get({
|
|
1261
1407
|
security: [{ name: "X-Api-Key", type: "apiKey" }, {
|
|
1262
1408
|
in: "query",
|
|
@@ -2114,20 +2260,60 @@ var getApiV1ConfigUi = (options) => (options?.client ?? client).get({
|
|
|
2114
2260
|
...options
|
|
2115
2261
|
});
|
|
2116
2262
|
// src/clients/lidarr.ts
|
|
2117
|
-
class LidarrClient {
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2263
|
+
class LidarrClient extends ServarrBaseClient {
|
|
2264
|
+
ops = {
|
|
2265
|
+
getSystemStatus: getApiV1SystemStatus,
|
|
2266
|
+
getHealth: getApiV1Health,
|
|
2267
|
+
getTags: getApiV1Tag,
|
|
2268
|
+
createTag: postApiV1Tag,
|
|
2269
|
+
getTagById: getApiV1TagById,
|
|
2270
|
+
updateTagById: putApiV1TagById,
|
|
2271
|
+
deleteTagById: deleteApiV1TagById,
|
|
2272
|
+
getTagDetails: getApiV1TagDetail,
|
|
2273
|
+
getTagDetailById: getApiV1TagDetailById,
|
|
2274
|
+
getNotifications: getApiV1Notification,
|
|
2275
|
+
createNotification: postApiV1Notification,
|
|
2276
|
+
getNotificationById: getApiV1NotificationById,
|
|
2277
|
+
updateNotificationById: putApiV1NotificationById,
|
|
2278
|
+
deleteNotificationById: deleteApiV1NotificationById,
|
|
2279
|
+
getNotificationSchema: getApiV1NotificationSchema,
|
|
2280
|
+
testNotification: postApiV1NotificationTest,
|
|
2281
|
+
testAllNotifications: postApiV1NotificationTestall,
|
|
2282
|
+
getDownloadClients: getApiV1Downloadclient,
|
|
2283
|
+
createDownloadClient: postApiV1Downloadclient,
|
|
2284
|
+
getDownloadClientById: getApiV1DownloadclientById,
|
|
2285
|
+
updateDownloadClientById: putApiV1DownloadclientById,
|
|
2286
|
+
deleteDownloadClientById: deleteApiV1DownloadclientById,
|
|
2287
|
+
getDownloadClientSchema: getApiV1DownloadclientSchema,
|
|
2288
|
+
testDownloadClient: postApiV1DownloadclientTest,
|
|
2289
|
+
testAllDownloadClients: postApiV1DownloadclientTestall,
|
|
2290
|
+
getIndexers: getApiV1Indexer,
|
|
2291
|
+
createIndexer: postApiV1Indexer,
|
|
2292
|
+
getIndexerById: getApiV1IndexerById,
|
|
2293
|
+
updateIndexerById: putApiV1IndexerById,
|
|
2294
|
+
deleteIndexerById: deleteApiV1IndexerById,
|
|
2295
|
+
getIndexerSchema: getApiV1IndexerSchema,
|
|
2296
|
+
testIndexer: postApiV1IndexerTest,
|
|
2297
|
+
testAllIndexers: postApiV1IndexerTestall,
|
|
2298
|
+
restartSystem: postApiV1SystemRestart,
|
|
2299
|
+
shutdownSystem: postApiV1SystemShutdown,
|
|
2300
|
+
getBackups: getApiV1SystemBackup,
|
|
2301
|
+
deleteBackup: deleteApiV1SystemBackupById,
|
|
2302
|
+
restoreBackup: postApiV1SystemBackupRestoreById,
|
|
2303
|
+
uploadBackup: postApiV1SystemBackupRestoreUpload,
|
|
2304
|
+
getLogFiles: getApiV1LogFile,
|
|
2305
|
+
getLogFileByName: getApiV1LogFileByFilename,
|
|
2306
|
+
runCommand: postApiV1Command,
|
|
2307
|
+
getCommands: getApiV1Command,
|
|
2308
|
+
getHostConfig: getApiV1ConfigHost,
|
|
2309
|
+
getHostConfigById: getApiV1ConfigHostById,
|
|
2310
|
+
updateHostConfig: putApiV1ConfigHostById,
|
|
2311
|
+
getUiConfig: getApiV1ConfigUi,
|
|
2312
|
+
getUiConfigById: getApiV1ConfigUiById,
|
|
2313
|
+
updateUiConfig: putApiV1ConfigUiById
|
|
2314
|
+
};
|
|
2315
|
+
configureRawClient() {
|
|
2316
|
+
client.setConfig(this.getClientConfig());
|
|
2131
2317
|
}
|
|
2132
2318
|
async getArtists() {
|
|
2133
2319
|
return getApiV1Artist();
|
|
@@ -2153,12 +2339,6 @@ class LidarrClient {
|
|
|
2153
2339
|
async searchArtists(term) {
|
|
2154
2340
|
return getApiV1ArtistLookup({ query: { term } });
|
|
2155
2341
|
}
|
|
2156
|
-
async runCommand(command) {
|
|
2157
|
-
return postApiV1Command({ body: command });
|
|
2158
|
-
}
|
|
2159
|
-
async getCommands() {
|
|
2160
|
-
return getApiV1Command();
|
|
2161
|
-
}
|
|
2162
2342
|
async getRootFolders() {
|
|
2163
2343
|
return getApiV1Rootfolder();
|
|
2164
2344
|
}
|
|
@@ -2272,15 +2452,6 @@ class LidarrClient {
|
|
|
2272
2452
|
async getCustomFormatSchema() {
|
|
2273
2453
|
return getApiV1CustomformatSchema();
|
|
2274
2454
|
}
|
|
2275
|
-
async getHostConfig() {
|
|
2276
|
-
return getApiV1ConfigHost();
|
|
2277
|
-
}
|
|
2278
|
-
async getHostConfigById(id) {
|
|
2279
|
-
return getApiV1ConfigHostById({ path: { id } });
|
|
2280
|
-
}
|
|
2281
|
-
async updateHostConfig(id, config) {
|
|
2282
|
-
return putApiV1ConfigHostById({ path: { id: String(id) }, body: config });
|
|
2283
|
-
}
|
|
2284
2455
|
async getNamingConfig() {
|
|
2285
2456
|
return getApiV1ConfigNaming();
|
|
2286
2457
|
}
|
|
@@ -2302,15 +2473,6 @@ class LidarrClient {
|
|
|
2302
2473
|
async updateMediaManagementConfig(id, config) {
|
|
2303
2474
|
return putApiV1ConfigMediamanagementById({ path: { id: String(id) }, body: config });
|
|
2304
2475
|
}
|
|
2305
|
-
async getUiConfig() {
|
|
2306
|
-
return getApiV1ConfigUi();
|
|
2307
|
-
}
|
|
2308
|
-
async getUiConfigById(id) {
|
|
2309
|
-
return getApiV1ConfigUiById({ path: { id } });
|
|
2310
|
-
}
|
|
2311
|
-
async updateUiConfig(id, config) {
|
|
2312
|
-
return putApiV1ConfigUiById({ path: { id: String(id) }, body: config });
|
|
2313
|
-
}
|
|
2314
2476
|
async getMetadataProviderConfig() {
|
|
2315
2477
|
return getApiV1ConfigMetadataprovider();
|
|
2316
2478
|
}
|
|
@@ -2320,111 +2482,12 @@ class LidarrClient {
|
|
|
2320
2482
|
async updateMetadataProviderConfig(id, config) {
|
|
2321
2483
|
return putApiV1ConfigMetadataproviderById({ path: { id: String(id) }, body: config });
|
|
2322
2484
|
}
|
|
2323
|
-
async restartSystem() {
|
|
2324
|
-
return postApiV1SystemRestart();
|
|
2325
|
-
}
|
|
2326
|
-
async shutdownSystem() {
|
|
2327
|
-
return postApiV1SystemShutdown();
|
|
2328
|
-
}
|
|
2329
|
-
async getSystemBackups() {
|
|
2330
|
-
return getApiV1SystemBackup();
|
|
2331
|
-
}
|
|
2332
|
-
async deleteSystemBackup(id) {
|
|
2333
|
-
return deleteApiV1SystemBackupById({ path: { id } });
|
|
2334
|
-
}
|
|
2335
|
-
async restoreSystemBackup(id) {
|
|
2336
|
-
return postApiV1SystemBackupRestoreById({ path: { id } });
|
|
2337
|
-
}
|
|
2338
|
-
async uploadSystemBackup() {
|
|
2339
|
-
return postApiV1SystemBackupRestoreUpload();
|
|
2340
|
-
}
|
|
2341
2485
|
async getSystemLogs() {
|
|
2342
2486
|
return getApiV1Log();
|
|
2343
2487
|
}
|
|
2344
|
-
async getLogFiles() {
|
|
2345
|
-
return getApiV1LogFile();
|
|
2346
|
-
}
|
|
2347
|
-
async getLogFileByName(filename) {
|
|
2348
|
-
return getApiV1LogFileByFilename({ path: { filename } });
|
|
2349
|
-
}
|
|
2350
2488
|
async getDiskSpace() {
|
|
2351
2489
|
return getApiV1Diskspace();
|
|
2352
2490
|
}
|
|
2353
|
-
async getTags() {
|
|
2354
|
-
return getApiV1Tag();
|
|
2355
|
-
}
|
|
2356
|
-
async addTag(tag) {
|
|
2357
|
-
return postApiV1Tag({ body: tag });
|
|
2358
|
-
}
|
|
2359
|
-
async getTag(id) {
|
|
2360
|
-
return getApiV1TagById({ path: { id } });
|
|
2361
|
-
}
|
|
2362
|
-
async updateTag(id, tag) {
|
|
2363
|
-
return putApiV1TagById({ path: { id: String(id) }, body: tag });
|
|
2364
|
-
}
|
|
2365
|
-
async deleteTag(id) {
|
|
2366
|
-
return deleteApiV1TagById({ path: { id } });
|
|
2367
|
-
}
|
|
2368
|
-
async getTagDetails() {
|
|
2369
|
-
return getApiV1TagDetail();
|
|
2370
|
-
}
|
|
2371
|
-
async getTagDetailById(id) {
|
|
2372
|
-
return getApiV1TagDetailById({ path: { id } });
|
|
2373
|
-
}
|
|
2374
|
-
async getDownloadClients() {
|
|
2375
|
-
return getApiV1Downloadclient();
|
|
2376
|
-
}
|
|
2377
|
-
async getDownloadClient(id) {
|
|
2378
|
-
return getApiV1DownloadclientById({ path: { id } });
|
|
2379
|
-
}
|
|
2380
|
-
async addDownloadClient(client2) {
|
|
2381
|
-
return postApiV1Downloadclient({ body: client2 });
|
|
2382
|
-
}
|
|
2383
|
-
async updateDownloadClient(id, client2) {
|
|
2384
|
-
return putApiV1DownloadclientById({ path: { id }, body: client2 });
|
|
2385
|
-
}
|
|
2386
|
-
async deleteDownloadClient(id) {
|
|
2387
|
-
return deleteApiV1DownloadclientById({ path: { id } });
|
|
2388
|
-
}
|
|
2389
|
-
async updateDownloadClientsBulk(clients) {
|
|
2390
|
-
return putApiV1DownloadclientBulk({ body: clients });
|
|
2391
|
-
}
|
|
2392
|
-
async deleteDownloadClientsBulk(ids) {
|
|
2393
|
-
return deleteApiV1DownloadclientBulk({ body: { ids } });
|
|
2394
|
-
}
|
|
2395
|
-
async getDownloadClientSchema() {
|
|
2396
|
-
return getApiV1DownloadclientSchema();
|
|
2397
|
-
}
|
|
2398
|
-
async testDownloadClient(client2) {
|
|
2399
|
-
return postApiV1DownloadclientTest({ body: client2 });
|
|
2400
|
-
}
|
|
2401
|
-
async testAllDownloadClients() {
|
|
2402
|
-
return postApiV1DownloadclientTestall();
|
|
2403
|
-
}
|
|
2404
|
-
async getIndexers() {
|
|
2405
|
-
return getApiV1Indexer();
|
|
2406
|
-
}
|
|
2407
|
-
async getIndexer(id) {
|
|
2408
|
-
return getApiV1IndexerById({ path: { id } });
|
|
2409
|
-
}
|
|
2410
|
-
async addIndexer(indexer) {
|
|
2411
|
-
return postApiV1Indexer({ body: indexer });
|
|
2412
|
-
}
|
|
2413
|
-
async updateIndexer(id, indexer) {
|
|
2414
|
-
return putApiV1IndexerById({ path: { id }, body: indexer });
|
|
2415
|
-
}
|
|
2416
|
-
async deleteIndexer(id) {
|
|
2417
|
-
return deleteApiV1IndexerById({ path: { id } });
|
|
2418
|
-
}
|
|
2419
|
-
async getIndexerSchema() {
|
|
2420
|
-
return getApiV1IndexerSchema();
|
|
2421
|
-
}
|
|
2422
|
-
async testIndexer(indexer) {
|
|
2423
|
-
return postApiV1IndexerTest({ body: indexer });
|
|
2424
|
-
}
|
|
2425
|
-
async testAllIndexers() {
|
|
2426
|
-
return postApiV1IndexerTestall();
|
|
2427
|
-
}
|
|
2428
2491
|
async getImportLists() {
|
|
2429
2492
|
return getApiV1Importlist();
|
|
2430
2493
|
}
|
|
@@ -2449,30 +2512,6 @@ class LidarrClient {
|
|
|
2449
2512
|
async testAllImportLists() {
|
|
2450
2513
|
return postApiV1ImportlistTestall();
|
|
2451
2514
|
}
|
|
2452
|
-
async getNotifications() {
|
|
2453
|
-
return getApiV1Notification();
|
|
2454
|
-
}
|
|
2455
|
-
async getNotification(id) {
|
|
2456
|
-
return getApiV1NotificationById({ path: { id } });
|
|
2457
|
-
}
|
|
2458
|
-
async addNotification(notification) {
|
|
2459
|
-
return postApiV1Notification({ body: notification });
|
|
2460
|
-
}
|
|
2461
|
-
async updateNotification(id, notification) {
|
|
2462
|
-
return putApiV1NotificationById({ path: { id }, body: notification });
|
|
2463
|
-
}
|
|
2464
|
-
async deleteNotification(id) {
|
|
2465
|
-
return deleteApiV1NotificationById({ path: { id } });
|
|
2466
|
-
}
|
|
2467
|
-
async getNotificationSchema() {
|
|
2468
|
-
return getApiV1NotificationSchema();
|
|
2469
|
-
}
|
|
2470
|
-
async testNotification(notification) {
|
|
2471
|
-
return postApiV1NotificationTest({ body: notification });
|
|
2472
|
-
}
|
|
2473
|
-
async testAllNotifications() {
|
|
2474
|
-
return postApiV1NotificationTestall();
|
|
2475
|
-
}
|
|
2476
2515
|
async getHistory(page, pageSize, sortKey, sortDirection, artistId, downloadId) {
|
|
2477
2516
|
const query = {};
|
|
2478
2517
|
if (page !== undefined)
|
|
@@ -2603,15 +2642,6 @@ class LidarrClient {
|
|
|
2603
2642
|
query.monitored = monitored;
|
|
2604
2643
|
return getApiV1WantedCutoff(Object.keys(query).length > 0 ? { query } : {});
|
|
2605
2644
|
}
|
|
2606
|
-
updateConfig(newConfig) {
|
|
2607
|
-
const updatedConfig = { ...this.clientConfig.config, ...newConfig };
|
|
2608
|
-
this.clientConfig = createServarrClient(updatedConfig);
|
|
2609
|
-
client.setConfig({
|
|
2610
|
-
baseUrl: this.clientConfig.getBaseUrl(),
|
|
2611
|
-
headers: this.clientConfig.getHeaders()
|
|
2612
|
-
});
|
|
2613
|
-
return this.clientConfig.config;
|
|
2614
|
-
}
|
|
2615
2645
|
}
|
|
2616
2646
|
export {
|
|
2617
2647
|
LidarrClient
|