@base44-preview/cli 0.1.7-pr.568.c08ba20 → 0.1.7-pr.585.083d2ac
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 +1558 -813
- package/dist/cli/index.js.map +16 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -31176,7 +31176,7 @@ function cleanDoc(doc2) {
|
|
|
31176
31176
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
31177
31177
|
}
|
|
31178
31178
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
31179
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
31179
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join26(replacement, currentDoc.split(`
|
|
31180
31180
|
`)) : currentDoc);
|
|
31181
31181
|
}
|
|
31182
31182
|
function canBreakFn(doc2) {
|
|
@@ -31256,7 +31256,7 @@ function indentIfBreak(contents, options) {
|
|
|
31256
31256
|
negate: options.negate
|
|
31257
31257
|
};
|
|
31258
31258
|
}
|
|
31259
|
-
function
|
|
31259
|
+
function join26(separator, docs) {
|
|
31260
31260
|
assertDoc(separator);
|
|
31261
31261
|
assertDocArray(docs);
|
|
31262
31262
|
const parts = [];
|
|
@@ -31967,7 +31967,7 @@ var init_doc = __esm(() => {
|
|
|
31967
31967
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
31968
31968
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
31969
31969
|
builders = {
|
|
31970
|
-
join:
|
|
31970
|
+
join: join26,
|
|
31971
31971
|
line,
|
|
31972
31972
|
softline,
|
|
31973
31973
|
hardline,
|
|
@@ -119578,11 +119578,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
119578
119578
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
119579
119579
|
}
|
|
119580
119580
|
function createSchema(SchemaConstructor, parameters) {
|
|
119581
|
-
const
|
|
119582
|
-
const subSchema = Object.create(
|
|
119581
|
+
const schema13 = new SchemaConstructor(parameters);
|
|
119582
|
+
const subSchema = Object.create(schema13);
|
|
119583
119583
|
for (const handlerKey of HANDLER_KEYS) {
|
|
119584
119584
|
if (handlerKey in parameters) {
|
|
119585
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
119585
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema13, Schema2.prototype[handlerKey].length);
|
|
119586
119586
|
}
|
|
119587
119587
|
}
|
|
119588
119588
|
return subSchema;
|
|
@@ -120385,7 +120385,7 @@ function skipVoid(str, ptr, banNewLines, banComments) {
|
|
|
120385
120385
|
ptr++;
|
|
120386
120386
|
return banComments || c24 !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
|
|
120387
120387
|
}
|
|
120388
|
-
function skipUntil(str, ptr,
|
|
120388
|
+
function skipUntil(str, ptr, sep2, end, banNewLines = false) {
|
|
120389
120389
|
if (!end) {
|
|
120390
120390
|
ptr = indexOfNewline(str, ptr);
|
|
120391
120391
|
return ptr < 0 ? str.length : ptr;
|
|
@@ -120394,7 +120394,7 @@ function skipUntil(str, ptr, sep, end, banNewLines = false) {
|
|
|
120394
120394
|
let c24 = str[i5];
|
|
120395
120395
|
if (c24 === "#") {
|
|
120396
120396
|
i5 = indexOfNewline(str, i5);
|
|
120397
|
-
} else if (c24 ===
|
|
120397
|
+
} else if (c24 === sep2) {
|
|
120398
120398
|
return i5 + 1;
|
|
120399
120399
|
} else if (c24 === end || banNewLines && (c24 === `
|
|
120400
120400
|
` || c24 === "\r" && str[i5 + 1] === `
|
|
@@ -120896,7 +120896,7 @@ function parse42(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
|
|
|
120896
120896
|
}
|
|
120897
120897
|
return res;
|
|
120898
120898
|
}
|
|
120899
|
-
async function
|
|
120899
|
+
async function readFile6(file2) {
|
|
120900
120900
|
if (isUrlString(file2)) {
|
|
120901
120901
|
file2 = new URL(file2);
|
|
120902
120902
|
}
|
|
@@ -121174,7 +121174,7 @@ function getDataProtocolModuleFormat(parsed) {
|
|
|
121174
121174
|
const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null];
|
|
121175
121175
|
return mimeToFormat(mime);
|
|
121176
121176
|
}
|
|
121177
|
-
function
|
|
121177
|
+
function extname2(url3) {
|
|
121178
121178
|
const pathname = url3.pathname;
|
|
121179
121179
|
let index = pathname.length;
|
|
121180
121180
|
while (index--) {
|
|
@@ -121189,7 +121189,7 @@ function extname(url3) {
|
|
|
121189
121189
|
return "";
|
|
121190
121190
|
}
|
|
121191
121191
|
function getFileProtocolModuleFormat(url3, _context, ignoreErrors) {
|
|
121192
|
-
const value =
|
|
121192
|
+
const value = extname2(url3);
|
|
121193
121193
|
if (value === ".js") {
|
|
121194
121194
|
const packageType = getPackageType(url3);
|
|
121195
121195
|
if (packageType !== "none") {
|
|
@@ -121650,8 +121650,8 @@ function packageResolve(specifier, base, conditions) {
|
|
|
121650
121650
|
let packageJsonPath = fileURLToPath42(packageJsonUrl);
|
|
121651
121651
|
let lastPath;
|
|
121652
121652
|
do {
|
|
121653
|
-
const
|
|
121654
|
-
if (!
|
|
121653
|
+
const stat22 = tryStatSync(packageJsonPath.slice(0, -13));
|
|
121654
|
+
if (!stat22 || !stat22.isDirectory()) {
|
|
121655
121655
|
lastPath = packageJsonPath;
|
|
121656
121656
|
packageJsonUrl = new URL((isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json", packageJsonUrl);
|
|
121657
121657
|
packageJsonPath = fileURLToPath42(packageJsonUrl);
|
|
@@ -122922,9 +122922,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122922
122922
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
122923
122923
|
}
|
|
122924
122924
|
if (optionInfo.exception) {
|
|
122925
|
-
parameters.validate = (value,
|
|
122925
|
+
parameters.validate = (value, schema13, utils3) => optionInfo.exception(value) || schema13.validate(value, utils3);
|
|
122926
122926
|
} else {
|
|
122927
|
-
parameters.validate = (value,
|
|
122927
|
+
parameters.validate = (value, schema13, utils3) => value === undefined || schema13.validate(value, utils3);
|
|
122928
122928
|
}
|
|
122929
122929
|
if (optionInfo.redirect) {
|
|
122930
122930
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -122939,7 +122939,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
122939
122939
|
}
|
|
122940
122940
|
if (isCLI && !optionInfo.array) {
|
|
122941
122941
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
122942
|
-
parameters.preprocess = (value,
|
|
122942
|
+
parameters.preprocess = (value, schema13, utils3) => schema13.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
122943
122943
|
}
|
|
122944
122944
|
return optionInfo.array ? ArraySchema.create({
|
|
122945
122945
|
...isCLI ? {
|
|
@@ -123904,14 +123904,14 @@ async function printToDoc(originalText, options8) {
|
|
|
123904
123904
|
async function printDocToString2(doc2, options8) {
|
|
123905
123905
|
return printDocToStringWithoutNormalizeOptions(doc2, await normalize_format_options_default(options8));
|
|
123906
123906
|
}
|
|
123907
|
-
function createParsersAndPrinters(
|
|
123907
|
+
function createParsersAndPrinters(modules2) {
|
|
123908
123908
|
const parsers2 = /* @__PURE__ */ Object.create(null);
|
|
123909
123909
|
const printers2 = /* @__PURE__ */ Object.create(null);
|
|
123910
123910
|
for (const {
|
|
123911
123911
|
importPlugin: importPlugin2,
|
|
123912
123912
|
parsers: parserNames = [],
|
|
123913
123913
|
printers: printerNames = []
|
|
123914
|
-
} of
|
|
123914
|
+
} of modules2) {
|
|
123915
123915
|
const loadPlugin2 = async () => {
|
|
123916
123916
|
const plugin = await importPlugin2();
|
|
123917
123917
|
Object.assign(parsers2, plugin.parsers);
|
|
@@ -124516,9 +124516,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124516
124516
|
};
|
|
124517
124517
|
applyNormalization();
|
|
124518
124518
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
124519
|
-
const
|
|
124519
|
+
const schema13 = this._utils.schemas[key2];
|
|
124520
124520
|
if (!(key2 in newOptions)) {
|
|
124521
|
-
const defaultResult = normalizeDefaultResult(
|
|
124521
|
+
const defaultResult = normalizeDefaultResult(schema13.default(this._utils));
|
|
124522
124522
|
if ("value" in defaultResult) {
|
|
124523
124523
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
124524
124524
|
}
|
|
@@ -124529,13 +124529,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124529
124529
|
if (!(key2 in newOptions)) {
|
|
124530
124530
|
continue;
|
|
124531
124531
|
}
|
|
124532
|
-
const
|
|
124532
|
+
const schema13 = this._utils.schemas[key2];
|
|
124533
124533
|
const value = newOptions[key2];
|
|
124534
|
-
const newValue =
|
|
124534
|
+
const newValue = schema13.postprocess(value, this._utils);
|
|
124535
124535
|
if (newValue === VALUE_UNCHANGED) {
|
|
124536
124536
|
continue;
|
|
124537
124537
|
}
|
|
124538
|
-
this._applyValidation(newValue, key2,
|
|
124538
|
+
this._applyValidation(newValue, key2, schema13);
|
|
124539
124539
|
newOptions[key2] = newValue;
|
|
124540
124540
|
}
|
|
124541
124541
|
this._applyPostprocess(newOptions);
|
|
@@ -124546,14 +124546,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124546
124546
|
const transferredOptionsArray = [];
|
|
124547
124547
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
124548
124548
|
for (const key2 of knownKeys) {
|
|
124549
|
-
const
|
|
124550
|
-
const value =
|
|
124551
|
-
this._applyValidation(value, key2,
|
|
124549
|
+
const schema13 = this._utils.schemas[key2];
|
|
124550
|
+
const value = schema13.preprocess(options8[key2], this._utils);
|
|
124551
|
+
this._applyValidation(value, key2, schema13);
|
|
124552
124552
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
124553
124553
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
124554
124554
|
};
|
|
124555
124555
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
124556
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
124556
|
+
const deprecatedResult = normalizeDeprecatedResult(schema13.deprecated(currentValue, this._utils), value, true);
|
|
124557
124557
|
if (deprecatedResult === false) {
|
|
124558
124558
|
return;
|
|
124559
124559
|
}
|
|
@@ -124571,13 +124571,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124571
124571
|
}
|
|
124572
124572
|
}
|
|
124573
124573
|
};
|
|
124574
|
-
const forwardResult = normalizeForwardResult(
|
|
124574
|
+
const forwardResult = normalizeForwardResult(schema13.forward(value, this._utils), value);
|
|
124575
124575
|
forwardResult.forEach(appendTransferredOptions);
|
|
124576
|
-
const redirectResult = normalizeRedirectResult(
|
|
124576
|
+
const redirectResult = normalizeRedirectResult(schema13.redirect(value, this._utils), value);
|
|
124577
124577
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
124578
124578
|
if ("remain" in redirectResult) {
|
|
124579
124579
|
const remainingValue = redirectResult.remain;
|
|
124580
|
-
newOptions[key2] = key2 in newOptions ?
|
|
124580
|
+
newOptions[key2] = key2 in newOptions ? schema13.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
124581
124581
|
warnDeprecated({ value: remainingValue });
|
|
124582
124582
|
}
|
|
124583
124583
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -124605,8 +124605,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124605
124605
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
124606
124606
|
return { knownKeys, unknownKeys };
|
|
124607
124607
|
}
|
|
124608
|
-
_applyValidation(value, key2,
|
|
124609
|
-
const validateResult = normalizeValidateResult(
|
|
124608
|
+
_applyValidation(value, key2, schema13) {
|
|
124609
|
+
const validateResult = normalizeValidateResult(schema13.validate(value, this._utils), value);
|
|
124610
124610
|
if (validateResult !== true) {
|
|
124611
124611
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
124612
124612
|
}
|
|
@@ -124648,8 +124648,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc2,
|
|
|
124648
124648
|
for (const key2 of unknownKeys) {
|
|
124649
124649
|
const value = postprocessed.override[key2];
|
|
124650
124650
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
124651
|
-
const
|
|
124652
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
124651
|
+
const schema13 = this._utils.schemas[knownResultKey];
|
|
124652
|
+
this._applyValidation(knownResultValue, knownResultKey, schema13);
|
|
124653
124653
|
options8[knownResultKey] = knownResultValue;
|
|
124654
124654
|
});
|
|
124655
124655
|
}
|
|
@@ -128293,7 +128293,7 @@ var init_prettier = __esm(() => {
|
|
|
128293
128293
|
callSuccessCallback(callback, lstat2);
|
|
128294
128294
|
return;
|
|
128295
128295
|
}
|
|
128296
|
-
settings.fs.stat(path152, (statError,
|
|
128296
|
+
settings.fs.stat(path152, (statError, stat22) => {
|
|
128297
128297
|
if (statError !== null) {
|
|
128298
128298
|
if (settings.throwErrorOnBrokenSymbolicLink) {
|
|
128299
128299
|
callFailureCallback(callback, statError);
|
|
@@ -128303,9 +128303,9 @@ var init_prettier = __esm(() => {
|
|
|
128303
128303
|
return;
|
|
128304
128304
|
}
|
|
128305
128305
|
if (settings.markSymbolicLink) {
|
|
128306
|
-
|
|
128306
|
+
stat22.isSymbolicLink = () => true;
|
|
128307
128307
|
}
|
|
128308
|
-
callSuccessCallback(callback,
|
|
128308
|
+
callSuccessCallback(callback, stat22);
|
|
128309
128309
|
});
|
|
128310
128310
|
});
|
|
128311
128311
|
}
|
|
@@ -128328,11 +128328,11 @@ var init_prettier = __esm(() => {
|
|
|
128328
128328
|
return lstat2;
|
|
128329
128329
|
}
|
|
128330
128330
|
try {
|
|
128331
|
-
const
|
|
128331
|
+
const stat22 = settings.fs.statSync(path152);
|
|
128332
128332
|
if (settings.markSymbolicLink) {
|
|
128333
|
-
|
|
128333
|
+
stat22.isSymbolicLink = () => true;
|
|
128334
128334
|
}
|
|
128335
|
-
return
|
|
128335
|
+
return stat22;
|
|
128336
128336
|
} catch (error48) {
|
|
128337
128337
|
if (!settings.throwErrorOnBrokenSymbolicLink) {
|
|
128338
128338
|
return lstat2;
|
|
@@ -128390,14 +128390,14 @@ var init_prettier = __esm(() => {
|
|
|
128390
128390
|
var sync = require_sync7();
|
|
128391
128391
|
var settings_1 = require_settings5();
|
|
128392
128392
|
exports.Settings = settings_1.default;
|
|
128393
|
-
function
|
|
128393
|
+
function stat22(path152, optionsOrSettingsOrCallback, callback) {
|
|
128394
128394
|
if (typeof optionsOrSettingsOrCallback === "function") {
|
|
128395
128395
|
async.read(path152, getSettings(), optionsOrSettingsOrCallback);
|
|
128396
128396
|
return;
|
|
128397
128397
|
}
|
|
128398
128398
|
async.read(path152, getSettings(optionsOrSettingsOrCallback), callback);
|
|
128399
128399
|
}
|
|
128400
|
-
exports.stat =
|
|
128400
|
+
exports.stat = stat22;
|
|
128401
128401
|
function statSync22(path152, optionsOrSettings) {
|
|
128402
128402
|
const settings = getSettings(optionsOrSettings);
|
|
128403
128403
|
return sync.read(path152, settings);
|
|
@@ -128544,7 +128544,7 @@ var init_prettier = __esm(() => {
|
|
|
128544
128544
|
readdirWithFileTypes(directory, settings, callback);
|
|
128545
128545
|
return;
|
|
128546
128546
|
}
|
|
128547
|
-
|
|
128547
|
+
readdir3(directory, settings, callback);
|
|
128548
128548
|
}
|
|
128549
128549
|
exports.read = read3;
|
|
128550
128550
|
function readdirWithFileTypes(directory, settings, callback) {
|
|
@@ -128593,7 +128593,7 @@ var init_prettier = __esm(() => {
|
|
|
128593
128593
|
});
|
|
128594
128594
|
};
|
|
128595
128595
|
}
|
|
128596
|
-
function
|
|
128596
|
+
function readdir3(directory, settings, callback) {
|
|
128597
128597
|
settings.fs.readdir(directory, (readdirError, names) => {
|
|
128598
128598
|
if (readdirError !== null) {
|
|
128599
128599
|
callFailureCallback(callback, readdirError);
|
|
@@ -128628,7 +128628,7 @@ var init_prettier = __esm(() => {
|
|
|
128628
128628
|
});
|
|
128629
128629
|
});
|
|
128630
128630
|
}
|
|
128631
|
-
exports.readdir =
|
|
128631
|
+
exports.readdir = readdir3;
|
|
128632
128632
|
function callFailureCallback(callback, error48) {
|
|
128633
128633
|
callback(error48);
|
|
128634
128634
|
}
|
|
@@ -128649,7 +128649,7 @@ var init_prettier = __esm(() => {
|
|
|
128649
128649
|
if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
|
|
128650
128650
|
return readdirWithFileTypes(directory, settings);
|
|
128651
128651
|
}
|
|
128652
|
-
return
|
|
128652
|
+
return readdir3(directory, settings);
|
|
128653
128653
|
}
|
|
128654
128654
|
exports.read = read3;
|
|
128655
128655
|
function readdirWithFileTypes(directory, settings) {
|
|
@@ -128674,7 +128674,7 @@ var init_prettier = __esm(() => {
|
|
|
128674
128674
|
});
|
|
128675
128675
|
}
|
|
128676
128676
|
exports.readdirWithFileTypes = readdirWithFileTypes;
|
|
128677
|
-
function
|
|
128677
|
+
function readdir3(directory, settings) {
|
|
128678
128678
|
const names = settings.fs.readdirSync(directory);
|
|
128679
128679
|
return names.map((name2) => {
|
|
128680
128680
|
const entryPath = common2.joinPathSegments(directory, name2, settings.pathSegmentSeparator);
|
|
@@ -128690,7 +128690,7 @@ var init_prettier = __esm(() => {
|
|
|
128690
128690
|
return entry;
|
|
128691
128691
|
});
|
|
128692
128692
|
}
|
|
128693
|
-
exports.readdir =
|
|
128693
|
+
exports.readdir = readdir3;
|
|
128694
128694
|
}
|
|
128695
128695
|
});
|
|
128696
128696
|
require_fs42 = __commonJS2({
|
|
@@ -134690,7 +134690,7 @@ ${codeblock}`, options8);
|
|
|
134690
134690
|
"\\": "\\"
|
|
134691
134691
|
};
|
|
134692
134692
|
KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
134693
|
-
read_file_default =
|
|
134693
|
+
read_file_default = readFile6;
|
|
134694
134694
|
loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file2) {
|
|
134695
134695
|
const { prettier } = await readBunPackageJson(file2);
|
|
134696
134696
|
return prettier;
|
|
@@ -136881,7 +136881,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136881
136881
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
136882
136882
|
}
|
|
136883
136883
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
136884
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
136884
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join28(replacement, currentDoc.split(`
|
|
136885
136885
|
`)) : currentDoc);
|
|
136886
136886
|
}
|
|
136887
136887
|
function canBreakFn2(doc2) {
|
|
@@ -136967,7 +136967,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
136967
136967
|
negate: options8.negate
|
|
136968
136968
|
};
|
|
136969
136969
|
}
|
|
136970
|
-
function
|
|
136970
|
+
function join28(separator, docs) {
|
|
136971
136971
|
assertDoc2(separator);
|
|
136972
136972
|
assertDocArray2(docs);
|
|
136973
136973
|
const parts = [];
|
|
@@ -137632,7 +137632,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
137632
137632
|
}
|
|
137633
137633
|
}
|
|
137634
137634
|
var builders2 = {
|
|
137635
|
-
join:
|
|
137635
|
+
join: join28,
|
|
137636
137636
|
line: line3,
|
|
137637
137637
|
softline: softline2,
|
|
137638
137638
|
hardline: hardline4,
|
|
@@ -138287,11 +138287,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
138287
138287
|
var require_formatter = __commonJS((exports) => {
|
|
138288
138288
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
138289
138289
|
function adopt(value) {
|
|
138290
|
-
return value instanceof P9 ? value : new P9(function(
|
|
138291
|
-
|
|
138290
|
+
return value instanceof P9 ? value : new P9(function(resolve16) {
|
|
138291
|
+
resolve16(value);
|
|
138292
138292
|
});
|
|
138293
138293
|
}
|
|
138294
|
-
return new (P9 || (P9 = Promise))(function(
|
|
138294
|
+
return new (P9 || (P9 = Promise))(function(resolve16, reject) {
|
|
138295
138295
|
function fulfilled(value) {
|
|
138296
138296
|
try {
|
|
138297
138297
|
step(generator.next(value));
|
|
@@ -138307,7 +138307,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
138307
138307
|
}
|
|
138308
138308
|
}
|
|
138309
138309
|
function step(result) {
|
|
138310
|
-
result.done ?
|
|
138310
|
+
result.done ? resolve16(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
138311
138311
|
}
|
|
138312
138312
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
138313
138313
|
});
|
|
@@ -138362,23 +138362,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
138362
138362
|
exports.Parent = Symbol("Parent");
|
|
138363
138363
|
exports.Types = Symbol("Types");
|
|
138364
138364
|
exports.Intersection = Symbol("Intersection");
|
|
138365
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
138366
|
-
const parent =
|
|
138365
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema13) => {
|
|
138366
|
+
const parent = schema13[exports.Parent];
|
|
138367
138367
|
if (!parent) {
|
|
138368
|
-
return
|
|
138368
|
+
return schema13;
|
|
138369
138369
|
}
|
|
138370
138370
|
return (0, exports.getRootSchema)(parent);
|
|
138371
138371
|
});
|
|
138372
|
-
function isBoolean(
|
|
138373
|
-
return
|
|
138372
|
+
function isBoolean(schema13) {
|
|
138373
|
+
return schema13 === true || schema13 === false;
|
|
138374
138374
|
}
|
|
138375
138375
|
exports.isBoolean = isBoolean;
|
|
138376
|
-
function isPrimitive(
|
|
138377
|
-
return !(0, lodash_1.isPlainObject)(
|
|
138376
|
+
function isPrimitive(schema13) {
|
|
138377
|
+
return !(0, lodash_1.isPlainObject)(schema13);
|
|
138378
138378
|
}
|
|
138379
138379
|
exports.isPrimitive = isPrimitive;
|
|
138380
|
-
function isCompound(
|
|
138381
|
-
return Array.isArray(
|
|
138380
|
+
function isCompound(schema13) {
|
|
138381
|
+
return Array.isArray(schema13.type) || "anyOf" in schema13 || "oneOf" in schema13;
|
|
138382
138382
|
}
|
|
138383
138383
|
exports.isCompound = isCompound;
|
|
138384
138384
|
});
|
|
@@ -138605,9 +138605,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
138605
138605
|
var require_schema5 = __commonJS((exports, module) => {
|
|
138606
138606
|
var YAMLException = require_exception2();
|
|
138607
138607
|
var Type = require_type2();
|
|
138608
|
-
function compileList(
|
|
138608
|
+
function compileList(schema13, name2) {
|
|
138609
138609
|
var result = [];
|
|
138610
|
-
|
|
138610
|
+
schema13[name2].forEach(function(currentType) {
|
|
138611
138611
|
var newIndex = result.length;
|
|
138612
138612
|
result.forEach(function(previousType, previousIndex) {
|
|
138613
138613
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -140552,7 +140552,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140552
140552
|
"OFF"
|
|
140553
140553
|
];
|
|
140554
140554
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
140555
|
-
function compileStyleMap(
|
|
140555
|
+
function compileStyleMap(schema13, map2) {
|
|
140556
140556
|
var result, keys, index, length, tag, style, type;
|
|
140557
140557
|
if (map2 === null)
|
|
140558
140558
|
return {};
|
|
@@ -140564,7 +140564,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
140564
140564
|
if (tag.slice(0, 2) === "!!") {
|
|
140565
140565
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
140566
140566
|
}
|
|
140567
|
-
type =
|
|
140567
|
+
type = schema13.compiledTypeMap["fallback"][tag];
|
|
140568
140568
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
140569
140569
|
style = type.styleAliases[style];
|
|
140570
140570
|
}
|
|
@@ -141223,11 +141223,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141223
141223
|
function traverseArray(arr, callback, processed) {
|
|
141224
141224
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
141225
141225
|
}
|
|
141226
|
-
function traverseIntersection(
|
|
141227
|
-
if (typeof
|
|
141226
|
+
function traverseIntersection(schema13, callback, processed) {
|
|
141227
|
+
if (typeof schema13 !== "object" || !schema13) {
|
|
141228
141228
|
return;
|
|
141229
141229
|
}
|
|
141230
|
-
const r5 =
|
|
141230
|
+
const r5 = schema13;
|
|
141231
141231
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
141232
141232
|
if (!intersection2) {
|
|
141233
141233
|
return;
|
|
@@ -141236,60 +141236,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141236
141236
|
traverseArray(intersection2.allOf, callback, processed);
|
|
141237
141237
|
}
|
|
141238
141238
|
}
|
|
141239
|
-
function traverse(
|
|
141240
|
-
if (processed.has(
|
|
141239
|
+
function traverse(schema13, callback, processed = new Set, key2) {
|
|
141240
|
+
if (processed.has(schema13)) {
|
|
141241
141241
|
return;
|
|
141242
141242
|
}
|
|
141243
|
-
processed.add(
|
|
141244
|
-
callback(
|
|
141245
|
-
if (
|
|
141246
|
-
traverseArray(
|
|
141243
|
+
processed.add(schema13);
|
|
141244
|
+
callback(schema13, key2 !== null && key2 !== undefined ? key2 : null);
|
|
141245
|
+
if (schema13.anyOf) {
|
|
141246
|
+
traverseArray(schema13.anyOf, callback, processed);
|
|
141247
141247
|
}
|
|
141248
|
-
if (
|
|
141249
|
-
traverseArray(
|
|
141248
|
+
if (schema13.allOf) {
|
|
141249
|
+
traverseArray(schema13.allOf, callback, processed);
|
|
141250
141250
|
}
|
|
141251
|
-
if (
|
|
141252
|
-
traverseArray(
|
|
141251
|
+
if (schema13.oneOf) {
|
|
141252
|
+
traverseArray(schema13.oneOf, callback, processed);
|
|
141253
141253
|
}
|
|
141254
|
-
if (
|
|
141255
|
-
traverseObjectKeys(
|
|
141254
|
+
if (schema13.properties) {
|
|
141255
|
+
traverseObjectKeys(schema13.properties, callback, processed);
|
|
141256
141256
|
}
|
|
141257
|
-
if (
|
|
141258
|
-
traverseObjectKeys(
|
|
141257
|
+
if (schema13.patternProperties) {
|
|
141258
|
+
traverseObjectKeys(schema13.patternProperties, callback, processed);
|
|
141259
141259
|
}
|
|
141260
|
-
if (
|
|
141261
|
-
traverse(
|
|
141260
|
+
if (schema13.additionalProperties && typeof schema13.additionalProperties === "object") {
|
|
141261
|
+
traverse(schema13.additionalProperties, callback, processed);
|
|
141262
141262
|
}
|
|
141263
|
-
if (
|
|
141264
|
-
const { items } =
|
|
141263
|
+
if (schema13.items) {
|
|
141264
|
+
const { items } = schema13;
|
|
141265
141265
|
if (Array.isArray(items)) {
|
|
141266
141266
|
traverseArray(items, callback, processed);
|
|
141267
141267
|
} else {
|
|
141268
141268
|
traverse(items, callback, processed);
|
|
141269
141269
|
}
|
|
141270
141270
|
}
|
|
141271
|
-
if (
|
|
141272
|
-
traverse(
|
|
141271
|
+
if (schema13.additionalItems && typeof schema13.additionalItems === "object") {
|
|
141272
|
+
traverse(schema13.additionalItems, callback, processed);
|
|
141273
141273
|
}
|
|
141274
|
-
if (
|
|
141275
|
-
if (Array.isArray(
|
|
141276
|
-
traverseArray(
|
|
141274
|
+
if (schema13.dependencies) {
|
|
141275
|
+
if (Array.isArray(schema13.dependencies)) {
|
|
141276
|
+
traverseArray(schema13.dependencies, callback, processed);
|
|
141277
141277
|
} else {
|
|
141278
|
-
traverseObjectKeys(
|
|
141278
|
+
traverseObjectKeys(schema13.dependencies, callback, processed);
|
|
141279
141279
|
}
|
|
141280
141280
|
}
|
|
141281
|
-
if (
|
|
141282
|
-
traverseObjectKeys(
|
|
141281
|
+
if (schema13.definitions) {
|
|
141282
|
+
traverseObjectKeys(schema13.definitions, callback, processed);
|
|
141283
141283
|
}
|
|
141284
|
-
if (
|
|
141285
|
-
traverseObjectKeys(
|
|
141284
|
+
if (schema13.$defs) {
|
|
141285
|
+
traverseObjectKeys(schema13.$defs, callback, processed);
|
|
141286
141286
|
}
|
|
141287
|
-
if (
|
|
141288
|
-
traverse(
|
|
141287
|
+
if (schema13.not) {
|
|
141288
|
+
traverse(schema13.not, callback, processed);
|
|
141289
141289
|
}
|
|
141290
|
-
traverseIntersection(
|
|
141291
|
-
Object.keys(
|
|
141292
|
-
const child =
|
|
141290
|
+
traverseIntersection(schema13, callback, processed);
|
|
141291
|
+
Object.keys(schema13).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
141292
|
+
const child = schema13[key3];
|
|
141293
141293
|
if (child && typeof child === "object") {
|
|
141294
141294
|
traverseObjectKeys(child, callback, processed);
|
|
141295
141295
|
}
|
|
@@ -141371,14 +141371,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141371
141371
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
141372
141372
|
}
|
|
141373
141373
|
}
|
|
141374
|
-
function escapeBlockComment(
|
|
141374
|
+
function escapeBlockComment(schema13) {
|
|
141375
141375
|
const replacer = "* /";
|
|
141376
|
-
if (
|
|
141376
|
+
if (schema13 === null || typeof schema13 !== "object") {
|
|
141377
141377
|
return;
|
|
141378
141378
|
}
|
|
141379
|
-
for (const key2 of Object.keys(
|
|
141380
|
-
if (key2 === "description" && typeof
|
|
141381
|
-
|
|
141379
|
+
for (const key2 of Object.keys(schema13)) {
|
|
141380
|
+
if (key2 === "description" && typeof schema13[key2] === "string") {
|
|
141381
|
+
schema13[key2] = schema13[key2].replace(/\*\//g, replacer);
|
|
141382
141382
|
}
|
|
141383
141383
|
}
|
|
141384
141384
|
}
|
|
@@ -141390,45 +141390,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
141390
141390
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
141391
141391
|
}
|
|
141392
141392
|
exports.pathTransform = pathTransform;
|
|
141393
|
-
function maybeStripDefault(
|
|
141394
|
-
if (!("default" in
|
|
141395
|
-
return
|
|
141393
|
+
function maybeStripDefault(schema13) {
|
|
141394
|
+
if (!("default" in schema13)) {
|
|
141395
|
+
return schema13;
|
|
141396
141396
|
}
|
|
141397
|
-
switch (
|
|
141397
|
+
switch (schema13.type) {
|
|
141398
141398
|
case "array":
|
|
141399
|
-
if (Array.isArray(
|
|
141400
|
-
return
|
|
141399
|
+
if (Array.isArray(schema13.default)) {
|
|
141400
|
+
return schema13;
|
|
141401
141401
|
}
|
|
141402
141402
|
break;
|
|
141403
141403
|
case "boolean":
|
|
141404
|
-
if (typeof
|
|
141405
|
-
return
|
|
141404
|
+
if (typeof schema13.default === "boolean") {
|
|
141405
|
+
return schema13;
|
|
141406
141406
|
}
|
|
141407
141407
|
break;
|
|
141408
141408
|
case "integer":
|
|
141409
141409
|
case "number":
|
|
141410
|
-
if (typeof
|
|
141411
|
-
return
|
|
141410
|
+
if (typeof schema13.default === "number") {
|
|
141411
|
+
return schema13;
|
|
141412
141412
|
}
|
|
141413
141413
|
break;
|
|
141414
141414
|
case "string":
|
|
141415
|
-
if (typeof
|
|
141416
|
-
return
|
|
141415
|
+
if (typeof schema13.default === "string") {
|
|
141416
|
+
return schema13;
|
|
141417
141417
|
}
|
|
141418
141418
|
break;
|
|
141419
141419
|
case "null":
|
|
141420
|
-
if (
|
|
141421
|
-
return
|
|
141420
|
+
if (schema13.default === null) {
|
|
141421
|
+
return schema13;
|
|
141422
141422
|
}
|
|
141423
141423
|
break;
|
|
141424
141424
|
case "object":
|
|
141425
|
-
if ((0, lodash_1.isPlainObject)(
|
|
141426
|
-
return
|
|
141425
|
+
if ((0, lodash_1.isPlainObject)(schema13.default)) {
|
|
141426
|
+
return schema13;
|
|
141427
141427
|
}
|
|
141428
141428
|
break;
|
|
141429
141429
|
}
|
|
141430
|
-
delete
|
|
141431
|
-
return
|
|
141430
|
+
delete schema13.default;
|
|
141431
|
+
return schema13;
|
|
141432
141432
|
}
|
|
141433
141433
|
exports.maybeStripDefault = maybeStripDefault;
|
|
141434
141434
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -141442,11 +141442,11 @@ ${values.join(`
|
|
|
141442
141442
|
`);
|
|
141443
141443
|
}
|
|
141444
141444
|
exports.appendToDescription = appendToDescription;
|
|
141445
|
-
function isSchemaLike(
|
|
141446
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
141445
|
+
function isSchemaLike(schema13) {
|
|
141446
|
+
if (!(0, lodash_1.isPlainObject)(schema13)) {
|
|
141447
141447
|
return false;
|
|
141448
141448
|
}
|
|
141449
|
-
const parent =
|
|
141449
|
+
const parent = schema13[JSONSchema_1.Parent];
|
|
141450
141450
|
if (parent === null) {
|
|
141451
141451
|
return true;
|
|
141452
141452
|
}
|
|
@@ -141463,7 +141463,7 @@ ${values.join(`
|
|
|
141463
141463
|
"properties",
|
|
141464
141464
|
"required"
|
|
141465
141465
|
];
|
|
141466
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
141466
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema13)) {
|
|
141467
141467
|
return false;
|
|
141468
141468
|
}
|
|
141469
141469
|
return true;
|
|
@@ -141761,13 +141761,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141761
141761
|
exports.typesOfSchema = undefined;
|
|
141762
141762
|
var lodash_1 = require_lodash8();
|
|
141763
141763
|
var JSONSchema_1 = require_JSONSchema();
|
|
141764
|
-
function typesOfSchema(
|
|
141765
|
-
if (
|
|
141764
|
+
function typesOfSchema(schema13) {
|
|
141765
|
+
if (schema13.tsType) {
|
|
141766
141766
|
return new Set(["CUSTOM_TYPE"]);
|
|
141767
141767
|
}
|
|
141768
141768
|
const matchedTypes = new Set;
|
|
141769
141769
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
141770
|
-
if (f7(
|
|
141770
|
+
if (f7(schema13)) {
|
|
141771
141771
|
matchedTypes.add(schemaType);
|
|
141772
141772
|
}
|
|
141773
141773
|
}
|
|
@@ -141778,26 +141778,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141778
141778
|
}
|
|
141779
141779
|
exports.typesOfSchema = typesOfSchema;
|
|
141780
141780
|
var matchers = {
|
|
141781
|
-
ALL_OF(
|
|
141782
|
-
return "allOf" in
|
|
141781
|
+
ALL_OF(schema13) {
|
|
141782
|
+
return "allOf" in schema13;
|
|
141783
141783
|
},
|
|
141784
|
-
ANY(
|
|
141785
|
-
if (Object.keys(
|
|
141784
|
+
ANY(schema13) {
|
|
141785
|
+
if (Object.keys(schema13).length === 0) {
|
|
141786
141786
|
return true;
|
|
141787
141787
|
}
|
|
141788
|
-
return
|
|
141788
|
+
return schema13.type === "any";
|
|
141789
141789
|
},
|
|
141790
|
-
ANY_OF(
|
|
141791
|
-
return "anyOf" in
|
|
141790
|
+
ANY_OF(schema13) {
|
|
141791
|
+
return "anyOf" in schema13;
|
|
141792
141792
|
},
|
|
141793
|
-
BOOLEAN(
|
|
141794
|
-
if ("enum" in
|
|
141793
|
+
BOOLEAN(schema13) {
|
|
141794
|
+
if ("enum" in schema13) {
|
|
141795
141795
|
return false;
|
|
141796
141796
|
}
|
|
141797
|
-
if (
|
|
141797
|
+
if (schema13.type === "boolean") {
|
|
141798
141798
|
return true;
|
|
141799
141799
|
}
|
|
141800
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141800
|
+
if (!(0, JSONSchema_1.isCompound)(schema13) && typeof schema13.default === "boolean") {
|
|
141801
141801
|
return true;
|
|
141802
141802
|
}
|
|
141803
141803
|
return false;
|
|
@@ -141805,74 +141805,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
141805
141805
|
CUSTOM_TYPE() {
|
|
141806
141806
|
return false;
|
|
141807
141807
|
},
|
|
141808
|
-
NAMED_ENUM(
|
|
141809
|
-
return "enum" in
|
|
141808
|
+
NAMED_ENUM(schema13) {
|
|
141809
|
+
return "enum" in schema13 && "tsEnumNames" in schema13;
|
|
141810
141810
|
},
|
|
141811
|
-
NAMED_SCHEMA(
|
|
141812
|
-
return "$id" in
|
|
141811
|
+
NAMED_SCHEMA(schema13) {
|
|
141812
|
+
return "$id" in schema13 && (("patternProperties" in schema13) || ("properties" in schema13));
|
|
141813
141813
|
},
|
|
141814
|
-
NEVER(
|
|
141815
|
-
return
|
|
141814
|
+
NEVER(schema13) {
|
|
141815
|
+
return schema13 === false;
|
|
141816
141816
|
},
|
|
141817
|
-
NULL(
|
|
141818
|
-
return
|
|
141817
|
+
NULL(schema13) {
|
|
141818
|
+
return schema13.type === "null";
|
|
141819
141819
|
},
|
|
141820
|
-
NUMBER(
|
|
141821
|
-
if ("enum" in
|
|
141820
|
+
NUMBER(schema13) {
|
|
141821
|
+
if ("enum" in schema13) {
|
|
141822
141822
|
return false;
|
|
141823
141823
|
}
|
|
141824
|
-
if (
|
|
141824
|
+
if (schema13.type === "integer" || schema13.type === "number") {
|
|
141825
141825
|
return true;
|
|
141826
141826
|
}
|
|
141827
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141827
|
+
if (!(0, JSONSchema_1.isCompound)(schema13) && typeof schema13.default === "number") {
|
|
141828
141828
|
return true;
|
|
141829
141829
|
}
|
|
141830
141830
|
return false;
|
|
141831
141831
|
},
|
|
141832
|
-
OBJECT(
|
|
141833
|
-
return
|
|
141832
|
+
OBJECT(schema13) {
|
|
141833
|
+
return schema13.type === "object" && !(0, lodash_1.isPlainObject)(schema13.additionalProperties) && !schema13.allOf && !schema13.anyOf && !schema13.oneOf && !schema13.patternProperties && !schema13.properties && !schema13.required;
|
|
141834
141834
|
},
|
|
141835
|
-
ONE_OF(
|
|
141836
|
-
return "oneOf" in
|
|
141835
|
+
ONE_OF(schema13) {
|
|
141836
|
+
return "oneOf" in schema13;
|
|
141837
141837
|
},
|
|
141838
|
-
REFERENCE(
|
|
141839
|
-
return "$ref" in
|
|
141838
|
+
REFERENCE(schema13) {
|
|
141839
|
+
return "$ref" in schema13;
|
|
141840
141840
|
},
|
|
141841
|
-
STRING(
|
|
141842
|
-
if ("enum" in
|
|
141841
|
+
STRING(schema13) {
|
|
141842
|
+
if ("enum" in schema13) {
|
|
141843
141843
|
return false;
|
|
141844
141844
|
}
|
|
141845
|
-
if (
|
|
141845
|
+
if (schema13.type === "string") {
|
|
141846
141846
|
return true;
|
|
141847
141847
|
}
|
|
141848
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
141848
|
+
if (!(0, JSONSchema_1.isCompound)(schema13) && typeof schema13.default === "string") {
|
|
141849
141849
|
return true;
|
|
141850
141850
|
}
|
|
141851
141851
|
return false;
|
|
141852
141852
|
},
|
|
141853
|
-
TYPED_ARRAY(
|
|
141854
|
-
if (
|
|
141853
|
+
TYPED_ARRAY(schema13) {
|
|
141854
|
+
if (schema13.type && schema13.type !== "array") {
|
|
141855
141855
|
return false;
|
|
141856
141856
|
}
|
|
141857
|
-
return "items" in
|
|
141857
|
+
return "items" in schema13;
|
|
141858
141858
|
},
|
|
141859
|
-
UNION(
|
|
141860
|
-
return Array.isArray(
|
|
141859
|
+
UNION(schema13) {
|
|
141860
|
+
return Array.isArray(schema13.type);
|
|
141861
141861
|
},
|
|
141862
|
-
UNNAMED_ENUM(
|
|
141863
|
-
if ("tsEnumNames" in
|
|
141862
|
+
UNNAMED_ENUM(schema13) {
|
|
141863
|
+
if ("tsEnumNames" in schema13) {
|
|
141864
141864
|
return false;
|
|
141865
141865
|
}
|
|
141866
|
-
if (
|
|
141866
|
+
if (schema13.type && schema13.type !== "boolean" && schema13.type !== "integer" && schema13.type !== "number" && schema13.type !== "string") {
|
|
141867
141867
|
return false;
|
|
141868
141868
|
}
|
|
141869
|
-
return "enum" in
|
|
141869
|
+
return "enum" in schema13;
|
|
141870
141870
|
},
|
|
141871
141871
|
UNNAMED_SCHEMA() {
|
|
141872
141872
|
return false;
|
|
141873
141873
|
},
|
|
141874
|
-
UNTYPED_ARRAY(
|
|
141875
|
-
return
|
|
141874
|
+
UNTYPED_ARRAY(schema13) {
|
|
141875
|
+
return schema13.type === "array" && !("items" in schema13);
|
|
141876
141876
|
}
|
|
141877
141877
|
};
|
|
141878
141878
|
});
|
|
@@ -141883,10 +141883,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141883
141883
|
exports.applySchemaTyping = undefined;
|
|
141884
141884
|
var JSONSchema_1 = require_JSONSchema();
|
|
141885
141885
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
141886
|
-
function applySchemaTyping(
|
|
141886
|
+
function applySchemaTyping(schema13) {
|
|
141887
141887
|
var _a7;
|
|
141888
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
141889
|
-
Object.defineProperty(
|
|
141888
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema13);
|
|
141889
|
+
Object.defineProperty(schema13, JSONSchema_1.Types, {
|
|
141890
141890
|
enumerable: false,
|
|
141891
141891
|
value: types,
|
|
141892
141892
|
writable: false
|
|
@@ -141895,23 +141895,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
141895
141895
|
return;
|
|
141896
141896
|
}
|
|
141897
141897
|
const intersection2 = {
|
|
141898
|
-
[JSONSchema_1.Parent]:
|
|
141898
|
+
[JSONSchema_1.Parent]: schema13,
|
|
141899
141899
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
141900
|
-
$id:
|
|
141901
|
-
description:
|
|
141902
|
-
name:
|
|
141903
|
-
title:
|
|
141904
|
-
allOf: (_a7 =
|
|
141900
|
+
$id: schema13.$id,
|
|
141901
|
+
description: schema13.description,
|
|
141902
|
+
name: schema13.name,
|
|
141903
|
+
title: schema13.title,
|
|
141904
|
+
allOf: (_a7 = schema13.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
141905
141905
|
required: [],
|
|
141906
141906
|
additionalProperties: false
|
|
141907
141907
|
};
|
|
141908
141908
|
types.delete("ALL_OF");
|
|
141909
|
-
delete
|
|
141910
|
-
delete
|
|
141911
|
-
delete
|
|
141912
|
-
delete
|
|
141913
|
-
delete
|
|
141914
|
-
Object.defineProperty(
|
|
141909
|
+
delete schema13.allOf;
|
|
141910
|
+
delete schema13.$id;
|
|
141911
|
+
delete schema13.description;
|
|
141912
|
+
delete schema13.name;
|
|
141913
|
+
delete schema13.title;
|
|
141914
|
+
Object.defineProperty(schema13, JSONSchema_1.Intersection, {
|
|
141915
141915
|
enumerable: false,
|
|
141916
141916
|
value: intersection2,
|
|
141917
141917
|
writable: false
|
|
@@ -141929,186 +141929,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
141929
141929
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
141930
141930
|
var util_1 = __require("util");
|
|
141931
141931
|
var rules = new Map;
|
|
141932
|
-
function hasType(
|
|
141933
|
-
return
|
|
141932
|
+
function hasType(schema13, type) {
|
|
141933
|
+
return schema13.type === type || Array.isArray(schema13.type) && schema13.type.includes(type);
|
|
141934
141934
|
}
|
|
141935
|
-
function isObjectType(
|
|
141936
|
-
return
|
|
141935
|
+
function isObjectType(schema13) {
|
|
141936
|
+
return schema13.properties !== undefined || hasType(schema13, "object") || hasType(schema13, "any");
|
|
141937
141937
|
}
|
|
141938
|
-
function isArrayType(
|
|
141939
|
-
return
|
|
141938
|
+
function isArrayType(schema13) {
|
|
141939
|
+
return schema13.items !== undefined || hasType(schema13, "array") || hasType(schema13, "any");
|
|
141940
141940
|
}
|
|
141941
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
141942
|
-
return
|
|
141941
|
+
function isEnumTypeWithoutTsEnumNames(schema13) {
|
|
141942
|
+
return schema13.type === "string" && schema13.enum !== undefined && schema13.tsEnumNames === undefined;
|
|
141943
141943
|
}
|
|
141944
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
141945
|
-
if (Array.isArray(
|
|
141946
|
-
|
|
141944
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema13) => {
|
|
141945
|
+
if (Array.isArray(schema13.enum) && schema13.enum.some((e8) => e8 === null) && Array.isArray(schema13.type) && schema13.type.includes("null")) {
|
|
141946
|
+
schema13.type = schema13.type.filter((type) => type !== "null");
|
|
141947
141947
|
}
|
|
141948
141948
|
});
|
|
141949
|
-
rules.set("Destructure unary types", (
|
|
141950
|
-
if (
|
|
141951
|
-
|
|
141949
|
+
rules.set("Destructure unary types", (schema13) => {
|
|
141950
|
+
if (schema13.type && Array.isArray(schema13.type) && schema13.type.length === 1) {
|
|
141951
|
+
schema13.type = schema13.type[0];
|
|
141952
141952
|
}
|
|
141953
141953
|
});
|
|
141954
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
141955
|
-
if (isObjectType(
|
|
141956
|
-
|
|
141954
|
+
rules.set("Add empty `required` property if none is defined", (schema13) => {
|
|
141955
|
+
if (isObjectType(schema13) && !("required" in schema13)) {
|
|
141956
|
+
schema13.required = [];
|
|
141957
141957
|
}
|
|
141958
141958
|
});
|
|
141959
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
141960
|
-
if (
|
|
141961
|
-
|
|
141959
|
+
rules.set("Transform `required`=false to `required`=[]", (schema13) => {
|
|
141960
|
+
if (schema13.required === false) {
|
|
141961
|
+
schema13.required = [];
|
|
141962
141962
|
}
|
|
141963
141963
|
});
|
|
141964
|
-
rules.set("Default additionalProperties", (
|
|
141965
|
-
if (isObjectType(
|
|
141966
|
-
|
|
141964
|
+
rules.set("Default additionalProperties", (schema13, _10, options8) => {
|
|
141965
|
+
if (isObjectType(schema13) && !("additionalProperties" in schema13) && schema13.patternProperties === undefined) {
|
|
141966
|
+
schema13.additionalProperties = options8.additionalProperties;
|
|
141967
141967
|
}
|
|
141968
141968
|
});
|
|
141969
|
-
rules.set("Transform id to $id", (
|
|
141970
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141969
|
+
rules.set("Transform id to $id", (schema13, fileName) => {
|
|
141970
|
+
if (!(0, utils_1.isSchemaLike)(schema13)) {
|
|
141971
141971
|
return;
|
|
141972
141972
|
}
|
|
141973
|
-
if (
|
|
141974
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
141973
|
+
if (schema13.id && schema13.$id && schema13.id !== schema13.$id) {
|
|
141974
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema13.id}, $id=${schema13.$id} in ${fileName}`);
|
|
141975
141975
|
}
|
|
141976
|
-
if (
|
|
141977
|
-
|
|
141978
|
-
delete
|
|
141976
|
+
if (schema13.id) {
|
|
141977
|
+
schema13.$id = schema13.id;
|
|
141978
|
+
delete schema13.id;
|
|
141979
141979
|
}
|
|
141980
141980
|
});
|
|
141981
|
-
rules.set("Add an $id to anything that needs it", (
|
|
141982
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
141981
|
+
rules.set("Add an $id to anything that needs it", (schema13, fileName, _options, _key, dereferencedPaths) => {
|
|
141982
|
+
if (!(0, utils_1.isSchemaLike)(schema13)) {
|
|
141983
141983
|
return;
|
|
141984
141984
|
}
|
|
141985
|
-
if (!
|
|
141986
|
-
|
|
141985
|
+
if (!schema13.$id && !schema13[JSONSchema_1.Parent]) {
|
|
141986
|
+
schema13.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
141987
141987
|
return;
|
|
141988
141988
|
}
|
|
141989
|
-
if (!isArrayType(
|
|
141989
|
+
if (!isArrayType(schema13) && !isObjectType(schema13)) {
|
|
141990
141990
|
return;
|
|
141991
141991
|
}
|
|
141992
|
-
const dereferencedName = dereferencedPaths.get(
|
|
141993
|
-
if (!
|
|
141994
|
-
|
|
141992
|
+
const dereferencedName = dereferencedPaths.get(schema13);
|
|
141993
|
+
if (!schema13.$id && !schema13.title && dereferencedName) {
|
|
141994
|
+
schema13.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
141995
141995
|
}
|
|
141996
141996
|
if (dereferencedName) {
|
|
141997
|
-
dereferencedPaths.delete(
|
|
141997
|
+
dereferencedPaths.delete(schema13);
|
|
141998
141998
|
}
|
|
141999
141999
|
});
|
|
142000
|
-
rules.set("Escape closing JSDoc comment", (
|
|
142001
|
-
(0, utils_1.escapeBlockComment)(
|
|
142000
|
+
rules.set("Escape closing JSDoc comment", (schema13) => {
|
|
142001
|
+
(0, utils_1.escapeBlockComment)(schema13);
|
|
142002
142002
|
});
|
|
142003
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
142004
|
-
if (!isArrayType(
|
|
142003
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema13) => {
|
|
142004
|
+
if (!isArrayType(schema13)) {
|
|
142005
142005
|
return;
|
|
142006
142006
|
}
|
|
142007
142007
|
const commentsToAppend = [
|
|
142008
|
-
"minItems" in
|
|
142009
|
-
"maxItems" in
|
|
142008
|
+
"minItems" in schema13 ? `@minItems ${schema13.minItems}` : "",
|
|
142009
|
+
"maxItems" in schema13 ? `@maxItems ${schema13.maxItems}` : ""
|
|
142010
142010
|
].filter(Boolean);
|
|
142011
142011
|
if (commentsToAppend.length) {
|
|
142012
|
-
|
|
142012
|
+
schema13.description = (0, utils_1.appendToDescription)(schema13.description, ...commentsToAppend);
|
|
142013
142013
|
}
|
|
142014
142014
|
});
|
|
142015
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
142016
|
-
if (!isArrayType(
|
|
142015
|
+
rules.set("Optionally remove maxItems and minItems", (schema13, _fileName, options8) => {
|
|
142016
|
+
if (!isArrayType(schema13)) {
|
|
142017
142017
|
return;
|
|
142018
142018
|
}
|
|
142019
|
-
if ("minItems" in
|
|
142020
|
-
delete
|
|
142019
|
+
if ("minItems" in schema13 && options8.ignoreMinAndMaxItems) {
|
|
142020
|
+
delete schema13.minItems;
|
|
142021
142021
|
}
|
|
142022
|
-
if ("maxItems" in
|
|
142023
|
-
delete
|
|
142022
|
+
if ("maxItems" in schema13 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
142023
|
+
delete schema13.maxItems;
|
|
142024
142024
|
}
|
|
142025
142025
|
});
|
|
142026
|
-
rules.set("Normalize schema.minItems", (
|
|
142026
|
+
rules.set("Normalize schema.minItems", (schema13, _fileName, options8) => {
|
|
142027
142027
|
if (options8.ignoreMinAndMaxItems) {
|
|
142028
142028
|
return;
|
|
142029
142029
|
}
|
|
142030
|
-
if (!isArrayType(
|
|
142030
|
+
if (!isArrayType(schema13)) {
|
|
142031
142031
|
return;
|
|
142032
142032
|
}
|
|
142033
|
-
const { minItems } =
|
|
142034
|
-
|
|
142033
|
+
const { minItems } = schema13;
|
|
142034
|
+
schema13.minItems = typeof minItems === "number" ? minItems : 0;
|
|
142035
142035
|
});
|
|
142036
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
142036
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema13, _fileName, options8) => {
|
|
142037
142037
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
142038
142038
|
return;
|
|
142039
142039
|
}
|
|
142040
|
-
if (!isArrayType(
|
|
142040
|
+
if (!isArrayType(schema13)) {
|
|
142041
142041
|
return;
|
|
142042
142042
|
}
|
|
142043
|
-
const { maxItems, minItems } =
|
|
142043
|
+
const { maxItems, minItems } = schema13;
|
|
142044
142044
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
142045
|
-
delete
|
|
142045
|
+
delete schema13.maxItems;
|
|
142046
142046
|
}
|
|
142047
142047
|
});
|
|
142048
|
-
rules.set("Normalize schema.items", (
|
|
142048
|
+
rules.set("Normalize schema.items", (schema13, _fileName, options8) => {
|
|
142049
142049
|
if (options8.ignoreMinAndMaxItems) {
|
|
142050
142050
|
return;
|
|
142051
142051
|
}
|
|
142052
|
-
const { maxItems, minItems } =
|
|
142052
|
+
const { maxItems, minItems } = schema13;
|
|
142053
142053
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
142054
142054
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
142055
|
-
if (
|
|
142056
|
-
const items =
|
|
142055
|
+
if (schema13.items && !Array.isArray(schema13.items) && (hasMaxItems || hasMinItems)) {
|
|
142056
|
+
const items = schema13.items;
|
|
142057
142057
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
142058
142058
|
if (!hasMaxItems) {
|
|
142059
|
-
|
|
142059
|
+
schema13.additionalItems = items;
|
|
142060
142060
|
}
|
|
142061
|
-
|
|
142061
|
+
schema13.items = newItems;
|
|
142062
142062
|
}
|
|
142063
|
-
if (Array.isArray(
|
|
142064
|
-
|
|
142063
|
+
if (Array.isArray(schema13.items) && hasMaxItems && maxItems < schema13.items.length) {
|
|
142064
|
+
schema13.items = schema13.items.slice(0, maxItems);
|
|
142065
142065
|
}
|
|
142066
|
-
return
|
|
142066
|
+
return schema13;
|
|
142067
142067
|
});
|
|
142068
|
-
rules.set("Remove extends, if it is empty", (
|
|
142069
|
-
if (!
|
|
142068
|
+
rules.set("Remove extends, if it is empty", (schema13) => {
|
|
142069
|
+
if (!schema13.hasOwnProperty("extends")) {
|
|
142070
142070
|
return;
|
|
142071
142071
|
}
|
|
142072
|
-
if (
|
|
142073
|
-
delete
|
|
142072
|
+
if (schema13.extends == null || Array.isArray(schema13.extends) && schema13.extends.length === 0) {
|
|
142073
|
+
delete schema13.extends;
|
|
142074
142074
|
}
|
|
142075
142075
|
});
|
|
142076
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
142077
|
-
if (
|
|
142076
|
+
rules.set("Make extends always an array, if it is defined", (schema13) => {
|
|
142077
|
+
if (schema13.extends == null) {
|
|
142078
142078
|
return;
|
|
142079
142079
|
}
|
|
142080
|
-
if (!Array.isArray(
|
|
142081
|
-
|
|
142080
|
+
if (!Array.isArray(schema13.extends)) {
|
|
142081
|
+
schema13.extends = [schema13.extends];
|
|
142082
142082
|
}
|
|
142083
142083
|
});
|
|
142084
|
-
rules.set("Transform definitions to $defs", (
|
|
142085
|
-
if (
|
|
142086
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
142084
|
+
rules.set("Transform definitions to $defs", (schema13, fileName) => {
|
|
142085
|
+
if (schema13.definitions && schema13.$defs && !(0, util_1.isDeepStrictEqual)(schema13.definitions, schema13.$defs)) {
|
|
142086
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema13.id} in ${fileName}`);
|
|
142087
142087
|
}
|
|
142088
|
-
if (
|
|
142089
|
-
|
|
142090
|
-
delete
|
|
142088
|
+
if (schema13.definitions) {
|
|
142089
|
+
schema13.$defs = schema13.definitions;
|
|
142090
|
+
delete schema13.definitions;
|
|
142091
142091
|
}
|
|
142092
142092
|
});
|
|
142093
|
-
rules.set("Transform const to singleton enum", (
|
|
142094
|
-
if (
|
|
142095
|
-
|
|
142096
|
-
delete
|
|
142093
|
+
rules.set("Transform const to singleton enum", (schema13) => {
|
|
142094
|
+
if (schema13.const !== undefined) {
|
|
142095
|
+
schema13.enum = [schema13.const];
|
|
142096
|
+
delete schema13.const;
|
|
142097
142097
|
}
|
|
142098
142098
|
});
|
|
142099
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
142099
|
+
rules.set("Add tsEnumNames to enum types", (schema13, _10, options8) => {
|
|
142100
142100
|
var _a7;
|
|
142101
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
142102
|
-
|
|
142101
|
+
if (isEnumTypeWithoutTsEnumNames(schema13) && options8.inferStringEnumKeysFromValues) {
|
|
142102
|
+
schema13.tsEnumNames = (_a7 = schema13.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
142103
142103
|
}
|
|
142104
142104
|
});
|
|
142105
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
142106
|
-
if (
|
|
142107
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
142105
|
+
rules.set("Pre-calculate schema types and intersections", (schema13) => {
|
|
142106
|
+
if (schema13 !== null && typeof schema13 === "object") {
|
|
142107
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema13);
|
|
142108
142108
|
}
|
|
142109
142109
|
});
|
|
142110
142110
|
function normalize2(rootSchema, dereferencedPaths, filename, options8) {
|
|
142111
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
142111
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema13, key2) => rule(schema13, filename, options8, key2, dereferencedPaths)));
|
|
142112
142112
|
return rootSchema;
|
|
142113
142113
|
}
|
|
142114
142114
|
exports.normalize = normalize2;
|
|
@@ -142190,37 +142190,37 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142190
142190
|
var AST_1 = require_AST();
|
|
142191
142191
|
var JSONSchema_1 = require_JSONSchema();
|
|
142192
142192
|
var utils_1 = require_utils7();
|
|
142193
|
-
function parse11(
|
|
142194
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
142195
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
142196
|
-
return parseBooleanSchema(
|
|
142193
|
+
function parse11(schema13, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142194
|
+
if ((0, JSONSchema_1.isPrimitive)(schema13)) {
|
|
142195
|
+
if ((0, JSONSchema_1.isBoolean)(schema13)) {
|
|
142196
|
+
return parseBooleanSchema(schema13, keyName, options8);
|
|
142197
142197
|
}
|
|
142198
|
-
return parseLiteral(
|
|
142198
|
+
return parseLiteral(schema13, keyName);
|
|
142199
142199
|
}
|
|
142200
|
-
const intersection2 =
|
|
142201
|
-
const types =
|
|
142200
|
+
const intersection2 = schema13[JSONSchema_1.Intersection];
|
|
142201
|
+
const types = schema13[JSONSchema_1.Types];
|
|
142202
142202
|
if (intersection2) {
|
|
142203
142203
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
142204
142204
|
types.forEach((type) => {
|
|
142205
|
-
ast.params.push(parseAsTypeWithCache(
|
|
142205
|
+
ast.params.push(parseAsTypeWithCache(schema13, type, options8, keyName, processed, usedNames));
|
|
142206
142206
|
});
|
|
142207
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
142207
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema13, "Output:", ast);
|
|
142208
142208
|
return ast;
|
|
142209
142209
|
}
|
|
142210
142210
|
if (types.size === 1) {
|
|
142211
142211
|
const type = [...types][0];
|
|
142212
|
-
const ast = parseAsTypeWithCache(
|
|
142213
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
142212
|
+
const ast = parseAsTypeWithCache(schema13, type, options8, keyName, processed, usedNames);
|
|
142213
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema13, "Output:", ast);
|
|
142214
142214
|
return ast;
|
|
142215
142215
|
}
|
|
142216
142216
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
142217
142217
|
}
|
|
142218
142218
|
exports.parse = parse11;
|
|
142219
|
-
function parseAsTypeWithCache(
|
|
142220
|
-
let cachedTypeMap = processed.get(
|
|
142219
|
+
function parseAsTypeWithCache(schema13, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
142220
|
+
let cachedTypeMap = processed.get(schema13);
|
|
142221
142221
|
if (!cachedTypeMap) {
|
|
142222
142222
|
cachedTypeMap = new Map;
|
|
142223
|
-
processed.set(
|
|
142223
|
+
processed.set(schema13, cachedTypeMap);
|
|
142224
142224
|
}
|
|
142225
142225
|
const cachedAST = cachedTypeMap.get(type);
|
|
142226
142226
|
if (cachedAST) {
|
|
@@ -142228,10 +142228,10 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142228
142228
|
}
|
|
142229
142229
|
const ast = {};
|
|
142230
142230
|
cachedTypeMap.set(type, ast);
|
|
142231
|
-
return Object.assign(ast, parseNonLiteral(
|
|
142231
|
+
return Object.assign(ast, parseNonLiteral(schema13, type, options8, keyName, processed, usedNames));
|
|
142232
142232
|
}
|
|
142233
|
-
function parseBooleanSchema(
|
|
142234
|
-
if (
|
|
142233
|
+
function parseBooleanSchema(schema13, keyName, options8) {
|
|
142234
|
+
if (schema13) {
|
|
142235
142235
|
return {
|
|
142236
142236
|
keyName,
|
|
142237
142237
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -142242,157 +142242,157 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142242
142242
|
type: "NEVER"
|
|
142243
142243
|
};
|
|
142244
142244
|
}
|
|
142245
|
-
function parseLiteral(
|
|
142245
|
+
function parseLiteral(schema13, keyName) {
|
|
142246
142246
|
return {
|
|
142247
142247
|
keyName,
|
|
142248
|
-
params:
|
|
142248
|
+
params: schema13,
|
|
142249
142249
|
type: "LITERAL"
|
|
142250
142250
|
};
|
|
142251
142251
|
}
|
|
142252
|
-
function parseNonLiteral(
|
|
142253
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
142254
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
142252
|
+
function parseNonLiteral(schema13, type, options8, keyName, processed, usedNames) {
|
|
142253
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema13));
|
|
142254
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema13);
|
|
142255
142255
|
switch (type) {
|
|
142256
142256
|
case "ALL_OF":
|
|
142257
142257
|
return {
|
|
142258
|
-
comment:
|
|
142259
|
-
deprecated:
|
|
142258
|
+
comment: schema13.description,
|
|
142259
|
+
deprecated: schema13.deprecated,
|
|
142260
142260
|
keyName,
|
|
142261
|
-
standaloneName: standaloneName(
|
|
142262
|
-
params:
|
|
142261
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142262
|
+
params: schema13.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142263
142263
|
type: "INTERSECTION"
|
|
142264
142264
|
};
|
|
142265
142265
|
case "ANY":
|
|
142266
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
142266
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema13.description, deprecated: schema13.deprecated, keyName, standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8) });
|
|
142267
142267
|
case "ANY_OF":
|
|
142268
142268
|
return {
|
|
142269
|
-
comment:
|
|
142270
|
-
deprecated:
|
|
142269
|
+
comment: schema13.description,
|
|
142270
|
+
deprecated: schema13.deprecated,
|
|
142271
142271
|
keyName,
|
|
142272
|
-
standaloneName: standaloneName(
|
|
142273
|
-
params:
|
|
142272
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142273
|
+
params: schema13.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142274
142274
|
type: "UNION"
|
|
142275
142275
|
};
|
|
142276
142276
|
case "BOOLEAN":
|
|
142277
142277
|
return {
|
|
142278
|
-
comment:
|
|
142279
|
-
deprecated:
|
|
142278
|
+
comment: schema13.description,
|
|
142279
|
+
deprecated: schema13.deprecated,
|
|
142280
142280
|
keyName,
|
|
142281
|
-
standaloneName: standaloneName(
|
|
142281
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142282
142282
|
type: "BOOLEAN"
|
|
142283
142283
|
};
|
|
142284
142284
|
case "CUSTOM_TYPE":
|
|
142285
142285
|
return {
|
|
142286
|
-
comment:
|
|
142287
|
-
deprecated:
|
|
142286
|
+
comment: schema13.description,
|
|
142287
|
+
deprecated: schema13.deprecated,
|
|
142288
142288
|
keyName,
|
|
142289
|
-
params:
|
|
142290
|
-
standaloneName: standaloneName(
|
|
142289
|
+
params: schema13.tsType,
|
|
142290
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142291
142291
|
type: "CUSTOM_TYPE"
|
|
142292
142292
|
};
|
|
142293
142293
|
case "NAMED_ENUM":
|
|
142294
142294
|
return {
|
|
142295
|
-
comment:
|
|
142296
|
-
deprecated:
|
|
142295
|
+
comment: schema13.description,
|
|
142296
|
+
deprecated: schema13.deprecated,
|
|
142297
142297
|
keyName,
|
|
142298
|
-
standaloneName: standaloneName(
|
|
142299
|
-
params:
|
|
142298
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
142299
|
+
params: schema13.enum.map((_10, n5) => ({
|
|
142300
142300
|
ast: parseLiteral(_10, undefined),
|
|
142301
|
-
keyName:
|
|
142301
|
+
keyName: schema13.tsEnumNames[n5]
|
|
142302
142302
|
})),
|
|
142303
142303
|
type: "ENUM"
|
|
142304
142304
|
};
|
|
142305
142305
|
case "NAMED_SCHEMA":
|
|
142306
|
-
return newInterface(
|
|
142306
|
+
return newInterface(schema13, options8, processed, usedNames, keyName);
|
|
142307
142307
|
case "NEVER":
|
|
142308
142308
|
return {
|
|
142309
|
-
comment:
|
|
142310
|
-
deprecated:
|
|
142309
|
+
comment: schema13.description,
|
|
142310
|
+
deprecated: schema13.deprecated,
|
|
142311
142311
|
keyName,
|
|
142312
|
-
standaloneName: standaloneName(
|
|
142312
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142313
142313
|
type: "NEVER"
|
|
142314
142314
|
};
|
|
142315
142315
|
case "NULL":
|
|
142316
142316
|
return {
|
|
142317
|
-
comment:
|
|
142318
|
-
deprecated:
|
|
142317
|
+
comment: schema13.description,
|
|
142318
|
+
deprecated: schema13.deprecated,
|
|
142319
142319
|
keyName,
|
|
142320
|
-
standaloneName: standaloneName(
|
|
142320
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142321
142321
|
type: "NULL"
|
|
142322
142322
|
};
|
|
142323
142323
|
case "NUMBER":
|
|
142324
142324
|
return {
|
|
142325
|
-
comment:
|
|
142326
|
-
deprecated:
|
|
142325
|
+
comment: schema13.description,
|
|
142326
|
+
deprecated: schema13.deprecated,
|
|
142327
142327
|
keyName,
|
|
142328
|
-
standaloneName: standaloneName(
|
|
142328
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142329
142329
|
type: "NUMBER"
|
|
142330
142330
|
};
|
|
142331
142331
|
case "OBJECT":
|
|
142332
142332
|
return {
|
|
142333
|
-
comment:
|
|
142333
|
+
comment: schema13.description,
|
|
142334
142334
|
keyName,
|
|
142335
|
-
standaloneName: standaloneName(
|
|
142335
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142336
142336
|
type: "OBJECT",
|
|
142337
|
-
deprecated:
|
|
142337
|
+
deprecated: schema13.deprecated
|
|
142338
142338
|
};
|
|
142339
142339
|
case "ONE_OF":
|
|
142340
142340
|
return {
|
|
142341
|
-
comment:
|
|
142342
|
-
deprecated:
|
|
142341
|
+
comment: schema13.description,
|
|
142342
|
+
deprecated: schema13.deprecated,
|
|
142343
142343
|
keyName,
|
|
142344
|
-
standaloneName: standaloneName(
|
|
142345
|
-
params:
|
|
142344
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142345
|
+
params: schema13.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142346
142346
|
type: "UNION"
|
|
142347
142347
|
};
|
|
142348
142348
|
case "REFERENCE":
|
|
142349
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
142349
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema13));
|
|
142350
142350
|
case "STRING":
|
|
142351
142351
|
return {
|
|
142352
|
-
comment:
|
|
142353
|
-
deprecated:
|
|
142352
|
+
comment: schema13.description,
|
|
142353
|
+
deprecated: schema13.deprecated,
|
|
142354
142354
|
keyName,
|
|
142355
|
-
standaloneName: standaloneName(
|
|
142355
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142356
142356
|
type: "STRING"
|
|
142357
142357
|
};
|
|
142358
142358
|
case "TYPED_ARRAY":
|
|
142359
|
-
if (Array.isArray(
|
|
142360
|
-
const minItems2 =
|
|
142361
|
-
const maxItems2 =
|
|
142359
|
+
if (Array.isArray(schema13.items)) {
|
|
142360
|
+
const minItems2 = schema13.minItems;
|
|
142361
|
+
const maxItems2 = schema13.maxItems;
|
|
142362
142362
|
const arrayType = {
|
|
142363
|
-
comment:
|
|
142364
|
-
deprecated:
|
|
142363
|
+
comment: schema13.description,
|
|
142364
|
+
deprecated: schema13.deprecated,
|
|
142365
142365
|
keyName,
|
|
142366
142366
|
maxItems: maxItems2,
|
|
142367
142367
|
minItems: minItems2,
|
|
142368
|
-
standaloneName: standaloneName(
|
|
142369
|
-
params:
|
|
142368
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142369
|
+
params: schema13.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
142370
142370
|
type: "TUPLE"
|
|
142371
142371
|
};
|
|
142372
|
-
if (
|
|
142372
|
+
if (schema13.additionalItems === true) {
|
|
142373
142373
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142374
|
-
} else if (
|
|
142375
|
-
arrayType.spreadParam = parse11(
|
|
142374
|
+
} else if (schema13.additionalItems) {
|
|
142375
|
+
arrayType.spreadParam = parse11(schema13.additionalItems, options8, undefined, processed, usedNames);
|
|
142376
142376
|
}
|
|
142377
142377
|
return arrayType;
|
|
142378
142378
|
} else {
|
|
142379
142379
|
return {
|
|
142380
|
-
comment:
|
|
142381
|
-
deprecated:
|
|
142380
|
+
comment: schema13.description,
|
|
142381
|
+
deprecated: schema13.deprecated,
|
|
142382
142382
|
keyName,
|
|
142383
|
-
standaloneName: standaloneName(
|
|
142384
|
-
params: parse11(
|
|
142383
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142384
|
+
params: parse11(schema13.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
142385
142385
|
type: "ARRAY"
|
|
142386
142386
|
};
|
|
142387
142387
|
}
|
|
142388
142388
|
case "UNION":
|
|
142389
142389
|
return {
|
|
142390
|
-
comment:
|
|
142391
|
-
deprecated:
|
|
142390
|
+
comment: schema13.description,
|
|
142391
|
+
deprecated: schema13.deprecated,
|
|
142392
142392
|
keyName,
|
|
142393
|
-
standaloneName: standaloneName(
|
|
142394
|
-
params:
|
|
142395
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
142393
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142394
|
+
params: schema13.type.map((type2) => {
|
|
142395
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema13, "$id", "description", "title")), { type: type2 });
|
|
142396
142396
|
(0, utils_1.maybeStripDefault)(member);
|
|
142397
142397
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
142398
142398
|
return parse11(member, options8, undefined, processed, usedNames);
|
|
@@ -142401,80 +142401,80 @@ var require_parser2 = __commonJS((exports) => {
|
|
|
142401
142401
|
};
|
|
142402
142402
|
case "UNNAMED_ENUM":
|
|
142403
142403
|
return {
|
|
142404
|
-
comment:
|
|
142405
|
-
deprecated:
|
|
142404
|
+
comment: schema13.description,
|
|
142405
|
+
deprecated: schema13.deprecated,
|
|
142406
142406
|
keyName,
|
|
142407
|
-
standaloneName: standaloneName(
|
|
142408
|
-
params:
|
|
142407
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142408
|
+
params: schema13.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
142409
142409
|
type: "UNION"
|
|
142410
142410
|
};
|
|
142411
142411
|
case "UNNAMED_SCHEMA":
|
|
142412
|
-
return newInterface(
|
|
142412
|
+
return newInterface(schema13, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
142413
142413
|
case "UNTYPED_ARRAY":
|
|
142414
|
-
const minItems =
|
|
142415
|
-
const maxItems = typeof
|
|
142414
|
+
const minItems = schema13.minItems;
|
|
142415
|
+
const maxItems = typeof schema13.maxItems === "number" ? schema13.maxItems : -1;
|
|
142416
142416
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
142417
142417
|
if (minItems > 0 || maxItems >= 0) {
|
|
142418
142418
|
return {
|
|
142419
|
-
comment:
|
|
142420
|
-
deprecated:
|
|
142419
|
+
comment: schema13.description,
|
|
142420
|
+
deprecated: schema13.deprecated,
|
|
142421
142421
|
keyName,
|
|
142422
|
-
maxItems:
|
|
142422
|
+
maxItems: schema13.maxItems,
|
|
142423
142423
|
minItems,
|
|
142424
142424
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
142425
142425
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
142426
|
-
standaloneName: standaloneName(
|
|
142426
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142427
142427
|
type: "TUPLE"
|
|
142428
142428
|
};
|
|
142429
142429
|
}
|
|
142430
142430
|
return {
|
|
142431
|
-
comment:
|
|
142432
|
-
deprecated:
|
|
142431
|
+
comment: schema13.description,
|
|
142432
|
+
deprecated: schema13.deprecated,
|
|
142433
142433
|
keyName,
|
|
142434
142434
|
params,
|
|
142435
|
-
standaloneName: standaloneName(
|
|
142435
|
+
standaloneName: standaloneName(schema13, keyNameFromDefinition, usedNames, options8),
|
|
142436
142436
|
type: "ARRAY"
|
|
142437
142437
|
};
|
|
142438
142438
|
}
|
|
142439
142439
|
}
|
|
142440
|
-
function standaloneName(
|
|
142440
|
+
function standaloneName(schema13, keyNameFromDefinition, usedNames, options8) {
|
|
142441
142441
|
var _a7;
|
|
142442
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
142442
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema13, keyNameFromDefinition)) || schema13.title || schema13.$id || keyNameFromDefinition;
|
|
142443
142443
|
if (name2) {
|
|
142444
142444
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
142445
142445
|
}
|
|
142446
142446
|
}
|
|
142447
|
-
function newInterface(
|
|
142448
|
-
const name2 = standaloneName(
|
|
142447
|
+
function newInterface(schema13, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
142448
|
+
const name2 = standaloneName(schema13, keyNameFromDefinition, usedNames, options8);
|
|
142449
142449
|
return {
|
|
142450
|
-
comment:
|
|
142451
|
-
deprecated:
|
|
142450
|
+
comment: schema13.description,
|
|
142451
|
+
deprecated: schema13.deprecated,
|
|
142452
142452
|
keyName,
|
|
142453
|
-
params: parseSchema(
|
|
142453
|
+
params: parseSchema(schema13, options8, processed, usedNames, name2),
|
|
142454
142454
|
standaloneName: name2,
|
|
142455
|
-
superTypes: parseSuperTypes(
|
|
142455
|
+
superTypes: parseSuperTypes(schema13, options8, processed, usedNames),
|
|
142456
142456
|
type: "INTERFACE"
|
|
142457
142457
|
};
|
|
142458
142458
|
}
|
|
142459
|
-
function parseSuperTypes(
|
|
142460
|
-
const superTypes =
|
|
142459
|
+
function parseSuperTypes(schema13, options8, processed, usedNames) {
|
|
142460
|
+
const superTypes = schema13.extends;
|
|
142461
142461
|
if (!superTypes) {
|
|
142462
142462
|
return [];
|
|
142463
142463
|
}
|
|
142464
142464
|
return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
|
|
142465
142465
|
}
|
|
142466
|
-
function parseSchema(
|
|
142467
|
-
let asts = (0, lodash_1.map)(
|
|
142466
|
+
function parseSchema(schema13, options8, processed, usedNames, parentSchemaName) {
|
|
142467
|
+
let asts = (0, lodash_1.map)(schema13.properties, (value, key2) => ({
|
|
142468
142468
|
ast: parse11(value, options8, key2, processed, usedNames),
|
|
142469
142469
|
isPatternProperty: false,
|
|
142470
|
-
isRequired: (0, lodash_1.includes)(
|
|
142470
|
+
isRequired: (0, lodash_1.includes)(schema13.required || [], key2),
|
|
142471
142471
|
isUnreachableDefinition: false,
|
|
142472
142472
|
keyName: key2
|
|
142473
142473
|
}));
|
|
142474
142474
|
let singlePatternProperty = false;
|
|
142475
|
-
if (
|
|
142476
|
-
singlePatternProperty = !
|
|
142477
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142475
|
+
if (schema13.patternProperties) {
|
|
142476
|
+
singlePatternProperty = !schema13.additionalProperties && Object.keys(schema13.patternProperties).length === 1;
|
|
142477
|
+
asts = asts.concat((0, lodash_1.map)(schema13.patternProperties, (value, key2) => {
|
|
142478
142478
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142479
142479
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
142480
142480
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
@@ -142484,14 +142484,14 @@ ${comment}` : comment;
|
|
|
142484
142484
|
return {
|
|
142485
142485
|
ast,
|
|
142486
142486
|
isPatternProperty: !singlePatternProperty,
|
|
142487
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
142487
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema13.required || [], key2),
|
|
142488
142488
|
isUnreachableDefinition: false,
|
|
142489
142489
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
142490
142490
|
};
|
|
142491
142491
|
}));
|
|
142492
142492
|
}
|
|
142493
142493
|
if (options8.unreachableDefinitions) {
|
|
142494
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
142494
|
+
asts = asts.concat((0, lodash_1.map)(schema13.$defs, (value, key2) => {
|
|
142495
142495
|
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
142496
142496
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
142497
142497
|
via the \`definition\` "${key2}".`;
|
|
@@ -142501,13 +142501,13 @@ ${comment}` : comment;
|
|
|
142501
142501
|
return {
|
|
142502
142502
|
ast,
|
|
142503
142503
|
isPatternProperty: false,
|
|
142504
|
-
isRequired: (0, lodash_1.includes)(
|
|
142504
|
+
isRequired: (0, lodash_1.includes)(schema13.required || [], key2),
|
|
142505
142505
|
isUnreachableDefinition: true,
|
|
142506
142506
|
keyName: key2
|
|
142507
142507
|
};
|
|
142508
142508
|
}));
|
|
142509
142509
|
}
|
|
142510
|
-
switch (
|
|
142510
|
+
switch (schema13.additionalProperties) {
|
|
142511
142511
|
case undefined:
|
|
142512
142512
|
case true:
|
|
142513
142513
|
if (singlePatternProperty) {
|
|
@@ -142524,7 +142524,7 @@ ${comment}` : comment;
|
|
|
142524
142524
|
return asts;
|
|
142525
142525
|
default:
|
|
142526
142526
|
return asts.concat({
|
|
142527
|
-
ast: parse11(
|
|
142527
|
+
ast: parse11(schema13.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
142528
142528
|
isPatternProperty: false,
|
|
142529
142529
|
isRequired: true,
|
|
142530
142530
|
isUnreachableDefinition: false,
|
|
@@ -142532,22 +142532,22 @@ ${comment}` : comment;
|
|
|
142532
142532
|
});
|
|
142533
142533
|
}
|
|
142534
142534
|
}
|
|
142535
|
-
function getDefinitions(
|
|
142536
|
-
if (processed.has(
|
|
142535
|
+
function getDefinitions(schema13, isSchema = true, processed = new Set) {
|
|
142536
|
+
if (processed.has(schema13)) {
|
|
142537
142537
|
return {};
|
|
142538
142538
|
}
|
|
142539
|
-
processed.add(
|
|
142540
|
-
if (Array.isArray(
|
|
142541
|
-
return
|
|
142539
|
+
processed.add(schema13);
|
|
142540
|
+
if (Array.isArray(schema13)) {
|
|
142541
|
+
return schema13.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
142542
142542
|
}
|
|
142543
|
-
if ((0, lodash_1.isPlainObject)(
|
|
142544
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
142543
|
+
if ((0, lodash_1.isPlainObject)(schema13)) {
|
|
142544
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema13) ? schema13.$defs : {}), Object.keys(schema13).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema13[cur], false, processed)), {}));
|
|
142545
142545
|
}
|
|
142546
142546
|
return {};
|
|
142547
142547
|
}
|
|
142548
142548
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
142549
|
-
function hasDefinitions(
|
|
142550
|
-
return "$defs" in
|
|
142549
|
+
function hasDefinitions(schema13) {
|
|
142550
|
+
return "$defs" in schema13;
|
|
142551
142551
|
}
|
|
142552
142552
|
});
|
|
142553
142553
|
|
|
@@ -142960,7 +142960,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142960
142960
|
};
|
|
142961
142961
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
142962
142962
|
exports.parse = undefined;
|
|
142963
|
-
exports.resolve =
|
|
142963
|
+
exports.resolve = resolve16;
|
|
142964
142964
|
exports.cwd = cwd;
|
|
142965
142965
|
exports.getProtocol = getProtocol;
|
|
142966
142966
|
exports.getExtension = getExtension;
|
|
@@ -142972,7 +142972,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142972
142972
|
exports.fromFileSystemPath = fromFileSystemPath;
|
|
142973
142973
|
exports.toFileSystemPath = toFileSystemPath;
|
|
142974
142974
|
exports.safePointerToPath = safePointerToPath;
|
|
142975
|
-
exports.relative =
|
|
142975
|
+
exports.relative = relative5;
|
|
142976
142976
|
var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
|
|
142977
142977
|
var path_1 = __importStar(__require("path"));
|
|
142978
142978
|
var forwardSlashPattern = /\//g;
|
|
@@ -142988,7 +142988,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142988
142988
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
142989
142989
|
var parse11 = (u4) => new URL(u4);
|
|
142990
142990
|
exports.parse = parse11;
|
|
142991
|
-
function
|
|
142991
|
+
function resolve16(from, to5) {
|
|
142992
142992
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
142993
142993
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
142994
142994
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -143122,9 +143122,9 @@ var require_url = __commonJS((exports) => {
|
|
|
143122
143122
|
return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
|
|
143123
143123
|
});
|
|
143124
143124
|
}
|
|
143125
|
-
function
|
|
143125
|
+
function relative5(from, to5) {
|
|
143126
143126
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143127
|
-
return
|
|
143127
|
+
return resolve16(from, to5);
|
|
143128
143128
|
}
|
|
143129
143129
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
143130
143130
|
const toPath4 = stripHash(to5);
|
|
@@ -143800,7 +143800,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143800
143800
|
let plugin;
|
|
143801
143801
|
let lastError;
|
|
143802
143802
|
let index = 0;
|
|
143803
|
-
return new Promise((
|
|
143803
|
+
return new Promise((resolve16, reject) => {
|
|
143804
143804
|
runNextPlugin();
|
|
143805
143805
|
function runNextPlugin() {
|
|
143806
143806
|
plugin = plugins[index++];
|
|
@@ -143828,7 +143828,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143828
143828
|
}
|
|
143829
143829
|
}
|
|
143830
143830
|
function onSuccess(result) {
|
|
143831
|
-
|
|
143831
|
+
resolve16({
|
|
143832
143832
|
plugin,
|
|
143833
143833
|
result
|
|
143834
143834
|
});
|
|
@@ -143925,7 +143925,7 @@ var require_parse7 = __commonJS((exports) => {
|
|
|
143925
143925
|
extension: url3.getExtension(path18)
|
|
143926
143926
|
};
|
|
143927
143927
|
try {
|
|
143928
|
-
const resolver = await
|
|
143928
|
+
const resolver = await readFile7(file2, options8, $refs);
|
|
143929
143929
|
$ref.pathType = resolver.plugin.name;
|
|
143930
143930
|
file2.data = resolver.result;
|
|
143931
143931
|
const parser2 = await parseFile(file2, options8, $refs);
|
|
@@ -143938,7 +143938,7 @@ var require_parse7 = __commonJS((exports) => {
|
|
|
143938
143938
|
throw err;
|
|
143939
143939
|
}
|
|
143940
143940
|
}
|
|
143941
|
-
async function
|
|
143941
|
+
async function readFile7(file2, options8, $refs) {
|
|
143942
143942
|
let resolvers = plugins.all(options8.resolve);
|
|
143943
143943
|
resolvers = plugins.filter(resolvers, "canRead", file2);
|
|
143944
143944
|
plugins.sort(resolvers);
|
|
@@ -144371,7 +144371,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144371
144371
|
var options_js_1 = require_options();
|
|
144372
144372
|
function normalizeArgs(_args) {
|
|
144373
144373
|
let path18;
|
|
144374
|
-
let
|
|
144374
|
+
let schema13;
|
|
144375
144375
|
let options8;
|
|
144376
144376
|
let callback;
|
|
144377
144377
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -144381,15 +144381,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144381
144381
|
if (typeof args[0] === "string") {
|
|
144382
144382
|
path18 = args[0];
|
|
144383
144383
|
if (typeof args[2] === "object") {
|
|
144384
|
-
|
|
144384
|
+
schema13 = args[1];
|
|
144385
144385
|
options8 = args[2];
|
|
144386
144386
|
} else {
|
|
144387
|
-
|
|
144387
|
+
schema13 = undefined;
|
|
144388
144388
|
options8 = args[1];
|
|
144389
144389
|
}
|
|
144390
144390
|
} else {
|
|
144391
144391
|
path18 = "";
|
|
144392
|
-
|
|
144392
|
+
schema13 = args[0];
|
|
144393
144393
|
options8 = args[1];
|
|
144394
144394
|
}
|
|
144395
144395
|
try {
|
|
@@ -144397,12 +144397,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
144397
144397
|
} catch (e8) {
|
|
144398
144398
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
144399
144399
|
}
|
|
144400
|
-
if (!options8.mutateInputSchema && typeof
|
|
144401
|
-
|
|
144400
|
+
if (!options8.mutateInputSchema && typeof schema13 === "object") {
|
|
144401
|
+
schema13 = JSON.parse(JSON.stringify(schema13));
|
|
144402
144402
|
}
|
|
144403
144403
|
return {
|
|
144404
144404
|
path: path18,
|
|
144405
|
-
schema:
|
|
144405
|
+
schema: schema13,
|
|
144406
144406
|
options: options8,
|
|
144407
144407
|
callback
|
|
144408
144408
|
};
|
|
@@ -145161,11 +145161,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
145161
145161
|
var require_resolver = __commonJS((exports) => {
|
|
145162
145162
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145163
145163
|
function adopt(value) {
|
|
145164
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145165
|
-
|
|
145164
|
+
return value instanceof P9 ? value : new P9(function(resolve16) {
|
|
145165
|
+
resolve16(value);
|
|
145166
145166
|
});
|
|
145167
145167
|
}
|
|
145168
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145168
|
+
return new (P9 || (P9 = Promise))(function(resolve16, reject) {
|
|
145169
145169
|
function fulfilled(value) {
|
|
145170
145170
|
try {
|
|
145171
145171
|
step(generator.next(value));
|
|
@@ -145181,7 +145181,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145181
145181
|
}
|
|
145182
145182
|
}
|
|
145183
145183
|
function step(result) {
|
|
145184
|
-
result.done ?
|
|
145184
|
+
result.done ? resolve16(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145185
145185
|
}
|
|
145186
145186
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145187
145187
|
});
|
|
@@ -145191,12 +145191,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145191
145191
|
var json_schema_ref_parser_1 = require_lib3();
|
|
145192
145192
|
var utils_1 = require_utils7();
|
|
145193
145193
|
function dereference(schema_1, _a7) {
|
|
145194
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145195
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
145194
|
+
return __awaiter(this, arguments, undefined, function* (schema13, { cwd, $refOptions }) {
|
|
145195
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema13);
|
|
145196
145196
|
const parser2 = new json_schema_ref_parser_1.$RefParser;
|
|
145197
145197
|
const dereferencedPaths = new WeakMap;
|
|
145198
|
-
const dereferencedSchema = yield parser2.dereference(cwd,
|
|
145199
|
-
dereferencedPaths.set(
|
|
145198
|
+
const dereferencedSchema = yield parser2.dereference(cwd, schema13, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema14) {
|
|
145199
|
+
dereferencedPaths.set(schema14, $ref);
|
|
145200
145200
|
} }) }));
|
|
145201
145201
|
return { dereferencedPaths, dereferencedSchema };
|
|
145202
145202
|
});
|
|
@@ -145210,46 +145210,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
145210
145210
|
exports.validate = undefined;
|
|
145211
145211
|
var utils_1 = require_utils7();
|
|
145212
145212
|
var rules = new Map;
|
|
145213
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
145214
|
-
if (
|
|
145213
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema13) => {
|
|
145214
|
+
if (schema13.enum && schema13.tsEnumNames && schema13.enum.length !== schema13.tsEnumNames.length) {
|
|
145215
145215
|
return false;
|
|
145216
145216
|
}
|
|
145217
145217
|
});
|
|
145218
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
145219
|
-
if (
|
|
145218
|
+
rules.set("tsEnumNames must be an array of strings", (schema13) => {
|
|
145219
|
+
if (schema13.tsEnumNames && schema13.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
145220
145220
|
return false;
|
|
145221
145221
|
}
|
|
145222
145222
|
});
|
|
145223
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
145224
|
-
const { maxItems, minItems } =
|
|
145223
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema13) => {
|
|
145224
|
+
const { maxItems, minItems } = schema13;
|
|
145225
145225
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
145226
145226
|
return maxItems >= minItems;
|
|
145227
145227
|
}
|
|
145228
145228
|
});
|
|
145229
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
145230
|
-
const { maxItems } =
|
|
145229
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema13) => {
|
|
145230
|
+
const { maxItems } = schema13;
|
|
145231
145231
|
if (typeof maxItems === "number") {
|
|
145232
145232
|
return maxItems >= 0;
|
|
145233
145233
|
}
|
|
145234
145234
|
});
|
|
145235
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
145236
|
-
const { minItems } =
|
|
145235
|
+
rules.set("When minItems exists, minItems >= 0", (schema13) => {
|
|
145236
|
+
const { minItems } = schema13;
|
|
145237
145237
|
if (typeof minItems === "number") {
|
|
145238
145238
|
return minItems >= 0;
|
|
145239
145239
|
}
|
|
145240
145240
|
});
|
|
145241
|
-
rules.set("deprecated must be a boolean", (
|
|
145242
|
-
const typeOfDeprecated = typeof
|
|
145241
|
+
rules.set("deprecated must be a boolean", (schema13) => {
|
|
145242
|
+
const typeOfDeprecated = typeof schema13.deprecated;
|
|
145243
145243
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
145244
145244
|
});
|
|
145245
|
-
function validate2(
|
|
145245
|
+
function validate2(schema13, filename) {
|
|
145246
145246
|
const errors5 = [];
|
|
145247
145247
|
rules.forEach((rule, ruleName) => {
|
|
145248
|
-
(0, utils_1.traverse)(
|
|
145249
|
-
if (rule(
|
|
145248
|
+
(0, utils_1.traverse)(schema13, (schema14, key2) => {
|
|
145249
|
+
if (rule(schema14) === false) {
|
|
145250
145250
|
errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
145251
145251
|
}
|
|
145252
|
-
return
|
|
145252
|
+
return schema14;
|
|
145253
145253
|
});
|
|
145254
145254
|
});
|
|
145255
145255
|
return errors5;
|
|
@@ -145263,25 +145263,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
145263
145263
|
exports.link = undefined;
|
|
145264
145264
|
var JSONSchema_1 = require_JSONSchema();
|
|
145265
145265
|
var lodash_1 = require_lodash8();
|
|
145266
|
-
function link2(
|
|
145267
|
-
if (!Array.isArray(
|
|
145268
|
-
return
|
|
145266
|
+
function link2(schema13, parent = null) {
|
|
145267
|
+
if (!Array.isArray(schema13) && !(0, lodash_1.isPlainObject)(schema13)) {
|
|
145268
|
+
return schema13;
|
|
145269
145269
|
}
|
|
145270
|
-
if (
|
|
145271
|
-
return
|
|
145270
|
+
if (schema13.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
145271
|
+
return schema13;
|
|
145272
145272
|
}
|
|
145273
|
-
Object.defineProperty(
|
|
145273
|
+
Object.defineProperty(schema13, JSONSchema_1.Parent, {
|
|
145274
145274
|
enumerable: false,
|
|
145275
145275
|
value: parent,
|
|
145276
145276
|
writable: false
|
|
145277
145277
|
});
|
|
145278
|
-
if (Array.isArray(
|
|
145279
|
-
|
|
145278
|
+
if (Array.isArray(schema13)) {
|
|
145279
|
+
schema13.forEach((child) => link2(child, schema13));
|
|
145280
145280
|
}
|
|
145281
|
-
for (const key2 in
|
|
145282
|
-
link2(
|
|
145281
|
+
for (const key2 in schema13) {
|
|
145282
|
+
link2(schema13[key2], schema13);
|
|
145283
145283
|
}
|
|
145284
|
-
return
|
|
145284
|
+
return schema13;
|
|
145285
145285
|
}
|
|
145286
145286
|
exports.link = link2;
|
|
145287
145287
|
});
|
|
@@ -145302,11 +145302,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
145302
145302
|
var require_src3 = __commonJS((exports) => {
|
|
145303
145303
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145304
145304
|
function adopt(value) {
|
|
145305
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145306
|
-
|
|
145305
|
+
return value instanceof P9 ? value : new P9(function(resolve16) {
|
|
145306
|
+
resolve16(value);
|
|
145307
145307
|
});
|
|
145308
145308
|
}
|
|
145309
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145309
|
+
return new (P9 || (P9 = Promise))(function(resolve16, reject) {
|
|
145310
145310
|
function fulfilled(value) {
|
|
145311
145311
|
try {
|
|
145312
145312
|
step(generator.next(value));
|
|
@@ -145322,7 +145322,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145322
145322
|
}
|
|
145323
145323
|
}
|
|
145324
145324
|
function step(result) {
|
|
145325
|
-
result.done ?
|
|
145325
|
+
result.done ? resolve16(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145326
145326
|
}
|
|
145327
145327
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145328
145328
|
});
|
|
@@ -145373,8 +145373,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145373
145373
|
unknownAny: true
|
|
145374
145374
|
};
|
|
145375
145375
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
145376
|
-
const
|
|
145377
|
-
return compile(
|
|
145376
|
+
const schema13 = parseAsJSONSchema(filename);
|
|
145377
|
+
return compile(schema13, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
145378
145378
|
}
|
|
145379
145379
|
exports.compileFromFile = compileFromFile;
|
|
145380
145380
|
function parseAsJSONSchema(filename) {
|
|
@@ -145384,7 +145384,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145384
145384
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
145385
145385
|
}
|
|
145386
145386
|
function compile(schema_1, name_1) {
|
|
145387
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
145387
|
+
return __awaiter(this, arguments, undefined, function* (schema13, name2, options8 = {}) {
|
|
145388
145388
|
(0, optionValidator_1.validateOptions)(options8);
|
|
145389
145389
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
145390
145390
|
const start = Date.now();
|
|
@@ -145394,7 +145394,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145394
145394
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
145395
145395
|
_options.cwd += "/";
|
|
145396
145396
|
}
|
|
145397
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
145397
|
+
const _schema = (0, lodash_1.cloneDeep)(schema13);
|
|
145398
145398
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
145399
145399
|
if (process.env.VERBOSE) {
|
|
145400
145400
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -146451,7 +146451,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146451
146451
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
146452
146452
|
* MIT Licensed
|
|
146453
146453
|
*/
|
|
146454
|
-
var
|
|
146454
|
+
var relative5 = __require("path").relative;
|
|
146455
146455
|
module.exports = depd;
|
|
146456
146456
|
var basePath = process.cwd();
|
|
146457
146457
|
function containsNamespace(str, namespace) {
|
|
@@ -146647,7 +146647,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146647
146647
|
return formatted;
|
|
146648
146648
|
}
|
|
146649
146649
|
function formatLocation(callSite) {
|
|
146650
|
-
return
|
|
146650
|
+
return relative5(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
146651
146651
|
}
|
|
146652
146652
|
function getStack() {
|
|
146653
146653
|
var limit = Error.stackTraceLimit;
|
|
@@ -150643,7 +150643,7 @@ var require_dbcs_data = __commonJS((exports, module) => {
|
|
|
150643
150643
|
// ../../node_modules/iconv-lite/encodings/index.js
|
|
150644
150644
|
var require_encodings = __commonJS((exports, module) => {
|
|
150645
150645
|
var mergeModules = require_merge_exports();
|
|
150646
|
-
var
|
|
150646
|
+
var modules2 = [
|
|
150647
150647
|
require_internal(),
|
|
150648
150648
|
require_utf32(),
|
|
150649
150649
|
require_utf16(),
|
|
@@ -150654,8 +150654,8 @@ var require_encodings = __commonJS((exports, module) => {
|
|
|
150654
150654
|
require_dbcs_codec(),
|
|
150655
150655
|
require_dbcs_data()
|
|
150656
150656
|
];
|
|
150657
|
-
for (i5 = 0;i5 <
|
|
150658
|
-
module =
|
|
150657
|
+
for (i5 = 0;i5 < modules2.length; i5++) {
|
|
150658
|
+
module = modules2[i5];
|
|
150659
150659
|
mergeModules(exports, module);
|
|
150660
150660
|
}
|
|
150661
150661
|
var module;
|
|
@@ -150984,11 +150984,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
150984
150984
|
if (done) {
|
|
150985
150985
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
150986
150986
|
}
|
|
150987
|
-
return new Promise(function executor(
|
|
150987
|
+
return new Promise(function executor(resolve16, reject) {
|
|
150988
150988
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
150989
150989
|
if (err)
|
|
150990
150990
|
return reject(err);
|
|
150991
|
-
|
|
150991
|
+
resolve16(buf);
|
|
150992
150992
|
});
|
|
150993
150993
|
});
|
|
150994
150994
|
}
|
|
@@ -160792,7 +160792,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
160792
160792
|
* MIT Licensed
|
|
160793
160793
|
*/
|
|
160794
160794
|
var db2 = require_db();
|
|
160795
|
-
var
|
|
160795
|
+
var extname3 = __require("path").extname;
|
|
160796
160796
|
var mimeScore = require_mimeScore();
|
|
160797
160797
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
160798
160798
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
@@ -160849,7 +160849,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
160849
160849
|
if (!path18 || typeof path18 !== "string") {
|
|
160850
160850
|
return false;
|
|
160851
160851
|
}
|
|
160852
|
-
var extension2 =
|
|
160852
|
+
var extension2 = extname3("x." + path18).toLowerCase().slice(1);
|
|
160853
160853
|
if (!extension2) {
|
|
160854
160854
|
return false;
|
|
160855
160855
|
}
|
|
@@ -164109,16 +164109,16 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164109
164109
|
var debug = require_src4()("express:view");
|
|
164110
164110
|
var path18 = __require("node:path");
|
|
164111
164111
|
var fs28 = __require("node:fs");
|
|
164112
|
-
var
|
|
164112
|
+
var dirname21 = path18.dirname;
|
|
164113
164113
|
var basename6 = path18.basename;
|
|
164114
|
-
var
|
|
164115
|
-
var
|
|
164116
|
-
var
|
|
164114
|
+
var extname3 = path18.extname;
|
|
164115
|
+
var join29 = path18.join;
|
|
164116
|
+
var resolve16 = path18.resolve;
|
|
164117
164117
|
module.exports = View;
|
|
164118
164118
|
function View(name2, options8) {
|
|
164119
164119
|
var opts = options8 || {};
|
|
164120
164120
|
this.defaultEngine = opts.defaultEngine;
|
|
164121
|
-
this.ext =
|
|
164121
|
+
this.ext = extname3(name2);
|
|
164122
164122
|
this.name = name2;
|
|
164123
164123
|
this.root = opts.root;
|
|
164124
164124
|
if (!this.ext && !this.defaultEngine) {
|
|
@@ -164147,8 +164147,8 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164147
164147
|
debug('lookup "%s"', name2);
|
|
164148
164148
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
164149
164149
|
var root2 = roots[i5];
|
|
164150
|
-
var loc =
|
|
164151
|
-
var dir =
|
|
164150
|
+
var loc = resolve16(root2, name2);
|
|
164151
|
+
var dir = dirname21(loc);
|
|
164152
164152
|
var file2 = basename6(loc);
|
|
164153
164153
|
path19 = this.resolve(dir, file2);
|
|
164154
164154
|
}
|
|
@@ -164172,16 +164172,16 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164172
164172
|
});
|
|
164173
164173
|
sync = false;
|
|
164174
164174
|
};
|
|
164175
|
-
View.prototype.resolve = function
|
|
164175
|
+
View.prototype.resolve = function resolve17(dir, file2) {
|
|
164176
164176
|
var ext = this.ext;
|
|
164177
|
-
var path19 =
|
|
164178
|
-
var
|
|
164179
|
-
if (
|
|
164177
|
+
var path19 = join29(dir, file2);
|
|
164178
|
+
var stat4 = tryStat(path19);
|
|
164179
|
+
if (stat4 && stat4.isFile()) {
|
|
164180
164180
|
return path19;
|
|
164181
164181
|
}
|
|
164182
|
-
path19 =
|
|
164183
|
-
|
|
164184
|
-
if (
|
|
164182
|
+
path19 = join29(dir, basename6(file2, ext), "index" + ext);
|
|
164183
|
+
stat4 = tryStat(path19);
|
|
164184
|
+
if (stat4 && stat4.isFile()) {
|
|
164185
164185
|
return path19;
|
|
164186
164186
|
}
|
|
164187
164187
|
};
|
|
@@ -164232,9 +164232,9 @@ var require_etag = __commonJS((exports, module) => {
|
|
|
164232
164232
|
}
|
|
164233
164233
|
return obj && typeof obj === "object" && "ctime" in obj && toString2.call(obj.ctime) === "[object Date]" && "mtime" in obj && toString2.call(obj.mtime) === "[object Date]" && "ino" in obj && typeof obj.ino === "number" && "size" in obj && typeof obj.size === "number";
|
|
164234
164234
|
}
|
|
164235
|
-
function stattag(
|
|
164236
|
-
var mtime =
|
|
164237
|
-
var size =
|
|
164235
|
+
function stattag(stat4) {
|
|
164236
|
+
var mtime = stat4.mtime.getTime().toString(16);
|
|
164237
|
+
var size = stat4.size.toString(16);
|
|
164238
164238
|
return '"' + size + "-" + mtime + '"';
|
|
164239
164239
|
}
|
|
164240
164240
|
});
|
|
@@ -166331,7 +166331,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166331
166331
|
var compileETag = require_utils10().compileETag;
|
|
166332
166332
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
166333
166333
|
var compileTrust = require_utils10().compileTrust;
|
|
166334
|
-
var
|
|
166334
|
+
var resolve16 = __require("node:path").resolve;
|
|
166335
166335
|
var once9 = require_once();
|
|
166336
166336
|
var Router = require_router();
|
|
166337
166337
|
var slice = Array.prototype.slice;
|
|
@@ -166385,7 +166385,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166385
166385
|
this.mountpath = "/";
|
|
166386
166386
|
this.locals.settings = this.settings;
|
|
166387
166387
|
this.set("view", View);
|
|
166388
|
-
this.set("views",
|
|
166388
|
+
this.set("views", resolve16("views"));
|
|
166389
166389
|
this.set("jsonp callback name", "callback");
|
|
166390
166390
|
if (env4 === "production") {
|
|
166391
166391
|
this.enable("view cache");
|
|
@@ -167873,11 +167873,11 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167873
167873
|
var statuses = require_statuses();
|
|
167874
167874
|
var Stream2 = __require("stream");
|
|
167875
167875
|
var util2 = __require("util");
|
|
167876
|
-
var
|
|
167877
|
-
var
|
|
167876
|
+
var extname3 = path18.extname;
|
|
167877
|
+
var join29 = path18.join;
|
|
167878
167878
|
var normalize2 = path18.normalize;
|
|
167879
|
-
var
|
|
167880
|
-
var
|
|
167879
|
+
var resolve16 = path18.resolve;
|
|
167880
|
+
var sep2 = path18.sep;
|
|
167881
167881
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
167882
167882
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
167883
167883
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
@@ -167905,7 +167905,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167905
167905
|
this._maxage = opts.maxAge || opts.maxage;
|
|
167906
167906
|
this._maxage = typeof this._maxage === "string" ? ms9(this._maxage) : Number(this._maxage);
|
|
167907
167907
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
167908
|
-
this._root = opts.root ?
|
|
167908
|
+
this._root = opts.root ? resolve16(opts.root) : null;
|
|
167909
167909
|
}
|
|
167910
167910
|
util2.inherits(SendStream, Stream2);
|
|
167911
167911
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -168038,23 +168038,23 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168038
168038
|
var parts;
|
|
168039
168039
|
if (root2 !== null) {
|
|
168040
168040
|
if (path19) {
|
|
168041
|
-
path19 = normalize2("." +
|
|
168041
|
+
path19 = normalize2("." + sep2 + path19);
|
|
168042
168042
|
}
|
|
168043
168043
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
168044
168044
|
debug('malicious path "%s"', path19);
|
|
168045
168045
|
this.error(403);
|
|
168046
168046
|
return res;
|
|
168047
168047
|
}
|
|
168048
|
-
parts = path19.split(
|
|
168049
|
-
path19 = normalize2(
|
|
168048
|
+
parts = path19.split(sep2);
|
|
168049
|
+
path19 = normalize2(join29(root2, path19));
|
|
168050
168050
|
} else {
|
|
168051
168051
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
168052
168052
|
debug('malicious path "%s"', path19);
|
|
168053
168053
|
this.error(403);
|
|
168054
168054
|
return res;
|
|
168055
168055
|
}
|
|
168056
|
-
parts = normalize2(path19).split(
|
|
168057
|
-
path19 =
|
|
168056
|
+
parts = normalize2(path19).split(sep2);
|
|
168057
|
+
path19 = resolve16(path19);
|
|
168058
168058
|
}
|
|
168059
168059
|
if (containsDotFile(parts)) {
|
|
168060
168060
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -168077,8 +168077,8 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168077
168077
|
this.sendFile(path19);
|
|
168078
168078
|
return res;
|
|
168079
168079
|
};
|
|
168080
|
-
SendStream.prototype.send = function send2(path19,
|
|
168081
|
-
var len =
|
|
168080
|
+
SendStream.prototype.send = function send2(path19, stat4) {
|
|
168081
|
+
var len = stat4.size;
|
|
168082
168082
|
var options8 = this.options;
|
|
168083
168083
|
var opts = {};
|
|
168084
168084
|
var res = this.res;
|
|
@@ -168090,7 +168090,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168090
168090
|
return;
|
|
168091
168091
|
}
|
|
168092
168092
|
debug('pipe "%s"', path19);
|
|
168093
|
-
this.setHeader(path19,
|
|
168093
|
+
this.setHeader(path19, stat4);
|
|
168094
168094
|
this.type(path19);
|
|
168095
168095
|
if (this.isConditionalGET()) {
|
|
168096
168096
|
if (this.isPreconditionFailure()) {
|
|
@@ -168147,19 +168147,19 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168147
168147
|
var i5 = 0;
|
|
168148
168148
|
var self2 = this;
|
|
168149
168149
|
debug('stat "%s"', path19);
|
|
168150
|
-
fs28.stat(path19, function onstat(err,
|
|
168151
|
-
var pathEndsWithSep = path19[path19.length - 1] ===
|
|
168152
|
-
if (err && err.code === "ENOENT" && !
|
|
168150
|
+
fs28.stat(path19, function onstat(err, stat4) {
|
|
168151
|
+
var pathEndsWithSep = path19[path19.length - 1] === sep2;
|
|
168152
|
+
if (err && err.code === "ENOENT" && !extname3(path19) && !pathEndsWithSep) {
|
|
168153
168153
|
return next(err);
|
|
168154
168154
|
}
|
|
168155
168155
|
if (err)
|
|
168156
168156
|
return self2.onStatError(err);
|
|
168157
|
-
if (
|
|
168157
|
+
if (stat4.isDirectory())
|
|
168158
168158
|
return self2.redirect(path19);
|
|
168159
168159
|
if (pathEndsWithSep)
|
|
168160
168160
|
return self2.error(404);
|
|
168161
|
-
self2.emit("file", path19,
|
|
168162
|
-
self2.send(path19,
|
|
168161
|
+
self2.emit("file", path19, stat4);
|
|
168162
|
+
self2.send(path19, stat4);
|
|
168163
168163
|
});
|
|
168164
168164
|
function next(err) {
|
|
168165
168165
|
if (self2._extensions.length <= i5) {
|
|
@@ -168167,13 +168167,13 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168167
168167
|
}
|
|
168168
168168
|
var p4 = path19 + "." + self2._extensions[i5++];
|
|
168169
168169
|
debug('stat "%s"', p4);
|
|
168170
|
-
fs28.stat(p4, function(err2,
|
|
168170
|
+
fs28.stat(p4, function(err2, stat4) {
|
|
168171
168171
|
if (err2)
|
|
168172
168172
|
return next(err2);
|
|
168173
|
-
if (
|
|
168173
|
+
if (stat4.isDirectory())
|
|
168174
168174
|
return next();
|
|
168175
|
-
self2.emit("file", p4,
|
|
168176
|
-
self2.send(p4,
|
|
168175
|
+
self2.emit("file", p4, stat4);
|
|
168176
|
+
self2.send(p4, stat4);
|
|
168177
168177
|
});
|
|
168178
168178
|
}
|
|
168179
168179
|
};
|
|
@@ -168186,15 +168186,15 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168186
168186
|
return self2.onStatError(err);
|
|
168187
168187
|
return self2.error(404);
|
|
168188
168188
|
}
|
|
168189
|
-
var p4 =
|
|
168189
|
+
var p4 = join29(path19, self2._index[i5]);
|
|
168190
168190
|
debug('stat "%s"', p4);
|
|
168191
|
-
fs28.stat(p4, function(err2,
|
|
168191
|
+
fs28.stat(p4, function(err2, stat4) {
|
|
168192
168192
|
if (err2)
|
|
168193
168193
|
return next(err2);
|
|
168194
|
-
if (
|
|
168194
|
+
if (stat4.isDirectory())
|
|
168195
168195
|
return next();
|
|
168196
|
-
self2.emit("file", p4,
|
|
168197
|
-
self2.send(p4,
|
|
168196
|
+
self2.emit("file", p4, stat4);
|
|
168197
|
+
self2.send(p4, stat4);
|
|
168198
168198
|
});
|
|
168199
168199
|
}
|
|
168200
168200
|
next();
|
|
@@ -168221,14 +168221,14 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168221
168221
|
var res = this.res;
|
|
168222
168222
|
if (res.getHeader("Content-Type"))
|
|
168223
168223
|
return;
|
|
168224
|
-
var ext =
|
|
168224
|
+
var ext = extname3(path19);
|
|
168225
168225
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
168226
168226
|
debug("content-type %s", type2);
|
|
168227
168227
|
res.setHeader("Content-Type", type2);
|
|
168228
168228
|
};
|
|
168229
|
-
SendStream.prototype.setHeader = function setHeader(path19,
|
|
168229
|
+
SendStream.prototype.setHeader = function setHeader(path19, stat4) {
|
|
168230
168230
|
var res = this.res;
|
|
168231
|
-
this.emit("headers", res, path19,
|
|
168231
|
+
this.emit("headers", res, path19, stat4);
|
|
168232
168232
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
168233
168233
|
debug("accept ranges");
|
|
168234
168234
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -168242,12 +168242,12 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168242
168242
|
res.setHeader("Cache-Control", cacheControl);
|
|
168243
168243
|
}
|
|
168244
168244
|
if (this._lastModified && !res.getHeader("Last-Modified")) {
|
|
168245
|
-
var modified =
|
|
168245
|
+
var modified = stat4.mtime.toUTCString();
|
|
168246
168246
|
debug("modified %s", modified);
|
|
168247
168247
|
res.setHeader("Last-Modified", modified);
|
|
168248
168248
|
}
|
|
168249
168249
|
if (this._etag && !res.getHeader("ETag")) {
|
|
168250
|
-
var val = etag(
|
|
168250
|
+
var val = etag(stat4);
|
|
168251
168251
|
debug("etag %s", val);
|
|
168252
168252
|
res.setHeader("ETag", val);
|
|
168253
168253
|
}
|
|
@@ -168381,8 +168381,8 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168381
168381
|
var setCharset = require_utils10().setCharset;
|
|
168382
168382
|
var cookie = require_cookie();
|
|
168383
168383
|
var send = require_send();
|
|
168384
|
-
var
|
|
168385
|
-
var
|
|
168384
|
+
var extname3 = path18.extname;
|
|
168385
|
+
var resolve16 = path18.resolve;
|
|
168386
168386
|
var vary = require_vary();
|
|
168387
168387
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
168388
168388
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -168591,7 +168591,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168591
168591
|
}
|
|
168592
168592
|
opts = Object.create(opts);
|
|
168593
168593
|
opts.headers = headers;
|
|
168594
|
-
var fullPath = !opts.root ?
|
|
168594
|
+
var fullPath = !opts.root ? resolve16(path19) : path19;
|
|
168595
168595
|
return this.sendFile(fullPath, opts, done);
|
|
168596
168596
|
};
|
|
168597
168597
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -168622,7 +168622,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168622
168622
|
};
|
|
168623
168623
|
res.attachment = function attachment(filename) {
|
|
168624
168624
|
if (filename) {
|
|
168625
|
-
this.type(
|
|
168625
|
+
this.type(extname3(filename));
|
|
168626
168626
|
}
|
|
168627
168627
|
this.set("Content-Disposition", contentDisposition(filename));
|
|
168628
168628
|
return this;
|
|
@@ -168852,7 +168852,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168852
168852
|
var encodeUrl = require_encodeurl();
|
|
168853
168853
|
var escapeHtml = require_escape_html();
|
|
168854
168854
|
var parseUrl = require_parseurl();
|
|
168855
|
-
var
|
|
168855
|
+
var resolve16 = __require("path").resolve;
|
|
168856
168856
|
var send = require_send();
|
|
168857
168857
|
var url3 = __require("url");
|
|
168858
168858
|
module.exports = serveStatic;
|
|
@@ -168871,7 +168871,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168871
168871
|
throw new TypeError("option setHeaders must be function");
|
|
168872
168872
|
}
|
|
168873
168873
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
168874
|
-
opts.root =
|
|
168874
|
+
opts.root = resolve16(root2);
|
|
168875
168875
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
168876
168876
|
return function serveStatic2(req, res, next) {
|
|
168877
168877
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -169795,8 +169795,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
169795
169795
|
}
|
|
169796
169796
|
return parsed;
|
|
169797
169797
|
}
|
|
169798
|
-
function resolveUrl(
|
|
169799
|
-
return useNativeURL ? new URL2(
|
|
169798
|
+
function resolveUrl(relative5, base) {
|
|
169799
|
+
return useNativeURL ? new URL2(relative5, base) : parseUrl(url3.resolve(base, relative5));
|
|
169800
169800
|
}
|
|
169801
169801
|
function validateUrl(input) {
|
|
169802
169802
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -172245,8 +172245,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
172245
172245
|
}
|
|
172246
172246
|
resetBuffer() {
|
|
172247
172247
|
this.buffer = new Waterfall;
|
|
172248
|
-
this.buffer.chain(new Promise((
|
|
172249
|
-
this._triggerBuffer =
|
|
172248
|
+
this.buffer.chain(new Promise((resolve16) => {
|
|
172249
|
+
this._triggerBuffer = resolve16;
|
|
172250
172250
|
}));
|
|
172251
172251
|
if (this.ready)
|
|
172252
172252
|
this._triggerBuffer();
|
|
@@ -173266,7 +173266,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173266
173266
|
throw e8;
|
|
173267
173267
|
}
|
|
173268
173268
|
};
|
|
173269
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
173269
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve16, reject) => {
|
|
173270
173270
|
try {
|
|
173271
173271
|
const stream = writeFileStream(filename, { mode });
|
|
173272
173272
|
const readable2 = Readable6.from(lines);
|
|
@@ -173283,7 +173283,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173283
173283
|
if (err)
|
|
173284
173284
|
reject(err);
|
|
173285
173285
|
else
|
|
173286
|
-
|
|
173286
|
+
resolve16();
|
|
173287
173287
|
});
|
|
173288
173288
|
});
|
|
173289
173289
|
readable2.on("error", (err) => {
|
|
@@ -173454,7 +173454,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173454
173454
|
return { data: tdata, indexes };
|
|
173455
173455
|
}
|
|
173456
173456
|
treatRawStreamAsync(rawStream) {
|
|
173457
|
-
return new Promise((
|
|
173457
|
+
return new Promise((resolve16, reject) => {
|
|
173458
173458
|
const dataById = {};
|
|
173459
173459
|
const indexes = {};
|
|
173460
173460
|
let corruptItems = 0;
|
|
@@ -173497,7 +173497,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173497
173497
|
}
|
|
173498
173498
|
}
|
|
173499
173499
|
const data = Object.values(dataById);
|
|
173500
|
-
|
|
173500
|
+
resolve16({ data, indexes });
|
|
173501
173501
|
});
|
|
173502
173502
|
lineStream.on("error", function(err) {
|
|
173503
173503
|
reject(err, null);
|
|
@@ -183030,7 +183030,7 @@ var require_mime_types2 = __commonJS((exports) => {
|
|
|
183030
183030
|
* MIT Licensed
|
|
183031
183031
|
*/
|
|
183032
183032
|
var db2 = require_db2();
|
|
183033
|
-
var
|
|
183033
|
+
var extname3 = __require("path").extname;
|
|
183034
183034
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
183035
183035
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
183036
183036
|
exports.charset = charset;
|
|
@@ -183085,7 +183085,7 @@ var require_mime_types2 = __commonJS((exports) => {
|
|
|
183085
183085
|
if (!path18 || typeof path18 !== "string") {
|
|
183086
183086
|
return false;
|
|
183087
183087
|
}
|
|
183088
|
-
var extension2 =
|
|
183088
|
+
var extension2 = extname3("x." + path18).toLowerCase().substr(1);
|
|
183089
183089
|
if (!extension2) {
|
|
183090
183090
|
return false;
|
|
183091
183091
|
}
|
|
@@ -193077,7 +193077,7 @@ var require_mime_types3 = __commonJS((exports) => {
|
|
|
193077
193077
|
* MIT Licensed
|
|
193078
193078
|
*/
|
|
193079
193079
|
var db2 = require_db3();
|
|
193080
|
-
var
|
|
193080
|
+
var extname3 = __require("path").extname;
|
|
193081
193081
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
193082
193082
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
193083
193083
|
exports.charset = charset;
|
|
@@ -193132,7 +193132,7 @@ var require_mime_types3 = __commonJS((exports) => {
|
|
|
193132
193132
|
if (!path18 || typeof path18 !== "string") {
|
|
193133
193133
|
return false;
|
|
193134
193134
|
}
|
|
193135
|
-
var extension2 =
|
|
193135
|
+
var extension2 = extname3("x." + path18).toLowerCase().substr(1);
|
|
193136
193136
|
if (!extension2) {
|
|
193137
193137
|
return false;
|
|
193138
193138
|
}
|
|
@@ -195655,7 +195655,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
195655
195655
|
var http = __require("http");
|
|
195656
195656
|
var net2 = __require("net");
|
|
195657
195657
|
var tls = __require("tls");
|
|
195658
|
-
var { randomBytes: randomBytes2, createHash } = __require("crypto");
|
|
195658
|
+
var { randomBytes: randomBytes2, createHash: createHash2 } = __require("crypto");
|
|
195659
195659
|
var { Duplex: Duplex4, Readable: Readable6 } = __require("stream");
|
|
195660
195660
|
var { URL: URL2 } = __require("url");
|
|
195661
195661
|
var PerMessageDeflate = require_permessage_deflate();
|
|
@@ -196187,7 +196187,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
196187
196187
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
196188
196188
|
return;
|
|
196189
196189
|
}
|
|
196190
|
-
const digest =
|
|
196190
|
+
const digest = createHash2("sha1").update(key2 + GUID).digest("base64");
|
|
196191
196191
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
196192
196192
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
196193
196193
|
return;
|
|
@@ -196560,7 +196560,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
196560
196560
|
var EventEmitter3 = __require("events");
|
|
196561
196561
|
var http = __require("http");
|
|
196562
196562
|
var { Duplex: Duplex4 } = __require("stream");
|
|
196563
|
-
var { createHash } = __require("crypto");
|
|
196563
|
+
var { createHash: createHash2 } = __require("crypto");
|
|
196564
196564
|
var extension = require_extension();
|
|
196565
196565
|
var PerMessageDeflate = require_permessage_deflate();
|
|
196566
196566
|
var subprotocol = require_subprotocol();
|
|
@@ -196768,7 +196768,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
196768
196768
|
}
|
|
196769
196769
|
if (this._state > RUNNING)
|
|
196770
196770
|
return abortHandshake(socket, 503);
|
|
196771
|
-
const digest =
|
|
196771
|
+
const digest = createHash2("sha1").update(key2 + GUID).digest("base64");
|
|
196772
196772
|
const headers = [
|
|
196773
196773
|
"HTTP/1.1 101 Switching Protocols",
|
|
196774
196774
|
"Upgrade: websocket",
|
|
@@ -199108,13 +199108,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
199108
199108
|
return true;
|
|
199109
199109
|
}
|
|
199110
199110
|
emitWithAck(ev2, ...args) {
|
|
199111
|
-
return new Promise((
|
|
199111
|
+
return new Promise((resolve16, reject) => {
|
|
199112
199112
|
args.push((err, responses) => {
|
|
199113
199113
|
if (err) {
|
|
199114
199114
|
err.responses = responses;
|
|
199115
199115
|
return reject(err);
|
|
199116
199116
|
} else {
|
|
199117
|
-
return
|
|
199117
|
+
return resolve16(responses);
|
|
199118
199118
|
}
|
|
199119
199119
|
});
|
|
199120
199120
|
this.emit(ev2, ...args);
|
|
@@ -199302,12 +199302,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
199302
199302
|
}
|
|
199303
199303
|
emitWithAck(ev2, ...args) {
|
|
199304
199304
|
const withErr = this.flags.timeout !== undefined;
|
|
199305
|
-
return new Promise((
|
|
199305
|
+
return new Promise((resolve16, reject) => {
|
|
199306
199306
|
args.push((arg1, arg2) => {
|
|
199307
199307
|
if (withErr) {
|
|
199308
|
-
return arg1 ? reject(arg1) :
|
|
199308
|
+
return arg1 ? reject(arg1) : resolve16(arg2);
|
|
199309
199309
|
} else {
|
|
199310
|
-
return
|
|
199310
|
+
return resolve16(arg1);
|
|
199311
199311
|
}
|
|
199312
199312
|
});
|
|
199313
199313
|
this.emit(ev2, ...args);
|
|
@@ -199762,13 +199762,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
199762
199762
|
return true;
|
|
199763
199763
|
}
|
|
199764
199764
|
serverSideEmitWithAck(ev2, ...args) {
|
|
199765
|
-
return new Promise((
|
|
199765
|
+
return new Promise((resolve16, reject) => {
|
|
199766
199766
|
args.push((err, responses) => {
|
|
199767
199767
|
if (err) {
|
|
199768
199768
|
err.responses = responses;
|
|
199769
199769
|
return reject(err);
|
|
199770
199770
|
} else {
|
|
199771
|
-
return
|
|
199771
|
+
return resolve16(responses);
|
|
199772
199772
|
}
|
|
199773
199773
|
});
|
|
199774
199774
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -201483,7 +201483,7 @@ var require_websocket4 = __commonJS((exports, module) => {
|
|
|
201483
201483
|
var http = __require("http");
|
|
201484
201484
|
var net2 = __require("net");
|
|
201485
201485
|
var tls = __require("tls");
|
|
201486
|
-
var { randomBytes: randomBytes2, createHash } = __require("crypto");
|
|
201486
|
+
var { randomBytes: randomBytes2, createHash: createHash2 } = __require("crypto");
|
|
201487
201487
|
var { Duplex: Duplex4, Readable: Readable6 } = __require("stream");
|
|
201488
201488
|
var { URL: URL2 } = __require("url");
|
|
201489
201489
|
var PerMessageDeflate = require_permessage_deflate2();
|
|
@@ -202015,7 +202015,7 @@ var require_websocket4 = __commonJS((exports, module) => {
|
|
|
202015
202015
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
202016
202016
|
return;
|
|
202017
202017
|
}
|
|
202018
|
-
const digest =
|
|
202018
|
+
const digest = createHash2("sha1").update(key2 + GUID).digest("base64");
|
|
202019
202019
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
202020
202020
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
202021
202021
|
return;
|
|
@@ -202388,7 +202388,7 @@ var require_websocket_server2 = __commonJS((exports, module) => {
|
|
|
202388
202388
|
var EventEmitter3 = __require("events");
|
|
202389
202389
|
var http = __require("http");
|
|
202390
202390
|
var { Duplex: Duplex4 } = __require("stream");
|
|
202391
|
-
var { createHash } = __require("crypto");
|
|
202391
|
+
var { createHash: createHash2 } = __require("crypto");
|
|
202392
202392
|
var extension = require_extension2();
|
|
202393
202393
|
var PerMessageDeflate = require_permessage_deflate2();
|
|
202394
202394
|
var subprotocol = require_subprotocol2();
|
|
@@ -202596,7 +202596,7 @@ var require_websocket_server2 = __commonJS((exports, module) => {
|
|
|
202596
202596
|
}
|
|
202597
202597
|
if (this._state > RUNNING)
|
|
202598
202598
|
return abortHandshake(socket, 503);
|
|
202599
|
-
const digest =
|
|
202599
|
+
const digest = createHash2("sha1").update(key2 + GUID).digest("base64");
|
|
202600
202600
|
const headers = [
|
|
202601
202601
|
"HTTP/1.1 101 Switching Protocols",
|
|
202602
202602
|
"Upgrade: websocket",
|
|
@@ -203303,7 +203303,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
203303
203303
|
return localSockets;
|
|
203304
203304
|
}
|
|
203305
203305
|
const requestId = randomId();
|
|
203306
|
-
return new Promise((
|
|
203306
|
+
return new Promise((resolve16, reject) => {
|
|
203307
203307
|
const timeout3 = setTimeout(() => {
|
|
203308
203308
|
const storedRequest2 = this.requests.get(requestId);
|
|
203309
203309
|
if (storedRequest2) {
|
|
@@ -203313,7 +203313,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
203313
203313
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
203314
203314
|
const storedRequest = {
|
|
203315
203315
|
type: MessageType.FETCH_SOCKETS,
|
|
203316
|
-
resolve:
|
|
203316
|
+
resolve: resolve16,
|
|
203317
203317
|
timeout: timeout3,
|
|
203318
203318
|
current: 0,
|
|
203319
203319
|
expected: expectedResponseCount,
|
|
@@ -203523,7 +203523,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
203523
203523
|
return localSockets;
|
|
203524
203524
|
}
|
|
203525
203525
|
const requestId = randomId();
|
|
203526
|
-
return new Promise((
|
|
203526
|
+
return new Promise((resolve16, reject) => {
|
|
203527
203527
|
const timeout3 = setTimeout(() => {
|
|
203528
203528
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
203529
203529
|
if (storedRequest2) {
|
|
@@ -203533,7 +203533,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
203533
203533
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
203534
203534
|
const storedRequest = {
|
|
203535
203535
|
type: MessageType.FETCH_SOCKETS,
|
|
203536
|
-
resolve:
|
|
203536
|
+
resolve: resolve16,
|
|
203537
203537
|
timeout: timeout3,
|
|
203538
203538
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
203539
203539
|
responses: localSockets
|
|
@@ -204262,13 +204262,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
204262
204262
|
this.engine.close();
|
|
204263
204263
|
(0, uws_1.restoreAdapter)();
|
|
204264
204264
|
if (this.httpServer) {
|
|
204265
|
-
return new Promise((
|
|
204265
|
+
return new Promise((resolve16) => {
|
|
204266
204266
|
this.httpServer.close((err) => {
|
|
204267
204267
|
fn9 && fn9(err);
|
|
204268
204268
|
if (err) {
|
|
204269
204269
|
debug("server was not running");
|
|
204270
204270
|
}
|
|
204271
|
-
|
|
204271
|
+
resolve16();
|
|
204272
204272
|
});
|
|
204273
204273
|
});
|
|
204274
204274
|
} else {
|
|
@@ -213004,7 +213004,7 @@ var require_mime_types4 = __commonJS((exports) => {
|
|
|
213004
213004
|
* MIT Licensed
|
|
213005
213005
|
*/
|
|
213006
213006
|
var db2 = require_db4();
|
|
213007
|
-
var
|
|
213007
|
+
var extname3 = __require("path").extname;
|
|
213008
213008
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
213009
213009
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
213010
213010
|
exports.charset = charset;
|
|
@@ -213059,7 +213059,7 @@ var require_mime_types4 = __commonJS((exports) => {
|
|
|
213059
213059
|
if (!path18 || typeof path18 !== "string") {
|
|
213060
213060
|
return false;
|
|
213061
213061
|
}
|
|
213062
|
-
var extension2 =
|
|
213062
|
+
var extension2 = extname3("x." + path18).toLowerCase().substr(1);
|
|
213063
213063
|
if (!extension2) {
|
|
213064
213064
|
return false;
|
|
213065
213065
|
}
|
|
@@ -217391,8 +217391,8 @@ var require_mkdirp = __commonJS((exports, module) => {
|
|
|
217391
217391
|
});
|
|
217392
217392
|
break;
|
|
217393
217393
|
default:
|
|
217394
|
-
xfs.stat(p4, function(er22,
|
|
217395
|
-
if (er22 || !
|
|
217394
|
+
xfs.stat(p4, function(er22, stat4) {
|
|
217395
|
+
if (er22 || !stat4.isDirectory())
|
|
217396
217396
|
cb2(er10, made);
|
|
217397
217397
|
else
|
|
217398
217398
|
cb2(null, made);
|
|
@@ -217423,13 +217423,13 @@ var require_mkdirp = __commonJS((exports, module) => {
|
|
|
217423
217423
|
sync(p4, opts, made);
|
|
217424
217424
|
break;
|
|
217425
217425
|
default:
|
|
217426
|
-
var
|
|
217426
|
+
var stat4;
|
|
217427
217427
|
try {
|
|
217428
|
-
|
|
217428
|
+
stat4 = xfs.statSync(p4);
|
|
217429
217429
|
} catch (err1) {
|
|
217430
217430
|
throw err0;
|
|
217431
217431
|
}
|
|
217432
|
-
if (!
|
|
217432
|
+
if (!stat4.isDirectory())
|
|
217433
217433
|
throw err0;
|
|
217434
217434
|
break;
|
|
217435
217435
|
}
|
|
@@ -217632,7 +217632,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
217632
217632
|
}
|
|
217633
217633
|
}, {
|
|
217634
217634
|
key: "join",
|
|
217635
|
-
value: function
|
|
217635
|
+
value: function join31(s5) {
|
|
217636
217636
|
if (this.length === 0)
|
|
217637
217637
|
return "";
|
|
217638
217638
|
var p4 = this.head;
|
|
@@ -218930,14 +218930,14 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
218930
218930
|
};
|
|
218931
218931
|
}
|
|
218932
218932
|
function readAndResolve(iter) {
|
|
218933
|
-
var
|
|
218934
|
-
if (
|
|
218933
|
+
var resolve16 = iter[kLastResolve];
|
|
218934
|
+
if (resolve16 !== null) {
|
|
218935
218935
|
var data = iter[kStream].read();
|
|
218936
218936
|
if (data !== null) {
|
|
218937
218937
|
iter[kLastPromise] = null;
|
|
218938
218938
|
iter[kLastResolve] = null;
|
|
218939
218939
|
iter[kLastReject] = null;
|
|
218940
|
-
|
|
218940
|
+
resolve16(createIterResult(data, false));
|
|
218941
218941
|
}
|
|
218942
218942
|
}
|
|
218943
218943
|
}
|
|
@@ -218945,13 +218945,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
218945
218945
|
process.nextTick(readAndResolve, iter);
|
|
218946
218946
|
}
|
|
218947
218947
|
function wrapForNext(lastPromise, iter) {
|
|
218948
|
-
return function(
|
|
218948
|
+
return function(resolve16, reject) {
|
|
218949
218949
|
lastPromise.then(function() {
|
|
218950
218950
|
if (iter[kEnded]) {
|
|
218951
|
-
|
|
218951
|
+
resolve16(createIterResult(undefined, true));
|
|
218952
218952
|
return;
|
|
218953
218953
|
}
|
|
218954
|
-
iter[kHandlePromise](
|
|
218954
|
+
iter[kHandlePromise](resolve16, reject);
|
|
218955
218955
|
}, reject);
|
|
218956
218956
|
};
|
|
218957
218957
|
}
|
|
@@ -218970,12 +218970,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
218970
218970
|
return Promise.resolve(createIterResult(undefined, true));
|
|
218971
218971
|
}
|
|
218972
218972
|
if (this[kStream].destroyed) {
|
|
218973
|
-
return new Promise(function(
|
|
218973
|
+
return new Promise(function(resolve16, reject) {
|
|
218974
218974
|
process.nextTick(function() {
|
|
218975
218975
|
if (_this[kError]) {
|
|
218976
218976
|
reject(_this[kError]);
|
|
218977
218977
|
} else {
|
|
218978
|
-
|
|
218978
|
+
resolve16(createIterResult(undefined, true));
|
|
218979
218979
|
}
|
|
218980
218980
|
});
|
|
218981
218981
|
});
|
|
@@ -218998,13 +218998,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
218998
218998
|
return this;
|
|
218999
218999
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
219000
219000
|
var _this2 = this;
|
|
219001
|
-
return new Promise(function(
|
|
219001
|
+
return new Promise(function(resolve16, reject) {
|
|
219002
219002
|
_this2[kStream].destroy(null, function(err) {
|
|
219003
219003
|
if (err) {
|
|
219004
219004
|
reject(err);
|
|
219005
219005
|
return;
|
|
219006
219006
|
}
|
|
219007
|
-
|
|
219007
|
+
resolve16(createIterResult(undefined, true));
|
|
219008
219008
|
});
|
|
219009
219009
|
});
|
|
219010
219010
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -219026,15 +219026,15 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
219026
219026
|
value: stream._readableState.endEmitted,
|
|
219027
219027
|
writable: true
|
|
219028
219028
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
219029
|
-
value: function value(
|
|
219029
|
+
value: function value(resolve16, reject) {
|
|
219030
219030
|
var data = iterator[kStream].read();
|
|
219031
219031
|
if (data) {
|
|
219032
219032
|
iterator[kLastPromise] = null;
|
|
219033
219033
|
iterator[kLastResolve] = null;
|
|
219034
219034
|
iterator[kLastReject] = null;
|
|
219035
|
-
|
|
219035
|
+
resolve16(createIterResult(data, false));
|
|
219036
219036
|
} else {
|
|
219037
|
-
iterator[kLastResolve] =
|
|
219037
|
+
iterator[kLastResolve] = resolve16;
|
|
219038
219038
|
iterator[kLastReject] = reject;
|
|
219039
219039
|
}
|
|
219040
219040
|
},
|
|
@@ -219053,12 +219053,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
219053
219053
|
iterator[kError] = err;
|
|
219054
219054
|
return;
|
|
219055
219055
|
}
|
|
219056
|
-
var
|
|
219057
|
-
if (
|
|
219056
|
+
var resolve16 = iterator[kLastResolve];
|
|
219057
|
+
if (resolve16 !== null) {
|
|
219058
219058
|
iterator[kLastPromise] = null;
|
|
219059
219059
|
iterator[kLastResolve] = null;
|
|
219060
219060
|
iterator[kLastReject] = null;
|
|
219061
|
-
|
|
219061
|
+
resolve16(createIterResult(undefined, true));
|
|
219062
219062
|
}
|
|
219063
219063
|
iterator[kEnded] = true;
|
|
219064
219064
|
});
|
|
@@ -219070,7 +219070,7 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
219070
219070
|
|
|
219071
219071
|
// ../../node_modules/readable-stream/lib/internal/streams/from.js
|
|
219072
219072
|
var require_from = __commonJS((exports, module) => {
|
|
219073
|
-
function asyncGeneratorStep(gen,
|
|
219073
|
+
function asyncGeneratorStep(gen, resolve16, reject, _next, _throw, key2, arg) {
|
|
219074
219074
|
try {
|
|
219075
219075
|
var info = gen[key2](arg);
|
|
219076
219076
|
var value = info.value;
|
|
@@ -219079,7 +219079,7 @@ var require_from = __commonJS((exports, module) => {
|
|
|
219079
219079
|
return;
|
|
219080
219080
|
}
|
|
219081
219081
|
if (info.done) {
|
|
219082
|
-
|
|
219082
|
+
resolve16(value);
|
|
219083
219083
|
} else {
|
|
219084
219084
|
Promise.resolve(value).then(_next, _throw);
|
|
219085
219085
|
}
|
|
@@ -219087,13 +219087,13 @@ var require_from = __commonJS((exports, module) => {
|
|
|
219087
219087
|
function _asyncToGenerator(fn9) {
|
|
219088
219088
|
return function() {
|
|
219089
219089
|
var self2 = this, args = arguments;
|
|
219090
|
-
return new Promise(function(
|
|
219090
|
+
return new Promise(function(resolve16, reject) {
|
|
219091
219091
|
var gen = fn9.apply(self2, args);
|
|
219092
219092
|
function _next(value) {
|
|
219093
|
-
asyncGeneratorStep(gen,
|
|
219093
|
+
asyncGeneratorStep(gen, resolve16, reject, _next, _throw, "next", value);
|
|
219094
219094
|
}
|
|
219095
219095
|
function _throw(err) {
|
|
219096
|
-
asyncGeneratorStep(gen,
|
|
219096
|
+
asyncGeneratorStep(gen, resolve16, reject, _next, _throw, "throw", err);
|
|
219097
219097
|
}
|
|
219098
219098
|
_next(undefined);
|
|
219099
219099
|
});
|
|
@@ -221220,7 +221220,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
221220
221220
|
determineAgent: () => determineAgent
|
|
221221
221221
|
});
|
|
221222
221222
|
module.exports = __toCommonJS2(src_exports);
|
|
221223
|
-
var
|
|
221223
|
+
var import_promises26 = __require("node:fs/promises");
|
|
221224
221224
|
var import_node_fs24 = __require("node:fs");
|
|
221225
221225
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
221226
221226
|
var CURSOR2 = "cursor";
|
|
@@ -221278,7 +221278,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
221278
221278
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
221279
221279
|
}
|
|
221280
221280
|
try {
|
|
221281
|
-
await (0,
|
|
221281
|
+
await (0, import_promises26.access)(DEVIN_LOCAL_PATH, import_node_fs24.constants.F_OK);
|
|
221282
221282
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
221283
221283
|
} catch (error48) {}
|
|
221284
221284
|
return { isAgent: false, agent: undefined };
|
|
@@ -237049,7 +237049,7 @@ function normalizeBase44Env() {
|
|
|
237049
237049
|
loadProjectEnvFiles();
|
|
237050
237050
|
|
|
237051
237051
|
// src/cli/index.ts
|
|
237052
|
-
import { dirname as
|
|
237052
|
+
import { dirname as dirname26, join as join36 } from "node:path";
|
|
237053
237053
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
237054
237054
|
|
|
237055
237055
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -238257,7 +238257,7 @@ var {
|
|
|
238257
238257
|
} = import__.default;
|
|
238258
238258
|
|
|
238259
238259
|
// src/cli/commands/agent-skills/pull.ts
|
|
238260
|
-
import { dirname as
|
|
238260
|
+
import { dirname as dirname11, join as join17 } from "node:path";
|
|
238261
238261
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
238262
238262
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
238263
238263
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -244912,15 +244912,14 @@ async function setAppVisibility(visibility) {
|
|
|
244912
244912
|
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
244913
244913
|
}
|
|
244914
244914
|
}
|
|
244915
|
-
async function listProjects(
|
|
244915
|
+
async function listProjects() {
|
|
244916
244916
|
let response;
|
|
244917
244917
|
try {
|
|
244918
244918
|
response = await base44Client.get("api/apps", {
|
|
244919
244919
|
searchParams: {
|
|
244920
244920
|
sort: "-updated_date",
|
|
244921
244921
|
fields: "id,name,user_description,is_managed_source_code",
|
|
244922
|
-
limit: 50
|
|
244923
|
-
...options.workspaceId ? { workspace_id: options.workspaceId } : {}
|
|
244922
|
+
limit: 50
|
|
244924
244923
|
}
|
|
244925
244924
|
});
|
|
244926
244925
|
} catch (error48) {
|
|
@@ -247552,7 +247551,7 @@ async function deployAll(projectData, options) {
|
|
|
247552
247551
|
await authConfigResource.push(authConfig);
|
|
247553
247552
|
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
247554
247553
|
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
247555
|
-
if (project.site?.outputDirectory) {
|
|
247554
|
+
if ((options?.site ?? true) && project.site?.outputDirectory) {
|
|
247556
247555
|
const outputDir = resolve3(project.root, project.site.outputDirectory);
|
|
247557
247556
|
const { appUrl } = await deploySite(outputDir);
|
|
247558
247557
|
return { appUrl, connectorResults };
|
|
@@ -254715,6 +254714,667 @@ function formatYaml(data, options = {}) {
|
|
|
254715
254714
|
const replacer = stripEmpty ? stripEmptyReplacer : undefined;
|
|
254716
254715
|
return $stringify(data, replacer, { indent: YAML_INDENT }).trimEnd();
|
|
254717
254716
|
}
|
|
254717
|
+
// src/core/deployments/api.ts
|
|
254718
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
254719
|
+
|
|
254720
|
+
// src/core/deployments/schema.ts
|
|
254721
|
+
var GIT_HASH_PATTERN = /^[a-fA-F0-9]{7,64}$/;
|
|
254722
|
+
var CreateDeploymentResponseSchema = exports_external.object({
|
|
254723
|
+
deployment_id: exports_external.string(),
|
|
254724
|
+
asset_buckets: exports_external.array(exports_external.array(exports_external.string()))
|
|
254725
|
+
}).transform((data) => ({
|
|
254726
|
+
deploymentId: data.deployment_id,
|
|
254727
|
+
assetBuckets: data.asset_buckets
|
|
254728
|
+
}));
|
|
254729
|
+
var AssetUploadResponseSchema = exports_external.looseObject({
|
|
254730
|
+
result: exports_external.looseObject({ jwt: exports_external.string().nullable().optional() }).nullable().optional()
|
|
254731
|
+
});
|
|
254732
|
+
var FinalizeDeploymentResponseSchema = exports_external.object({
|
|
254733
|
+
deployment_id: exports_external.string()
|
|
254734
|
+
}).transform((data) => ({
|
|
254735
|
+
deploymentId: data.deployment_id
|
|
254736
|
+
}));
|
|
254737
|
+
|
|
254738
|
+
// src/core/deployments/api.ts
|
|
254739
|
+
var MODULE_CONTENT_TYPES = {
|
|
254740
|
+
esm: "application/javascript+module",
|
|
254741
|
+
sourcemap: "application/source-map",
|
|
254742
|
+
wasm: "application/wasm",
|
|
254743
|
+
text: "text/plain",
|
|
254744
|
+
data: "application/octet-stream"
|
|
254745
|
+
};
|
|
254746
|
+
async function createDeployment(request) {
|
|
254747
|
+
const appClient = getAppClient();
|
|
254748
|
+
let response;
|
|
254749
|
+
try {
|
|
254750
|
+
response = await appClient.post("deployments", {
|
|
254751
|
+
json: request,
|
|
254752
|
+
timeout: 120000
|
|
254753
|
+
});
|
|
254754
|
+
} catch (error48) {
|
|
254755
|
+
throw await ApiError.fromHttpError(error48, "creating deployment");
|
|
254756
|
+
}
|
|
254757
|
+
const result = CreateDeploymentResponseSchema.safeParse(await response.json());
|
|
254758
|
+
if (!result.success) {
|
|
254759
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
254760
|
+
}
|
|
254761
|
+
return result.data;
|
|
254762
|
+
}
|
|
254763
|
+
async function uploadAssetBucket(deploymentId, formData) {
|
|
254764
|
+
const appClient = getAppClient();
|
|
254765
|
+
const response = await appClient.post(`deployments/${encodeURIComponent(deploymentId)}/assets`, {
|
|
254766
|
+
searchParams: { base64: "true" },
|
|
254767
|
+
body: formData,
|
|
254768
|
+
timeout: 120000,
|
|
254769
|
+
retry: 0
|
|
254770
|
+
});
|
|
254771
|
+
const parsed = AssetUploadResponseSchema.safeParse(await response.json());
|
|
254772
|
+
const jwt3 = parsed.success ? parsed.data.result?.jwt : null;
|
|
254773
|
+
return jwt3 || null;
|
|
254774
|
+
}
|
|
254775
|
+
async function finalizeDeployment(deploymentId, completionJwt, modules) {
|
|
254776
|
+
const appClient = getAppClient();
|
|
254777
|
+
const formData = new FormData;
|
|
254778
|
+
formData.append("payload", JSON.stringify({ completion_jwt: completionJwt }));
|
|
254779
|
+
for (const module of modules) {
|
|
254780
|
+
const content = module.content !== undefined ? module.content : new Uint8Array(await readFile2(module.absolutePath));
|
|
254781
|
+
formData.append(module.name, new File([content], module.name, {
|
|
254782
|
+
type: MODULE_CONTENT_TYPES[module.type]
|
|
254783
|
+
}));
|
|
254784
|
+
}
|
|
254785
|
+
let response;
|
|
254786
|
+
try {
|
|
254787
|
+
response = await appClient.post(`deployments/${encodeURIComponent(deploymentId)}/finalize`, { body: formData, timeout: 180000 });
|
|
254788
|
+
} catch (error48) {
|
|
254789
|
+
throw await ApiError.fromHttpError(error48, "finalizing deployment");
|
|
254790
|
+
}
|
|
254791
|
+
const result = FinalizeDeploymentResponseSchema.safeParse(await response.json());
|
|
254792
|
+
if (!result.success) {
|
|
254793
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
254794
|
+
}
|
|
254795
|
+
return result.data;
|
|
254796
|
+
}
|
|
254797
|
+
// src/core/deployments/manifest.ts
|
|
254798
|
+
import { createHash } from "node:crypto";
|
|
254799
|
+
import { readdir as readdir2, readFile as readFile3, stat } from "node:fs/promises";
|
|
254800
|
+
import { extname, join as join15 } from "node:path";
|
|
254801
|
+
var MAX_ASSET_SIZE_BYTES = 25 * 1024 * 1024;
|
|
254802
|
+
var MAX_ASSET_COUNT = 1e5;
|
|
254803
|
+
var ASSETS_IGNORE_FILE = ".assetsignore";
|
|
254804
|
+
var ALWAYS_SKIPPED_FILES = new Set([
|
|
254805
|
+
ASSETS_IGNORE_FILE,
|
|
254806
|
+
"wrangler.json",
|
|
254807
|
+
".dev.vars"
|
|
254808
|
+
]);
|
|
254809
|
+
var MIME_TYPES = {
|
|
254810
|
+
".html": "text/html",
|
|
254811
|
+
".htm": "text/html",
|
|
254812
|
+
".css": "text/css",
|
|
254813
|
+
".js": "text/javascript",
|
|
254814
|
+
".mjs": "text/javascript",
|
|
254815
|
+
".json": "application/json",
|
|
254816
|
+
".map": "application/json",
|
|
254817
|
+
".txt": "text/plain",
|
|
254818
|
+
".xml": "application/xml",
|
|
254819
|
+
".svg": "image/svg+xml",
|
|
254820
|
+
".png": "image/png",
|
|
254821
|
+
".jpg": "image/jpeg",
|
|
254822
|
+
".jpeg": "image/jpeg",
|
|
254823
|
+
".gif": "image/gif",
|
|
254824
|
+
".webp": "image/webp",
|
|
254825
|
+
".avif": "image/avif",
|
|
254826
|
+
".ico": "image/x-icon",
|
|
254827
|
+
".woff": "font/woff",
|
|
254828
|
+
".woff2": "font/woff2",
|
|
254829
|
+
".ttf": "font/ttf",
|
|
254830
|
+
".otf": "font/otf",
|
|
254831
|
+
".eot": "application/vnd.ms-fontobject",
|
|
254832
|
+
".mp3": "audio/mpeg",
|
|
254833
|
+
".mp4": "video/mp4",
|
|
254834
|
+
".webm": "video/webm",
|
|
254835
|
+
".pdf": "application/pdf",
|
|
254836
|
+
".wasm": "application/wasm",
|
|
254837
|
+
".webmanifest": "application/manifest+json"
|
|
254838
|
+
};
|
|
254839
|
+
function getMimeType(filePath) {
|
|
254840
|
+
return MIME_TYPES[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
254841
|
+
}
|
|
254842
|
+
function hashAsset(appId, content) {
|
|
254843
|
+
return createHash("sha256").update(Buffer.from(appId, "utf8")).update(content).digest("hex").slice(0, 32);
|
|
254844
|
+
}
|
|
254845
|
+
function globToRegExp(glob) {
|
|
254846
|
+
let source = "";
|
|
254847
|
+
for (let i2 = 0;i2 < glob.length; i2++) {
|
|
254848
|
+
const char = glob[i2];
|
|
254849
|
+
if (char === "*") {
|
|
254850
|
+
if (glob[i2 + 1] === "*") {
|
|
254851
|
+
source += ".*";
|
|
254852
|
+
i2++;
|
|
254853
|
+
} else {
|
|
254854
|
+
source += "[^/]*";
|
|
254855
|
+
}
|
|
254856
|
+
} else if (char === "?") {
|
|
254857
|
+
source += "[^/]";
|
|
254858
|
+
} else {
|
|
254859
|
+
source += char.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
254860
|
+
}
|
|
254861
|
+
}
|
|
254862
|
+
return new RegExp(`^${source}$`);
|
|
254863
|
+
}
|
|
254864
|
+
function createIgnoreMatcher(lines) {
|
|
254865
|
+
const rules = lines.map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#")).map((line) => {
|
|
254866
|
+
const isDirOnly = line.endsWith("/");
|
|
254867
|
+
let pattern = isDirOnly ? line.slice(0, -1) : line;
|
|
254868
|
+
const anchored = pattern.includes("/");
|
|
254869
|
+
pattern = pattern.replace(/^\//, "");
|
|
254870
|
+
return { regex: globToRegExp(pattern), anchored, isDirOnly };
|
|
254871
|
+
});
|
|
254872
|
+
return (relativePath, isDirectory2) => {
|
|
254873
|
+
const segments = relativePath.split("/");
|
|
254874
|
+
return rules.some((rule) => {
|
|
254875
|
+
if (rule.anchored) {
|
|
254876
|
+
if (rule.isDirOnly ? isDirectory2 : true) {
|
|
254877
|
+
if (rule.regex.test(relativePath))
|
|
254878
|
+
return true;
|
|
254879
|
+
}
|
|
254880
|
+
return false;
|
|
254881
|
+
}
|
|
254882
|
+
const basename4 = segments[segments.length - 1];
|
|
254883
|
+
if (rule.isDirOnly && !isDirectory2)
|
|
254884
|
+
return false;
|
|
254885
|
+
return rule.regex.test(basename4);
|
|
254886
|
+
});
|
|
254887
|
+
};
|
|
254888
|
+
}
|
|
254889
|
+
async function loadIgnoreMatcher(assetsDir) {
|
|
254890
|
+
const ignorePath = join15(assetsDir, ASSETS_IGNORE_FILE);
|
|
254891
|
+
if (!await pathExists(ignorePath)) {
|
|
254892
|
+
return () => false;
|
|
254893
|
+
}
|
|
254894
|
+
const content = await readTextFile(ignorePath);
|
|
254895
|
+
return createIgnoreMatcher(content.split(/\r?\n/));
|
|
254896
|
+
}
|
|
254897
|
+
async function buildAssetManifest(assetsDir, appId) {
|
|
254898
|
+
const isIgnored = await loadIgnoreMatcher(assetsDir);
|
|
254899
|
+
const manifest = {};
|
|
254900
|
+
const filesByHash = new Map;
|
|
254901
|
+
const relativeFilePaths = await collectFilePaths(assetsDir, "", isIgnored);
|
|
254902
|
+
if (relativeFilePaths.length > MAX_ASSET_COUNT) {
|
|
254903
|
+
throw new InvalidInputError(`Too many static assets: found ${relativeFilePaths.length}, the limit is ${MAX_ASSET_COUNT} files.`);
|
|
254904
|
+
}
|
|
254905
|
+
for (const relativePath of relativeFilePaths.sort()) {
|
|
254906
|
+
const absolutePath = join15(assetsDir, ...relativePath.split("/"));
|
|
254907
|
+
const { size } = await stat(absolutePath);
|
|
254908
|
+
if (size > MAX_ASSET_SIZE_BYTES) {
|
|
254909
|
+
throw new InvalidInputError(`Static asset "${relativePath}" is ${size} bytes, which exceeds the 25 MiB per-file limit.`);
|
|
254910
|
+
}
|
|
254911
|
+
const content = await readFile3(absolutePath);
|
|
254912
|
+
const hash2 = hashAsset(appId, content);
|
|
254913
|
+
manifest[`/${relativePath}`] = { hash: hash2, size };
|
|
254914
|
+
if (!filesByHash.has(hash2)) {
|
|
254915
|
+
filesByHash.set(hash2, {
|
|
254916
|
+
absolutePath,
|
|
254917
|
+
hash: hash2,
|
|
254918
|
+
size,
|
|
254919
|
+
contentType: getMimeType(absolutePath)
|
|
254920
|
+
});
|
|
254921
|
+
}
|
|
254922
|
+
}
|
|
254923
|
+
return { manifest, filesByHash };
|
|
254924
|
+
}
|
|
254925
|
+
async function collectFilePaths(dir, relativeDir, isIgnored) {
|
|
254926
|
+
const entries = await readdir2(dir, { withFileTypes: true });
|
|
254927
|
+
const results = [];
|
|
254928
|
+
for (const entry of entries) {
|
|
254929
|
+
const relativePath = relativeDir ? `${relativeDir}/${entry.name}` : entry.name;
|
|
254930
|
+
if (entry.isDirectory()) {
|
|
254931
|
+
if (isIgnored(relativePath, true))
|
|
254932
|
+
continue;
|
|
254933
|
+
results.push(...await collectFilePaths(join15(dir, entry.name), relativePath, isIgnored));
|
|
254934
|
+
continue;
|
|
254935
|
+
}
|
|
254936
|
+
if (!entry.isFile())
|
|
254937
|
+
continue;
|
|
254938
|
+
if (ALWAYS_SKIPPED_FILES.has(entry.name))
|
|
254939
|
+
continue;
|
|
254940
|
+
if (isIgnored(relativePath, false))
|
|
254941
|
+
continue;
|
|
254942
|
+
results.push(relativePath);
|
|
254943
|
+
}
|
|
254944
|
+
return results;
|
|
254945
|
+
}
|
|
254946
|
+
|
|
254947
|
+
// src/core/deployments/modules.ts
|
|
254948
|
+
import { stat as stat2 } from "node:fs/promises";
|
|
254949
|
+
import { relative as relative3, resolve as resolve4, sep } from "node:path";
|
|
254950
|
+
var MAX_TOTAL_MODULE_BYTES = 40 * 1024 * 1024;
|
|
254951
|
+
var MODULE_IGNORE = ["wrangler.json", ".dev.vars"];
|
|
254952
|
+
var RULE_TYPE_TO_MODULE_TYPE = {
|
|
254953
|
+
ESModule: "esm",
|
|
254954
|
+
CompiledWasm: "wasm",
|
|
254955
|
+
Text: "text",
|
|
254956
|
+
Data: "data"
|
|
254957
|
+
};
|
|
254958
|
+
function toPosix(path16) {
|
|
254959
|
+
return path16.split(sep).join("/");
|
|
254960
|
+
}
|
|
254961
|
+
async function collectModules(config12) {
|
|
254962
|
+
const entryPath = resolve4(config12.configDir, config12.main);
|
|
254963
|
+
if (!await pathExists(entryPath)) {
|
|
254964
|
+
throw new InvalidInputError(`Worker entry module does not exist: ${entryPath} (from "main" in ${config12.configPath})`, {
|
|
254965
|
+
hints: [{ message: "Rebuild the project to regenerate the artifact" }]
|
|
254966
|
+
});
|
|
254967
|
+
}
|
|
254968
|
+
const modulesByName = new Map;
|
|
254969
|
+
const entryName = toPosix(relative3(config12.configDir, entryPath));
|
|
254970
|
+
modulesByName.set(entryName, {
|
|
254971
|
+
name: entryName,
|
|
254972
|
+
absolutePath: entryPath,
|
|
254973
|
+
size: 0,
|
|
254974
|
+
type: "esm"
|
|
254975
|
+
});
|
|
254976
|
+
const ignore = [...MODULE_IGNORE];
|
|
254977
|
+
if (config12.assetsDirectory?.startsWith(config12.configDir + sep)) {
|
|
254978
|
+
ignore.push(`${toPosix(relative3(config12.configDir, config12.assetsDirectory))}/**`);
|
|
254979
|
+
}
|
|
254980
|
+
for (const rule of config12.rules) {
|
|
254981
|
+
const type = RULE_TYPE_TO_MODULE_TYPE[rule.type];
|
|
254982
|
+
if (!type) {
|
|
254983
|
+
throw new InvalidInputError(`Unsupported module rule type "${rule.type}" in ${config12.configPath}. Supported: ${Object.keys(RULE_TYPE_TO_MODULE_TYPE).join(", ")}.`);
|
|
254984
|
+
}
|
|
254985
|
+
const matches = await globby(rule.globs, {
|
|
254986
|
+
cwd: config12.configDir,
|
|
254987
|
+
onlyFiles: true,
|
|
254988
|
+
dot: true,
|
|
254989
|
+
ignore
|
|
254990
|
+
});
|
|
254991
|
+
for (const match of matches.sort()) {
|
|
254992
|
+
if (!modulesByName.has(match)) {
|
|
254993
|
+
modulesByName.set(match, {
|
|
254994
|
+
name: match,
|
|
254995
|
+
absolutePath: resolve4(config12.configDir, match),
|
|
254996
|
+
size: 0,
|
|
254997
|
+
type
|
|
254998
|
+
});
|
|
254999
|
+
}
|
|
255000
|
+
}
|
|
255001
|
+
}
|
|
255002
|
+
if (config12.uploadSourceMaps) {
|
|
255003
|
+
const maps = await globby("**/*.map", {
|
|
255004
|
+
cwd: config12.configDir,
|
|
255005
|
+
onlyFiles: true,
|
|
255006
|
+
dot: true,
|
|
255007
|
+
ignore
|
|
255008
|
+
});
|
|
255009
|
+
for (const map2 of maps.sort()) {
|
|
255010
|
+
addSourcemap(modulesByName, config12.configDir, map2);
|
|
255011
|
+
}
|
|
255012
|
+
} else {
|
|
255013
|
+
for (const name2 of [...modulesByName.keys()]) {
|
|
255014
|
+
const mapName = `${name2}.map`;
|
|
255015
|
+
if (await pathExists(resolve4(config12.configDir, mapName))) {
|
|
255016
|
+
addSourcemap(modulesByName, config12.configDir, mapName);
|
|
255017
|
+
}
|
|
255018
|
+
}
|
|
255019
|
+
}
|
|
255020
|
+
const modules = [...modulesByName.values()];
|
|
255021
|
+
let totalBytes = 0;
|
|
255022
|
+
for (const module of modules) {
|
|
255023
|
+
module.size = (await stat2(module.absolutePath)).size;
|
|
255024
|
+
totalBytes += module.size;
|
|
255025
|
+
}
|
|
255026
|
+
if (totalBytes > MAX_TOTAL_MODULE_BYTES) {
|
|
255027
|
+
throw new InvalidInputError(`Worker modules total ${totalBytes} bytes, which exceeds the 40 MB limit for Base44 full-stack deploys.`);
|
|
255028
|
+
}
|
|
255029
|
+
return modules;
|
|
255030
|
+
}
|
|
255031
|
+
function addSourcemap(modulesByName, configDir, name2) {
|
|
255032
|
+
if (modulesByName.has(name2))
|
|
255033
|
+
return;
|
|
255034
|
+
modulesByName.set(name2, {
|
|
255035
|
+
name: name2,
|
|
255036
|
+
absolutePath: resolve4(configDir, name2),
|
|
255037
|
+
size: 0,
|
|
255038
|
+
type: "sourcemap"
|
|
255039
|
+
});
|
|
255040
|
+
}
|
|
255041
|
+
|
|
255042
|
+
// src/core/deployments/upload.ts
|
|
255043
|
+
import { readFile as readFile4 } from "node:fs/promises";
|
|
255044
|
+
var BUCKET_CONCURRENCY = 3;
|
|
255045
|
+
var MAX_ATTEMPTS_PER_BUCKET = 3;
|
|
255046
|
+
var RETRY_BASE_DELAY_MS = 500;
|
|
255047
|
+
var MAX_RATE_LIMIT_WAITS = 10;
|
|
255048
|
+
var RATE_LIMIT_DELAY_MS = 15000;
|
|
255049
|
+
async function uploadAssetBuckets(deploymentId, buckets, filesByHash, onProgress) {
|
|
255050
|
+
if (buckets.length === 0) {
|
|
255051
|
+
return null;
|
|
255052
|
+
}
|
|
255053
|
+
const totalFiles = buckets.reduce((sum, bucket) => sum + bucket.length, 0);
|
|
255054
|
+
let uploadedFiles = 0;
|
|
255055
|
+
let completedBuckets = 0;
|
|
255056
|
+
let completionJwt = null;
|
|
255057
|
+
let nextBucket = 0;
|
|
255058
|
+
const worker = async () => {
|
|
255059
|
+
while (nextBucket < buckets.length) {
|
|
255060
|
+
const bucket = buckets[nextBucket++];
|
|
255061
|
+
const jwt3 = await uploadBucketWithRetry(deploymentId, bucket, filesByHash);
|
|
255062
|
+
if (jwt3) {
|
|
255063
|
+
completionJwt = jwt3;
|
|
255064
|
+
}
|
|
255065
|
+
uploadedFiles += bucket.length;
|
|
255066
|
+
completedBuckets++;
|
|
255067
|
+
onProgress?.({
|
|
255068
|
+
uploadedFiles,
|
|
255069
|
+
totalFiles,
|
|
255070
|
+
completedBuckets,
|
|
255071
|
+
totalBuckets: buckets.length
|
|
255072
|
+
});
|
|
255073
|
+
}
|
|
255074
|
+
};
|
|
255075
|
+
await Promise.all(Array.from({ length: Math.min(BUCKET_CONCURRENCY, buckets.length) }, worker));
|
|
255076
|
+
if (!completionJwt) {
|
|
255077
|
+
throw new ApiError("Asset upload finished but the server did not return a completion token.");
|
|
255078
|
+
}
|
|
255079
|
+
return completionJwt;
|
|
255080
|
+
}
|
|
255081
|
+
async function uploadBucketWithRetry(deploymentId, bucket, filesByHash) {
|
|
255082
|
+
let lastError;
|
|
255083
|
+
let rateLimitWaits = 0;
|
|
255084
|
+
const formData = await buildBucketForm(bucket, filesByHash);
|
|
255085
|
+
for (let attempt = 0;attempt < MAX_ATTEMPTS_PER_BUCKET; attempt++) {
|
|
255086
|
+
if (attempt > 0) {
|
|
255087
|
+
await sleep3(RETRY_BASE_DELAY_MS * 2 ** (attempt - 1));
|
|
255088
|
+
}
|
|
255089
|
+
try {
|
|
255090
|
+
return await uploadAssetBucket(deploymentId, formData);
|
|
255091
|
+
} catch (error48) {
|
|
255092
|
+
if (error48 instanceof HTTPError && error48.response.status === 429 && rateLimitWaits < MAX_RATE_LIMIT_WAITS) {
|
|
255093
|
+
rateLimitWaits++;
|
|
255094
|
+
attempt--;
|
|
255095
|
+
await sleep3(RATE_LIMIT_DELAY_MS);
|
|
255096
|
+
continue;
|
|
255097
|
+
}
|
|
255098
|
+
lastError = error48;
|
|
255099
|
+
}
|
|
255100
|
+
}
|
|
255101
|
+
if (lastError instanceof HTTPError && lastError.response.status === 409) {
|
|
255102
|
+
throw new ApiError("This deploy's upload session has expired — rerun deploy. Already-uploaded assets are skipped on the next attempt.", { statusCode: 409, cause: lastError });
|
|
255103
|
+
}
|
|
255104
|
+
throw await ApiError.fromHttpError(lastError, "uploading static assets");
|
|
255105
|
+
}
|
|
255106
|
+
async function buildBucketForm(bucket, filesByHash) {
|
|
255107
|
+
const formData = new FormData;
|
|
255108
|
+
for (const hash2 of bucket) {
|
|
255109
|
+
const file2 = filesByHash.get(hash2);
|
|
255110
|
+
if (!file2) {
|
|
255111
|
+
throw new InternalError(`Server requested upload of unknown asset hash: ${hash2}`);
|
|
255112
|
+
}
|
|
255113
|
+
const content = await readFile4(file2.absolutePath);
|
|
255114
|
+
formData.append(hash2, new File([content.toString("base64")], hash2, { type: file2.contentType }));
|
|
255115
|
+
}
|
|
255116
|
+
return formData;
|
|
255117
|
+
}
|
|
255118
|
+
function sleep3(ms) {
|
|
255119
|
+
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
255120
|
+
}
|
|
255121
|
+
|
|
255122
|
+
// src/core/deployments/wrangler-config.ts
|
|
255123
|
+
import { dirname as dirname10, join as join16, resolve as resolve5 } from "node:path";
|
|
255124
|
+
var WRANGLER_REDIRECT_PATH = join16(".wrangler", "deploy", "config.json");
|
|
255125
|
+
var RedirectConfigSchema = exports_external.looseObject({
|
|
255126
|
+
configPath: exports_external.string().min(1)
|
|
255127
|
+
});
|
|
255128
|
+
var BindingArraySchema = exports_external.array(exports_external.unknown()).optional();
|
|
255129
|
+
var WranglerConfigSchema = exports_external.looseObject({
|
|
255130
|
+
name: exports_external.string().optional(),
|
|
255131
|
+
main: exports_external.string().min(1, "wrangler config is missing a 'main' entry module"),
|
|
255132
|
+
no_bundle: exports_external.boolean().optional(),
|
|
255133
|
+
rules: exports_external.array(exports_external.looseObject({ type: exports_external.string(), globs: exports_external.array(exports_external.string()) })).optional(),
|
|
255134
|
+
assets: exports_external.looseObject({
|
|
255135
|
+
directory: exports_external.string().optional(),
|
|
255136
|
+
html_handling: exports_external.string().optional(),
|
|
255137
|
+
not_found_handling: exports_external.string().optional(),
|
|
255138
|
+
run_worker_first: exports_external.union([exports_external.boolean(), exports_external.array(exports_external.string())]).optional(),
|
|
255139
|
+
headers: exports_external.string().optional(),
|
|
255140
|
+
redirects: exports_external.string().optional()
|
|
255141
|
+
}).optional(),
|
|
255142
|
+
compatibility_date: exports_external.string().optional(),
|
|
255143
|
+
compatibility_flags: exports_external.array(exports_external.string()).optional(),
|
|
255144
|
+
vars: exports_external.record(exports_external.string(), exports_external.unknown()).optional(),
|
|
255145
|
+
upload_source_maps: exports_external.boolean().optional(),
|
|
255146
|
+
kv_namespaces: BindingArraySchema,
|
|
255147
|
+
d1_databases: BindingArraySchema,
|
|
255148
|
+
r2_buckets: BindingArraySchema,
|
|
255149
|
+
durable_objects: exports_external.looseObject({ bindings: BindingArraySchema }).optional(),
|
|
255150
|
+
services: BindingArraySchema,
|
|
255151
|
+
queues: exports_external.looseObject({
|
|
255152
|
+
producers: BindingArraySchema,
|
|
255153
|
+
consumers: BindingArraySchema
|
|
255154
|
+
}).optional(),
|
|
255155
|
+
hyperdrive: BindingArraySchema,
|
|
255156
|
+
analytics_engine_datasets: BindingArraySchema,
|
|
255157
|
+
vectorize: BindingArraySchema
|
|
255158
|
+
});
|
|
255159
|
+
async function detectFullStackArtifact(projectRoot) {
|
|
255160
|
+
const redirectPath = join16(projectRoot, WRANGLER_REDIRECT_PATH);
|
|
255161
|
+
if (await pathExists(redirectPath)) {
|
|
255162
|
+
return { source: "redirect", path: redirectPath };
|
|
255163
|
+
}
|
|
255164
|
+
for (const name2 of ["wrangler.jsonc", "wrangler.json"]) {
|
|
255165
|
+
const configPath = join16(projectRoot, name2);
|
|
255166
|
+
if (await pathExists(configPath)) {
|
|
255167
|
+
return { source: "root-config", path: configPath };
|
|
255168
|
+
}
|
|
255169
|
+
}
|
|
255170
|
+
const tomlPath = join16(projectRoot, "wrangler.toml");
|
|
255171
|
+
if (await pathExists(tomlPath)) {
|
|
255172
|
+
return { source: "toml", path: tomlPath };
|
|
255173
|
+
}
|
|
255174
|
+
return null;
|
|
255175
|
+
}
|
|
255176
|
+
async function resolveWranglerConfig(projectRoot) {
|
|
255177
|
+
const artifact = await detectFullStackArtifact(projectRoot);
|
|
255178
|
+
if (!artifact) {
|
|
255179
|
+
throw new InvalidInputError("No full-stack build artifact found. Expected a .wrangler/deploy/config.json redirect file or a root wrangler.jsonc.", {
|
|
255180
|
+
hints: [{ message: "Run your framework's build command first" }]
|
|
255181
|
+
});
|
|
255182
|
+
}
|
|
255183
|
+
if (artifact.source === "toml") {
|
|
255184
|
+
throw new InvalidInputError("wrangler.toml is not supported for Base44 full-stack deploys. Convert your config to wrangler.jsonc.");
|
|
255185
|
+
}
|
|
255186
|
+
const configPath = artifact.source === "redirect" ? await resolveRedirectedConfigPath(artifact.path) : artifact.path;
|
|
255187
|
+
const parsed = await readJsonFile(configPath);
|
|
255188
|
+
const result = WranglerConfigSchema.safeParse(parsed);
|
|
255189
|
+
if (!result.success) {
|
|
255190
|
+
throw new ConfigInvalidError(`Invalid wrangler config: ${exports_external.prettifyError(result.error)}`, configPath);
|
|
255191
|
+
}
|
|
255192
|
+
const config12 = result.data;
|
|
255193
|
+
if (config12.no_bundle !== true) {
|
|
255194
|
+
throw new InvalidInputError("This framework's output requires bundling; not yet supported. Base44 full-stack deploys only support pre-bundled Workers output (no_bundle: true).");
|
|
255195
|
+
}
|
|
255196
|
+
assertNoUnsupportedBindings(config12, configPath);
|
|
255197
|
+
const configDir = dirname10(configPath);
|
|
255198
|
+
const assetsDirectory = config12.assets?.directory ? resolve5(configDir, config12.assets.directory) : null;
|
|
255199
|
+
return {
|
|
255200
|
+
configPath,
|
|
255201
|
+
configDir,
|
|
255202
|
+
name: config12.name ?? null,
|
|
255203
|
+
main: config12.main,
|
|
255204
|
+
assetsDirectory,
|
|
255205
|
+
assetsConfig: config12.assets ? toResolvedAssetsConfig(config12.assets) : null,
|
|
255206
|
+
compatibilityDate: config12.compatibility_date ?? null,
|
|
255207
|
+
compatibilityFlags: config12.compatibility_flags ?? [],
|
|
255208
|
+
vars: config12.vars ?? {},
|
|
255209
|
+
rules: (config12.rules ?? []).map((rule) => ({
|
|
255210
|
+
type: rule.type,
|
|
255211
|
+
globs: rule.globs
|
|
255212
|
+
})),
|
|
255213
|
+
uploadSourceMaps: config12.upload_source_maps ?? false
|
|
255214
|
+
};
|
|
255215
|
+
}
|
|
255216
|
+
async function resolveRedirectedConfigPath(redirectPath) {
|
|
255217
|
+
const parsed = await readJsonFile(redirectPath);
|
|
255218
|
+
const result = RedirectConfigSchema.safeParse(parsed);
|
|
255219
|
+
if (!result.success) {
|
|
255220
|
+
throw new ConfigInvalidError(`Invalid deploy redirect file: ${exports_external.prettifyError(result.error)}`, redirectPath);
|
|
255221
|
+
}
|
|
255222
|
+
const configPath = resolve5(dirname10(redirectPath), result.data.configPath);
|
|
255223
|
+
if (!await pathExists(configPath)) {
|
|
255224
|
+
throw new ConfigInvalidError(`Wrangler config referenced by ${redirectPath} does not exist: ${configPath}`, redirectPath, {
|
|
255225
|
+
hints: [{ message: "Rebuild the project to regenerate the artifact" }]
|
|
255226
|
+
});
|
|
255227
|
+
}
|
|
255228
|
+
return configPath;
|
|
255229
|
+
}
|
|
255230
|
+
function toResolvedAssetsConfig(assets) {
|
|
255231
|
+
return {
|
|
255232
|
+
htmlHandling: assets.html_handling,
|
|
255233
|
+
notFoundHandling: assets.not_found_handling,
|
|
255234
|
+
runWorkerFirst: assets.run_worker_first,
|
|
255235
|
+
headers: assets.headers,
|
|
255236
|
+
redirects: assets.redirects
|
|
255237
|
+
};
|
|
255238
|
+
}
|
|
255239
|
+
function assertNoUnsupportedBindings(config12, configPath) {
|
|
255240
|
+
const bindingSources = {
|
|
255241
|
+
kv_namespaces: config12.kv_namespaces,
|
|
255242
|
+
d1_databases: config12.d1_databases,
|
|
255243
|
+
r2_buckets: config12.r2_buckets,
|
|
255244
|
+
"durable_objects.bindings": config12.durable_objects?.bindings,
|
|
255245
|
+
services: config12.services,
|
|
255246
|
+
"queues.producers": config12.queues?.producers,
|
|
255247
|
+
"queues.consumers": config12.queues?.consumers,
|
|
255248
|
+
hyperdrive: config12.hyperdrive,
|
|
255249
|
+
analytics_engine_datasets: config12.analytics_engine_datasets,
|
|
255250
|
+
vectorize: config12.vectorize
|
|
255251
|
+
};
|
|
255252
|
+
const used = Object.entries(bindingSources).filter(([, values]) => (values?.length ?? 0) > 0).map(([name2]) => name2);
|
|
255253
|
+
if (used.length > 0) {
|
|
255254
|
+
throw new InvalidInputError(`Unsupported bindings for Base44 full-stack deploys: ${used.join(", ")}. Remove them or file a feature request.`, {
|
|
255255
|
+
hints: [{ message: `Edit the bindings in ${configPath}` }]
|
|
255256
|
+
});
|
|
255257
|
+
}
|
|
255258
|
+
}
|
|
255259
|
+
|
|
255260
|
+
// src/core/deployments/deploy.ts
|
|
255261
|
+
async function resolveGitHash(projectRoot, explicit) {
|
|
255262
|
+
const hash2 = explicit ?? await gitHead(projectRoot);
|
|
255263
|
+
if (!hash2 || !GIT_HASH_PATTERN.test(hash2)) {
|
|
255264
|
+
throw new InvalidInputError(explicit ? `'${explicit}' is not a git commit hash.` : "Full-stack deployments are addressed by the commit that produced the build, and no git commit was found.", {
|
|
255265
|
+
hints: [
|
|
255266
|
+
{
|
|
255267
|
+
message: "Run the deploy from a git checkout, or pass the commit explicitly with --git-hash."
|
|
255268
|
+
}
|
|
255269
|
+
]
|
|
255270
|
+
});
|
|
255271
|
+
}
|
|
255272
|
+
return hash2;
|
|
255273
|
+
}
|
|
255274
|
+
async function gitHead(projectRoot) {
|
|
255275
|
+
try {
|
|
255276
|
+
const { stdout } = await execa("git", ["rev-parse", "HEAD"], {
|
|
255277
|
+
cwd: projectRoot
|
|
255278
|
+
});
|
|
255279
|
+
return stdout.trim();
|
|
255280
|
+
} catch {
|
|
255281
|
+
return null;
|
|
255282
|
+
}
|
|
255283
|
+
}
|
|
255284
|
+
async function deployFullStack(options) {
|
|
255285
|
+
const { projectRoot, gitHash, progress } = options;
|
|
255286
|
+
const config12 = await resolveWranglerConfig(projectRoot);
|
|
255287
|
+
if (!config12.compatibilityFlags.includes("nodejs_compat")) {
|
|
255288
|
+
progress?.onWarning?.("The wrangler config has no 'nodejs_compat' compatibility flag; Node.js built-ins will be unavailable at runtime. Enable it in your framework's Cloudflare adapter settings if your server code needs Node APIs.");
|
|
255289
|
+
}
|
|
255290
|
+
if (config12.vars && Object.keys(config12.vars).length > 0) {
|
|
255291
|
+
progress?.onWarning?.("wrangler 'vars' are not supported and were ignored — a worker's environment comes from the app's secrets (base44 secrets set).");
|
|
255292
|
+
}
|
|
255293
|
+
const modules = await collectModules(config12);
|
|
255294
|
+
let assets = { manifest: {}, filesByHash: new Map };
|
|
255295
|
+
if (config12.assetsDirectory && await pathExists(config12.assetsDirectory)) {
|
|
255296
|
+
assets = await buildAssetManifest(config12.assetsDirectory, getAppContext().id);
|
|
255297
|
+
}
|
|
255298
|
+
const created = await createDeployment({
|
|
255299
|
+
git_hash: gitHash,
|
|
255300
|
+
config: {
|
|
255301
|
+
main: config12.main,
|
|
255302
|
+
compatibility_date: config12.compatibilityDate,
|
|
255303
|
+
compatibility_flags: config12.compatibilityFlags,
|
|
255304
|
+
assets: buildAssetsConfig(config12.assetsConfig, progress)
|
|
255305
|
+
},
|
|
255306
|
+
asset_manifest: assets.manifest
|
|
255307
|
+
});
|
|
255308
|
+
const totalAssets = Object.keys(assets.manifest).length;
|
|
255309
|
+
const newAssets = new Set(created.assetBuckets.flat()).size;
|
|
255310
|
+
progress?.onAssets?.({ totalAssets, newAssets });
|
|
255311
|
+
const completionJwt = await uploadAssetBuckets(created.deploymentId, created.assetBuckets, assets.filesByHash, progress?.onAssetUpload);
|
|
255312
|
+
progress?.onWorker?.({ moduleCount: modules.length });
|
|
255313
|
+
const finalized = await finalizeDeployment(created.deploymentId, completionJwt, modules);
|
|
255314
|
+
return { deploymentId: finalized.deploymentId, gitHash };
|
|
255315
|
+
}
|
|
255316
|
+
function buildAssetsConfig(assetsConfig, progress) {
|
|
255317
|
+
if (!assetsConfig)
|
|
255318
|
+
return null;
|
|
255319
|
+
if (assetsConfig.headers || assetsConfig.redirects) {
|
|
255320
|
+
progress?.onWarning?.("_headers/_redirects files are not supported yet and were ignored for this deploy.");
|
|
255321
|
+
}
|
|
255322
|
+
let runWorkerFirst;
|
|
255323
|
+
if (Array.isArray(assetsConfig.runWorkerFirst)) {
|
|
255324
|
+
progress?.onWarning?.("'run_worker_first' route patterns are not supported yet and were ignored for this deploy.");
|
|
255325
|
+
} else {
|
|
255326
|
+
runWorkerFirst = assetsConfig.runWorkerFirst;
|
|
255327
|
+
}
|
|
255328
|
+
return {
|
|
255329
|
+
html_handling: assetsConfig.htmlHandling,
|
|
255330
|
+
not_found_handling: assetsConfig.notFoundHandling,
|
|
255331
|
+
run_worker_first: runWorkerFirst
|
|
255332
|
+
};
|
|
255333
|
+
}
|
|
255334
|
+
// src/core/deployments/static-site.ts
|
|
255335
|
+
var STATIC_WORKERS_ENV = "BASE44_STATIC_WORKERS";
|
|
255336
|
+
function staticWorkersEnabled(env2 = process.env) {
|
|
255337
|
+
const value = env2[STATIC_WORKERS_ENV];
|
|
255338
|
+
return value === "1" || value === "true";
|
|
255339
|
+
}
|
|
255340
|
+
var STUB_MODULE_NAME = "index.js";
|
|
255341
|
+
var STUB_SOURCE = `export default {
|
|
255342
|
+
async fetch(request, env) {
|
|
255343
|
+
return env.ASSETS.fetch(request);
|
|
255344
|
+
},
|
|
255345
|
+
};
|
|
255346
|
+
`;
|
|
255347
|
+
var STATIC_COMPATIBILITY_DATE = "2026-01-01";
|
|
255348
|
+
async function deployStaticSite(options) {
|
|
255349
|
+
const { outputDir, gitHash, progress } = options;
|
|
255350
|
+
const assets = await buildAssetManifest(outputDir, getAppContext().id);
|
|
255351
|
+
const created = await createDeployment({
|
|
255352
|
+
git_hash: gitHash,
|
|
255353
|
+
config: {
|
|
255354
|
+
main: STUB_MODULE_NAME,
|
|
255355
|
+
compatibility_date: STATIC_COMPATIBILITY_DATE,
|
|
255356
|
+
compatibility_flags: [],
|
|
255357
|
+
assets: { not_found_handling: "single-page-application" }
|
|
255358
|
+
},
|
|
255359
|
+
asset_manifest: assets.manifest
|
|
255360
|
+
});
|
|
255361
|
+
const totalAssets = Object.keys(assets.manifest).length;
|
|
255362
|
+
const newAssets = new Set(created.assetBuckets.flat()).size;
|
|
255363
|
+
progress?.onAssets?.({ totalAssets, newAssets });
|
|
255364
|
+
const completionJwt = await uploadAssetBuckets(created.deploymentId, created.assetBuckets, assets.filesByHash, progress?.onAssetUpload);
|
|
255365
|
+
const stubBytes = new TextEncoder().encode(STUB_SOURCE);
|
|
255366
|
+
const modules = [
|
|
255367
|
+
{
|
|
255368
|
+
name: STUB_MODULE_NAME,
|
|
255369
|
+
content: stubBytes,
|
|
255370
|
+
size: stubBytes.byteLength,
|
|
255371
|
+
type: "esm"
|
|
255372
|
+
}
|
|
255373
|
+
];
|
|
255374
|
+
progress?.onWorker?.({ moduleCount: modules.length });
|
|
255375
|
+
const finalized = await finalizeDeployment(created.deploymentId, completionJwt, modules);
|
|
255376
|
+
return { deploymentId: finalized.deploymentId, gitHash };
|
|
255377
|
+
}
|
|
254718
255378
|
// src/core/utils/dependencies.ts
|
|
254719
255379
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
254720
255380
|
function verifyDenoInstalled(context) {
|
|
@@ -254803,7 +255463,7 @@ async function pullAction({
|
|
|
254803
255463
|
runTask: runTask2
|
|
254804
255464
|
}) {
|
|
254805
255465
|
const { project: project2 } = await readProjectConfig();
|
|
254806
|
-
const dir =
|
|
255466
|
+
const dir = join17(dirname11(project2.configPath), project2.agentSkillsDir);
|
|
254807
255467
|
const remote = await runTask2("Fetching agent skills from Base44", () => fetchAgentSkills(), {
|
|
254808
255468
|
successMessage: "Agent skills fetched successfully",
|
|
254809
255469
|
errorMessage: "Failed to fetch agent skills"
|
|
@@ -254859,14 +255519,14 @@ function getAgentSkillsCommand() {
|
|
|
254859
255519
|
}
|
|
254860
255520
|
|
|
254861
255521
|
// src/cli/commands/agents/pull.ts
|
|
254862
|
-
import { dirname as
|
|
255522
|
+
import { dirname as dirname12, join as join18 } from "node:path";
|
|
254863
255523
|
async function pullAgentsAction({
|
|
254864
255524
|
log,
|
|
254865
255525
|
runTask: runTask2
|
|
254866
255526
|
}) {
|
|
254867
255527
|
const { project: project2 } = await readProjectConfig();
|
|
254868
|
-
const configDir =
|
|
254869
|
-
const agentsDir =
|
|
255528
|
+
const configDir = dirname12(project2.configPath);
|
|
255529
|
+
const agentsDir = join18(configDir, project2.agentsDir);
|
|
254870
255530
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
254871
255531
|
return await fetchAgents();
|
|
254872
255532
|
}, {
|
|
@@ -254936,12 +255596,12 @@ function getAgentsCommand() {
|
|
|
254936
255596
|
}
|
|
254937
255597
|
|
|
254938
255598
|
// src/cli/commands/auth/password-login.ts
|
|
254939
|
-
import { dirname as
|
|
255599
|
+
import { dirname as dirname13, join as join19 } from "node:path";
|
|
254940
255600
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
254941
255601
|
const shouldEnable = action === "enable";
|
|
254942
255602
|
const { project: project2 } = await readProjectConfig();
|
|
254943
|
-
const configDir =
|
|
254944
|
-
const authDir =
|
|
255603
|
+
const configDir = dirname13(project2.configPath);
|
|
255604
|
+
const authDir = join19(configDir, project2.authDir);
|
|
254945
255605
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
254946
255606
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
254947
255607
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -254961,14 +255621,14 @@ function getPasswordLoginCommand() {
|
|
|
254961
255621
|
}
|
|
254962
255622
|
|
|
254963
255623
|
// src/cli/commands/auth/pull.ts
|
|
254964
|
-
import { dirname as
|
|
255624
|
+
import { dirname as dirname14, join as join20 } from "node:path";
|
|
254965
255625
|
async function pullAuthAction({
|
|
254966
255626
|
log,
|
|
254967
255627
|
runTask: runTask2
|
|
254968
255628
|
}) {
|
|
254969
255629
|
const { project: project2 } = await readProjectConfig();
|
|
254970
|
-
const configDir =
|
|
254971
|
-
const authDir =
|
|
255630
|
+
const configDir = dirname14(project2.configPath);
|
|
255631
|
+
const authDir = join20(configDir, project2.authDir);
|
|
254972
255632
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
254973
255633
|
return await pullAuthConfig();
|
|
254974
255634
|
}, {
|
|
@@ -255032,7 +255692,7 @@ function getAuthPushCommand() {
|
|
|
255032
255692
|
}
|
|
255033
255693
|
|
|
255034
255694
|
// src/cli/commands/auth/social-login.ts
|
|
255035
|
-
import { dirname as
|
|
255695
|
+
import { dirname as dirname15, join as join21, resolve as resolve6 } from "node:path";
|
|
255036
255696
|
var PROVIDER_LABELS = {
|
|
255037
255697
|
google: "Google",
|
|
255038
255698
|
microsoft: "Microsoft",
|
|
@@ -255072,7 +255732,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
255072
255732
|
let clientSecret;
|
|
255073
255733
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
255074
255734
|
if (options.envFile) {
|
|
255075
|
-
const secrets = await parseEnvFile(
|
|
255735
|
+
const secrets = await parseEnvFile(resolve6(options.envFile));
|
|
255076
255736
|
const value = secrets[oauthCli.envVar];
|
|
255077
255737
|
if (!value) {
|
|
255078
255738
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -255102,8 +255762,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
255102
255762
|
}
|
|
255103
255763
|
}
|
|
255104
255764
|
const { project: project2 } = await readProjectConfig();
|
|
255105
|
-
const configDir =
|
|
255106
|
-
const authDir =
|
|
255765
|
+
const configDir = dirname15(project2.configPath);
|
|
255766
|
+
const authDir = join21(configDir, project2.authDir);
|
|
255107
255767
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
255108
255768
|
if (clientSecret) {
|
|
255109
255769
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -255128,7 +255788,7 @@ function getSocialLoginCommand() {
|
|
|
255128
255788
|
}
|
|
255129
255789
|
|
|
255130
255790
|
// src/cli/commands/auth/sso.ts
|
|
255131
|
-
import { dirname as
|
|
255791
|
+
import { dirname as dirname16, join as join22, resolve as resolve7 } from "node:path";
|
|
255132
255792
|
var SSOConfigFileSchema = exports_external.object({
|
|
255133
255793
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
255134
255794
|
clientId: exports_external.string(),
|
|
@@ -255144,7 +255804,7 @@ var SSOConfigFileSchema = exports_external.object({
|
|
|
255144
255804
|
ssoName: exports_external.string().optional()
|
|
255145
255805
|
});
|
|
255146
255806
|
async function loadSSOConfigFile(filePath) {
|
|
255147
|
-
const resolved =
|
|
255807
|
+
const resolved = resolve7(filePath);
|
|
255148
255808
|
const raw2 = await readJsonFile(resolved);
|
|
255149
255809
|
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
255150
255810
|
if (!result.success) {
|
|
@@ -255232,7 +255892,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
255232
255892
|
}
|
|
255233
255893
|
let clientSecret;
|
|
255234
255894
|
if (merged.envFile && !merged.clientSecret) {
|
|
255235
|
-
const secrets2 = await parseEnvFile(
|
|
255895
|
+
const secrets2 = await parseEnvFile(resolve7(merged.envFile));
|
|
255236
255896
|
const value = secrets2.sso_client_secret;
|
|
255237
255897
|
if (!value) {
|
|
255238
255898
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -255291,8 +255951,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
255291
255951
|
throw error48;
|
|
255292
255952
|
}
|
|
255293
255953
|
const { project: project2 } = await readProjectConfig();
|
|
255294
|
-
const configDir =
|
|
255295
|
-
const authDir =
|
|
255954
|
+
const configDir = dirname16(project2.configPath);
|
|
255955
|
+
const authDir = join22(configDir, project2.authDir);
|
|
255296
255956
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
255297
255957
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
255298
255958
|
return {
|
|
@@ -255307,8 +255967,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
255307
255967
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
255308
255968
|
}
|
|
255309
255969
|
const { project: project2 } = await readProjectConfig();
|
|
255310
|
-
const configDir =
|
|
255311
|
-
const authDir =
|
|
255970
|
+
const configDir = dirname16(project2.configPath);
|
|
255971
|
+
const authDir = join22(configDir, project2.authDir);
|
|
255312
255972
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
255313
255973
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
255314
255974
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -255870,19 +256530,19 @@ var baseOpen = async (options) => {
|
|
|
255870
256530
|
}
|
|
255871
256531
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
255872
256532
|
if (options.wait) {
|
|
255873
|
-
return new Promise((
|
|
256533
|
+
return new Promise((resolve8, reject) => {
|
|
255874
256534
|
subprocess.once("error", reject);
|
|
255875
256535
|
subprocess.once("close", (exitCode) => {
|
|
255876
256536
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
255877
256537
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
255878
256538
|
return;
|
|
255879
256539
|
}
|
|
255880
|
-
|
|
256540
|
+
resolve8(subprocess);
|
|
255881
256541
|
});
|
|
255882
256542
|
});
|
|
255883
256543
|
}
|
|
255884
256544
|
if (isFallbackAttempt) {
|
|
255885
|
-
return new Promise((
|
|
256545
|
+
return new Promise((resolve8, reject) => {
|
|
255886
256546
|
subprocess.once("error", reject);
|
|
255887
256547
|
subprocess.once("spawn", () => {
|
|
255888
256548
|
subprocess.once("close", (exitCode) => {
|
|
@@ -255892,17 +256552,17 @@ var baseOpen = async (options) => {
|
|
|
255892
256552
|
return;
|
|
255893
256553
|
}
|
|
255894
256554
|
subprocess.unref();
|
|
255895
|
-
|
|
256555
|
+
resolve8(subprocess);
|
|
255896
256556
|
});
|
|
255897
256557
|
});
|
|
255898
256558
|
});
|
|
255899
256559
|
}
|
|
255900
256560
|
subprocess.unref();
|
|
255901
|
-
return new Promise((
|
|
256561
|
+
return new Promise((resolve8, reject) => {
|
|
255902
256562
|
subprocess.once("error", reject);
|
|
255903
256563
|
subprocess.once("spawn", () => {
|
|
255904
256564
|
subprocess.off("error", reject);
|
|
255905
|
-
|
|
256565
|
+
resolve8(subprocess);
|
|
255906
256566
|
});
|
|
255907
256567
|
});
|
|
255908
256568
|
};
|
|
@@ -256165,13 +256825,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
256165
256825
|
}
|
|
256166
256826
|
|
|
256167
256827
|
// src/cli/commands/connectors/pull.ts
|
|
256168
|
-
import { dirname as
|
|
256828
|
+
import { dirname as dirname17, join as join23, resolve as resolve8 } from "node:path";
|
|
256169
256829
|
async function resolveConnectorsDir(options) {
|
|
256170
256830
|
if (!getAppContext().projectRoot) {
|
|
256171
|
-
return
|
|
256831
|
+
return resolve8(options.dir ?? "connectors");
|
|
256172
256832
|
}
|
|
256173
256833
|
const { project: project2 } = await readProjectConfig();
|
|
256174
|
-
return
|
|
256834
|
+
return join23(dirname17(project2.configPath), project2.connectorsDir);
|
|
256175
256835
|
}
|
|
256176
256836
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
256177
256837
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -256212,10 +256872,10 @@ function getConnectorsPullCommand() {
|
|
|
256212
256872
|
}
|
|
256213
256873
|
|
|
256214
256874
|
// src/cli/commands/connectors/push.ts
|
|
256215
|
-
import { resolve as
|
|
256875
|
+
import { resolve as resolve9 } from "node:path";
|
|
256216
256876
|
async function readConnectorsToPush(options) {
|
|
256217
256877
|
if (!getAppContext().projectRoot) {
|
|
256218
|
-
return readAllConnectors(
|
|
256878
|
+
return readAllConnectors(resolve9(options.dir ?? "connectors"));
|
|
256219
256879
|
}
|
|
256220
256880
|
const { connectors } = await readProjectConfig();
|
|
256221
256881
|
return connectors;
|
|
@@ -256579,11 +257239,11 @@ function getListCommand() {
|
|
|
256579
257239
|
}
|
|
256580
257240
|
|
|
256581
257241
|
// src/cli/commands/functions/pull.ts
|
|
256582
|
-
import { dirname as
|
|
257242
|
+
import { dirname as dirname18, join as join24 } from "node:path";
|
|
256583
257243
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
256584
257244
|
const { project: project2, functions } = await readProjectConfig();
|
|
256585
|
-
const configDir =
|
|
256586
|
-
const functionsDir =
|
|
257245
|
+
const configDir = dirname18(project2.configPath);
|
|
257246
|
+
const functionsDir = join24(configDir, project2.functionsDir);
|
|
256587
257247
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
256588
257248
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
256589
257249
|
const { functions: functions2 } = await listDeployedFunctions();
|
|
@@ -256642,11 +257302,11 @@ function getFunctionsCommand() {
|
|
|
256642
257302
|
}
|
|
256643
257303
|
|
|
256644
257304
|
// src/cli/commands/project/create.ts
|
|
256645
|
-
import { basename as basename4, resolve as
|
|
257305
|
+
import { basename as basename4, resolve as resolve10 } from "node:path";
|
|
256646
257306
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
256647
257307
|
|
|
256648
257308
|
// src/cli/commands/project/scaffold-shared.ts
|
|
256649
|
-
import { join as
|
|
257309
|
+
import { join as join25 } from "node:path";
|
|
256650
257310
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
256651
257311
|
async function getTemplateById(templateId) {
|
|
256652
257312
|
const templates = await listTemplates();
|
|
@@ -256663,7 +257323,7 @@ async function completeProjectSetup({
|
|
|
256663
257323
|
projectId,
|
|
256664
257324
|
name: name2,
|
|
256665
257325
|
resolvedPath,
|
|
256666
|
-
deploy:
|
|
257326
|
+
deploy: deploy6,
|
|
256667
257327
|
skills,
|
|
256668
257328
|
isInteractive
|
|
256669
257329
|
}, { runTask: runTask2 }) {
|
|
@@ -256677,7 +257337,7 @@ async function completeProjectSetup({
|
|
|
256677
257337
|
});
|
|
256678
257338
|
shouldPushEntities = !Ct(result) && result;
|
|
256679
257339
|
} else {
|
|
256680
|
-
shouldPushEntities = !!
|
|
257340
|
+
shouldPushEntities = !!deploy6;
|
|
256681
257341
|
}
|
|
256682
257342
|
if (shouldPushEntities) {
|
|
256683
257343
|
await runTask2(`Pushing ${entities.length} data models to Base44...`, async () => {
|
|
@@ -256697,7 +257357,7 @@ async function completeProjectSetup({
|
|
|
256697
257357
|
});
|
|
256698
257358
|
shouldDeploy = !Ct(result) && result;
|
|
256699
257359
|
} else {
|
|
256700
|
-
shouldDeploy = !!
|
|
257360
|
+
shouldDeploy = !!deploy6;
|
|
256701
257361
|
}
|
|
256702
257362
|
if (shouldDeploy && installCommand && buildCommand && outputDirectory) {
|
|
256703
257363
|
const { appUrl } = await runTask2("Installing dependencies...", async (updateMessage) => {
|
|
@@ -256705,7 +257365,7 @@ async function completeProjectSetup({
|
|
|
256705
257365
|
updateMessage("Building project...");
|
|
256706
257366
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
256707
257367
|
updateMessage("Deploying site...");
|
|
256708
|
-
return await deploySite(
|
|
257368
|
+
return await deploySite(join25(resolvedPath, outputDirectory));
|
|
256709
257369
|
}, {
|
|
256710
257370
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
256711
257371
|
errorMessage: "Failed to deploy site"
|
|
@@ -256751,7 +257411,7 @@ function workspaceLabel(workspace2) {
|
|
|
256751
257411
|
const suffix = workspace2.isPersonal ? "personal" : workspace2.userRole ?? "member";
|
|
256752
257412
|
return `${workspace2.name} (${suffix})`;
|
|
256753
257413
|
}
|
|
256754
|
-
async function resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive
|
|
257414
|
+
async function resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive) {
|
|
256755
257415
|
if (flagWorkspaceId) {
|
|
256756
257416
|
return flagWorkspaceId;
|
|
256757
257417
|
}
|
|
@@ -256762,13 +257422,13 @@ async function resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive, options =
|
|
|
256762
257422
|
if (workspaces.length <= 1) {
|
|
256763
257423
|
return;
|
|
256764
257424
|
}
|
|
256765
|
-
const
|
|
257425
|
+
const options = workspaces.map((w) => ({
|
|
256766
257426
|
value: w.id,
|
|
256767
257427
|
label: workspaceLabel(w)
|
|
256768
257428
|
}));
|
|
256769
257429
|
const selected = await Je({
|
|
256770
|
-
message:
|
|
256771
|
-
options
|
|
257430
|
+
message: "Which workspace should this app belong to?",
|
|
257431
|
+
options,
|
|
256772
257432
|
initialValue: workspaces[0].id
|
|
256773
257433
|
});
|
|
256774
257434
|
if (Ct(selected)) {
|
|
@@ -256834,7 +257494,7 @@ async function createInteractive(options, ctx) {
|
|
|
256834
257494
|
}, ctx);
|
|
256835
257495
|
}
|
|
256836
257496
|
async function createNonInteractive(options, ctx) {
|
|
256837
|
-
ctx.log.info(`Creating a new project at ${
|
|
257497
|
+
ctx.log.info(`Creating a new project at ${resolve10(options.path)}`);
|
|
256838
257498
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
256839
257499
|
return await executeCreate({
|
|
256840
257500
|
template: template2,
|
|
@@ -256851,14 +257511,14 @@ async function executeCreate({
|
|
|
256851
257511
|
name: rawName,
|
|
256852
257512
|
description,
|
|
256853
257513
|
projectPath,
|
|
256854
|
-
deploy:
|
|
257514
|
+
deploy: deploy6,
|
|
256855
257515
|
skills,
|
|
256856
257516
|
workspaceId: flagWorkspaceId,
|
|
256857
257517
|
isInteractive
|
|
256858
257518
|
}, ctx) {
|
|
256859
257519
|
const { log, runTask: runTask2 } = ctx;
|
|
256860
257520
|
const name2 = rawName.trim();
|
|
256861
|
-
const resolvedPath =
|
|
257521
|
+
const resolvedPath = resolve10(projectPath);
|
|
256862
257522
|
const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
|
|
256863
257523
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
256864
257524
|
return await createProjectFiles({
|
|
@@ -256873,7 +257533,7 @@ async function executeCreate({
|
|
|
256873
257533
|
errorMessage: "Failed to create project"
|
|
256874
257534
|
});
|
|
256875
257535
|
setAppContext({ id: projectId, projectRoot: resolvedPath });
|
|
256876
|
-
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy:
|
|
257536
|
+
const summary = await completeProjectSetup({ projectId, name: name2, resolvedPath, deploy: deploy6, skills, isInteractive }, ctx);
|
|
256877
257537
|
printProjectSummary(summary, log);
|
|
256878
257538
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
256879
257539
|
}
|
|
@@ -256909,17 +257569,24 @@ Examples:
|
|
|
256909
257569
|
}
|
|
256910
257570
|
|
|
256911
257571
|
// src/cli/commands/project/deploy.ts
|
|
256912
|
-
|
|
257572
|
+
import { resolve as resolve11 } from "node:path";
|
|
257573
|
+
async function deployAction(ctx, options = {}) {
|
|
257574
|
+
const { isNonInteractive, log } = ctx;
|
|
256913
257575
|
if (isNonInteractive && !options.yes) {
|
|
256914
257576
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
256915
257577
|
}
|
|
257578
|
+
if (options.build && options.prebuilt) {
|
|
257579
|
+
throw new InvalidInputError("--build and --prebuilt cannot be combined.");
|
|
257580
|
+
}
|
|
256916
257581
|
const projectData = await readProjectConfig(options.projectRoot);
|
|
256917
|
-
|
|
257582
|
+
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
257583
|
+
let fullStackArtifact = await detectFullStackArtifact(project2.root);
|
|
257584
|
+
const isFullStackCandidate = fullStackArtifact !== null || Boolean(project2.site?.buildCommand);
|
|
257585
|
+
if (!hasResourcesToDeploy(projectData) && !isFullStackCandidate) {
|
|
256918
257586
|
return {
|
|
256919
257587
|
outroMessage: "No resources found to deploy"
|
|
256920
257588
|
};
|
|
256921
257589
|
}
|
|
256922
|
-
const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
|
|
256923
257590
|
const summaryLines = [];
|
|
256924
257591
|
if (entities.length > 0) {
|
|
256925
257592
|
summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -256939,7 +257606,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
256939
257606
|
if (project2.visibility) {
|
|
256940
257607
|
summaryLines.push(` - Visibility: ${project2.visibility}`);
|
|
256941
257608
|
}
|
|
256942
|
-
if (
|
|
257609
|
+
if (fullStackArtifact) {
|
|
257610
|
+
summaryLines.push(" - Full-stack app");
|
|
257611
|
+
} else if (project2.site?.outputDirectory) {
|
|
256943
257612
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
256944
257613
|
}
|
|
256945
257614
|
if (!options.yes) {
|
|
@@ -256960,6 +257629,7 @@ ${summaryLines.join(`
|
|
|
256960
257629
|
let functionCompleted = 0;
|
|
256961
257630
|
const functionTotal = functions.length;
|
|
256962
257631
|
const result = await deployAll(projectData, {
|
|
257632
|
+
site: false,
|
|
256963
257633
|
onVisibilitySet: (level) => {
|
|
256964
257634
|
log.success(`App visibility set to ${level}`);
|
|
256965
257635
|
},
|
|
@@ -256972,6 +257642,20 @@ ${summaryLines.join(`
|
|
|
256972
257642
|
formatDeployResult(r, log);
|
|
256973
257643
|
}
|
|
256974
257644
|
});
|
|
257645
|
+
await buildSiteIfNeeded(ctx, projectData, options, fullStackArtifact);
|
|
257646
|
+
fullStackArtifact = await detectFullStackArtifact(project2.root);
|
|
257647
|
+
let appUrl;
|
|
257648
|
+
let fullStackResult;
|
|
257649
|
+
if (fullStackArtifact) {
|
|
257650
|
+
fullStackResult = await runFullStackDeploy(ctx, project2.root, options);
|
|
257651
|
+
} else if (project2.site?.outputDirectory) {
|
|
257652
|
+
const outputDir = resolve11(project2.root, project2.site.outputDirectory);
|
|
257653
|
+
if (staticWorkersEnabled()) {
|
|
257654
|
+
fullStackResult = await runFullStackDeploy(ctx, project2.root, options, outputDir);
|
|
257655
|
+
} else {
|
|
257656
|
+
({ appUrl } = await deploySite(outputDir));
|
|
257657
|
+
}
|
|
257658
|
+
}
|
|
256975
257659
|
const connectorResults = result.connectorResults ?? [];
|
|
256976
257660
|
await handleOAuthConnectors(connectorResults, isNonInteractive, options, log);
|
|
256977
257661
|
const stripeResult = connectorResults.find((r) => r.type === "stripe");
|
|
@@ -256979,13 +257663,83 @@ ${summaryLines.join(`
|
|
|
256979
257663
|
printStripeResult(stripeResult, log);
|
|
256980
257664
|
}
|
|
256981
257665
|
log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
256982
|
-
if (
|
|
256983
|
-
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(
|
|
257666
|
+
if (appUrl) {
|
|
257667
|
+
log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(appUrl)}`);
|
|
257668
|
+
}
|
|
257669
|
+
if (fullStackResult) {
|
|
257670
|
+
printFullStackSummary(fullStackResult, log);
|
|
256984
257671
|
}
|
|
256985
|
-
return {
|
|
257672
|
+
return {
|
|
257673
|
+
outroMessage: "App deployed successfully",
|
|
257674
|
+
stdout: ctx.jsonMode && fullStackResult ? `${JSON.stringify({
|
|
257675
|
+
deploymentId: fullStackResult.deploymentId,
|
|
257676
|
+
gitHash: fullStackResult.gitHash
|
|
257677
|
+
}, null, 2)}
|
|
257678
|
+
` : undefined
|
|
257679
|
+
};
|
|
257680
|
+
}
|
|
257681
|
+
async function buildSiteIfNeeded({ runTask: runTask2 }, { project: project2 }, options, fullStackArtifact) {
|
|
257682
|
+
const site2 = project2.site;
|
|
257683
|
+
if (!site2?.buildCommand || options.prebuilt)
|
|
257684
|
+
return;
|
|
257685
|
+
const artifactPresent = fullStackArtifact !== null || (site2.outputDirectory ? await pathExists(resolve11(project2.root, site2.outputDirectory)) : false);
|
|
257686
|
+
if (artifactPresent && !options.build)
|
|
257687
|
+
return;
|
|
257688
|
+
const { installCommand, buildCommand } = site2;
|
|
257689
|
+
await runTask2(installCommand ? "Installing dependencies..." : "Building project...", async (updateMessage) => {
|
|
257690
|
+
if (installCommand) {
|
|
257691
|
+
await execa({ cwd: project2.root, shell: true })`${installCommand}`;
|
|
257692
|
+
updateMessage("Building project...");
|
|
257693
|
+
}
|
|
257694
|
+
await execa({ cwd: project2.root, shell: true })`${buildCommand}`;
|
|
257695
|
+
}, {
|
|
257696
|
+
successMessage: "Project built successfully",
|
|
257697
|
+
errorMessage: "Failed to build project"
|
|
257698
|
+
});
|
|
257699
|
+
}
|
|
257700
|
+
async function runFullStackDeploy({ runTask: runTask2, log }, projectRoot, options, staticOutputDir) {
|
|
257701
|
+
const gitHash = await resolveGitHash(projectRoot, options.gitHash);
|
|
257702
|
+
const progressLines = [];
|
|
257703
|
+
const warnings = [];
|
|
257704
|
+
const deployment = await runTask2(staticOutputDir ? "Deploying site to Workers..." : "Deploying full-stack app...", async (updateMessage) => {
|
|
257705
|
+
const progress = {
|
|
257706
|
+
onWarning: (message) => {
|
|
257707
|
+
warnings.push(message);
|
|
257708
|
+
},
|
|
257709
|
+
onAssets: ({ totalAssets, newAssets }) => {
|
|
257710
|
+
const line = `Found ${totalAssets} static assets (${newAssets} new)`;
|
|
257711
|
+
progressLines.push(line);
|
|
257712
|
+
updateMessage(line);
|
|
257713
|
+
},
|
|
257714
|
+
onAssetUpload: ({ uploadedFiles, totalFiles }) => {
|
|
257715
|
+
updateMessage(`Uploaded ${uploadedFiles} of ${totalFiles} assets`);
|
|
257716
|
+
},
|
|
257717
|
+
onWorker: ({ moduleCount }) => {
|
|
257718
|
+
updateMessage(`Deploying worker (${moduleCount} modules)…`);
|
|
257719
|
+
}
|
|
257720
|
+
};
|
|
257721
|
+
return staticOutputDir ? await deployStaticSite({
|
|
257722
|
+
outputDir: staticOutputDir,
|
|
257723
|
+
gitHash,
|
|
257724
|
+
progress
|
|
257725
|
+
}) : await deployFullStack({ projectRoot, gitHash, progress });
|
|
257726
|
+
}, {
|
|
257727
|
+
successMessage: theme.colors.base44Orange(staticOutputDir ? "Site deployed to Workers" : "Full-stack app deployed"),
|
|
257728
|
+
errorMessage: staticOutputDir ? "Site deploy failed" : "Full-stack deploy failed"
|
|
257729
|
+
});
|
|
257730
|
+
for (const line of progressLines) {
|
|
257731
|
+
log.message(theme.styles.dim(line));
|
|
257732
|
+
}
|
|
257733
|
+
for (const warning of warnings) {
|
|
257734
|
+
log.warn(warning);
|
|
257735
|
+
}
|
|
257736
|
+
return deployment;
|
|
257737
|
+
}
|
|
257738
|
+
function printFullStackSummary(deployment, log) {
|
|
257739
|
+
log.message(`${theme.styles.header("Deployment")}: ${deployment.deploymentId} ${theme.styles.dim(`(commit ${deployment.gitHash.slice(0, 12)})`)}`);
|
|
256986
257740
|
}
|
|
256987
257741
|
function getDeployCommand2() {
|
|
256988
|
-
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
|
|
257742
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--git-hash <hash>", "Commit the full-stack build came from (defaults to the checkout's HEAD)").option("--build", "Run the configured install/build commands before deploying, even when a build artifact already exists").option("--prebuilt", "Skip the build step and deploy the existing artifact").action(deployAction);
|
|
256989
257743
|
}
|
|
256990
257744
|
async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
|
|
256991
257745
|
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
@@ -257101,36 +257855,6 @@ async function promptForExistingProject(projects) {
|
|
|
257101
257855
|
}
|
|
257102
257856
|
return selectedProject;
|
|
257103
257857
|
}
|
|
257104
|
-
async function resolveExplicitAppId(ctx, appId) {
|
|
257105
|
-
await ctx.runTask("Validating app...", () => getApp(appId), {
|
|
257106
|
-
errorMessage: "Could not validate app"
|
|
257107
|
-
}).catch((error48) => {
|
|
257108
|
-
if (error48 instanceof ApiError && (error48.statusCode === 404 || error48.statusCode === 403)) {
|
|
257109
|
-
throw new InvalidInputError(`App "${appId}" not found, or you don't have access to it.`, {
|
|
257110
|
-
hints: [
|
|
257111
|
-
{ message: "Check the app ID is correct" },
|
|
257112
|
-
{
|
|
257113
|
-
message: "Run 'base44 link' without --app-id to browse apps by workspace"
|
|
257114
|
-
}
|
|
257115
|
-
]
|
|
257116
|
-
});
|
|
257117
|
-
}
|
|
257118
|
-
throw error48;
|
|
257119
|
-
});
|
|
257120
|
-
return appId;
|
|
257121
|
-
}
|
|
257122
|
-
async function chooseProjectInteractively(ctx, options) {
|
|
257123
|
-
const workspaceId = await resolveWorkspaceId(ctx, options.workspace ?? options.org, !ctx.isNonInteractive, { promptMessage: "Which workspace is the app in?" });
|
|
257124
|
-
const projects = await ctx.runTask("Fetching projects...", () => listProjects({ workspaceId }), {
|
|
257125
|
-
successMessage: "Projects fetched",
|
|
257126
|
-
errorMessage: "Failed to fetch projects"
|
|
257127
|
-
});
|
|
257128
|
-
if (!projects.length) {
|
|
257129
|
-
return;
|
|
257130
|
-
}
|
|
257131
|
-
const selectedProject = await promptForExistingProject(projects);
|
|
257132
|
-
return selectedProject.id;
|
|
257133
|
-
}
|
|
257134
257858
|
async function link(ctx, options, command2) {
|
|
257135
257859
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
257136
257860
|
const appId = readExplicitAppId(command2).value;
|
|
@@ -257154,10 +257878,31 @@ async function link(ctx, options, command2) {
|
|
|
257154
257878
|
let finalAppId;
|
|
257155
257879
|
const action = appId ? "choose" : options.create ? "create" : await promptForLinkAction();
|
|
257156
257880
|
if (action === "choose") {
|
|
257157
|
-
const
|
|
257158
|
-
|
|
257881
|
+
const projects = await runTask2("Fetching projects...", async () => listProjects(), {
|
|
257882
|
+
successMessage: "Projects fetched",
|
|
257883
|
+
errorMessage: "Failed to fetch projects"
|
|
257884
|
+
});
|
|
257885
|
+
if (!projects.length) {
|
|
257159
257886
|
return { outroMessage: "No projects available for linking" };
|
|
257160
257887
|
}
|
|
257888
|
+
let linkedAppId;
|
|
257889
|
+
if (appId) {
|
|
257890
|
+
const project2 = projects.find((p) => p.id === appId);
|
|
257891
|
+
if (!project2) {
|
|
257892
|
+
throw new InvalidInputError(`App with ID "${appId}" not found.`, {
|
|
257893
|
+
hints: [
|
|
257894
|
+
{ message: "Check the app ID is correct" },
|
|
257895
|
+
{
|
|
257896
|
+
message: "Use 'base44 link' without --app-id to see available projects"
|
|
257897
|
+
}
|
|
257898
|
+
]
|
|
257899
|
+
});
|
|
257900
|
+
}
|
|
257901
|
+
linkedAppId = appId;
|
|
257902
|
+
} else {
|
|
257903
|
+
const selectedProject = await promptForExistingProject(projects);
|
|
257904
|
+
linkedAppId = selectedProject.id;
|
|
257905
|
+
}
|
|
257161
257906
|
await runTask2("Linking project...", async () => {
|
|
257162
257907
|
await writeAppConfig(projectRoot.root, linkedAppId);
|
|
257163
257908
|
setAppContext({ id: linkedAppId, projectRoot: projectRoot.root });
|
|
@@ -257186,7 +257931,7 @@ async function link(ctx, options, command2) {
|
|
|
257186
257931
|
function getLinkCommand() {
|
|
257187
257932
|
return new Base44Command("link", {
|
|
257188
257933
|
requireAppContext: false
|
|
257189
|
-
}).description("Link a local project to a Base44 project (create new or link existing)").configureHelp({ showGlobalOptions: true }).option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-w, --workspace <id>", "Workspace (organization) ID to
|
|
257934
|
+
}).description("Link a local project to a Base44 project (create new or link existing)").configureHelp({ showGlobalOptions: true }).option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-w, --workspace <id>", "Workspace (organization) ID to create the app in when using --create (defaults to your personal workspace)").addOption(new Option("--org <id>", "Alias for --workspace").hideHelp()).addOption(new Option("-p, --project-id <id>", "Project ID to link to an existing project").hideHelp()).addOption(new Option("--projectId <id>", "Project ID to link to an existing project").hideHelp()).hook("preAction", validateNonInteractiveFlags).action(link);
|
|
257190
257935
|
}
|
|
257191
257936
|
|
|
257192
257937
|
// src/cli/commands/project/logs.ts
|
|
@@ -257272,7 +258017,7 @@ async function followLogs(functionNames, options, availableFunctionNames, jsonMo
|
|
|
257272
258017
|
for (const entry of fresh)
|
|
257273
258018
|
writeFollowLine(entry, jsonMode);
|
|
257274
258019
|
first = false;
|
|
257275
|
-
await new Promise((
|
|
258020
|
+
await new Promise((resolve12) => setTimeout(resolve12, 2000));
|
|
257276
258021
|
}
|
|
257277
258022
|
}
|
|
257278
258023
|
function formatLogs(entries, env3) {
|
|
@@ -257386,7 +258131,7 @@ function getLogsCommand() {
|
|
|
257386
258131
|
}
|
|
257387
258132
|
|
|
257388
258133
|
// src/cli/commands/project/scaffold.ts
|
|
257389
|
-
import { basename as basename5, resolve as
|
|
258134
|
+
import { basename as basename5, resolve as resolve12 } from "node:path";
|
|
257390
258135
|
function resolveAppId(options) {
|
|
257391
258136
|
const appId = options.appId;
|
|
257392
258137
|
if (!appId) {
|
|
@@ -257402,7 +258147,7 @@ function resolveAppId(options) {
|
|
|
257402
258147
|
async function scaffoldAction(ctx, name2, options, command2) {
|
|
257403
258148
|
const { log, runTask: runTask2 } = ctx;
|
|
257404
258149
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
257405
|
-
const resolvedPath =
|
|
258150
|
+
const resolvedPath = resolve12("./");
|
|
257406
258151
|
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
257407
258152
|
const template2 = await getTemplateById("backend-only");
|
|
257408
258153
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -257568,7 +258313,7 @@ function withSandboxAuthHint(error48) {
|
|
|
257568
258313
|
cause: error48
|
|
257569
258314
|
});
|
|
257570
258315
|
}
|
|
257571
|
-
async function callTool(appId, tool, payload,
|
|
258316
|
+
async function callTool(appId, tool, payload, schema13, context, timeout2 = 60000) {
|
|
257572
258317
|
const client = getSandboxClient(appId);
|
|
257573
258318
|
let response;
|
|
257574
258319
|
try {
|
|
@@ -257576,7 +258321,7 @@ async function callTool(appId, tool, payload, schema12, context, timeout2 = 6000
|
|
|
257576
258321
|
} catch (error48) {
|
|
257577
258322
|
throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
|
|
257578
258323
|
}
|
|
257579
|
-
const result =
|
|
258324
|
+
const result = schema13.safeParse(await response.json());
|
|
257580
258325
|
if (!result.success) {
|
|
257581
258326
|
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
257582
258327
|
}
|
|
@@ -257585,7 +258330,7 @@ async function callTool(appId, tool, payload, schema12, context, timeout2 = 6000
|
|
|
257585
258330
|
function listDirectory(appId, params) {
|
|
257586
258331
|
return callTool(appId, "list_directory", { ...params }, ListDirectoryResponseSchema, "listing directory");
|
|
257587
258332
|
}
|
|
257588
|
-
function
|
|
258333
|
+
function readFile5(appId, params) {
|
|
257589
258334
|
return callTool(appId, "read_file", { ...params }, ReadFileResponseSchema, "reading file");
|
|
257590
258335
|
}
|
|
257591
258336
|
function writeFile2(appId, params) {
|
|
@@ -257715,7 +258460,7 @@ async function readFileAction({ runTask: runTask2 }, paths, options) {
|
|
|
257715
258460
|
const { id: appId } = getAppContext();
|
|
257716
258461
|
const offset = parsePositiveInt(options.offset, "--offset");
|
|
257717
258462
|
const limit = parsePositiveInt(options.limit, "--limit");
|
|
257718
|
-
const result = await runTask2("Reading file", () =>
|
|
258463
|
+
const result = await runTask2("Reading file", () => readFile5(appId, { paths, offset, limit }));
|
|
257719
258464
|
return { outroMessage: "Read file", stdout: toJsonStdout(result) };
|
|
257720
258465
|
}
|
|
257721
258466
|
function getSandboxReadFileCommand() {
|
|
@@ -257799,7 +258544,7 @@ function getSecretsListCommand() {
|
|
|
257799
258544
|
}
|
|
257800
258545
|
|
|
257801
258546
|
// src/cli/commands/secrets/set.ts
|
|
257802
|
-
import { resolve as
|
|
258547
|
+
import { resolve as resolve13 } from "node:path";
|
|
257803
258548
|
function parseEntries(entries) {
|
|
257804
258549
|
const secrets = {};
|
|
257805
258550
|
for (const entry of entries) {
|
|
@@ -257830,7 +258575,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
257830
258575
|
validateInput(entries, options);
|
|
257831
258576
|
let secrets;
|
|
257832
258577
|
if (options.envFile) {
|
|
257833
|
-
secrets = await parseEnvFile(
|
|
258578
|
+
secrets = await parseEnvFile(resolve13(options.envFile));
|
|
257834
258579
|
if (Object.keys(secrets).length === 0) {
|
|
257835
258580
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
257836
258581
|
}
|
|
@@ -257859,7 +258604,7 @@ function getSecretsCommand() {
|
|
|
257859
258604
|
}
|
|
257860
258605
|
|
|
257861
258606
|
// src/cli/commands/site/deploy.ts
|
|
257862
|
-
import { resolve as
|
|
258607
|
+
import { resolve as resolve14 } from "node:path";
|
|
257863
258608
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
257864
258609
|
if (isNonInteractive && !options.yes) {
|
|
257865
258610
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -257874,7 +258619,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
257874
258619
|
]
|
|
257875
258620
|
});
|
|
257876
258621
|
}
|
|
257877
|
-
const outputDir =
|
|
258622
|
+
const outputDir = resolve14(project2.root, project2.site.outputDirectory);
|
|
257878
258623
|
if (!options.yes) {
|
|
257879
258624
|
const shouldDeploy = await Re({
|
|
257880
258625
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -257970,9 +258715,9 @@ async function generateContent(input) {
|
|
|
257970
258715
|
`);
|
|
257971
258716
|
}
|
|
257972
258717
|
async function compileEntity(entity2) {
|
|
257973
|
-
const { name: name2, source: _source, ...
|
|
258718
|
+
const { name: name2, source: _source, ...schema13 } = entity2;
|
|
257974
258719
|
const jsonSchema = {
|
|
257975
|
-
...
|
|
258720
|
+
...schema13,
|
|
257976
258721
|
title: name2,
|
|
257977
258722
|
additionalProperties: false
|
|
257978
258723
|
};
|
|
@@ -257999,10 +258744,10 @@ function toPascalCase(name2) {
|
|
|
257999
258744
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
258000
258745
|
}
|
|
258001
258746
|
// src/core/types/update-project.ts
|
|
258002
|
-
import { join as
|
|
258747
|
+
import { join as join28 } from "node:path";
|
|
258003
258748
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
258004
258749
|
async function updateProjectConfig(projectRoot) {
|
|
258005
|
-
const tsconfigPath =
|
|
258750
|
+
const tsconfigPath = join28(projectRoot, "tsconfig.json");
|
|
258006
258751
|
if (!await pathExists(tsconfigPath)) {
|
|
258007
258752
|
return false;
|
|
258008
258753
|
}
|
|
@@ -258237,7 +258982,7 @@ function createDevLogger(label2, labelColor = theme.styles.dim) {
|
|
|
258237
258982
|
// src/cli/dev/dev-server/main.ts
|
|
258238
258983
|
var import_cors = __toESM(require_lib4(), 1);
|
|
258239
258984
|
var import_express6 = __toESM(require_express(), 1);
|
|
258240
|
-
import { dirname as
|
|
258985
|
+
import { dirname as dirname24, join as join35 } from "node:path";
|
|
258241
258986
|
|
|
258242
258987
|
// ../../node_modules/get-port/index.js
|
|
258243
258988
|
import net from "node:net";
|
|
@@ -258264,14 +259009,14 @@ var getLocalHosts = () => {
|
|
|
258264
259009
|
}
|
|
258265
259010
|
return results;
|
|
258266
259011
|
};
|
|
258267
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
259012
|
+
var checkAvailablePort = (options8) => new Promise((resolve16, reject) => {
|
|
258268
259013
|
const server = net.createServer();
|
|
258269
259014
|
server.unref();
|
|
258270
259015
|
server.on("error", reject);
|
|
258271
259016
|
server.listen(options8, () => {
|
|
258272
259017
|
const { port } = server.address();
|
|
258273
259018
|
server.close(() => {
|
|
258274
|
-
|
|
259019
|
+
resolve16(port);
|
|
258275
259020
|
});
|
|
258276
259021
|
});
|
|
258277
259022
|
});
|
|
@@ -258372,7 +259117,7 @@ var $setGracefulCleanup = tmp.setGracefulCleanup;
|
|
|
258372
259117
|
|
|
258373
259118
|
// src/cli/dev/dev-server/function-manager.ts
|
|
258374
259119
|
import { spawn as spawn2 } from "node:child_process";
|
|
258375
|
-
import { dirname as
|
|
259120
|
+
import { dirname as dirname21, join as join29 } from "node:path";
|
|
258376
259121
|
import { pathToFileURL } from "node:url";
|
|
258377
259122
|
|
|
258378
259123
|
// src/cli/dev/dev-server/base-function-manager.ts
|
|
@@ -258477,7 +259222,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258477
259222
|
}
|
|
258478
259223
|
spawnFunction(func, port) {
|
|
258479
259224
|
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
258480
|
-
const importMapPath =
|
|
259225
|
+
const importMapPath = join29(dirname21(this.wrapperPath), "import-map.json");
|
|
258481
259226
|
const process23 = spawn2("deno", ["run", "--allow-all", "--import-map", importMapPath, this.wrapperPath], {
|
|
258482
259227
|
env: {
|
|
258483
259228
|
...globalThis.process.env,
|
|
@@ -258516,7 +259261,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258516
259261
|
});
|
|
258517
259262
|
}
|
|
258518
259263
|
waitForReady(name2, runningFunc) {
|
|
258519
|
-
return new Promise((
|
|
259264
|
+
return new Promise((resolve16, reject) => {
|
|
258520
259265
|
runningFunc.process.on("exit", (code2) => {
|
|
258521
259266
|
if (!runningFunc.ready) {
|
|
258522
259267
|
clearTimeout(timeout3);
|
|
@@ -258539,7 +259284,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258539
259284
|
runningFunc.ready = true;
|
|
258540
259285
|
clearTimeout(timeout3);
|
|
258541
259286
|
runningFunc.process.stdout?.off("data", onData);
|
|
258542
|
-
|
|
259287
|
+
resolve16(runningFunc.port);
|
|
258543
259288
|
}
|
|
258544
259289
|
};
|
|
258545
259290
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -258551,7 +259296,7 @@ class FunctionManager extends BaseFunctionManager {
|
|
|
258551
259296
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
258552
259297
|
import { isBuiltin } from "node:module";
|
|
258553
259298
|
import { homedir as homedir3 } from "node:os";
|
|
258554
|
-
import { join as
|
|
259299
|
+
import { join as join30 } from "node:path";
|
|
258555
259300
|
import { pathToFileURL as pathToFileURL6 } from "node:url";
|
|
258556
259301
|
var depsPromise;
|
|
258557
259302
|
function loadDeps() {
|
|
@@ -258672,9 +259417,9 @@ export default {
|
|
|
258672
259417
|
};
|
|
258673
259418
|
`;
|
|
258674
259419
|
function ensureBundlerConfig() {
|
|
258675
|
-
const dir =
|
|
259420
|
+
const dir = join30(homedir3(), ".base44", "function-bundler");
|
|
258676
259421
|
mkdirSync2(dir, { recursive: true });
|
|
258677
|
-
const configPath =
|
|
259422
|
+
const configPath = join30(dir, "deno.json");
|
|
258678
259423
|
writeFileSync2(configPath, `${JSON.stringify({ nodeModulesDir: "auto" }, null, 2)}
|
|
258679
259424
|
`);
|
|
258680
259425
|
return configPath;
|
|
@@ -259262,22 +260007,22 @@ class Database {
|
|
|
259262
260007
|
this.schemas.clear();
|
|
259263
260008
|
}
|
|
259264
260009
|
validate(entityName, record2, partial2 = false) {
|
|
259265
|
-
const
|
|
259266
|
-
if (!
|
|
260010
|
+
const schema13 = this.schemas.get(this.normalizeName(entityName));
|
|
260011
|
+
if (!schema13) {
|
|
259267
260012
|
throw new Error(`Entity "${entityName}" not found`);
|
|
259268
260013
|
}
|
|
259269
|
-
return this.validator.validate(record2,
|
|
260014
|
+
return this.validator.validate(record2, schema13, partial2);
|
|
259270
260015
|
}
|
|
259271
260016
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
259272
|
-
const
|
|
259273
|
-
if (!
|
|
260017
|
+
const schema13 = this.schemas.get(this.normalizeName(entityName));
|
|
260018
|
+
if (!schema13) {
|
|
259274
260019
|
throw new Error(`Entity "${entityName}" not found`);
|
|
259275
260020
|
}
|
|
259276
|
-
const filteredRecord = this.validator.filterFields(record2,
|
|
260021
|
+
const filteredRecord = this.validator.filterFields(record2, schema13);
|
|
259277
260022
|
if (partial2) {
|
|
259278
260023
|
return filteredRecord;
|
|
259279
260024
|
}
|
|
259280
|
-
return this.validator.applyDefaults(filteredRecord,
|
|
260025
|
+
return this.validator.applyDefaults(filteredRecord, schema13);
|
|
259281
260026
|
}
|
|
259282
260027
|
normalizeName(entityName) {
|
|
259283
260028
|
return entityName.toLowerCase();
|
|
@@ -259571,13 +260316,13 @@ function checkRLS(rule, record2, user) {
|
|
|
259571
260316
|
return false;
|
|
259572
260317
|
return evaluateCondition(rule, record2, user);
|
|
259573
260318
|
}
|
|
259574
|
-
function applyFLS(record2,
|
|
260319
|
+
function applyFLS(record2, schema13, user, operation) {
|
|
259575
260320
|
if (Array.isArray(record2)) {
|
|
259576
|
-
return record2.map((r5) => applyFLS(r5,
|
|
260321
|
+
return record2.map((r5) => applyFLS(r5, schema13, user, operation));
|
|
259577
260322
|
}
|
|
259578
260323
|
const result = {};
|
|
259579
260324
|
for (const [key2, value] of Object.entries(record2)) {
|
|
259580
|
-
const rule =
|
|
260325
|
+
const rule = schema13.properties[key2]?.rls?.[operation];
|
|
259581
260326
|
if (rule === undefined || checkRLS(rule, record2, user)) {
|
|
259582
260327
|
result[key2] = value;
|
|
259583
260328
|
}
|
|
@@ -259805,14 +260550,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259805
260550
|
res.status(404).json({ error: `Entity "${entityName}" not found` });
|
|
259806
260551
|
return;
|
|
259807
260552
|
}
|
|
259808
|
-
const
|
|
259809
|
-
if (!
|
|
260553
|
+
const schema13 = db2.getSchema(entityName);
|
|
260554
|
+
if (!schema13) {
|
|
259810
260555
|
res.status(404).json({ error: `Schema for "${entityName}" not found` });
|
|
259811
260556
|
return;
|
|
259812
260557
|
}
|
|
259813
260558
|
const currentUserResult = await resolveCurrentUser(db2, req);
|
|
259814
260559
|
const currentUser = currentUserResult.ok ? currentUserResult.user : undefined;
|
|
259815
|
-
await handler(req, res, collection,
|
|
260560
|
+
await handler(req, res, collection, schema13, currentUser);
|
|
259816
260561
|
};
|
|
259817
260562
|
}
|
|
259818
260563
|
function emit(appId, entityName, type, data) {
|
|
@@ -259830,19 +260575,19 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259830
260575
|
}
|
|
259831
260576
|
broadcast(appId, entityName, createData(data));
|
|
259832
260577
|
}
|
|
259833
|
-
function prepareCreateRecord(entityName, body,
|
|
260578
|
+
function prepareCreateRecord(entityName, body, schema13, currentUser, now) {
|
|
259834
260579
|
const { _id, ...recordBody } = body;
|
|
259835
260580
|
const ownerFields = {
|
|
259836
260581
|
created_by: currentUser?.email,
|
|
259837
260582
|
created_by_id: currentUser?.id
|
|
259838
260583
|
};
|
|
259839
|
-
if (!checkRLS(
|
|
260584
|
+
if (!checkRLS(schema13.rls?.create, {
|
|
259840
260585
|
...recordBody,
|
|
259841
260586
|
...ownerFields
|
|
259842
260587
|
}, currentUser)) {
|
|
259843
260588
|
return;
|
|
259844
260589
|
}
|
|
259845
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody),
|
|
260590
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, recordBody), schema13, currentUser, "write");
|
|
259846
260591
|
db2.validate(entityName, filteredBody);
|
|
259847
260592
|
return {
|
|
259848
260593
|
...filteredBody,
|
|
@@ -259854,7 +260599,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259854
260599
|
}
|
|
259855
260600
|
const userRouter = createUserRouter(db2, logger2);
|
|
259856
260601
|
router.use("/User", userRouter);
|
|
259857
|
-
router.get("/:entityName/:id", withCollection(async (req, res, collection,
|
|
260602
|
+
router.get("/:entityName/:id", withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259858
260603
|
const { entityName, id: id2 } = req.params;
|
|
259859
260604
|
try {
|
|
259860
260605
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -259862,27 +260607,27 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259862
260607
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259863
260608
|
return;
|
|
259864
260609
|
}
|
|
259865
|
-
if (!checkRLS(
|
|
260610
|
+
if (!checkRLS(schema13.rls?.read, doc2, currentUser)) {
|
|
259866
260611
|
res.status(404).json({
|
|
259867
260612
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259868
260613
|
});
|
|
259869
260614
|
return;
|
|
259870
260615
|
}
|
|
259871
|
-
const result = applyFLS(stripInternalFields(doc2),
|
|
260616
|
+
const result = applyFLS(stripInternalFields(doc2), schema13, currentUser, "read");
|
|
259872
260617
|
res.json(result);
|
|
259873
260618
|
} catch (error48) {
|
|
259874
260619
|
logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
|
|
259875
260620
|
res.status(500).json({ error: "Internal server error" });
|
|
259876
260621
|
}
|
|
259877
260622
|
}));
|
|
259878
|
-
router.get("/:entityName", withCollection(async (req, res, collection,
|
|
260623
|
+
router.get("/:entityName", withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259879
260624
|
const { entityName } = req.params;
|
|
259880
260625
|
try {
|
|
259881
260626
|
let results = stripInternalFields(await queryEntity(collection, req.query));
|
|
259882
|
-
if (
|
|
259883
|
-
results = results.filter((doc2) => checkRLS(
|
|
260627
|
+
if (schema13.rls?.read !== undefined && schema13.rls.read !== true) {
|
|
260628
|
+
results = results.filter((doc2) => checkRLS(schema13.rls.read, doc2, currentUser));
|
|
259884
260629
|
}
|
|
259885
|
-
results = results.map((doc2) => applyFLS(doc2,
|
|
260630
|
+
results = results.map((doc2) => applyFLS(doc2, schema13, currentUser, "read"));
|
|
259886
260631
|
res.json(results);
|
|
259887
260632
|
} catch (error48) {
|
|
259888
260633
|
if (error48 instanceof InvalidInputError) {
|
|
@@ -259893,16 +260638,16 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259893
260638
|
}
|
|
259894
260639
|
}
|
|
259895
260640
|
}));
|
|
259896
|
-
router.post("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
260641
|
+
router.post("/:entityName", parseBody, withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259897
260642
|
const { appId, entityName } = req.params;
|
|
259898
260643
|
try {
|
|
259899
260644
|
const now = new Date().toISOString();
|
|
259900
|
-
const record2 = prepareCreateRecord(entityName, req.body,
|
|
260645
|
+
const record2 = prepareCreateRecord(entityName, req.body, schema13, currentUser, now);
|
|
259901
260646
|
if (!record2) {
|
|
259902
260647
|
res.status(403).json({ error: "Permission denied" });
|
|
259903
260648
|
return;
|
|
259904
260649
|
}
|
|
259905
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)),
|
|
260650
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(record2)), schema13, currentUser, "read");
|
|
259906
260651
|
emit(appId, entityName, "create", inserted);
|
|
259907
260652
|
res.status(201).json(inserted);
|
|
259908
260653
|
} catch (error48) {
|
|
@@ -259914,7 +260659,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259914
260659
|
res.status(500).json({ error: "Internal server error" });
|
|
259915
260660
|
}
|
|
259916
260661
|
}));
|
|
259917
|
-
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection,
|
|
260662
|
+
router.post("/:entityName/bulk", parseBody, withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259918
260663
|
const { appId, entityName } = req.params;
|
|
259919
260664
|
if (!Array.isArray(req.body)) {
|
|
259920
260665
|
res.status(400).json({ error: "Request body must be an array" });
|
|
@@ -259924,14 +260669,14 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259924
260669
|
const now = new Date().toISOString();
|
|
259925
260670
|
const records = [];
|
|
259926
260671
|
for (const body of req.body) {
|
|
259927
|
-
const record2 = prepareCreateRecord(entityName, body,
|
|
260672
|
+
const record2 = prepareCreateRecord(entityName, body, schema13, currentUser, now);
|
|
259928
260673
|
if (!record2) {
|
|
259929
260674
|
res.status(403).json({ error: "Permission denied" });
|
|
259930
260675
|
return;
|
|
259931
260676
|
}
|
|
259932
260677
|
records.push(record2);
|
|
259933
260678
|
}
|
|
259934
|
-
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)),
|
|
260679
|
+
const inserted = applyFLS(stripInternalFields(await collection.insertAsync(records)), schema13, currentUser, "read");
|
|
259935
260680
|
emit(appId, entityName, "create", inserted);
|
|
259936
260681
|
res.status(201).json(inserted);
|
|
259937
260682
|
} catch (error48) {
|
|
@@ -259943,24 +260688,24 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259943
260688
|
res.status(500).json({ error: "Internal server error" });
|
|
259944
260689
|
}
|
|
259945
260690
|
}));
|
|
259946
|
-
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection,
|
|
260691
|
+
router.put("/:entityName/:id", parseBody, withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259947
260692
|
const { appId, entityName, id: id2 } = req.params;
|
|
259948
260693
|
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
259949
260694
|
try {
|
|
259950
|
-
if (
|
|
260695
|
+
if (schema13.rls?.update !== undefined) {
|
|
259951
260696
|
const existing = await collection.findOneAsync({ id: id2 });
|
|
259952
260697
|
if (!existing) {
|
|
259953
260698
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259954
260699
|
return;
|
|
259955
260700
|
}
|
|
259956
|
-
if (!checkRLS(
|
|
260701
|
+
if (!checkRLS(schema13.rls.update, existing, currentUser)) {
|
|
259957
260702
|
res.status(404).json({
|
|
259958
260703
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259959
260704
|
});
|
|
259960
260705
|
return;
|
|
259961
260706
|
}
|
|
259962
260707
|
}
|
|
259963
|
-
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true),
|
|
260708
|
+
const filteredBody = applyFLS(db2.prepareRecord(entityName, body, true), schema13, currentUser, "write");
|
|
259964
260709
|
db2.validate(entityName, filteredBody, true);
|
|
259965
260710
|
const updateData = {
|
|
259966
260711
|
...filteredBody,
|
|
@@ -259971,7 +260716,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259971
260716
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259972
260717
|
return;
|
|
259973
260718
|
}
|
|
259974
|
-
const updated = applyFLS(stripInternalFields(result.affectedDocuments),
|
|
260719
|
+
const updated = applyFLS(stripInternalFields(result.affectedDocuments), schema13, currentUser, "read");
|
|
259975
260720
|
emit(appId, entityName, "update", updated);
|
|
259976
260721
|
res.json(updated);
|
|
259977
260722
|
} catch (error48) {
|
|
@@ -259983,7 +260728,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259983
260728
|
res.status(500).json({ error: "Internal server error" });
|
|
259984
260729
|
}
|
|
259985
260730
|
}));
|
|
259986
|
-
router.delete("/:entityName/:id", withCollection(async (req, res, collection,
|
|
260731
|
+
router.delete("/:entityName/:id", withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
259987
260732
|
const { appId, entityName, id: id2 } = req.params;
|
|
259988
260733
|
try {
|
|
259989
260734
|
const doc2 = await collection.findOneAsync({ id: id2 });
|
|
@@ -259991,7 +260736,7 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
259991
260736
|
res.status(404).json({ error: `Record with id "${id2}" not found` });
|
|
259992
260737
|
return;
|
|
259993
260738
|
}
|
|
259994
|
-
if (!checkRLS(
|
|
260739
|
+
if (!checkRLS(schema13.rls?.delete, doc2, currentUser)) {
|
|
259995
260740
|
res.status(404).json({
|
|
259996
260741
|
message: `Entity ${entityName} with ID ${id2} not found`
|
|
259997
260742
|
});
|
|
@@ -260005,11 +260750,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
260005
260750
|
res.status(500).json({ error: "Internal server error" });
|
|
260006
260751
|
}
|
|
260007
260752
|
}));
|
|
260008
|
-
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection,
|
|
260753
|
+
router.delete("/:entityName", parseBody, withCollection(async (req, res, collection, schema13, currentUser) => {
|
|
260009
260754
|
const { entityName } = req.params;
|
|
260010
260755
|
try {
|
|
260011
260756
|
const query = req.body || {};
|
|
260012
|
-
const rlsDelete =
|
|
260757
|
+
const rlsDelete = schema13?.rls?.delete;
|
|
260013
260758
|
if (rlsDelete !== undefined && rlsDelete !== true) {
|
|
260014
260759
|
if (rlsDelete === false && currentUser?.is_service !== true) {
|
|
260015
260760
|
res.status(403).json({ error: "Permission denied" });
|
|
@@ -260036,11 +260781,11 @@ async function createEntityRoutes(db2, logger2, broadcast) {
|
|
|
260036
260781
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
260037
260782
|
var import_express5 = __toESM(require_express(), 1);
|
|
260038
260783
|
var import_multer = __toESM(require_multer(), 1);
|
|
260039
|
-
import { createHash, randomUUID as randomUUID4 } from "node:crypto";
|
|
260784
|
+
import { createHash as createHash2, randomUUID as randomUUID4 } from "node:crypto";
|
|
260040
260785
|
import fs28 from "node:fs";
|
|
260041
260786
|
import path18 from "node:path";
|
|
260042
260787
|
function createFileToken(fileUri) {
|
|
260043
|
-
return
|
|
260788
|
+
return createHash2("sha256").update(fileUri).digest("hex");
|
|
260044
260789
|
}
|
|
260045
260790
|
function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger2) {
|
|
260046
260791
|
const router = import_express5.Router({ mergeParams: true });
|
|
@@ -260063,12 +260808,12 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger2) {
|
|
|
260063
260808
|
cb2(null, `${randomUUID4()}${ext}`);
|
|
260064
260809
|
}
|
|
260065
260810
|
});
|
|
260066
|
-
const
|
|
260811
|
+
const upload2 = import_multer.default({ storage, limits: { fileSize: MAX_FILE_SIZE } });
|
|
260067
260812
|
const privateUpload = import_multer.default({
|
|
260068
260813
|
storage: privateStorage,
|
|
260069
260814
|
limits: { fileSize: MAX_FILE_SIZE }
|
|
260070
260815
|
});
|
|
260071
|
-
router.post("/Core/UploadFile",
|
|
260816
|
+
router.post("/Core/UploadFile", upload2.single("file"), (req, res) => {
|
|
260072
260817
|
if (!req.file) {
|
|
260073
260818
|
res.status(400).json({ error: "No file uploaded" });
|
|
260074
260819
|
return;
|
|
@@ -260125,16 +260870,16 @@ function createCustomIntegrationRoutes(remoteProxy, logger2) {
|
|
|
260125
260870
|
|
|
260126
260871
|
// src/cli/dev/dev-server/watcher.ts
|
|
260127
260872
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
260128
|
-
import { relative as
|
|
260873
|
+
import { relative as relative7 } from "node:path";
|
|
260129
260874
|
|
|
260130
260875
|
// ../../node_modules/chokidar/index.js
|
|
260131
260876
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
260132
260877
|
import { stat as statcb, Stats } from "node:fs";
|
|
260133
|
-
import { readdir as
|
|
260878
|
+
import { readdir as readdir4, stat as stat6 } from "node:fs/promises";
|
|
260134
260879
|
import * as sp3 from "node:path";
|
|
260135
260880
|
|
|
260136
260881
|
// ../../node_modules/readdirp/index.js
|
|
260137
|
-
import { lstat as lstat2, readdir as
|
|
260882
|
+
import { lstat as lstat2, readdir as readdir3, realpath, stat as stat4 } from "node:fs/promises";
|
|
260138
260883
|
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
260139
260884
|
import { Readable as Readable6 } from "node:stream";
|
|
260140
260885
|
var EntryTypes = {
|
|
@@ -260216,7 +260961,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
260216
260961
|
const { root: root2, type } = opts;
|
|
260217
260962
|
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
260218
260963
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
260219
|
-
const statMethod = opts.lstat ? lstat2 :
|
|
260964
|
+
const statMethod = opts.lstat ? lstat2 : stat4;
|
|
260220
260965
|
if (wantBigintFsStats) {
|
|
260221
260966
|
this._stat = (path19) => statMethod(path19, { bigint: true });
|
|
260222
260967
|
} else {
|
|
@@ -260287,7 +261032,7 @@ class ReaddirpStream extends Readable6 {
|
|
|
260287
261032
|
async _exploreDir(path19, depth) {
|
|
260288
261033
|
let files;
|
|
260289
261034
|
try {
|
|
260290
|
-
files = await
|
|
261035
|
+
files = await readdir3(path19, this._rdOptions);
|
|
260291
261036
|
} catch (error48) {
|
|
260292
261037
|
this._onError(error48);
|
|
260293
261038
|
}
|
|
@@ -260369,7 +261114,7 @@ function readdirp(root2, options8 = {}) {
|
|
|
260369
261114
|
|
|
260370
261115
|
// ../../node_modules/chokidar/handler.js
|
|
260371
261116
|
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
260372
|
-
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as
|
|
261117
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat5 } from "node:fs/promises";
|
|
260373
261118
|
import { type as osType } from "node:os";
|
|
260374
261119
|
import * as sp2 from "node:path";
|
|
260375
261120
|
var STR_DATA = "data";
|
|
@@ -260395,7 +261140,7 @@ var EVENTS = {
|
|
|
260395
261140
|
};
|
|
260396
261141
|
var EV = EVENTS;
|
|
260397
261142
|
var THROTTLE_MODE_WATCH = "watch";
|
|
260398
|
-
var statMethods = { lstat: lstat3, stat:
|
|
261143
|
+
var statMethods = { lstat: lstat3, stat: stat5 };
|
|
260399
261144
|
var KEY_LISTENERS = "listeners";
|
|
260400
261145
|
var KEY_ERR = "errHandlers";
|
|
260401
261146
|
var KEY_RAW = "rawEmitters";
|
|
@@ -260855,9 +261600,9 @@ class NodeFsHandler {
|
|
|
260855
261600
|
if (this.fsw.closed) {
|
|
260856
261601
|
return;
|
|
260857
261602
|
}
|
|
260858
|
-
const
|
|
261603
|
+
const dirname23 = sp2.dirname(file2);
|
|
260859
261604
|
const basename7 = sp2.basename(file2);
|
|
260860
|
-
const parent = this.fsw._getWatchedDir(
|
|
261605
|
+
const parent = this.fsw._getWatchedDir(dirname23);
|
|
260861
261606
|
let prevStats = stats;
|
|
260862
261607
|
if (parent.has(basename7))
|
|
260863
261608
|
return;
|
|
@@ -260866,7 +261611,7 @@ class NodeFsHandler {
|
|
|
260866
261611
|
return;
|
|
260867
261612
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
260868
261613
|
try {
|
|
260869
|
-
const newStats2 = await
|
|
261614
|
+
const newStats2 = await stat5(file2);
|
|
260870
261615
|
if (this.fsw.closed)
|
|
260871
261616
|
return;
|
|
260872
261617
|
const at13 = newStats2.atimeMs;
|
|
@@ -260884,7 +261629,7 @@ class NodeFsHandler {
|
|
|
260884
261629
|
prevStats = newStats2;
|
|
260885
261630
|
}
|
|
260886
261631
|
} catch (error48) {
|
|
260887
|
-
this.fsw._remove(
|
|
261632
|
+
this.fsw._remove(dirname23, basename7);
|
|
260888
261633
|
}
|
|
260889
261634
|
} else if (parent.has(basename7)) {
|
|
260890
261635
|
const at13 = newStats.atimeMs;
|
|
@@ -260973,7 +261718,7 @@ class NodeFsHandler {
|
|
|
260973
261718
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
260974
261719
|
}
|
|
260975
261720
|
}).on(EV.ERROR, this._boundHandleError);
|
|
260976
|
-
return new Promise((
|
|
261721
|
+
return new Promise((resolve17, reject) => {
|
|
260977
261722
|
if (!stream)
|
|
260978
261723
|
return reject();
|
|
260979
261724
|
stream.once(STR_END, () => {
|
|
@@ -260982,7 +261727,7 @@ class NodeFsHandler {
|
|
|
260982
261727
|
return;
|
|
260983
261728
|
}
|
|
260984
261729
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
260985
|
-
|
|
261730
|
+
resolve17(undefined);
|
|
260986
261731
|
previous.getChildren().filter((item) => {
|
|
260987
261732
|
return item !== directory && !current.has(item);
|
|
260988
261733
|
}).forEach((item) => {
|
|
@@ -261107,11 +261852,11 @@ function createPattern(matcher) {
|
|
|
261107
261852
|
if (matcher.path === string4)
|
|
261108
261853
|
return true;
|
|
261109
261854
|
if (matcher.recursive) {
|
|
261110
|
-
const
|
|
261111
|
-
if (!
|
|
261855
|
+
const relative7 = sp3.relative(matcher.path, string4);
|
|
261856
|
+
if (!relative7) {
|
|
261112
261857
|
return false;
|
|
261113
261858
|
}
|
|
261114
|
-
return !
|
|
261859
|
+
return !relative7.startsWith("..") && !sp3.isAbsolute(relative7);
|
|
261115
261860
|
}
|
|
261116
261861
|
return false;
|
|
261117
261862
|
};
|
|
@@ -261214,7 +261959,7 @@ class DirEntry {
|
|
|
261214
261959
|
return;
|
|
261215
261960
|
const dir = this.path;
|
|
261216
261961
|
try {
|
|
261217
|
-
await
|
|
261962
|
+
await readdir4(dir);
|
|
261218
261963
|
} catch (err) {
|
|
261219
261964
|
if (this._removeWatcher) {
|
|
261220
261965
|
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
@@ -261538,7 +262283,7 @@ class FSWatcher extends EventEmitter3 {
|
|
|
261538
262283
|
const fullPath = opts.cwd ? sp3.join(opts.cwd, path19) : path19;
|
|
261539
262284
|
let stats2;
|
|
261540
262285
|
try {
|
|
261541
|
-
stats2 = await
|
|
262286
|
+
stats2 = await stat6(fullPath);
|
|
261542
262287
|
} catch (err) {}
|
|
261543
262288
|
if (!stats2 || this.closed)
|
|
261544
262289
|
return;
|
|
@@ -261642,8 +262387,8 @@ class FSWatcher extends EventEmitter3 {
|
|
|
261642
262387
|
}
|
|
261643
262388
|
return this._userIgnored(path19, stats);
|
|
261644
262389
|
}
|
|
261645
|
-
_isntIgnored(path19,
|
|
261646
|
-
return !this._isIgnored(path19,
|
|
262390
|
+
_isntIgnored(path19, stat7) {
|
|
262391
|
+
return !this._isIgnored(path19, stat7);
|
|
261647
262392
|
}
|
|
261648
262393
|
_getWatchHelpers(path19) {
|
|
261649
262394
|
return new WatchHelper(path19, this.options.followSymlinks, this);
|
|
@@ -261810,7 +262555,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
261810
262555
|
ignoreInitial: true
|
|
261811
262556
|
});
|
|
261812
262557
|
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
261813
|
-
this.emit("change", name2,
|
|
262558
|
+
this.emit("change", name2, relative7(targetPath, path19));
|
|
261814
262559
|
}, WATCH_DEBOUNCE_MS));
|
|
261815
262560
|
watcher.on("error", (err) => {
|
|
261816
262561
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -261899,7 +262644,7 @@ async function createDevServer(options8) {
|
|
|
261899
262644
|
}
|
|
261900
262645
|
remoteProxy(req, res, next);
|
|
261901
262646
|
});
|
|
261902
|
-
const server = await new Promise((
|
|
262647
|
+
const server = await new Promise((resolve18, reject) => {
|
|
261903
262648
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
261904
262649
|
if (err) {
|
|
261905
262650
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -261908,7 +262653,7 @@ async function createDevServer(options8) {
|
|
|
261908
262653
|
reject(err);
|
|
261909
262654
|
}
|
|
261910
262655
|
} else {
|
|
261911
|
-
|
|
262656
|
+
resolve18(s5);
|
|
261912
262657
|
}
|
|
261913
262658
|
});
|
|
261914
262659
|
});
|
|
@@ -261917,8 +262662,8 @@ async function createDevServer(options8) {
|
|
|
261917
262662
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
261918
262663
|
};
|
|
261919
262664
|
const base44ConfigWatcher = new WatchBase44({
|
|
261920
|
-
functions:
|
|
261921
|
-
entities:
|
|
262665
|
+
functions: join35(dirname24(project2.configPath), project2.functionsDir),
|
|
262666
|
+
entities: join35(dirname24(project2.configPath), project2.entitiesDir)
|
|
261922
262667
|
}, devLogger);
|
|
261923
262668
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
261924
262669
|
try {
|
|
@@ -261958,13 +262703,13 @@ async function createDevServer(options8) {
|
|
|
261958
262703
|
if (!server.listening) {
|
|
261959
262704
|
return;
|
|
261960
262705
|
}
|
|
261961
|
-
await new Promise((
|
|
262706
|
+
await new Promise((resolve18, reject) => {
|
|
261962
262707
|
server.close((error48) => {
|
|
261963
262708
|
if (error48) {
|
|
261964
262709
|
reject(error48);
|
|
261965
262710
|
return;
|
|
261966
262711
|
}
|
|
261967
|
-
|
|
262712
|
+
resolve18();
|
|
261968
262713
|
});
|
|
261969
262714
|
});
|
|
261970
262715
|
};
|
|
@@ -262035,15 +262780,15 @@ class ServeRunner {
|
|
|
262035
262780
|
return;
|
|
262036
262781
|
}
|
|
262037
262782
|
this.stopping = true;
|
|
262038
|
-
const exited = new Promise((
|
|
262783
|
+
const exited = new Promise((resolve18) => child.once("exit", () => resolve18()));
|
|
262039
262784
|
if (process23.platform === "win32" && child.pid) {
|
|
262040
262785
|
const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
262041
262786
|
stdio: "ignore",
|
|
262042
262787
|
windowsHide: true
|
|
262043
262788
|
});
|
|
262044
|
-
await new Promise((
|
|
262045
|
-
taskkill.once("exit", () =>
|
|
262046
|
-
taskkill.once("error", () =>
|
|
262789
|
+
await new Promise((resolve18) => {
|
|
262790
|
+
taskkill.once("exit", () => resolve18());
|
|
262791
|
+
taskkill.once("error", () => resolve18());
|
|
262047
262792
|
});
|
|
262048
262793
|
} else if (child.pid) {
|
|
262049
262794
|
try {
|
|
@@ -262213,13 +262958,13 @@ async function runScript(options8) {
|
|
|
262213
262958
|
}
|
|
262214
262959
|
// src/cli/commands/exec.ts
|
|
262215
262960
|
function readStdin2() {
|
|
262216
|
-
return new Promise((
|
|
262961
|
+
return new Promise((resolve18, reject) => {
|
|
262217
262962
|
let data = "";
|
|
262218
262963
|
process.stdin.setEncoding("utf-8");
|
|
262219
262964
|
process.stdin.on("data", (chunk) => {
|
|
262220
262965
|
data += chunk;
|
|
262221
262966
|
});
|
|
262222
|
-
process.stdin.on("end", () =>
|
|
262967
|
+
process.stdin.on("end", () => resolve18(data));
|
|
262223
262968
|
process.stdin.on("error", reject);
|
|
262224
262969
|
});
|
|
262225
262970
|
}
|
|
@@ -262290,7 +263035,7 @@ Examples:
|
|
|
262290
263035
|
}
|
|
262291
263036
|
|
|
262292
263037
|
// src/cli/commands/project/eject.ts
|
|
262293
|
-
import { resolve as
|
|
263038
|
+
import { resolve as resolve18 } from "node:path";
|
|
262294
263039
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
262295
263040
|
async function eject(ctx, options8, command2) {
|
|
262296
263041
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -262354,7 +263099,7 @@ async function eject(ctx, options8, command2) {
|
|
|
262354
263099
|
Ne("Operation cancelled.");
|
|
262355
263100
|
throw new CLIExitError(0);
|
|
262356
263101
|
}
|
|
262357
|
-
const resolvedPath =
|
|
263102
|
+
const resolvedPath = resolve18(selectedPath);
|
|
262358
263103
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
262359
263104
|
await createProjectFilesForExistingProject({
|
|
262360
263105
|
projectId,
|
|
@@ -262442,7 +263187,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
262442
263187
|
import { release, type } from "node:os";
|
|
262443
263188
|
|
|
262444
263189
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
262445
|
-
import { dirname as
|
|
263190
|
+
import { dirname as dirname25, posix, sep as sep2 } from "path";
|
|
262446
263191
|
function createModulerModifier() {
|
|
262447
263192
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
262448
263193
|
return async (frames) => {
|
|
@@ -262451,7 +263196,7 @@ function createModulerModifier() {
|
|
|
262451
263196
|
return frames;
|
|
262452
263197
|
};
|
|
262453
263198
|
}
|
|
262454
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
263199
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname25(process.argv[1]) : process.cwd(), isWindows5 = sep2 === "\\") {
|
|
262455
263200
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
262456
263201
|
return (filename) => {
|
|
262457
263202
|
if (!filename)
|
|
@@ -264729,14 +265474,14 @@ async function addSourceContext(frames) {
|
|
|
264729
265474
|
return frames;
|
|
264730
265475
|
}
|
|
264731
265476
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
264732
|
-
return new Promise((
|
|
265477
|
+
return new Promise((resolve19) => {
|
|
264733
265478
|
const stream = createReadStream2(path19);
|
|
264734
265479
|
const lineReaded = createInterface2({
|
|
264735
265480
|
input: stream
|
|
264736
265481
|
});
|
|
264737
265482
|
function destroyStreamAndResolve() {
|
|
264738
265483
|
stream.destroy();
|
|
264739
|
-
|
|
265484
|
+
resolve19();
|
|
264740
265485
|
}
|
|
264741
265486
|
let lineNumber = 0;
|
|
264742
265487
|
let currentRangeIndex = 0;
|
|
@@ -265848,15 +266593,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
265848
266593
|
return true;
|
|
265849
266594
|
if (this.featureFlagsPoller === undefined)
|
|
265850
266595
|
return false;
|
|
265851
|
-
return new Promise((
|
|
266596
|
+
return new Promise((resolve19) => {
|
|
265852
266597
|
const timeout3 = setTimeout(() => {
|
|
265853
266598
|
cleanup();
|
|
265854
|
-
|
|
266599
|
+
resolve19(false);
|
|
265855
266600
|
}, timeoutMs);
|
|
265856
266601
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
265857
266602
|
clearTimeout(timeout3);
|
|
265858
266603
|
cleanup();
|
|
265859
|
-
|
|
266604
|
+
resolve19(count2 > 0);
|
|
265860
266605
|
});
|
|
265861
266606
|
});
|
|
265862
266607
|
}
|
|
@@ -266640,9 +267385,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
266640
267385
|
});
|
|
266641
267386
|
}
|
|
266642
267387
|
// src/cli/index.ts
|
|
266643
|
-
var __dirname4 =
|
|
267388
|
+
var __dirname4 = dirname26(fileURLToPath6(import.meta.url));
|
|
266644
267389
|
async function runCLI(options8) {
|
|
266645
|
-
ensureNpmAssets(
|
|
267390
|
+
ensureNpmAssets(join36(__dirname4, "../assets"));
|
|
266646
267391
|
const errorReporter = new ErrorReporter;
|
|
266647
267392
|
errorReporter.registerProcessErrorHandlers();
|
|
266648
267393
|
const jsonMode = process.argv.includes("--json");
|
|
@@ -266681,4 +267426,4 @@ export {
|
|
|
266681
267426
|
CLIExitError
|
|
266682
267427
|
};
|
|
266683
267428
|
|
|
266684
|
-
//# debugId=
|
|
267429
|
+
//# debugId=FFEEAB2F2B84F55664756E2164756E21
|