@cdot65/prisma-airs-cli 5.0.0 → 5.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.
Files changed (2) hide show
  1. package/dist/cli/index.js +20 -4
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -8944,6 +8944,7 @@ function registerCleanupCommand(parent) {
8944
8944
  import { lstat } from "fs/promises";
8945
8945
  import { resolve as resolve2 } from "path";
8946
8946
  import { dump as dump5 } from "js-yaml";
8947
+ var TIME_UNITS = ["hour", "hours", "day", "days"];
8947
8948
  function integer2(value, name, minimum = 0) {
8948
8949
  const n = Number(value);
8949
8950
  if (!/^\d+$/.test(String(value)) || !Number.isSafeInteger(n) || n < minimum)
@@ -8974,8 +8975,19 @@ function scan(opts) {
8974
8975
  scanSubReqId: integer2(opts.scanSubReqId, "--scan-sub-req-id")
8975
8976
  };
8976
8977
  }
8977
- function timeOptions(command, interval = "1", unit = "day") {
8978
- return command.option("--interval <n>", "Look-back interval", interval).option("--unit <unit>", "API time unit (windows are deployment-dependent)", unit);
8978
+ function timeOptions(command, interval = "1", unit = "day", allowedUnits = TIME_UNITS) {
8979
+ return command.option("--interval <n>", "Look-back interval", interval).option(
8980
+ "--unit <unit>",
8981
+ `Time unit: ${allowedUnits.join(", ")}`,
8982
+ (value) => {
8983
+ if (!allowedUnits.includes(value))
8984
+ usageError(
8985
+ `Unsupported --unit. Supported units: ${allowedUnits.join(", ")}. For one week, use --interval 7 --unit days.`
8986
+ );
8987
+ return value;
8988
+ },
8989
+ unit
8990
+ );
8979
8991
  }
8980
8992
  function pageOptions(command) {
8981
8993
  return command.option("--limit <n>", "Items per page", "25").option("--offset <n>", "Item offset", "0");
@@ -9039,7 +9051,10 @@ function registerRuntimeDashboardCommands(runtime) {
9039
9051
  register6(
9040
9052
  pageOptions(
9041
9053
  timeOptions(
9042
- dashboard.command("applications").description("One page of application activity")
9054
+ dashboard.command("applications").description("One page of application activity"),
9055
+ "1",
9056
+ "day",
9057
+ ["day", "days", "hour"]
9043
9058
  )
9044
9059
  ),
9045
9060
  (opts) => {
@@ -9066,7 +9081,8 @@ function registerRuntimeDashboardCommands(runtime) {
9066
9081
  timeOptions(
9067
9082
  dashboard.command(name).requiredOption("--app-id <id>", "Application identity").requiredOption("--app-name <name>", "Exact dashboard application name"),
9068
9083
  "30",
9069
- "days"
9084
+ "days",
9085
+ ["days"]
9070
9086
  ),
9071
9087
  (opts) => {
9072
9088
  const interval = integer2(opts.interval, "--interval", 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cdot65/prisma-airs-cli",
3
3
  "packageManager": "pnpm@10.6.5",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "description": "CLI and library for Palo Alto Prisma AIRS — guardrail refinement, AI red teaming, model security scanning, profile audits",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",