fern-api 0.16.11 → 0.16.12-rc0
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/bundle.cjs +329 -304
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -20993,8 +20993,8 @@ var require_graceful_fs = __commonJS({
|
|
|
20993
20993
|
}
|
|
20994
20994
|
}
|
|
20995
20995
|
var fs$writeFile = fs5.writeFile;
|
|
20996
|
-
fs5.writeFile =
|
|
20997
|
-
function
|
|
20996
|
+
fs5.writeFile = writeFile37;
|
|
20997
|
+
function writeFile37(path32, data2, options, cb) {
|
|
20998
20998
|
if (typeof options === "function")
|
|
20999
20999
|
cb = options, options = null;
|
|
21000
21000
|
return go$writeFile(path32, data2, options, cb);
|
|
@@ -22509,7 +22509,7 @@ var require_jsonfile = __commonJS({
|
|
|
22509
22509
|
const str2 = stringify5(obj, options);
|
|
22510
22510
|
await universalify.fromCallback(fs4.writeFile)(file, str2, options);
|
|
22511
22511
|
}
|
|
22512
|
-
var
|
|
22512
|
+
var writeFile37 = universalify.fromPromise(_writeFile);
|
|
22513
22513
|
function writeFileSync(file, obj, options = {}) {
|
|
22514
22514
|
const fs4 = options.fs || _fs;
|
|
22515
22515
|
const str2 = stringify5(obj, options);
|
|
@@ -22518,7 +22518,7 @@ var require_jsonfile = __commonJS({
|
|
|
22518
22518
|
var jsonfile = {
|
|
22519
22519
|
readFile: readFile37,
|
|
22520
22520
|
readFileSync: readFileSync4,
|
|
22521
|
-
writeFile:
|
|
22521
|
+
writeFile: writeFile37,
|
|
22522
22522
|
writeFileSync
|
|
22523
22523
|
};
|
|
22524
22524
|
module2.exports = jsonfile;
|
|
@@ -29588,12 +29588,12 @@ var require_common2 = __commonJS({
|
|
|
29588
29588
|
args.unshift("%O");
|
|
29589
29589
|
}
|
|
29590
29590
|
let index2 = 0;
|
|
29591
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match,
|
|
29591
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format5) => {
|
|
29592
29592
|
if (match === "%%") {
|
|
29593
29593
|
return "%";
|
|
29594
29594
|
}
|
|
29595
29595
|
index2++;
|
|
29596
|
-
const formatter = createDebug.formatters[
|
|
29596
|
+
const formatter = createDebug.formatters[format5];
|
|
29597
29597
|
if (typeof formatter === "function") {
|
|
29598
29598
|
const val = args[index2];
|
|
29599
29599
|
match = formatter.call(self2, val);
|
|
@@ -105751,7 +105751,7 @@ var require_utils5 = __commonJS({
|
|
|
105751
105751
|
return strWithoutPlus;
|
|
105752
105752
|
}
|
|
105753
105753
|
};
|
|
105754
|
-
var encode2 = function encode3(str2, defaultEncoder, charset, kind,
|
|
105754
|
+
var encode2 = function encode3(str2, defaultEncoder, charset, kind, format5) {
|
|
105755
105755
|
if (str2.length === 0) {
|
|
105756
105756
|
return str2;
|
|
105757
105757
|
}
|
|
@@ -105769,7 +105769,7 @@ var require_utils5 = __commonJS({
|
|
|
105769
105769
|
var out = "";
|
|
105770
105770
|
for (var i2 = 0; i2 < string3.length; ++i2) {
|
|
105771
105771
|
var c2 = string3.charCodeAt(i2);
|
|
105772
|
-
if (c2 === 45 || c2 === 46 || c2 === 95 || c2 === 126 || c2 >= 48 && c2 <= 57 || c2 >= 65 && c2 <= 90 || c2 >= 97 && c2 <= 122 ||
|
|
105772
|
+
if (c2 === 45 || c2 === 46 || c2 === 95 || c2 === 126 || c2 >= 48 && c2 <= 57 || c2 >= 65 && c2 <= 90 || c2 >= 97 && c2 <= 122 || format5 === formats.RFC1738 && (c2 === 40 || c2 === 41)) {
|
|
105773
105773
|
out += string3.charAt(i2);
|
|
105774
105774
|
continue;
|
|
105775
105775
|
}
|
|
@@ -105896,7 +105896,7 @@ var require_stringify2 = __commonJS({
|
|
|
105896
105896
|
return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean" || typeof v2 === "symbol" || typeof v2 === "bigint";
|
|
105897
105897
|
};
|
|
105898
105898
|
var sentinel = {};
|
|
105899
|
-
var stringify5 = function stringify6(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter6, sort, allowDots, serializeDate,
|
|
105899
|
+
var stringify5 = function stringify6(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter6, sort, allowDots, serializeDate, format5, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
105900
105900
|
var obj = object;
|
|
105901
105901
|
var tmpSc = sideChannel;
|
|
105902
105902
|
var step = 0;
|
|
@@ -105929,14 +105929,14 @@ var require_stringify2 = __commonJS({
|
|
|
105929
105929
|
}
|
|
105930
105930
|
if (obj === null) {
|
|
105931
105931
|
if (strictNullHandling) {
|
|
105932
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults4.encoder, charset, "key",
|
|
105932
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults4.encoder, charset, "key", format5) : prefix;
|
|
105933
105933
|
}
|
|
105934
105934
|
obj = "";
|
|
105935
105935
|
}
|
|
105936
105936
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
105937
105937
|
if (encoder) {
|
|
105938
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults4.encoder, charset, "key",
|
|
105939
|
-
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults4.encoder, charset, "value",
|
|
105938
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults4.encoder, charset, "key", format5);
|
|
105939
|
+
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults4.encoder, charset, "value", format5))];
|
|
105940
105940
|
}
|
|
105941
105941
|
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
105942
105942
|
}
|
|
@@ -105979,7 +105979,7 @@ var require_stringify2 = __commonJS({
|
|
|
105979
105979
|
sort,
|
|
105980
105980
|
allowDots,
|
|
105981
105981
|
serializeDate,
|
|
105982
|
-
|
|
105982
|
+
format5,
|
|
105983
105983
|
formatter,
|
|
105984
105984
|
encodeValuesOnly,
|
|
105985
105985
|
charset,
|
|
@@ -105999,14 +105999,14 @@ var require_stringify2 = __commonJS({
|
|
|
105999
105999
|
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
106000
106000
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
106001
106001
|
}
|
|
106002
|
-
var
|
|
106002
|
+
var format5 = formats["default"];
|
|
106003
106003
|
if (typeof opts.format !== "undefined") {
|
|
106004
106004
|
if (!has2.call(formats.formatters, opts.format)) {
|
|
106005
106005
|
throw new TypeError("Unknown format option provided.");
|
|
106006
106006
|
}
|
|
106007
|
-
|
|
106007
|
+
format5 = opts.format;
|
|
106008
106008
|
}
|
|
106009
|
-
var formatter = formats.formatters[
|
|
106009
|
+
var formatter = formats.formatters[format5];
|
|
106010
106010
|
var filter6 = defaults4.filter;
|
|
106011
106011
|
if (typeof opts.filter === "function" || isArray3(opts.filter)) {
|
|
106012
106012
|
filter6 = opts.filter;
|
|
@@ -106021,7 +106021,7 @@ var require_stringify2 = __commonJS({
|
|
|
106021
106021
|
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults4.encoder,
|
|
106022
106022
|
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults4.encodeValuesOnly,
|
|
106023
106023
|
filter: filter6,
|
|
106024
|
-
format:
|
|
106024
|
+
format: format5,
|
|
106025
106025
|
formatter,
|
|
106026
106026
|
serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults4.serializeDate,
|
|
106027
106027
|
skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults4.skipNulls,
|
|
@@ -112940,7 +112940,7 @@ ${ctx.indent}`;
|
|
|
112940
112940
|
};
|
|
112941
112941
|
function resolveScalar(str2, tags, scalarFallback) {
|
|
112942
112942
|
for (const {
|
|
112943
|
-
format:
|
|
112943
|
+
format: format5,
|
|
112944
112944
|
test,
|
|
112945
112945
|
resolve: resolve6
|
|
112946
112946
|
} of tags) {
|
|
@@ -112950,8 +112950,8 @@ ${ctx.indent}`;
|
|
|
112950
112950
|
let res = resolve6.apply(null, match);
|
|
112951
112951
|
if (!(res instanceof Scalar))
|
|
112952
112952
|
res = new Scalar(res);
|
|
112953
|
-
if (
|
|
112954
|
-
res.format =
|
|
112953
|
+
if (format5)
|
|
112954
|
+
res.format = format5;
|
|
112955
112955
|
return res;
|
|
112956
112956
|
}
|
|
112957
112957
|
}
|
|
@@ -113354,7 +113354,7 @@ ${indent3}`);
|
|
|
113354
113354
|
return res;
|
|
113355
113355
|
}
|
|
113356
113356
|
function stringifyNumber({
|
|
113357
|
-
format:
|
|
113357
|
+
format: format5,
|
|
113358
113358
|
minFractionDigits,
|
|
113359
113359
|
tag,
|
|
113360
113360
|
value
|
|
@@ -113364,7 +113364,7 @@ ${indent3}`);
|
|
|
113364
113364
|
if (!isFinite(value))
|
|
113365
113365
|
return isNaN(value) ? ".nan" : value < 0 ? "-.inf" : ".inf";
|
|
113366
113366
|
let n2 = JSON.stringify(value);
|
|
113367
|
-
if (!
|
|
113367
|
+
if (!format5 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n2)) {
|
|
113368
113368
|
let i2 = n2.indexOf(".");
|
|
113369
113369
|
if (i2 < 0) {
|
|
113370
113370
|
i2 = n2.length;
|
|
@@ -301863,7 +301863,7 @@ ${frame}`;
|
|
|
301863
301863
|
let padded = zeros(startString) || zeros(endString) || zeros(stepString);
|
|
301864
301864
|
let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
|
|
301865
301865
|
let toNumber2 = padded === false && stringify5(start3, end, options) === false;
|
|
301866
|
-
let
|
|
301866
|
+
let format5 = options.transform || transform2(toNumber2);
|
|
301867
301867
|
if (options.toRegex && step === 1) {
|
|
301868
301868
|
return toRange(toMaxLen(start3, maxLen), toMaxLen(end, maxLen), true, options);
|
|
301869
301869
|
}
|
|
@@ -301878,7 +301878,7 @@ ${frame}`;
|
|
|
301878
301878
|
if (options.toRegex === true && step > 1) {
|
|
301879
301879
|
push2(a2);
|
|
301880
301880
|
} else {
|
|
301881
|
-
range2.push(pad2(
|
|
301881
|
+
range2.push(pad2(format5(a2, index2), maxLen, toNumber2));
|
|
301882
301882
|
}
|
|
301883
301883
|
a2 = descending ? a2 - step : a2 + step;
|
|
301884
301884
|
index2++;
|
|
@@ -301894,7 +301894,7 @@ ${frame}`;
|
|
|
301894
301894
|
if (!isNumber2(start3) && start3.length > 1 || !isNumber2(end) && end.length > 1) {
|
|
301895
301895
|
return invalidRange(start3, end, options);
|
|
301896
301896
|
}
|
|
301897
|
-
let
|
|
301897
|
+
let format5 = options.transform || ((val) => String.fromCharCode(val));
|
|
301898
301898
|
let a2 = `${start3}`.charCodeAt(0);
|
|
301899
301899
|
let b2 = `${end}`.charCodeAt(0);
|
|
301900
301900
|
let descending = a2 > b2;
|
|
@@ -301906,7 +301906,7 @@ ${frame}`;
|
|
|
301906
301906
|
let range2 = [];
|
|
301907
301907
|
let index2 = 0;
|
|
301908
301908
|
while (descending ? a2 >= b2 : a2 <= b2) {
|
|
301909
|
-
range2.push(
|
|
301909
|
+
range2.push(format5(a2, index2));
|
|
301910
301910
|
a2 = descending ? a2 - step : a2 + step;
|
|
301911
301911
|
index2++;
|
|
301912
301912
|
}
|
|
@@ -304060,11 +304060,11 @@ ${frame}`;
|
|
|
304060
304060
|
};
|
|
304061
304061
|
}
|
|
304062
304062
|
const opts = options || {};
|
|
304063
|
-
const
|
|
304063
|
+
const format5 = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
304064
304064
|
let match = input === glob16;
|
|
304065
|
-
let output = match &&
|
|
304065
|
+
let output = match && format5 ? format5(input) : input;
|
|
304066
304066
|
if (match === false) {
|
|
304067
|
-
output =
|
|
304067
|
+
output = format5 ? format5(input) : input;
|
|
304068
304068
|
match = output === glob16;
|
|
304069
304069
|
}
|
|
304070
304070
|
if (match === false || opts.capture === true) {
|
|
@@ -314963,7 +314963,7 @@ ${fromBody}`;
|
|
|
314963
314963
|
var {
|
|
314964
314964
|
escapeTemplateCharacters
|
|
314965
314965
|
} = require_template_literal();
|
|
314966
|
-
function
|
|
314966
|
+
function format5(path32, print, textToDoc) {
|
|
314967
314967
|
const node2 = path32.getValue();
|
|
314968
314968
|
let text6 = node2.quasis[0].value.raw.replace(/((?:\\\\)*)\\`/g, (_4, backslashes) => "\\".repeat(backslashes.length / 2) + "`");
|
|
314969
314969
|
const indentation = getIndentation(text6);
|
|
@@ -314983,7 +314983,7 @@ ${fromBody}`;
|
|
|
314983
314983
|
const firstMatchedIndent = str2.match(/^([^\S\n]*)\S/m);
|
|
314984
314984
|
return firstMatchedIndent === null ? "" : firstMatchedIndent[1];
|
|
314985
314985
|
}
|
|
314986
|
-
module22.exports =
|
|
314986
|
+
module22.exports = format5;
|
|
314987
314987
|
}
|
|
314988
314988
|
});
|
|
314989
314989
|
var require_css = __commonJS22({
|
|
@@ -315007,7 +315007,7 @@ ${fromBody}`;
|
|
|
315007
315007
|
var {
|
|
315008
315008
|
printTemplateExpressions
|
|
315009
315009
|
} = require_template_literal();
|
|
315010
|
-
function
|
|
315010
|
+
function format5(path32, print, textToDoc) {
|
|
315011
315011
|
const node2 = path32.getValue();
|
|
315012
315012
|
const rawQuasis = node2.quasis.map((q2) => q2.value.raw);
|
|
315013
315013
|
let placeholderID = 0;
|
|
@@ -315050,7 +315050,7 @@ ${fromBody}`;
|
|
|
315050
315050
|
});
|
|
315051
315051
|
return expressionDocs.length === replaceCounter ? newDoc : null;
|
|
315052
315052
|
}
|
|
315053
|
-
module22.exports =
|
|
315053
|
+
module22.exports = format5;
|
|
315054
315054
|
}
|
|
315055
315055
|
});
|
|
315056
315056
|
var require_graphql = __commonJS22({
|
|
@@ -315067,7 +315067,7 @@ ${fromBody}`;
|
|
|
315067
315067
|
escapeTemplateCharacters,
|
|
315068
315068
|
printTemplateExpressions
|
|
315069
315069
|
} = require_template_literal();
|
|
315070
|
-
function
|
|
315070
|
+
function format5(path32, print, textToDoc) {
|
|
315071
315071
|
const node2 = path32.getValue();
|
|
315072
315072
|
const numQuasis = node2.quasis.length;
|
|
315073
315073
|
if (numQuasis === 1 && node2.quasis[0].value.raw.trim() === "") {
|
|
@@ -315134,7 +315134,7 @@ ${fromBody}`;
|
|
|
315134
315134
|
}
|
|
315135
315135
|
return parts.length === 0 ? null : join4(hardline, parts);
|
|
315136
315136
|
}
|
|
315137
|
-
module22.exports =
|
|
315137
|
+
module22.exports = format5;
|
|
315138
315138
|
}
|
|
315139
315139
|
});
|
|
315140
315140
|
var require_html = __commonJS22({
|
|
@@ -315156,7 +315156,7 @@ ${fromBody}`;
|
|
|
315156
315156
|
uncookTemplateElementValue
|
|
315157
315157
|
} = require_template_literal();
|
|
315158
315158
|
var htmlTemplateLiteralCounter = 0;
|
|
315159
|
-
function
|
|
315159
|
+
function format5(path32, print, textToDoc, options, {
|
|
315160
315160
|
parser: parser2
|
|
315161
315161
|
}) {
|
|
315162
315162
|
const node2 = path32.getValue();
|
|
@@ -315209,7 +315209,7 @@ ${fromBody}`;
|
|
|
315209
315209
|
}
|
|
315210
315210
|
return group(["`", leadingWhitespace, topLevelCount > 1 ? indent3(group(contentDoc)) : group(contentDoc), trailingWhitespace, "`"]);
|
|
315211
315211
|
}
|
|
315212
|
-
module22.exports =
|
|
315212
|
+
module22.exports = format5;
|
|
315213
315213
|
}
|
|
315214
315214
|
});
|
|
315215
315215
|
var require_embed = __commonJS22({
|
|
@@ -351449,10 +351449,10 @@ var require_core4 = __commonJS({
|
|
|
351449
351449
|
}
|
|
351450
351450
|
return this;
|
|
351451
351451
|
}
|
|
351452
|
-
addFormat(name2,
|
|
351453
|
-
if (typeof
|
|
351454
|
-
|
|
351455
|
-
this.formats[name2] =
|
|
351452
|
+
addFormat(name2, format5) {
|
|
351453
|
+
if (typeof format5 == "string")
|
|
351454
|
+
format5 = new RegExp(format5);
|
|
351455
|
+
this.formats[name2] = format5;
|
|
351456
351456
|
return this;
|
|
351457
351457
|
}
|
|
351458
351458
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
@@ -351570,9 +351570,9 @@ var require_core4 = __commonJS({
|
|
|
351570
351570
|
}
|
|
351571
351571
|
function addInitialFormats() {
|
|
351572
351572
|
for (const name2 in this.opts.formats) {
|
|
351573
|
-
const
|
|
351574
|
-
if (
|
|
351575
|
-
this.addFormat(name2,
|
|
351573
|
+
const format5 = this.opts.formats[name2];
|
|
351574
|
+
if (format5)
|
|
351575
|
+
this.addFormat(name2, format5);
|
|
351576
351576
|
}
|
|
351577
351577
|
}
|
|
351578
351578
|
function addInitialKeywords(defs) {
|
|
@@ -353262,18 +353262,18 @@ var require_format = __commonJS({
|
|
|
353262
353262
|
});
|
|
353263
353263
|
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
353264
353264
|
const fType = gen.let("fType");
|
|
353265
|
-
const
|
|
353266
|
-
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(
|
|
353265
|
+
const format5 = gen.let("format");
|
|
353266
|
+
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format5, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format5, fDef));
|
|
353267
353267
|
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
353268
353268
|
function unknownFmt() {
|
|
353269
353269
|
if (opts.strictSchema === false)
|
|
353270
353270
|
return codegen_1.nil;
|
|
353271
|
-
return (0, codegen_1._)`${schemaCode} && !${
|
|
353271
|
+
return (0, codegen_1._)`${schemaCode} && !${format5}`;
|
|
353272
353272
|
}
|
|
353273
353273
|
function invalidFmt() {
|
|
353274
|
-
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${
|
|
353275
|
-
const validData = (0, codegen_1._)`(typeof ${
|
|
353276
|
-
return (0, codegen_1._)`${
|
|
353274
|
+
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format5}(${data2}) : ${format5}(${data2}))` : (0, codegen_1._)`${format5}(${data2})`;
|
|
353275
|
+
const validData = (0, codegen_1._)`(typeof ${format5} == "function" ? ${callFormat} : ${format5}.test(${data2}))`;
|
|
353276
|
+
return (0, codegen_1._)`${format5} && ${format5} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
353277
353277
|
}
|
|
353278
353278
|
}
|
|
353279
353279
|
function validateFormat() {
|
|
@@ -353284,7 +353284,7 @@ var require_format = __commonJS({
|
|
|
353284
353284
|
}
|
|
353285
353285
|
if (formatDef === true)
|
|
353286
353286
|
return;
|
|
353287
|
-
const [fmtType,
|
|
353287
|
+
const [fmtType, format5, fmtRef] = getFormat(formatDef);
|
|
353288
353288
|
if (fmtType === ruleType)
|
|
353289
353289
|
cxt.pass(validCondition());
|
|
353290
353290
|
function unknownFormat() {
|
|
@@ -353311,7 +353311,7 @@ var require_format = __commonJS({
|
|
|
353311
353311
|
throw new Error("async format in sync schema");
|
|
353312
353312
|
return (0, codegen_1._)`await ${fmtRef}(${data2})`;
|
|
353313
353313
|
}
|
|
353314
|
-
return typeof
|
|
353314
|
+
return typeof format5 == "function" ? (0, codegen_1._)`${fmtRef}(${data2})` : (0, codegen_1._)`${fmtRef}.test(${data2})`;
|
|
353315
353315
|
}
|
|
353316
353316
|
}
|
|
353317
353317
|
}
|
|
@@ -353326,8 +353326,8 @@ var require_format2 = __commonJS({
|
|
|
353326
353326
|
"use strict";
|
|
353327
353327
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
353328
353328
|
var format_1 = require_format();
|
|
353329
|
-
var
|
|
353330
|
-
exports2.default =
|
|
353329
|
+
var format5 = [format_1.default];
|
|
353330
|
+
exports2.default = format5;
|
|
353331
353331
|
}
|
|
353332
353332
|
});
|
|
353333
353333
|
|
|
@@ -354523,7 +354523,7 @@ var require_json_schema_2020_12 = __commonJS({
|
|
|
354523
354523
|
var unevaluated = require_unevaluated2();
|
|
354524
354524
|
var content3 = require_content();
|
|
354525
354525
|
var core3 = require_core7();
|
|
354526
|
-
var
|
|
354526
|
+
var format5 = require_format_annotation();
|
|
354527
354527
|
var metadata = require_meta_data();
|
|
354528
354528
|
var validation = require_validation3();
|
|
354529
354529
|
var META_SUPPORT_DATA = ["/properties"];
|
|
@@ -354535,7 +354535,7 @@ var require_json_schema_2020_12 = __commonJS({
|
|
|
354535
354535
|
unevaluated,
|
|
354536
354536
|
content3,
|
|
354537
354537
|
core3,
|
|
354538
|
-
with$data(this,
|
|
354538
|
+
with$data(this, format5),
|
|
354539
354539
|
metadata,
|
|
354540
354540
|
with$data(this, validation)
|
|
354541
354541
|
].forEach((sch) => this.addMetaSchema(sch, void 0, false));
|
|
@@ -378155,10 +378155,10 @@ var require_core10 = __commonJS({
|
|
|
378155
378155
|
}
|
|
378156
378156
|
return this;
|
|
378157
378157
|
}
|
|
378158
|
-
addFormat(name2,
|
|
378159
|
-
if (typeof
|
|
378160
|
-
|
|
378161
|
-
this.formats[name2] =
|
|
378158
|
+
addFormat(name2, format5) {
|
|
378159
|
+
if (typeof format5 == "string")
|
|
378160
|
+
format5 = new RegExp(format5);
|
|
378161
|
+
this.formats[name2] = format5;
|
|
378162
378162
|
return this;
|
|
378163
378163
|
}
|
|
378164
378164
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
@@ -378276,9 +378276,9 @@ var require_core10 = __commonJS({
|
|
|
378276
378276
|
}
|
|
378277
378277
|
function addInitialFormats() {
|
|
378278
378278
|
for (const name2 in this.opts.formats) {
|
|
378279
|
-
const
|
|
378280
|
-
if (
|
|
378281
|
-
this.addFormat(name2,
|
|
378279
|
+
const format5 = this.opts.formats[name2];
|
|
378280
|
+
if (format5)
|
|
378281
|
+
this.addFormat(name2, format5);
|
|
378282
378282
|
}
|
|
378283
378283
|
}
|
|
378284
378284
|
function addInitialKeywords(defs) {
|
|
@@ -380285,18 +380285,18 @@ var require_format3 = __commonJS({
|
|
|
380285
380285
|
});
|
|
380286
380286
|
const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`);
|
|
380287
380287
|
const fType = gen.let("fType");
|
|
380288
|
-
const
|
|
380289
|
-
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(
|
|
380288
|
+
const format5 = gen.let("format");
|
|
380289
|
+
gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format5, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format5, fDef));
|
|
380290
380290
|
cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
|
|
380291
380291
|
function unknownFmt() {
|
|
380292
380292
|
if (opts.strictSchema === false)
|
|
380293
380293
|
return codegen_1.nil;
|
|
380294
|
-
return (0, codegen_1._)`${schemaCode} && !${
|
|
380294
|
+
return (0, codegen_1._)`${schemaCode} && !${format5}`;
|
|
380295
380295
|
}
|
|
380296
380296
|
function invalidFmt() {
|
|
380297
|
-
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${
|
|
380298
|
-
const validData = (0, codegen_1._)`(typeof ${
|
|
380299
|
-
return (0, codegen_1._)`${
|
|
380297
|
+
const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format5}(${data2}) : ${format5}(${data2}))` : (0, codegen_1._)`${format5}(${data2})`;
|
|
380298
|
+
const validData = (0, codegen_1._)`(typeof ${format5} == "function" ? ${callFormat} : ${format5}.test(${data2}))`;
|
|
380299
|
+
return (0, codegen_1._)`${format5} && ${format5} !== true && ${fType} === ${ruleType} && !${validData}`;
|
|
380300
380300
|
}
|
|
380301
380301
|
}
|
|
380302
380302
|
function validateFormat() {
|
|
@@ -380307,7 +380307,7 @@ var require_format3 = __commonJS({
|
|
|
380307
380307
|
}
|
|
380308
380308
|
if (formatDef === true)
|
|
380309
380309
|
return;
|
|
380310
|
-
const [fmtType,
|
|
380310
|
+
const [fmtType, format5, fmtRef] = getFormat(formatDef);
|
|
380311
380311
|
if (fmtType === ruleType)
|
|
380312
380312
|
cxt.pass(validCondition());
|
|
380313
380313
|
function unknownFormat() {
|
|
@@ -380334,7 +380334,7 @@ var require_format3 = __commonJS({
|
|
|
380334
380334
|
throw new Error("async format in sync schema");
|
|
380335
380335
|
return (0, codegen_1._)`await ${fmtRef}(${data2})`;
|
|
380336
380336
|
}
|
|
380337
|
-
return typeof
|
|
380337
|
+
return typeof format5 == "function" ? (0, codegen_1._)`${fmtRef}(${data2})` : (0, codegen_1._)`${fmtRef}.test(${data2})`;
|
|
380338
380338
|
}
|
|
380339
380339
|
}
|
|
380340
380340
|
}
|
|
@@ -380349,8 +380349,8 @@ var require_format4 = __commonJS({
|
|
|
380349
380349
|
"use strict";
|
|
380350
380350
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
380351
380351
|
var format_1 = require_format3();
|
|
380352
|
-
var
|
|
380353
|
-
exports2.default =
|
|
380352
|
+
var format5 = [format_1.default];
|
|
380353
|
+
exports2.default = format5;
|
|
380354
380354
|
}
|
|
380355
380355
|
});
|
|
380356
380356
|
|
|
@@ -380905,7 +380905,7 @@ var require_json_schema_2020_122 = __commonJS({
|
|
|
380905
380905
|
var unevaluated = require_unevaluated4();
|
|
380906
380906
|
var content3 = require_content2();
|
|
380907
380907
|
var core3 = require_core12();
|
|
380908
|
-
var
|
|
380908
|
+
var format5 = require_format_annotation2();
|
|
380909
380909
|
var metadata = require_meta_data2();
|
|
380910
380910
|
var validation = require_validation5();
|
|
380911
380911
|
var META_SUPPORT_DATA = ["/properties"];
|
|
@@ -380917,7 +380917,7 @@ var require_json_schema_2020_122 = __commonJS({
|
|
|
380917
380917
|
unevaluated,
|
|
380918
380918
|
content3,
|
|
380919
380919
|
core3,
|
|
380920
|
-
with$data(this,
|
|
380920
|
+
with$data(this, format5),
|
|
380921
380921
|
metadata,
|
|
380922
380922
|
with$data(this, validation)
|
|
380923
380923
|
].forEach((sch) => this.addMetaSchema(sch, void 0, false));
|
|
@@ -391663,15 +391663,15 @@ var require_format5 = __commonJS({
|
|
|
391663
391663
|
}
|
|
391664
391664
|
exports2.getTotals = getTotals;
|
|
391665
391665
|
function formatProblems(problems, opts) {
|
|
391666
|
-
const { maxProblems = 100, cwd: cwd2 = process.cwd(), format:
|
|
391666
|
+
const { maxProblems = 100, cwd: cwd2 = process.cwd(), format: format5 = "codeframe", color: color3 = logger_1.colorOptions.enabled, totals = getTotals(problems), version: version3 = coreVersion } = opts;
|
|
391667
391667
|
logger_1.colorOptions.enabled = color3;
|
|
391668
391668
|
const totalProblems = problems.length;
|
|
391669
391669
|
problems = problems.filter((m) => !m.ignored);
|
|
391670
391670
|
const ignoredProblems = totalProblems - problems.length;
|
|
391671
391671
|
problems = problems.sort((a2, b2) => severityToNumber(a2.severity) - severityToNumber(b2.severity)).slice(0, maxProblems);
|
|
391672
|
-
if (!totalProblems &&
|
|
391672
|
+
if (!totalProblems && format5 !== "json")
|
|
391673
391673
|
return;
|
|
391674
|
-
switch (
|
|
391674
|
+
switch (format5) {
|
|
391675
391675
|
case "json":
|
|
391676
391676
|
outputJSON();
|
|
391677
391677
|
break;
|
|
@@ -397275,14 +397275,14 @@ var require_bool4 = __commonJS({
|
|
|
397275
397275
|
var require_stringifyNumber = __commonJS({
|
|
397276
397276
|
"pnp:/home/circleci/project/.yarn/cache/yaml-npm-2.3.3-c5a47b9f8f-cdfd132e7e.zip/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
|
|
397277
397277
|
"use strict";
|
|
397278
|
-
function stringifyNumber({ format:
|
|
397278
|
+
function stringifyNumber({ format: format5, minFractionDigits, tag, value }) {
|
|
397279
397279
|
if (typeof value === "bigint")
|
|
397280
397280
|
return String(value);
|
|
397281
397281
|
const num = typeof value === "number" ? value : Number(value);
|
|
397282
397282
|
if (!isFinite(num))
|
|
397283
397283
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
397284
397284
|
let n2 = JSON.stringify(value);
|
|
397285
|
-
if (!
|
|
397285
|
+
if (!format5 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n2)) {
|
|
397286
397286
|
let i2 = n2.indexOf(".");
|
|
397287
397287
|
if (i2 < 0) {
|
|
397288
397288
|
i2 = n2.length;
|
|
@@ -714051,8 +714051,8 @@ var require_depd = __commonJS({
|
|
|
714051
714051
|
process.emit("deprecation", err);
|
|
714052
714052
|
return;
|
|
714053
714053
|
}
|
|
714054
|
-
var
|
|
714055
|
-
var output =
|
|
714054
|
+
var format5 = process.stderr.isTTY ? formatColor : formatPlain;
|
|
714055
|
+
var output = format5.call(this, msg, caller, stack.slice(i2));
|
|
714056
714056
|
process.stderr.write(output + "\n", "utf8");
|
|
714057
714057
|
}
|
|
714058
714058
|
function callSiteLocation(callSite) {
|
|
@@ -714227,7 +714227,7 @@ var require_bytes = __commonJS({
|
|
|
714227
714227
|
"pnp:/home/circleci/project/.yarn/cache/bytes-npm-3.1.2-28b8643004-e4bcd3948d.zip/node_modules/bytes/index.js"(exports2, module2) {
|
|
714228
714228
|
"use strict";
|
|
714229
714229
|
module2.exports = bytes;
|
|
714230
|
-
module2.exports.format =
|
|
714230
|
+
module2.exports.format = format5;
|
|
714231
714231
|
module2.exports.parse = parse6;
|
|
714232
714232
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
714233
714233
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
@@ -714245,11 +714245,11 @@ var require_bytes = __commonJS({
|
|
|
714245
714245
|
return parse6(value);
|
|
714246
714246
|
}
|
|
714247
714247
|
if (typeof value === "number") {
|
|
714248
|
-
return
|
|
714248
|
+
return format5(value, options);
|
|
714249
714249
|
}
|
|
714250
714250
|
return null;
|
|
714251
714251
|
}
|
|
714252
|
-
function
|
|
714252
|
+
function format5(value, options) {
|
|
714253
714253
|
if (!Number.isFinite(value)) {
|
|
714254
714254
|
return null;
|
|
714255
714255
|
}
|
|
@@ -714321,9 +714321,9 @@ var require_content_type = __commonJS({
|
|
|
714321
714321
|
var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g;
|
|
714322
714322
|
var QUOTE_REGEXP = /([\\"])/g;
|
|
714323
714323
|
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
714324
|
-
exports2.format =
|
|
714324
|
+
exports2.format = format5;
|
|
714325
714325
|
exports2.parse = parse6;
|
|
714326
|
-
function
|
|
714326
|
+
function format5(obj) {
|
|
714327
714327
|
if (!obj || typeof obj !== "object") {
|
|
714328
714328
|
throw new TypeError("argument obj is required");
|
|
714329
714329
|
}
|
|
@@ -714897,11 +714897,11 @@ var require_debug3 = __commonJS({
|
|
|
714897
714897
|
args.unshift("%O");
|
|
714898
714898
|
}
|
|
714899
714899
|
var index2 = 0;
|
|
714900
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match,
|
|
714900
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format5) {
|
|
714901
714901
|
if (match === "%%")
|
|
714902
714902
|
return match;
|
|
714903
714903
|
index2++;
|
|
714904
|
-
var formatter = exports2.formatters[
|
|
714904
|
+
var formatter = exports2.formatters[format5];
|
|
714905
714905
|
if ("function" === typeof formatter) {
|
|
714906
714906
|
var val = args[index2];
|
|
714907
714907
|
match = formatter.call(self2, val);
|
|
@@ -715803,9 +715803,9 @@ var require_media_typer = __commonJS({
|
|
|
715803
715803
|
var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/;
|
|
715804
715804
|
var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
|
715805
715805
|
var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
|
715806
|
-
exports2.format =
|
|
715806
|
+
exports2.format = format5;
|
|
715807
715807
|
exports2.parse = parse6;
|
|
715808
|
-
function
|
|
715808
|
+
function format5(obj) {
|
|
715809
715809
|
if (!obj || typeof obj !== "object") {
|
|
715810
715810
|
throw new TypeError("argument obj is required");
|
|
715811
715811
|
}
|
|
@@ -716396,7 +716396,7 @@ var require_utils16 = __commonJS({
|
|
|
716396
716396
|
return strWithoutPlus;
|
|
716397
716397
|
}
|
|
716398
716398
|
};
|
|
716399
|
-
var encode2 = function encode3(str2, defaultEncoder, charset, kind,
|
|
716399
|
+
var encode2 = function encode3(str2, defaultEncoder, charset, kind, format5) {
|
|
716400
716400
|
if (str2.length === 0) {
|
|
716401
716401
|
return str2;
|
|
716402
716402
|
}
|
|
@@ -716414,7 +716414,7 @@ var require_utils16 = __commonJS({
|
|
|
716414
716414
|
var out = "";
|
|
716415
716415
|
for (var i2 = 0; i2 < string3.length; ++i2) {
|
|
716416
716416
|
var c2 = string3.charCodeAt(i2);
|
|
716417
|
-
if (c2 === 45 || c2 === 46 || c2 === 95 || c2 === 126 || c2 >= 48 && c2 <= 57 || c2 >= 65 && c2 <= 90 || c2 >= 97 && c2 <= 122 ||
|
|
716417
|
+
if (c2 === 45 || c2 === 46 || c2 === 95 || c2 === 126 || c2 >= 48 && c2 <= 57 || c2 >= 65 && c2 <= 90 || c2 >= 97 && c2 <= 122 || format5 === formats.RFC1738 && (c2 === 40 || c2 === 41)) {
|
|
716418
716418
|
out += string3.charAt(i2);
|
|
716419
716419
|
continue;
|
|
716420
716420
|
}
|
|
@@ -716542,7 +716542,7 @@ var require_stringify4 = __commonJS({
|
|
|
716542
716542
|
return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean" || typeof v2 === "symbol" || typeof v2 === "bigint";
|
|
716543
716543
|
};
|
|
716544
716544
|
var sentinel = {};
|
|
716545
|
-
var stringify5 = function stringify6(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter6, sort, allowDots, serializeDate,
|
|
716545
|
+
var stringify5 = function stringify6(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter6, sort, allowDots, serializeDate, format5, formatter, encodeValuesOnly, charset, sideChannel) {
|
|
716546
716546
|
var obj = object;
|
|
716547
716547
|
var tmpSc = sideChannel;
|
|
716548
716548
|
var step = 0;
|
|
@@ -716575,22 +716575,22 @@ var require_stringify4 = __commonJS({
|
|
|
716575
716575
|
}
|
|
716576
716576
|
if (obj === null) {
|
|
716577
716577
|
if (strictNullHandling) {
|
|
716578
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults4.encoder, charset, "key",
|
|
716578
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults4.encoder, charset, "key", format5) : prefix;
|
|
716579
716579
|
}
|
|
716580
716580
|
obj = "";
|
|
716581
716581
|
}
|
|
716582
716582
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
716583
716583
|
if (encoder) {
|
|
716584
|
-
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults4.encoder, charset, "key",
|
|
716584
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults4.encoder, charset, "key", format5);
|
|
716585
716585
|
if (generateArrayPrefix === "comma" && encodeValuesOnly) {
|
|
716586
716586
|
var valuesArray = split2.call(String(obj), ",");
|
|
716587
716587
|
var valuesJoined = "";
|
|
716588
716588
|
for (var i2 = 0; i2 < valuesArray.length; ++i2) {
|
|
716589
|
-
valuesJoined += (i2 === 0 ? "" : ",") + formatter(encoder(valuesArray[i2], defaults4.encoder, charset, "value",
|
|
716589
|
+
valuesJoined += (i2 === 0 ? "" : ",") + formatter(encoder(valuesArray[i2], defaults4.encoder, charset, "value", format5));
|
|
716590
716590
|
}
|
|
716591
716591
|
return [formatter(keyValue) + (commaRoundTrip && isArray3(obj) && valuesArray.length === 1 ? "[]" : "") + "=" + valuesJoined];
|
|
716592
716592
|
}
|
|
716593
|
-
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults4.encoder, charset, "value",
|
|
716593
|
+
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults4.encoder, charset, "value", format5))];
|
|
716594
716594
|
}
|
|
716595
716595
|
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
716596
716596
|
}
|
|
@@ -716630,7 +716630,7 @@ var require_stringify4 = __commonJS({
|
|
|
716630
716630
|
sort,
|
|
716631
716631
|
allowDots,
|
|
716632
716632
|
serializeDate,
|
|
716633
|
-
|
|
716633
|
+
format5,
|
|
716634
716634
|
formatter,
|
|
716635
716635
|
encodeValuesOnly,
|
|
716636
716636
|
charset,
|
|
@@ -716650,14 +716650,14 @@ var require_stringify4 = __commonJS({
|
|
|
716650
716650
|
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
716651
716651
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
716652
716652
|
}
|
|
716653
|
-
var
|
|
716653
|
+
var format5 = formats["default"];
|
|
716654
716654
|
if (typeof opts.format !== "undefined") {
|
|
716655
716655
|
if (!has2.call(formats.formatters, opts.format)) {
|
|
716656
716656
|
throw new TypeError("Unknown format option provided.");
|
|
716657
716657
|
}
|
|
716658
|
-
|
|
716658
|
+
format5 = opts.format;
|
|
716659
716659
|
}
|
|
716660
|
-
var formatter = formats.formatters[
|
|
716660
|
+
var formatter = formats.formatters[format5];
|
|
716661
716661
|
var filter6 = defaults4.filter;
|
|
716662
716662
|
if (typeof opts.filter === "function" || isArray3(opts.filter)) {
|
|
716663
716663
|
filter6 = opts.filter;
|
|
@@ -716672,7 +716672,7 @@ var require_stringify4 = __commonJS({
|
|
|
716672
716672
|
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults4.encoder,
|
|
716673
716673
|
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults4.encodeValuesOnly,
|
|
716674
716674
|
filter: filter6,
|
|
716675
|
-
format:
|
|
716675
|
+
format: format5,
|
|
716676
716676
|
formatter,
|
|
716677
716677
|
serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults4.serializeDate,
|
|
716678
716678
|
skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults4.skipNulls,
|
|
@@ -717587,17 +717587,17 @@ var require_path_to_regexp = __commonJS({
|
|
|
717587
717587
|
});
|
|
717588
717588
|
return new RegExp("(?:" + path32.join("|") + ")", flags);
|
|
717589
717589
|
}
|
|
717590
|
-
path32 = ("^" + path32 + (strict ? "" : path32[path32.length - 1] === "/" ? "?" : "/?")).replace(/\/\(/g, "/(?:").replace(/([\/\.])/g, "\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function(match, slash,
|
|
717590
|
+
path32 = ("^" + path32 + (strict ? "" : path32[path32.length - 1] === "/" ? "?" : "/?")).replace(/\/\(/g, "/(?:").replace(/([\/\.])/g, "\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function(match, slash, format5, key2, capture, star, optional, offset2) {
|
|
717591
717591
|
slash = slash || "";
|
|
717592
|
-
|
|
717593
|
-
capture = capture || "([^\\/" +
|
|
717592
|
+
format5 = format5 || "";
|
|
717593
|
+
capture = capture || "([^\\/" + format5 + "]+?)";
|
|
717594
717594
|
optional = optional || "";
|
|
717595
717595
|
keys4.push({
|
|
717596
717596
|
name: key2,
|
|
717597
717597
|
optional: !!optional,
|
|
717598
717598
|
offset: offset2 + extraOffset
|
|
717599
717599
|
});
|
|
717600
|
-
var result2 = "" + (optional ? "" : slash) + "(?:" +
|
|
717600
|
+
var result2 = "" + (optional ? "" : slash) + "(?:" + format5 + (optional ? slash : "") + capture + (star ? "((?:[\\/" + format5 + "].+?)?)" : "") + ")" + optional;
|
|
717601
717601
|
extraOffset += result2.length - match.length;
|
|
717602
717602
|
return result2;
|
|
717603
717603
|
}).replace(/\*/g, function(star, index3) {
|
|
@@ -718434,7 +718434,7 @@ var require_content_disposition = __commonJS({
|
|
|
718434
718434
|
var opts = options || {};
|
|
718435
718435
|
var type2 = opts.type || "attachment";
|
|
718436
718436
|
var params = createparams(filename, opts.fallback);
|
|
718437
|
-
return
|
|
718437
|
+
return format5(new ContentDisposition(type2, params));
|
|
718438
718438
|
}
|
|
718439
718439
|
function createparams(filename, fallback2) {
|
|
718440
718440
|
if (filename === void 0) {
|
|
@@ -718465,7 +718465,7 @@ var require_content_disposition = __commonJS({
|
|
|
718465
718465
|
}
|
|
718466
718466
|
return params;
|
|
718467
718467
|
}
|
|
718468
|
-
function
|
|
718468
|
+
function format5(obj) {
|
|
718469
718469
|
var parameters = obj.parameters;
|
|
718470
718470
|
var type2 = obj.type;
|
|
718471
718471
|
if (!type2 || typeof type2 !== "string" || !TOKEN_REGEXP.test(type2)) {
|
|
@@ -736685,7 +736685,7 @@ var AccessTokenPosthogManager = class {
|
|
|
736685
736685
|
properties: {
|
|
736686
736686
|
...event,
|
|
736687
736687
|
...event.properties,
|
|
736688
|
-
version: "0.16.
|
|
736688
|
+
version: "0.16.12-rc0",
|
|
736689
736689
|
usingAccessToken: true
|
|
736690
736690
|
}
|
|
736691
736691
|
});
|
|
@@ -736747,7 +736747,7 @@ var UserPosthogManager = class {
|
|
|
736747
736747
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
736748
736748
|
event: "CLI",
|
|
736749
736749
|
properties: {
|
|
736750
|
-
version: "0.16.
|
|
736750
|
+
version: "0.16.12-rc0",
|
|
736751
736751
|
...event,
|
|
736752
736752
|
...event.properties
|
|
736753
736753
|
}
|
|
@@ -736779,19 +736779,23 @@ async function getPosthogManager() {
|
|
|
736779
736779
|
return posthogManager;
|
|
736780
736780
|
}
|
|
736781
736781
|
async function createPosthogManager() {
|
|
736782
|
-
|
|
736783
|
-
|
|
736782
|
+
try {
|
|
736783
|
+
const posthogApiKey = "phc_yQgAEdJJkVpI24NdSRID2mor1x1leRpDoC9yZ9mfXal";
|
|
736784
|
+
if (posthogApiKey == null) {
|
|
736785
|
+
return new NoopPosthogManager();
|
|
736786
|
+
}
|
|
736787
|
+
const userToken = await getUserToken();
|
|
736788
|
+
if (userToken != null) {
|
|
736789
|
+
return new UserPosthogManager({ token: userToken, posthogApiKey });
|
|
736790
|
+
}
|
|
736791
|
+
const accessToken = await getAccessToken();
|
|
736792
|
+
if (accessToken != null) {
|
|
736793
|
+
return new AccessTokenPosthogManager({ posthogApiKey });
|
|
736794
|
+
}
|
|
736795
|
+
return new UserPosthogManager({ token: void 0, posthogApiKey });
|
|
736796
|
+
} catch (err) {
|
|
736784
736797
|
return new NoopPosthogManager();
|
|
736785
736798
|
}
|
|
736786
|
-
const userToken = await getUserToken();
|
|
736787
|
-
if (userToken != null) {
|
|
736788
|
-
return new UserPosthogManager({ token: userToken, posthogApiKey });
|
|
736789
|
-
}
|
|
736790
|
-
const accessToken = await getAccessToken();
|
|
736791
|
-
if (accessToken != null) {
|
|
736792
|
-
return new AccessTokenPosthogManager({ posthogApiKey });
|
|
736793
|
-
}
|
|
736794
|
-
return new UserPosthogManager({ token: void 0, posthogApiKey });
|
|
736795
736799
|
}
|
|
736796
736800
|
|
|
736797
736801
|
// pnp:/home/circleci/project/packages/cli/login/lib/auth0-login/doAuth0DeviceAuthorizationFlow.js
|
|
@@ -745893,9 +745897,9 @@ var FernDefinitionFileFormatter = class {
|
|
|
745893
745897
|
constructor({ fileContents }) {
|
|
745894
745898
|
this.fileContents = fileContents;
|
|
745895
745899
|
}
|
|
745896
|
-
format() {
|
|
745900
|
+
async format() {
|
|
745897
745901
|
if (this.formatted == null) {
|
|
745898
|
-
const { header, body } = this.splitFileAtHeader();
|
|
745902
|
+
const { header, body } = await this.splitFileAtHeader();
|
|
745899
745903
|
const writer = new FileWriter();
|
|
745900
745904
|
if (!this.fileContents.includes("yaml-language-server")) {
|
|
745901
745905
|
writer.writeLine(LANG_SERVER_BANNER);
|
|
@@ -745912,12 +745916,12 @@ var FernDefinitionFileFormatter = class {
|
|
|
745912
745916
|
while (!reader.isEof()) {
|
|
745913
745917
|
location2 = this.writeNextLine({ nextLine: reader.readNextLine(), writer, location: location2 });
|
|
745914
745918
|
}
|
|
745915
|
-
this.formatted = this.prettierFormat(writer.getContent());
|
|
745919
|
+
this.formatted = await this.prettierFormat(writer.getContent());
|
|
745916
745920
|
}
|
|
745917
745921
|
return this.formatted;
|
|
745918
745922
|
}
|
|
745919
|
-
splitFileAtHeader() {
|
|
745920
|
-
const lines = this.prettierFormat(this.fileContents).split("\n");
|
|
745923
|
+
async splitFileAtHeader() {
|
|
745924
|
+
const lines = (await this.prettierFormat(this.fileContents)).split("\n");
|
|
745921
745925
|
const indexOfSeparator = lines.findIndex((line) => {
|
|
745922
745926
|
const trimmed = line.trim();
|
|
745923
745927
|
return trimmed.length === 0 || !trimmed.startsWith("#");
|
|
@@ -745927,7 +745931,7 @@ var FernDefinitionFileFormatter = class {
|
|
|
745927
745931
|
body: lines.slice(indexOfSeparator).filter((line) => line.trim().length > 0)
|
|
745928
745932
|
};
|
|
745929
745933
|
}
|
|
745930
|
-
prettierFormat(content3) {
|
|
745934
|
+
async prettierFormat(content3) {
|
|
745931
745935
|
return prettier.format(content3, {
|
|
745932
745936
|
parser: "yaml"
|
|
745933
745937
|
});
|
|
@@ -746038,18 +746042,18 @@ var FileWriter = class {
|
|
|
746038
746042
|
};
|
|
746039
746043
|
|
|
746040
746044
|
// pnp:/home/circleci/project/packages/cli/yaml/formatter/lib/formatDefinitionFile.js
|
|
746041
|
-
function formatDefinitionFile({ fileContents }) {
|
|
746045
|
+
async function formatDefinitionFile({ fileContents }) {
|
|
746042
746046
|
const formatter = new FernDefinitionFileFormatter({
|
|
746043
746047
|
fileContents
|
|
746044
746048
|
});
|
|
746045
|
-
return formatter.format();
|
|
746049
|
+
return await formatter.format();
|
|
746046
746050
|
}
|
|
746047
746051
|
|
|
746048
746052
|
// pnp:/home/circleci/project/packages/cli/yaml/formatter/lib/formatWorkspace.js
|
|
746049
746053
|
var import_promises13 = require("fs/promises");
|
|
746050
746054
|
async function formatFernWorkspace({ workspace, context, shouldFix }) {
|
|
746051
746055
|
for (const [relativeFilepath, file] of entries(workspace.definition.namedDefinitionFiles)) {
|
|
746052
|
-
const formatted = formatDefinitionFile({
|
|
746056
|
+
const formatted = await formatDefinitionFile({
|
|
746053
746057
|
fileContents: file.rawContents
|
|
746054
746058
|
});
|
|
746055
746059
|
if (formatted !== file.rawContents) {
|
|
@@ -746187,7 +746191,7 @@ async function writeSampleApiDefinition({ directoryOfDefinition }) {
|
|
|
746187
746191
|
await (0, import_promises14.mkdir)(directoryOfDefinition);
|
|
746188
746192
|
await (0, import_promises14.writeFile)(join(directoryOfDefinition, RelativeFilePath.of(ROOT_API_FILENAME)), js_yaml_default.dump(ROOT_API));
|
|
746189
746193
|
const absoluteFilepathToImdbYaml = join(directoryOfDefinition, RelativeFilePath.of("imdb.yml"));
|
|
746190
|
-
await (0, import_promises14.writeFile)(absoluteFilepathToImdbYaml, formatDefinitionFile({
|
|
746194
|
+
await (0, import_promises14.writeFile)(absoluteFilepathToImdbYaml, await formatDefinitionFile({
|
|
746191
746195
|
fileContents: SAMPLE_IMDB_API
|
|
746192
746196
|
}));
|
|
746193
746197
|
}
|
|
@@ -750929,8 +750933,8 @@ function convertLiteral({ wrapAsNullable, value, description, groupName }) {
|
|
|
750929
750933
|
|
|
750930
750934
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/v3/converters/schema/convertNumber.js
|
|
750931
750935
|
var import_parseIr7 = __toESM(require_parseIr());
|
|
750932
|
-
function convertNumber({ format:
|
|
750933
|
-
if (
|
|
750936
|
+
function convertNumber({ format: format5, description, wrapAsNullable, example, groupName }) {
|
|
750937
|
+
if (format5 == null || format5 === "double") {
|
|
750934
750938
|
return wrapPrimitive({
|
|
750935
750939
|
primitive: import_parseIr7.PrimitiveSchemaValueWithExample.double({
|
|
750936
750940
|
example
|
|
@@ -750939,7 +750943,7 @@ function convertNumber({ format: format4, description, wrapAsNullable, example,
|
|
|
750939
750943
|
description,
|
|
750940
750944
|
groupName
|
|
750941
750945
|
});
|
|
750942
|
-
} else if (
|
|
750946
|
+
} else if (format5 === "float") {
|
|
750943
750947
|
return wrapPrimitive({
|
|
750944
750948
|
primitive: import_parseIr7.PrimitiveSchemaValueWithExample.float({
|
|
750945
750949
|
example
|
|
@@ -750948,7 +750952,7 @@ function convertNumber({ format: format4, description, wrapAsNullable, example,
|
|
|
750948
750952
|
description,
|
|
750949
750953
|
groupName
|
|
750950
750954
|
});
|
|
750951
|
-
} else if (
|
|
750955
|
+
} else if (format5 === "int32") {
|
|
750952
750956
|
return wrapPrimitive({
|
|
750953
750957
|
primitive: import_parseIr7.PrimitiveSchemaValueWithExample.int({
|
|
750954
750958
|
example
|
|
@@ -750957,7 +750961,7 @@ function convertNumber({ format: format4, description, wrapAsNullable, example,
|
|
|
750957
750961
|
description,
|
|
750958
750962
|
groupName
|
|
750959
750963
|
});
|
|
750960
|
-
} else if (
|
|
750964
|
+
} else if (format5 === "int64") {
|
|
750961
750965
|
return wrapPrimitive({
|
|
750962
750966
|
primitive: import_parseIr7.PrimitiveSchemaValueWithExample.int64({
|
|
750963
750967
|
example
|
|
@@ -750966,7 +750970,7 @@ function convertNumber({ format: format4, description, wrapAsNullable, example,
|
|
|
750966
750970
|
description,
|
|
750967
750971
|
groupName
|
|
750968
750972
|
});
|
|
750969
|
-
} else if (
|
|
750973
|
+
} else if (format5 === "time-delta") {
|
|
750970
750974
|
return wrapPrimitive({
|
|
750971
750975
|
primitive: import_parseIr7.PrimitiveSchemaValueWithExample.float({
|
|
750972
750976
|
example
|
|
@@ -761217,10 +761221,10 @@ var CliContext = class {
|
|
|
761217
761221
|
return "fern-api";
|
|
761218
761222
|
}
|
|
761219
761223
|
getPackageVersion() {
|
|
761220
|
-
if ("0.16.
|
|
761224
|
+
if ("0.16.12-rc0" == null) {
|
|
761221
761225
|
this.logger.error("CLI_VERSION is not defined");
|
|
761222
761226
|
}
|
|
761223
|
-
return "0.16.
|
|
761227
|
+
return "0.16.12-rc0";
|
|
761224
761228
|
}
|
|
761225
761229
|
getCliName() {
|
|
761226
761230
|
if ("fern" == null) {
|
|
@@ -762621,16 +762625,33 @@ var import_api3 = __toESM(require_api4());
|
|
|
762621
762625
|
|
|
762622
762626
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertDeclaration.js
|
|
762623
762627
|
var import_api2 = __toESM(require_api4());
|
|
762628
|
+
|
|
762629
|
+
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/formatDocs.js
|
|
762630
|
+
var prettier2 = __toESM(require_prettier());
|
|
762631
|
+
async function formatDocs(docs) {
|
|
762632
|
+
if (docs != null) {
|
|
762633
|
+
const formattedDocs = prettier2.format(docs, {
|
|
762634
|
+
parser: "markdown"
|
|
762635
|
+
});
|
|
762636
|
+
if (formattedDocs.endsWith("\n") || formattedDocs.endsWith("\r")) {
|
|
762637
|
+
return formattedDocs.substring(0, formattedDocs.length - 1);
|
|
762638
|
+
}
|
|
762639
|
+
return formattedDocs;
|
|
762640
|
+
}
|
|
762641
|
+
return docs;
|
|
762642
|
+
}
|
|
762643
|
+
|
|
762644
|
+
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertDeclaration.js
|
|
762624
762645
|
var DEFAULT_DECLARATION = {
|
|
762625
762646
|
docs: void 0,
|
|
762626
762647
|
availability: void 0
|
|
762627
762648
|
};
|
|
762628
|
-
function convertDeclaration(declaration) {
|
|
762649
|
+
async function convertDeclaration(declaration) {
|
|
762629
762650
|
if (typeof declaration === "string") {
|
|
762630
762651
|
return DEFAULT_DECLARATION;
|
|
762631
762652
|
}
|
|
762632
762653
|
return {
|
|
762633
|
-
docs: declaration.docs,
|
|
762654
|
+
docs: await formatDocs(declaration.docs),
|
|
762634
762655
|
availability: convertAvailability(declaration.availability)
|
|
762635
762656
|
};
|
|
762636
762657
|
}
|
|
@@ -762665,24 +762686,24 @@ function convertAvailabilityStatus(status) {
|
|
|
762665
762686
|
}
|
|
762666
762687
|
|
|
762667
762688
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertObjectTypeDeclaration.js
|
|
762668
|
-
function convertObjectTypeDeclaration({ object, file }) {
|
|
762689
|
+
async function convertObjectTypeDeclaration({ object, file }) {
|
|
762669
762690
|
return import_api3.Type.object({
|
|
762670
762691
|
extends: getExtensionsAsList(object.extends).map((extended) => parseTypeName({ typeName: extended, file })),
|
|
762671
|
-
properties: getObjectPropertiesFromRawObjectSchema(object, file)
|
|
762692
|
+
properties: await getObjectPropertiesFromRawObjectSchema(object, file)
|
|
762672
762693
|
});
|
|
762673
762694
|
}
|
|
762674
|
-
function getObjectPropertiesFromRawObjectSchema(object, file) {
|
|
762695
|
+
async function getObjectPropertiesFromRawObjectSchema(object, file) {
|
|
762675
762696
|
if (object.properties == null) {
|
|
762676
762697
|
return [];
|
|
762677
762698
|
}
|
|
762678
|
-
return Object.entries(object.properties).map(([propertyKey, propertyDefinition]) => ({
|
|
762679
|
-
...convertDeclaration(propertyDefinition),
|
|
762699
|
+
return await Promise.all(Object.entries(object.properties).map(async ([propertyKey, propertyDefinition]) => ({
|
|
762700
|
+
...await convertDeclaration(propertyDefinition),
|
|
762680
762701
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
762681
762702
|
wireValue: propertyKey,
|
|
762682
762703
|
name: getPropertyName({ propertyKey, property: propertyDefinition }).name
|
|
762683
762704
|
}),
|
|
762684
762705
|
valueType: file.parseTypeReference(propertyDefinition)
|
|
762685
|
-
}));
|
|
762706
|
+
})));
|
|
762686
762707
|
}
|
|
762687
762708
|
function getExtensionsAsList(extensions) {
|
|
762688
762709
|
if (extensions == null) {
|
|
@@ -763221,7 +763242,7 @@ function getDocs(field) {
|
|
|
763221
763242
|
|
|
763222
763243
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.js
|
|
763223
763244
|
var DEFAULT_UNION_VALUE_PROPERTY_VALUE = "value";
|
|
763224
|
-
function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }) {
|
|
763245
|
+
async function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }) {
|
|
763225
763246
|
const discriminant = getUnionDiscriminant(union2);
|
|
763226
763247
|
return import_api7.Type.union({
|
|
763227
763248
|
discriminant: file.casingsGenerator.generateNameAndWireValue({
|
|
@@ -763229,14 +763250,14 @@ function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeRes
|
|
|
763229
763250
|
name: getUnionDiscriminantName(union2).name
|
|
763230
763251
|
}),
|
|
763231
763252
|
extends: getExtensionsAsList(union2.extends).map((extended) => parseTypeName({ typeName: extended, file })),
|
|
763232
|
-
baseProperties: union2["base-properties"] != null ? Object.entries(union2["base-properties"]).map(([propertyKey, propertyDefinition]) => ({
|
|
763233
|
-
...convertDeclaration(propertyDefinition),
|
|
763253
|
+
baseProperties: union2["base-properties"] != null ? await Promise.all(Object.entries(union2["base-properties"]).map(async ([propertyKey, propertyDefinition]) => ({
|
|
763254
|
+
...await convertDeclaration(propertyDefinition),
|
|
763234
763255
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
763235
763256
|
wireValue: propertyKey,
|
|
763236
763257
|
name: getPropertyName({ propertyKey, property: propertyDefinition }).name
|
|
763237
763258
|
}),
|
|
763238
763259
|
valueType: file.parseTypeReference(propertyDefinition)
|
|
763239
|
-
})) : [],
|
|
763260
|
+
}))) : [],
|
|
763240
763261
|
types: Object.entries(union2.union).map(([unionKey, rawSingleUnionType]) => {
|
|
763241
763262
|
const rawType = typeof rawSingleUnionType === "string" ? rawSingleUnionType : typeof rawSingleUnionType.type === "string" ? rawSingleUnionType.type : void 0;
|
|
763242
763263
|
const discriminantValue = file.casingsGenerator.generateNameAndWireValue({
|
|
@@ -763694,15 +763715,15 @@ function areLiteralTypesEquivalent({ expected, actual }) {
|
|
|
763694
763715
|
|
|
763695
763716
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertEnumTypeDeclaration.js
|
|
763696
763717
|
var import_api9 = __toESM(require_api4());
|
|
763697
|
-
function convertEnumTypeDeclaration({ _enum, file }) {
|
|
763718
|
+
async function convertEnumTypeDeclaration({ _enum, file }) {
|
|
763698
763719
|
return import_api9.Type.enum({
|
|
763699
|
-
values: _enum.enum.map((value) => ({
|
|
763700
|
-
...convertDeclaration(value),
|
|
763720
|
+
values: await Promise.all(_enum.enum.map(async (value) => ({
|
|
763721
|
+
...await convertDeclaration(value),
|
|
763701
763722
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
763702
763723
|
wireValue: typeof value === "string" ? value : value.value,
|
|
763703
763724
|
name: getEnumName(value).name
|
|
763704
763725
|
})
|
|
763705
|
-
}))
|
|
763726
|
+
})))
|
|
763706
763727
|
});
|
|
763707
763728
|
}
|
|
763708
763729
|
function getEnumName(enumValue) {
|
|
@@ -764468,7 +764489,7 @@ function buildUrl({ service, endpoint, example, pathParams }) {
|
|
|
764468
764489
|
|
|
764469
764490
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/services/convertHttpResponse.js
|
|
764470
764491
|
var import_api12 = __toESM(require_api4());
|
|
764471
|
-
function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
764492
|
+
async function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
764472
764493
|
const { response, ["response-stream"]: responseStream } = endpoint;
|
|
764473
764494
|
if (response != null) {
|
|
764474
764495
|
const docs = typeof response !== "string" ? response.docs : void 0;
|
|
@@ -764482,7 +764503,7 @@ function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
|
764482
764503
|
docs
|
|
764483
764504
|
});
|
|
764484
764505
|
} else {
|
|
764485
|
-
return convertJsonResponse(response, docs, file, typeResolver);
|
|
764506
|
+
return await convertJsonResponse(response, docs, file, typeResolver);
|
|
764486
764507
|
}
|
|
764487
764508
|
}
|
|
764488
764509
|
if (responseStream != null) {
|
|
@@ -764502,7 +764523,7 @@ function constructStreamingResponseChunkType(responseStream, file) {
|
|
|
764502
764523
|
return import_api12.StreamingResponseChunkType.json(file.parseTypeReference(typeReference));
|
|
764503
764524
|
}
|
|
764504
764525
|
}
|
|
764505
|
-
function convertJsonResponse(response, docs, file, typeResolver) {
|
|
764526
|
+
async function convertJsonResponse(response, docs, file, typeResolver) {
|
|
764506
764527
|
const responseBodyType = file.parseTypeReference(response);
|
|
764507
764528
|
const resolvedType = typeResolver.resolveTypeOrThrow({
|
|
764508
764529
|
type: typeof response !== "string" ? response.type : response,
|
|
@@ -764513,7 +764534,7 @@ function convertJsonResponse(response, docs, file, typeResolver) {
|
|
|
764513
764534
|
return import_api12.HttpResponse.json(import_api12.JsonResponse.nestedPropertyAsResponse({
|
|
764514
764535
|
docs,
|
|
764515
764536
|
responseBodyType,
|
|
764516
|
-
responseProperty: getObjectPropertyFromResolvedType(resolvedType, responseProperty, file, typeResolver)
|
|
764537
|
+
responseProperty: await getObjectPropertyFromResolvedType(resolvedType, responseProperty, file, typeResolver)
|
|
764517
764538
|
}));
|
|
764518
764539
|
}
|
|
764519
764540
|
return import_api12.HttpResponse.json(import_api12.JsonResponse.response({
|
|
@@ -764521,16 +764542,16 @@ function convertJsonResponse(response, docs, file, typeResolver) {
|
|
|
764521
764542
|
responseBodyType
|
|
764522
764543
|
}));
|
|
764523
764544
|
}
|
|
764524
|
-
function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeResolver) {
|
|
764545
|
+
async function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeResolver) {
|
|
764525
764546
|
switch (resolvedType._type) {
|
|
764526
764547
|
case "container":
|
|
764527
764548
|
if (resolvedType.container._type === "optional") {
|
|
764528
|
-
return getObjectPropertyFromResolvedType(resolvedType.container.itemType, property2, file, typeResolver);
|
|
764549
|
+
return await getObjectPropertyFromResolvedType(resolvedType.container.itemType, property2, file, typeResolver);
|
|
764529
764550
|
}
|
|
764530
764551
|
break;
|
|
764531
764552
|
case "named":
|
|
764532
764553
|
if (isRawObjectDefinition2(resolvedType.declaration)) {
|
|
764533
|
-
return getObjectPropertyFromObjectSchema(resolvedType.declaration, property2, resolvedType.file, typeResolver);
|
|
764554
|
+
return await getObjectPropertyFromObjectSchema(resolvedType.declaration, property2, resolvedType.file, typeResolver);
|
|
764534
764555
|
}
|
|
764535
764556
|
break;
|
|
764536
764557
|
case "primitive":
|
|
@@ -764541,15 +764562,15 @@ function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeRe
|
|
|
764541
764562
|
}
|
|
764542
764563
|
throw new Error("Internal error; response must be an object in order to return a property as a response");
|
|
764543
764564
|
}
|
|
764544
|
-
function getObjectPropertyFromObjectSchema(objectSchema, property2, file, typeResolver) {
|
|
764545
|
-
const properties = getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver);
|
|
764565
|
+
async function getObjectPropertyFromObjectSchema(objectSchema, property2, file, typeResolver) {
|
|
764566
|
+
const properties = await getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver);
|
|
764546
764567
|
const objectProperty = properties[property2];
|
|
764547
764568
|
if (objectProperty == null) {
|
|
764548
764569
|
throw new Error(`Response does not have a property named ${property2}.`);
|
|
764549
764570
|
}
|
|
764550
764571
|
return objectProperty;
|
|
764551
764572
|
}
|
|
764552
|
-
function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
764573
|
+
async function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
764553
764574
|
let extendedTypes = [];
|
|
764554
764575
|
if (typeof objectSchema.extends === "string") {
|
|
764555
764576
|
extendedTypes = [objectSchema.extends];
|
|
@@ -764558,24 +764579,24 @@ function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
|
764558
764579
|
}
|
|
764559
764580
|
const properties = {};
|
|
764560
764581
|
for (const extendedType of extendedTypes) {
|
|
764561
|
-
const extendedProperties = getAllPropertiesForExtendedType(extendedType, file, typeResolver);
|
|
764582
|
+
const extendedProperties = await getAllPropertiesForExtendedType(extendedType, file, typeResolver);
|
|
764562
764583
|
Object.entries(extendedProperties).map(([propertyKey, objectProperty]) => {
|
|
764563
764584
|
properties[propertyKey] = objectProperty;
|
|
764564
764585
|
});
|
|
764565
764586
|
}
|
|
764566
|
-
const objectProperties = getObjectPropertiesFromRawObjectSchema(objectSchema, file);
|
|
764587
|
+
const objectProperties = await getObjectPropertiesFromRawObjectSchema(objectSchema, file);
|
|
764567
764588
|
objectProperties.forEach((objectProperty) => {
|
|
764568
764589
|
properties[objectProperty.name.name.originalName] = objectProperty;
|
|
764569
764590
|
});
|
|
764570
764591
|
return properties;
|
|
764571
764592
|
}
|
|
764572
|
-
function getAllPropertiesForExtendedType(extendedType, file, typeResolver) {
|
|
764593
|
+
async function getAllPropertiesForExtendedType(extendedType, file, typeResolver) {
|
|
764573
764594
|
const resolvedType = typeResolver.resolveNamedTypeOrThrow({
|
|
764574
764595
|
referenceToNamedType: extendedType,
|
|
764575
764596
|
file
|
|
764576
764597
|
});
|
|
764577
764598
|
if (resolvedType._type === "named" && isRawObjectDefinition2(resolvedType.declaration)) {
|
|
764578
|
-
return getAllPropertiesForRawObjectSchema(resolvedType.declaration, file, typeResolver);
|
|
764599
|
+
return await getAllPropertiesForRawObjectSchema(resolvedType.declaration, file, typeResolver);
|
|
764579
764600
|
}
|
|
764580
764601
|
throw new Error(`Extended type ${extendedType} must be another named type`);
|
|
764581
764602
|
}
|
|
@@ -764599,8 +764620,8 @@ function convertResponseErrors2({ errors, file }) {
|
|
|
764599
764620
|
}
|
|
764600
764621
|
|
|
764601
764622
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/services/convertHttpService.js
|
|
764602
|
-
function convertHttpService({ rootPathParameters, serviceDefinition, file, errorResolver, typeResolver, exampleResolver, variableResolver, globalErrors, workspace }) {
|
|
764603
|
-
const servicePathParameters = convertPathParameters2({
|
|
764623
|
+
async function convertHttpService({ rootPathParameters, serviceDefinition, file, errorResolver, typeResolver, exampleResolver, variableResolver, globalErrors, workspace }) {
|
|
764624
|
+
const servicePathParameters = await convertPathParameters2({
|
|
764604
764625
|
pathParameters: serviceDefinition["path-parameters"],
|
|
764605
764626
|
location: import_api13.PathParameterLocation.Service,
|
|
764606
764627
|
file,
|
|
@@ -764612,18 +764633,18 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764612
764633
|
name: serviceName,
|
|
764613
764634
|
displayName: serviceDefinition["display-name"] ?? void 0,
|
|
764614
764635
|
basePath: constructHttpPath(serviceDefinition["base-path"]),
|
|
764615
|
-
headers: serviceDefinition.headers != null ? Object.entries(serviceDefinition.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
|
|
764636
|
+
headers: serviceDefinition.headers != null ? await Promise.all(Object.entries(serviceDefinition.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file }))) : [],
|
|
764616
764637
|
pathParameters: servicePathParameters,
|
|
764617
|
-
endpoints: Object.entries(serviceDefinition.endpoints).map(([endpointKey, endpoint]) => {
|
|
764638
|
+
endpoints: await Promise.all(Object.entries(serviceDefinition.endpoints).map(async ([endpointKey, endpoint]) => {
|
|
764618
764639
|
var _a2, _b2;
|
|
764619
|
-
const endpointPathParameters = convertPathParameters2({
|
|
764640
|
+
const endpointPathParameters = await convertPathParameters2({
|
|
764620
764641
|
pathParameters: endpoint["path-parameters"],
|
|
764621
764642
|
location: import_api13.PathParameterLocation.Endpoint,
|
|
764622
764643
|
file,
|
|
764623
764644
|
variableResolver
|
|
764624
764645
|
});
|
|
764625
764646
|
const httpEndpoint = {
|
|
764626
|
-
...convertDeclaration(endpoint),
|
|
764647
|
+
...await convertDeclaration(endpoint),
|
|
764627
764648
|
id: "",
|
|
764628
764649
|
name: file.casingsGenerator.generateName(endpointKey),
|
|
764629
764650
|
displayName: endpoint["display-name"],
|
|
@@ -764635,11 +764656,11 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764635
764656
|
fullPath: constructHttpPath(file.rootApiFile["base-path"] != null ? urlJoin(file.rootApiFile["base-path"], serviceDefinition["base-path"], endpoint.path) : urlJoin(serviceDefinition["base-path"], endpoint.path)),
|
|
764636
764657
|
pathParameters: endpointPathParameters,
|
|
764637
764658
|
allPathParameters: [...rootPathParameters, ...servicePathParameters, ...endpointPathParameters],
|
|
764638
|
-
queryParameters: typeof endpoint.request !== "string" && ((_a2 = endpoint.request) == null ? void 0 : _a2["query-parameters"]) != null ? Object.entries(endpoint.request["query-parameters"]).map(([queryParameterKey, queryParameter]) => {
|
|
764659
|
+
queryParameters: typeof endpoint.request !== "string" && ((_a2 = endpoint.request) == null ? void 0 : _a2["query-parameters"]) != null ? await Promise.all(Object.entries(endpoint.request["query-parameters"]).map(async ([queryParameterKey, queryParameter]) => {
|
|
764639
764660
|
const { name: name2 } = getQueryParameterName({ queryParameterKey, queryParameter });
|
|
764640
764661
|
const valueType = file.parseTypeReference(queryParameter);
|
|
764641
764662
|
return {
|
|
764642
|
-
...convertDeclaration(queryParameter),
|
|
764663
|
+
...await convertDeclaration(queryParameter),
|
|
764643
764664
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
764644
764665
|
wireValue: queryParameterKey,
|
|
764645
764666
|
name: name2
|
|
@@ -764647,8 +764668,8 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764647
764668
|
valueType,
|
|
764648
764669
|
allowMultiple: typeof queryParameter !== "string" && queryParameter["allow-multiple"] != null ? queryParameter["allow-multiple"] : false
|
|
764649
764670
|
};
|
|
764650
|
-
}) : [],
|
|
764651
|
-
headers: typeof endpoint.request !== "string" && ((_b2 = endpoint.request) == null ? void 0 : _b2.headers) != null ? Object.entries(endpoint.request.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
|
|
764671
|
+
})) : [],
|
|
764672
|
+
headers: typeof endpoint.request !== "string" && ((_b2 = endpoint.request) == null ? void 0 : _b2.headers) != null ? await Promise.all(Object.entries(endpoint.request.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file }))) : [],
|
|
764652
764673
|
requestBody: convertHttpRequestBody({ request: endpoint.request, file }),
|
|
764653
764674
|
sdkRequest: convertHttpSdkRequest({
|
|
764654
764675
|
service: serviceDefinition,
|
|
@@ -764656,7 +764677,7 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764656
764677
|
file,
|
|
764657
764678
|
typeResolver
|
|
764658
764679
|
}),
|
|
764659
|
-
response: convertHttpResponse({ endpoint, file, typeResolver }),
|
|
764680
|
+
response: await convertHttpResponse({ endpoint, file, typeResolver }),
|
|
764660
764681
|
errors: [...convertResponseErrors2({ errors: endpoint.errors, file }), ...globalErrors],
|
|
764661
764682
|
examples: endpoint.examples != null ? endpoint.examples.map((example) => convertExampleEndpointCall2({
|
|
764662
764683
|
service: serviceDefinition,
|
|
@@ -764672,24 +764693,24 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764672
764693
|
};
|
|
764673
764694
|
httpEndpoint.id = IdGenerator.generateEndpointId(serviceName, httpEndpoint);
|
|
764674
764695
|
return httpEndpoint;
|
|
764675
|
-
})
|
|
764696
|
+
}))
|
|
764676
764697
|
};
|
|
764677
764698
|
}
|
|
764678
|
-
function convertPathParameters2({ pathParameters, location: location2, file, variableResolver }) {
|
|
764699
|
+
async function convertPathParameters2({ pathParameters, location: location2, file, variableResolver }) {
|
|
764679
764700
|
if (pathParameters == null) {
|
|
764680
764701
|
return [];
|
|
764681
764702
|
}
|
|
764682
|
-
return Object.entries(pathParameters).map(([parameterName, parameter]) => convertPathParameter({
|
|
764703
|
+
return await Promise.all(Object.entries(pathParameters).map(([parameterName, parameter]) => convertPathParameter({
|
|
764683
764704
|
parameterName,
|
|
764684
764705
|
parameter,
|
|
764685
764706
|
location: location2,
|
|
764686
764707
|
file,
|
|
764687
764708
|
variableResolver
|
|
764688
|
-
}));
|
|
764709
|
+
})));
|
|
764689
764710
|
}
|
|
764690
|
-
function convertPathParameter({ parameterName, parameter, location: location2, file, variableResolver }) {
|
|
764711
|
+
async function convertPathParameter({ parameterName, parameter, location: location2, file, variableResolver }) {
|
|
764691
764712
|
return {
|
|
764692
|
-
...convertDeclaration(parameter),
|
|
764713
|
+
...await convertDeclaration(parameter),
|
|
764693
764714
|
name: file.casingsGenerator.generateName(parameterName),
|
|
764694
764715
|
valueType: getPathParameterType({ parameter, variableResolver, file }),
|
|
764695
764716
|
location: location2,
|
|
@@ -764758,10 +764779,10 @@ function convertHttpMethod2(method2) {
|
|
|
764758
764779
|
assertNever(method2);
|
|
764759
764780
|
}
|
|
764760
764781
|
}
|
|
764761
|
-
function convertHttpHeader({ headerKey, header, file }) {
|
|
764782
|
+
async function convertHttpHeader({ headerKey, header, file }) {
|
|
764762
764783
|
const { name: name2 } = getHeaderName2({ headerKey, header });
|
|
764763
764784
|
return {
|
|
764764
|
-
...convertDeclaration(header),
|
|
764785
|
+
...await convertDeclaration(header),
|
|
764765
764786
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
764766
764787
|
wireValue: headerKey,
|
|
764767
764788
|
name: name2
|
|
@@ -765005,7 +765026,7 @@ function convertErrorDiscriminationStrategy(rawStrategy, file) {
|
|
|
765005
765026
|
|
|
765006
765027
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertWebhookGroup.js
|
|
765007
765028
|
var import_api17 = __toESM(require_api4());
|
|
765008
|
-
function convertWebhookGroup2({ webhooks, file }) {
|
|
765029
|
+
async function convertWebhookGroup2({ webhooks, file }) {
|
|
765009
765030
|
const webhookGroup = [];
|
|
765010
765031
|
for (const [webhookId, webhook] of Object.entries(webhooks)) {
|
|
765011
765032
|
webhookGroup.push({
|
|
@@ -765014,7 +765035,7 @@ function convertWebhookGroup2({ webhooks, file }) {
|
|
|
765014
765035
|
docs: webhook.docs,
|
|
765015
765036
|
method: webhook.method,
|
|
765016
765037
|
name: file.casingsGenerator.generateName(webhookId),
|
|
765017
|
-
headers: webhook.headers != null ? Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
|
|
765038
|
+
headers: webhook.headers != null ? await Promise.all(Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file }))) : [],
|
|
765018
765039
|
payload: convertWebhookPayloadSchema({ payload: webhook.payload, file })
|
|
765019
765040
|
});
|
|
765020
765041
|
}
|
|
@@ -765188,8 +765209,8 @@ var SeenTypeNamesImpl = class {
|
|
|
765188
765209
|
};
|
|
765189
765210
|
|
|
765190
765211
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertTypeDeclaration.js
|
|
765191
|
-
function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver, exampleResolver, workspace }) {
|
|
765192
|
-
const declaration = convertDeclaration(typeDeclaration);
|
|
765212
|
+
async function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver, exampleResolver, workspace }) {
|
|
765213
|
+
const declaration = await convertDeclaration(typeDeclaration);
|
|
765193
765214
|
const declaredTypeName = parseTypeName({
|
|
765194
765215
|
typeName,
|
|
765195
765216
|
file
|
|
@@ -765199,7 +765220,7 @@ function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver,
|
|
|
765199
765220
|
typeDeclaration: {
|
|
765200
765221
|
...declaration,
|
|
765201
765222
|
name: declaredTypeName,
|
|
765202
|
-
shape: convertType({ typeDeclaration, file, typeResolver }),
|
|
765223
|
+
shape: await convertType({ typeDeclaration, file, typeResolver }),
|
|
765203
765224
|
referencedTypes: new Set(referencedTypes.map((referencedType) => referencedType.typeId)),
|
|
765204
765225
|
examples: typeof typeDeclaration !== "string" && typeDeclaration.examples != null ? typeDeclaration.examples.map((example) => ({
|
|
765205
765226
|
name: example.name != null ? file.casingsGenerator.generateName(example.name) : void 0,
|
|
@@ -765223,8 +765244,8 @@ function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver,
|
|
|
765223
765244
|
descendantFilepaths: new Set(referencedTypes.map((referencedType) => referencedType.fernFilepath))
|
|
765224
765245
|
};
|
|
765225
765246
|
}
|
|
765226
|
-
function convertType({ typeDeclaration, file, typeResolver }) {
|
|
765227
|
-
return visitRawTypeDeclaration(typeDeclaration, {
|
|
765247
|
+
async function convertType({ typeDeclaration, file, typeResolver }) {
|
|
765248
|
+
return await visitRawTypeDeclaration(typeDeclaration, {
|
|
765228
765249
|
alias: (alias) => convertAliasTypeDeclaration({ alias, file, typeResolver }),
|
|
765229
765250
|
object: (object) => convertObjectTypeDeclaration({ object, file }),
|
|
765230
765251
|
discriminatedUnion: (union2) => convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }),
|
|
@@ -766146,13 +766167,13 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766146
766167
|
const intermediateRepresentation = {
|
|
766147
766168
|
apiName: casingsGenerator.generateName(workspace.name),
|
|
766148
766169
|
apiDisplayName: workspace.definition.rootApiFile.contents["display-name"],
|
|
766149
|
-
apiDocs: workspace.definition.rootApiFile.contents.docs,
|
|
766170
|
+
apiDocs: await formatDocs(workspace.definition.rootApiFile.contents.docs),
|
|
766150
766171
|
auth: convertApiAuth({
|
|
766151
766172
|
rawApiFileSchema: workspace.definition.rootApiFile.contents,
|
|
766152
766173
|
file: rootApiFileContext
|
|
766153
766174
|
}),
|
|
766154
|
-
headers: workspace.definition.rootApiFile.contents.headers != null ? Object.entries(workspace.definition.rootApiFile.contents.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file: rootApiFileContext })) : [],
|
|
766155
|
-
idempotencyHeaders: workspace.definition.rootApiFile.contents["idempotency-headers"] != null ? Object.entries(workspace.definition.rootApiFile.contents["idempotency-headers"]).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file: rootApiFileContext })) : [],
|
|
766175
|
+
headers: workspace.definition.rootApiFile.contents.headers != null ? await Promise.all(Object.entries(workspace.definition.rootApiFile.contents.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file: rootApiFileContext }))) : [],
|
|
766176
|
+
idempotencyHeaders: workspace.definition.rootApiFile.contents["idempotency-headers"] != null ? await Promise.all(Object.entries(workspace.definition.rootApiFile.contents["idempotency-headers"]).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file: rootApiFileContext }))) : [],
|
|
766156
766177
|
types: {},
|
|
766157
766178
|
errors: {},
|
|
766158
766179
|
services: {},
|
|
@@ -766163,7 +766184,7 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766163
766184
|
}),
|
|
766164
766185
|
errorDiscriminationStrategy: convertErrorDiscriminationStrategy(workspace.definition.rootApiFile.contents["error-discrimination"], rootApiFileContext),
|
|
766165
766186
|
basePath: workspace.definition.rootApiFile.contents["base-path"] != null ? constructHttpPath(workspace.definition.rootApiFile.contents["base-path"]) : void 0,
|
|
766166
|
-
pathParameters: convertPathParameters2({
|
|
766187
|
+
pathParameters: await convertPathParameters2({
|
|
766167
766188
|
pathParameters: workspace.definition.rootApiFile.contents["path-parameters"],
|
|
766168
766189
|
file: rootApiFileContext,
|
|
766169
766190
|
location: import_api22.PathParameterLocation.Root,
|
|
@@ -766191,12 +766212,12 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766191
766212
|
packageTreeGenerator.addDocs(file.fernFilepath, docs);
|
|
766192
766213
|
}
|
|
766193
766214
|
},
|
|
766194
|
-
types: (types4) => {
|
|
766215
|
+
types: async (types4) => {
|
|
766195
766216
|
if (types4 == null) {
|
|
766196
766217
|
return;
|
|
766197
766218
|
}
|
|
766198
766219
|
for (const [typeName, typeDeclaration] of Object.entries(types4)) {
|
|
766199
|
-
const convertedTypeDeclarationWithFilepaths = convertTypeDeclaration({
|
|
766220
|
+
const convertedTypeDeclarationWithFilepaths = await convertTypeDeclaration({
|
|
766200
766221
|
typeName,
|
|
766201
766222
|
typeDeclaration,
|
|
766202
766223
|
file,
|
|
@@ -766233,11 +766254,11 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766233
766254
|
irGraph.addError(convertedErrorDeclaration);
|
|
766234
766255
|
}
|
|
766235
766256
|
},
|
|
766236
|
-
service: (service) => {
|
|
766257
|
+
service: async (service) => {
|
|
766237
766258
|
if (service == null) {
|
|
766238
766259
|
return;
|
|
766239
766260
|
}
|
|
766240
|
-
const convertedHttpService = convertHttpService({
|
|
766261
|
+
const convertedHttpService = await convertHttpService({
|
|
766241
766262
|
rootPathParameters: intermediateRepresentation.pathParameters,
|
|
766242
766263
|
serviceDefinition: service,
|
|
766243
766264
|
file,
|
|
@@ -766266,12 +766287,12 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766266
766287
|
}
|
|
766267
766288
|
});
|
|
766268
766289
|
},
|
|
766269
|
-
webhooks: (webhooks) => {
|
|
766290
|
+
webhooks: async (webhooks) => {
|
|
766270
766291
|
if (webhooks == null) {
|
|
766271
766292
|
return;
|
|
766272
766293
|
}
|
|
766273
766294
|
const webhookGroupId = IdGenerator.generateWebhookGroupId(file.fernFilepath);
|
|
766274
|
-
const convertedWebhookGroup = convertWebhookGroup2({ webhooks, file });
|
|
766295
|
+
const convertedWebhookGroup = await convertWebhookGroup2({ webhooks, file });
|
|
766275
766296
|
intermediateRepresentation.webhookGroups[webhookGroupId] = convertedWebhookGroup;
|
|
766276
766297
|
packageTreeGenerator.addWebhookGroup(webhookGroupId, file.fernFilepath);
|
|
766277
766298
|
}
|
|
@@ -774816,6 +774837,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
774816
774837
|
}
|
|
774817
774838
|
|
|
774818
774839
|
// pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
774840
|
+
var import_promises35 = require("fs/promises");
|
|
774819
774841
|
var import_os3 = __toESM(require("os"));
|
|
774820
774842
|
var import_path33 = __toESM(require("path"));
|
|
774821
774843
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
@@ -775215,6 +775237,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
775215
775237
|
audiences,
|
|
775216
775238
|
generationLanguage: generatorInvocation.language
|
|
775217
775239
|
});
|
|
775240
|
+
context.logger.debug("Generated IR");
|
|
775218
775241
|
const migratedIntermediateRepresentation = irVersionOverride != null ? await migrateIntermediateRepresentationThroughVersion({
|
|
775219
775242
|
intermediateRepresentation,
|
|
775220
775243
|
context,
|
|
@@ -775227,11 +775250,13 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
775227
775250
|
version: generatorInvocation.version
|
|
775228
775251
|
}
|
|
775229
775252
|
});
|
|
775253
|
+
context.logger.debug("Migrated IR");
|
|
775230
775254
|
const irFile = await import_tmp_promise6.default.file({
|
|
775231
775255
|
tmpdir: workspaceTempDir.path
|
|
775232
775256
|
});
|
|
775233
775257
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
775234
|
-
await
|
|
775258
|
+
await (0, import_promises35.writeFile)(absolutePathToIr, JSON.stringify(migratedIntermediateRepresentation, void 0, 4));
|
|
775259
|
+
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
775235
775260
|
return absolutePathToIr;
|
|
775236
775261
|
}
|
|
775237
775262
|
|
|
@@ -775412,9 +775437,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
775412
775437
|
var import_axios6 = __toESM(require_axios2());
|
|
775413
775438
|
var import_decompress2 = __toESM(require_decompress());
|
|
775414
775439
|
var import_fs7 = require("fs");
|
|
775415
|
-
var
|
|
775440
|
+
var import_promises36 = require("fs/promises");
|
|
775416
775441
|
var import_path34 = __toESM(require("path"));
|
|
775417
|
-
var
|
|
775442
|
+
var import_promises37 = require("stream/promises");
|
|
775418
775443
|
|
|
775419
775444
|
// pnp:/home/circleci/project/.yarn/cache/terminal-link-npm-3.0.0-82cbbd7f4a-85a78ae50a.zip/node_modules/terminal-link/index.js
|
|
775420
775445
|
var import_supports_hyperlinks = __toESM(require_supports_hyperlinks());
|
|
@@ -775516,11 +775541,11 @@ async function downloadFilesForTask({ s3PreSignedReadUrl, absolutePathToLocalOut
|
|
|
775516
775541
|
});
|
|
775517
775542
|
const tmpDir = await import_tmp_promise7.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
775518
775543
|
const outputZipPath = import_path34.default.join(tmpDir.path, "output.zip");
|
|
775519
|
-
await (0,
|
|
775544
|
+
await (0, import_promises37.pipeline)(request.data, (0, import_fs7.createWriteStream)(outputZipPath));
|
|
775520
775545
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
775521
|
-
await (0,
|
|
775546
|
+
await (0, import_promises36.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
775522
775547
|
}
|
|
775523
|
-
await (0,
|
|
775548
|
+
await (0, import_promises36.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
775524
775549
|
await (0, import_decompress2.default)(outputZipPath, absolutePathToLocalOutput);
|
|
775525
775550
|
context.logger.info(source_default.green(`Downloaded to ${absolutePathToLocalOutput}`));
|
|
775526
775551
|
} catch (e) {
|
|
@@ -775614,10 +775639,10 @@ async function runRemoteGenerationForAPIWorkspace({ organization, workspace, con
|
|
|
775614
775639
|
|
|
775615
775640
|
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/parseDocsConfiguration.js
|
|
775616
775641
|
var import_serialization3 = __toESM(require_serialization2());
|
|
775617
|
-
var
|
|
775642
|
+
var import_promises39 = require("fs/promises");
|
|
775618
775643
|
|
|
775619
775644
|
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/getAllPages.js
|
|
775620
|
-
var
|
|
775645
|
+
var import_promises38 = require("fs/promises");
|
|
775621
775646
|
async function getAllPages({ navigation, absolutePathToFernFolder }) {
|
|
775622
775647
|
switch (navigation.type) {
|
|
775623
775648
|
case "tabbed":
|
|
@@ -775653,7 +775678,7 @@ async function getAllPagesFromNavigationItem({ item, absolutePathToFernFolder })
|
|
|
775653
775678
|
return {};
|
|
775654
775679
|
case "page":
|
|
775655
775680
|
return {
|
|
775656
|
-
[await relativize(absolutePathToFernFolder, item.absolutePath)]: (await (0,
|
|
775681
|
+
[await relativize(absolutePathToFernFolder, item.absolutePath)]: (await (0, import_promises38.readFile)(item.absolutePath)).toString()
|
|
775657
775682
|
};
|
|
775658
775683
|
case "section":
|
|
775659
775684
|
return combineMaps(await Promise.all(item.contents.map(async (sectionItem) => {
|
|
@@ -775739,7 +775764,7 @@ async function getNavigationConfiguration({ versions, navigation, absolutePathTo
|
|
|
775739
775764
|
const versionedNavbars = [];
|
|
775740
775765
|
for (const version3 of versions) {
|
|
775741
775766
|
const absoluteFilepathToVersionFile = resolve(absolutePathToFernFolder, version3.path);
|
|
775742
|
-
const content3 = js_yaml_default.load((await (0,
|
|
775767
|
+
const content3 = js_yaml_default.load((await (0, import_promises39.readFile)(absoluteFilepathToVersionFile)).toString());
|
|
775743
775768
|
const result2 = await import_serialization3.VersionFileConfig.parseOrThrow(content3);
|
|
775744
775769
|
const navigation2 = await convertNavigationConfiguration({
|
|
775745
775770
|
rawNavigationConfig: result2.navigation,
|
|
@@ -775963,7 +775988,7 @@ function isTabbedNavigationConfig(navigationConfig) {
|
|
|
775963
775988
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
775964
775989
|
var import_fdr_sdk3 = __toESM(require_dist());
|
|
775965
775990
|
var import_axios7 = __toESM(require_axios2());
|
|
775966
|
-
var
|
|
775991
|
+
var import_promises40 = require("fs/promises");
|
|
775967
775992
|
var mime = __toESM(require_mime_types());
|
|
775968
775993
|
async function publishDocs({ token, organization, docsWorkspace, domain: domain2, customDomains, fernWorkspaces, context, version: version3, preview }) {
|
|
775969
775994
|
const fdr = createFdrService({ token: token.value });
|
|
@@ -776013,7 +776038,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
|
|
|
776013
776038
|
context.failAndThrow(`Failed to upload ${filepathToUpload}`, "Upload URL is missing");
|
|
776014
776039
|
} else {
|
|
776015
776040
|
const mimeType = mime.lookup(filepathToUpload);
|
|
776016
|
-
await import_axios7.default.put(uploadUrl.uploadUrl, await (0,
|
|
776041
|
+
await import_axios7.default.put(uploadUrl.uploadUrl, await (0, import_promises40.readFile)(filepathToUpload), {
|
|
776017
776042
|
headers: {
|
|
776018
776043
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
776019
776044
|
}
|
|
@@ -797455,7 +797480,7 @@ function createProcessor(options) {
|
|
|
797455
797480
|
const {
|
|
797456
797481
|
development: development2,
|
|
797457
797482
|
jsx: jsx2,
|
|
797458
|
-
format:
|
|
797483
|
+
format: format5,
|
|
797459
797484
|
outputFormat,
|
|
797460
797485
|
providerImportSource,
|
|
797461
797486
|
recmaPlugins,
|
|
@@ -797477,13 +797502,13 @@ function createProcessor(options) {
|
|
|
797477
797502
|
);
|
|
797478
797503
|
}
|
|
797479
797504
|
}
|
|
797480
|
-
if (
|
|
797505
|
+
if (format5 === "detect") {
|
|
797481
797506
|
throw new Error(
|
|
797482
797507
|
"Incorrect `format: 'detect'`: `createProcessor` can support either `md` or `mdx`; it does not support detecting the format"
|
|
797483
797508
|
);
|
|
797484
797509
|
}
|
|
797485
797510
|
const pipeline3 = unified().use(remarkParse);
|
|
797486
|
-
if (
|
|
797511
|
+
if (format5 !== "md") {
|
|
797487
797512
|
pipeline3.use(remarkMdx);
|
|
797488
797513
|
}
|
|
797489
797514
|
const extraNodeTypes = remarkRehypeOptions ? remarkRehypeOptions.passThrough || [] : [];
|
|
@@ -797492,7 +797517,7 @@ function createProcessor(options) {
|
|
|
797492
797517
|
allowDangerousHtml: true,
|
|
797493
797518
|
passThrough: [...extraNodeTypes, ...nodeTypes]
|
|
797494
797519
|
}).use(rehypePlugins || []);
|
|
797495
|
-
if (
|
|
797520
|
+
if (format5 === "md") {
|
|
797496
797521
|
pipeline3.use(rehypeRemoveRaw);
|
|
797497
797522
|
}
|
|
797498
797523
|
pipeline3.use(rehypeRecma, { elementAttributeNameCase, stylePropertyNameCase }).use(recmaDocument, { ...rest2, outputFormat }).use(recmaJsxRewrite, {
|
|
@@ -797514,11 +797539,11 @@ var md = import_markdown_extensions.default.map((d2) => "." + d2);
|
|
|
797514
797539
|
// pnp:/home/circleci/project/.yarn/cache/@mdx-js-mdx-npm-2.3.0-043b30d13e-d918766a32.zip/node_modules/@mdx-js/mdx/lib/util/resolve-file-and-options.js
|
|
797515
797540
|
function resolveFileAndOptions(vfileCompatible, options) {
|
|
797516
797541
|
const file = looksLikeAVFile2(vfileCompatible) ? vfileCompatible : new VFile(vfileCompatible);
|
|
797517
|
-
const { format:
|
|
797542
|
+
const { format: format5, ...rest2 } = options || {};
|
|
797518
797543
|
return {
|
|
797519
797544
|
file,
|
|
797520
797545
|
options: {
|
|
797521
|
-
format:
|
|
797546
|
+
format: format5 === "md" || format5 === "mdx" ? format5 : file.extname && (rest2.mdExtensions || md).includes(file.extname) ? "md" : "mdx",
|
|
797522
797547
|
...rest2
|
|
797523
797548
|
}
|
|
797524
797549
|
};
|
|
@@ -802427,7 +802452,7 @@ async function previewDocsWorkspace({
|
|
|
802427
802452
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
802428
802453
|
var import_fiddle_sdk5 = __toESM(require_node());
|
|
802429
802454
|
var import_axios8 = __toESM(require_axios2());
|
|
802430
|
-
var
|
|
802455
|
+
var import_promises41 = require("fs/promises");
|
|
802431
802456
|
var import_path36 = __toESM(require("path"));
|
|
802432
802457
|
var import_tar2 = __toESM(require_tar());
|
|
802433
802458
|
var import_tmp_promise8 = __toESM(require_tmp_promise());
|
|
@@ -802476,7 +802501,7 @@ async function registerWorkspacesV1({
|
|
|
802476
802501
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
802477
802502
|
await import_tar2.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
|
|
802478
802503
|
context.logger.info("Uploading definition...");
|
|
802479
|
-
await import_axios8.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
802504
|
+
await import_axios8.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises41.readFile)(tarPath));
|
|
802480
802505
|
context.logger.info(
|
|
802481
802506
|
`Registered @${project.config.organization}/${workspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
802482
802507
|
);
|
|
@@ -802539,17 +802564,17 @@ async function generateToken({
|
|
|
802539
802564
|
}
|
|
802540
802565
|
|
|
802541
802566
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
802542
|
-
var
|
|
802567
|
+
var import_promises44 = require("fs/promises");
|
|
802543
802568
|
|
|
802544
802569
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
802545
|
-
var
|
|
802570
|
+
var import_promises42 = require("fs/promises");
|
|
802546
802571
|
var FERN_DIRECTORY2 = "fern";
|
|
802547
802572
|
async function loadWorkspaces(context) {
|
|
802548
802573
|
const fernDirectory = await getFernDirectory2();
|
|
802549
802574
|
if (fernDirectory == null) {
|
|
802550
802575
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
802551
802576
|
}
|
|
802552
|
-
const fernDirectoryContents = await (0,
|
|
802577
|
+
const fernDirectoryContents = await (0, import_promises42.readdir)(fernDirectory, { withFileTypes: true });
|
|
802553
802578
|
return fernDirectoryContents.reduce((all4, item) => {
|
|
802554
802579
|
if (item.isDirectory()) {
|
|
802555
802580
|
all4.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -802584,7 +802609,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
802584
802609
|
}
|
|
802585
802610
|
|
|
802586
802611
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
802587
|
-
var
|
|
802612
|
+
var import_promises43 = require("fs/promises");
|
|
802588
802613
|
|
|
802589
802614
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
802590
802615
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -802607,7 +802632,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
802607
802632
|
|
|
802608
802633
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
802609
802634
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
802610
|
-
const contentsStr = await (0,
|
|
802635
|
+
const contentsStr = await (0, import_promises43.readFile)(absolutePathToGeneratorsConfiguration);
|
|
802611
802636
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
802612
802637
|
return await validateSchema({
|
|
802613
802638
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -802643,7 +802668,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
802643
802668
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
802644
802669
|
});
|
|
802645
802670
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
802646
|
-
await (0,
|
|
802671
|
+
await (0, import_promises44.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
802647
802672
|
}
|
|
802648
802673
|
function migrateConfiguration(oldConfiguration) {
|
|
802649
802674
|
return {
|
|
@@ -802669,7 +802694,7 @@ var versionMigrations = {
|
|
|
802669
802694
|
var __default = versionMigrations;
|
|
802670
802695
|
|
|
802671
802696
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
802672
|
-
var
|
|
802697
|
+
var import_promises45 = require("fs/promises");
|
|
802673
802698
|
|
|
802674
802699
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
802675
802700
|
var import_glob_promise2 = __toESM(require_lib6());
|
|
@@ -802703,7 +802728,7 @@ var migration2 = {
|
|
|
802703
802728
|
try {
|
|
802704
802729
|
const fileContents = await getFileContents(yamlFilepath);
|
|
802705
802730
|
const newContents = addDiscriminantToFile(fileContents);
|
|
802706
|
-
await (0,
|
|
802731
|
+
await (0, import_promises45.writeFile)(yamlFilepath, newContents);
|
|
802707
802732
|
} catch (error) {
|
|
802708
802733
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
802709
802734
|
}
|
|
@@ -802711,7 +802736,7 @@ var migration2 = {
|
|
|
802711
802736
|
}
|
|
802712
802737
|
};
|
|
802713
802738
|
async function getFileContents(filepath) {
|
|
802714
|
-
const buffer3 = await (0,
|
|
802739
|
+
const buffer3 = await (0, import_promises45.readFile)(filepath);
|
|
802715
802740
|
return buffer3.toString();
|
|
802716
802741
|
}
|
|
802717
802742
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -802740,7 +802765,7 @@ var versionMigrations2 = {
|
|
|
802740
802765
|
var __default2 = versionMigrations2;
|
|
802741
802766
|
|
|
802742
802767
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
802743
|
-
var
|
|
802768
|
+
var import_promises46 = require("fs/promises");
|
|
802744
802769
|
var import_yaml = __toESM(require_dist4());
|
|
802745
802770
|
|
|
802746
802771
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -802781,7 +802806,7 @@ var migration3 = {
|
|
|
802781
802806
|
}
|
|
802782
802807
|
};
|
|
802783
802808
|
async function migrateFile(filepath, context) {
|
|
802784
|
-
const contents = await (0,
|
|
802809
|
+
const contents = await (0, import_promises46.readFile)(filepath);
|
|
802785
802810
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
802786
802811
|
const types4 = parsedDocument.get("types");
|
|
802787
802812
|
if (types4 == null) {
|
|
@@ -802813,7 +802838,7 @@ async function migrateFile(filepath, context) {
|
|
|
802813
802838
|
}
|
|
802814
802839
|
}
|
|
802815
802840
|
}
|
|
802816
|
-
await (0,
|
|
802841
|
+
await (0, import_promises46.writeFile)(filepath, parsedDocument.toString());
|
|
802817
802842
|
}
|
|
802818
802843
|
|
|
802819
802844
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -802824,7 +802849,7 @@ var versionMigrations3 = {
|
|
|
802824
802849
|
var __default3 = versionMigrations3;
|
|
802825
802850
|
|
|
802826
802851
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
802827
|
-
var
|
|
802852
|
+
var import_promises47 = require("fs/promises");
|
|
802828
802853
|
var import_yaml2 = __toESM(require_dist4());
|
|
802829
802854
|
|
|
802830
802855
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -802865,7 +802890,7 @@ var migration4 = {
|
|
|
802865
802890
|
}
|
|
802866
802891
|
};
|
|
802867
802892
|
async function migrateGeneratorsYml(filepath, context) {
|
|
802868
|
-
const contents = await (0,
|
|
802893
|
+
const contents = await (0, import_promises47.readFile)(filepath);
|
|
802869
802894
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
802870
802895
|
const draftGenerators = parsedDocument.get("draft");
|
|
802871
802896
|
if (draftGenerators == null) {
|
|
@@ -802892,7 +802917,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
802892
802917
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
802893
802918
|
}
|
|
802894
802919
|
});
|
|
802895
|
-
await (0,
|
|
802920
|
+
await (0, import_promises47.writeFile)(filepath, parsedDocument.toString());
|
|
802896
802921
|
}
|
|
802897
802922
|
|
|
802898
802923
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -802903,7 +802928,7 @@ var versionMigrations4 = {
|
|
|
802903
802928
|
var __default4 = versionMigrations4;
|
|
802904
802929
|
|
|
802905
802930
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
802906
|
-
var
|
|
802931
|
+
var import_promises48 = require("fs/promises");
|
|
802907
802932
|
var import_yaml3 = __toESM(require_dist4());
|
|
802908
802933
|
|
|
802909
802934
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -802944,7 +802969,7 @@ var migration5 = {
|
|
|
802944
802969
|
}
|
|
802945
802970
|
};
|
|
802946
802971
|
async function migrateFile2(filepath, context) {
|
|
802947
|
-
const contents = await (0,
|
|
802972
|
+
const contents = await (0, import_promises48.readFile)(filepath);
|
|
802948
802973
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
802949
802974
|
const addType = (typeName, typeDeclaration) => {
|
|
802950
802975
|
const types4 = parsedDocument.get("types");
|
|
@@ -802988,7 +803013,7 @@ async function migrateFile2(filepath, context) {
|
|
|
802988
803013
|
}
|
|
802989
803014
|
}
|
|
802990
803015
|
}
|
|
802991
|
-
await (0,
|
|
803016
|
+
await (0, import_promises48.writeFile)(filepath, parsedDocument.toString());
|
|
802992
803017
|
}
|
|
802993
803018
|
|
|
802994
803019
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -802999,7 +803024,7 @@ var versionMigrations5 = {
|
|
|
802999
803024
|
var __default5 = versionMigrations5;
|
|
803000
803025
|
|
|
803001
803026
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
803002
|
-
var
|
|
803027
|
+
var import_promises49 = require("fs/promises");
|
|
803003
803028
|
var import_yaml4 = __toESM(require_dist4());
|
|
803004
803029
|
|
|
803005
803030
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -803040,7 +803065,7 @@ var migration6 = {
|
|
|
803040
803065
|
}
|
|
803041
803066
|
};
|
|
803042
803067
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
803043
|
-
const contents = await (0,
|
|
803068
|
+
const contents = await (0, import_promises49.readFile)(filepath);
|
|
803044
803069
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
803045
803070
|
const releaseGenerators = parsedDocument.get("release");
|
|
803046
803071
|
if (releaseGenerators == null) {
|
|
@@ -803078,7 +803103,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
803078
803103
|
}
|
|
803079
803104
|
releaseGenerator.delete("outputs");
|
|
803080
803105
|
});
|
|
803081
|
-
await (0,
|
|
803106
|
+
await (0, import_promises49.writeFile)(filepath, parsedDocument.toString());
|
|
803082
803107
|
}
|
|
803083
803108
|
|
|
803084
803109
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -803089,7 +803114,7 @@ var versionMigrations6 = {
|
|
|
803089
803114
|
var __default6 = versionMigrations6;
|
|
803090
803115
|
|
|
803091
803116
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
803092
|
-
var
|
|
803117
|
+
var import_promises50 = require("fs/promises");
|
|
803093
803118
|
|
|
803094
803119
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
803095
803120
|
var import_glob_promise7 = __toESM(require_lib6());
|
|
@@ -803120,9 +803145,9 @@ var migration7 = {
|
|
|
803120
803145
|
run: async ({ context }) => {
|
|
803121
803146
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
803122
803147
|
for (const filepath of yamlFiles) {
|
|
803123
|
-
const contents = await (0,
|
|
803148
|
+
const contents = await (0, import_promises50.readFile)(filepath);
|
|
803124
803149
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
803125
|
-
await (0,
|
|
803150
|
+
await (0, import_promises50.writeFile)(filepath, newContents);
|
|
803126
803151
|
}
|
|
803127
803152
|
}
|
|
803128
803153
|
};
|
|
@@ -803135,7 +803160,7 @@ var versionMigrations7 = {
|
|
|
803135
803160
|
var __default7 = versionMigrations7;
|
|
803136
803161
|
|
|
803137
803162
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
803138
|
-
var
|
|
803163
|
+
var import_promises51 = require("fs/promises");
|
|
803139
803164
|
|
|
803140
803165
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
803141
803166
|
var import_glob_promise8 = __toESM(require_lib6());
|
|
@@ -803166,9 +803191,9 @@ var migration8 = {
|
|
|
803166
803191
|
run: async ({ context }) => {
|
|
803167
803192
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
803168
803193
|
for (const filepath of yamlFiles) {
|
|
803169
|
-
const contents = await (0,
|
|
803194
|
+
const contents = await (0, import_promises51.readFile)(filepath);
|
|
803170
803195
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
803171
|
-
await (0,
|
|
803196
|
+
await (0, import_promises51.writeFile)(filepath, newContents);
|
|
803172
803197
|
}
|
|
803173
803198
|
}
|
|
803174
803199
|
};
|
|
@@ -803181,7 +803206,7 @@ var versionMigrations8 = {
|
|
|
803181
803206
|
var __default8 = versionMigrations8;
|
|
803182
803207
|
|
|
803183
803208
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
803184
|
-
var
|
|
803209
|
+
var import_promises52 = require("fs/promises");
|
|
803185
803210
|
|
|
803186
803211
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
803187
803212
|
var import_glob_promise9 = __toESM(require_lib6());
|
|
@@ -803288,7 +803313,7 @@ var migration9 = {
|
|
|
803288
803313
|
}
|
|
803289
803314
|
};
|
|
803290
803315
|
async function migrateGeneratorsYml3(filepath) {
|
|
803291
|
-
const contentsStr = await (0,
|
|
803316
|
+
const contentsStr = await (0, import_promises52.readFile)(filepath);
|
|
803292
803317
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
803293
803318
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
803294
803319
|
let newGeneratorsConfiguration = {};
|
|
@@ -803306,7 +803331,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
803306
803331
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
803307
803332
|
};
|
|
803308
803333
|
}
|
|
803309
|
-
await (0,
|
|
803334
|
+
await (0, import_promises52.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
803310
803335
|
}
|
|
803311
803336
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
803312
803337
|
const newSchema = {
|
|
@@ -803381,7 +803406,7 @@ var versionMigrations9 = {
|
|
|
803381
803406
|
var __default9 = versionMigrations9;
|
|
803382
803407
|
|
|
803383
803408
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
803384
|
-
var
|
|
803409
|
+
var import_promises53 = require("fs/promises");
|
|
803385
803410
|
var import_yaml5 = __toESM(require_dist4());
|
|
803386
803411
|
|
|
803387
803412
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -803422,7 +803447,7 @@ var migration10 = {
|
|
|
803422
803447
|
}
|
|
803423
803448
|
};
|
|
803424
803449
|
async function migrateRootApiFile(filepath) {
|
|
803425
|
-
const contents = await (0,
|
|
803450
|
+
const contents = await (0, import_promises53.readFile)(filepath);
|
|
803426
803451
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
803427
803452
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
803428
803453
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -803433,7 +803458,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
803433
803458
|
"property-name": errorDiscriminant.value
|
|
803434
803459
|
});
|
|
803435
803460
|
parsedDocument.delete("error-discriminant");
|
|
803436
|
-
await (0,
|
|
803461
|
+
await (0, import_promises53.writeFile)(filepath, parsedDocument.toString());
|
|
803437
803462
|
}
|
|
803438
803463
|
|
|
803439
803464
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -803444,7 +803469,7 @@ var versionMigrations10 = {
|
|
|
803444
803469
|
var __default10 = versionMigrations10;
|
|
803445
803470
|
|
|
803446
803471
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
803447
|
-
var
|
|
803472
|
+
var import_promises54 = require("fs/promises");
|
|
803448
803473
|
var import_yaml6 = __toESM(require_dist4());
|
|
803449
803474
|
|
|
803450
803475
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -803485,7 +803510,7 @@ var migration11 = {
|
|
|
803485
803510
|
}
|
|
803486
803511
|
};
|
|
803487
803512
|
async function migrateYamlFile(filepath, context) {
|
|
803488
|
-
const contents = await (0,
|
|
803513
|
+
const contents = await (0, import_promises54.readFile)(filepath);
|
|
803489
803514
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
803490
803515
|
const services = parsedDocument.get("services");
|
|
803491
803516
|
if (services == null) {
|
|
@@ -803525,7 +803550,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
803525
803550
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
803526
803551
|
}
|
|
803527
803552
|
}
|
|
803528
|
-
await (0,
|
|
803553
|
+
await (0, import_promises54.writeFile)(filepath, parsedDocument.toString());
|
|
803529
803554
|
}
|
|
803530
803555
|
}
|
|
803531
803556
|
function convertEndpoint13({ document: document4, endpoint }) {
|
|
@@ -803609,10 +803634,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
803609
803634
|
var LegacyDocsSerializers = __toESM(require_serialization14());
|
|
803610
803635
|
|
|
803611
803636
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
803612
|
-
var
|
|
803637
|
+
var import_promises55 = require("fs/promises");
|
|
803613
803638
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
803614
803639
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803615
|
-
const contentsStr = await (0,
|
|
803640
|
+
const contentsStr = await (0, import_promises55.readFile)(filepath);
|
|
803616
803641
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
803617
803642
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
803618
803643
|
if (result2.ok) {
|
|
@@ -803630,7 +803655,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
803630
803655
|
}
|
|
803631
803656
|
|
|
803632
803657
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
803633
|
-
var
|
|
803658
|
+
var import_promises57 = require("fs/promises");
|
|
803634
803659
|
|
|
803635
803660
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
803636
803661
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -803809,10 +803834,10 @@ __export(legacy_exports, {
|
|
|
803809
803834
|
});
|
|
803810
803835
|
|
|
803811
803836
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
803812
|
-
var
|
|
803837
|
+
var import_promises56 = require("fs/promises");
|
|
803813
803838
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
803814
803839
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
803815
|
-
const contentsStr = await (0,
|
|
803840
|
+
const contentsStr = await (0, import_promises56.readFile)(filepath);
|
|
803816
803841
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
803817
803842
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
803818
803843
|
if (result2.success) {
|
|
@@ -803919,7 +803944,7 @@ var GeneratorsConfigurationSchema5 = z.strictObject({
|
|
|
803919
803944
|
var APIS_DIRECTORY2 = "apis";
|
|
803920
803945
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
803921
803946
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
803922
|
-
await (0,
|
|
803947
|
+
await (0, import_promises57.mkdir)(absolutePathToApisDirectory);
|
|
803923
803948
|
for (const workspace of workspaces) {
|
|
803924
803949
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
803925
803950
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -803927,11 +803952,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
803927
803952
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
803928
803953
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
803929
803954
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
803930
|
-
await (0,
|
|
803955
|
+
await (0, import_promises57.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
803931
803956
|
}
|
|
803932
803957
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
803933
803958
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
803934
|
-
await (0,
|
|
803959
|
+
await (0, import_promises57.rm)(absolutePathToWorkspace, { recursive: true });
|
|
803935
803960
|
}
|
|
803936
803961
|
}
|
|
803937
803962
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -803944,7 +803969,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
803944
803969
|
generatorsConfiguration,
|
|
803945
803970
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
803946
803971
|
});
|
|
803947
|
-
await (0,
|
|
803972
|
+
await (0, import_promises57.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
803948
803973
|
return convertedResponse.docsURLs;
|
|
803949
803974
|
}
|
|
803950
803975
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -803958,19 +803983,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
803958
803983
|
apiName
|
|
803959
803984
|
});
|
|
803960
803985
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803961
|
-
await (0,
|
|
803986
|
+
await (0, import_promises57.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
803962
803987
|
}
|
|
803963
803988
|
|
|
803964
803989
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
803965
|
-
var
|
|
803990
|
+
var import_promises58 = require("fs/promises");
|
|
803966
803991
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
803967
803992
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
803968
803993
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
803969
803994
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
803970
803995
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
803971
803996
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
803972
|
-
await (0,
|
|
803973
|
-
await (0,
|
|
803997
|
+
await (0, import_promises58.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
803998
|
+
await (0, import_promises58.rm)(absolutePathToWorkspace, { recursive: true });
|
|
803974
803999
|
}
|
|
803975
804000
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
803976
804001
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -803983,7 +804008,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
803983
804008
|
apiName: void 0
|
|
803984
804009
|
});
|
|
803985
804010
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803986
|
-
await (0,
|
|
804011
|
+
await (0, import_promises58.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
803987
804012
|
}
|
|
803988
804013
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
803989
804014
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -803995,22 +804020,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
803995
804020
|
generatorsConfiguration,
|
|
803996
804021
|
pathModificationStrategy: "MoveUp"
|
|
803997
804022
|
});
|
|
803998
|
-
await (0,
|
|
804023
|
+
await (0, import_promises58.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
803999
804024
|
return convertedResponse.docsURLs;
|
|
804000
804025
|
}
|
|
804001
804026
|
|
|
804002
804027
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
804003
|
-
var
|
|
804028
|
+
var import_promises59 = require("fs/promises");
|
|
804004
804029
|
var APIS_DIRECTORY3 = "apis";
|
|
804005
804030
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
804006
804031
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
804007
|
-
await (0,
|
|
804032
|
+
await (0, import_promises59.mkdir)(absolutePathToApisDirectory);
|
|
804008
804033
|
for (const workspace of workspaces) {
|
|
804009
804034
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
804010
804035
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
804011
804036
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
804012
804037
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
804013
|
-
await (0,
|
|
804038
|
+
await (0, import_promises59.rm)(absolutePathToWorkspace, { recursive: true });
|
|
804014
804039
|
}
|
|
804015
804040
|
}
|
|
804016
804041
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -804023,15 +804048,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
804023
804048
|
generatorsConfiguration,
|
|
804024
804049
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
804025
804050
|
});
|
|
804026
|
-
await (0,
|
|
804051
|
+
await (0, import_promises59.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
804027
804052
|
}
|
|
804028
804053
|
|
|
804029
804054
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
804030
|
-
var
|
|
804055
|
+
var import_promises60 = require("fs/promises");
|
|
804031
804056
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
804032
804057
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
804033
804058
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
804034
|
-
await (0,
|
|
804059
|
+
await (0, import_promises60.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
804035
804060
|
}
|
|
804036
804061
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
804037
804062
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -804043,7 +804068,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
804043
804068
|
generatorsConfiguration,
|
|
804044
804069
|
pathModificationStrategy: "MoveUp"
|
|
804045
804070
|
});
|
|
804046
|
-
await (0,
|
|
804071
|
+
await (0, import_promises60.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
804047
804072
|
}
|
|
804048
804073
|
|
|
804049
804074
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -804120,7 +804145,7 @@ var versionMigrations12 = {
|
|
|
804120
804145
|
var __default12 = versionMigrations12;
|
|
804121
804146
|
|
|
804122
804147
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
804123
|
-
var
|
|
804148
|
+
var import_promises61 = require("fs/promises");
|
|
804124
804149
|
var import_yaml7 = __toESM(require_dist4());
|
|
804125
804150
|
|
|
804126
804151
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -804161,7 +804186,7 @@ var migration13 = {
|
|
|
804161
804186
|
}
|
|
804162
804187
|
};
|
|
804163
804188
|
async function migrateYamlFile2(filepath, context) {
|
|
804164
|
-
const contents = await (0,
|
|
804189
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
804165
804190
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
804166
804191
|
const types4 = parsedDocument.get("types");
|
|
804167
804192
|
if (types4 == null) {
|
|
@@ -804187,7 +804212,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
804187
804212
|
examples.set(i2, { value });
|
|
804188
804213
|
}
|
|
804189
804214
|
}
|
|
804190
|
-
await (0,
|
|
804215
|
+
await (0, import_promises61.writeFile)(filepath, parsedDocument.toString());
|
|
804191
804216
|
}
|
|
804192
804217
|
|
|
804193
804218
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -804198,7 +804223,7 @@ var versionMigrations13 = {
|
|
|
804198
804223
|
var __default13 = versionMigrations13;
|
|
804199
804224
|
|
|
804200
804225
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
804201
|
-
var
|
|
804226
|
+
var import_promises62 = require("fs/promises");
|
|
804202
804227
|
var import_yaml8 = __toESM(require_dist4());
|
|
804203
804228
|
|
|
804204
804229
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -804239,7 +804264,7 @@ var migration14 = {
|
|
|
804239
804264
|
}
|
|
804240
804265
|
};
|
|
804241
804266
|
async function migrateYamlFile3(filepath, context) {
|
|
804242
|
-
const contents = await (0,
|
|
804267
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
804243
804268
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
804244
804269
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
804245
804270
|
return context.failAndThrow("File is not a map");
|
|
@@ -804269,7 +804294,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
804269
804294
|
pair.value = firstService.value;
|
|
804270
804295
|
}
|
|
804271
804296
|
}
|
|
804272
|
-
await (0,
|
|
804297
|
+
await (0, import_promises62.writeFile)(filepath, parsedDocument.toString());
|
|
804273
804298
|
}
|
|
804274
804299
|
|
|
804275
804300
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -804280,7 +804305,7 @@ var versionMigrations14 = {
|
|
|
804280
804305
|
var __default14 = versionMigrations14;
|
|
804281
804306
|
|
|
804282
804307
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
804283
|
-
var
|
|
804308
|
+
var import_promises63 = require("fs/promises");
|
|
804284
804309
|
var import_yaml9 = __toESM(require_dist4());
|
|
804285
804310
|
|
|
804286
804311
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -804321,7 +804346,7 @@ var migration15 = {
|
|
|
804321
804346
|
}
|
|
804322
804347
|
};
|
|
804323
804348
|
async function migrateYamlFile4(filepath, context) {
|
|
804324
|
-
const contents = await (0,
|
|
804349
|
+
const contents = await (0, import_promises63.readFile)(filepath);
|
|
804325
804350
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
804326
804351
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
804327
804352
|
return context.failAndThrow("File is not a map");
|
|
@@ -804340,7 +804365,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
804340
804365
|
}
|
|
804341
804366
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
804342
804367
|
parsedDocument.contents.items.unshift(docsPair);
|
|
804343
|
-
await (0,
|
|
804368
|
+
await (0, import_promises63.writeFile)(filepath, parsedDocument.toString());
|
|
804344
804369
|
}
|
|
804345
804370
|
|
|
804346
804371
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -804351,7 +804376,7 @@ var versionMigrations15 = {
|
|
|
804351
804376
|
var __default15 = versionMigrations15;
|
|
804352
804377
|
|
|
804353
804378
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
804354
|
-
var
|
|
804379
|
+
var import_promises64 = require("fs/promises");
|
|
804355
804380
|
|
|
804356
804381
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
804357
804382
|
var import_glob_promise15 = __toESM(require_lib6());
|
|
@@ -804391,14 +804416,14 @@ var migration16 = {
|
|
|
804391
804416
|
}
|
|
804392
804417
|
};
|
|
804393
804418
|
async function migrateYamlFile5(filepath) {
|
|
804394
|
-
const contents = await (0,
|
|
804419
|
+
const contents = await (0, import_promises64.readFile)(filepath);
|
|
804395
804420
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
804396
804421
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
804397
804422
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
804398
804423
|
return `docs:
|
|
804399
804424
|
domain: "${domain2}.${domainSuffix}"`;
|
|
804400
804425
|
});
|
|
804401
|
-
await (0,
|
|
804426
|
+
await (0, import_promises64.writeFile)(filepath, updatedSnapshot.toString());
|
|
804402
804427
|
}
|
|
804403
804428
|
|
|
804404
804429
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -804500,7 +804525,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
804500
804525
|
}
|
|
804501
804526
|
|
|
804502
804527
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
804503
|
-
var
|
|
804528
|
+
var import_promises65 = require("fs/promises");
|
|
804504
804529
|
|
|
804505
804530
|
// pnp:/home/circleci/project/packages/cli/cli/src/cli-context/upgrade-utils/doesVersionOfCliExist.ts
|
|
804506
804531
|
async function doesVersionOfCliExist({
|
|
@@ -804607,7 +804632,7 @@ async function upgrade({
|
|
|
804607
804632
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
804608
804633
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
804609
804634
|
});
|
|
804610
|
-
await (0,
|
|
804635
|
+
await (0, import_promises65.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
804611
804636
|
cliContext.logger.info(
|
|
804612
804637
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
804613
804638
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -804655,7 +804680,7 @@ async function validateWorkspaces({
|
|
|
804655
804680
|
}
|
|
804656
804681
|
|
|
804657
804682
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
804658
|
-
var
|
|
804683
|
+
var import_promises66 = require("fs/promises");
|
|
804659
804684
|
async function writeDefinitionForWorkspaces({
|
|
804660
804685
|
project,
|
|
804661
804686
|
cliContext
|
|
@@ -804674,20 +804699,20 @@ async function writeDefinitionForWorkspaces({
|
|
|
804674
804699
|
}
|
|
804675
804700
|
async function writeDefinitionForWorkspace({ workspace, context }) {
|
|
804676
804701
|
const directoryOfDefinition = join(workspace.absoluteFilepath, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
804677
|
-
await (0,
|
|
804678
|
-
await (0,
|
|
804702
|
+
await (0, import_promises66.mkdir)(directoryOfDefinition);
|
|
804703
|
+
await (0, import_promises66.writeFile)(
|
|
804679
804704
|
join(directoryOfDefinition, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
804680
804705
|
js_yaml_default.dump(workspace.definition.rootApiFile.contents)
|
|
804681
804706
|
);
|
|
804682
804707
|
for (const [relativePath, definitionFile] of toPairs_default(workspace.definition.namedDefinitionFiles)) {
|
|
804683
804708
|
const absoluteFilepath = join(directoryOfDefinition, RelativeFilePath.of(relativePath));
|
|
804684
804709
|
let fileContents = js_yaml_default.dump(definitionFile.contents);
|
|
804685
|
-
fileContents = formatDefinitionFile({
|
|
804710
|
+
fileContents = await formatDefinitionFile({
|
|
804686
804711
|
fileContents: js_yaml_default.dump(definitionFile.contents)
|
|
804687
804712
|
});
|
|
804688
804713
|
const dirname5 = absoluteFilepath.split("/").slice(0, -1).join("/");
|
|
804689
|
-
await (0,
|
|
804690
|
-
await (0,
|
|
804714
|
+
await (0, import_promises66.mkdir)(dirname5, { recursive: true });
|
|
804715
|
+
await (0, import_promises66.writeFile)(absoluteFilepath, fileContents);
|
|
804691
804716
|
}
|
|
804692
804717
|
context.logger.info(source_default.green(`Wrote definition to ${directoryOfDefinition}`));
|
|
804693
804718
|
}
|