tsarr 2.4.0 → 2.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"prowlarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/prowlarr.ts"],"names":[],"mappings":"AA+MA,eAAO,MAAM,QAAQ,qDAKpB,CAAC"}
1
+ {"version":3,"file":"prowlarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/prowlarr.ts"],"names":[],"mappings":"AA0SA,eAAO,MAAM,QAAQ,qDAKpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"radarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/radarr.ts"],"names":[],"mappings":"AA2fA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
1
+ {"version":3,"file":"radarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/radarr.ts"],"names":[],"mappings":"AAmjBA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sonarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sonarr.ts"],"names":[],"mappings":"AAihBA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
1
+ {"version":3,"file":"sonarr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/sonarr.ts"],"names":[],"mappings":"AAmmBA,eAAO,MAAM,MAAM,qDAKlB,CAAC"}
package/dist/cli/index.js CHANGED
@@ -5259,6 +5259,7 @@ var exports_radarr3 = {};
5259
5259
  __export(exports_radarr3, {
5260
5260
  radarr: () => radarr
5261
5261
  });
5262
+ import { readFileSync as readFileSync2 } from "node:fs";
5262
5263
  function unwrapData(result) {
5263
5264
  return result?.data ?? result;
5264
5265
  }
@@ -5299,6 +5300,10 @@ async function findMovieByTmdbId(client2, tmdbId) {
5299
5300
  function getApiStatus(result) {
5300
5301
  return result?.error?.status ?? result?.response?.status;
5301
5302
  }
5303
+ function readJsonInput(filePath) {
5304
+ const raw = filePath === "-" ? readFileSync2(0, "utf-8") : readFileSync2(filePath, "utf-8");
5305
+ return JSON.parse(raw);
5306
+ }
5302
5307
  var resources, radarr;
5303
5308
  var init_radarr3 = __esm(() => {
5304
5309
  init_radarr2();
@@ -5319,6 +5324,7 @@ var init_radarr3 = __esm(() => {
5319
5324
  name: "get",
5320
5325
  description: "Get a movie by ID",
5321
5326
  args: [{ name: "id", description: "Movie ID", required: true, type: "number" }],
5327
+ columns: ["id", "title", "year", "monitored", "hasFile", "status", "qualityProfileId"],
5322
5328
  run: (c3, a2) => c3.getMovie(a2.id)
5323
5329
  },
5324
5330
  {
@@ -5657,6 +5663,24 @@ var init_radarr3 = __esm(() => {
5657
5663
  args: [{ name: "id", description: "Notification ID", required: true, type: "number" }],
5658
5664
  run: (c3, a2) => c3.getNotification(a2.id)
5659
5665
  },
5666
+ {
5667
+ name: "add",
5668
+ description: "Add a notification from JSON file or stdin",
5669
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
5670
+ run: async (c3, a2) => c3.addNotification(readJsonInput(a2.file))
5671
+ },
5672
+ {
5673
+ name: "edit",
5674
+ description: "Edit a notification (merges JSON with existing)",
5675
+ args: [
5676
+ { name: "id", description: "Notification ID", required: true, type: "number" },
5677
+ { name: "file", description: "JSON file with fields to update", required: true }
5678
+ ],
5679
+ run: async (c3, a2) => {
5680
+ const existing = unwrapData(await c3.getNotification(a2.id));
5681
+ return c3.updateNotification(a2.id, { ...existing, ...readJsonInput(a2.file) });
5682
+ }
5683
+ },
5660
5684
  {
5661
5685
  name: "delete",
5662
5686
  description: "Delete a notification",
@@ -5687,6 +5711,24 @@ var init_radarr3 = __esm(() => {
5687
5711
  args: [{ name: "id", description: "Download client ID", required: true, type: "number" }],
5688
5712
  run: (c3, a2) => c3.getDownloadClient(a2.id)
5689
5713
  },
5714
+ {
5715
+ name: "add",
5716
+ description: "Add a download client from JSON file or stdin",
5717
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
5718
+ run: async (c3, a2) => c3.addDownloadClient(readJsonInput(a2.file))
5719
+ },
5720
+ {
5721
+ name: "edit",
5722
+ description: "Edit a download client (merges JSON with existing)",
5723
+ args: [
5724
+ { name: "id", description: "Download client ID", required: true, type: "number" },
5725
+ { name: "file", description: "JSON file with fields to update", required: true }
5726
+ ],
5727
+ run: async (c3, a2) => {
5728
+ const existing = unwrapData(await c3.getDownloadClient(a2.id));
5729
+ return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput(a2.file) });
5730
+ }
5731
+ },
5690
5732
  {
5691
5733
  name: "delete",
5692
5734
  description: "Delete a download client",
@@ -5754,6 +5796,24 @@ var init_radarr3 = __esm(() => {
5754
5796
  args: [{ name: "id", description: "Import list ID", required: true, type: "number" }],
5755
5797
  run: (c3, a2) => c3.getImportList(a2.id)
5756
5798
  },
5799
+ {
5800
+ name: "add",
5801
+ description: "Add an import list from JSON file or stdin",
5802
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
5803
+ run: async (c3, a2) => c3.addImportList(readJsonInput(a2.file))
5804
+ },
5805
+ {
5806
+ name: "edit",
5807
+ description: "Edit an import list (merges JSON with existing)",
5808
+ args: [
5809
+ { name: "id", description: "Import list ID", required: true, type: "number" },
5810
+ { name: "file", description: "JSON file with fields to update", required: true }
5811
+ ],
5812
+ run: async (c3, a2) => {
5813
+ const existing = unwrapData(await c3.getImportList(a2.id));
5814
+ return c3.updateImportList(a2.id, { ...existing, ...readJsonInput(a2.file) });
5815
+ }
5816
+ },
5757
5817
  {
5758
5818
  name: "delete",
5759
5819
  description: "Delete an import list",
@@ -8177,6 +8237,7 @@ var exports_sonarr3 = {};
8177
8237
  __export(exports_sonarr3, {
8178
8238
  sonarr: () => sonarr
8179
8239
  });
8240
+ import { readFileSync as readFileSync3 } from "node:fs";
8180
8241
  function unwrapData2(result) {
8181
8242
  return result?.data ?? result;
8182
8243
  }
@@ -8236,6 +8297,10 @@ async function findSeriesByTvdbId(client3, tvdbId) {
8236
8297
  function getApiStatus2(result) {
8237
8298
  return result?.error?.status ?? result?.response?.status;
8238
8299
  }
8300
+ function readJsonInput2(filePath) {
8301
+ const raw = filePath === "-" ? readFileSync3(0, "utf-8") : readFileSync3(filePath, "utf-8");
8302
+ return JSON.parse(raw);
8303
+ }
8239
8304
  var resources2, sonarr;
8240
8305
  var init_sonarr3 = __esm(() => {
8241
8306
  init_sonarr2();
@@ -8268,7 +8333,21 @@ var init_sonarr3 = __esm(() => {
8268
8333
  name: "get",
8269
8334
  description: "Get a series by ID",
8270
8335
  args: [{ name: "id", description: "Series ID", required: true, type: "number" }],
8271
- run: (c3, a2) => c3.getSeriesById(a2.id)
8336
+ columns: [
8337
+ "id",
8338
+ "title",
8339
+ "year",
8340
+ "monitored",
8341
+ "seasonCount",
8342
+ "episodeCount",
8343
+ "network",
8344
+ "status"
8345
+ ],
8346
+ run: async (c3, a2) => {
8347
+ const result = await c3.getSeriesById(a2.id);
8348
+ const series = unwrapData2(result);
8349
+ return formatSeriesListItem(series);
8350
+ }
8272
8351
  },
8273
8352
  {
8274
8353
  name: "search",
@@ -8438,6 +8517,12 @@ var init_sonarr3 = __esm(() => {
8438
8517
  description: "List quality profiles",
8439
8518
  columns: ["id", "name"],
8440
8519
  run: (c3) => c3.getQualityProfiles()
8520
+ },
8521
+ {
8522
+ name: "get",
8523
+ description: "Get a quality profile by ID",
8524
+ args: [{ name: "id", description: "Profile ID", required: true, type: "number" }],
8525
+ run: (c3, a2) => c3.getQualityProfile(a2.id)
8441
8526
  }
8442
8527
  ]
8443
8528
  },
@@ -8586,7 +8671,14 @@ var init_sonarr3 = __esm(() => {
8586
8671
  { name: "unmonitored", description: "Include unmonitored", type: "boolean" }
8587
8672
  ],
8588
8673
  columns: ["id", "seriesTitle", "title", "seasonNumber", "episodeNumber", "airDateUtc"],
8589
- run: (c3, a2) => c3.getCalendar(a2.start, a2.end, a2.unmonitored)
8674
+ run: async (c3, a2) => {
8675
+ const result = await c3.getCalendar(a2.start, a2.end, a2.unmonitored);
8676
+ const episodes = unwrapData2(result);
8677
+ return episodes.map((ep) => ({
8678
+ ...ep,
8679
+ seriesTitle: ep.seriesTitle || ep.series?.title || "—"
8680
+ }));
8681
+ }
8590
8682
  }
8591
8683
  ]
8592
8684
  },
@@ -8606,6 +8698,24 @@ var init_sonarr3 = __esm(() => {
8606
8698
  args: [{ name: "id", description: "Notification ID", required: true, type: "number" }],
8607
8699
  run: (c3, a2) => c3.getNotification(a2.id)
8608
8700
  },
8701
+ {
8702
+ name: "add",
8703
+ description: "Add a notification from JSON file or stdin",
8704
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
8705
+ run: async (c3, a2) => c3.addNotification(readJsonInput2(a2.file))
8706
+ },
8707
+ {
8708
+ name: "edit",
8709
+ description: "Edit a notification (merges JSON with existing)",
8710
+ args: [
8711
+ { name: "id", description: "Notification ID", required: true, type: "number" },
8712
+ { name: "file", description: "JSON file with fields to update", required: true }
8713
+ ],
8714
+ run: async (c3, a2) => {
8715
+ const existing = unwrapData2(await c3.getNotification(a2.id));
8716
+ return c3.updateNotification(a2.id, { ...existing, ...readJsonInput2(a2.file) });
8717
+ }
8718
+ },
8609
8719
  {
8610
8720
  name: "delete",
8611
8721
  description: "Delete a notification",
@@ -8636,6 +8746,24 @@ var init_sonarr3 = __esm(() => {
8636
8746
  args: [{ name: "id", description: "Download client ID", required: true, type: "number" }],
8637
8747
  run: (c3, a2) => c3.getDownloadClient(a2.id)
8638
8748
  },
8749
+ {
8750
+ name: "add",
8751
+ description: "Add a download client from JSON file or stdin",
8752
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
8753
+ run: async (c3, a2) => c3.addDownloadClient(readJsonInput2(a2.file))
8754
+ },
8755
+ {
8756
+ name: "edit",
8757
+ description: "Edit a download client (merges JSON with existing)",
8758
+ args: [
8759
+ { name: "id", description: "Download client ID", required: true, type: "number" },
8760
+ { name: "file", description: "JSON file with fields to update", required: true }
8761
+ ],
8762
+ run: async (c3, a2) => {
8763
+ const existing = unwrapData2(await c3.getDownloadClient(a2.id));
8764
+ return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput2(a2.file) });
8765
+ }
8766
+ },
8639
8767
  {
8640
8768
  name: "delete",
8641
8769
  description: "Delete a download client",
@@ -8703,6 +8831,24 @@ var init_sonarr3 = __esm(() => {
8703
8831
  args: [{ name: "id", description: "Import list ID", required: true, type: "number" }],
8704
8832
  run: (c3, a2) => c3.getImportList(a2.id)
8705
8833
  },
8834
+ {
8835
+ name: "add",
8836
+ description: "Add an import list from JSON file or stdin",
8837
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
8838
+ run: async (c3, a2) => c3.addImportList(readJsonInput2(a2.file))
8839
+ },
8840
+ {
8841
+ name: "edit",
8842
+ description: "Edit an import list (merges JSON with existing)",
8843
+ args: [
8844
+ { name: "id", description: "Import list ID", required: true, type: "number" },
8845
+ { name: "file", description: "JSON file with fields to update", required: true }
8846
+ ],
8847
+ run: async (c3, a2) => {
8848
+ const existing = unwrapData2(await c3.getImportList(a2.id));
8849
+ return c3.updateImportList(a2.id, { ...existing, ...readJsonInput2(a2.file) });
8850
+ }
8851
+ },
8706
8852
  {
8707
8853
  name: "delete",
8708
8854
  description: "Delete an import list",
@@ -15446,6 +15592,14 @@ var exports_prowlarr3 = {};
15446
15592
  __export(exports_prowlarr3, {
15447
15593
  prowlarr: () => prowlarr
15448
15594
  });
15595
+ import { readFileSync as readFileSync4 } from "node:fs";
15596
+ function unwrapData3(result) {
15597
+ return result?.data ?? result;
15598
+ }
15599
+ function readJsonInput3(filePath) {
15600
+ const raw = filePath === "-" ? readFileSync4(0, "utf-8") : readFileSync4(filePath, "utf-8");
15601
+ return JSON.parse(raw);
15602
+ }
15449
15603
  var resources5, prowlarr;
15450
15604
  var init_prowlarr3 = __esm(() => {
15451
15605
  init_prowlarr2();
@@ -15468,6 +15622,28 @@ var init_prowlarr3 = __esm(() => {
15468
15622
  args: [{ name: "id", description: "Indexer ID", required: true, type: "number" }],
15469
15623
  run: (c3, a2) => c3.getIndexer(a2.id)
15470
15624
  },
15625
+ {
15626
+ name: "add",
15627
+ description: "Add an indexer from JSON file or stdin",
15628
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
15629
+ run: async (c3, a2) => {
15630
+ const body = readJsonInput3(a2.file);
15631
+ return c3.addIndexer(body);
15632
+ }
15633
+ },
15634
+ {
15635
+ name: "edit",
15636
+ description: "Edit an indexer (merges JSON with existing)",
15637
+ args: [
15638
+ { name: "id", description: "Indexer ID", required: true, type: "number" },
15639
+ { name: "file", description: "JSON file with fields to update", required: true }
15640
+ ],
15641
+ run: async (c3, a2) => {
15642
+ const existing = unwrapData3(await c3.getIndexer(a2.id));
15643
+ const updates = readJsonInput3(a2.file);
15644
+ return c3.updateIndexer(a2.id, { ...existing, ...updates });
15645
+ }
15646
+ },
15471
15647
  {
15472
15648
  name: "delete",
15473
15649
  description: "Delete an indexer",
@@ -15514,6 +15690,28 @@ var init_prowlarr3 = __esm(() => {
15514
15690
  args: [{ name: "id", description: "Application ID", required: true, type: "number" }],
15515
15691
  run: (c3, a2) => c3.getApplication(a2.id)
15516
15692
  },
15693
+ {
15694
+ name: "add",
15695
+ description: "Add an application from JSON file or stdin",
15696
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
15697
+ run: async (c3, a2) => {
15698
+ const body = readJsonInput3(a2.file);
15699
+ return c3.addApplication(body);
15700
+ }
15701
+ },
15702
+ {
15703
+ name: "edit",
15704
+ description: "Edit an application (merges JSON with existing)",
15705
+ args: [
15706
+ { name: "id", description: "Application ID", required: true, type: "number" },
15707
+ { name: "file", description: "JSON file with fields to update", required: true }
15708
+ ],
15709
+ run: async (c3, a2) => {
15710
+ const existing = unwrapData3(await c3.getApplication(a2.id));
15711
+ const updates = readJsonInput3(a2.file);
15712
+ return c3.updateApplication(a2.id, { ...existing, ...updates });
15713
+ }
15714
+ },
15517
15715
  {
15518
15716
  name: "delete",
15519
15717
  description: "Delete an application",
@@ -15569,7 +15767,17 @@ var init_prowlarr3 = __esm(() => {
15569
15767
  {
15570
15768
  name: "list",
15571
15769
  description: "Get indexer performance statistics",
15572
- run: (c3) => c3.getIndexerStats()
15770
+ columns: [
15771
+ "indexerName",
15772
+ "numberOfQueries",
15773
+ "numberOfGrabs",
15774
+ "numberOfFailures",
15775
+ "averageResponseTime"
15776
+ ],
15777
+ run: async (c3) => {
15778
+ const result = unwrapData3(await c3.getIndexerStats());
15779
+ return result?.indexers ?? result;
15780
+ }
15573
15781
  }
15574
15782
  ]
15575
15783
  },
@@ -15589,6 +15797,24 @@ var init_prowlarr3 = __esm(() => {
15589
15797
  args: [{ name: "id", description: "Notification ID", required: true, type: "number" }],
15590
15798
  run: (c3, a2) => c3.getNotification(a2.id)
15591
15799
  },
15800
+ {
15801
+ name: "add",
15802
+ description: "Add a notification from JSON file or stdin",
15803
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
15804
+ run: async (c3, a2) => c3.addNotification(readJsonInput3(a2.file))
15805
+ },
15806
+ {
15807
+ name: "edit",
15808
+ description: "Edit a notification (merges JSON with existing)",
15809
+ args: [
15810
+ { name: "id", description: "Notification ID", required: true, type: "number" },
15811
+ { name: "file", description: "JSON file with fields to update", required: true }
15812
+ ],
15813
+ run: async (c3, a2) => {
15814
+ const existing = unwrapData3(await c3.getNotification(a2.id));
15815
+ return c3.updateNotification(a2.id, { ...existing, ...readJsonInput3(a2.file) });
15816
+ }
15817
+ },
15592
15818
  {
15593
15819
  name: "delete",
15594
15820
  description: "Delete a notification",
@@ -15619,6 +15845,24 @@ var init_prowlarr3 = __esm(() => {
15619
15845
  args: [{ name: "id", description: "Download client ID", required: true, type: "number" }],
15620
15846
  run: (c3, a2) => c3.getDownloadClient(a2.id)
15621
15847
  },
15848
+ {
15849
+ name: "add",
15850
+ description: "Add a download client from JSON file or stdin",
15851
+ args: [{ name: "file", description: "JSON file path (use - for stdin)", required: true }],
15852
+ run: async (c3, a2) => c3.addDownloadClient(readJsonInput3(a2.file))
15853
+ },
15854
+ {
15855
+ name: "edit",
15856
+ description: "Edit a download client (merges JSON with existing)",
15857
+ args: [
15858
+ { name: "id", description: "Download client ID", required: true, type: "number" },
15859
+ { name: "file", description: "JSON file with fields to update", required: true }
15860
+ ],
15861
+ run: async (c3, a2) => {
15862
+ const existing = unwrapData3(await c3.getDownloadClient(a2.id));
15863
+ return c3.updateDownloadClient(a2.id, { ...existing, ...readJsonInput3(a2.file) });
15864
+ }
15865
+ },
15622
15866
  {
15623
15867
  name: "delete",
15624
15868
  description: "Delete a download client",
@@ -17751,8 +17995,8 @@ var init_completions = __esm(() => {
17751
17995
 
17752
17996
  // src/cli/index.ts
17753
17997
  init_dist();
17754
- import { readFileSync as readFileSync2 } from "node:fs";
17755
- var { version } = JSON.parse(readFileSync2(new URL("../../package.json", import.meta.url), "utf-8"));
17998
+ import { readFileSync as readFileSync5 } from "node:fs";
17999
+ var { version } = JSON.parse(readFileSync5(new URL("../../package.json", import.meta.url), "utf-8"));
17756
18000
  var main = defineCommand({
17757
18001
  meta: {
17758
18002
  name: "tsarr",
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsarr",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "author": "Robbe Verhelst",
5
5
  "repository": {
6
6
  "type": "git",
Binary file