@base44-preview/cli 0.0.34-pr.323.8ed63ab → 0.0.35-pr.321.30f0799
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/cli/index.js +685 -498
- package/dist/cli/index.js.map +12 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -12578,7 +12578,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12578
12578
|
var which = require_which();
|
|
12579
12579
|
var getPathKey = require_path_key();
|
|
12580
12580
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
12581
|
-
const
|
|
12581
|
+
const env3 = parsed.options.env || process.env;
|
|
12582
12582
|
const cwd = process.cwd();
|
|
12583
12583
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
12584
12584
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
@@ -12590,7 +12590,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12590
12590
|
let resolved;
|
|
12591
12591
|
try {
|
|
12592
12592
|
resolved = which.sync(parsed.command, {
|
|
12593
|
-
path:
|
|
12593
|
+
path: env3[getPathKey({ env: env3 })],
|
|
12594
12594
|
pathExt: withoutPathExt ? path11.delimiter : undefined
|
|
12595
12595
|
});
|
|
12596
12596
|
} catch (e2) {} finally {
|
|
@@ -108409,11 +108409,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
108409
108409
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
108410
108410
|
}
|
|
108411
108411
|
function createSchema(SchemaConstructor, parameters) {
|
|
108412
|
-
const
|
|
108413
|
-
const subSchema = Object.create(
|
|
108412
|
+
const schema9 = new SchemaConstructor(parameters);
|
|
108413
|
+
const subSchema = Object.create(schema9);
|
|
108414
108414
|
for (const handlerKey of HANDLER_KEYS) {
|
|
108415
108415
|
if (handlerKey in parameters) {
|
|
108416
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
108416
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema9, Schema.prototype[handlerKey].length);
|
|
108417
108417
|
}
|
|
108418
108418
|
}
|
|
108419
108419
|
return subSchema;
|
|
@@ -109727,7 +109727,7 @@ function parse42(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
|
|
|
109727
109727
|
}
|
|
109728
109728
|
return res;
|
|
109729
109729
|
}
|
|
109730
|
-
async function
|
|
109730
|
+
async function readFile3(file2) {
|
|
109731
109731
|
if (isUrlString(file2)) {
|
|
109732
109732
|
file2 = new URL(file2);
|
|
109733
109733
|
}
|
|
@@ -111753,9 +111753,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
111753
111753
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
111754
111754
|
}
|
|
111755
111755
|
if (optionInfo.exception) {
|
|
111756
|
-
parameters.validate = (value,
|
|
111756
|
+
parameters.validate = (value, schema9, utils3) => optionInfo.exception(value) || schema9.validate(value, utils3);
|
|
111757
111757
|
} else {
|
|
111758
|
-
parameters.validate = (value,
|
|
111758
|
+
parameters.validate = (value, schema9, utils3) => value === undefined || schema9.validate(value, utils3);
|
|
111759
111759
|
}
|
|
111760
111760
|
if (optionInfo.redirect) {
|
|
111761
111761
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -111770,7 +111770,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
111770
111770
|
}
|
|
111771
111771
|
if (isCLI && !optionInfo.array) {
|
|
111772
111772
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
111773
|
-
parameters.preprocess = (value,
|
|
111773
|
+
parameters.preprocess = (value, schema9, utils3) => schema9.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
111774
111774
|
}
|
|
111775
111775
|
return optionInfo.array ? ArraySchema.create({
|
|
111776
111776
|
...isCLI ? {
|
|
@@ -113347,9 +113347,9 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113347
113347
|
};
|
|
113348
113348
|
applyNormalization();
|
|
113349
113349
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
113350
|
-
const
|
|
113350
|
+
const schema9 = this._utils.schemas[key2];
|
|
113351
113351
|
if (!(key2 in newOptions)) {
|
|
113352
|
-
const defaultResult = normalizeDefaultResult(
|
|
113352
|
+
const defaultResult = normalizeDefaultResult(schema9.default(this._utils));
|
|
113353
113353
|
if ("value" in defaultResult) {
|
|
113354
113354
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
113355
113355
|
}
|
|
@@ -113360,13 +113360,13 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113360
113360
|
if (!(key2 in newOptions)) {
|
|
113361
113361
|
continue;
|
|
113362
113362
|
}
|
|
113363
|
-
const
|
|
113363
|
+
const schema9 = this._utils.schemas[key2];
|
|
113364
113364
|
const value = newOptions[key2];
|
|
113365
|
-
const newValue =
|
|
113365
|
+
const newValue = schema9.postprocess(value, this._utils);
|
|
113366
113366
|
if (newValue === VALUE_UNCHANGED) {
|
|
113367
113367
|
continue;
|
|
113368
113368
|
}
|
|
113369
|
-
this._applyValidation(newValue, key2,
|
|
113369
|
+
this._applyValidation(newValue, key2, schema9);
|
|
113370
113370
|
newOptions[key2] = newValue;
|
|
113371
113371
|
}
|
|
113372
113372
|
this._applyPostprocess(newOptions);
|
|
@@ -113377,14 +113377,14 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113377
113377
|
const transferredOptionsArray = [];
|
|
113378
113378
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
113379
113379
|
for (const key2 of knownKeys) {
|
|
113380
|
-
const
|
|
113381
|
-
const value =
|
|
113382
|
-
this._applyValidation(value, key2,
|
|
113380
|
+
const schema9 = this._utils.schemas[key2];
|
|
113381
|
+
const value = schema9.preprocess(options8[key2], this._utils);
|
|
113382
|
+
this._applyValidation(value, key2, schema9);
|
|
113383
113383
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
113384
113384
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
113385
113385
|
};
|
|
113386
113386
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
113387
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
113387
|
+
const deprecatedResult = normalizeDeprecatedResult(schema9.deprecated(currentValue, this._utils), value, true);
|
|
113388
113388
|
if (deprecatedResult === false) {
|
|
113389
113389
|
return;
|
|
113390
113390
|
}
|
|
@@ -113402,13 +113402,13 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113402
113402
|
}
|
|
113403
113403
|
}
|
|
113404
113404
|
};
|
|
113405
|
-
const forwardResult = normalizeForwardResult(
|
|
113405
|
+
const forwardResult = normalizeForwardResult(schema9.forward(value, this._utils), value);
|
|
113406
113406
|
forwardResult.forEach(appendTransferredOptions);
|
|
113407
|
-
const redirectResult = normalizeRedirectResult(
|
|
113407
|
+
const redirectResult = normalizeRedirectResult(schema9.redirect(value, this._utils), value);
|
|
113408
113408
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
113409
113409
|
if ("remain" in redirectResult) {
|
|
113410
113410
|
const remainingValue = redirectResult.remain;
|
|
113411
|
-
newOptions[key2] = key2 in newOptions ?
|
|
113411
|
+
newOptions[key2] = key2 in newOptions ? schema9.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
113412
113412
|
warnDeprecated({ value: remainingValue });
|
|
113413
113413
|
}
|
|
113414
113414
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -113436,8 +113436,8 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113436
113436
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
113437
113437
|
return { knownKeys, unknownKeys };
|
|
113438
113438
|
}
|
|
113439
|
-
_applyValidation(value, key2,
|
|
113440
|
-
const validateResult = normalizeValidateResult(
|
|
113439
|
+
_applyValidation(value, key2, schema9) {
|
|
113440
|
+
const validateResult = normalizeValidateResult(schema9.validate(value, this._utils), value);
|
|
113441
113441
|
if (validateResult !== true) {
|
|
113442
113442
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
113443
113443
|
}
|
|
@@ -113479,8 +113479,8 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113479
113479
|
for (const key2 of unknownKeys) {
|
|
113480
113480
|
const value = postprocessed.override[key2];
|
|
113481
113481
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
113482
|
-
const
|
|
113483
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
113482
|
+
const schema9 = this._utils.schemas[knownResultKey];
|
|
113483
|
+
this._applyValidation(knownResultValue, knownResultKey, schema9);
|
|
113484
113484
|
options8[knownResultKey] = knownResultValue;
|
|
113485
113485
|
});
|
|
113486
113486
|
}
|
|
@@ -118988,8 +118988,8 @@ var init_prettier = __esm(() => {
|
|
|
118988
118988
|
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
118989
118989
|
var p4 = process || {};
|
|
118990
118990
|
var argv = p4.argv || [];
|
|
118991
|
-
var
|
|
118992
|
-
var isColorSupported2 = !(!!
|
|
118991
|
+
var env3 = p4.env || {};
|
|
118992
|
+
var isColorSupported2 = !(!!env3.NO_COLOR || argv.includes("--no-color")) && (!!env3.FORCE_COLOR || argv.includes("--color") || p4.platform === "win32" || (p4.stdout || {}).isTTY && env3.TERM !== "dumb" || !!env3.CI);
|
|
118993
118993
|
var formatter = (open2, close, replace3 = open2) => (input) => {
|
|
118994
118994
|
let string4 = "" + input, index = string4.indexOf(close, open2.length);
|
|
118995
118995
|
return ~index ? open2 + replaceClose(string4, close, replace3, index) + close : open2 + string4 + close;
|
|
@@ -123521,7 +123521,7 @@ ${codeblock}`, options8);
|
|
|
123521
123521
|
"\\": "\\"
|
|
123522
123522
|
};
|
|
123523
123523
|
KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
123524
|
-
read_file_default =
|
|
123524
|
+
read_file_default = readFile3;
|
|
123525
123525
|
loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file2) {
|
|
123526
123526
|
const { prettier } = await readBunPackageJson(file2);
|
|
123527
123527
|
return prettier;
|
|
@@ -127193,23 +127193,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
127193
127193
|
exports.Parent = Symbol("Parent");
|
|
127194
127194
|
exports.Types = Symbol("Types");
|
|
127195
127195
|
exports.Intersection = Symbol("Intersection");
|
|
127196
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
127197
|
-
const parent =
|
|
127196
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema9) => {
|
|
127197
|
+
const parent = schema9[exports.Parent];
|
|
127198
127198
|
if (!parent) {
|
|
127199
|
-
return
|
|
127199
|
+
return schema9;
|
|
127200
127200
|
}
|
|
127201
127201
|
return (0, exports.getRootSchema)(parent);
|
|
127202
127202
|
});
|
|
127203
|
-
function isBoolean(
|
|
127204
|
-
return
|
|
127203
|
+
function isBoolean(schema9) {
|
|
127204
|
+
return schema9 === true || schema9 === false;
|
|
127205
127205
|
}
|
|
127206
127206
|
exports.isBoolean = isBoolean;
|
|
127207
|
-
function isPrimitive(
|
|
127208
|
-
return !(0, lodash_1.isPlainObject)(
|
|
127207
|
+
function isPrimitive(schema9) {
|
|
127208
|
+
return !(0, lodash_1.isPlainObject)(schema9);
|
|
127209
127209
|
}
|
|
127210
127210
|
exports.isPrimitive = isPrimitive;
|
|
127211
|
-
function isCompound(
|
|
127212
|
-
return Array.isArray(
|
|
127211
|
+
function isCompound(schema9) {
|
|
127212
|
+
return Array.isArray(schema9.type) || "anyOf" in schema9 || "oneOf" in schema9;
|
|
127213
127213
|
}
|
|
127214
127214
|
exports.isCompound = isCompound;
|
|
127215
127215
|
});
|
|
@@ -127436,9 +127436,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
127436
127436
|
var require_schema2 = __commonJS((exports, module) => {
|
|
127437
127437
|
var YAMLException = require_exception2();
|
|
127438
127438
|
var Type = require_type2();
|
|
127439
|
-
function compileList(
|
|
127439
|
+
function compileList(schema9, name2) {
|
|
127440
127440
|
var result = [];
|
|
127441
|
-
|
|
127441
|
+
schema9[name2].forEach(function(currentType) {
|
|
127442
127442
|
var newIndex = result.length;
|
|
127443
127443
|
result.forEach(function(previousType, previousIndex) {
|
|
127444
127444
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -129383,7 +129383,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
129383
129383
|
"OFF"
|
|
129384
129384
|
];
|
|
129385
129385
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
129386
|
-
function compileStyleMap(
|
|
129386
|
+
function compileStyleMap(schema9, map2) {
|
|
129387
129387
|
var result, keys, index, length, tag, style, type;
|
|
129388
129388
|
if (map2 === null)
|
|
129389
129389
|
return {};
|
|
@@ -129395,7 +129395,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
129395
129395
|
if (tag.slice(0, 2) === "!!") {
|
|
129396
129396
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
129397
129397
|
}
|
|
129398
|
-
type =
|
|
129398
|
+
type = schema9.compiledTypeMap["fallback"][tag];
|
|
129399
129399
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
129400
129400
|
style = type.styleAliases[style];
|
|
129401
129401
|
}
|
|
@@ -130054,11 +130054,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130054
130054
|
function traverseArray(arr, callback, processed) {
|
|
130055
130055
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
130056
130056
|
}
|
|
130057
|
-
function traverseIntersection(
|
|
130058
|
-
if (typeof
|
|
130057
|
+
function traverseIntersection(schema9, callback, processed) {
|
|
130058
|
+
if (typeof schema9 !== "object" || !schema9) {
|
|
130059
130059
|
return;
|
|
130060
130060
|
}
|
|
130061
|
-
const r5 =
|
|
130061
|
+
const r5 = schema9;
|
|
130062
130062
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
130063
130063
|
if (!intersection2) {
|
|
130064
130064
|
return;
|
|
@@ -130067,60 +130067,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130067
130067
|
traverseArray(intersection2.allOf, callback, processed);
|
|
130068
130068
|
}
|
|
130069
130069
|
}
|
|
130070
|
-
function traverse(
|
|
130071
|
-
if (processed.has(
|
|
130070
|
+
function traverse(schema9, callback, processed = new Set, key2) {
|
|
130071
|
+
if (processed.has(schema9)) {
|
|
130072
130072
|
return;
|
|
130073
130073
|
}
|
|
130074
|
-
processed.add(
|
|
130075
|
-
callback(
|
|
130076
|
-
if (
|
|
130077
|
-
traverseArray(
|
|
130074
|
+
processed.add(schema9);
|
|
130075
|
+
callback(schema9, key2 !== null && key2 !== undefined ? key2 : null);
|
|
130076
|
+
if (schema9.anyOf) {
|
|
130077
|
+
traverseArray(schema9.anyOf, callback, processed);
|
|
130078
130078
|
}
|
|
130079
|
-
if (
|
|
130080
|
-
traverseArray(
|
|
130079
|
+
if (schema9.allOf) {
|
|
130080
|
+
traverseArray(schema9.allOf, callback, processed);
|
|
130081
130081
|
}
|
|
130082
|
-
if (
|
|
130083
|
-
traverseArray(
|
|
130082
|
+
if (schema9.oneOf) {
|
|
130083
|
+
traverseArray(schema9.oneOf, callback, processed);
|
|
130084
130084
|
}
|
|
130085
|
-
if (
|
|
130086
|
-
traverseObjectKeys(
|
|
130085
|
+
if (schema9.properties) {
|
|
130086
|
+
traverseObjectKeys(schema9.properties, callback, processed);
|
|
130087
130087
|
}
|
|
130088
|
-
if (
|
|
130089
|
-
traverseObjectKeys(
|
|
130088
|
+
if (schema9.patternProperties) {
|
|
130089
|
+
traverseObjectKeys(schema9.patternProperties, callback, processed);
|
|
130090
130090
|
}
|
|
130091
|
-
if (
|
|
130092
|
-
traverse(
|
|
130091
|
+
if (schema9.additionalProperties && typeof schema9.additionalProperties === "object") {
|
|
130092
|
+
traverse(schema9.additionalProperties, callback, processed);
|
|
130093
130093
|
}
|
|
130094
|
-
if (
|
|
130095
|
-
const { items } =
|
|
130094
|
+
if (schema9.items) {
|
|
130095
|
+
const { items } = schema9;
|
|
130096
130096
|
if (Array.isArray(items)) {
|
|
130097
130097
|
traverseArray(items, callback, processed);
|
|
130098
130098
|
} else {
|
|
130099
130099
|
traverse(items, callback, processed);
|
|
130100
130100
|
}
|
|
130101
130101
|
}
|
|
130102
|
-
if (
|
|
130103
|
-
traverse(
|
|
130102
|
+
if (schema9.additionalItems && typeof schema9.additionalItems === "object") {
|
|
130103
|
+
traverse(schema9.additionalItems, callback, processed);
|
|
130104
130104
|
}
|
|
130105
|
-
if (
|
|
130106
|
-
if (Array.isArray(
|
|
130107
|
-
traverseArray(
|
|
130105
|
+
if (schema9.dependencies) {
|
|
130106
|
+
if (Array.isArray(schema9.dependencies)) {
|
|
130107
|
+
traverseArray(schema9.dependencies, callback, processed);
|
|
130108
130108
|
} else {
|
|
130109
|
-
traverseObjectKeys(
|
|
130109
|
+
traverseObjectKeys(schema9.dependencies, callback, processed);
|
|
130110
130110
|
}
|
|
130111
130111
|
}
|
|
130112
|
-
if (
|
|
130113
|
-
traverseObjectKeys(
|
|
130112
|
+
if (schema9.definitions) {
|
|
130113
|
+
traverseObjectKeys(schema9.definitions, callback, processed);
|
|
130114
130114
|
}
|
|
130115
|
-
if (
|
|
130116
|
-
traverseObjectKeys(
|
|
130115
|
+
if (schema9.$defs) {
|
|
130116
|
+
traverseObjectKeys(schema9.$defs, callback, processed);
|
|
130117
130117
|
}
|
|
130118
|
-
if (
|
|
130119
|
-
traverse(
|
|
130118
|
+
if (schema9.not) {
|
|
130119
|
+
traverse(schema9.not, callback, processed);
|
|
130120
130120
|
}
|
|
130121
|
-
traverseIntersection(
|
|
130122
|
-
Object.keys(
|
|
130123
|
-
const child =
|
|
130121
|
+
traverseIntersection(schema9, callback, processed);
|
|
130122
|
+
Object.keys(schema9).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
130123
|
+
const child = schema9[key3];
|
|
130124
130124
|
if (child && typeof child === "object") {
|
|
130125
130125
|
traverseObjectKeys(child, callback, processed);
|
|
130126
130126
|
}
|
|
@@ -130202,14 +130202,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130202
130202
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
130203
130203
|
}
|
|
130204
130204
|
}
|
|
130205
|
-
function escapeBlockComment(
|
|
130205
|
+
function escapeBlockComment(schema9) {
|
|
130206
130206
|
const replacer = "* /";
|
|
130207
|
-
if (
|
|
130207
|
+
if (schema9 === null || typeof schema9 !== "object") {
|
|
130208
130208
|
return;
|
|
130209
130209
|
}
|
|
130210
|
-
for (const key2 of Object.keys(
|
|
130211
|
-
if (key2 === "description" && typeof
|
|
130212
|
-
|
|
130210
|
+
for (const key2 of Object.keys(schema9)) {
|
|
130211
|
+
if (key2 === "description" && typeof schema9[key2] === "string") {
|
|
130212
|
+
schema9[key2] = schema9[key2].replace(/\*\//g, replacer);
|
|
130213
130213
|
}
|
|
130214
130214
|
}
|
|
130215
130215
|
}
|
|
@@ -130221,45 +130221,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130221
130221
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
130222
130222
|
}
|
|
130223
130223
|
exports.pathTransform = pathTransform;
|
|
130224
|
-
function maybeStripDefault(
|
|
130225
|
-
if (!("default" in
|
|
130226
|
-
return
|
|
130224
|
+
function maybeStripDefault(schema9) {
|
|
130225
|
+
if (!("default" in schema9)) {
|
|
130226
|
+
return schema9;
|
|
130227
130227
|
}
|
|
130228
|
-
switch (
|
|
130228
|
+
switch (schema9.type) {
|
|
130229
130229
|
case "array":
|
|
130230
|
-
if (Array.isArray(
|
|
130231
|
-
return
|
|
130230
|
+
if (Array.isArray(schema9.default)) {
|
|
130231
|
+
return schema9;
|
|
130232
130232
|
}
|
|
130233
130233
|
break;
|
|
130234
130234
|
case "boolean":
|
|
130235
|
-
if (typeof
|
|
130236
|
-
return
|
|
130235
|
+
if (typeof schema9.default === "boolean") {
|
|
130236
|
+
return schema9;
|
|
130237
130237
|
}
|
|
130238
130238
|
break;
|
|
130239
130239
|
case "integer":
|
|
130240
130240
|
case "number":
|
|
130241
|
-
if (typeof
|
|
130242
|
-
return
|
|
130241
|
+
if (typeof schema9.default === "number") {
|
|
130242
|
+
return schema9;
|
|
130243
130243
|
}
|
|
130244
130244
|
break;
|
|
130245
130245
|
case "string":
|
|
130246
|
-
if (typeof
|
|
130247
|
-
return
|
|
130246
|
+
if (typeof schema9.default === "string") {
|
|
130247
|
+
return schema9;
|
|
130248
130248
|
}
|
|
130249
130249
|
break;
|
|
130250
130250
|
case "null":
|
|
130251
|
-
if (
|
|
130252
|
-
return
|
|
130251
|
+
if (schema9.default === null) {
|
|
130252
|
+
return schema9;
|
|
130253
130253
|
}
|
|
130254
130254
|
break;
|
|
130255
130255
|
case "object":
|
|
130256
|
-
if ((0, lodash_1.isPlainObject)(
|
|
130257
|
-
return
|
|
130256
|
+
if ((0, lodash_1.isPlainObject)(schema9.default)) {
|
|
130257
|
+
return schema9;
|
|
130258
130258
|
}
|
|
130259
130259
|
break;
|
|
130260
130260
|
}
|
|
130261
|
-
delete
|
|
130262
|
-
return
|
|
130261
|
+
delete schema9.default;
|
|
130262
|
+
return schema9;
|
|
130263
130263
|
}
|
|
130264
130264
|
exports.maybeStripDefault = maybeStripDefault;
|
|
130265
130265
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -130273,11 +130273,11 @@ ${values.join(`
|
|
|
130273
130273
|
`);
|
|
130274
130274
|
}
|
|
130275
130275
|
exports.appendToDescription = appendToDescription;
|
|
130276
|
-
function isSchemaLike(
|
|
130277
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
130276
|
+
function isSchemaLike(schema9) {
|
|
130277
|
+
if (!(0, lodash_1.isPlainObject)(schema9)) {
|
|
130278
130278
|
return false;
|
|
130279
130279
|
}
|
|
130280
|
-
const parent =
|
|
130280
|
+
const parent = schema9[JSONSchema_1.Parent];
|
|
130281
130281
|
if (parent === null) {
|
|
130282
130282
|
return true;
|
|
130283
130283
|
}
|
|
@@ -130294,7 +130294,7 @@ ${values.join(`
|
|
|
130294
130294
|
"properties",
|
|
130295
130295
|
"required"
|
|
130296
130296
|
];
|
|
130297
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
130297
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema9)) {
|
|
130298
130298
|
return false;
|
|
130299
130299
|
}
|
|
130300
130300
|
return true;
|
|
@@ -130592,13 +130592,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130592
130592
|
exports.typesOfSchema = undefined;
|
|
130593
130593
|
var lodash_1 = require_lodash2();
|
|
130594
130594
|
var JSONSchema_1 = require_JSONSchema();
|
|
130595
|
-
function typesOfSchema(
|
|
130596
|
-
if (
|
|
130595
|
+
function typesOfSchema(schema9) {
|
|
130596
|
+
if (schema9.tsType) {
|
|
130597
130597
|
return new Set(["CUSTOM_TYPE"]);
|
|
130598
130598
|
}
|
|
130599
130599
|
const matchedTypes = new Set;
|
|
130600
130600
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
130601
|
-
if (f7(
|
|
130601
|
+
if (f7(schema9)) {
|
|
130602
130602
|
matchedTypes.add(schemaType);
|
|
130603
130603
|
}
|
|
130604
130604
|
}
|
|
@@ -130609,26 +130609,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130609
130609
|
}
|
|
130610
130610
|
exports.typesOfSchema = typesOfSchema;
|
|
130611
130611
|
var matchers = {
|
|
130612
|
-
ALL_OF(
|
|
130613
|
-
return "allOf" in
|
|
130612
|
+
ALL_OF(schema9) {
|
|
130613
|
+
return "allOf" in schema9;
|
|
130614
130614
|
},
|
|
130615
|
-
ANY(
|
|
130616
|
-
if (Object.keys(
|
|
130615
|
+
ANY(schema9) {
|
|
130616
|
+
if (Object.keys(schema9).length === 0) {
|
|
130617
130617
|
return true;
|
|
130618
130618
|
}
|
|
130619
|
-
return
|
|
130619
|
+
return schema9.type === "any";
|
|
130620
130620
|
},
|
|
130621
|
-
ANY_OF(
|
|
130622
|
-
return "anyOf" in
|
|
130621
|
+
ANY_OF(schema9) {
|
|
130622
|
+
return "anyOf" in schema9;
|
|
130623
130623
|
},
|
|
130624
|
-
BOOLEAN(
|
|
130625
|
-
if ("enum" in
|
|
130624
|
+
BOOLEAN(schema9) {
|
|
130625
|
+
if ("enum" in schema9) {
|
|
130626
130626
|
return false;
|
|
130627
130627
|
}
|
|
130628
|
-
if (
|
|
130628
|
+
if (schema9.type === "boolean") {
|
|
130629
130629
|
return true;
|
|
130630
130630
|
}
|
|
130631
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
130631
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "boolean") {
|
|
130632
130632
|
return true;
|
|
130633
130633
|
}
|
|
130634
130634
|
return false;
|
|
@@ -130636,74 +130636,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130636
130636
|
CUSTOM_TYPE() {
|
|
130637
130637
|
return false;
|
|
130638
130638
|
},
|
|
130639
|
-
NAMED_ENUM(
|
|
130640
|
-
return "enum" in
|
|
130639
|
+
NAMED_ENUM(schema9) {
|
|
130640
|
+
return "enum" in schema9 && "tsEnumNames" in schema9;
|
|
130641
130641
|
},
|
|
130642
|
-
NAMED_SCHEMA(
|
|
130643
|
-
return "$id" in
|
|
130642
|
+
NAMED_SCHEMA(schema9) {
|
|
130643
|
+
return "$id" in schema9 && (("patternProperties" in schema9) || ("properties" in schema9));
|
|
130644
130644
|
},
|
|
130645
|
-
NEVER(
|
|
130646
|
-
return
|
|
130645
|
+
NEVER(schema9) {
|
|
130646
|
+
return schema9 === false;
|
|
130647
130647
|
},
|
|
130648
|
-
NULL(
|
|
130649
|
-
return
|
|
130648
|
+
NULL(schema9) {
|
|
130649
|
+
return schema9.type === "null";
|
|
130650
130650
|
},
|
|
130651
|
-
NUMBER(
|
|
130652
|
-
if ("enum" in
|
|
130651
|
+
NUMBER(schema9) {
|
|
130652
|
+
if ("enum" in schema9) {
|
|
130653
130653
|
return false;
|
|
130654
130654
|
}
|
|
130655
|
-
if (
|
|
130655
|
+
if (schema9.type === "integer" || schema9.type === "number") {
|
|
130656
130656
|
return true;
|
|
130657
130657
|
}
|
|
130658
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
130658
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "number") {
|
|
130659
130659
|
return true;
|
|
130660
130660
|
}
|
|
130661
130661
|
return false;
|
|
130662
130662
|
},
|
|
130663
|
-
OBJECT(
|
|
130664
|
-
return
|
|
130663
|
+
OBJECT(schema9) {
|
|
130664
|
+
return schema9.type === "object" && !(0, lodash_1.isPlainObject)(schema9.additionalProperties) && !schema9.allOf && !schema9.anyOf && !schema9.oneOf && !schema9.patternProperties && !schema9.properties && !schema9.required;
|
|
130665
130665
|
},
|
|
130666
|
-
ONE_OF(
|
|
130667
|
-
return "oneOf" in
|
|
130666
|
+
ONE_OF(schema9) {
|
|
130667
|
+
return "oneOf" in schema9;
|
|
130668
130668
|
},
|
|
130669
|
-
REFERENCE(
|
|
130670
|
-
return "$ref" in
|
|
130669
|
+
REFERENCE(schema9) {
|
|
130670
|
+
return "$ref" in schema9;
|
|
130671
130671
|
},
|
|
130672
|
-
STRING(
|
|
130673
|
-
if ("enum" in
|
|
130672
|
+
STRING(schema9) {
|
|
130673
|
+
if ("enum" in schema9) {
|
|
130674
130674
|
return false;
|
|
130675
130675
|
}
|
|
130676
|
-
if (
|
|
130676
|
+
if (schema9.type === "string") {
|
|
130677
130677
|
return true;
|
|
130678
130678
|
}
|
|
130679
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
130679
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "string") {
|
|
130680
130680
|
return true;
|
|
130681
130681
|
}
|
|
130682
130682
|
return false;
|
|
130683
130683
|
},
|
|
130684
|
-
TYPED_ARRAY(
|
|
130685
|
-
if (
|
|
130684
|
+
TYPED_ARRAY(schema9) {
|
|
130685
|
+
if (schema9.type && schema9.type !== "array") {
|
|
130686
130686
|
return false;
|
|
130687
130687
|
}
|
|
130688
|
-
return "items" in
|
|
130688
|
+
return "items" in schema9;
|
|
130689
130689
|
},
|
|
130690
|
-
UNION(
|
|
130691
|
-
return Array.isArray(
|
|
130690
|
+
UNION(schema9) {
|
|
130691
|
+
return Array.isArray(schema9.type);
|
|
130692
130692
|
},
|
|
130693
|
-
UNNAMED_ENUM(
|
|
130694
|
-
if ("tsEnumNames" in
|
|
130693
|
+
UNNAMED_ENUM(schema9) {
|
|
130694
|
+
if ("tsEnumNames" in schema9) {
|
|
130695
130695
|
return false;
|
|
130696
130696
|
}
|
|
130697
|
-
if (
|
|
130697
|
+
if (schema9.type && schema9.type !== "boolean" && schema9.type !== "integer" && schema9.type !== "number" && schema9.type !== "string") {
|
|
130698
130698
|
return false;
|
|
130699
130699
|
}
|
|
130700
|
-
return "enum" in
|
|
130700
|
+
return "enum" in schema9;
|
|
130701
130701
|
},
|
|
130702
130702
|
UNNAMED_SCHEMA() {
|
|
130703
130703
|
return false;
|
|
130704
130704
|
},
|
|
130705
|
-
UNTYPED_ARRAY(
|
|
130706
|
-
return
|
|
130705
|
+
UNTYPED_ARRAY(schema9) {
|
|
130706
|
+
return schema9.type === "array" && !("items" in schema9);
|
|
130707
130707
|
}
|
|
130708
130708
|
};
|
|
130709
130709
|
});
|
|
@@ -130714,10 +130714,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
130714
130714
|
exports.applySchemaTyping = undefined;
|
|
130715
130715
|
var JSONSchema_1 = require_JSONSchema();
|
|
130716
130716
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
130717
|
-
function applySchemaTyping(
|
|
130717
|
+
function applySchemaTyping(schema9) {
|
|
130718
130718
|
var _a7;
|
|
130719
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
130720
|
-
Object.defineProperty(
|
|
130719
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema9);
|
|
130720
|
+
Object.defineProperty(schema9, JSONSchema_1.Types, {
|
|
130721
130721
|
enumerable: false,
|
|
130722
130722
|
value: types,
|
|
130723
130723
|
writable: false
|
|
@@ -130726,23 +130726,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
130726
130726
|
return;
|
|
130727
130727
|
}
|
|
130728
130728
|
const intersection2 = {
|
|
130729
|
-
[JSONSchema_1.Parent]:
|
|
130729
|
+
[JSONSchema_1.Parent]: schema9,
|
|
130730
130730
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
130731
|
-
$id:
|
|
130732
|
-
description:
|
|
130733
|
-
name:
|
|
130734
|
-
title:
|
|
130735
|
-
allOf: (_a7 =
|
|
130731
|
+
$id: schema9.$id,
|
|
130732
|
+
description: schema9.description,
|
|
130733
|
+
name: schema9.name,
|
|
130734
|
+
title: schema9.title,
|
|
130735
|
+
allOf: (_a7 = schema9.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
130736
130736
|
required: [],
|
|
130737
130737
|
additionalProperties: false
|
|
130738
130738
|
};
|
|
130739
130739
|
types.delete("ALL_OF");
|
|
130740
|
-
delete
|
|
130741
|
-
delete
|
|
130742
|
-
delete
|
|
130743
|
-
delete
|
|
130744
|
-
delete
|
|
130745
|
-
Object.defineProperty(
|
|
130740
|
+
delete schema9.allOf;
|
|
130741
|
+
delete schema9.$id;
|
|
130742
|
+
delete schema9.description;
|
|
130743
|
+
delete schema9.name;
|
|
130744
|
+
delete schema9.title;
|
|
130745
|
+
Object.defineProperty(schema9, JSONSchema_1.Intersection, {
|
|
130746
130746
|
enumerable: false,
|
|
130747
130747
|
value: intersection2,
|
|
130748
130748
|
writable: false
|
|
@@ -130760,186 +130760,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
130760
130760
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
130761
130761
|
var util_1 = __require("util");
|
|
130762
130762
|
var rules = new Map;
|
|
130763
|
-
function hasType(
|
|
130764
|
-
return
|
|
130763
|
+
function hasType(schema9, type) {
|
|
130764
|
+
return schema9.type === type || Array.isArray(schema9.type) && schema9.type.includes(type);
|
|
130765
130765
|
}
|
|
130766
|
-
function isObjectType(
|
|
130767
|
-
return
|
|
130766
|
+
function isObjectType(schema9) {
|
|
130767
|
+
return schema9.properties !== undefined || hasType(schema9, "object") || hasType(schema9, "any");
|
|
130768
130768
|
}
|
|
130769
|
-
function isArrayType(
|
|
130770
|
-
return
|
|
130769
|
+
function isArrayType(schema9) {
|
|
130770
|
+
return schema9.items !== undefined || hasType(schema9, "array") || hasType(schema9, "any");
|
|
130771
130771
|
}
|
|
130772
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
130773
|
-
return
|
|
130772
|
+
function isEnumTypeWithoutTsEnumNames(schema9) {
|
|
130773
|
+
return schema9.type === "string" && schema9.enum !== undefined && schema9.tsEnumNames === undefined;
|
|
130774
130774
|
}
|
|
130775
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
130776
|
-
if (Array.isArray(
|
|
130777
|
-
|
|
130775
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema9) => {
|
|
130776
|
+
if (Array.isArray(schema9.enum) && schema9.enum.some((e8) => e8 === null) && Array.isArray(schema9.type) && schema9.type.includes("null")) {
|
|
130777
|
+
schema9.type = schema9.type.filter((type) => type !== "null");
|
|
130778
130778
|
}
|
|
130779
130779
|
});
|
|
130780
|
-
rules.set("Destructure unary types", (
|
|
130781
|
-
if (
|
|
130782
|
-
|
|
130780
|
+
rules.set("Destructure unary types", (schema9) => {
|
|
130781
|
+
if (schema9.type && Array.isArray(schema9.type) && schema9.type.length === 1) {
|
|
130782
|
+
schema9.type = schema9.type[0];
|
|
130783
130783
|
}
|
|
130784
130784
|
});
|
|
130785
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
130786
|
-
if (isObjectType(
|
|
130787
|
-
|
|
130785
|
+
rules.set("Add empty `required` property if none is defined", (schema9) => {
|
|
130786
|
+
if (isObjectType(schema9) && !("required" in schema9)) {
|
|
130787
|
+
schema9.required = [];
|
|
130788
130788
|
}
|
|
130789
130789
|
});
|
|
130790
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
130791
|
-
if (
|
|
130792
|
-
|
|
130790
|
+
rules.set("Transform `required`=false to `required`=[]", (schema9) => {
|
|
130791
|
+
if (schema9.required === false) {
|
|
130792
|
+
schema9.required = [];
|
|
130793
130793
|
}
|
|
130794
130794
|
});
|
|
130795
|
-
rules.set("Default additionalProperties", (
|
|
130796
|
-
if (isObjectType(
|
|
130797
|
-
|
|
130795
|
+
rules.set("Default additionalProperties", (schema9, _10, options8) => {
|
|
130796
|
+
if (isObjectType(schema9) && !("additionalProperties" in schema9) && schema9.patternProperties === undefined) {
|
|
130797
|
+
schema9.additionalProperties = options8.additionalProperties;
|
|
130798
130798
|
}
|
|
130799
130799
|
});
|
|
130800
|
-
rules.set("Transform id to $id", (
|
|
130801
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
130800
|
+
rules.set("Transform id to $id", (schema9, fileName) => {
|
|
130801
|
+
if (!(0, utils_1.isSchemaLike)(schema9)) {
|
|
130802
130802
|
return;
|
|
130803
130803
|
}
|
|
130804
|
-
if (
|
|
130805
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
130804
|
+
if (schema9.id && schema9.$id && schema9.id !== schema9.$id) {
|
|
130805
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema9.id}, $id=${schema9.$id} in ${fileName}`);
|
|
130806
130806
|
}
|
|
130807
|
-
if (
|
|
130808
|
-
|
|
130809
|
-
delete
|
|
130807
|
+
if (schema9.id) {
|
|
130808
|
+
schema9.$id = schema9.id;
|
|
130809
|
+
delete schema9.id;
|
|
130810
130810
|
}
|
|
130811
130811
|
});
|
|
130812
|
-
rules.set("Add an $id to anything that needs it", (
|
|
130813
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
130812
|
+
rules.set("Add an $id to anything that needs it", (schema9, fileName, _options, _key, dereferencedPaths) => {
|
|
130813
|
+
if (!(0, utils_1.isSchemaLike)(schema9)) {
|
|
130814
130814
|
return;
|
|
130815
130815
|
}
|
|
130816
|
-
if (!
|
|
130817
|
-
|
|
130816
|
+
if (!schema9.$id && !schema9[JSONSchema_1.Parent]) {
|
|
130817
|
+
schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
130818
130818
|
return;
|
|
130819
130819
|
}
|
|
130820
|
-
if (!isArrayType(
|
|
130820
|
+
if (!isArrayType(schema9) && !isObjectType(schema9)) {
|
|
130821
130821
|
return;
|
|
130822
130822
|
}
|
|
130823
|
-
const dereferencedName = dereferencedPaths.get(
|
|
130824
|
-
if (!
|
|
130825
|
-
|
|
130823
|
+
const dereferencedName = dereferencedPaths.get(schema9);
|
|
130824
|
+
if (!schema9.$id && !schema9.title && dereferencedName) {
|
|
130825
|
+
schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
130826
130826
|
}
|
|
130827
130827
|
if (dereferencedName) {
|
|
130828
|
-
dereferencedPaths.delete(
|
|
130828
|
+
dereferencedPaths.delete(schema9);
|
|
130829
130829
|
}
|
|
130830
130830
|
});
|
|
130831
|
-
rules.set("Escape closing JSDoc comment", (
|
|
130832
|
-
(0, utils_1.escapeBlockComment)(
|
|
130831
|
+
rules.set("Escape closing JSDoc comment", (schema9) => {
|
|
130832
|
+
(0, utils_1.escapeBlockComment)(schema9);
|
|
130833
130833
|
});
|
|
130834
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
130835
|
-
if (!isArrayType(
|
|
130834
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema9) => {
|
|
130835
|
+
if (!isArrayType(schema9)) {
|
|
130836
130836
|
return;
|
|
130837
130837
|
}
|
|
130838
130838
|
const commentsToAppend = [
|
|
130839
|
-
"minItems" in
|
|
130840
|
-
"maxItems" in
|
|
130839
|
+
"minItems" in schema9 ? `@minItems ${schema9.minItems}` : "",
|
|
130840
|
+
"maxItems" in schema9 ? `@maxItems ${schema9.maxItems}` : ""
|
|
130841
130841
|
].filter(Boolean);
|
|
130842
130842
|
if (commentsToAppend.length) {
|
|
130843
|
-
|
|
130843
|
+
schema9.description = (0, utils_1.appendToDescription)(schema9.description, ...commentsToAppend);
|
|
130844
130844
|
}
|
|
130845
130845
|
});
|
|
130846
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
130847
|
-
if (!isArrayType(
|
|
130846
|
+
rules.set("Optionally remove maxItems and minItems", (schema9, _fileName, options8) => {
|
|
130847
|
+
if (!isArrayType(schema9)) {
|
|
130848
130848
|
return;
|
|
130849
130849
|
}
|
|
130850
|
-
if ("minItems" in
|
|
130851
|
-
delete
|
|
130850
|
+
if ("minItems" in schema9 && options8.ignoreMinAndMaxItems) {
|
|
130851
|
+
delete schema9.minItems;
|
|
130852
130852
|
}
|
|
130853
|
-
if ("maxItems" in
|
|
130854
|
-
delete
|
|
130853
|
+
if ("maxItems" in schema9 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
130854
|
+
delete schema9.maxItems;
|
|
130855
130855
|
}
|
|
130856
130856
|
});
|
|
130857
|
-
rules.set("Normalize schema.minItems", (
|
|
130857
|
+
rules.set("Normalize schema.minItems", (schema9, _fileName, options8) => {
|
|
130858
130858
|
if (options8.ignoreMinAndMaxItems) {
|
|
130859
130859
|
return;
|
|
130860
130860
|
}
|
|
130861
|
-
if (!isArrayType(
|
|
130861
|
+
if (!isArrayType(schema9)) {
|
|
130862
130862
|
return;
|
|
130863
130863
|
}
|
|
130864
|
-
const { minItems } =
|
|
130865
|
-
|
|
130864
|
+
const { minItems } = schema9;
|
|
130865
|
+
schema9.minItems = typeof minItems === "number" ? minItems : 0;
|
|
130866
130866
|
});
|
|
130867
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
130867
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema9, _fileName, options8) => {
|
|
130868
130868
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
130869
130869
|
return;
|
|
130870
130870
|
}
|
|
130871
|
-
if (!isArrayType(
|
|
130871
|
+
if (!isArrayType(schema9)) {
|
|
130872
130872
|
return;
|
|
130873
130873
|
}
|
|
130874
|
-
const { maxItems, minItems } =
|
|
130874
|
+
const { maxItems, minItems } = schema9;
|
|
130875
130875
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
130876
|
-
delete
|
|
130876
|
+
delete schema9.maxItems;
|
|
130877
130877
|
}
|
|
130878
130878
|
});
|
|
130879
|
-
rules.set("Normalize schema.items", (
|
|
130879
|
+
rules.set("Normalize schema.items", (schema9, _fileName, options8) => {
|
|
130880
130880
|
if (options8.ignoreMinAndMaxItems) {
|
|
130881
130881
|
return;
|
|
130882
130882
|
}
|
|
130883
|
-
const { maxItems, minItems } =
|
|
130883
|
+
const { maxItems, minItems } = schema9;
|
|
130884
130884
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
130885
130885
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
130886
|
-
if (
|
|
130887
|
-
const items =
|
|
130886
|
+
if (schema9.items && !Array.isArray(schema9.items) && (hasMaxItems || hasMinItems)) {
|
|
130887
|
+
const items = schema9.items;
|
|
130888
130888
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
130889
130889
|
if (!hasMaxItems) {
|
|
130890
|
-
|
|
130890
|
+
schema9.additionalItems = items;
|
|
130891
130891
|
}
|
|
130892
|
-
|
|
130892
|
+
schema9.items = newItems;
|
|
130893
130893
|
}
|
|
130894
|
-
if (Array.isArray(
|
|
130895
|
-
|
|
130894
|
+
if (Array.isArray(schema9.items) && hasMaxItems && maxItems < schema9.items.length) {
|
|
130895
|
+
schema9.items = schema9.items.slice(0, maxItems);
|
|
130896
130896
|
}
|
|
130897
|
-
return
|
|
130897
|
+
return schema9;
|
|
130898
130898
|
});
|
|
130899
|
-
rules.set("Remove extends, if it is empty", (
|
|
130900
|
-
if (!
|
|
130899
|
+
rules.set("Remove extends, if it is empty", (schema9) => {
|
|
130900
|
+
if (!schema9.hasOwnProperty("extends")) {
|
|
130901
130901
|
return;
|
|
130902
130902
|
}
|
|
130903
|
-
if (
|
|
130904
|
-
delete
|
|
130903
|
+
if (schema9.extends == null || Array.isArray(schema9.extends) && schema9.extends.length === 0) {
|
|
130904
|
+
delete schema9.extends;
|
|
130905
130905
|
}
|
|
130906
130906
|
});
|
|
130907
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
130908
|
-
if (
|
|
130907
|
+
rules.set("Make extends always an array, if it is defined", (schema9) => {
|
|
130908
|
+
if (schema9.extends == null) {
|
|
130909
130909
|
return;
|
|
130910
130910
|
}
|
|
130911
|
-
if (!Array.isArray(
|
|
130912
|
-
|
|
130911
|
+
if (!Array.isArray(schema9.extends)) {
|
|
130912
|
+
schema9.extends = [schema9.extends];
|
|
130913
130913
|
}
|
|
130914
130914
|
});
|
|
130915
|
-
rules.set("Transform definitions to $defs", (
|
|
130916
|
-
if (
|
|
130917
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
130915
|
+
rules.set("Transform definitions to $defs", (schema9, fileName) => {
|
|
130916
|
+
if (schema9.definitions && schema9.$defs && !(0, util_1.isDeepStrictEqual)(schema9.definitions, schema9.$defs)) {
|
|
130917
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema9.id} in ${fileName}`);
|
|
130918
130918
|
}
|
|
130919
|
-
if (
|
|
130920
|
-
|
|
130921
|
-
delete
|
|
130919
|
+
if (schema9.definitions) {
|
|
130920
|
+
schema9.$defs = schema9.definitions;
|
|
130921
|
+
delete schema9.definitions;
|
|
130922
130922
|
}
|
|
130923
130923
|
});
|
|
130924
|
-
rules.set("Transform const to singleton enum", (
|
|
130925
|
-
if (
|
|
130926
|
-
|
|
130927
|
-
delete
|
|
130924
|
+
rules.set("Transform const to singleton enum", (schema9) => {
|
|
130925
|
+
if (schema9.const !== undefined) {
|
|
130926
|
+
schema9.enum = [schema9.const];
|
|
130927
|
+
delete schema9.const;
|
|
130928
130928
|
}
|
|
130929
130929
|
});
|
|
130930
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
130930
|
+
rules.set("Add tsEnumNames to enum types", (schema9, _10, options8) => {
|
|
130931
130931
|
var _a7;
|
|
130932
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
130933
|
-
|
|
130932
|
+
if (isEnumTypeWithoutTsEnumNames(schema9) && options8.inferStringEnumKeysFromValues) {
|
|
130933
|
+
schema9.tsEnumNames = (_a7 = schema9.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
130934
130934
|
}
|
|
130935
130935
|
});
|
|
130936
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
130937
|
-
if (
|
|
130938
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
130936
|
+
rules.set("Pre-calculate schema types and intersections", (schema9) => {
|
|
130937
|
+
if (schema9 !== null && typeof schema9 === "object") {
|
|
130938
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema9);
|
|
130939
130939
|
}
|
|
130940
130940
|
});
|
|
130941
130941
|
function normalize(rootSchema, dereferencedPaths, filename, options8) {
|
|
130942
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
130942
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema9, key2) => rule(schema9, filename, options8, key2, dereferencedPaths)));
|
|
130943
130943
|
return rootSchema;
|
|
130944
130944
|
}
|
|
130945
130945
|
exports.normalize = normalize;
|
|
@@ -131021,37 +131021,37 @@ var require_parser = __commonJS((exports) => {
|
|
|
131021
131021
|
var AST_1 = require_AST();
|
|
131022
131022
|
var JSONSchema_1 = require_JSONSchema();
|
|
131023
131023
|
var utils_1 = require_utils7();
|
|
131024
|
-
function parse10(
|
|
131025
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
131026
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
131027
|
-
return parseBooleanSchema(
|
|
131024
|
+
function parse10(schema9, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
131025
|
+
if ((0, JSONSchema_1.isPrimitive)(schema9)) {
|
|
131026
|
+
if ((0, JSONSchema_1.isBoolean)(schema9)) {
|
|
131027
|
+
return parseBooleanSchema(schema9, keyName, options8);
|
|
131028
131028
|
}
|
|
131029
|
-
return parseLiteral(
|
|
131029
|
+
return parseLiteral(schema9, keyName);
|
|
131030
131030
|
}
|
|
131031
|
-
const intersection2 =
|
|
131032
|
-
const types =
|
|
131031
|
+
const intersection2 = schema9[JSONSchema_1.Intersection];
|
|
131032
|
+
const types = schema9[JSONSchema_1.Types];
|
|
131033
131033
|
if (intersection2) {
|
|
131034
131034
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
131035
131035
|
types.forEach((type) => {
|
|
131036
|
-
ast.params.push(parseAsTypeWithCache(
|
|
131036
|
+
ast.params.push(parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames));
|
|
131037
131037
|
});
|
|
131038
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
131038
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema9, "Output:", ast);
|
|
131039
131039
|
return ast;
|
|
131040
131040
|
}
|
|
131041
131041
|
if (types.size === 1) {
|
|
131042
131042
|
const type = [...types][0];
|
|
131043
|
-
const ast = parseAsTypeWithCache(
|
|
131044
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
131043
|
+
const ast = parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames);
|
|
131044
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema9, "Output:", ast);
|
|
131045
131045
|
return ast;
|
|
131046
131046
|
}
|
|
131047
131047
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
131048
131048
|
}
|
|
131049
131049
|
exports.parse = parse10;
|
|
131050
|
-
function parseAsTypeWithCache(
|
|
131051
|
-
let cachedTypeMap = processed.get(
|
|
131050
|
+
function parseAsTypeWithCache(schema9, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
131051
|
+
let cachedTypeMap = processed.get(schema9);
|
|
131052
131052
|
if (!cachedTypeMap) {
|
|
131053
131053
|
cachedTypeMap = new Map;
|
|
131054
|
-
processed.set(
|
|
131054
|
+
processed.set(schema9, cachedTypeMap);
|
|
131055
131055
|
}
|
|
131056
131056
|
const cachedAST = cachedTypeMap.get(type);
|
|
131057
131057
|
if (cachedAST) {
|
|
@@ -131059,10 +131059,10 @@ var require_parser = __commonJS((exports) => {
|
|
|
131059
131059
|
}
|
|
131060
131060
|
const ast = {};
|
|
131061
131061
|
cachedTypeMap.set(type, ast);
|
|
131062
|
-
return Object.assign(ast, parseNonLiteral(
|
|
131062
|
+
return Object.assign(ast, parseNonLiteral(schema9, type, options8, keyName, processed, usedNames));
|
|
131063
131063
|
}
|
|
131064
|
-
function parseBooleanSchema(
|
|
131065
|
-
if (
|
|
131064
|
+
function parseBooleanSchema(schema9, keyName, options8) {
|
|
131065
|
+
if (schema9) {
|
|
131066
131066
|
return {
|
|
131067
131067
|
keyName,
|
|
131068
131068
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -131073,157 +131073,157 @@ var require_parser = __commonJS((exports) => {
|
|
|
131073
131073
|
type: "NEVER"
|
|
131074
131074
|
};
|
|
131075
131075
|
}
|
|
131076
|
-
function parseLiteral(
|
|
131076
|
+
function parseLiteral(schema9, keyName) {
|
|
131077
131077
|
return {
|
|
131078
131078
|
keyName,
|
|
131079
|
-
params:
|
|
131079
|
+
params: schema9,
|
|
131080
131080
|
type: "LITERAL"
|
|
131081
131081
|
};
|
|
131082
131082
|
}
|
|
131083
|
-
function parseNonLiteral(
|
|
131084
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
131085
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
131083
|
+
function parseNonLiteral(schema9, type, options8, keyName, processed, usedNames) {
|
|
131084
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema9));
|
|
131085
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema9);
|
|
131086
131086
|
switch (type) {
|
|
131087
131087
|
case "ALL_OF":
|
|
131088
131088
|
return {
|
|
131089
|
-
comment:
|
|
131090
|
-
deprecated:
|
|
131089
|
+
comment: schema9.description,
|
|
131090
|
+
deprecated: schema9.deprecated,
|
|
131091
131091
|
keyName,
|
|
131092
|
-
standaloneName: standaloneName(
|
|
131093
|
-
params:
|
|
131092
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131093
|
+
params: schema9.allOf.map((_10) => parse10(_10, options8, undefined, processed, usedNames)),
|
|
131094
131094
|
type: "INTERSECTION"
|
|
131095
131095
|
};
|
|
131096
131096
|
case "ANY":
|
|
131097
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
131097
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema9.description, deprecated: schema9.deprecated, keyName, standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8) });
|
|
131098
131098
|
case "ANY_OF":
|
|
131099
131099
|
return {
|
|
131100
|
-
comment:
|
|
131101
|
-
deprecated:
|
|
131100
|
+
comment: schema9.description,
|
|
131101
|
+
deprecated: schema9.deprecated,
|
|
131102
131102
|
keyName,
|
|
131103
|
-
standaloneName: standaloneName(
|
|
131104
|
-
params:
|
|
131103
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131104
|
+
params: schema9.anyOf.map((_10) => parse10(_10, options8, undefined, processed, usedNames)),
|
|
131105
131105
|
type: "UNION"
|
|
131106
131106
|
};
|
|
131107
131107
|
case "BOOLEAN":
|
|
131108
131108
|
return {
|
|
131109
|
-
comment:
|
|
131110
|
-
deprecated:
|
|
131109
|
+
comment: schema9.description,
|
|
131110
|
+
deprecated: schema9.deprecated,
|
|
131111
131111
|
keyName,
|
|
131112
|
-
standaloneName: standaloneName(
|
|
131112
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131113
131113
|
type: "BOOLEAN"
|
|
131114
131114
|
};
|
|
131115
131115
|
case "CUSTOM_TYPE":
|
|
131116
131116
|
return {
|
|
131117
|
-
comment:
|
|
131118
|
-
deprecated:
|
|
131117
|
+
comment: schema9.description,
|
|
131118
|
+
deprecated: schema9.deprecated,
|
|
131119
131119
|
keyName,
|
|
131120
|
-
params:
|
|
131121
|
-
standaloneName: standaloneName(
|
|
131120
|
+
params: schema9.tsType,
|
|
131121
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131122
131122
|
type: "CUSTOM_TYPE"
|
|
131123
131123
|
};
|
|
131124
131124
|
case "NAMED_ENUM":
|
|
131125
131125
|
return {
|
|
131126
|
-
comment:
|
|
131127
|
-
deprecated:
|
|
131126
|
+
comment: schema9.description,
|
|
131127
|
+
deprecated: schema9.deprecated,
|
|
131128
131128
|
keyName,
|
|
131129
|
-
standaloneName: standaloneName(
|
|
131130
|
-
params:
|
|
131129
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
131130
|
+
params: schema9.enum.map((_10, n5) => ({
|
|
131131
131131
|
ast: parseLiteral(_10, undefined),
|
|
131132
|
-
keyName:
|
|
131132
|
+
keyName: schema9.tsEnumNames[n5]
|
|
131133
131133
|
})),
|
|
131134
131134
|
type: "ENUM"
|
|
131135
131135
|
};
|
|
131136
131136
|
case "NAMED_SCHEMA":
|
|
131137
|
-
return newInterface(
|
|
131137
|
+
return newInterface(schema9, options8, processed, usedNames, keyName);
|
|
131138
131138
|
case "NEVER":
|
|
131139
131139
|
return {
|
|
131140
|
-
comment:
|
|
131141
|
-
deprecated:
|
|
131140
|
+
comment: schema9.description,
|
|
131141
|
+
deprecated: schema9.deprecated,
|
|
131142
131142
|
keyName,
|
|
131143
|
-
standaloneName: standaloneName(
|
|
131143
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131144
131144
|
type: "NEVER"
|
|
131145
131145
|
};
|
|
131146
131146
|
case "NULL":
|
|
131147
131147
|
return {
|
|
131148
|
-
comment:
|
|
131149
|
-
deprecated:
|
|
131148
|
+
comment: schema9.description,
|
|
131149
|
+
deprecated: schema9.deprecated,
|
|
131150
131150
|
keyName,
|
|
131151
|
-
standaloneName: standaloneName(
|
|
131151
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131152
131152
|
type: "NULL"
|
|
131153
131153
|
};
|
|
131154
131154
|
case "NUMBER":
|
|
131155
131155
|
return {
|
|
131156
|
-
comment:
|
|
131157
|
-
deprecated:
|
|
131156
|
+
comment: schema9.description,
|
|
131157
|
+
deprecated: schema9.deprecated,
|
|
131158
131158
|
keyName,
|
|
131159
|
-
standaloneName: standaloneName(
|
|
131159
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131160
131160
|
type: "NUMBER"
|
|
131161
131161
|
};
|
|
131162
131162
|
case "OBJECT":
|
|
131163
131163
|
return {
|
|
131164
|
-
comment:
|
|
131164
|
+
comment: schema9.description,
|
|
131165
131165
|
keyName,
|
|
131166
|
-
standaloneName: standaloneName(
|
|
131166
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131167
131167
|
type: "OBJECT",
|
|
131168
|
-
deprecated:
|
|
131168
|
+
deprecated: schema9.deprecated
|
|
131169
131169
|
};
|
|
131170
131170
|
case "ONE_OF":
|
|
131171
131171
|
return {
|
|
131172
|
-
comment:
|
|
131173
|
-
deprecated:
|
|
131172
|
+
comment: schema9.description,
|
|
131173
|
+
deprecated: schema9.deprecated,
|
|
131174
131174
|
keyName,
|
|
131175
|
-
standaloneName: standaloneName(
|
|
131176
|
-
params:
|
|
131175
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131176
|
+
params: schema9.oneOf.map((_10) => parse10(_10, options8, undefined, processed, usedNames)),
|
|
131177
131177
|
type: "UNION"
|
|
131178
131178
|
};
|
|
131179
131179
|
case "REFERENCE":
|
|
131180
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
131180
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema9));
|
|
131181
131181
|
case "STRING":
|
|
131182
131182
|
return {
|
|
131183
|
-
comment:
|
|
131184
|
-
deprecated:
|
|
131183
|
+
comment: schema9.description,
|
|
131184
|
+
deprecated: schema9.deprecated,
|
|
131185
131185
|
keyName,
|
|
131186
|
-
standaloneName: standaloneName(
|
|
131186
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131187
131187
|
type: "STRING"
|
|
131188
131188
|
};
|
|
131189
131189
|
case "TYPED_ARRAY":
|
|
131190
|
-
if (Array.isArray(
|
|
131191
|
-
const minItems2 =
|
|
131192
|
-
const maxItems2 =
|
|
131190
|
+
if (Array.isArray(schema9.items)) {
|
|
131191
|
+
const minItems2 = schema9.minItems;
|
|
131192
|
+
const maxItems2 = schema9.maxItems;
|
|
131193
131193
|
const arrayType = {
|
|
131194
|
-
comment:
|
|
131195
|
-
deprecated:
|
|
131194
|
+
comment: schema9.description,
|
|
131195
|
+
deprecated: schema9.deprecated,
|
|
131196
131196
|
keyName,
|
|
131197
131197
|
maxItems: maxItems2,
|
|
131198
131198
|
minItems: minItems2,
|
|
131199
|
-
standaloneName: standaloneName(
|
|
131200
|
-
params:
|
|
131199
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131200
|
+
params: schema9.items.map((_10) => parse10(_10, options8, undefined, processed, usedNames)),
|
|
131201
131201
|
type: "TUPLE"
|
|
131202
131202
|
};
|
|
131203
|
-
if (
|
|
131203
|
+
if (schema9.additionalItems === true) {
|
|
131204
131204
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
131205
|
-
} else if (
|
|
131206
|
-
arrayType.spreadParam = parse10(
|
|
131205
|
+
} else if (schema9.additionalItems) {
|
|
131206
|
+
arrayType.spreadParam = parse10(schema9.additionalItems, options8, undefined, processed, usedNames);
|
|
131207
131207
|
}
|
|
131208
131208
|
return arrayType;
|
|
131209
131209
|
} else {
|
|
131210
131210
|
return {
|
|
131211
|
-
comment:
|
|
131212
|
-
deprecated:
|
|
131211
|
+
comment: schema9.description,
|
|
131212
|
+
deprecated: schema9.deprecated,
|
|
131213
131213
|
keyName,
|
|
131214
|
-
standaloneName: standaloneName(
|
|
131215
|
-
params: parse10(
|
|
131214
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131215
|
+
params: parse10(schema9.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
131216
131216
|
type: "ARRAY"
|
|
131217
131217
|
};
|
|
131218
131218
|
}
|
|
131219
131219
|
case "UNION":
|
|
131220
131220
|
return {
|
|
131221
|
-
comment:
|
|
131222
|
-
deprecated:
|
|
131221
|
+
comment: schema9.description,
|
|
131222
|
+
deprecated: schema9.deprecated,
|
|
131223
131223
|
keyName,
|
|
131224
|
-
standaloneName: standaloneName(
|
|
131225
|
-
params:
|
|
131226
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
131224
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131225
|
+
params: schema9.type.map((type2) => {
|
|
131226
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema9, "$id", "description", "title")), { type: type2 });
|
|
131227
131227
|
(0, utils_1.maybeStripDefault)(member);
|
|
131228
131228
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
131229
131229
|
return parse10(member, options8, undefined, processed, usedNames);
|
|
@@ -131232,80 +131232,80 @@ var require_parser = __commonJS((exports) => {
|
|
|
131232
131232
|
};
|
|
131233
131233
|
case "UNNAMED_ENUM":
|
|
131234
131234
|
return {
|
|
131235
|
-
comment:
|
|
131236
|
-
deprecated:
|
|
131235
|
+
comment: schema9.description,
|
|
131236
|
+
deprecated: schema9.deprecated,
|
|
131237
131237
|
keyName,
|
|
131238
|
-
standaloneName: standaloneName(
|
|
131239
|
-
params:
|
|
131238
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131239
|
+
params: schema9.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
131240
131240
|
type: "UNION"
|
|
131241
131241
|
};
|
|
131242
131242
|
case "UNNAMED_SCHEMA":
|
|
131243
|
-
return newInterface(
|
|
131243
|
+
return newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
131244
131244
|
case "UNTYPED_ARRAY":
|
|
131245
|
-
const minItems =
|
|
131246
|
-
const maxItems = typeof
|
|
131245
|
+
const minItems = schema9.minItems;
|
|
131246
|
+
const maxItems = typeof schema9.maxItems === "number" ? schema9.maxItems : -1;
|
|
131247
131247
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
131248
131248
|
if (minItems > 0 || maxItems >= 0) {
|
|
131249
131249
|
return {
|
|
131250
|
-
comment:
|
|
131251
|
-
deprecated:
|
|
131250
|
+
comment: schema9.description,
|
|
131251
|
+
deprecated: schema9.deprecated,
|
|
131252
131252
|
keyName,
|
|
131253
|
-
maxItems:
|
|
131253
|
+
maxItems: schema9.maxItems,
|
|
131254
131254
|
minItems,
|
|
131255
131255
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
131256
131256
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
131257
|
-
standaloneName: standaloneName(
|
|
131257
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131258
131258
|
type: "TUPLE"
|
|
131259
131259
|
};
|
|
131260
131260
|
}
|
|
131261
131261
|
return {
|
|
131262
|
-
comment:
|
|
131263
|
-
deprecated:
|
|
131262
|
+
comment: schema9.description,
|
|
131263
|
+
deprecated: schema9.deprecated,
|
|
131264
131264
|
keyName,
|
|
131265
131265
|
params,
|
|
131266
|
-
standaloneName: standaloneName(
|
|
131266
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131267
131267
|
type: "ARRAY"
|
|
131268
131268
|
};
|
|
131269
131269
|
}
|
|
131270
131270
|
}
|
|
131271
|
-
function standaloneName(
|
|
131271
|
+
function standaloneName(schema9, keyNameFromDefinition, usedNames, options8) {
|
|
131272
131272
|
var _a7;
|
|
131273
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
131273
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema9, keyNameFromDefinition)) || schema9.title || schema9.$id || keyNameFromDefinition;
|
|
131274
131274
|
if (name2) {
|
|
131275
131275
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
131276
131276
|
}
|
|
131277
131277
|
}
|
|
131278
|
-
function newInterface(
|
|
131279
|
-
const name2 = standaloneName(
|
|
131278
|
+
function newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
131279
|
+
const name2 = standaloneName(schema9, keyNameFromDefinition, usedNames, options8);
|
|
131280
131280
|
return {
|
|
131281
|
-
comment:
|
|
131282
|
-
deprecated:
|
|
131281
|
+
comment: schema9.description,
|
|
131282
|
+
deprecated: schema9.deprecated,
|
|
131283
131283
|
keyName,
|
|
131284
|
-
params: parseSchema(
|
|
131284
|
+
params: parseSchema(schema9, options8, processed, usedNames, name2),
|
|
131285
131285
|
standaloneName: name2,
|
|
131286
|
-
superTypes: parseSuperTypes(
|
|
131286
|
+
superTypes: parseSuperTypes(schema9, options8, processed, usedNames),
|
|
131287
131287
|
type: "INTERFACE"
|
|
131288
131288
|
};
|
|
131289
131289
|
}
|
|
131290
|
-
function parseSuperTypes(
|
|
131291
|
-
const superTypes =
|
|
131290
|
+
function parseSuperTypes(schema9, options8, processed, usedNames) {
|
|
131291
|
+
const superTypes = schema9.extends;
|
|
131292
131292
|
if (!superTypes) {
|
|
131293
131293
|
return [];
|
|
131294
131294
|
}
|
|
131295
131295
|
return superTypes.map((_10) => parse10(_10, options8, undefined, processed, usedNames));
|
|
131296
131296
|
}
|
|
131297
|
-
function parseSchema(
|
|
131298
|
-
let asts = (0, lodash_1.map)(
|
|
131297
|
+
function parseSchema(schema9, options8, processed, usedNames, parentSchemaName) {
|
|
131298
|
+
let asts = (0, lodash_1.map)(schema9.properties, (value, key2) => ({
|
|
131299
131299
|
ast: parse10(value, options8, key2, processed, usedNames),
|
|
131300
131300
|
isPatternProperty: false,
|
|
131301
|
-
isRequired: (0, lodash_1.includes)(
|
|
131301
|
+
isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131302
131302
|
isUnreachableDefinition: false,
|
|
131303
131303
|
keyName: key2
|
|
131304
131304
|
}));
|
|
131305
131305
|
let singlePatternProperty = false;
|
|
131306
|
-
if (
|
|
131307
|
-
singlePatternProperty = !
|
|
131308
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
131306
|
+
if (schema9.patternProperties) {
|
|
131307
|
+
singlePatternProperty = !schema9.additionalProperties && Object.keys(schema9.patternProperties).length === 1;
|
|
131308
|
+
asts = asts.concat((0, lodash_1.map)(schema9.patternProperties, (value, key2) => {
|
|
131309
131309
|
const ast = parse10(value, options8, key2, processed, usedNames);
|
|
131310
131310
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
131311
131311
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
@@ -131315,14 +131315,14 @@ ${comment}` : comment;
|
|
|
131315
131315
|
return {
|
|
131316
131316
|
ast,
|
|
131317
131317
|
isPatternProperty: !singlePatternProperty,
|
|
131318
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
131318
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131319
131319
|
isUnreachableDefinition: false,
|
|
131320
131320
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
131321
131321
|
};
|
|
131322
131322
|
}));
|
|
131323
131323
|
}
|
|
131324
131324
|
if (options8.unreachableDefinitions) {
|
|
131325
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
131325
|
+
asts = asts.concat((0, lodash_1.map)(schema9.$defs, (value, key2) => {
|
|
131326
131326
|
const ast = parse10(value, options8, key2, processed, usedNames);
|
|
131327
131327
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
131328
131328
|
via the \`definition\` "${key2}".`;
|
|
@@ -131332,13 +131332,13 @@ ${comment}` : comment;
|
|
|
131332
131332
|
return {
|
|
131333
131333
|
ast,
|
|
131334
131334
|
isPatternProperty: false,
|
|
131335
|
-
isRequired: (0, lodash_1.includes)(
|
|
131335
|
+
isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131336
131336
|
isUnreachableDefinition: true,
|
|
131337
131337
|
keyName: key2
|
|
131338
131338
|
};
|
|
131339
131339
|
}));
|
|
131340
131340
|
}
|
|
131341
|
-
switch (
|
|
131341
|
+
switch (schema9.additionalProperties) {
|
|
131342
131342
|
case undefined:
|
|
131343
131343
|
case true:
|
|
131344
131344
|
if (singlePatternProperty) {
|
|
@@ -131355,7 +131355,7 @@ ${comment}` : comment;
|
|
|
131355
131355
|
return asts;
|
|
131356
131356
|
default:
|
|
131357
131357
|
return asts.concat({
|
|
131358
|
-
ast: parse10(
|
|
131358
|
+
ast: parse10(schema9.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
131359
131359
|
isPatternProperty: false,
|
|
131360
131360
|
isRequired: true,
|
|
131361
131361
|
isUnreachableDefinition: false,
|
|
@@ -131363,22 +131363,22 @@ ${comment}` : comment;
|
|
|
131363
131363
|
});
|
|
131364
131364
|
}
|
|
131365
131365
|
}
|
|
131366
|
-
function getDefinitions(
|
|
131367
|
-
if (processed.has(
|
|
131366
|
+
function getDefinitions(schema9, isSchema = true, processed = new Set) {
|
|
131367
|
+
if (processed.has(schema9)) {
|
|
131368
131368
|
return {};
|
|
131369
131369
|
}
|
|
131370
|
-
processed.add(
|
|
131371
|
-
if (Array.isArray(
|
|
131372
|
-
return
|
|
131370
|
+
processed.add(schema9);
|
|
131371
|
+
if (Array.isArray(schema9)) {
|
|
131372
|
+
return schema9.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
131373
131373
|
}
|
|
131374
|
-
if ((0, lodash_1.isPlainObject)(
|
|
131375
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
131374
|
+
if ((0, lodash_1.isPlainObject)(schema9)) {
|
|
131375
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema9) ? schema9.$defs : {}), Object.keys(schema9).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema9[cur], false, processed)), {}));
|
|
131376
131376
|
}
|
|
131377
131377
|
return {};
|
|
131378
131378
|
}
|
|
131379
131379
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
131380
|
-
function hasDefinitions(
|
|
131381
|
-
return "$defs" in
|
|
131380
|
+
function hasDefinitions(schema9) {
|
|
131381
|
+
return "$defs" in schema9;
|
|
131382
131382
|
}
|
|
131383
131383
|
});
|
|
131384
131384
|
|
|
@@ -132756,7 +132756,7 @@ var require_parse6 = __commonJS((exports) => {
|
|
|
132756
132756
|
extension: url3.getExtension(path18)
|
|
132757
132757
|
};
|
|
132758
132758
|
try {
|
|
132759
|
-
const resolver = await
|
|
132759
|
+
const resolver = await readFile4(file2, options8, $refs);
|
|
132760
132760
|
$ref.pathType = resolver.plugin.name;
|
|
132761
132761
|
file2.data = resolver.result;
|
|
132762
132762
|
const parser = await parseFile(file2, options8, $refs);
|
|
@@ -132769,7 +132769,7 @@ var require_parse6 = __commonJS((exports) => {
|
|
|
132769
132769
|
throw err;
|
|
132770
132770
|
}
|
|
132771
132771
|
}
|
|
132772
|
-
async function
|
|
132772
|
+
async function readFile4(file2, options8, $refs) {
|
|
132773
132773
|
let resolvers = plugins.all(options8.resolve);
|
|
132774
132774
|
resolvers = plugins.filter(resolvers, "canRead", file2);
|
|
132775
132775
|
plugins.sort(resolvers);
|
|
@@ -133083,9 +133083,9 @@ var require_type3 = __commonJS((exports, module) => {
|
|
|
133083
133083
|
var require_schema3 = __commonJS((exports, module) => {
|
|
133084
133084
|
var YAMLException = require_exception3();
|
|
133085
133085
|
var Type = require_type3();
|
|
133086
|
-
function compileList(
|
|
133086
|
+
function compileList(schema9, name2) {
|
|
133087
133087
|
var result = [];
|
|
133088
|
-
|
|
133088
|
+
schema9[name2].forEach(function(currentType) {
|
|
133089
133089
|
var newIndex = result.length;
|
|
133090
133090
|
result.forEach(function(previousType, previousIndex) {
|
|
133091
133091
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -135030,7 +135030,7 @@ var require_dumper3 = __commonJS((exports, module) => {
|
|
|
135030
135030
|
"OFF"
|
|
135031
135031
|
];
|
|
135032
135032
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
135033
|
-
function compileStyleMap(
|
|
135033
|
+
function compileStyleMap(schema9, map2) {
|
|
135034
135034
|
var result, keys, index, length, tag, style, type;
|
|
135035
135035
|
if (map2 === null)
|
|
135036
135036
|
return {};
|
|
@@ -135042,7 +135042,7 @@ var require_dumper3 = __commonJS((exports, module) => {
|
|
|
135042
135042
|
if (tag.slice(0, 2) === "!!") {
|
|
135043
135043
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
135044
135044
|
}
|
|
135045
|
-
type =
|
|
135045
|
+
type = schema9.compiledTypeMap["fallback"][tag];
|
|
135046
135046
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
135047
135047
|
style = type.styleAliases[style];
|
|
135048
135048
|
}
|
|
@@ -135977,7 +135977,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
135977
135977
|
var options_js_1 = require_options();
|
|
135978
135978
|
function normalizeArgs(_args) {
|
|
135979
135979
|
let path18;
|
|
135980
|
-
let
|
|
135980
|
+
let schema9;
|
|
135981
135981
|
let options8;
|
|
135982
135982
|
let callback;
|
|
135983
135983
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -135987,15 +135987,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
135987
135987
|
if (typeof args[0] === "string") {
|
|
135988
135988
|
path18 = args[0];
|
|
135989
135989
|
if (typeof args[2] === "object") {
|
|
135990
|
-
|
|
135990
|
+
schema9 = args[1];
|
|
135991
135991
|
options8 = args[2];
|
|
135992
135992
|
} else {
|
|
135993
|
-
|
|
135993
|
+
schema9 = undefined;
|
|
135994
135994
|
options8 = args[1];
|
|
135995
135995
|
}
|
|
135996
135996
|
} else {
|
|
135997
135997
|
path18 = "";
|
|
135998
|
-
|
|
135998
|
+
schema9 = args[0];
|
|
135999
135999
|
options8 = args[1];
|
|
136000
136000
|
}
|
|
136001
136001
|
try {
|
|
@@ -136003,12 +136003,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
136003
136003
|
} catch (e8) {
|
|
136004
136004
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
136005
136005
|
}
|
|
136006
|
-
if (!options8.mutateInputSchema && typeof
|
|
136007
|
-
|
|
136006
|
+
if (!options8.mutateInputSchema && typeof schema9 === "object") {
|
|
136007
|
+
schema9 = JSON.parse(JSON.stringify(schema9));
|
|
136008
136008
|
}
|
|
136009
136009
|
return {
|
|
136010
136010
|
path: path18,
|
|
136011
|
-
schema:
|
|
136011
|
+
schema: schema9,
|
|
136012
136012
|
options: options8,
|
|
136013
136013
|
callback
|
|
136014
136014
|
};
|
|
@@ -136797,12 +136797,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
136797
136797
|
var json_schema_ref_parser_1 = require_lib3();
|
|
136798
136798
|
var utils_1 = require_utils7();
|
|
136799
136799
|
function dereference(schema_1, _a7) {
|
|
136800
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
136801
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
136800
|
+
return __awaiter(this, arguments, undefined, function* (schema9, { cwd, $refOptions }) {
|
|
136801
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema9);
|
|
136802
136802
|
const parser = new json_schema_ref_parser_1.$RefParser;
|
|
136803
136803
|
const dereferencedPaths = new WeakMap;
|
|
136804
|
-
const dereferencedSchema = yield parser.dereference(cwd,
|
|
136805
|
-
dereferencedPaths.set(
|
|
136804
|
+
const dereferencedSchema = yield parser.dereference(cwd, schema9, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema10) {
|
|
136805
|
+
dereferencedPaths.set(schema10, $ref);
|
|
136806
136806
|
} }) }));
|
|
136807
136807
|
return { dereferencedPaths, dereferencedSchema };
|
|
136808
136808
|
});
|
|
@@ -136816,46 +136816,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
136816
136816
|
exports.validate = undefined;
|
|
136817
136817
|
var utils_1 = require_utils7();
|
|
136818
136818
|
var rules = new Map;
|
|
136819
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
136820
|
-
if (
|
|
136819
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema9) => {
|
|
136820
|
+
if (schema9.enum && schema9.tsEnumNames && schema9.enum.length !== schema9.tsEnumNames.length) {
|
|
136821
136821
|
return false;
|
|
136822
136822
|
}
|
|
136823
136823
|
});
|
|
136824
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
136825
|
-
if (
|
|
136824
|
+
rules.set("tsEnumNames must be an array of strings", (schema9) => {
|
|
136825
|
+
if (schema9.tsEnumNames && schema9.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
136826
136826
|
return false;
|
|
136827
136827
|
}
|
|
136828
136828
|
});
|
|
136829
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
136830
|
-
const { maxItems, minItems } =
|
|
136829
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema9) => {
|
|
136830
|
+
const { maxItems, minItems } = schema9;
|
|
136831
136831
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
136832
136832
|
return maxItems >= minItems;
|
|
136833
136833
|
}
|
|
136834
136834
|
});
|
|
136835
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
136836
|
-
const { maxItems } =
|
|
136835
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema9) => {
|
|
136836
|
+
const { maxItems } = schema9;
|
|
136837
136837
|
if (typeof maxItems === "number") {
|
|
136838
136838
|
return maxItems >= 0;
|
|
136839
136839
|
}
|
|
136840
136840
|
});
|
|
136841
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
136842
|
-
const { minItems } =
|
|
136841
|
+
rules.set("When minItems exists, minItems >= 0", (schema9) => {
|
|
136842
|
+
const { minItems } = schema9;
|
|
136843
136843
|
if (typeof minItems === "number") {
|
|
136844
136844
|
return minItems >= 0;
|
|
136845
136845
|
}
|
|
136846
136846
|
});
|
|
136847
|
-
rules.set("deprecated must be a boolean", (
|
|
136848
|
-
const typeOfDeprecated = typeof
|
|
136847
|
+
rules.set("deprecated must be a boolean", (schema9) => {
|
|
136848
|
+
const typeOfDeprecated = typeof schema9.deprecated;
|
|
136849
136849
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
136850
136850
|
});
|
|
136851
|
-
function validate2(
|
|
136851
|
+
function validate2(schema9, filename) {
|
|
136852
136852
|
const errors4 = [];
|
|
136853
136853
|
rules.forEach((rule, ruleName) => {
|
|
136854
|
-
(0, utils_1.traverse)(
|
|
136855
|
-
if (rule(
|
|
136854
|
+
(0, utils_1.traverse)(schema9, (schema10, key2) => {
|
|
136855
|
+
if (rule(schema10) === false) {
|
|
136856
136856
|
errors4.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
136857
136857
|
}
|
|
136858
|
-
return
|
|
136858
|
+
return schema10;
|
|
136859
136859
|
});
|
|
136860
136860
|
});
|
|
136861
136861
|
return errors4;
|
|
@@ -136869,25 +136869,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
136869
136869
|
exports.link = undefined;
|
|
136870
136870
|
var JSONSchema_1 = require_JSONSchema();
|
|
136871
136871
|
var lodash_1 = require_lodash2();
|
|
136872
|
-
function link2(
|
|
136873
|
-
if (!Array.isArray(
|
|
136874
|
-
return
|
|
136872
|
+
function link2(schema9, parent = null) {
|
|
136873
|
+
if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
|
|
136874
|
+
return schema9;
|
|
136875
136875
|
}
|
|
136876
|
-
if (
|
|
136877
|
-
return
|
|
136876
|
+
if (schema9.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
136877
|
+
return schema9;
|
|
136878
136878
|
}
|
|
136879
|
-
Object.defineProperty(
|
|
136879
|
+
Object.defineProperty(schema9, JSONSchema_1.Parent, {
|
|
136880
136880
|
enumerable: false,
|
|
136881
136881
|
value: parent,
|
|
136882
136882
|
writable: false
|
|
136883
136883
|
});
|
|
136884
|
-
if (Array.isArray(
|
|
136885
|
-
|
|
136884
|
+
if (Array.isArray(schema9)) {
|
|
136885
|
+
schema9.forEach((child) => link2(child, schema9));
|
|
136886
136886
|
}
|
|
136887
|
-
for (const key2 in
|
|
136888
|
-
link2(
|
|
136887
|
+
for (const key2 in schema9) {
|
|
136888
|
+
link2(schema9[key2], schema9);
|
|
136889
136889
|
}
|
|
136890
|
-
return
|
|
136890
|
+
return schema9;
|
|
136891
136891
|
}
|
|
136892
136892
|
exports.link = link2;
|
|
136893
136893
|
});
|
|
@@ -136979,8 +136979,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
136979
136979
|
unknownAny: true
|
|
136980
136980
|
};
|
|
136981
136981
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
136982
|
-
const
|
|
136983
|
-
return compile(
|
|
136982
|
+
const schema9 = parseAsJSONSchema(filename);
|
|
136983
|
+
return compile(schema9, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
136984
136984
|
}
|
|
136985
136985
|
exports.compileFromFile = compileFromFile;
|
|
136986
136986
|
function parseAsJSONSchema(filename) {
|
|
@@ -136990,7 +136990,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
136990
136990
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
136991
136991
|
}
|
|
136992
136992
|
function compile(schema_1, name_1) {
|
|
136993
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
136993
|
+
return __awaiter(this, arguments, undefined, function* (schema9, name2, options8 = {}) {
|
|
136994
136994
|
(0, optionValidator_1.validateOptions)(options8);
|
|
136995
136995
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
136996
136996
|
const start = Date.now();
|
|
@@ -137000,7 +137000,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
137000
137000
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
137001
137001
|
_options.cwd += "/";
|
|
137002
137002
|
}
|
|
137003
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
137003
|
+
const _schema = (0, lodash_1.cloneDeep)(schema9);
|
|
137004
137004
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
137005
137005
|
if (process.env.VERBOSE) {
|
|
137006
137006
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -137500,7 +137500,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
137500
137500
|
|
|
137501
137501
|
// node_modules/debug/src/common.js
|
|
137502
137502
|
var require_common7 = __commonJS((exports, module) => {
|
|
137503
|
-
function setup(
|
|
137503
|
+
function setup(env3) {
|
|
137504
137504
|
createDebug.debug = createDebug;
|
|
137505
137505
|
createDebug.default = createDebug;
|
|
137506
137506
|
createDebug.coerce = coerce;
|
|
@@ -137509,8 +137509,8 @@ var require_common7 = __commonJS((exports, module) => {
|
|
|
137509
137509
|
createDebug.enabled = enabled;
|
|
137510
137510
|
createDebug.humanize = require_ms();
|
|
137511
137511
|
createDebug.destroy = destroy;
|
|
137512
|
-
Object.keys(
|
|
137513
|
-
createDebug[key2] =
|
|
137512
|
+
Object.keys(env3).forEach((key2) => {
|
|
137513
|
+
createDebug[key2] = env3[key2];
|
|
137514
137514
|
});
|
|
137515
137515
|
createDebug.names = [];
|
|
137516
137516
|
createDebug.skips = [];
|
|
@@ -155558,7 +155558,7 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155558
155558
|
module.exports = finalhandler;
|
|
155559
155559
|
function finalhandler(req, res, options8) {
|
|
155560
155560
|
var opts = options8 || {};
|
|
155561
|
-
var
|
|
155561
|
+
var env3 = opts.env || "development";
|
|
155562
155562
|
var onerror = opts.onerror;
|
|
155563
155563
|
return function(err) {
|
|
155564
155564
|
var headers;
|
|
@@ -155575,7 +155575,7 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155575
155575
|
} else {
|
|
155576
155576
|
headers = getErrorHeaders(err);
|
|
155577
155577
|
}
|
|
155578
|
-
msg = getErrorMessage(err, status,
|
|
155578
|
+
msg = getErrorMessage(err, status, env3);
|
|
155579
155579
|
} else {
|
|
155580
155580
|
status = 404;
|
|
155581
155581
|
msg = "Cannot " + req.method + " " + encodeUrl(getResourceName(req));
|
|
@@ -155600,9 +155600,9 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155600
155600
|
}
|
|
155601
155601
|
return { ...err.headers };
|
|
155602
155602
|
}
|
|
155603
|
-
function getErrorMessage(err, status,
|
|
155603
|
+
function getErrorMessage(err, status, env3) {
|
|
155604
155604
|
var msg;
|
|
155605
|
-
if (
|
|
155605
|
+
if (env3 !== "production") {
|
|
155606
155606
|
msg = err.stack;
|
|
155607
155607
|
if (!msg && typeof err.toString === "function") {
|
|
155608
155608
|
msg = err.toString();
|
|
@@ -157928,10 +157928,10 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157928
157928
|
});
|
|
157929
157929
|
};
|
|
157930
157930
|
app.defaultConfiguration = function defaultConfiguration() {
|
|
157931
|
-
var
|
|
157931
|
+
var env3 = "development";
|
|
157932
157932
|
this.enable("x-powered-by");
|
|
157933
157933
|
this.set("etag", "weak");
|
|
157934
|
-
this.set("env",
|
|
157934
|
+
this.set("env", env3);
|
|
157935
157935
|
this.set("query parser", "simple");
|
|
157936
157936
|
this.set("subdomain offset", 2);
|
|
157937
157937
|
this.set("trust proxy", false);
|
|
@@ -157939,7 +157939,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157939
157939
|
configurable: true,
|
|
157940
157940
|
value: true
|
|
157941
157941
|
});
|
|
157942
|
-
debug("booting in %s mode",
|
|
157942
|
+
debug("booting in %s mode", env3);
|
|
157943
157943
|
this.on("mount", function onmount(parent) {
|
|
157944
157944
|
if (this.settings[trustProxyDefaultSymbol] === true && typeof parent.settings["trust proxy fn"] === "function") {
|
|
157945
157945
|
delete this.settings["trust proxy"];
|
|
@@ -157956,7 +157956,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157956
157956
|
this.set("view", View);
|
|
157957
157957
|
this.set("views", resolve5("views"));
|
|
157958
157958
|
this.set("jsonp callback name", "callback");
|
|
157959
|
-
if (
|
|
157959
|
+
if (env3 === "production") {
|
|
157960
157960
|
this.enable("view cache");
|
|
157961
157961
|
}
|
|
157962
157962
|
};
|
|
@@ -159228,19 +159228,19 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159228
159228
|
// node_modules/cookie-signature/index.js
|
|
159229
159229
|
var require_cookie_signature = __commonJS((exports) => {
|
|
159230
159230
|
var crypto = __require("crypto");
|
|
159231
|
-
exports.sign = function(val,
|
|
159231
|
+
exports.sign = function(val, secret2) {
|
|
159232
159232
|
if (typeof val != "string")
|
|
159233
159233
|
throw new TypeError("Cookie value must be provided as a string.");
|
|
159234
|
-
if (
|
|
159234
|
+
if (secret2 == null)
|
|
159235
159235
|
throw new TypeError("Secret key must be provided.");
|
|
159236
|
-
return val + "." + crypto.createHmac("sha256",
|
|
159236
|
+
return val + "." + crypto.createHmac("sha256", secret2).update(val).digest("base64").replace(/\=+$/, "");
|
|
159237
159237
|
};
|
|
159238
|
-
exports.unsign = function(input,
|
|
159238
|
+
exports.unsign = function(input, secret2) {
|
|
159239
159239
|
if (typeof input != "string")
|
|
159240
159240
|
throw new TypeError("Signed cookie string must be provided.");
|
|
159241
|
-
if (
|
|
159241
|
+
if (secret2 == null)
|
|
159242
159242
|
throw new TypeError("Secret key must be provided.");
|
|
159243
|
-
var tentativeValue = input.slice(0, input.lastIndexOf(".")), expectedInput = exports.sign(tentativeValue,
|
|
159243
|
+
var tentativeValue = input.slice(0, input.lastIndexOf(".")), expectedInput = exports.sign(tentativeValue, secret2), expectedBuffer = Buffer.from(expectedInput), inputBuffer = Buffer.from(input);
|
|
159244
159244
|
return expectedBuffer.length === inputBuffer.length && crypto.timingSafeEqual(expectedBuffer, inputBuffer) ? tentativeValue : false;
|
|
159245
159245
|
};
|
|
159246
159246
|
});
|
|
@@ -160231,14 +160231,14 @@ var require_response = __commonJS((exports, module) => {
|
|
|
160231
160231
|
};
|
|
160232
160232
|
res.cookie = function(name2, value, options8) {
|
|
160233
160233
|
var opts = { ...options8 };
|
|
160234
|
-
var
|
|
160234
|
+
var secret2 = this.req.secret;
|
|
160235
160235
|
var signed = opts.signed;
|
|
160236
|
-
if (signed && !
|
|
160236
|
+
if (signed && !secret2) {
|
|
160237
160237
|
throw new Error('cookieParser("secret") required for signed cookies');
|
|
160238
160238
|
}
|
|
160239
160239
|
var val = typeof value === "object" ? "j:" + JSON.stringify(value) : String(value);
|
|
160240
160240
|
if (signed) {
|
|
160241
|
-
val = "s:" + sign2(val,
|
|
160241
|
+
val = "s:" + sign2(val, secret2);
|
|
160242
160242
|
}
|
|
160243
160243
|
if (opts.maxAge != null) {
|
|
160244
160244
|
var maxAge = opts.maxAge - 0;
|
|
@@ -162752,7 +162752,7 @@ var require_dist3 = __commonJS((exports, module) => {
|
|
|
162752
162752
|
determineAgent: () => determineAgent
|
|
162753
162753
|
});
|
|
162754
162754
|
module.exports = __toCommonJS(src_exports);
|
|
162755
|
-
var
|
|
162755
|
+
var import_promises20 = __require("node:fs/promises");
|
|
162756
162756
|
var import_node_fs18 = __require("node:fs");
|
|
162757
162757
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
162758
162758
|
var CURSOR2 = "cursor";
|
|
@@ -162810,7 +162810,7 @@ var require_dist3 = __commonJS((exports, module) => {
|
|
|
162810
162810
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
162811
162811
|
}
|
|
162812
162812
|
try {
|
|
162813
|
-
await (0,
|
|
162813
|
+
await (0, import_promises20.access)(DEVIN_LOCAL_PATH, import_node_fs18.constants.F_OK);
|
|
162814
162814
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
162815
162815
|
} catch (error48) {}
|
|
162816
162816
|
return { isAgent: false, agent: undefined };
|
|
@@ -186055,7 +186055,7 @@ var DeployFunctionsResponseSchema = exports_external.object({
|
|
|
186055
186055
|
var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
|
|
186056
186056
|
var FunctionLogEntrySchema = exports_external.object({
|
|
186057
186057
|
time: exports_external.string(),
|
|
186058
|
-
level:
|
|
186058
|
+
level: LogLevelSchema,
|
|
186059
186059
|
message: exports_external.string()
|
|
186060
186060
|
});
|
|
186061
186061
|
var FunctionLogsResponseSchema = exports_external.array(FunctionLogEntrySchema);
|
|
@@ -186673,6 +186673,85 @@ async function getUserInfo(accessToken) {
|
|
|
186673
186673
|
}
|
|
186674
186674
|
return result.data;
|
|
186675
186675
|
}
|
|
186676
|
+
// src/core/resources/secret/schema.ts
|
|
186677
|
+
var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
|
|
186678
|
+
var SetSecretsResponseSchema = exports_external.object({
|
|
186679
|
+
success: exports_external.boolean()
|
|
186680
|
+
});
|
|
186681
|
+
var DeleteSecretResponseSchema = exports_external.object({
|
|
186682
|
+
success: exports_external.boolean()
|
|
186683
|
+
});
|
|
186684
|
+
|
|
186685
|
+
// src/core/resources/secret/api.ts
|
|
186686
|
+
async function listSecrets() {
|
|
186687
|
+
const appClient = getAppClient();
|
|
186688
|
+
let response;
|
|
186689
|
+
try {
|
|
186690
|
+
response = await appClient.get("secrets");
|
|
186691
|
+
} catch (error48) {
|
|
186692
|
+
throw await ApiError.fromHttpError(error48, "listing secrets");
|
|
186693
|
+
}
|
|
186694
|
+
const result = ListSecretsResponseSchema.safeParse(await response.json());
|
|
186695
|
+
if (!result.success) {
|
|
186696
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
186697
|
+
}
|
|
186698
|
+
return result.data;
|
|
186699
|
+
}
|
|
186700
|
+
async function setSecrets(secrets) {
|
|
186701
|
+
const appClient = getAppClient();
|
|
186702
|
+
let response;
|
|
186703
|
+
try {
|
|
186704
|
+
response = await appClient.post("secrets", {
|
|
186705
|
+
json: secrets
|
|
186706
|
+
});
|
|
186707
|
+
} catch (error48) {
|
|
186708
|
+
throw await ApiError.fromHttpError(error48, "setting secrets");
|
|
186709
|
+
}
|
|
186710
|
+
const result = SetSecretsResponseSchema.safeParse(await response.json());
|
|
186711
|
+
if (!result.success) {
|
|
186712
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
186713
|
+
}
|
|
186714
|
+
return result.data;
|
|
186715
|
+
}
|
|
186716
|
+
async function deleteSecret(name2) {
|
|
186717
|
+
const appClient = getAppClient();
|
|
186718
|
+
let response;
|
|
186719
|
+
try {
|
|
186720
|
+
response = await appClient.delete("secrets", {
|
|
186721
|
+
searchParams: { secret_name: name2 }
|
|
186722
|
+
});
|
|
186723
|
+
} catch (error48) {
|
|
186724
|
+
throw await ApiError.fromHttpError(error48, "deleting secret");
|
|
186725
|
+
}
|
|
186726
|
+
const result = DeleteSecretResponseSchema.safeParse(await response.json());
|
|
186727
|
+
if (!result.success) {
|
|
186728
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
186729
|
+
}
|
|
186730
|
+
return result.data;
|
|
186731
|
+
}
|
|
186732
|
+
// src/core/resources/secret/env.ts
|
|
186733
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
186734
|
+
async function parseEnvFile(filePath) {
|
|
186735
|
+
const content = await readFile2(filePath, "utf-8");
|
|
186736
|
+
const secrets = {};
|
|
186737
|
+
for (const line of content.split(`
|
|
186738
|
+
`)) {
|
|
186739
|
+
const trimmed = line.trim();
|
|
186740
|
+
if (trimmed === "" || trimmed.startsWith("#")) {
|
|
186741
|
+
continue;
|
|
186742
|
+
}
|
|
186743
|
+
const eqIndex = trimmed.indexOf("=");
|
|
186744
|
+
if (eqIndex === -1) {
|
|
186745
|
+
continue;
|
|
186746
|
+
}
|
|
186747
|
+
const key = trimmed.slice(0, eqIndex).trim();
|
|
186748
|
+
const value = trimmed.slice(eqIndex + 1);
|
|
186749
|
+
if (key) {
|
|
186750
|
+
secrets[key] = value;
|
|
186751
|
+
}
|
|
186752
|
+
}
|
|
186753
|
+
return secrets;
|
|
186754
|
+
}
|
|
186676
186755
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
186677
186756
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
186678
186757
|
var wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`;
|
|
@@ -186860,7 +186939,7 @@ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.
|
|
|
186860
186939
|
const terminatorPosition = argv.indexOf("--");
|
|
186861
186940
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
186862
186941
|
}
|
|
186863
|
-
var { env } = process5;
|
|
186942
|
+
var { env: env2 } = process5;
|
|
186864
186943
|
var flagForceColor;
|
|
186865
186944
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
186866
186945
|
flagForceColor = 0;
|
|
@@ -186868,14 +186947,14 @@ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || has
|
|
|
186868
186947
|
flagForceColor = 1;
|
|
186869
186948
|
}
|
|
186870
186949
|
function envForceColor() {
|
|
186871
|
-
if ("FORCE_COLOR" in
|
|
186872
|
-
if (
|
|
186950
|
+
if ("FORCE_COLOR" in env2) {
|
|
186951
|
+
if (env2.FORCE_COLOR === "true") {
|
|
186873
186952
|
return 1;
|
|
186874
186953
|
}
|
|
186875
|
-
if (
|
|
186954
|
+
if (env2.FORCE_COLOR === "false") {
|
|
186876
186955
|
return 0;
|
|
186877
186956
|
}
|
|
186878
|
-
return
|
|
186957
|
+
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
186879
186958
|
}
|
|
186880
186959
|
}
|
|
186881
186960
|
function translateLevel(level) {
|
|
@@ -186906,14 +186985,14 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
186906
186985
|
return 2;
|
|
186907
186986
|
}
|
|
186908
186987
|
}
|
|
186909
|
-
if ("TF_BUILD" in
|
|
186988
|
+
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
186910
186989
|
return 1;
|
|
186911
186990
|
}
|
|
186912
186991
|
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
186913
186992
|
return 0;
|
|
186914
186993
|
}
|
|
186915
186994
|
const min = forceColor || 0;
|
|
186916
|
-
if (
|
|
186995
|
+
if (env2.TERM === "dumb") {
|
|
186917
186996
|
return min;
|
|
186918
186997
|
}
|
|
186919
186998
|
if (process5.platform === "win32") {
|
|
@@ -186923,33 +187002,33 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
186923
187002
|
}
|
|
186924
187003
|
return 1;
|
|
186925
187004
|
}
|
|
186926
|
-
if ("CI" in
|
|
186927
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in
|
|
187005
|
+
if ("CI" in env2) {
|
|
187006
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env2))) {
|
|
186928
187007
|
return 3;
|
|
186929
187008
|
}
|
|
186930
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in
|
|
187009
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
|
|
186931
187010
|
return 1;
|
|
186932
187011
|
}
|
|
186933
187012
|
return min;
|
|
186934
187013
|
}
|
|
186935
|
-
if ("TEAMCITY_VERSION" in
|
|
186936
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(
|
|
187014
|
+
if ("TEAMCITY_VERSION" in env2) {
|
|
187015
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
186937
187016
|
}
|
|
186938
|
-
if (
|
|
187017
|
+
if (env2.COLORTERM === "truecolor") {
|
|
186939
187018
|
return 3;
|
|
186940
187019
|
}
|
|
186941
|
-
if (
|
|
187020
|
+
if (env2.TERM === "xterm-kitty") {
|
|
186942
187021
|
return 3;
|
|
186943
187022
|
}
|
|
186944
|
-
if (
|
|
187023
|
+
if (env2.TERM === "xterm-ghostty") {
|
|
186945
187024
|
return 3;
|
|
186946
187025
|
}
|
|
186947
|
-
if (
|
|
187026
|
+
if (env2.TERM === "wezterm") {
|
|
186948
187027
|
return 3;
|
|
186949
187028
|
}
|
|
186950
|
-
if ("TERM_PROGRAM" in
|
|
186951
|
-
const version2 = Number.parseInt((
|
|
186952
|
-
switch (
|
|
187029
|
+
if ("TERM_PROGRAM" in env2) {
|
|
187030
|
+
const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
187031
|
+
switch (env2.TERM_PROGRAM) {
|
|
186953
187032
|
case "iTerm.app": {
|
|
186954
187033
|
return version2 >= 3 ? 3 : 2;
|
|
186955
187034
|
}
|
|
@@ -186958,13 +187037,13 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
186958
187037
|
}
|
|
186959
187038
|
}
|
|
186960
187039
|
}
|
|
186961
|
-
if (/-256(color)?$/i.test(
|
|
187040
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
186962
187041
|
return 2;
|
|
186963
187042
|
}
|
|
186964
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
187043
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
186965
187044
|
return 1;
|
|
186966
187045
|
}
|
|
186967
|
-
if ("COLORTERM" in
|
|
187046
|
+
if ("COLORTERM" in env2) {
|
|
186968
187047
|
return 1;
|
|
186969
187048
|
}
|
|
186970
187049
|
return min;
|
|
@@ -187803,12 +187882,12 @@ var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
187803
187882
|
// node_modules/is-unicode-supported/index.js
|
|
187804
187883
|
import process7 from "node:process";
|
|
187805
187884
|
function isUnicodeSupported() {
|
|
187806
|
-
const { env:
|
|
187807
|
-
const { TERM, TERM_PROGRAM } =
|
|
187885
|
+
const { env: env3 } = process7;
|
|
187886
|
+
const { TERM, TERM_PROGRAM } = env3;
|
|
187808
187887
|
if (process7.platform !== "win32") {
|
|
187809
187888
|
return TERM !== "linux";
|
|
187810
187889
|
}
|
|
187811
|
-
return Boolean(
|
|
187890
|
+
return Boolean(env3.WT_SESSION) || Boolean(env3.TERMINUS_SUBLIME) || env3.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env3.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
187812
187891
|
}
|
|
187813
187892
|
|
|
187814
187893
|
// node_modules/figures/index.js
|
|
@@ -188321,13 +188400,13 @@ import path12 from "node:path";
|
|
|
188321
188400
|
// node_modules/npm-run-path/node_modules/path-key/index.js
|
|
188322
188401
|
function pathKey(options = {}) {
|
|
188323
188402
|
const {
|
|
188324
|
-
env:
|
|
188403
|
+
env: env3 = process.env,
|
|
188325
188404
|
platform: platform6 = process.platform
|
|
188326
188405
|
} = options;
|
|
188327
188406
|
if (platform6 !== "win32") {
|
|
188328
188407
|
return "PATH";
|
|
188329
188408
|
}
|
|
188330
|
-
return Object.keys(
|
|
188409
|
+
return Object.keys(env3).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
188331
188410
|
}
|
|
188332
188411
|
|
|
188333
188412
|
// node_modules/npm-run-path/node_modules/unicorn-magic/node.js
|
|
@@ -188387,12 +188466,12 @@ var applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
|
188387
188466
|
result.push(pathPart);
|
|
188388
188467
|
}
|
|
188389
188468
|
};
|
|
188390
|
-
var npmRunPathEnv = ({ env:
|
|
188391
|
-
|
|
188392
|
-
const pathName = pathKey({ env:
|
|
188393
|
-
options.path =
|
|
188394
|
-
|
|
188395
|
-
return
|
|
188469
|
+
var npmRunPathEnv = ({ env: env3 = process8.env, ...options } = {}) => {
|
|
188470
|
+
env3 = { ...env3 };
|
|
188471
|
+
const pathName = pathKey({ env: env3 });
|
|
188472
|
+
options.path = env3[pathName];
|
|
188473
|
+
env3[pathName] = npmRunPath(options);
|
|
188474
|
+
return env3;
|
|
188396
188475
|
};
|
|
188397
188476
|
|
|
188398
188477
|
// node_modules/execa/lib/terminate/kill.js
|
|
@@ -189741,17 +189820,17 @@ var addDefaultOptions = ({
|
|
|
189741
189820
|
serialization
|
|
189742
189821
|
});
|
|
189743
189822
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath: nodePath2 }) => {
|
|
189744
|
-
const
|
|
189823
|
+
const env3 = extendEnv ? { ...process10.env, ...envOption } : envOption;
|
|
189745
189824
|
if (preferLocal || node) {
|
|
189746
189825
|
return npmRunPathEnv({
|
|
189747
|
-
env:
|
|
189826
|
+
env: env3,
|
|
189748
189827
|
cwd: localDirectory,
|
|
189749
189828
|
execPath: nodePath2,
|
|
189750
189829
|
preferLocal,
|
|
189751
189830
|
addExecPath: node
|
|
189752
189831
|
});
|
|
189753
189832
|
}
|
|
189754
|
-
return
|
|
189833
|
+
return env3;
|
|
189755
189834
|
};
|
|
189756
189835
|
|
|
189757
189836
|
// node_modules/execa/lib/arguments/shell.js
|
|
@@ -193958,7 +194037,7 @@ var {
|
|
|
193958
194037
|
// package.json
|
|
193959
194038
|
var package_default = {
|
|
193960
194039
|
name: "base44",
|
|
193961
|
-
version: "0.0.
|
|
194040
|
+
version: "0.0.35",
|
|
193962
194041
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
193963
194042
|
type: "module",
|
|
193964
194043
|
bin: {
|
|
@@ -195655,6 +195734,113 @@ function getLogsCommand(context) {
|
|
|
195655
195734
|
});
|
|
195656
195735
|
}
|
|
195657
195736
|
|
|
195737
|
+
// src/cli/commands/secrets/delete.ts
|
|
195738
|
+
async function deleteSecretsAction(keys) {
|
|
195739
|
+
if (keys.length === 0) {
|
|
195740
|
+
throw new InvalidInputError("Provide one or more secret names. Example: base44 secrets delete KEY1 KEY2");
|
|
195741
|
+
}
|
|
195742
|
+
for (const key of keys) {
|
|
195743
|
+
await runTask(`Deleting secret "${key}"`, async () => {
|
|
195744
|
+
return await deleteSecret(key);
|
|
195745
|
+
}, {
|
|
195746
|
+
successMessage: `Secret "${key}" deleted`,
|
|
195747
|
+
errorMessage: `Failed to delete secret "${key}"`
|
|
195748
|
+
});
|
|
195749
|
+
}
|
|
195750
|
+
R2.info(`Deleted: ${keys.join(", ")}`);
|
|
195751
|
+
return {
|
|
195752
|
+
outroMessage: "Secrets deleted. Your app will automatically redeploy with the updated values."
|
|
195753
|
+
};
|
|
195754
|
+
}
|
|
195755
|
+
function getSecretsDeleteCommand(context) {
|
|
195756
|
+
return new Command("delete").description("Delete one or more secrets").argument("[keys...]", "Secret name(s) to delete").action(async (keys) => {
|
|
195757
|
+
await runCommand(() => deleteSecretsAction(keys), { requireAuth: true }, context);
|
|
195758
|
+
});
|
|
195759
|
+
}
|
|
195760
|
+
|
|
195761
|
+
// src/cli/commands/secrets/list.ts
|
|
195762
|
+
async function listSecretsAction() {
|
|
195763
|
+
const secrets = await runTask("Fetching secrets from Base44", async () => {
|
|
195764
|
+
return await listSecrets();
|
|
195765
|
+
}, {
|
|
195766
|
+
successMessage: "Secrets fetched successfully",
|
|
195767
|
+
errorMessage: "Failed to fetch secrets"
|
|
195768
|
+
});
|
|
195769
|
+
const names = Object.keys(secrets);
|
|
195770
|
+
if (names.length === 0) {
|
|
195771
|
+
return { outroMessage: "No secrets configured." };
|
|
195772
|
+
}
|
|
195773
|
+
for (const [name2, maskedValue] of Object.entries(secrets)) {
|
|
195774
|
+
R2.info(`${name2} = ${maskedValue}`);
|
|
195775
|
+
}
|
|
195776
|
+
return {
|
|
195777
|
+
outroMessage: `Found ${names.length} secret${names.length === 1 ? "" : "s"}.`
|
|
195778
|
+
};
|
|
195779
|
+
}
|
|
195780
|
+
function getSecretsListCommand(context) {
|
|
195781
|
+
return new Command("list").description("List secret names (values are masked)").action(async () => {
|
|
195782
|
+
await runCommand(listSecretsAction, { requireAuth: true }, context);
|
|
195783
|
+
});
|
|
195784
|
+
}
|
|
195785
|
+
|
|
195786
|
+
// src/cli/commands/secrets/set.ts
|
|
195787
|
+
function parseEntries(entries) {
|
|
195788
|
+
const secrets = {};
|
|
195789
|
+
for (const entry of entries) {
|
|
195790
|
+
const eqIndex = entry.indexOf("=");
|
|
195791
|
+
if (eqIndex === -1) {
|
|
195792
|
+
throw new InvalidInputError(`Invalid format: "${entry}". Expected KEY=VALUE.`);
|
|
195793
|
+
}
|
|
195794
|
+
const key = entry.slice(0, eqIndex);
|
|
195795
|
+
const value = entry.slice(eqIndex + 1);
|
|
195796
|
+
if (!key) {
|
|
195797
|
+
throw new InvalidInputError(`Invalid format: "${entry}". Key cannot be empty.`);
|
|
195798
|
+
}
|
|
195799
|
+
secrets[key] = value;
|
|
195800
|
+
}
|
|
195801
|
+
return secrets;
|
|
195802
|
+
}
|
|
195803
|
+
async function setSecretsAction(entries, options) {
|
|
195804
|
+
const hasEntries = entries.length > 0;
|
|
195805
|
+
const hasEnvFile = Boolean(options.envFile);
|
|
195806
|
+
if (!hasEntries && !hasEnvFile) {
|
|
195807
|
+
throw new InvalidInputError("Provide KEY=VALUE pairs or use --env-file. Example: base44 secrets set KEY1=VALUE1 KEY2=VALUE2");
|
|
195808
|
+
}
|
|
195809
|
+
if (hasEntries && hasEnvFile) {
|
|
195810
|
+
throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
|
|
195811
|
+
}
|
|
195812
|
+
let secrets;
|
|
195813
|
+
if (hasEnvFile) {
|
|
195814
|
+
secrets = await parseEnvFile(options.envFile);
|
|
195815
|
+
if (Object.keys(secrets).length === 0) {
|
|
195816
|
+
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
195817
|
+
}
|
|
195818
|
+
} else {
|
|
195819
|
+
secrets = parseEntries(entries);
|
|
195820
|
+
}
|
|
195821
|
+
const names = Object.keys(secrets);
|
|
195822
|
+
await runTask(`Setting ${names.length} secret${names.length === 1 ? "" : "s"}`, async () => {
|
|
195823
|
+
return await setSecrets(secrets);
|
|
195824
|
+
}, {
|
|
195825
|
+
successMessage: `${names.length} secret${names.length === 1 ? "" : "s"} set successfully`,
|
|
195826
|
+
errorMessage: "Failed to set secrets"
|
|
195827
|
+
});
|
|
195828
|
+
R2.info(`Set: ${names.join(", ")}`);
|
|
195829
|
+
return {
|
|
195830
|
+
outroMessage: "Secrets saved. Your app will automatically redeploy with the new values."
|
|
195831
|
+
};
|
|
195832
|
+
}
|
|
195833
|
+
function getSecretsSetCommand(context) {
|
|
195834
|
+
return new Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").action(async (entries, options) => {
|
|
195835
|
+
await runCommand(() => setSecretsAction(entries, options), { requireAuth: true }, context);
|
|
195836
|
+
});
|
|
195837
|
+
}
|
|
195838
|
+
|
|
195839
|
+
// src/cli/commands/secrets/index.ts
|
|
195840
|
+
function getSecretsCommand(context) {
|
|
195841
|
+
return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand(context)).addCommand(getSecretsSetCommand(context)).addCommand(getSecretsDeleteCommand(context));
|
|
195842
|
+
}
|
|
195843
|
+
|
|
195658
195844
|
// src/cli/commands/site/deploy.ts
|
|
195659
195845
|
import { resolve as resolve3 } from "node:path";
|
|
195660
195846
|
async function deployAction2(options) {
|
|
@@ -195770,9 +195956,9 @@ async function generateContent(input) {
|
|
|
195770
195956
|
`);
|
|
195771
195957
|
}
|
|
195772
195958
|
async function compileEntity(entity2) {
|
|
195773
|
-
const { name: name2, ...
|
|
195959
|
+
const { name: name2, ...schema9 } = entity2;
|
|
195774
195960
|
const jsonSchema = {
|
|
195775
|
-
...
|
|
195961
|
+
...schema9,
|
|
195776
195962
|
title: name2,
|
|
195777
195963
|
additionalProperties: false
|
|
195778
195964
|
};
|
|
@@ -196373,6 +196559,7 @@ function createProgram(context) {
|
|
|
196373
196559
|
program2.addCommand(getAgentsCommand(context));
|
|
196374
196560
|
program2.addCommand(getConnectorsCommand(context));
|
|
196375
196561
|
program2.addCommand(getFunctionsDeployCommand(context));
|
|
196562
|
+
program2.addCommand(getSecretsCommand(context));
|
|
196376
196563
|
program2.addCommand(getSiteCommand(context));
|
|
196377
196564
|
program2.addCommand(getTypesCommand(context));
|
|
196378
196565
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
@@ -200641,4 +200828,4 @@ export {
|
|
|
200641
200828
|
CLIExitError
|
|
200642
200829
|
};
|
|
200643
200830
|
|
|
200644
|
-
//# debugId=
|
|
200831
|
+
//# debugId=DB498D92DFB9A9A864756E2164756E21
|