@get-dx/cli 0.3.7 → 0.3.8

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.
@@ -300,8 +300,10 @@ export function entitiesCommand() {
300
300
  .command("scorecards")
301
301
  .description("Get the current scorecard report for an entity")
302
302
  .argument("<identifier>", "Entity identifier")
303
+ .option("--check-ids <ids>", "Comma-separated check IDs to filter the report to")
303
304
  .option("--cursor <cursor>", "Cursor for the next page of results")
304
305
  .option("--limit <n>", "Max scorecards per page (default is 50)", (value) => parsePositiveIntOption(value, "--limit"))
306
+ .option("--only-failing", "Return only checks that are not passing (exempted failing checks are still included)")
305
307
  .addHelpText("afterAll", createExampleText([
306
308
  {
307
309
  label: "Get scorecards for the `login-frontend` entity",
@@ -315,12 +317,22 @@ export function entitiesCommand() {
315
317
  label: "Fetch the next page of scorecards",
316
318
  command: "dx catalog entities scorecards login-frontend --cursor xuvkgfq9t0ty",
317
319
  },
320
+ {
321
+ label: "Show only checks that are not passing",
322
+ command: "dx catalog entities scorecards login-frontend --only-failing",
323
+ },
324
+ {
325
+ label: "Filter the report to specific checks",
326
+ command: "dx catalog entities scorecards login-frontend --check-ids NDQ,NTU",
327
+ },
318
328
  ]))
319
329
  .action(wrapAction(async (identifier, options, command) => {
320
330
  const runtime = await buildRuntime(getContext(command));
321
331
  const response = await getEntityScorecards(runtime, identifier, {
332
+ check_ids: parseCommaSeparatedValues(options.checkIds),
322
333
  cursor: options.cursor,
323
334
  limit: options.limit,
335
+ only_failing: options.onlyFailing,
324
336
  });
325
337
  if (runtime.context.json) {
326
338
  renderJson(response);
@@ -383,11 +395,18 @@ async function upsertEntity(runtime, identifier, params) {
383
395
  return response.body;
384
396
  }
385
397
  async function getEntityScorecards(runtime, identifier, params) {
386
- const query = { identifier };
398
+ const query = {
399
+ identifier,
400
+ };
387
401
  if (params.cursor !== undefined)
388
402
  query.cursor = params.cursor;
389
403
  if (params.limit !== undefined)
390
404
  query.limit = params.limit;
405
+ if (params.only_failing)
406
+ query.only_failing = true;
407
+ if (params.check_ids !== undefined && params.check_ids.length > 0) {
408
+ query.check_ids = params.check_ids.join(",");
409
+ }
391
410
  const response = await request(runtime, "/catalog.entities.scorecards", {
392
411
  method: "GET",
393
412
  query,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-dx/cli",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "DX CLI",
5
5
  "author": "DX <developers@getdx.com>",
6
6
  "bugs": {