tsarr 2.7.0 → 2.7.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":"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,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,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,uDAqKzB"}
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,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,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,uDA6KzB"}
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,14 @@ Run \`tsarr config init\` or set TSARR_${serviceName.toUpperCase()}_API_KEY`;
5432
5439
  }
5433
5440
  });
5434
5441
  }
5442
+ const singleAction = resource.actions.length === 1 ? actionCommands[resource.actions[0].name] : undefined;
5435
5443
  subCommands[resource.name] = defineCommand({
5436
5444
  meta: {
5437
5445
  name: resource.name,
5438
5446
  description: resource.description
5439
5447
  },
5440
- subCommands: actionCommands
5448
+ subCommands: actionCommands,
5449
+ ...singleAction ? { run: singleAction.run } : {}
5441
5450
  });
5442
5451
  }
5443
5452
  return defineCommand({
@@ -5460,22 +5469,6 @@ function coerceBooleanArg(value) {
5460
5469
  }
5461
5470
  return Boolean(value);
5462
5471
  }
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
5472
  function buildDryRunPreview(format, serviceName, resourceName, actionName, args) {
5480
5473
  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
5474
  if (format === "json") {
@@ -21301,7 +21294,7 @@ var init_doctor = __esm(() => {
21301
21294
  }
21302
21295
  formatOutput(results, {
21303
21296
  format,
21304
- columns: ["service", "status", "version", "baseUrl", "error"],
21297
+ columns: ["service", "status", "configured", "version", "baseUrl", "error"],
21305
21298
  idField: "service",
21306
21299
  select: args.select
21307
21300
  });
@@ -21716,7 +21709,7 @@ init_dist();
21716
21709
  // package.json
21717
21710
  var package_default = {
21718
21711
  name: "tsarr",
21719
- version: "2.7.0",
21712
+ version: "2.7.1",
21720
21713
  author: "Robbe Verhelst",
21721
21714
  repository: {
21722
21715
  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.1",
4
4
  "author": "Robbe Verhelst",
5
5
  "repository": {
6
6
  "type": "git",
Binary file