fern-api 0.16.11 → 0.16.12-rc1
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 +337 -307
- 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-rc1",
|
|
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-rc1",
|
|
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
|
}
|
|
@@ -750109,7 +750113,7 @@ function buildFernDefinition(context) {
|
|
|
750109
750113
|
const typeDeclaration = buildTypeDeclaration({ schema: schema2, context, declarationFile });
|
|
750110
750114
|
if (isRawAliasDefinition(typeDeclaration.schema)) {
|
|
750111
750115
|
const aliasType = getTypeFromTypeReference(typeDeclaration.schema);
|
|
750112
|
-
if (typeDeclaration.name ===
|
|
750116
|
+
if (aliasType === (typeDeclaration.name ?? id) || aliasType === `optional<${typeDeclaration.name ?? id}>`) {
|
|
750113
750117
|
continue;
|
|
750114
750118
|
}
|
|
750115
750119
|
}
|
|
@@ -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
|
|
@@ -751735,14 +751739,19 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
751735
751739
|
groupName
|
|
751736
751740
|
});
|
|
751737
751741
|
}
|
|
751742
|
+
const hasNullValue = schema2.oneOf.filter((schema3) => {
|
|
751743
|
+
return !isReferenceObject(schema3) && schema3.type === "null";
|
|
751744
|
+
}).length > 0;
|
|
751738
751745
|
return convertUndiscriminatedOneOf({
|
|
751739
751746
|
nameOverride,
|
|
751740
751747
|
generatedName,
|
|
751741
751748
|
breadcrumbs,
|
|
751742
751749
|
description,
|
|
751743
|
-
wrapAsNullable,
|
|
751750
|
+
wrapAsNullable: wrapAsNullable || hasNullValue,
|
|
751744
751751
|
context,
|
|
751745
|
-
subtypes: schema2.oneOf
|
|
751752
|
+
subtypes: schema2.oneOf.filter((schema3) => {
|
|
751753
|
+
return isReferenceObject(schema3) || schema3.type !== "null";
|
|
751754
|
+
}),
|
|
751746
751755
|
groupName
|
|
751747
751756
|
});
|
|
751748
751757
|
}
|
|
@@ -761217,10 +761226,10 @@ var CliContext = class {
|
|
|
761217
761226
|
return "fern-api";
|
|
761218
761227
|
}
|
|
761219
761228
|
getPackageVersion() {
|
|
761220
|
-
if ("0.16.
|
|
761229
|
+
if ("0.16.12-rc1" == null) {
|
|
761221
761230
|
this.logger.error("CLI_VERSION is not defined");
|
|
761222
761231
|
}
|
|
761223
|
-
return "0.16.
|
|
761232
|
+
return "0.16.12-rc1";
|
|
761224
761233
|
}
|
|
761225
761234
|
getCliName() {
|
|
761226
761235
|
if ("fern" == null) {
|
|
@@ -762621,16 +762630,33 @@ var import_api3 = __toESM(require_api4());
|
|
|
762621
762630
|
|
|
762622
762631
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertDeclaration.js
|
|
762623
762632
|
var import_api2 = __toESM(require_api4());
|
|
762633
|
+
|
|
762634
|
+
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/formatDocs.js
|
|
762635
|
+
var prettier2 = __toESM(require_prettier());
|
|
762636
|
+
async function formatDocs(docs) {
|
|
762637
|
+
if (docs != null) {
|
|
762638
|
+
const formattedDocs = prettier2.format(docs, {
|
|
762639
|
+
parser: "markdown"
|
|
762640
|
+
});
|
|
762641
|
+
if (formattedDocs.endsWith("\n") || formattedDocs.endsWith("\r")) {
|
|
762642
|
+
return formattedDocs.substring(0, formattedDocs.length - 1);
|
|
762643
|
+
}
|
|
762644
|
+
return formattedDocs;
|
|
762645
|
+
}
|
|
762646
|
+
return docs;
|
|
762647
|
+
}
|
|
762648
|
+
|
|
762649
|
+
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertDeclaration.js
|
|
762624
762650
|
var DEFAULT_DECLARATION = {
|
|
762625
762651
|
docs: void 0,
|
|
762626
762652
|
availability: void 0
|
|
762627
762653
|
};
|
|
762628
|
-
function convertDeclaration(declaration) {
|
|
762654
|
+
async function convertDeclaration(declaration) {
|
|
762629
762655
|
if (typeof declaration === "string") {
|
|
762630
762656
|
return DEFAULT_DECLARATION;
|
|
762631
762657
|
}
|
|
762632
762658
|
return {
|
|
762633
|
-
docs: declaration.docs,
|
|
762659
|
+
docs: await formatDocs(declaration.docs),
|
|
762634
762660
|
availability: convertAvailability(declaration.availability)
|
|
762635
762661
|
};
|
|
762636
762662
|
}
|
|
@@ -762665,24 +762691,24 @@ function convertAvailabilityStatus(status) {
|
|
|
762665
762691
|
}
|
|
762666
762692
|
|
|
762667
762693
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertObjectTypeDeclaration.js
|
|
762668
|
-
function convertObjectTypeDeclaration({ object, file }) {
|
|
762694
|
+
async function convertObjectTypeDeclaration({ object, file }) {
|
|
762669
762695
|
return import_api3.Type.object({
|
|
762670
762696
|
extends: getExtensionsAsList(object.extends).map((extended) => parseTypeName({ typeName: extended, file })),
|
|
762671
|
-
properties: getObjectPropertiesFromRawObjectSchema(object, file)
|
|
762697
|
+
properties: await getObjectPropertiesFromRawObjectSchema(object, file)
|
|
762672
762698
|
});
|
|
762673
762699
|
}
|
|
762674
|
-
function getObjectPropertiesFromRawObjectSchema(object, file) {
|
|
762700
|
+
async function getObjectPropertiesFromRawObjectSchema(object, file) {
|
|
762675
762701
|
if (object.properties == null) {
|
|
762676
762702
|
return [];
|
|
762677
762703
|
}
|
|
762678
|
-
return Object.entries(object.properties).map(([propertyKey, propertyDefinition]) => ({
|
|
762679
|
-
...convertDeclaration(propertyDefinition),
|
|
762704
|
+
return await Promise.all(Object.entries(object.properties).map(async ([propertyKey, propertyDefinition]) => ({
|
|
762705
|
+
...await convertDeclaration(propertyDefinition),
|
|
762680
762706
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
762681
762707
|
wireValue: propertyKey,
|
|
762682
762708
|
name: getPropertyName({ propertyKey, property: propertyDefinition }).name
|
|
762683
762709
|
}),
|
|
762684
762710
|
valueType: file.parseTypeReference(propertyDefinition)
|
|
762685
|
-
}));
|
|
762711
|
+
})));
|
|
762686
762712
|
}
|
|
762687
762713
|
function getExtensionsAsList(extensions) {
|
|
762688
762714
|
if (extensions == null) {
|
|
@@ -763221,7 +763247,7 @@ function getDocs(field) {
|
|
|
763221
763247
|
|
|
763222
763248
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertDiscriminatedUnionTypeDeclaration.js
|
|
763223
763249
|
var DEFAULT_UNION_VALUE_PROPERTY_VALUE = "value";
|
|
763224
|
-
function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }) {
|
|
763250
|
+
async function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }) {
|
|
763225
763251
|
const discriminant = getUnionDiscriminant(union2);
|
|
763226
763252
|
return import_api7.Type.union({
|
|
763227
763253
|
discriminant: file.casingsGenerator.generateNameAndWireValue({
|
|
@@ -763229,14 +763255,14 @@ function convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeRes
|
|
|
763229
763255
|
name: getUnionDiscriminantName(union2).name
|
|
763230
763256
|
}),
|
|
763231
763257
|
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),
|
|
763258
|
+
baseProperties: union2["base-properties"] != null ? await Promise.all(Object.entries(union2["base-properties"]).map(async ([propertyKey, propertyDefinition]) => ({
|
|
763259
|
+
...await convertDeclaration(propertyDefinition),
|
|
763234
763260
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
763235
763261
|
wireValue: propertyKey,
|
|
763236
763262
|
name: getPropertyName({ propertyKey, property: propertyDefinition }).name
|
|
763237
763263
|
}),
|
|
763238
763264
|
valueType: file.parseTypeReference(propertyDefinition)
|
|
763239
|
-
})) : [],
|
|
763265
|
+
}))) : [],
|
|
763240
763266
|
types: Object.entries(union2.union).map(([unionKey, rawSingleUnionType]) => {
|
|
763241
763267
|
const rawType = typeof rawSingleUnionType === "string" ? rawSingleUnionType : typeof rawSingleUnionType.type === "string" ? rawSingleUnionType.type : void 0;
|
|
763242
763268
|
const discriminantValue = file.casingsGenerator.generateNameAndWireValue({
|
|
@@ -763694,15 +763720,15 @@ function areLiteralTypesEquivalent({ expected, actual }) {
|
|
|
763694
763720
|
|
|
763695
763721
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertEnumTypeDeclaration.js
|
|
763696
763722
|
var import_api9 = __toESM(require_api4());
|
|
763697
|
-
function convertEnumTypeDeclaration({ _enum, file }) {
|
|
763723
|
+
async function convertEnumTypeDeclaration({ _enum, file }) {
|
|
763698
763724
|
return import_api9.Type.enum({
|
|
763699
|
-
values: _enum.enum.map((value) => ({
|
|
763700
|
-
...convertDeclaration(value),
|
|
763725
|
+
values: await Promise.all(_enum.enum.map(async (value) => ({
|
|
763726
|
+
...await convertDeclaration(value),
|
|
763701
763727
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
763702
763728
|
wireValue: typeof value === "string" ? value : value.value,
|
|
763703
763729
|
name: getEnumName(value).name
|
|
763704
763730
|
})
|
|
763705
|
-
}))
|
|
763731
|
+
})))
|
|
763706
763732
|
});
|
|
763707
763733
|
}
|
|
763708
763734
|
function getEnumName(enumValue) {
|
|
@@ -764468,7 +764494,7 @@ function buildUrl({ service, endpoint, example, pathParams }) {
|
|
|
764468
764494
|
|
|
764469
764495
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/services/convertHttpResponse.js
|
|
764470
764496
|
var import_api12 = __toESM(require_api4());
|
|
764471
|
-
function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
764497
|
+
async function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
764472
764498
|
const { response, ["response-stream"]: responseStream } = endpoint;
|
|
764473
764499
|
if (response != null) {
|
|
764474
764500
|
const docs = typeof response !== "string" ? response.docs : void 0;
|
|
@@ -764482,7 +764508,7 @@ function convertHttpResponse({ endpoint, file, typeResolver }) {
|
|
|
764482
764508
|
docs
|
|
764483
764509
|
});
|
|
764484
764510
|
} else {
|
|
764485
|
-
return convertJsonResponse(response, docs, file, typeResolver);
|
|
764511
|
+
return await convertJsonResponse(response, docs, file, typeResolver);
|
|
764486
764512
|
}
|
|
764487
764513
|
}
|
|
764488
764514
|
if (responseStream != null) {
|
|
@@ -764502,7 +764528,7 @@ function constructStreamingResponseChunkType(responseStream, file) {
|
|
|
764502
764528
|
return import_api12.StreamingResponseChunkType.json(file.parseTypeReference(typeReference));
|
|
764503
764529
|
}
|
|
764504
764530
|
}
|
|
764505
|
-
function convertJsonResponse(response, docs, file, typeResolver) {
|
|
764531
|
+
async function convertJsonResponse(response, docs, file, typeResolver) {
|
|
764506
764532
|
const responseBodyType = file.parseTypeReference(response);
|
|
764507
764533
|
const resolvedType = typeResolver.resolveTypeOrThrow({
|
|
764508
764534
|
type: typeof response !== "string" ? response.type : response,
|
|
@@ -764513,7 +764539,7 @@ function convertJsonResponse(response, docs, file, typeResolver) {
|
|
|
764513
764539
|
return import_api12.HttpResponse.json(import_api12.JsonResponse.nestedPropertyAsResponse({
|
|
764514
764540
|
docs,
|
|
764515
764541
|
responseBodyType,
|
|
764516
|
-
responseProperty: getObjectPropertyFromResolvedType(resolvedType, responseProperty, file, typeResolver)
|
|
764542
|
+
responseProperty: await getObjectPropertyFromResolvedType(resolvedType, responseProperty, file, typeResolver)
|
|
764517
764543
|
}));
|
|
764518
764544
|
}
|
|
764519
764545
|
return import_api12.HttpResponse.json(import_api12.JsonResponse.response({
|
|
@@ -764521,16 +764547,16 @@ function convertJsonResponse(response, docs, file, typeResolver) {
|
|
|
764521
764547
|
responseBodyType
|
|
764522
764548
|
}));
|
|
764523
764549
|
}
|
|
764524
|
-
function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeResolver) {
|
|
764550
|
+
async function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeResolver) {
|
|
764525
764551
|
switch (resolvedType._type) {
|
|
764526
764552
|
case "container":
|
|
764527
764553
|
if (resolvedType.container._type === "optional") {
|
|
764528
|
-
return getObjectPropertyFromResolvedType(resolvedType.container.itemType, property2, file, typeResolver);
|
|
764554
|
+
return await getObjectPropertyFromResolvedType(resolvedType.container.itemType, property2, file, typeResolver);
|
|
764529
764555
|
}
|
|
764530
764556
|
break;
|
|
764531
764557
|
case "named":
|
|
764532
764558
|
if (isRawObjectDefinition2(resolvedType.declaration)) {
|
|
764533
|
-
return getObjectPropertyFromObjectSchema(resolvedType.declaration, property2, resolvedType.file, typeResolver);
|
|
764559
|
+
return await getObjectPropertyFromObjectSchema(resolvedType.declaration, property2, resolvedType.file, typeResolver);
|
|
764534
764560
|
}
|
|
764535
764561
|
break;
|
|
764536
764562
|
case "primitive":
|
|
@@ -764541,15 +764567,15 @@ function getObjectPropertyFromResolvedType(resolvedType, property2, file, typeRe
|
|
|
764541
764567
|
}
|
|
764542
764568
|
throw new Error("Internal error; response must be an object in order to return a property as a response");
|
|
764543
764569
|
}
|
|
764544
|
-
function getObjectPropertyFromObjectSchema(objectSchema, property2, file, typeResolver) {
|
|
764545
|
-
const properties = getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver);
|
|
764570
|
+
async function getObjectPropertyFromObjectSchema(objectSchema, property2, file, typeResolver) {
|
|
764571
|
+
const properties = await getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver);
|
|
764546
764572
|
const objectProperty = properties[property2];
|
|
764547
764573
|
if (objectProperty == null) {
|
|
764548
764574
|
throw new Error(`Response does not have a property named ${property2}.`);
|
|
764549
764575
|
}
|
|
764550
764576
|
return objectProperty;
|
|
764551
764577
|
}
|
|
764552
|
-
function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
764578
|
+
async function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
764553
764579
|
let extendedTypes = [];
|
|
764554
764580
|
if (typeof objectSchema.extends === "string") {
|
|
764555
764581
|
extendedTypes = [objectSchema.extends];
|
|
@@ -764558,24 +764584,24 @@ function getAllPropertiesForRawObjectSchema(objectSchema, file, typeResolver) {
|
|
|
764558
764584
|
}
|
|
764559
764585
|
const properties = {};
|
|
764560
764586
|
for (const extendedType of extendedTypes) {
|
|
764561
|
-
const extendedProperties = getAllPropertiesForExtendedType(extendedType, file, typeResolver);
|
|
764587
|
+
const extendedProperties = await getAllPropertiesForExtendedType(extendedType, file, typeResolver);
|
|
764562
764588
|
Object.entries(extendedProperties).map(([propertyKey, objectProperty]) => {
|
|
764563
764589
|
properties[propertyKey] = objectProperty;
|
|
764564
764590
|
});
|
|
764565
764591
|
}
|
|
764566
|
-
const objectProperties = getObjectPropertiesFromRawObjectSchema(objectSchema, file);
|
|
764592
|
+
const objectProperties = await getObjectPropertiesFromRawObjectSchema(objectSchema, file);
|
|
764567
764593
|
objectProperties.forEach((objectProperty) => {
|
|
764568
764594
|
properties[objectProperty.name.name.originalName] = objectProperty;
|
|
764569
764595
|
});
|
|
764570
764596
|
return properties;
|
|
764571
764597
|
}
|
|
764572
|
-
function getAllPropertiesForExtendedType(extendedType, file, typeResolver) {
|
|
764598
|
+
async function getAllPropertiesForExtendedType(extendedType, file, typeResolver) {
|
|
764573
764599
|
const resolvedType = typeResolver.resolveNamedTypeOrThrow({
|
|
764574
764600
|
referenceToNamedType: extendedType,
|
|
764575
764601
|
file
|
|
764576
764602
|
});
|
|
764577
764603
|
if (resolvedType._type === "named" && isRawObjectDefinition2(resolvedType.declaration)) {
|
|
764578
|
-
return getAllPropertiesForRawObjectSchema(resolvedType.declaration, file, typeResolver);
|
|
764604
|
+
return await getAllPropertiesForRawObjectSchema(resolvedType.declaration, file, typeResolver);
|
|
764579
764605
|
}
|
|
764580
764606
|
throw new Error(`Extended type ${extendedType} must be another named type`);
|
|
764581
764607
|
}
|
|
@@ -764599,8 +764625,8 @@ function convertResponseErrors2({ errors, file }) {
|
|
|
764599
764625
|
}
|
|
764600
764626
|
|
|
764601
764627
|
// 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({
|
|
764628
|
+
async function convertHttpService({ rootPathParameters, serviceDefinition, file, errorResolver, typeResolver, exampleResolver, variableResolver, globalErrors, workspace }) {
|
|
764629
|
+
const servicePathParameters = await convertPathParameters2({
|
|
764604
764630
|
pathParameters: serviceDefinition["path-parameters"],
|
|
764605
764631
|
location: import_api13.PathParameterLocation.Service,
|
|
764606
764632
|
file,
|
|
@@ -764612,18 +764638,18 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764612
764638
|
name: serviceName,
|
|
764613
764639
|
displayName: serviceDefinition["display-name"] ?? void 0,
|
|
764614
764640
|
basePath: constructHttpPath(serviceDefinition["base-path"]),
|
|
764615
|
-
headers: serviceDefinition.headers != null ? Object.entries(serviceDefinition.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
|
|
764641
|
+
headers: serviceDefinition.headers != null ? await Promise.all(Object.entries(serviceDefinition.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file }))) : [],
|
|
764616
764642
|
pathParameters: servicePathParameters,
|
|
764617
|
-
endpoints: Object.entries(serviceDefinition.endpoints).map(([endpointKey, endpoint]) => {
|
|
764643
|
+
endpoints: await Promise.all(Object.entries(serviceDefinition.endpoints).map(async ([endpointKey, endpoint]) => {
|
|
764618
764644
|
var _a2, _b2;
|
|
764619
|
-
const endpointPathParameters = convertPathParameters2({
|
|
764645
|
+
const endpointPathParameters = await convertPathParameters2({
|
|
764620
764646
|
pathParameters: endpoint["path-parameters"],
|
|
764621
764647
|
location: import_api13.PathParameterLocation.Endpoint,
|
|
764622
764648
|
file,
|
|
764623
764649
|
variableResolver
|
|
764624
764650
|
});
|
|
764625
764651
|
const httpEndpoint = {
|
|
764626
|
-
...convertDeclaration(endpoint),
|
|
764652
|
+
...await convertDeclaration(endpoint),
|
|
764627
764653
|
id: "",
|
|
764628
764654
|
name: file.casingsGenerator.generateName(endpointKey),
|
|
764629
764655
|
displayName: endpoint["display-name"],
|
|
@@ -764635,11 +764661,11 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764635
764661
|
fullPath: constructHttpPath(file.rootApiFile["base-path"] != null ? urlJoin(file.rootApiFile["base-path"], serviceDefinition["base-path"], endpoint.path) : urlJoin(serviceDefinition["base-path"], endpoint.path)),
|
|
764636
764662
|
pathParameters: endpointPathParameters,
|
|
764637
764663
|
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]) => {
|
|
764664
|
+
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
764665
|
const { name: name2 } = getQueryParameterName({ queryParameterKey, queryParameter });
|
|
764640
764666
|
const valueType = file.parseTypeReference(queryParameter);
|
|
764641
764667
|
return {
|
|
764642
|
-
...convertDeclaration(queryParameter),
|
|
764668
|
+
...await convertDeclaration(queryParameter),
|
|
764643
764669
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
764644
764670
|
wireValue: queryParameterKey,
|
|
764645
764671
|
name: name2
|
|
@@ -764647,8 +764673,8 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764647
764673
|
valueType,
|
|
764648
764674
|
allowMultiple: typeof queryParameter !== "string" && queryParameter["allow-multiple"] != null ? queryParameter["allow-multiple"] : false
|
|
764649
764675
|
};
|
|
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 })) : [],
|
|
764676
|
+
})) : [],
|
|
764677
|
+
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
764678
|
requestBody: convertHttpRequestBody({ request: endpoint.request, file }),
|
|
764653
764679
|
sdkRequest: convertHttpSdkRequest({
|
|
764654
764680
|
service: serviceDefinition,
|
|
@@ -764656,7 +764682,7 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764656
764682
|
file,
|
|
764657
764683
|
typeResolver
|
|
764658
764684
|
}),
|
|
764659
|
-
response: convertHttpResponse({ endpoint, file, typeResolver }),
|
|
764685
|
+
response: await convertHttpResponse({ endpoint, file, typeResolver }),
|
|
764660
764686
|
errors: [...convertResponseErrors2({ errors: endpoint.errors, file }), ...globalErrors],
|
|
764661
764687
|
examples: endpoint.examples != null ? endpoint.examples.map((example) => convertExampleEndpointCall2({
|
|
764662
764688
|
service: serviceDefinition,
|
|
@@ -764672,24 +764698,24 @@ function convertHttpService({ rootPathParameters, serviceDefinition, file, error
|
|
|
764672
764698
|
};
|
|
764673
764699
|
httpEndpoint.id = IdGenerator.generateEndpointId(serviceName, httpEndpoint);
|
|
764674
764700
|
return httpEndpoint;
|
|
764675
|
-
})
|
|
764701
|
+
}))
|
|
764676
764702
|
};
|
|
764677
764703
|
}
|
|
764678
|
-
function convertPathParameters2({ pathParameters, location: location2, file, variableResolver }) {
|
|
764704
|
+
async function convertPathParameters2({ pathParameters, location: location2, file, variableResolver }) {
|
|
764679
764705
|
if (pathParameters == null) {
|
|
764680
764706
|
return [];
|
|
764681
764707
|
}
|
|
764682
|
-
return Object.entries(pathParameters).map(([parameterName, parameter]) => convertPathParameter({
|
|
764708
|
+
return await Promise.all(Object.entries(pathParameters).map(([parameterName, parameter]) => convertPathParameter({
|
|
764683
764709
|
parameterName,
|
|
764684
764710
|
parameter,
|
|
764685
764711
|
location: location2,
|
|
764686
764712
|
file,
|
|
764687
764713
|
variableResolver
|
|
764688
|
-
}));
|
|
764714
|
+
})));
|
|
764689
764715
|
}
|
|
764690
|
-
function convertPathParameter({ parameterName, parameter, location: location2, file, variableResolver }) {
|
|
764716
|
+
async function convertPathParameter({ parameterName, parameter, location: location2, file, variableResolver }) {
|
|
764691
764717
|
return {
|
|
764692
|
-
...convertDeclaration(parameter),
|
|
764718
|
+
...await convertDeclaration(parameter),
|
|
764693
764719
|
name: file.casingsGenerator.generateName(parameterName),
|
|
764694
764720
|
valueType: getPathParameterType({ parameter, variableResolver, file }),
|
|
764695
764721
|
location: location2,
|
|
@@ -764758,10 +764784,10 @@ function convertHttpMethod2(method2) {
|
|
|
764758
764784
|
assertNever(method2);
|
|
764759
764785
|
}
|
|
764760
764786
|
}
|
|
764761
|
-
function convertHttpHeader({ headerKey, header, file }) {
|
|
764787
|
+
async function convertHttpHeader({ headerKey, header, file }) {
|
|
764762
764788
|
const { name: name2 } = getHeaderName2({ headerKey, header });
|
|
764763
764789
|
return {
|
|
764764
|
-
...convertDeclaration(header),
|
|
764790
|
+
...await convertDeclaration(header),
|
|
764765
764791
|
name: file.casingsGenerator.generateNameAndWireValue({
|
|
764766
764792
|
wireValue: headerKey,
|
|
764767
764793
|
name: name2
|
|
@@ -765005,7 +765031,7 @@ function convertErrorDiscriminationStrategy(rawStrategy, file) {
|
|
|
765005
765031
|
|
|
765006
765032
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/converters/convertWebhookGroup.js
|
|
765007
765033
|
var import_api17 = __toESM(require_api4());
|
|
765008
|
-
function convertWebhookGroup2({ webhooks, file }) {
|
|
765034
|
+
async function convertWebhookGroup2({ webhooks, file }) {
|
|
765009
765035
|
const webhookGroup = [];
|
|
765010
765036
|
for (const [webhookId, webhook] of Object.entries(webhooks)) {
|
|
765011
765037
|
webhookGroup.push({
|
|
@@ -765014,7 +765040,7 @@ function convertWebhookGroup2({ webhooks, file }) {
|
|
|
765014
765040
|
docs: webhook.docs,
|
|
765015
765041
|
method: webhook.method,
|
|
765016
765042
|
name: file.casingsGenerator.generateName(webhookId),
|
|
765017
|
-
headers: webhook.headers != null ? Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
|
|
765043
|
+
headers: webhook.headers != null ? await Promise.all(Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file }))) : [],
|
|
765018
765044
|
payload: convertWebhookPayloadSchema({ payload: webhook.payload, file })
|
|
765019
765045
|
});
|
|
765020
765046
|
}
|
|
@@ -765188,8 +765214,8 @@ var SeenTypeNamesImpl = class {
|
|
|
765188
765214
|
};
|
|
765189
765215
|
|
|
765190
765216
|
// 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);
|
|
765217
|
+
async function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver, exampleResolver, workspace }) {
|
|
765218
|
+
const declaration = await convertDeclaration(typeDeclaration);
|
|
765193
765219
|
const declaredTypeName = parseTypeName({
|
|
765194
765220
|
typeName,
|
|
765195
765221
|
file
|
|
@@ -765199,7 +765225,7 @@ function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver,
|
|
|
765199
765225
|
typeDeclaration: {
|
|
765200
765226
|
...declaration,
|
|
765201
765227
|
name: declaredTypeName,
|
|
765202
|
-
shape: convertType({ typeDeclaration, file, typeResolver }),
|
|
765228
|
+
shape: await convertType({ typeDeclaration, file, typeResolver }),
|
|
765203
765229
|
referencedTypes: new Set(referencedTypes.map((referencedType) => referencedType.typeId)),
|
|
765204
765230
|
examples: typeof typeDeclaration !== "string" && typeDeclaration.examples != null ? typeDeclaration.examples.map((example) => ({
|
|
765205
765231
|
name: example.name != null ? file.casingsGenerator.generateName(example.name) : void 0,
|
|
@@ -765223,8 +765249,8 @@ function convertTypeDeclaration({ typeName, typeDeclaration, file, typeResolver,
|
|
|
765223
765249
|
descendantFilepaths: new Set(referencedTypes.map((referencedType) => referencedType.fernFilepath))
|
|
765224
765250
|
};
|
|
765225
765251
|
}
|
|
765226
|
-
function convertType({ typeDeclaration, file, typeResolver }) {
|
|
765227
|
-
return visitRawTypeDeclaration(typeDeclaration, {
|
|
765252
|
+
async function convertType({ typeDeclaration, file, typeResolver }) {
|
|
765253
|
+
return await visitRawTypeDeclaration(typeDeclaration, {
|
|
765228
765254
|
alias: (alias) => convertAliasTypeDeclaration({ alias, file, typeResolver }),
|
|
765229
765255
|
object: (object) => convertObjectTypeDeclaration({ object, file }),
|
|
765230
765256
|
discriminatedUnion: (union2) => convertDiscriminatedUnionTypeDeclaration({ union: union2, file, typeResolver }),
|
|
@@ -766146,13 +766172,13 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766146
766172
|
const intermediateRepresentation = {
|
|
766147
766173
|
apiName: casingsGenerator.generateName(workspace.name),
|
|
766148
766174
|
apiDisplayName: workspace.definition.rootApiFile.contents["display-name"],
|
|
766149
|
-
apiDocs: workspace.definition.rootApiFile.contents.docs,
|
|
766175
|
+
apiDocs: await formatDocs(workspace.definition.rootApiFile.contents.docs),
|
|
766150
766176
|
auth: convertApiAuth({
|
|
766151
766177
|
rawApiFileSchema: workspace.definition.rootApiFile.contents,
|
|
766152
766178
|
file: rootApiFileContext
|
|
766153
766179
|
}),
|
|
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 })) : [],
|
|
766180
|
+
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 }))) : [],
|
|
766181
|
+
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
766182
|
types: {},
|
|
766157
766183
|
errors: {},
|
|
766158
766184
|
services: {},
|
|
@@ -766163,7 +766189,7 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766163
766189
|
}),
|
|
766164
766190
|
errorDiscriminationStrategy: convertErrorDiscriminationStrategy(workspace.definition.rootApiFile.contents["error-discrimination"], rootApiFileContext),
|
|
766165
766191
|
basePath: workspace.definition.rootApiFile.contents["base-path"] != null ? constructHttpPath(workspace.definition.rootApiFile.contents["base-path"]) : void 0,
|
|
766166
|
-
pathParameters: convertPathParameters2({
|
|
766192
|
+
pathParameters: await convertPathParameters2({
|
|
766167
766193
|
pathParameters: workspace.definition.rootApiFile.contents["path-parameters"],
|
|
766168
766194
|
file: rootApiFileContext,
|
|
766169
766195
|
location: import_api22.PathParameterLocation.Root,
|
|
@@ -766191,12 +766217,12 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766191
766217
|
packageTreeGenerator.addDocs(file.fernFilepath, docs);
|
|
766192
766218
|
}
|
|
766193
766219
|
},
|
|
766194
|
-
types: (types4) => {
|
|
766220
|
+
types: async (types4) => {
|
|
766195
766221
|
if (types4 == null) {
|
|
766196
766222
|
return;
|
|
766197
766223
|
}
|
|
766198
766224
|
for (const [typeName, typeDeclaration] of Object.entries(types4)) {
|
|
766199
|
-
const convertedTypeDeclarationWithFilepaths = convertTypeDeclaration({
|
|
766225
|
+
const convertedTypeDeclarationWithFilepaths = await convertTypeDeclaration({
|
|
766200
766226
|
typeName,
|
|
766201
766227
|
typeDeclaration,
|
|
766202
766228
|
file,
|
|
@@ -766233,11 +766259,11 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766233
766259
|
irGraph.addError(convertedErrorDeclaration);
|
|
766234
766260
|
}
|
|
766235
766261
|
},
|
|
766236
|
-
service: (service) => {
|
|
766262
|
+
service: async (service) => {
|
|
766237
766263
|
if (service == null) {
|
|
766238
766264
|
return;
|
|
766239
766265
|
}
|
|
766240
|
-
const convertedHttpService = convertHttpService({
|
|
766266
|
+
const convertedHttpService = await convertHttpService({
|
|
766241
766267
|
rootPathParameters: intermediateRepresentation.pathParameters,
|
|
766242
766268
|
serviceDefinition: service,
|
|
766243
766269
|
file,
|
|
@@ -766266,12 +766292,12 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
766266
766292
|
}
|
|
766267
766293
|
});
|
|
766268
766294
|
},
|
|
766269
|
-
webhooks: (webhooks) => {
|
|
766295
|
+
webhooks: async (webhooks) => {
|
|
766270
766296
|
if (webhooks == null) {
|
|
766271
766297
|
return;
|
|
766272
766298
|
}
|
|
766273
766299
|
const webhookGroupId = IdGenerator.generateWebhookGroupId(file.fernFilepath);
|
|
766274
|
-
const convertedWebhookGroup = convertWebhookGroup2({ webhooks, file });
|
|
766300
|
+
const convertedWebhookGroup = await convertWebhookGroup2({ webhooks, file });
|
|
766275
766301
|
intermediateRepresentation.webhookGroups[webhookGroupId] = convertedWebhookGroup;
|
|
766276
766302
|
packageTreeGenerator.addWebhookGroup(webhookGroupId, file.fernFilepath);
|
|
766277
766303
|
}
|
|
@@ -774816,6 +774842,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
774816
774842
|
}
|
|
774817
774843
|
|
|
774818
774844
|
// pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
774845
|
+
var import_promises35 = require("fs/promises");
|
|
774819
774846
|
var import_os3 = __toESM(require("os"));
|
|
774820
774847
|
var import_path33 = __toESM(require("path"));
|
|
774821
774848
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
@@ -775215,6 +775242,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
775215
775242
|
audiences,
|
|
775216
775243
|
generationLanguage: generatorInvocation.language
|
|
775217
775244
|
});
|
|
775245
|
+
context.logger.debug("Generated IR");
|
|
775218
775246
|
const migratedIntermediateRepresentation = irVersionOverride != null ? await migrateIntermediateRepresentationThroughVersion({
|
|
775219
775247
|
intermediateRepresentation,
|
|
775220
775248
|
context,
|
|
@@ -775227,11 +775255,13 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
775227
775255
|
version: generatorInvocation.version
|
|
775228
775256
|
}
|
|
775229
775257
|
});
|
|
775258
|
+
context.logger.debug("Migrated IR");
|
|
775230
775259
|
const irFile = await import_tmp_promise6.default.file({
|
|
775231
775260
|
tmpdir: workspaceTempDir.path
|
|
775232
775261
|
});
|
|
775233
775262
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
775234
|
-
await
|
|
775263
|
+
await (0, import_promises35.writeFile)(absolutePathToIr, JSON.stringify(migratedIntermediateRepresentation, void 0, 4));
|
|
775264
|
+
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
775235
775265
|
return absolutePathToIr;
|
|
775236
775266
|
}
|
|
775237
775267
|
|
|
@@ -775412,9 +775442,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
775412
775442
|
var import_axios6 = __toESM(require_axios2());
|
|
775413
775443
|
var import_decompress2 = __toESM(require_decompress());
|
|
775414
775444
|
var import_fs7 = require("fs");
|
|
775415
|
-
var
|
|
775445
|
+
var import_promises36 = require("fs/promises");
|
|
775416
775446
|
var import_path34 = __toESM(require("path"));
|
|
775417
|
-
var
|
|
775447
|
+
var import_promises37 = require("stream/promises");
|
|
775418
775448
|
|
|
775419
775449
|
// pnp:/home/circleci/project/.yarn/cache/terminal-link-npm-3.0.0-82cbbd7f4a-85a78ae50a.zip/node_modules/terminal-link/index.js
|
|
775420
775450
|
var import_supports_hyperlinks = __toESM(require_supports_hyperlinks());
|
|
@@ -775516,11 +775546,11 @@ async function downloadFilesForTask({ s3PreSignedReadUrl, absolutePathToLocalOut
|
|
|
775516
775546
|
});
|
|
775517
775547
|
const tmpDir = await import_tmp_promise7.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
775518
775548
|
const outputZipPath = import_path34.default.join(tmpDir.path, "output.zip");
|
|
775519
|
-
await (0,
|
|
775549
|
+
await (0, import_promises37.pipeline)(request.data, (0, import_fs7.createWriteStream)(outputZipPath));
|
|
775520
775550
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
775521
|
-
await (0,
|
|
775551
|
+
await (0, import_promises36.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
775522
775552
|
}
|
|
775523
|
-
await (0,
|
|
775553
|
+
await (0, import_promises36.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
775524
775554
|
await (0, import_decompress2.default)(outputZipPath, absolutePathToLocalOutput);
|
|
775525
775555
|
context.logger.info(source_default.green(`Downloaded to ${absolutePathToLocalOutput}`));
|
|
775526
775556
|
} catch (e) {
|
|
@@ -775614,10 +775644,10 @@ async function runRemoteGenerationForAPIWorkspace({ organization, workspace, con
|
|
|
775614
775644
|
|
|
775615
775645
|
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/parseDocsConfiguration.js
|
|
775616
775646
|
var import_serialization3 = __toESM(require_serialization2());
|
|
775617
|
-
var
|
|
775647
|
+
var import_promises39 = require("fs/promises");
|
|
775618
775648
|
|
|
775619
775649
|
// pnp:/home/circleci/project/packages/cli/config-management/docs-configuration/lib/getAllPages.js
|
|
775620
|
-
var
|
|
775650
|
+
var import_promises38 = require("fs/promises");
|
|
775621
775651
|
async function getAllPages({ navigation, absolutePathToFernFolder }) {
|
|
775622
775652
|
switch (navigation.type) {
|
|
775623
775653
|
case "tabbed":
|
|
@@ -775653,7 +775683,7 @@ async function getAllPagesFromNavigationItem({ item, absolutePathToFernFolder })
|
|
|
775653
775683
|
return {};
|
|
775654
775684
|
case "page":
|
|
775655
775685
|
return {
|
|
775656
|
-
[await relativize(absolutePathToFernFolder, item.absolutePath)]: (await (0,
|
|
775686
|
+
[await relativize(absolutePathToFernFolder, item.absolutePath)]: (await (0, import_promises38.readFile)(item.absolutePath)).toString()
|
|
775657
775687
|
};
|
|
775658
775688
|
case "section":
|
|
775659
775689
|
return combineMaps(await Promise.all(item.contents.map(async (sectionItem) => {
|
|
@@ -775739,7 +775769,7 @@ async function getNavigationConfiguration({ versions, navigation, absolutePathTo
|
|
|
775739
775769
|
const versionedNavbars = [];
|
|
775740
775770
|
for (const version3 of versions) {
|
|
775741
775771
|
const absoluteFilepathToVersionFile = resolve(absolutePathToFernFolder, version3.path);
|
|
775742
|
-
const content3 = js_yaml_default.load((await (0,
|
|
775772
|
+
const content3 = js_yaml_default.load((await (0, import_promises39.readFile)(absoluteFilepathToVersionFile)).toString());
|
|
775743
775773
|
const result2 = await import_serialization3.VersionFileConfig.parseOrThrow(content3);
|
|
775744
775774
|
const navigation2 = await convertNavigationConfiguration({
|
|
775745
775775
|
rawNavigationConfig: result2.navigation,
|
|
@@ -775963,7 +775993,7 @@ function isTabbedNavigationConfig(navigationConfig) {
|
|
|
775963
775993
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
775964
775994
|
var import_fdr_sdk3 = __toESM(require_dist());
|
|
775965
775995
|
var import_axios7 = __toESM(require_axios2());
|
|
775966
|
-
var
|
|
775996
|
+
var import_promises40 = require("fs/promises");
|
|
775967
775997
|
var mime = __toESM(require_mime_types());
|
|
775968
775998
|
async function publishDocs({ token, organization, docsWorkspace, domain: domain2, customDomains, fernWorkspaces, context, version: version3, preview }) {
|
|
775969
775999
|
const fdr = createFdrService({ token: token.value });
|
|
@@ -776013,7 +776043,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain2
|
|
|
776013
776043
|
context.failAndThrow(`Failed to upload ${filepathToUpload}`, "Upload URL is missing");
|
|
776014
776044
|
} else {
|
|
776015
776045
|
const mimeType = mime.lookup(filepathToUpload);
|
|
776016
|
-
await import_axios7.default.put(uploadUrl.uploadUrl, await (0,
|
|
776046
|
+
await import_axios7.default.put(uploadUrl.uploadUrl, await (0, import_promises40.readFile)(filepathToUpload), {
|
|
776017
776047
|
headers: {
|
|
776018
776048
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
776019
776049
|
}
|
|
@@ -797455,7 +797485,7 @@ function createProcessor(options) {
|
|
|
797455
797485
|
const {
|
|
797456
797486
|
development: development2,
|
|
797457
797487
|
jsx: jsx2,
|
|
797458
|
-
format:
|
|
797488
|
+
format: format5,
|
|
797459
797489
|
outputFormat,
|
|
797460
797490
|
providerImportSource,
|
|
797461
797491
|
recmaPlugins,
|
|
@@ -797477,13 +797507,13 @@ function createProcessor(options) {
|
|
|
797477
797507
|
);
|
|
797478
797508
|
}
|
|
797479
797509
|
}
|
|
797480
|
-
if (
|
|
797510
|
+
if (format5 === "detect") {
|
|
797481
797511
|
throw new Error(
|
|
797482
797512
|
"Incorrect `format: 'detect'`: `createProcessor` can support either `md` or `mdx`; it does not support detecting the format"
|
|
797483
797513
|
);
|
|
797484
797514
|
}
|
|
797485
797515
|
const pipeline3 = unified().use(remarkParse);
|
|
797486
|
-
if (
|
|
797516
|
+
if (format5 !== "md") {
|
|
797487
797517
|
pipeline3.use(remarkMdx);
|
|
797488
797518
|
}
|
|
797489
797519
|
const extraNodeTypes = remarkRehypeOptions ? remarkRehypeOptions.passThrough || [] : [];
|
|
@@ -797492,7 +797522,7 @@ function createProcessor(options) {
|
|
|
797492
797522
|
allowDangerousHtml: true,
|
|
797493
797523
|
passThrough: [...extraNodeTypes, ...nodeTypes]
|
|
797494
797524
|
}).use(rehypePlugins || []);
|
|
797495
|
-
if (
|
|
797525
|
+
if (format5 === "md") {
|
|
797496
797526
|
pipeline3.use(rehypeRemoveRaw);
|
|
797497
797527
|
}
|
|
797498
797528
|
pipeline3.use(rehypeRecma, { elementAttributeNameCase, stylePropertyNameCase }).use(recmaDocument, { ...rest2, outputFormat }).use(recmaJsxRewrite, {
|
|
@@ -797514,11 +797544,11 @@ var md = import_markdown_extensions.default.map((d2) => "." + d2);
|
|
|
797514
797544
|
// 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
797545
|
function resolveFileAndOptions(vfileCompatible, options) {
|
|
797516
797546
|
const file = looksLikeAVFile2(vfileCompatible) ? vfileCompatible : new VFile(vfileCompatible);
|
|
797517
|
-
const { format:
|
|
797547
|
+
const { format: format5, ...rest2 } = options || {};
|
|
797518
797548
|
return {
|
|
797519
797549
|
file,
|
|
797520
797550
|
options: {
|
|
797521
|
-
format:
|
|
797551
|
+
format: format5 === "md" || format5 === "mdx" ? format5 : file.extname && (rest2.mdExtensions || md).includes(file.extname) ? "md" : "mdx",
|
|
797522
797552
|
...rest2
|
|
797523
797553
|
}
|
|
797524
797554
|
};
|
|
@@ -802427,7 +802457,7 @@ async function previewDocsWorkspace({
|
|
|
802427
802457
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
802428
802458
|
var import_fiddle_sdk5 = __toESM(require_node());
|
|
802429
802459
|
var import_axios8 = __toESM(require_axios2());
|
|
802430
|
-
var
|
|
802460
|
+
var import_promises41 = require("fs/promises");
|
|
802431
802461
|
var import_path36 = __toESM(require("path"));
|
|
802432
802462
|
var import_tar2 = __toESM(require_tar());
|
|
802433
802463
|
var import_tmp_promise8 = __toESM(require_tmp_promise());
|
|
@@ -802476,7 +802506,7 @@ async function registerWorkspacesV1({
|
|
|
802476
802506
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
802477
802507
|
await import_tar2.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
|
|
802478
802508
|
context.logger.info("Uploading definition...");
|
|
802479
|
-
await import_axios8.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
802509
|
+
await import_axios8.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises41.readFile)(tarPath));
|
|
802480
802510
|
context.logger.info(
|
|
802481
802511
|
`Registered @${project.config.organization}/${workspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
802482
802512
|
);
|
|
@@ -802539,17 +802569,17 @@ async function generateToken({
|
|
|
802539
802569
|
}
|
|
802540
802570
|
|
|
802541
802571
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
802542
|
-
var
|
|
802572
|
+
var import_promises44 = require("fs/promises");
|
|
802543
802573
|
|
|
802544
802574
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
802545
|
-
var
|
|
802575
|
+
var import_promises42 = require("fs/promises");
|
|
802546
802576
|
var FERN_DIRECTORY2 = "fern";
|
|
802547
802577
|
async function loadWorkspaces(context) {
|
|
802548
802578
|
const fernDirectory = await getFernDirectory2();
|
|
802549
802579
|
if (fernDirectory == null) {
|
|
802550
802580
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
802551
802581
|
}
|
|
802552
|
-
const fernDirectoryContents = await (0,
|
|
802582
|
+
const fernDirectoryContents = await (0, import_promises42.readdir)(fernDirectory, { withFileTypes: true });
|
|
802553
802583
|
return fernDirectoryContents.reduce((all4, item) => {
|
|
802554
802584
|
if (item.isDirectory()) {
|
|
802555
802585
|
all4.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -802584,7 +802614,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
802584
802614
|
}
|
|
802585
802615
|
|
|
802586
802616
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
802587
|
-
var
|
|
802617
|
+
var import_promises43 = require("fs/promises");
|
|
802588
802618
|
|
|
802589
802619
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
802590
802620
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -802607,7 +802637,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
802607
802637
|
|
|
802608
802638
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
802609
802639
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
802610
|
-
const contentsStr = await (0,
|
|
802640
|
+
const contentsStr = await (0, import_promises43.readFile)(absolutePathToGeneratorsConfiguration);
|
|
802611
802641
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
802612
802642
|
return await validateSchema({
|
|
802613
802643
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -802643,7 +802673,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
802643
802673
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
802644
802674
|
});
|
|
802645
802675
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
802646
|
-
await (0,
|
|
802676
|
+
await (0, import_promises44.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
802647
802677
|
}
|
|
802648
802678
|
function migrateConfiguration(oldConfiguration) {
|
|
802649
802679
|
return {
|
|
@@ -802669,7 +802699,7 @@ var versionMigrations = {
|
|
|
802669
802699
|
var __default = versionMigrations;
|
|
802670
802700
|
|
|
802671
802701
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
802672
|
-
var
|
|
802702
|
+
var import_promises45 = require("fs/promises");
|
|
802673
802703
|
|
|
802674
802704
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
802675
802705
|
var import_glob_promise2 = __toESM(require_lib6());
|
|
@@ -802703,7 +802733,7 @@ var migration2 = {
|
|
|
802703
802733
|
try {
|
|
802704
802734
|
const fileContents = await getFileContents(yamlFilepath);
|
|
802705
802735
|
const newContents = addDiscriminantToFile(fileContents);
|
|
802706
|
-
await (0,
|
|
802736
|
+
await (0, import_promises45.writeFile)(yamlFilepath, newContents);
|
|
802707
802737
|
} catch (error) {
|
|
802708
802738
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
802709
802739
|
}
|
|
@@ -802711,7 +802741,7 @@ var migration2 = {
|
|
|
802711
802741
|
}
|
|
802712
802742
|
};
|
|
802713
802743
|
async function getFileContents(filepath) {
|
|
802714
|
-
const buffer3 = await (0,
|
|
802744
|
+
const buffer3 = await (0, import_promises45.readFile)(filepath);
|
|
802715
802745
|
return buffer3.toString();
|
|
802716
802746
|
}
|
|
802717
802747
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -802740,7 +802770,7 @@ var versionMigrations2 = {
|
|
|
802740
802770
|
var __default2 = versionMigrations2;
|
|
802741
802771
|
|
|
802742
802772
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
802743
|
-
var
|
|
802773
|
+
var import_promises46 = require("fs/promises");
|
|
802744
802774
|
var import_yaml = __toESM(require_dist4());
|
|
802745
802775
|
|
|
802746
802776
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -802781,7 +802811,7 @@ var migration3 = {
|
|
|
802781
802811
|
}
|
|
802782
802812
|
};
|
|
802783
802813
|
async function migrateFile(filepath, context) {
|
|
802784
|
-
const contents = await (0,
|
|
802814
|
+
const contents = await (0, import_promises46.readFile)(filepath);
|
|
802785
802815
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
802786
802816
|
const types4 = parsedDocument.get("types");
|
|
802787
802817
|
if (types4 == null) {
|
|
@@ -802813,7 +802843,7 @@ async function migrateFile(filepath, context) {
|
|
|
802813
802843
|
}
|
|
802814
802844
|
}
|
|
802815
802845
|
}
|
|
802816
|
-
await (0,
|
|
802846
|
+
await (0, import_promises46.writeFile)(filepath, parsedDocument.toString());
|
|
802817
802847
|
}
|
|
802818
802848
|
|
|
802819
802849
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -802824,7 +802854,7 @@ var versionMigrations3 = {
|
|
|
802824
802854
|
var __default3 = versionMigrations3;
|
|
802825
802855
|
|
|
802826
802856
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
802827
|
-
var
|
|
802857
|
+
var import_promises47 = require("fs/promises");
|
|
802828
802858
|
var import_yaml2 = __toESM(require_dist4());
|
|
802829
802859
|
|
|
802830
802860
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -802865,7 +802895,7 @@ var migration4 = {
|
|
|
802865
802895
|
}
|
|
802866
802896
|
};
|
|
802867
802897
|
async function migrateGeneratorsYml(filepath, context) {
|
|
802868
|
-
const contents = await (0,
|
|
802898
|
+
const contents = await (0, import_promises47.readFile)(filepath);
|
|
802869
802899
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
802870
802900
|
const draftGenerators = parsedDocument.get("draft");
|
|
802871
802901
|
if (draftGenerators == null) {
|
|
@@ -802892,7 +802922,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
802892
802922
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
802893
802923
|
}
|
|
802894
802924
|
});
|
|
802895
|
-
await (0,
|
|
802925
|
+
await (0, import_promises47.writeFile)(filepath, parsedDocument.toString());
|
|
802896
802926
|
}
|
|
802897
802927
|
|
|
802898
802928
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -802903,7 +802933,7 @@ var versionMigrations4 = {
|
|
|
802903
802933
|
var __default4 = versionMigrations4;
|
|
802904
802934
|
|
|
802905
802935
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
802906
|
-
var
|
|
802936
|
+
var import_promises48 = require("fs/promises");
|
|
802907
802937
|
var import_yaml3 = __toESM(require_dist4());
|
|
802908
802938
|
|
|
802909
802939
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -802944,7 +802974,7 @@ var migration5 = {
|
|
|
802944
802974
|
}
|
|
802945
802975
|
};
|
|
802946
802976
|
async function migrateFile2(filepath, context) {
|
|
802947
|
-
const contents = await (0,
|
|
802977
|
+
const contents = await (0, import_promises48.readFile)(filepath);
|
|
802948
802978
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
802949
802979
|
const addType = (typeName, typeDeclaration) => {
|
|
802950
802980
|
const types4 = parsedDocument.get("types");
|
|
@@ -802988,7 +803018,7 @@ async function migrateFile2(filepath, context) {
|
|
|
802988
803018
|
}
|
|
802989
803019
|
}
|
|
802990
803020
|
}
|
|
802991
|
-
await (0,
|
|
803021
|
+
await (0, import_promises48.writeFile)(filepath, parsedDocument.toString());
|
|
802992
803022
|
}
|
|
802993
803023
|
|
|
802994
803024
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -802999,7 +803029,7 @@ var versionMigrations5 = {
|
|
|
802999
803029
|
var __default5 = versionMigrations5;
|
|
803000
803030
|
|
|
803001
803031
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
803002
|
-
var
|
|
803032
|
+
var import_promises49 = require("fs/promises");
|
|
803003
803033
|
var import_yaml4 = __toESM(require_dist4());
|
|
803004
803034
|
|
|
803005
803035
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -803040,7 +803070,7 @@ var migration6 = {
|
|
|
803040
803070
|
}
|
|
803041
803071
|
};
|
|
803042
803072
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
803043
|
-
const contents = await (0,
|
|
803073
|
+
const contents = await (0, import_promises49.readFile)(filepath);
|
|
803044
803074
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
803045
803075
|
const releaseGenerators = parsedDocument.get("release");
|
|
803046
803076
|
if (releaseGenerators == null) {
|
|
@@ -803078,7 +803108,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
803078
803108
|
}
|
|
803079
803109
|
releaseGenerator.delete("outputs");
|
|
803080
803110
|
});
|
|
803081
|
-
await (0,
|
|
803111
|
+
await (0, import_promises49.writeFile)(filepath, parsedDocument.toString());
|
|
803082
803112
|
}
|
|
803083
803113
|
|
|
803084
803114
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -803089,7 +803119,7 @@ var versionMigrations6 = {
|
|
|
803089
803119
|
var __default6 = versionMigrations6;
|
|
803090
803120
|
|
|
803091
803121
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
803092
|
-
var
|
|
803122
|
+
var import_promises50 = require("fs/promises");
|
|
803093
803123
|
|
|
803094
803124
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
803095
803125
|
var import_glob_promise7 = __toESM(require_lib6());
|
|
@@ -803120,9 +803150,9 @@ var migration7 = {
|
|
|
803120
803150
|
run: async ({ context }) => {
|
|
803121
803151
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
803122
803152
|
for (const filepath of yamlFiles) {
|
|
803123
|
-
const contents = await (0,
|
|
803153
|
+
const contents = await (0, import_promises50.readFile)(filepath);
|
|
803124
803154
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
803125
|
-
await (0,
|
|
803155
|
+
await (0, import_promises50.writeFile)(filepath, newContents);
|
|
803126
803156
|
}
|
|
803127
803157
|
}
|
|
803128
803158
|
};
|
|
@@ -803135,7 +803165,7 @@ var versionMigrations7 = {
|
|
|
803135
803165
|
var __default7 = versionMigrations7;
|
|
803136
803166
|
|
|
803137
803167
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
803138
|
-
var
|
|
803168
|
+
var import_promises51 = require("fs/promises");
|
|
803139
803169
|
|
|
803140
803170
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
803141
803171
|
var import_glob_promise8 = __toESM(require_lib6());
|
|
@@ -803166,9 +803196,9 @@ var migration8 = {
|
|
|
803166
803196
|
run: async ({ context }) => {
|
|
803167
803197
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
803168
803198
|
for (const filepath of yamlFiles) {
|
|
803169
|
-
const contents = await (0,
|
|
803199
|
+
const contents = await (0, import_promises51.readFile)(filepath);
|
|
803170
803200
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
803171
|
-
await (0,
|
|
803201
|
+
await (0, import_promises51.writeFile)(filepath, newContents);
|
|
803172
803202
|
}
|
|
803173
803203
|
}
|
|
803174
803204
|
};
|
|
@@ -803181,7 +803211,7 @@ var versionMigrations8 = {
|
|
|
803181
803211
|
var __default8 = versionMigrations8;
|
|
803182
803212
|
|
|
803183
803213
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
803184
|
-
var
|
|
803214
|
+
var import_promises52 = require("fs/promises");
|
|
803185
803215
|
|
|
803186
803216
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
803187
803217
|
var import_glob_promise9 = __toESM(require_lib6());
|
|
@@ -803288,7 +803318,7 @@ var migration9 = {
|
|
|
803288
803318
|
}
|
|
803289
803319
|
};
|
|
803290
803320
|
async function migrateGeneratorsYml3(filepath) {
|
|
803291
|
-
const contentsStr = await (0,
|
|
803321
|
+
const contentsStr = await (0, import_promises52.readFile)(filepath);
|
|
803292
803322
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
803293
803323
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
803294
803324
|
let newGeneratorsConfiguration = {};
|
|
@@ -803306,7 +803336,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
803306
803336
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
803307
803337
|
};
|
|
803308
803338
|
}
|
|
803309
|
-
await (0,
|
|
803339
|
+
await (0, import_promises52.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
803310
803340
|
}
|
|
803311
803341
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
803312
803342
|
const newSchema = {
|
|
@@ -803381,7 +803411,7 @@ var versionMigrations9 = {
|
|
|
803381
803411
|
var __default9 = versionMigrations9;
|
|
803382
803412
|
|
|
803383
803413
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
803384
|
-
var
|
|
803414
|
+
var import_promises53 = require("fs/promises");
|
|
803385
803415
|
var import_yaml5 = __toESM(require_dist4());
|
|
803386
803416
|
|
|
803387
803417
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -803422,7 +803452,7 @@ var migration10 = {
|
|
|
803422
803452
|
}
|
|
803423
803453
|
};
|
|
803424
803454
|
async function migrateRootApiFile(filepath) {
|
|
803425
|
-
const contents = await (0,
|
|
803455
|
+
const contents = await (0, import_promises53.readFile)(filepath);
|
|
803426
803456
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
803427
803457
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
803428
803458
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -803433,7 +803463,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
803433
803463
|
"property-name": errorDiscriminant.value
|
|
803434
803464
|
});
|
|
803435
803465
|
parsedDocument.delete("error-discriminant");
|
|
803436
|
-
await (0,
|
|
803466
|
+
await (0, import_promises53.writeFile)(filepath, parsedDocument.toString());
|
|
803437
803467
|
}
|
|
803438
803468
|
|
|
803439
803469
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -803444,7 +803474,7 @@ var versionMigrations10 = {
|
|
|
803444
803474
|
var __default10 = versionMigrations10;
|
|
803445
803475
|
|
|
803446
803476
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
803447
|
-
var
|
|
803477
|
+
var import_promises54 = require("fs/promises");
|
|
803448
803478
|
var import_yaml6 = __toESM(require_dist4());
|
|
803449
803479
|
|
|
803450
803480
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -803485,7 +803515,7 @@ var migration11 = {
|
|
|
803485
803515
|
}
|
|
803486
803516
|
};
|
|
803487
803517
|
async function migrateYamlFile(filepath, context) {
|
|
803488
|
-
const contents = await (0,
|
|
803518
|
+
const contents = await (0, import_promises54.readFile)(filepath);
|
|
803489
803519
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
803490
803520
|
const services = parsedDocument.get("services");
|
|
803491
803521
|
if (services == null) {
|
|
@@ -803525,7 +803555,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
803525
803555
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
803526
803556
|
}
|
|
803527
803557
|
}
|
|
803528
|
-
await (0,
|
|
803558
|
+
await (0, import_promises54.writeFile)(filepath, parsedDocument.toString());
|
|
803529
803559
|
}
|
|
803530
803560
|
}
|
|
803531
803561
|
function convertEndpoint13({ document: document4, endpoint }) {
|
|
@@ -803609,10 +803639,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
803609
803639
|
var LegacyDocsSerializers = __toESM(require_serialization14());
|
|
803610
803640
|
|
|
803611
803641
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
803612
|
-
var
|
|
803642
|
+
var import_promises55 = require("fs/promises");
|
|
803613
803643
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
803614
803644
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803615
|
-
const contentsStr = await (0,
|
|
803645
|
+
const contentsStr = await (0, import_promises55.readFile)(filepath);
|
|
803616
803646
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
803617
803647
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
803618
803648
|
if (result2.ok) {
|
|
@@ -803630,7 +803660,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
803630
803660
|
}
|
|
803631
803661
|
|
|
803632
803662
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
803633
|
-
var
|
|
803663
|
+
var import_promises57 = require("fs/promises");
|
|
803634
803664
|
|
|
803635
803665
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
803636
803666
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -803809,10 +803839,10 @@ __export(legacy_exports, {
|
|
|
803809
803839
|
});
|
|
803810
803840
|
|
|
803811
803841
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
803812
|
-
var
|
|
803842
|
+
var import_promises56 = require("fs/promises");
|
|
803813
803843
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
803814
803844
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
803815
|
-
const contentsStr = await (0,
|
|
803845
|
+
const contentsStr = await (0, import_promises56.readFile)(filepath);
|
|
803816
803846
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
803817
803847
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
803818
803848
|
if (result2.success) {
|
|
@@ -803919,7 +803949,7 @@ var GeneratorsConfigurationSchema5 = z.strictObject({
|
|
|
803919
803949
|
var APIS_DIRECTORY2 = "apis";
|
|
803920
803950
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
803921
803951
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
803922
|
-
await (0,
|
|
803952
|
+
await (0, import_promises57.mkdir)(absolutePathToApisDirectory);
|
|
803923
803953
|
for (const workspace of workspaces) {
|
|
803924
803954
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
803925
803955
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -803927,11 +803957,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
803927
803957
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
803928
803958
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
803929
803959
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
803930
|
-
await (0,
|
|
803960
|
+
await (0, import_promises57.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
803931
803961
|
}
|
|
803932
803962
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
803933
803963
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
803934
|
-
await (0,
|
|
803964
|
+
await (0, import_promises57.rm)(absolutePathToWorkspace, { recursive: true });
|
|
803935
803965
|
}
|
|
803936
803966
|
}
|
|
803937
803967
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -803944,7 +803974,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
803944
803974
|
generatorsConfiguration,
|
|
803945
803975
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
803946
803976
|
});
|
|
803947
|
-
await (0,
|
|
803977
|
+
await (0, import_promises57.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
803948
803978
|
return convertedResponse.docsURLs;
|
|
803949
803979
|
}
|
|
803950
803980
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -803958,19 +803988,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
803958
803988
|
apiName
|
|
803959
803989
|
});
|
|
803960
803990
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803961
|
-
await (0,
|
|
803991
|
+
await (0, import_promises57.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
803962
803992
|
}
|
|
803963
803993
|
|
|
803964
803994
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
803965
|
-
var
|
|
803995
|
+
var import_promises58 = require("fs/promises");
|
|
803966
803996
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
803967
803997
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
803968
803998
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
803969
803999
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
803970
804000
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
803971
804001
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
803972
|
-
await (0,
|
|
803973
|
-
await (0,
|
|
804002
|
+
await (0, import_promises58.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
804003
|
+
await (0, import_promises58.rm)(absolutePathToWorkspace, { recursive: true });
|
|
803974
804004
|
}
|
|
803975
804005
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
803976
804006
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -803983,7 +804013,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
803983
804013
|
apiName: void 0
|
|
803984
804014
|
});
|
|
803985
804015
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
803986
|
-
await (0,
|
|
804016
|
+
await (0, import_promises58.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
803987
804017
|
}
|
|
803988
804018
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
803989
804019
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -803995,22 +804025,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
803995
804025
|
generatorsConfiguration,
|
|
803996
804026
|
pathModificationStrategy: "MoveUp"
|
|
803997
804027
|
});
|
|
803998
|
-
await (0,
|
|
804028
|
+
await (0, import_promises58.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
803999
804029
|
return convertedResponse.docsURLs;
|
|
804000
804030
|
}
|
|
804001
804031
|
|
|
804002
804032
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
804003
|
-
var
|
|
804033
|
+
var import_promises59 = require("fs/promises");
|
|
804004
804034
|
var APIS_DIRECTORY3 = "apis";
|
|
804005
804035
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
804006
804036
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
804007
|
-
await (0,
|
|
804037
|
+
await (0, import_promises59.mkdir)(absolutePathToApisDirectory);
|
|
804008
804038
|
for (const workspace of workspaces) {
|
|
804009
804039
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
804010
804040
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
804011
804041
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
804012
804042
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
804013
|
-
await (0,
|
|
804043
|
+
await (0, import_promises59.rm)(absolutePathToWorkspace, { recursive: true });
|
|
804014
804044
|
}
|
|
804015
804045
|
}
|
|
804016
804046
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -804023,15 +804053,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
804023
804053
|
generatorsConfiguration,
|
|
804024
804054
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
804025
804055
|
});
|
|
804026
|
-
await (0,
|
|
804056
|
+
await (0, import_promises59.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
804027
804057
|
}
|
|
804028
804058
|
|
|
804029
804059
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
804030
|
-
var
|
|
804060
|
+
var import_promises60 = require("fs/promises");
|
|
804031
804061
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
804032
804062
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
804033
804063
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
804034
|
-
await (0,
|
|
804064
|
+
await (0, import_promises60.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
804035
804065
|
}
|
|
804036
804066
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
804037
804067
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -804043,7 +804073,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
804043
804073
|
generatorsConfiguration,
|
|
804044
804074
|
pathModificationStrategy: "MoveUp"
|
|
804045
804075
|
});
|
|
804046
|
-
await (0,
|
|
804076
|
+
await (0, import_promises60.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
804047
804077
|
}
|
|
804048
804078
|
|
|
804049
804079
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -804120,7 +804150,7 @@ var versionMigrations12 = {
|
|
|
804120
804150
|
var __default12 = versionMigrations12;
|
|
804121
804151
|
|
|
804122
804152
|
// 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
|
|
804153
|
+
var import_promises61 = require("fs/promises");
|
|
804124
804154
|
var import_yaml7 = __toESM(require_dist4());
|
|
804125
804155
|
|
|
804126
804156
|
// 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 +804191,7 @@ var migration13 = {
|
|
|
804161
804191
|
}
|
|
804162
804192
|
};
|
|
804163
804193
|
async function migrateYamlFile2(filepath, context) {
|
|
804164
|
-
const contents = await (0,
|
|
804194
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
804165
804195
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
804166
804196
|
const types4 = parsedDocument.get("types");
|
|
804167
804197
|
if (types4 == null) {
|
|
@@ -804187,7 +804217,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
804187
804217
|
examples.set(i2, { value });
|
|
804188
804218
|
}
|
|
804189
804219
|
}
|
|
804190
|
-
await (0,
|
|
804220
|
+
await (0, import_promises61.writeFile)(filepath, parsedDocument.toString());
|
|
804191
804221
|
}
|
|
804192
804222
|
|
|
804193
804223
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -804198,7 +804228,7 @@ var versionMigrations13 = {
|
|
|
804198
804228
|
var __default13 = versionMigrations13;
|
|
804199
804229
|
|
|
804200
804230
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
804201
|
-
var
|
|
804231
|
+
var import_promises62 = require("fs/promises");
|
|
804202
804232
|
var import_yaml8 = __toESM(require_dist4());
|
|
804203
804233
|
|
|
804204
804234
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -804239,7 +804269,7 @@ var migration14 = {
|
|
|
804239
804269
|
}
|
|
804240
804270
|
};
|
|
804241
804271
|
async function migrateYamlFile3(filepath, context) {
|
|
804242
|
-
const contents = await (0,
|
|
804272
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
804243
804273
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
804244
804274
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
804245
804275
|
return context.failAndThrow("File is not a map");
|
|
@@ -804269,7 +804299,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
804269
804299
|
pair.value = firstService.value;
|
|
804270
804300
|
}
|
|
804271
804301
|
}
|
|
804272
|
-
await (0,
|
|
804302
|
+
await (0, import_promises62.writeFile)(filepath, parsedDocument.toString());
|
|
804273
804303
|
}
|
|
804274
804304
|
|
|
804275
804305
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -804280,7 +804310,7 @@ var versionMigrations14 = {
|
|
|
804280
804310
|
var __default14 = versionMigrations14;
|
|
804281
804311
|
|
|
804282
804312
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
804283
|
-
var
|
|
804313
|
+
var import_promises63 = require("fs/promises");
|
|
804284
804314
|
var import_yaml9 = __toESM(require_dist4());
|
|
804285
804315
|
|
|
804286
804316
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -804321,7 +804351,7 @@ var migration15 = {
|
|
|
804321
804351
|
}
|
|
804322
804352
|
};
|
|
804323
804353
|
async function migrateYamlFile4(filepath, context) {
|
|
804324
|
-
const contents = await (0,
|
|
804354
|
+
const contents = await (0, import_promises63.readFile)(filepath);
|
|
804325
804355
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
804326
804356
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
804327
804357
|
return context.failAndThrow("File is not a map");
|
|
@@ -804340,7 +804370,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
804340
804370
|
}
|
|
804341
804371
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
804342
804372
|
parsedDocument.contents.items.unshift(docsPair);
|
|
804343
|
-
await (0,
|
|
804373
|
+
await (0, import_promises63.writeFile)(filepath, parsedDocument.toString());
|
|
804344
804374
|
}
|
|
804345
804375
|
|
|
804346
804376
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -804351,7 +804381,7 @@ var versionMigrations15 = {
|
|
|
804351
804381
|
var __default15 = versionMigrations15;
|
|
804352
804382
|
|
|
804353
804383
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
804354
|
-
var
|
|
804384
|
+
var import_promises64 = require("fs/promises");
|
|
804355
804385
|
|
|
804356
804386
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
804357
804387
|
var import_glob_promise15 = __toESM(require_lib6());
|
|
@@ -804391,14 +804421,14 @@ var migration16 = {
|
|
|
804391
804421
|
}
|
|
804392
804422
|
};
|
|
804393
804423
|
async function migrateYamlFile5(filepath) {
|
|
804394
|
-
const contents = await (0,
|
|
804424
|
+
const contents = await (0, import_promises64.readFile)(filepath);
|
|
804395
804425
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
804396
804426
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
804397
804427
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
804398
804428
|
return `docs:
|
|
804399
804429
|
domain: "${domain2}.${domainSuffix}"`;
|
|
804400
804430
|
});
|
|
804401
|
-
await (0,
|
|
804431
|
+
await (0, import_promises64.writeFile)(filepath, updatedSnapshot.toString());
|
|
804402
804432
|
}
|
|
804403
804433
|
|
|
804404
804434
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -804500,7 +804530,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
804500
804530
|
}
|
|
804501
804531
|
|
|
804502
804532
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
804503
|
-
var
|
|
804533
|
+
var import_promises65 = require("fs/promises");
|
|
804504
804534
|
|
|
804505
804535
|
// pnp:/home/circleci/project/packages/cli/cli/src/cli-context/upgrade-utils/doesVersionOfCliExist.ts
|
|
804506
804536
|
async function doesVersionOfCliExist({
|
|
@@ -804607,7 +804637,7 @@ async function upgrade({
|
|
|
804607
804637
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
804608
804638
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
804609
804639
|
});
|
|
804610
|
-
await (0,
|
|
804640
|
+
await (0, import_promises65.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
804611
804641
|
cliContext.logger.info(
|
|
804612
804642
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
804613
804643
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -804655,7 +804685,7 @@ async function validateWorkspaces({
|
|
|
804655
804685
|
}
|
|
804656
804686
|
|
|
804657
804687
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
804658
|
-
var
|
|
804688
|
+
var import_promises66 = require("fs/promises");
|
|
804659
804689
|
async function writeDefinitionForWorkspaces({
|
|
804660
804690
|
project,
|
|
804661
804691
|
cliContext
|
|
@@ -804674,20 +804704,20 @@ async function writeDefinitionForWorkspaces({
|
|
|
804674
804704
|
}
|
|
804675
804705
|
async function writeDefinitionForWorkspace({ workspace, context }) {
|
|
804676
804706
|
const directoryOfDefinition = join(workspace.absoluteFilepath, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
804677
|
-
await (0,
|
|
804678
|
-
await (0,
|
|
804707
|
+
await (0, import_promises66.mkdir)(directoryOfDefinition);
|
|
804708
|
+
await (0, import_promises66.writeFile)(
|
|
804679
804709
|
join(directoryOfDefinition, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
804680
804710
|
js_yaml_default.dump(workspace.definition.rootApiFile.contents)
|
|
804681
804711
|
);
|
|
804682
804712
|
for (const [relativePath, definitionFile] of toPairs_default(workspace.definition.namedDefinitionFiles)) {
|
|
804683
804713
|
const absoluteFilepath = join(directoryOfDefinition, RelativeFilePath.of(relativePath));
|
|
804684
804714
|
let fileContents = js_yaml_default.dump(definitionFile.contents);
|
|
804685
|
-
fileContents = formatDefinitionFile({
|
|
804715
|
+
fileContents = await formatDefinitionFile({
|
|
804686
804716
|
fileContents: js_yaml_default.dump(definitionFile.contents)
|
|
804687
804717
|
});
|
|
804688
804718
|
const dirname5 = absoluteFilepath.split("/").slice(0, -1).join("/");
|
|
804689
|
-
await (0,
|
|
804690
|
-
await (0,
|
|
804719
|
+
await (0, import_promises66.mkdir)(dirname5, { recursive: true });
|
|
804720
|
+
await (0, import_promises66.writeFile)(absoluteFilepath, fileContents);
|
|
804691
804721
|
}
|
|
804692
804722
|
context.logger.info(source_default.green(`Wrote definition to ${directoryOfDefinition}`));
|
|
804693
804723
|
}
|