@superdoc-dev/cli 0.3.0-next.26 → 0.3.0-next.27
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/dist/index.js +12 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -315768,6 +315768,15 @@ function acceptsLegacyTextAddressTarget(operationId, param, value2) {
|
|
|
315768
315768
|
const docApiId = toDocApiId(operationId);
|
|
315769
315769
|
return docApiId === "replace" || docApiId === "delete" || docApiId?.startsWith("format.") === true;
|
|
315770
315770
|
}
|
|
315771
|
+
function extractConstValues(variants) {
|
|
315772
|
+
const values2 = [];
|
|
315773
|
+
for (const variant of variants) {
|
|
315774
|
+
if (!("const" in variant))
|
|
315775
|
+
return [];
|
|
315776
|
+
values2.push(String(variant.const));
|
|
315777
|
+
}
|
|
315778
|
+
return values2;
|
|
315779
|
+
}
|
|
315771
315780
|
function validateValueAgainstTypeSpec(value2, schema, path2) {
|
|
315772
315781
|
if ("const" in schema) {
|
|
315773
315782
|
if (value2 !== schema.const) {
|
|
@@ -315786,7 +315795,9 @@ function validateValueAgainstTypeSpec(value2, schema, path2) {
|
|
|
315786
315795
|
errors2.push(error2 instanceof Error ? error2.message : String(error2));
|
|
315787
315796
|
}
|
|
315788
315797
|
}
|
|
315789
|
-
|
|
315798
|
+
const allowedValues = extractConstValues(variants);
|
|
315799
|
+
const message = allowedValues.length > 0 ? `${path2} must be one of: ${allowedValues.join(", ")}.` : `${path2} must match one of the allowed schema variants.`;
|
|
315800
|
+
throw new CliError("VALIDATION_ERROR", message, { errors: errors2 });
|
|
315790
315801
|
}
|
|
315791
315802
|
if (schema.type === "json")
|
|
315792
315803
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdoc-dev/cli",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"superdoc": "./dist/index.js"
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"optionalDependencies": {
|
|
33
|
-
"@superdoc-dev/cli-darwin-arm64": "0.3.0-next.
|
|
34
|
-
"@superdoc-dev/cli-darwin-x64": "0.3.0-next.
|
|
35
|
-
"@superdoc-dev/cli-
|
|
36
|
-
"@superdoc-dev/cli-linux-arm64": "0.3.0-next.
|
|
37
|
-
"@superdoc-dev/cli-
|
|
33
|
+
"@superdoc-dev/cli-darwin-arm64": "0.3.0-next.27",
|
|
34
|
+
"@superdoc-dev/cli-darwin-x64": "0.3.0-next.27",
|
|
35
|
+
"@superdoc-dev/cli-windows-x64": "0.3.0-next.27",
|
|
36
|
+
"@superdoc-dev/cli-linux-arm64": "0.3.0-next.27",
|
|
37
|
+
"@superdoc-dev/cli-linux-x64": "0.3.0-next.27"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"predev": "node scripts/ensure-superdoc-build.js",
|