doc-detective-common 3.1.0-dev.1 → 3.1.0-dev.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.
@@ -97,9 +97,9 @@
97
97
  "description": "Whether or not to detect steps in input files based on defined markup.",
98
98
  "default": true
99
99
  },
100
- "allowUnsafeTests": {
100
+ "allowUnsafeSteps": {
101
101
  "type": "boolean",
102
- "description": "Whether or not to run potentially unsafe tests, such as those that execute shell commands or run code."
102
+ "description": "Whether or not to run potentially unsafe steps, such as those that might modify files or system state."
103
103
  },
104
104
  "logLevel": {
105
105
  "description": "Amount of detail to output when performing an operation.",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "unsafe": {
51
51
  "type": "boolean",
52
- "description": "Whether or not the test or step is may be unsafe. Unsafe tests and steps may perform actions that could modify the system or environment in unexpected ways. Tests that contain unsafe steps are only performed within Docker containers or if unsafe tests are enabled with the `allowUnsafeTests` config property or the `--unsafe` flag.",
52
+ "description": "Whether or not the step may be unsafe. Unsafe steps may perform actions that could modify the system or environment in unexpected ways. Unsafe steps are only performed within Docker containers or if unsafe steps are enabled with the `allowUnsafeSteps` config property or the `--allow-unsafe` flag.",
53
53
  "default": false
54
54
  },
55
55
  "outputs": {
@@ -16,11 +16,6 @@
16
16
  "type": "string",
17
17
  "description": "Path to the content that the test is associated with."
18
18
  },
19
- "unsafe": {
20
- "type": "boolean",
21
- "description": "Whether or not the test or step is may be unsafe. Unsafe tests and steps may perform actions that could modify the system or environment in unexpected ways. Tests that contain unsafe steps are only performed within Docker containers or if unsafe tests are enabled with the `allowUnsafeTests` config property or the `--unsafe` flag.",
22
- "default": false
23
- },
24
19
  "detectSteps": {
25
20
  "type": "boolean",
26
21
  "description": "Whether or not to detect steps in input files based on markup regex.",
@@ -74,11 +69,6 @@
74
69
  "openApi": {
75
70
  "$ref": "#/components/schemas/openApi"
76
71
  },
77
- "unsafe": {
78
- "type": "boolean",
79
- "description": "Whether or not the test or step is may be unsafe. Unsafe tests and steps may perform actions that could modify the system or environment in unexpected ways. Tests that contain unsafe steps are only performed within Docker containers or if unsafe tests are enabled with the `allowUnsafeTests` config property or the `--unsafe` flag.",
80
- "default": false
81
- },
82
72
  "steps": {
83
73
  "description": "Steps to perform as part of the test. Performed in the sequence defined. If one or more actions fail, the test fails. By default, if a step fails, the test stops and the remaining steps are not executed.",
84
74
  "type": "array",
@@ -157,7 +147,6 @@
157
147
  "description": "This test includes every property across all actions.",
158
148
  "before": "setup.json",
159
149
  "after": "cleanup.json",
160
- "unsafe": true,
161
150
  "runOn": [
162
151
  {
163
152
  "platforms": ["linux"],
package/src/validate.js CHANGED
@@ -353,14 +353,7 @@ function transformToSchemaKey({
353
353
  object: transformedObject,
354
354
  });
355
355
  if (!result.valid) {
356
- throw new Error(`Invalid object: ${result.errors
357
- .map(
358
- (error) =>
359
- `${error.instancePath} ${error.message} (${JSON.stringify(
360
- error.params
361
- )})`
362
- )
363
- .join(", ")}`);
356
+ throw new Error(`Invalid object: ${result.errors}`);
364
357
  }
365
358
  return result.object;
366
359
  } else if (targetSchema === "config_v3") {
@@ -453,14 +446,7 @@ function transformToSchemaKey({
453
446
  object: transformedObject,
454
447
  });
455
448
  if (!result.valid) {
456
- throw new Error(`Invalid object: ${result.errors
457
- .map(
458
- (error) =>
459
- `${error.instancePath} ${error.message} (${JSON.stringify(
460
- error.params
461
- )})`
462
- )
463
- .join(", ")}`);
449
+ throw new Error(`Invalid object: ${result.errors}`);
464
450
  }
465
451
  return result.object;
466
452
  } else if (targetSchema === "context_v3") {
@@ -488,14 +474,7 @@ function transformToSchemaKey({
488
474
  object: transformedObject,
489
475
  });
490
476
  if (!result.valid) {
491
- throw new Error(`Invalid object: ${result.errors
492
- .map(
493
- (error) =>
494
- `${error.instancePath} ${error.message} (${JSON.stringify(
495
- error.params
496
- )})`
497
- )
498
- .join(", ")}`);
477
+ throw new Error(`Invalid object: ${result.errors}`);
499
478
  }
500
479
  return result.object;
501
480
  } else if (targetSchema === "openApi_v3") {
@@ -511,14 +490,7 @@ function transformToSchemaKey({
511
490
  object: transformedObject,
512
491
  });
513
492
  if (!result.valid) {
514
- throw new Error(`Invalid object: ${result.errors
515
- .map(
516
- (error) =>
517
- `${error.instancePath} ${error.message} (${JSON.stringify(
518
- error.params
519
- )})`
520
- )
521
- .join(", ")}`);
493
+ throw new Error(`Invalid object: ${result.errors}`);
522
494
  }
523
495
  return transformedObject;
524
496
  } else if (targetSchema === "spec_v3") {
@@ -557,14 +529,7 @@ function transformToSchemaKey({
557
529
  object: transformedObject,
558
530
  });
559
531
  if (!result.valid) {
560
- throw new Error(`Invalid object: ${result.errors
561
- .map(
562
- (error) =>
563
- `${error.instancePath} ${error.message} (${JSON.stringify(
564
- error.params
565
- )})`
566
- )
567
- .join(", ")}`);
532
+ throw new Error(`Invalid object: ${result.errors}`);
568
533
  }
569
534
  return result.object;
570
535
  } else if (targetSchema === "test_v3") {
@@ -606,14 +571,7 @@ function transformToSchemaKey({
606
571
  object: transformedObject,
607
572
  });
608
573
  if (!result.valid) {
609
- throw new Error(`Invalid object: ${result.errors
610
- .map(
611
- (error) =>
612
- `${error.instancePath} ${error.message} (${JSON.stringify(
613
- error.params
614
- )})`
615
- )
616
- .join(", ")}`);
574
+ throw new Error(`Invalid object: ${result.errors}`);
617
575
  }
618
576
  return result.object;
619
577
  }