@ctrl/nzbget 0.0.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.
@@ -0,0 +1,669 @@
1
+ export interface JsonRpcErrorModel {
2
+ /** JSON-RPC error code. */
3
+ code: number;
4
+ /** Human-readable error message returned by NZBGet. */
5
+ message: string;
6
+ /** Optional server-provided error payload. */
7
+ data?: unknown;
8
+ }
9
+ export interface JsonRpcResponse<T> {
10
+ /** Request identifier echoed by the server. */
11
+ id: number | string;
12
+ /** JSON-RPC protocol version. */
13
+ jsonrpc: '2.0';
14
+ /** Successful result payload. */
15
+ result: T;
16
+ /** Optional error payload when the request fails. */
17
+ error?: JsonRpcErrorModel | null;
18
+ }
19
+ /**
20
+ * One config entry from {@link https://nzbget-ng.github.io/api/config | config}.
21
+ */
22
+ export interface NzbGetParameter {
23
+ /** Name of the parameter. */
24
+ Name: string;
25
+ /** Raw parameter value. */
26
+ Value: unknown;
27
+ }
28
+ /**
29
+ * Response from {@link https://nzbget-ng.github.io/api/status | status}.
30
+ */
31
+ export interface NzbGetNewsServerStatus {
32
+ /** Server number in the configuration file. */
33
+ ID: number;
34
+ /** True if the server is enabled for downloads. */
35
+ Active: boolean;
36
+ }
37
+ export type NzbGetLogKind = 'INFO' | 'WARNING' | 'ERROR' | 'DETAIL' | 'DEBUG';
38
+ export interface NzbGetLogEntry {
39
+ /** ID of the log entry. */
40
+ ID: number;
41
+ /** Log entry class. */
42
+ Kind: Exclude<NzbGetLogKind, 'DETAIL'>;
43
+ /** Entry time in Unix seconds. */
44
+ Time: number;
45
+ /** Log message. */
46
+ Text: string;
47
+ }
48
+ export interface NzbGetVolumeSlot {
49
+ /** Downloaded amount, low 32 bits. */
50
+ SizeLo: number;
51
+ /** Downloaded amount, high 32 bits. */
52
+ SizeHi: number;
53
+ /** Downloaded amount in megabytes. */
54
+ SizeMB: number;
55
+ }
56
+ export interface NzbGetServerVolume {
57
+ /** ID of the news server. */
58
+ ServerID: number;
59
+ /** Time when the data was last updated. */
60
+ DataTime: number;
61
+ /** Total downloaded amount, low 32 bits. */
62
+ TotalSizeLo: number;
63
+ /** Total downloaded amount, high 32 bits. */
64
+ TotalSizeHi: number;
65
+ /** Total downloaded amount in megabytes. */
66
+ TotalSizeMB: number;
67
+ /** Custom counter amount, low 32 bits. */
68
+ CustomSizeLo: number;
69
+ /** Custom counter amount, high 32 bits. */
70
+ CustomSizeHi: number;
71
+ /** Custom counter amount in megabytes. */
72
+ CustomSizeMB: number;
73
+ /** Time of the last custom counter reset. */
74
+ CustomTime: number;
75
+ /** Per-second volume slots. */
76
+ BytesPerSeconds: NzbGetVolumeSlot[];
77
+ /** Per-minute volume slots. */
78
+ BytesPerMinutes: NzbGetVolumeSlot[];
79
+ /** Per-hour volume slots. */
80
+ BytesPerHours: NzbGetVolumeSlot[];
81
+ /** Per-day volume slots. */
82
+ BytesPerDays: NzbGetVolumeSlot[];
83
+ /** Current second slot index. */
84
+ SecSlot: number;
85
+ /** Current minute slot index. */
86
+ MinSlot: number;
87
+ /** Current hour slot index. */
88
+ HourSlot: number;
89
+ /** Current day slot index. */
90
+ DaySlot: number;
91
+ /** Calendar day for the first day slot. */
92
+ FirstDay: number;
93
+ }
94
+ export interface NzbGetStatus {
95
+ /** Remaining queue size in bytes, low 32 bits of the 64-bit value. */
96
+ RemainingSizeLo: number;
97
+ /** Remaining queue size in bytes, high 32 bits of the 64-bit value. */
98
+ RemainingSizeHi: number;
99
+ /** Remaining queue size in megabytes. */
100
+ RemainingSizeMB?: number;
101
+ /** Remaining forced-priority size, low 32 bits. */
102
+ ForcedSizeLo?: number;
103
+ /** Remaining forced-priority size, high 32 bits. */
104
+ ForcedSizeHi?: number;
105
+ /** Remaining forced-priority size in megabytes. */
106
+ ForcedSizeMB?: number;
107
+ /** Amount downloaded since server start in bytes, low 32 bits. */
108
+ DownloadedSizeLo: number;
109
+ /** Amount downloaded since server start in bytes, high 32 bits. */
110
+ DownloadedSizeHi: number;
111
+ /** Amount downloaded since server start in megabytes. */
112
+ DownloadedSizeMB?: number;
113
+ /** Current article-cache usage, low 32 bits. */
114
+ ArticleCacheLo?: number;
115
+ /** Current article-cache usage, high 32 bits. */
116
+ ArticleCacheHi?: number;
117
+ /** Current article-cache usage in megabytes. */
118
+ ArticleCacheMB?: number;
119
+ /** Current download speed in bytes per second. */
120
+ DownloadRate: number;
121
+ /** Average download speed since server start in bytes per second. */
122
+ AverageDownloadRate: number;
123
+ /** Current download limit in bytes per second. */
124
+ DownloadLimit: number;
125
+ /** Number of running threads. */
126
+ ThreadCount?: number;
127
+ /** Number of jobs in post-processing queue. */
128
+ PostJobCount?: number;
129
+ /** Deprecated par job count. */
130
+ ParJobCount?: number;
131
+ /** Number of URLs in URL queue. */
132
+ UrlCount?: number;
133
+ /** Server uptime in seconds. */
134
+ UpTimeSec?: number;
135
+ /** Server download time in seconds. */
136
+ DownloadTimeSec?: number;
137
+ /** True when there are no active downloads. */
138
+ ServerStandBy?: boolean;
139
+ /** True if the download queue is soft-paused. */
140
+ DownloadPaused: boolean;
141
+ /** Deprecated second download pause flag. */
142
+ Download2Paused?: boolean;
143
+ /** Deprecated server pause flag. */
144
+ ServerPaused?: boolean;
145
+ /** True if post-processing queue is paused. */
146
+ PostPaused?: boolean;
147
+ /** True if scan queue is paused. */
148
+ ScanPaused?: boolean;
149
+ /** Current server time in Unix seconds. */
150
+ ServerTime?: number;
151
+ /** Scheduled resume time in Unix seconds. */
152
+ ResumeTime?: number;
153
+ /** True if any RSS feed is currently active. */
154
+ FeedActive?: boolean;
155
+ /** Free disk space, low 32 bits. */
156
+ FreeDiskSpaceLo?: number;
157
+ /** Free disk space, high 32 bits. */
158
+ FreeDiskSpaceHi?: number;
159
+ /** Free disk space in megabytes. */
160
+ FreeDiskSpaceMB?: number;
161
+ /** Per-server enabled/disabled state. */
162
+ NewsServers?: NzbGetNewsServerStatus[];
163
+ [key: string]: unknown;
164
+ }
165
+ /**
166
+ * Queue item returned by {@link https://nzbget-ng.github.io/api/listgroups | listgroups}.
167
+ */
168
+ export interface NzbGetQueueItem {
169
+ /** ID of the NZB entry. */
170
+ NZBID: number;
171
+ /** Deprecated alias for `NZBID`. */
172
+ FirstID: number;
173
+ /** Deprecated alias for `NZBID`. */
174
+ LastID: number;
175
+ /** Source nzb filename, possibly including a path. */
176
+ NZBFilename?: string;
177
+ /** Friendly NZB name without path or extension. */
178
+ NZBName: string;
179
+ /** Deprecated alias for `NZBName`. */
180
+ NZBNicename?: string;
181
+ /** Kind of queue entry. */
182
+ Kind?: NzbGetQueueKind;
183
+ /** URL where the NZB file was fetched or should be fetched. */
184
+ URL?: string;
185
+ /** Destination directory for output file. */
186
+ DestDir?: string;
187
+ /** Final destination set by post-processing scripts. */
188
+ FinalDir?: string;
189
+ /** Assigned category, or an empty string when none is set. */
190
+ Category: string;
191
+ /** Total group size in bytes, low 32 bits. */
192
+ FileSizeLo: number;
193
+ /** Total group size in bytes, high 32 bits. */
194
+ FileSizeHi: number;
195
+ /** Initial group size in megabytes. */
196
+ FileSizeMB?: number;
197
+ /** Remaining group size in bytes, low 32 bits. */
198
+ RemainingSizeLo: number;
199
+ /** Remaining group size in bytes, high 32 bits. */
200
+ RemainingSizeHi: number;
201
+ /** Remaining group size in megabytes. */
202
+ RemainingSizeMB?: number;
203
+ /** Total paused file size in bytes, low 32 bits. */
204
+ PausedSizeLo: number;
205
+ /** Total paused file size in bytes, high 32 bits. */
206
+ PausedSizeHi: number;
207
+ /** Total paused file size in megabytes. */
208
+ PausedSizeMB?: number;
209
+ /** Initial number of files in the group. */
210
+ FileCount?: number;
211
+ /** Remaining number of files in the group. */
212
+ RemainingFileCount?: number;
213
+ /** Remaining number of par files in the group. */
214
+ RemainingParCount?: number;
215
+ /** Oldest article timestamp in Unix seconds. */
216
+ MinPostTime?: number;
217
+ /** Newest article timestamp in Unix seconds. */
218
+ MaxPostTime?: number;
219
+ /** Lowest file priority in the group. */
220
+ MinPriority: number;
221
+ /** Highest file priority in the group. */
222
+ MaxPriority: number;
223
+ /** Number of files in the group currently downloading. */
224
+ ActiveDownloads: number;
225
+ /** Aggregate group status string. */
226
+ Status?: NzbGetQueueStatus;
227
+ /** Total number of articles in the group. */
228
+ TotalArticles?: number;
229
+ /** Number of successfully downloaded articles. */
230
+ SuccessArticles?: number;
231
+ /** Number of failed article downloads. */
232
+ FailedArticles?: number;
233
+ /** Current health of the group, in permille. */
234
+ Health?: number;
235
+ /** Critical health threshold, in permille. */
236
+ CriticalHealth?: number;
237
+ /** Downloaded size, low 32 bits. */
238
+ DownloadedSizeLo?: number;
239
+ /** Downloaded size, high 32 bits. */
240
+ DownloadedSizeHi?: number;
241
+ /** Downloaded size in megabytes. */
242
+ DownloadedSizeMB?: number;
243
+ /** Download time in seconds. */
244
+ DownloadTimeSec?: number;
245
+ /** Number of messages stored in item log. */
246
+ MessageCount?: number;
247
+ /** Duplicate key. */
248
+ DupeKey?: string;
249
+ /** Duplicate score. */
250
+ DupeScore?: number;
251
+ /** Duplicate mode. */
252
+ DupeMode?: NzbGetDupeMode;
253
+ /** Deprecated deleted flag. */
254
+ Deleted?: boolean;
255
+ /** Result of par-check or repair during post-processing. */
256
+ ParStatus?: NzbGetParStatus;
257
+ /** Result of unpacking during post-processing. */
258
+ UnpackStatus?: NzbGetUnpackStatus;
259
+ /** Result of moving output during post-processing. */
260
+ MoveStatus?: NzbGetMoveStatus;
261
+ /** Result of post-processing scripts during post-processing. */
262
+ ScriptStatus?: NzbGetScriptStatus;
263
+ /** Result of delete handling during post-processing. */
264
+ DeleteStatus?: NzbGetDeleteStatus;
265
+ /** Final mark assigned during post-processing. */
266
+ MarkStatus?: NzbGetMarkStatus;
267
+ /** Short description of the current post-processing action. */
268
+ PostInfoText?: string;
269
+ /** Current post-processing stage completion in permille. */
270
+ PostStageProgress?: number;
271
+ /** Total seconds spent in post-processing. */
272
+ PostTotalTimeSec?: number;
273
+ /** Seconds spent in the current post-processing stage. */
274
+ PostStageTimeSec?: number;
275
+ /** Per-item parameters attached to the queue entry. */
276
+ Parameters: NzbGetParameter[];
277
+ [key: string]: unknown;
278
+ }
279
+ /**
280
+ * History item returned by {@link https://nzbget-ng.github.io/api/history | history}.
281
+ */
282
+ export interface NzbGetHistoryItem {
283
+ /** ID of the NZB entry. */
284
+ NZBID?: number;
285
+ /** Deprecated alias for `NZBID`. */
286
+ ID: number;
287
+ /** Kind of history item. */
288
+ Kind?: NzbGetHistoryKind;
289
+ /** Source nzb filename, possibly including a path. */
290
+ NZBFilename?: string;
291
+ /** Friendly item name without path or extension. */
292
+ Name: string;
293
+ /** URL for URL history items. */
294
+ URL?: string;
295
+ /** Assigned category, or an empty string when none is set. */
296
+ Category: string;
297
+ /** Total group size in bytes, low 32 bits. */
298
+ FileSizeLo: number;
299
+ /** Total group size in bytes, high 32 bits. */
300
+ FileSizeHi: number;
301
+ /** Initial group size in megabytes. */
302
+ FileSizeMB?: number;
303
+ /** Initial number of files in the group. */
304
+ FileCount?: number;
305
+ /** Number of parked files in the group. */
306
+ RemainingFileCount?: number;
307
+ /** Time when the item was added to history, in Unix seconds. */
308
+ HistoryTime?: number;
309
+ /** Oldest article timestamp in Unix seconds. */
310
+ MinPostTime?: number;
311
+ /** Newest article timestamp in Unix seconds. */
312
+ MaxPostTime?: number;
313
+ /** Total number of articles in the group. */
314
+ TotalArticles?: number;
315
+ /** Number of successfully downloaded articles. */
316
+ SuccessArticles?: number;
317
+ /** Number of failed article downloads. */
318
+ FailedArticles?: number;
319
+ /** Final health of the group, in permille. */
320
+ Health?: number;
321
+ /** Downloaded size, low 32 bits. */
322
+ DownloadedSizeLo?: number;
323
+ /** Downloaded size, high 32 bits. */
324
+ DownloadedSizeHi?: number;
325
+ /** Downloaded size in megabytes. */
326
+ DownloadedSizeMB?: number;
327
+ /** Download time in seconds. */
328
+ DownloadTimeSec?: number;
329
+ /** Total post-processing time in seconds. */
330
+ PostTotalTimeSec?: number;
331
+ /** Par-check time in seconds. */
332
+ ParTimeSec?: number;
333
+ /** Repair time in seconds. */
334
+ RepairTimeSec?: number;
335
+ /** Unpack time in seconds. */
336
+ UnpackTimeSec?: number;
337
+ /** Number of messages stored in the item log. */
338
+ MessageCount?: number;
339
+ /** Duplicate key. */
340
+ DupeKey?: string;
341
+ /** Duplicate score. */
342
+ DupeScore?: number;
343
+ /** Duplicate mode. */
344
+ DupeMode?: NzbGetDupeMode;
345
+ /** Total status of the download. */
346
+ Status?: NzbGetHistoryStatus;
347
+ /** Result of par-check or repair. */
348
+ ParStatus: NzbGetParStatus;
349
+ /** Duplicate par-scan repair status. */
350
+ ExParStatus?: NzbGetExParStatus;
351
+ /** Result of unpacking. */
352
+ UnpackStatus: NzbGetUnpackStatus;
353
+ /** Result of URL-download. */
354
+ UrlStatus?: NzbGetUrlStatus;
355
+ /** Result of moving the output to its destination. */
356
+ MoveStatus: NzbGetMoveStatus;
357
+ /** Result of post-processing scripts. */
358
+ ScriptStatus: NzbGetScriptStatus;
359
+ /** Result of delete or cleanup handling. */
360
+ DeleteStatus: NzbGetDeleteStatus;
361
+ /** Final mark assigned to the item. */
362
+ MarkStatus: NzbGetMarkStatus;
363
+ /** Destination directory for the item output. */
364
+ DestDir: string;
365
+ /** Final destination directory if overridden during post-processing. */
366
+ FinalDir: string;
367
+ /** Extra par blocks received from or donated to duplicates. */
368
+ ExtraParBlocks?: number;
369
+ /** Per-item parameters attached to the history entry. */
370
+ Parameters: NzbGetParameter[];
371
+ [key: string]: unknown;
372
+ }
373
+ /**
374
+ * Config item returned by {@link https://nzbget-ng.github.io/api/config | config}.
375
+ */
376
+ export interface NzbGetConfigItem {
377
+ /** Config option name. */
378
+ Name: string;
379
+ /** Config option value. */
380
+ Value: string;
381
+ }
382
+ type NzbGetLooseEnum<TValue extends string> = TValue | (string & Record<never, never>);
383
+ export type NzbGetHistoryKind = NzbGetLooseEnum<'NZB' | 'URL' | 'DUP'>;
384
+ export type NzbGetDupeMode = NzbGetLooseEnum<'SCORE' | 'ALL' | 'FORCE'>;
385
+ export type NzbGetParStatus = NzbGetLooseEnum<'NONE' | 'FAILURE' | 'REPAIR_POSSIBLE' | 'SUCCESS' | 'MANUAL'>;
386
+ export type NzbGetExParStatus = NzbGetLooseEnum<'RECIPIENT' | 'DONOR'>;
387
+ export type NzbGetUnpackStatus = NzbGetLooseEnum<'NONE' | 'FAILURE' | 'SPACE' | 'PASSWORD' | 'SUCCESS'>;
388
+ export type NzbGetUrlStatus = NzbGetLooseEnum<'NONE' | 'SUCCESS' | 'FAILURE' | 'SCAN_SKIPPED' | 'SCAN_FAILURE'>;
389
+ export type NzbGetScriptStatus = NzbGetLooseEnum<'NONE' | 'FAILURE' | 'SUCCESS'>;
390
+ export type NzbGetMoveStatus = NzbGetLooseEnum<'NONE' | 'SUCCESS' | 'FAILURE'>;
391
+ export type NzbGetDeleteStatus = NzbGetLooseEnum<'NONE' | 'MANUAL' | 'HEALTH' | 'DUPE' | 'BAD' | 'SCAN' | 'COPY'>;
392
+ export type NzbGetMarkStatus = NzbGetLooseEnum<'NONE' | 'GOOD' | 'BAD'>;
393
+ export type NzbGetHistoryStatus = NzbGetLooseEnum<'SUCCESS/ALL' | 'SUCCESS/UNPACK' | 'SUCCESS/PAR' | 'SUCCESS/HEALTH' | 'SUCCESS/GOOD' | 'SUCCESS/MARK' | 'WARNING/SCRIPT' | 'WARNING/SPACE' | 'WARNING/PASSWORD' | 'WARNING/DAMAGED' | 'WARNING/REPAIRABLE' | 'WARNING/HEALTH' | 'WARNING/SKIPPED' | 'DELETED/MANUAL' | 'DELETED/DUPE' | 'DELETED/COPY' | 'DELETED/GOOD' | 'FAILURE/PAR' | 'FAILURE/UNPACK' | 'FAILURE/MOVE' | 'FAILURE/SCAN' | 'FAILURE/BAD' | 'FAILURE/HEALTH' | 'FAILURE/FETCH' | 'SUCCESS/HIDDEN' | 'FAILURE/HIDDEN'>;
394
+ export type NzbGetQueueKind = NzbGetLooseEnum<'NZB' | 'URL'>;
395
+ export type NzbGetQueueStatus = NzbGetLooseEnum<'QUEUED' | 'PAUSED' | 'DOWNLOADING' | 'FETCHING' | 'PP_QUEUED' | 'LOADING_PARS' | 'VERIFYING_SOURCES' | 'REPAIRING' | 'VERIFYING_REPAIRED' | 'RENAMING' | 'UNPACKING' | 'MOVING' | 'EXECUTING_SCRIPT' | 'PP_FINISHED'>;
396
+ type NzbGetServerSettingKey = `Server${number}.Active` | `Server${number}.Name` | `Server${number}.Level` | `Server${number}.Optional` | `Server${number}.Group` | `Server${number}.Host` | `Server${number}.Encryption` | `Server${number}.Port` | `Server${number}.Username` | `Server${number}.Password` | `Server${number}.JoinGroup` | `Server${number}.Cipher` | `Server${number}.Connections` | `Server${number}.Retention` | `Server${number}.CertVerification` | `Server${number}.IpVersion` | `Server${number}.Notes`;
397
+ type NzbGetCategorySettingKey = `Category${number}.Name` | `Category${number}.DestDir` | `Category${number}.Unpack` | `Category${number}.Extensions` | `Category${number}.Aliases`;
398
+ type NzbGetSettingsKnownKeys = {
399
+ ConfigFile: string;
400
+ AppBin: string;
401
+ AppDir: string;
402
+ Version: string;
403
+ MainDir: string;
404
+ WebDir: string;
405
+ ConfigTemplate: string;
406
+ TempDir: string;
407
+ DestDir: string;
408
+ InterDir: string;
409
+ QueueDir: string;
410
+ NzbDir: string;
411
+ LockFile: string;
412
+ LogFile: string;
413
+ ScriptDir: string;
414
+ RequiredDir: string;
415
+ WriteLog: string;
416
+ RotateLog: string;
417
+ AppendCategoryDir: string;
418
+ OutputMode: string;
419
+ DupeCheck: string;
420
+ DownloadRate: string;
421
+ ControlIP: string;
422
+ ControlUsername: string;
423
+ ControlPassword: string;
424
+ RestrictedUsername: string;
425
+ RestrictedPassword: string;
426
+ AddUsername: string;
427
+ AddPassword: string;
428
+ ControlPort: string;
429
+ FormAuth: string;
430
+ SecureControl: string;
431
+ SecurePort: string;
432
+ SecureCert: string;
433
+ SecureKey: string;
434
+ CertStore: string;
435
+ CertCheck: string;
436
+ AuthorizedIP: string;
437
+ ArticleTimeout: string;
438
+ ArticleReadChunkSize: string;
439
+ UrlTimeout: string;
440
+ RemoteTimeout: string;
441
+ FlushQueue: string;
442
+ SystemHealthCheck: string;
443
+ NzbLog: string;
444
+ RawArticle: string;
445
+ SkipWrite: string;
446
+ ArticleRetries: string;
447
+ ArticleInterval: string;
448
+ UrlRetries: string;
449
+ UrlInterval: string;
450
+ ContinuePartial: string;
451
+ UrlConnections: string;
452
+ LogBuffer: string;
453
+ InfoTarget: string;
454
+ WarningTarget: string;
455
+ ErrorTarget: string;
456
+ DebugTarget: string;
457
+ DetailTarget: string;
458
+ ParCheck: string;
459
+ ParRepair: string;
460
+ ParScan: string;
461
+ ParQuick: string;
462
+ PostStrategy: string;
463
+ FileNaming: string;
464
+ RenameAfterUnpack: string;
465
+ RenameIgnoreExt: string;
466
+ ParRename: string;
467
+ ParBuffer: string;
468
+ ParThreads: string;
469
+ RarRename: string;
470
+ HealthCheck: string;
471
+ DirectRename: string;
472
+ HardLinking: string;
473
+ HardLinkingIgnoreExt: string;
474
+ ScriptOrder: string;
475
+ Extensions: string;
476
+ DaemonUsername: string;
477
+ UMask: string;
478
+ UpdateInterval: string;
479
+ CursesNzbName: string;
480
+ CursesTime: string;
481
+ CursesGroup: string;
482
+ CrcCheck: string;
483
+ DirectWrite: string;
484
+ WriteBuffer: string;
485
+ NzbDirInterval: string;
486
+ NzbDirFileAge: string;
487
+ DiskSpace: string;
488
+ CrashTrace: string;
489
+ CrashDump: string;
490
+ ParPauseQueue: string;
491
+ ScriptPauseQueue: string;
492
+ NzbCleanupDisk: string;
493
+ ParTimeLimit: string;
494
+ KeepHistory: string;
495
+ Unpack: string;
496
+ DirectUnpack: string;
497
+ UseTempUnpackDir: string;
498
+ UnpackCleanupDisk: string;
499
+ UnrarCmd: string;
500
+ SevenZipCmd: string;
501
+ UnpackPassFile: string;
502
+ UnpackPauseQueue: string;
503
+ ExtCleanupDisk: string;
504
+ ParIgnoreExt: string;
505
+ UnpackIgnoreExt: string;
506
+ FeedHistory: string;
507
+ UrlForce: string;
508
+ TimeCorrection: string;
509
+ PropagationDelay: string;
510
+ ArticleCache: string;
511
+ EventInterval: string;
512
+ ShellOverride: string;
513
+ MonthlyQuota: string;
514
+ QuotaStartDay: string;
515
+ DailyQuota: string;
516
+ ReorderFiles: string;
517
+ UpdateCheck: string;
518
+ };
519
+ /**
520
+ * Settings map returned by {@link https://nzbget-ng.github.io/api/config | config}.
521
+ *
522
+ * NZBGet exposes a broad string-to-string config object. This type makes the
523
+ * common built-in keys explicit while preserving support for custom or
524
+ * version-specific settings.
525
+ */
526
+ export type NzbGetSettings = Record<string, string> & NzbGetSettingsKnownKeys & Partial<Record<NzbGetServerSettingKey, string>> & Partial<Record<NzbGetCategorySettingKey, string>>;
527
+ /**
528
+ * Template entry returned by
529
+ * {@link https://nzbget-ng.github.io/api/configtemplates | configtemplates}.
530
+ */
531
+ export interface NzbGetConfigTemplate {
532
+ /**
533
+ * Script path, or an empty value for the first record which contains the base
534
+ * NZBGet config template.
535
+ */
536
+ Name: string;
537
+ /** Display-ready script name. */
538
+ DisplayName?: string;
539
+ /** True for post-processing scripts. */
540
+ PostScript?: boolean;
541
+ /** True for scan scripts. */
542
+ ScanScript?: boolean;
543
+ /** True for queue scripts. */
544
+ QueueScript?: boolean;
545
+ /** True for scheduler scripts. */
546
+ SchedulerScript?: boolean;
547
+ /** Multi-line template content. */
548
+ Template?: string;
549
+ [key: string]: unknown;
550
+ }
551
+ /**
552
+ * File entry returned by {@link https://nzbget-ng.github.io/api/listfiles | listfiles}.
553
+ */
554
+ export interface NzbGetFile {
555
+ /** ID of the file. */
556
+ ID: number;
557
+ /** ID of the parent NZB group. */
558
+ NZBID: number;
559
+ /** Source NZB filename, possibly including a path. */
560
+ NZBFilename?: string;
561
+ /** Friendly NZB name without path or extension. */
562
+ NZBName?: string;
563
+ /** Deprecated alias for `NZBName`. */
564
+ NZBNicename?: string;
565
+ /** True if the filename was confirmed from the article body. */
566
+ FilenameConfirmed?: boolean;
567
+ /** Destination directory for the output file. */
568
+ DestDir?: string;
569
+ /** Parsed or confirmed filename for the file entry. */
570
+ Filename: string;
571
+ /** Subject read from the NZB file. */
572
+ Subject?: string;
573
+ /** File size in bytes, low 32 bits. */
574
+ FileSizeLo?: number;
575
+ /** File size in bytes, high 32 bits. */
576
+ FileSizeHi?: number;
577
+ /** Remaining size in bytes, low 32 bits. */
578
+ RemainingSizeLo?: number;
579
+ /** Remaining size in bytes, high 32 bits. */
580
+ RemainingSizeHi?: number;
581
+ /** True if the file is paused. */
582
+ Paused?: boolean;
583
+ /** Post date in Unix seconds. */
584
+ PostTime?: number;
585
+ /** Deprecated file priority. */
586
+ Priority?: number;
587
+ /** Number of active downloads for this file. */
588
+ ActiveDownloads?: number;
589
+ /** Download progress in the range 0..1000. */
590
+ Progress?: number;
591
+ [key: string]: unknown;
592
+ }
593
+ export interface NzbGetAddOptions {
594
+ /** Category assigned to the added download. */
595
+ category?: string;
596
+ /** Raw NZBGet priority value. */
597
+ priority?: number;
598
+ /** True to add the item paused. */
599
+ addPaused?: boolean;
600
+ /** True to place the item at the top of the queue. */
601
+ addToTop?: boolean;
602
+ /** Duplicate key used by NZBGet duplicate handling. */
603
+ dupeKey?: string;
604
+ /** Duplicate score used by NZBGet duplicate handling. */
605
+ dupeScore?: number;
606
+ /** Duplicate mode used by NZBGet duplicate handling. */
607
+ dupeMode?: NzbGetDupeMode;
608
+ /** Post-processing parameters sent with the append call. */
609
+ ppParameters?: NzbGetParameter[];
610
+ }
611
+ export type NzbGetEditQueueCommand = 'FileMoveOffset' | 'FileMoveTop' | 'FileMoveBottom' | 'FilePause' | 'FileResume' | 'FileDelete' | 'FilePauseAllPars' | 'FilePauseExtraPars' | 'FileSetPriority' | 'FileReorder' | 'FileSplit' | 'GroupMoveOffset' | 'GroupMoveTop' | 'GroupMoveBottom' | 'GroupPause' | 'GroupResume' | 'GroupDelete' | 'GroupDupeDelete' | 'GroupFinalDelete' | 'GroupPauseAllPars' | 'GroupPauseExtraPars' | 'GroupSetPriority' | 'GroupSetCategory' | 'GroupApplyCategory' | 'GroupMerge' | 'GroupSetParameter' | 'GroupSetName' | 'GroupSetDupeKey' | 'GroupSetDupeScore' | 'GroupSetDupeMode' | 'GroupSort' | 'PostMoveOffset' | 'PostMoveTop' | 'PostMoveBottom' | 'PostDelete' | 'HistoryDelete' | 'HistoryFinalDelete' | 'HistoryReturn' | 'HistoryProcess' | 'HistoryRedownload' | 'HistorySetName' | 'HistorySetCategory' | 'HistorySetParameter' | 'HistorySetDupeKey' | 'HistorySetDupeScore' | 'HistorySetDupeMode' | 'HistorySetDupeBackup' | 'HistoryMarkBad' | 'HistoryMarkGood' | 'HistoryMarkSuccess';
612
+ export type NzbGetSortField = 'name' | 'priority' | 'category' | 'size' | 'left';
613
+ export type NzbGetSortDirection = '+' | '-';
614
+ export type NzbGetSortParam = NzbGetSortField | `${NzbGetSortField}${NzbGetSortDirection}`;
615
+ export type NzbGetParameterAssignment = `${string}=${string}`;
616
+ export interface NzbGetEditQueueParameterMap {
617
+ FileMoveOffset: number | `${number}`;
618
+ FileMoveTop: '';
619
+ FileMoveBottom: '';
620
+ FilePause: '';
621
+ FileResume: '';
622
+ FileDelete: '';
623
+ FilePauseAllPars: '';
624
+ FilePauseExtraPars: '';
625
+ FileSetPriority: number;
626
+ FileReorder: '';
627
+ FileSplit: '';
628
+ GroupMoveOffset: number | `${number}`;
629
+ GroupMoveTop: '';
630
+ GroupMoveBottom: '';
631
+ GroupPause: '';
632
+ GroupResume: '';
633
+ GroupDelete: '';
634
+ GroupDupeDelete: '';
635
+ GroupFinalDelete: '';
636
+ GroupPauseAllPars: '';
637
+ GroupPauseExtraPars: '';
638
+ GroupSetPriority: number;
639
+ GroupSetCategory: string;
640
+ GroupApplyCategory: string;
641
+ GroupMerge: '';
642
+ GroupSetParameter: NzbGetParameterAssignment;
643
+ GroupSetName: string;
644
+ GroupSetDupeKey: string;
645
+ GroupSetDupeScore: number | `${number}`;
646
+ GroupSetDupeMode: NzbGetDupeMode;
647
+ GroupSort: NzbGetSortParam;
648
+ PostMoveOffset: number | `${number}`;
649
+ PostMoveTop: '';
650
+ PostMoveBottom: '';
651
+ PostDelete: '';
652
+ HistoryDelete: '';
653
+ HistoryFinalDelete: '';
654
+ HistoryReturn: '';
655
+ HistoryProcess: '';
656
+ HistoryRedownload: '';
657
+ HistorySetName: string;
658
+ HistorySetCategory: string;
659
+ HistorySetParameter: NzbGetParameterAssignment;
660
+ HistorySetDupeKey: string;
661
+ HistorySetDupeScore: number | `${number}`;
662
+ HistorySetDupeMode: NzbGetDupeMode;
663
+ HistorySetDupeBackup: '0' | '1' | 0 | 1;
664
+ HistoryMarkBad: '';
665
+ HistoryMarkGood: '';
666
+ HistoryMarkSuccess: '';
667
+ }
668
+ export type NzbGetEditQueueParameter<TCommand extends NzbGetEditQueueCommand> = NzbGetEditQueueParameterMap[TCommand];
669
+ export {};
@@ -0,0 +1 @@
1
+ export {};