tsarr 2.7.0 → 2.7.2

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":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;EAsFjB,CAAC"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;EA8FjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"seerr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/seerr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,SAAS,EAAE,WAAW,EAgGlC,CAAC;AAEF,eAAO,MAAM,KAAK,qDAKjB,CAAC"}
1
+ {"version":3,"file":"seerr.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/seerr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,SAAS,EAAE,WAAW,EA4GlC,CAAC;AAEF,eAAO,MAAM,KAAK,qDAKjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/service.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAA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AAC,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,sBAAsB,UAA0D,CAAC;AAE9F,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,CAM5E;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,EACnC,SAAS,EAAE,WAAW,EAAE,uDAqLzB"}
package/dist/cli/index.js CHANGED
@@ -5109,7 +5109,12 @@ function formatOutput(data, options) {
5109
5109
  }
5110
5110
  switch (options.format) {
5111
5111
  case "json": {
5112
- const output = options.select ? selectFields(data, options.select) : data;
5112
+ let output = data;
5113
+ if (options.select) {
5114
+ output = selectFields(data, options.select);
5115
+ } else if (options.columns && Array.isArray(data)) {
5116
+ output = selectFields(data, options.columns.join(","));
5117
+ }
5113
5118
  console.log(JSON.stringify(output, null, 2));
5114
5119
  break;
5115
5120
  }
@@ -5383,7 +5388,7 @@ function buildServiceCommand(serviceName, description, clientFactory, resources)
5383
5388
  const format = detectFormat(args);
5384
5389
  const noHeader = process.argv.includes("--no-header") || !!args.noHeader;
5385
5390
  const dryRun = !!(args["dry-run"] ?? args.dryRun ?? process.argv.includes("--dry-run"));
5386
- if (dryRun && isWriteAction(action.name)) {
5391
+ if (dryRun) {
5387
5392
  formatOutput(buildDryRunPreview(format, serviceName, resource.name, action.name, resolvedArgs), {
5388
5393
  format,
5389
5394
  noHeader
@@ -5418,6 +5423,8 @@ Run \`tsarr config init\` or set TSARR_${serviceName.toUpperCase()}_API_KEY`;
5418
5423
  }
5419
5424
  if (result?.records !== undefined && Array.isArray(result.records)) {
5420
5425
  result = result.records;
5426
+ } else if (result?.results !== undefined && Array.isArray(result.results)) {
5427
+ result = result.results;
5421
5428
  }
5422
5429
  formatOutput(result, {
5423
5430
  format,
@@ -5432,12 +5439,21 @@ Run \`tsarr config init\` or set TSARR_${serviceName.toUpperCase()}_API_KEY`;
5432
5439
  }
5433
5440
  });
5434
5441
  }
5442
+ const singleAction = resource.actions.length === 1 ? resource.actions[0] : undefined;
5443
+ const singleActionCommand = singleAction ? actionCommands[singleAction.name] : undefined;
5435
5444
  subCommands[resource.name] = defineCommand({
5436
5445
  meta: {
5437
5446
  name: resource.name,
5438
5447
  description: resource.description
5439
5448
  },
5440
- subCommands: actionCommands
5449
+ subCommands: actionCommands,
5450
+ ...singleActionCommand ? {
5451
+ run: (ctx) => {
5452
+ if (process.argv.includes(singleAction.name))
5453
+ return;
5454
+ return singleActionCommand.run(ctx);
5455
+ }
5456
+ } : {}
5441
5457
  });
5442
5458
  }
5443
5459
  return defineCommand({
@@ -5460,22 +5476,6 @@ function coerceBooleanArg(value) {
5460
5476
  }
5461
5477
  return Boolean(value);
5462
5478
  }
5463
- function isWriteAction(actionName) {
5464
- return [
5465
- "add",
5466
- "create",
5467
- "delete",
5468
- "edit",
5469
- "pause",
5470
- "resume",
5471
- "refresh",
5472
- "manual-search",
5473
- "grab",
5474
- "sync",
5475
- "test",
5476
- "search"
5477
- ].includes(actionName);
5478
- }
5479
5479
  function buildDryRunPreview(format, serviceName, resourceName, actionName, args) {
5480
5480
  const filteredArgs = Object.fromEntries(Object.entries(args).filter(([key, value]) => value !== undefined && key !== "_" && key !== "json" && key !== "table" && key !== "plain" && key !== "quiet" && key !== "select" && key !== "no-header" && key !== "noHeader" && key !== "dry-run" && key !== "dryRun"));
5481
5481
  if (format === "json") {
@@ -21067,7 +21067,20 @@ var init_seerr3 = __esm(() => {
21067
21067
  ],
21068
21068
  columns: ["id", "status", "requestedBy", "createdAt", "updatedAt"],
21069
21069
  idField: "id",
21070
- run: (c3, a2) => c3.getRequests(a2.filter ? { filter: a2.filter } : undefined)
21070
+ run: async (c3, a2) => {
21071
+ const result = await c3.getRequests(a2.filter ? { filter: a2.filter } : undefined);
21072
+ const data = result?.data ?? result;
21073
+ const items = data?.results ?? data;
21074
+ if (!Array.isArray(items))
21075
+ return result;
21076
+ return {
21077
+ ...data,
21078
+ results: items.map((r3) => ({
21079
+ ...r3,
21080
+ requestedBy: r3.requestedBy?.displayName ?? r3.requestedBy?.email ?? r3.requestedBy
21081
+ }))
21082
+ };
21083
+ }
21071
21084
  },
21072
21085
  {
21073
21086
  name: "count",
@@ -21160,13 +21173,13 @@ function classifyError(error) {
21160
21173
  return "Unknown error";
21161
21174
  const msg = error.message;
21162
21175
  const cause = error.cause;
21163
- if (cause?.code === "ECONNREFUSED" || msg.includes("ECONNREFUSED")) {
21176
+ if (cause?.code === "ECONNREFUSED" || cause?.code === "ConnectionRefused" || msg.includes("ECONNREFUSED")) {
21164
21177
  return "Connection refused - is the service running?";
21165
21178
  }
21166
21179
  if (cause?.code === "ENOTFOUND" || msg.includes("ENOTFOUND")) {
21167
21180
  return "Host not found - check the URL";
21168
21181
  }
21169
- if (cause?.code === "ECONNRESET" || msg.includes("ECONNRESET")) {
21182
+ if (cause?.code === "ECONNRESET" || cause?.code === "ConnectionReset" || msg.includes("ECONNRESET")) {
21170
21183
  return "Connection reset - service may have crashed";
21171
21184
  }
21172
21185
  if (cause?.code === "ETIMEDOUT" || msg.includes("ETIMEDOUT") || msg.includes("timed out")) {
@@ -21274,6 +21287,11 @@ var init_doctor = __esm(() => {
21274
21287
  }
21275
21288
  const client9 = factory(svcConfig);
21276
21289
  const status = await client9.getSystemStatus();
21290
+ if (status?.error !== undefined) {
21291
+ const err = status.error;
21292
+ const cause = err?.code ? { code: err.code } : undefined;
21293
+ throw Object.assign(new Error(err?.message ?? err?.code ?? "Unknown API error"), cause ? { cause } : {});
21294
+ }
21277
21295
  const version = extractVersion(service, status) ?? "?";
21278
21296
  if (version === "?") {
21279
21297
  throw new Error("Unexpected response payload");
@@ -21301,7 +21319,7 @@ var init_doctor = __esm(() => {
21301
21319
  }
21302
21320
  formatOutput(results, {
21303
21321
  format,
21304
- columns: ["service", "status", "version", "baseUrl", "error"],
21322
+ columns: ["service", "status", "configured", "version", "baseUrl", "error"],
21305
21323
  idField: "service",
21306
21324
  select: args.select
21307
21325
  });
@@ -21716,7 +21734,7 @@ init_dist();
21716
21734
  // package.json
21717
21735
  var package_default = {
21718
21736
  name: "tsarr",
21719
- version: "2.7.0",
21737
+ version: "2.7.2",
21720
21738
  author: "Robbe Verhelst",
21721
21739
  repository: {
21722
21740
  type: "git",
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,YAAY,CAMf;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE;IACP,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,IAAI,CA+BN"}
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhE,wBAAgB,YAAY,CAAC,IAAI,EAAE;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,YAAY,CAMf;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE;IACP,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,IAAI,CAoCN"}
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsarr",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "author": "Robbe Verhelst",
5
5
  "repository": {
6
6
  "type": "git",
Binary file