@epilot/cli 0.1.149 → 0.1.150

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.
package/README.md CHANGED
@@ -29,7 +29,7 @@ npm install -g @epilot/cli
29
29
 
30
30
  <!-- usage-help -->
31
31
  ```
32
- epilot v0.1.149 — CLI for epilot APIs
32
+ epilot v0.1.150 — CLI for epilot APIs
33
33
 
34
34
  USAGE
35
35
  epilot <api> <operationId> [params...] [flags]
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "Validation Rules API",
5
5
  "version": "1.0.0",
6
- "description": "The Validation Rules API manages reusable input validation rules for epilot journeys and entity attributes.\n\nValidation rules define constraints for user input (e.g. regex patterns, numeric ranges, character counts) that can be applied to journey blocks or entity schema attributes.\n\nKey capabilities:\n- Define validation rules using regex patterns, character patterns, or numeric constraints\n- Apply rules to journey blocks or entity schema attributes via the `used_by` association\n- Manage the lifecycle of rules (create, read, update, delete)\n- Compose complex validation logic using AND/OR/NOT condition combinators\n\n## Rule schema versions\n\nThe `rule` property holds one of two shapes, identified by the document's `_schema_version`:\n- `v1`: a json-rules-engine condition tree (regex/pattern/numeric) with static comparison values only.\n- `v2`: a declarative rule with predefined comparison operators whose comparison values may be static,\n dynamic (a path into runtime context declared via `contexts`,\n e.g. `contract.installment_amount`) or relative dates. v2 shapes carry an `input_type` property.\nConverting a rule between schema versions is not supported.\n"
6
+ "description": "The Validation Rules API manages reusable input validation rules for epilot journeys and entity attributes.\n\nValidation rules define constraints for user input (e.g. regex patterns, numeric ranges, character counts) that can be applied to journey blocks or entity schema attributes.\n\nKey capabilities:\n- Define validation rules using regex patterns, character patterns, or numeric constraints\n- Apply rules to journey blocks or entity schema attributes via the `used_by` association\n- Manage the lifecycle of rules (create, read, update, delete)\n- Compose complex validation logic using AND/OR/NOT condition combinators\n\n## Rule schema versions\n\nThe `rule` property holds one of two shapes, identified by the document's `_schema_version`:\n- `v1`: a json-rules-engine condition tree (regex/pattern/numeric) with static comparison values only.\n- `v2`: a declarative rule with predefined comparison operators whose comparison values may be static,\n dynamic (a path into runtime context declared via `contexts`,\n e.g. `contract.installment_amount`) or relative dates. v2 shapes carry an `input_type` property.\n Two v2 shapes exist: `ComparisonRuleType` for number, date and text inputs, and `DocumentRuleType`\n for uploaded files, whose conditions check file properties and, at the higher check levels,\n the document's content.\nConverting a rule between schema versions is not supported.\n"
7
7
  },
8
8
  "tags": [
9
9
  {
@@ -208,7 +208,7 @@
208
208
  }
209
209
  },
210
210
  "400": {
211
- "description": "Bad Request - Invalid request body. Invalid external comparison values additionally carry a\n`code` (`external_value_not_found` when the app is not installed or the hook / result does not\nexist, `external_value_incompatible` when the result type does not match the compared kind).\n",
211
+ "description": "Bad Request - Invalid request body. Invalid external or environment comparison values additionally\ncarry a `code`: `external_value_not_found` when the app is not installed or the hook / result does not\nexist, `external_value_incompatible` when the result type does not match the compared kind,\n`environment_variable_not_found` when the referenced environment variable does not exist in the\norganisation, `environment_variable_incompatible` when its type cannot be compared as required\n(`Number` for numbers, `Text` for text and dates, `Number` / `Text` / `Boolean` for `applies_when`;\n`String`, `SecretString`, `Map` and `JSON` never).\n",
212
212
  "content": {
213
213
  "application/json": {
214
214
  "schema": {
@@ -222,7 +222,9 @@
222
222
  "type": "string",
223
223
  "enum": [
224
224
  "external_value_not_found",
225
- "external_value_incompatible"
225
+ "external_value_incompatible",
226
+ "environment_variable_not_found",
227
+ "environment_variable_incompatible"
226
228
  ]
227
229
  }
228
230
  }
@@ -491,7 +493,7 @@
491
493
  }
492
494
  },
493
495
  "400": {
494
- "description": "Bad Request - Invalid request body. Invalid external comparison values additionally carry a\n`code` (`external_value_not_found` when the app is not installed or the hook / result does not\nexist, `external_value_incompatible` when the result type does not match the compared kind).\n",
496
+ "description": "Bad Request - Invalid request body. Invalid external or environment comparison values additionally\ncarry a `code`: `external_value_not_found` when the app is not installed or the hook / result does not\nexist, `external_value_incompatible` when the result type does not match the compared kind,\n`environment_variable_not_found` when the referenced environment variable does not exist in the\norganisation, `environment_variable_incompatible` when its type cannot be compared as required\n(`Number` for numbers, `Text` for text and dates, `Number` / `Text` / `Boolean` for `applies_when`;\n`String`, `SecretString`, `Map` and `JSON` never).\n",
495
497
  "content": {
496
498
  "application/json": {
497
499
  "schema": {
@@ -505,7 +507,9 @@
505
507
  "type": "string",
506
508
  "enum": [
507
509
  "external_value_not_found",
508
- "external_value_incompatible"
510
+ "external_value_incompatible",
511
+ "environment_variable_not_found",
512
+ "environment_variable_incompatible"
509
513
  ]
510
514
  }
511
515
  }
@@ -1073,6 +1077,9 @@
1073
1077
  },
1074
1078
  {
1075
1079
  "$ref": "#/components/schemas/ComparisonRuleType"
1080
+ },
1081
+ {
1082
+ "$ref": "#/components/schemas/DocumentRuleType"
1076
1083
  }
1077
1084
  ]
1078
1085
  },
@@ -2306,7 +2313,7 @@
2306
2313
  "up",
2307
2314
  "down"
2308
2315
  ],
2309
- "description": "Rounds the adjusted result to a whole number - `up` (ceiling) or `down` (floor).\nOmitted means no rounding. Used for bounds like \"round up(current × 0.9) to whole euros\".\n"
2316
+ "description": "Rounds the adjusted result to a whole number - `up` (ceiling) or `down` (floor).\nOmitted means no rounding. Used for bounds like \"round up(current \u00d7 0.9) to whole euros\".\n"
2310
2317
  }
2311
2318
  }
2312
2319
  },
@@ -2389,6 +2396,177 @@
2389
2396
  }
2390
2397
  }
2391
2398
  },
2399
+ "DocumentRuleType": {
2400
+ "type": "object",
2401
+ "description": "Declarative validation rule (schema version v2) for uploaded files. The rule declares how deep\nthe check goes (`check.level`) and the conditions the file must satisfy. Property conditions\n(file type, size, page count, image resolution, blank and password-protected detection) are\ndeterministic and available at every level; the `meetsCriteria` condition judges a free-text\nrequirement against the document's extracted content and is available from level `standard`.\n\nEvaluation semantics for content conditions differ from scalar rules: each condition resolves to\npass, fail or uncertain. A confident fail on a blocking condition fails the input; an uncertain\nresult is always reported as advisory and never fails the input, regardless of `allow_failure`.\nDocument rules carry no `contexts` yet.\n",
2402
+ "required": [
2403
+ "input_type",
2404
+ "check",
2405
+ "conditions"
2406
+ ],
2407
+ "additionalProperties": false,
2408
+ "properties": {
2409
+ "input_type": {
2410
+ "type": "string",
2411
+ "enum": [
2412
+ "document"
2413
+ ],
2414
+ "description": "Identifies the rule as a document rule. Determines which operators are allowed."
2415
+ },
2416
+ "check": {
2417
+ "$ref": "#/components/schemas/DocumentCheck"
2418
+ },
2419
+ "conditions": {
2420
+ "type": "array",
2421
+ "description": "The checks the uploaded file must satisfy. All blocking conditions must pass for the\nfile to be valid; `allow_failure` conditions are advisory. Must contain at least one\ncondition (enforced at write time).\n",
2422
+ "items": {
2423
+ "$ref": "#/components/schemas/DocumentCondition"
2424
+ }
2425
+ }
2426
+ }
2427
+ },
2428
+ "DocumentCheck": {
2429
+ "type": "object",
2430
+ "description": "How deep the document check goes. Levels are cumulative.",
2431
+ "required": [
2432
+ "level"
2433
+ ],
2434
+ "additionalProperties": false,
2435
+ "properties": {
2436
+ "level": {
2437
+ "type": "string",
2438
+ "enum": [
2439
+ "basic",
2440
+ "standard",
2441
+ "advanced"
2442
+ ],
2443
+ "description": "- `basic`: file properties only (type, size, page count, resolution, blank, password). Instant, no extraction.\n- `standard`: basic checks plus a quick scan of the content. A few seconds.\n- `advanced`: basic checks plus a thorough reading of the fully extracted content. Roughly 5 to 10 seconds.\n"
2444
+ }
2445
+ }
2446
+ },
2447
+ "DocumentCondition": {
2448
+ "type": "object",
2449
+ "description": "A single check the uploaded file must satisfy.",
2450
+ "required": [
2451
+ "id",
2452
+ "operator",
2453
+ "value",
2454
+ "error_message"
2455
+ ],
2456
+ "additionalProperties": false,
2457
+ "properties": {
2458
+ "id": {
2459
+ "type": "string",
2460
+ "minLength": 1,
2461
+ "maxLength": 50,
2462
+ "description": "Stable identifier of the condition within the rule, used for editing and error reporting."
2463
+ },
2464
+ "operator": {
2465
+ "$ref": "#/components/schemas/DocumentOperator"
2466
+ },
2467
+ "value": {
2468
+ "$ref": "#/components/schemas/DocumentConditionValue"
2469
+ },
2470
+ "error_message": {
2471
+ "type": "string",
2472
+ "minLength": 1,
2473
+ "maxLength": 200,
2474
+ "description": "Message shown to the end user when this condition fails."
2475
+ },
2476
+ "allow_failure": {
2477
+ "type": "boolean",
2478
+ "default": false,
2479
+ "description": "When true, the condition is advisory: a failure is reported but never takes part in the\nvalidity verdict. Recommended for `meetsCriteria` until the organisation has reviewed\nresults on real files.\n"
2480
+ }
2481
+ }
2482
+ },
2483
+ "DocumentOperator": {
2484
+ "type": "string",
2485
+ "description": "Predefined document check. Value compatibility (enforced at write time):\n- fileTypeIn: `file_types` value listing the accepted file categories.\n- sizeBelow: static integer, maximum file size in bytes.\n- pageCountBetween: `range` of static non-negative integers (inclusive).\n- resolutionAtLeast / resolutionAtMost: static positive integer, the image's longer edge in pixels.\n- isNotBlank / isNotPasswordProtected: `none` value (unary).\n- meetsCriteria: `criteria` value with the free-text requirement. Requires check level `standard` or `advanced`.\n",
2486
+ "enum": [
2487
+ "fileTypeIn",
2488
+ "sizeBelow",
2489
+ "pageCountBetween",
2490
+ "resolutionAtLeast",
2491
+ "resolutionAtMost",
2492
+ "isNotBlank",
2493
+ "isNotPasswordProtected",
2494
+ "meetsCriteria"
2495
+ ]
2496
+ },
2497
+ "DocumentConditionValue": {
2498
+ "description": "The value of a document condition - a static scalar, a range, nothing, accepted file categories, or a free-text criterion.",
2499
+ "oneOf": [
2500
+ {
2501
+ "$ref": "#/components/schemas/StaticValue"
2502
+ },
2503
+ {
2504
+ "$ref": "#/components/schemas/RangeValue"
2505
+ },
2506
+ {
2507
+ "$ref": "#/components/schemas/NoValue"
2508
+ },
2509
+ {
2510
+ "$ref": "#/components/schemas/FileTypesValue"
2511
+ },
2512
+ {
2513
+ "$ref": "#/components/schemas/CriteriaValue"
2514
+ }
2515
+ ]
2516
+ },
2517
+ "FileTypesValue": {
2518
+ "type": "object",
2519
+ "description": "Accepted file categories; each category expands to a mime list at check time.",
2520
+ "required": [
2521
+ "source",
2522
+ "types"
2523
+ ],
2524
+ "additionalProperties": false,
2525
+ "properties": {
2526
+ "source": {
2527
+ "type": "string",
2528
+ "enum": [
2529
+ "file_types"
2530
+ ]
2531
+ },
2532
+ "types": {
2533
+ "type": "array",
2534
+ "minItems": 1,
2535
+ "uniqueItems": true,
2536
+ "items": {
2537
+ "type": "string",
2538
+ "enum": [
2539
+ "image",
2540
+ "pdf",
2541
+ "document",
2542
+ "spreadsheet"
2543
+ ]
2544
+ }
2545
+ }
2546
+ }
2547
+ },
2548
+ "CriteriaValue": {
2549
+ "type": "object",
2550
+ "description": "A free-text requirement judged against the document's extracted content, e.g. \"The photo shows\nan electricity meter with the meter number and the current reading fully legible.\" One requirement\nper condition keeps results specific and lets each requirement be graded separately.\n",
2551
+ "required": [
2552
+ "source",
2553
+ "text"
2554
+ ],
2555
+ "additionalProperties": false,
2556
+ "properties": {
2557
+ "source": {
2558
+ "type": "string",
2559
+ "enum": [
2560
+ "criteria"
2561
+ ]
2562
+ },
2563
+ "text": {
2564
+ "type": "string",
2565
+ "minLength": 1,
2566
+ "maxLength": 500
2567
+ }
2568
+ }
2569
+ },
2392
2570
  "AppliesWhen": {
2393
2571
  "type": "object",
2394
2572
  "description": "Optional precondition on a condition: the condition only takes part in the\nvalidation when this comparison over context holds. Examples: apply the\ndual-tariff reference only when `contract.htnt` is not empty, or run a\nplausibility check only when a context value reaches a threshold.\n",
@@ -11,7 +11,7 @@ import { defineCommand } from "citty";
11
11
  var main = defineCommand({
12
12
  meta: {
13
13
  name: "epilot",
14
- version: "0.1.149",
14
+ version: "0.1.150",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -31,7 +31,7 @@ var main = defineCommand({
31
31
  profile: () => import("../profile-OZJL5ZPT.js").then((m) => m.default),
32
32
  config: () => import("../config-DGZIMLZK.js").then((m) => m.default),
33
33
  completion: () => import("../completion-O46M2V67.js").then((m) => m.default),
34
- upgrade: () => import("../upgrade-YUGQOSQG.js").then((m) => m.default),
34
+ upgrade: () => import("../upgrade-PHISMBD2.js").then((m) => m.default),
35
35
  "access-token": () => import("../access-token-WWE6BDJH.js").then((m) => m.default),
36
36
  address: () => import("../address-EH3C4CVB.js").then((m) => m.default),
37
37
  "address-suggestions": () => import("../address-suggestions-RRSLOBFW.js").then((m) => m.default),
@@ -134,7 +134,7 @@ process.stderr.on("error", (err) => {
134
134
  if (err.code === "EPIPE") process.exit(0);
135
135
  throw err;
136
136
  });
137
- var VERSION = true ? "0.1.149" : (await null).default.version;
137
+ var VERSION = true ? "0.1.150" : (await null).default.version;
138
138
  var reorderedArgv = hoistFlagsAfterSubcommand(process.argv.slice(2));
139
139
  process.argv = [process.argv[0], process.argv[1], ...reorderedArgv];
140
140
  var args = process.argv.slice(2);
@@ -72,7 +72,7 @@ ${GREEN}${BOLD}Upgraded to @epilot/cli@${latest}${RESET}
72
72
  }
73
73
  });
74
74
  var getCurrentVersion = () => {
75
- if (true) return "0.1.149";
75
+ if (true) return "0.1.150";
76
76
  try {
77
77
  const output = execSync("npm ls -g @epilot/cli --depth=0 --json 2>/dev/null", {
78
78
  encoding: "utf-8",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/cli",
3
- "version": "0.1.149",
3
+ "version": "0.1.150",
4
4
  "description": "CLI for epilot APIs",
5
5
  "type": "module",
6
6
  "bin": {