fern-api 0.35.0 → 0.36.0-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 +296 -207
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -24533,8 +24533,8 @@ var init_LayoutConfig = __esm({
|
|
|
24533
24533
|
contentWidth: schemas_exports.property("content-width", schemas_exports.string().optional()),
|
|
24534
24534
|
sidebarWidth: schemas_exports.property("sidebar-width", schemas_exports.string().optional()),
|
|
24535
24535
|
headerHeight: schemas_exports.property("header-height", schemas_exports.string().optional()),
|
|
24536
|
-
searchbarPlacement: schemas_exports.property("searchbar-placement", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
24537
|
-
tabsPlacement: schemas_exports.property("tabs-placement", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).
|
|
24536
|
+
searchbarPlacement: schemas_exports.property("searchbar-placement", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).SearchbarPlacement).optional()),
|
|
24537
|
+
tabsPlacement: schemas_exports.property("tabs-placement", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).TabsPlacement).optional()),
|
|
24538
24538
|
contentAlignment: schemas_exports.property("content-alignment", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).ContentAlignment).optional()),
|
|
24539
24539
|
headerPosition: schemas_exports.property("header-position", schemas_exports.lazy(async () => (await Promise.resolve().then(() => (init_serialization(), serialization_exports))).HeaderPosition).optional()),
|
|
24540
24540
|
disableHeader: schemas_exports.property("disable-header", schemas_exports.boolean().optional())
|
|
@@ -24542,12 +24542,21 @@ var init_LayoutConfig = __esm({
|
|
|
24542
24542
|
}
|
|
24543
24543
|
});
|
|
24544
24544
|
|
|
24545
|
-
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
24546
|
-
var
|
|
24547
|
-
var
|
|
24548
|
-
"pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/
|
|
24545
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/SearchbarPlacement.js
|
|
24546
|
+
var SearchbarPlacement3;
|
|
24547
|
+
var init_SearchbarPlacement = __esm({
|
|
24548
|
+
"pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/SearchbarPlacement.js"() {
|
|
24549
24549
|
init_core();
|
|
24550
|
-
|
|
24550
|
+
SearchbarPlacement3 = schemas_exports.enum_(["header", "header-tabs", "sidebar"]);
|
|
24551
|
+
}
|
|
24552
|
+
});
|
|
24553
|
+
|
|
24554
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TabsPlacement.js
|
|
24555
|
+
var TabsPlacement3;
|
|
24556
|
+
var init_TabsPlacement = __esm({
|
|
24557
|
+
"pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/TabsPlacement.js"() {
|
|
24558
|
+
init_core();
|
|
24559
|
+
TabsPlacement3 = schemas_exports.enum_(["header", "sidebar"]);
|
|
24551
24560
|
}
|
|
24552
24561
|
});
|
|
24553
24562
|
|
|
@@ -25126,7 +25135,8 @@ var init_types = __esm({
|
|
|
25126
25135
|
init_BackgroundImageThemedConfig();
|
|
25127
25136
|
init_DocsTypographyConfig();
|
|
25128
25137
|
init_LayoutConfig();
|
|
25129
|
-
|
|
25138
|
+
init_SearchbarPlacement();
|
|
25139
|
+
init_TabsPlacement();
|
|
25130
25140
|
init_ContentAlignment();
|
|
25131
25141
|
init_HeaderPosition();
|
|
25132
25142
|
init_FontConfig();
|
|
@@ -25222,14 +25232,15 @@ __export(docs_exports3, {
|
|
|
25222
25232
|
NavigationItem: () => NavigationItem,
|
|
25223
25233
|
PageConfiguration: () => PageConfiguration,
|
|
25224
25234
|
RedirectConfig: () => RedirectConfig,
|
|
25235
|
+
SearchbarPlacement: () => SearchbarPlacement3,
|
|
25225
25236
|
SectionConfiguration: () => SectionConfiguration,
|
|
25226
|
-
SidebarOrHeaderPlacement: () => SidebarOrHeaderPlacement2,
|
|
25227
25237
|
SnippetLanguageConfiguration: () => SnippetLanguageConfiguration,
|
|
25228
25238
|
SnippetsConfiguration: () => SnippetsConfiguration,
|
|
25229
25239
|
TabConfig: () => TabConfig,
|
|
25230
25240
|
TabId: () => TabId2,
|
|
25231
25241
|
TabbedNavigationConfig: () => TabbedNavigationConfig,
|
|
25232
25242
|
TabbedNavigationItem: () => TabbedNavigationItem,
|
|
25243
|
+
TabsPlacement: () => TabsPlacement3,
|
|
25233
25244
|
TwitterCardSetting: () => TwitterCardSetting3,
|
|
25234
25245
|
UntabbedNavigationConifg: () => UntabbedNavigationConifg,
|
|
25235
25246
|
VersionAvailability: () => VersionAvailability4,
|
|
@@ -25303,14 +25314,15 @@ __export(serialization_exports, {
|
|
|
25303
25314
|
NavigationItem: () => NavigationItem,
|
|
25304
25315
|
PageConfiguration: () => PageConfiguration,
|
|
25305
25316
|
RedirectConfig: () => RedirectConfig,
|
|
25317
|
+
SearchbarPlacement: () => SearchbarPlacement3,
|
|
25306
25318
|
SectionConfiguration: () => SectionConfiguration,
|
|
25307
|
-
SidebarOrHeaderPlacement: () => SidebarOrHeaderPlacement2,
|
|
25308
25319
|
SnippetLanguageConfiguration: () => SnippetLanguageConfiguration,
|
|
25309
25320
|
SnippetsConfiguration: () => SnippetsConfiguration,
|
|
25310
25321
|
TabConfig: () => TabConfig,
|
|
25311
25322
|
TabId: () => TabId2,
|
|
25312
25323
|
TabbedNavigationConfig: () => TabbedNavigationConfig,
|
|
25313
25324
|
TabbedNavigationItem: () => TabbedNavigationItem,
|
|
25325
|
+
TabsPlacement: () => TabsPlacement3,
|
|
25314
25326
|
TwitterCardSetting: () => TwitterCardSetting3,
|
|
25315
25327
|
UntabbedNavigationConifg: () => UntabbedNavigationConifg,
|
|
25316
25328
|
VersionAvailability: () => VersionAvailability4,
|
|
@@ -33178,7 +33190,7 @@ var require_agent = __commonJS({
|
|
|
33178
33190
|
var { Socket } = require("net");
|
|
33179
33191
|
var { Duplex } = require("stream");
|
|
33180
33192
|
var { resolve: resolve6 } = require("path");
|
|
33181
|
-
var { readFile:
|
|
33193
|
+
var { readFile: readFile46 } = require("fs");
|
|
33182
33194
|
var { execFile, spawn } = require("child_process");
|
|
33183
33195
|
var { isParsedKey, parseKey } = require_keyParser();
|
|
33184
33196
|
var {
|
|
@@ -33396,7 +33408,7 @@ var require_agent = __commonJS({
|
|
|
33396
33408
|
cb = once3(cb);
|
|
33397
33409
|
let socketPath = this.socketPath;
|
|
33398
33410
|
let triedCygpath = false;
|
|
33399
|
-
|
|
33411
|
+
readFile46(socketPath, function readCygsocket(err, data2) {
|
|
33400
33412
|
if (err) {
|
|
33401
33413
|
if (triedCygpath)
|
|
33402
33414
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
@@ -33405,7 +33417,7 @@ var require_agent = __commonJS({
|
|
|
33405
33417
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
33406
33418
|
triedCygpath = true;
|
|
33407
33419
|
socketPath = stdout.toString().replace(/[\r\n]/g, "");
|
|
33408
|
-
|
|
33420
|
+
readFile46(socketPath, readCygsocket);
|
|
33409
33421
|
});
|
|
33410
33422
|
return;
|
|
33411
33423
|
}
|
|
@@ -70787,8 +70799,8 @@ var require_graceful_fs = __commonJS({
|
|
|
70787
70799
|
fs11.createReadStream = createReadStream2;
|
|
70788
70800
|
fs11.createWriteStream = createWriteStream7;
|
|
70789
70801
|
var fs$readFile = fs11.readFile;
|
|
70790
|
-
fs11.readFile =
|
|
70791
|
-
function
|
|
70802
|
+
fs11.readFile = readFile46;
|
|
70803
|
+
function readFile46(path44, options2, cb) {
|
|
70792
70804
|
if (typeof options2 === "function")
|
|
70793
70805
|
cb = options2, options2 = null;
|
|
70794
70806
|
return go$readFile(path44, options2, cb);
|
|
@@ -72295,7 +72307,7 @@ var require_jsonfile = __commonJS({
|
|
|
72295
72307
|
}
|
|
72296
72308
|
return obj;
|
|
72297
72309
|
}
|
|
72298
|
-
var
|
|
72310
|
+
var readFile46 = universalify.fromPromise(_readFile);
|
|
72299
72311
|
function readFileSync4(file, options2 = {}) {
|
|
72300
72312
|
if (typeof options2 === "string") {
|
|
72301
72313
|
options2 = { encoding: options2 };
|
|
@@ -72327,7 +72339,7 @@ var require_jsonfile = __commonJS({
|
|
|
72327
72339
|
return fs10.writeFileSync(file, str3, options2);
|
|
72328
72340
|
}
|
|
72329
72341
|
var jsonfile = {
|
|
72330
|
-
readFile:
|
|
72342
|
+
readFile: readFile46,
|
|
72331
72343
|
readFileSync: readFileSync4,
|
|
72332
72344
|
writeFile: writeFile41,
|
|
72333
72345
|
writeFileSync
|
|
@@ -135064,7 +135076,7 @@ ${error.message}`;
|
|
|
135064
135076
|
Object.defineProperty(exports22, "__esModule", {
|
|
135065
135077
|
value: true
|
|
135066
135078
|
});
|
|
135067
|
-
exports22.readFile =
|
|
135079
|
+
exports22.readFile = readFile46;
|
|
135068
135080
|
exports22.readFileSync = readFileSync4;
|
|
135069
135081
|
var _fs = _interopRequireDefault(require("fs"));
|
|
135070
135082
|
function _interopRequireDefault(obj) {
|
|
@@ -135083,7 +135095,7 @@ ${error.message}`;
|
|
|
135083
135095
|
});
|
|
135084
135096
|
});
|
|
135085
135097
|
}
|
|
135086
|
-
async function
|
|
135098
|
+
async function readFile46(filepath, options2 = {}) {
|
|
135087
135099
|
const throwNotFound = options2.throwNotFound === true;
|
|
135088
135100
|
try {
|
|
135089
135101
|
const content5 = await fsReadFileAsync(filepath, "utf8");
|
|
@@ -326604,8 +326616,8 @@ ${error.message}`;
|
|
|
326604
326616
|
cb(null, x2);
|
|
326605
326617
|
}
|
|
326606
326618
|
};
|
|
326607
|
-
var defaultReadPackage = function defaultReadPackage2(
|
|
326608
|
-
|
|
326619
|
+
var defaultReadPackage = function defaultReadPackage2(readFile46, pkgfile, cb) {
|
|
326620
|
+
readFile46(pkgfile, function(readFileErr, body) {
|
|
326609
326621
|
if (readFileErr)
|
|
326610
326622
|
cb(readFileErr);
|
|
326611
326623
|
else {
|
|
@@ -326641,7 +326653,7 @@ ${error.message}`;
|
|
|
326641
326653
|
opts = normalizeOptions(x2, opts);
|
|
326642
326654
|
var isFile2 = opts.isFile || defaultIsFile;
|
|
326643
326655
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
326644
|
-
var
|
|
326656
|
+
var readFile46 = opts.readFile || fs10.readFile;
|
|
326645
326657
|
var realpath = opts.realpath || defaultRealpath;
|
|
326646
326658
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
326647
326659
|
if (opts.readFile && opts.readPackage) {
|
|
@@ -326773,7 +326785,7 @@ ${error.message}`;
|
|
|
326773
326785
|
isFile2(pkgfile, function(err2, ex) {
|
|
326774
326786
|
if (!ex)
|
|
326775
326787
|
return loadpkg(path44.dirname(dir), cb2);
|
|
326776
|
-
readPackage(
|
|
326788
|
+
readPackage(readFile46, pkgfile, function(err3, pkgParam) {
|
|
326777
326789
|
if (err3)
|
|
326778
326790
|
cb2(err3);
|
|
326779
326791
|
var pkg2 = pkgParam;
|
|
@@ -326801,7 +326813,7 @@ ${error.message}`;
|
|
|
326801
326813
|
return cb2(err2);
|
|
326802
326814
|
if (!ex)
|
|
326803
326815
|
return loadAsFile(path44.join(x22, "index"), fpkg, cb2);
|
|
326804
|
-
readPackage(
|
|
326816
|
+
readPackage(readFile46, pkgfile, function(err3, pkgParam) {
|
|
326805
326817
|
if (err3)
|
|
326806
326818
|
return cb2(err3);
|
|
326807
326819
|
var pkg2 = pkgParam;
|
|
@@ -389574,7 +389586,7 @@ var require_parse9 = __commonJS({
|
|
|
389574
389586
|
extension: url.getExtension(path44)
|
|
389575
389587
|
};
|
|
389576
389588
|
try {
|
|
389577
|
-
const resolver3 = await
|
|
389589
|
+
const resolver3 = await readFile46(file, options2, $refs);
|
|
389578
389590
|
$ref.pathType = resolver3.plugin.name;
|
|
389579
389591
|
file.data = resolver3.result;
|
|
389580
389592
|
const parser2 = await parseFile(file, options2, $refs);
|
|
@@ -389587,7 +389599,7 @@ var require_parse9 = __commonJS({
|
|
|
389587
389599
|
throw err;
|
|
389588
389600
|
}
|
|
389589
389601
|
}
|
|
389590
|
-
function
|
|
389602
|
+
function readFile46(file, options2, $refs) {
|
|
389591
389603
|
return new Promise((resolve6, reject2) => {
|
|
389592
389604
|
let resolvers = plugins.all(options2.resolve);
|
|
389593
389605
|
resolvers = plugins.filter(resolvers, "canRead", file);
|
|
@@ -1185176,8 +1185188,9 @@ __export(schemas_exports2, {
|
|
|
1185176
1185188
|
FontStyle: () => FontStyle2,
|
|
1185177
1185189
|
HeaderPosition: () => HeaderPosition2,
|
|
1185178
1185190
|
JsScriptStrategy: () => JsScriptStrategy2,
|
|
1185191
|
+
SearchbarPlacement: () => SearchbarPlacement2,
|
|
1185179
1185192
|
Serializer: () => serialization_exports,
|
|
1185180
|
-
|
|
1185193
|
+
TabsPlacement: () => TabsPlacement2,
|
|
1185181
1185194
|
TwitterCardSetting: () => TwitterCardSetting2,
|
|
1185182
1185195
|
VersionAvailability: () => VersionAvailability3,
|
|
1185183
1185196
|
docs: () => docs_exports2,
|
|
@@ -1185192,7 +1185205,8 @@ __export(api_exports4, {
|
|
|
1185192
1185205
|
FontStyle: () => FontStyle2,
|
|
1185193
1185206
|
HeaderPosition: () => HeaderPosition2,
|
|
1185194
1185207
|
JsScriptStrategy: () => JsScriptStrategy2,
|
|
1185195
|
-
|
|
1185208
|
+
SearchbarPlacement: () => SearchbarPlacement2,
|
|
1185209
|
+
TabsPlacement: () => TabsPlacement2,
|
|
1185196
1185210
|
TwitterCardSetting: () => TwitterCardSetting2,
|
|
1185197
1185211
|
VersionAvailability: () => VersionAvailability3,
|
|
1185198
1185212
|
docs: () => docs_exports2
|
|
@@ -1185206,7 +1185220,8 @@ __export(docs_exports2, {
|
|
|
1185206
1185220
|
FontStyle: () => FontStyle2,
|
|
1185207
1185221
|
HeaderPosition: () => HeaderPosition2,
|
|
1185208
1185222
|
JsScriptStrategy: () => JsScriptStrategy2,
|
|
1185209
|
-
|
|
1185223
|
+
SearchbarPlacement: () => SearchbarPlacement2,
|
|
1185224
|
+
TabsPlacement: () => TabsPlacement2,
|
|
1185210
1185225
|
TwitterCardSetting: () => TwitterCardSetting2,
|
|
1185211
1185226
|
VersionAvailability: () => VersionAvailability3
|
|
1185212
1185227
|
});
|
|
@@ -1185219,8 +1185234,15 @@ var VersionAvailability3 = {
|
|
|
1185219
1185234
|
Beta: "beta"
|
|
1185220
1185235
|
};
|
|
1185221
1185236
|
|
|
1185222
|
-
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/api/resources/docs/types/
|
|
1185223
|
-
var
|
|
1185237
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/api/resources/docs/types/SearchbarPlacement.js
|
|
1185238
|
+
var SearchbarPlacement2 = {
|
|
1185239
|
+
Header: "header",
|
|
1185240
|
+
HeaderTabs: "header-tabs",
|
|
1185241
|
+
Sidebar: "sidebar"
|
|
1185242
|
+
};
|
|
1185243
|
+
|
|
1185244
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/configuration/lib/docs-yml/schemas/sdk/api/resources/docs/types/TabsPlacement.js
|
|
1185245
|
+
var TabsPlacement2 = {
|
|
1185224
1185246
|
Header: "header",
|
|
1185225
1185247
|
Sidebar: "sidebar"
|
|
1185226
1185248
|
};
|
|
@@ -1185455,7 +1185477,7 @@ function convertLayoutConfig(layout) {
|
|
|
1185455
1185477
|
contentWidth: parseSizeConfig(layout.contentWidth),
|
|
1185456
1185478
|
sidebarWidth: parseSizeConfig(layout.sidebarWidth),
|
|
1185457
1185479
|
headerHeight: parseSizeConfig(layout.headerHeight),
|
|
1185458
|
-
searchbarPlacement: layout.searchbarPlacement === "header" ? DocsV1Write_exports.SearchbarPlacement.Header : DocsV1Write_exports.SearchbarPlacement.Sidebar,
|
|
1185480
|
+
searchbarPlacement: layout.searchbarPlacement === "header" ? DocsV1Write_exports.SearchbarPlacement.Header : layout.searchbarPlacement === "header-tabs" ? DocsV1Write_exports.SearchbarPlacement.HeaderTabs : DocsV1Write_exports.SearchbarPlacement.Sidebar,
|
|
1185459
1185481
|
tabsPlacement: layout.tabsPlacement === "header" ? DocsV1Write_exports.TabsPlacement.Header : DocsV1Write_exports.TabsPlacement.Sidebar,
|
|
1185460
1185482
|
contentAlignment: layout.contentAlignment === "left" ? DocsV1Write_exports.ContentAlignment.Left : DocsV1Write_exports.ContentAlignment.Center,
|
|
1185461
1185483
|
headerPosition: layout.headerPosition === "static" ? DocsV1Write_exports.HeaderPosition.Absolute : DocsV1Write_exports.HeaderPosition.Fixed,
|
|
@@ -1185722,7 +1185744,7 @@ function parsePageConfig(item, absolutePathToConfig) {
|
|
|
1185722
1185744
|
slug: item.slug,
|
|
1185723
1185745
|
icon: item.icon,
|
|
1185724
1185746
|
hidden: item.hidden,
|
|
1185725
|
-
noindex:
|
|
1185747
|
+
noindex: void 0
|
|
1185726
1185748
|
};
|
|
1185727
1185749
|
}
|
|
1185728
1185750
|
function parseApiReferenceLayoutItem(item, absolutePathToConfig) {
|
|
@@ -1189910,7 +1189932,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1189910
1189932
|
properties: {
|
|
1189911
1189933
|
...event,
|
|
1189912
1189934
|
...event.properties,
|
|
1189913
|
-
version: "0.
|
|
1189935
|
+
version: "0.36.0-rc1",
|
|
1189914
1189936
|
usingAccessToken: true
|
|
1189915
1189937
|
}
|
|
1189916
1189938
|
});
|
|
@@ -1189972,7 +1189994,7 @@ var UserPosthogManager = class {
|
|
|
1189972
1189994
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1189973
1189995
|
event: "CLI",
|
|
1189974
1189996
|
properties: {
|
|
1189975
|
-
version: "0.
|
|
1189997
|
+
version: "0.36.0-rc1",
|
|
1189976
1189998
|
...event,
|
|
1189977
1189999
|
...event.properties
|
|
1189978
1190000
|
}
|
|
@@ -1202236,18 +1202258,21 @@ async function replaceReferencedMarkdown({
|
|
|
1202236
1202258
|
if (!markdown.includes("<Markdown")) {
|
|
1202237
1202259
|
return markdown;
|
|
1202238
1202260
|
}
|
|
1202239
|
-
const regex3 =
|
|
1202261
|
+
const regex3 = /([ \t]*)<Markdown\s+src={?['"]([^'"]+.mdx?)['"](?! \+)}?\s*\/>/g;
|
|
1202240
1202262
|
let newMarkdown = markdown;
|
|
1202241
1202263
|
let match;
|
|
1202242
1202264
|
while ((match = regex3.exec(markdown)) != null) {
|
|
1202243
1202265
|
const matchString = match[0];
|
|
1202244
|
-
const
|
|
1202266
|
+
const indent3 = match[1];
|
|
1202267
|
+
const src = match[2];
|
|
1202245
1202268
|
if (matchString == null || src == null) {
|
|
1202246
1202269
|
throw new Error(`Failed to parse regex "${match}" in ${absolutePathToMdx}`);
|
|
1202247
1202270
|
}
|
|
1202248
1202271
|
const filepath = resolve(src.startsWith("/") ? absolutePathToFernFolder : dirname(absolutePathToMdx), RelativeFilePath.of(src.replace(/^\//, "")));
|
|
1202249
1202272
|
try {
|
|
1202250
|
-
|
|
1202273
|
+
let replaceString = await markdownLoader(filepath);
|
|
1202274
|
+
replaceString = replaceString.split("\n").map((line) => indent3 + line).join("\n");
|
|
1202275
|
+
newMarkdown = newMarkdown.replace(matchString, replaceString);
|
|
1202251
1202276
|
} catch (e) {
|
|
1202252
1202277
|
context.failAndThrow(`Failed to read markdown file "${src}" referenced in ${absolutePathToMdx}`, e);
|
|
1202253
1202278
|
break;
|
|
@@ -1202256,8 +1202281,60 @@ async function replaceReferencedMarkdown({
|
|
|
1202256
1202281
|
return newMarkdown;
|
|
1202257
1202282
|
}
|
|
1202258
1202283
|
|
|
1202259
|
-
// pnp:/home/runner/work/fern/fern/packages/cli/
|
|
1202284
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/docs-markdown-utils/lib/replaceReferencedCode.js
|
|
1202260
1202285
|
var import_promises24 = require("fs/promises");
|
|
1202286
|
+
async function defaultFileLoader(filepath) {
|
|
1202287
|
+
const file = await (0, import_promises24.readFile)(filepath);
|
|
1202288
|
+
return file.toString();
|
|
1202289
|
+
}
|
|
1202290
|
+
async function replaceReferencedCode({
|
|
1202291
|
+
markdown,
|
|
1202292
|
+
absolutePathToFernFolder,
|
|
1202293
|
+
absolutePathToMdx,
|
|
1202294
|
+
context,
|
|
1202295
|
+
fileLoader = defaultFileLoader
|
|
1202296
|
+
}) {
|
|
1202297
|
+
if (!markdown.includes("<Code ")) {
|
|
1202298
|
+
return markdown;
|
|
1202299
|
+
}
|
|
1202300
|
+
const regex3 = /([ \t]*)<Code\s+src={?['"]([^'"]+)['"](?! \+)}?\s*\/>/g;
|
|
1202301
|
+
let newMarkdown = markdown;
|
|
1202302
|
+
let match;
|
|
1202303
|
+
while ((match = regex3.exec(markdown)) != null) {
|
|
1202304
|
+
const matchString = match[0];
|
|
1202305
|
+
const indent3 = match[1];
|
|
1202306
|
+
const src = match[2];
|
|
1202307
|
+
if (matchString == null || src == null) {
|
|
1202308
|
+
throw new Error(`Failed to parse regex "${match}" in ${absolutePathToMdx}`);
|
|
1202309
|
+
}
|
|
1202310
|
+
const filepath = resolve(src.startsWith("/") ? absolutePathToFernFolder : dirname(absolutePathToMdx), RelativeFilePath.of(src.replace(/^\//, "")));
|
|
1202311
|
+
try {
|
|
1202312
|
+
let replacement = await fileLoader(filepath);
|
|
1202313
|
+
let metastring = "";
|
|
1202314
|
+
const language = filepath.split(".").pop();
|
|
1202315
|
+
if (language != null) {
|
|
1202316
|
+
metastring += language;
|
|
1202317
|
+
}
|
|
1202318
|
+
const title2 = filepath.split("/").pop();
|
|
1202319
|
+
if (title2 != null) {
|
|
1202320
|
+
metastring += ` title="${title2}"`;
|
|
1202321
|
+
}
|
|
1202322
|
+
replacement = `\`\`\`${metastring}
|
|
1202323
|
+
${replacement}
|
|
1202324
|
+
\`\`\``;
|
|
1202325
|
+
replacement = replacement.split("\n").map((line) => indent3 + line).join("\n");
|
|
1202326
|
+
replacement = replacement + "\n";
|
|
1202327
|
+
newMarkdown = newMarkdown.replace(matchString, replacement);
|
|
1202328
|
+
} catch (e) {
|
|
1202329
|
+
context.failAndThrow(`Failed to read markdown file "${src}" referenced in ${absolutePathToMdx}`, e);
|
|
1202330
|
+
break;
|
|
1202331
|
+
}
|
|
1202332
|
+
}
|
|
1202333
|
+
return newMarkdown;
|
|
1202334
|
+
}
|
|
1202335
|
+
|
|
1202336
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/docsAst/visitDocsConfigFileAst.js
|
|
1202337
|
+
var import_promises25 = require("fs/promises");
|
|
1202261
1202338
|
var import_path17 = __toESM(require("path"));
|
|
1202262
1202339
|
async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToConfiguration, absolutePathToFernFolder, context) {
|
|
1202263
1202340
|
var _a5, _b4, _c4, _d2, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
@@ -1202282,6 +1202359,12 @@ async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToC
|
|
|
1202282
1202359
|
absolutePathToMdx: resolve(absolutePathToFernFolder, relativePath),
|
|
1202283
1202360
|
context
|
|
1202284
1202361
|
});
|
|
1202362
|
+
pageEntries[RelativeFilePath.of(relativePath)] = await replaceReferencedCode({
|
|
1202363
|
+
markdown,
|
|
1202364
|
+
absolutePathToFernFolder,
|
|
1202365
|
+
absolutePathToMdx: resolve(absolutePathToFernFolder, relativePath),
|
|
1202366
|
+
context
|
|
1202367
|
+
});
|
|
1202285
1202368
|
}
|
|
1202286
1202369
|
for (const [relativePath, markdown] of Object.entries(pageEntries)) {
|
|
1202287
1202370
|
const { filepaths } = parseImagePaths(markdown, {
|
|
@@ -1202450,7 +1202533,7 @@ async function visitDocsConfigFileYamlAst(contents, visitor, absoluteFilepathToC
|
|
|
1202450
1202533
|
willBeUploaded: false
|
|
1202451
1202534
|
});
|
|
1202452
1202535
|
const absoluteFilepath = resolve(dirname(absoluteFilepathToConfiguration), version3.path);
|
|
1202453
|
-
const content5 = js_yaml_default.load((await (0,
|
|
1202536
|
+
const content5 = js_yaml_default.load((await (0, import_promises25.readFile)(absoluteFilepath)).toString());
|
|
1202454
1202537
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1202455
1202538
|
await ((_a6 = visitor.versionFile) == null ? void 0 : _a6.call(visitor, {
|
|
1202456
1202539
|
path: version3.path,
|
|
@@ -1202515,7 +1202598,7 @@ async function visitNavigationItem({ navigationItem, visitor, nodePath, absolute
|
|
|
1202515
1202598
|
});
|
|
1202516
1202599
|
const absoluteFilepath = resolve(dirname(absoluteFilepathToConfiguration), navigationItem.path);
|
|
1202517
1202600
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1202518
|
-
const content5 = (await (0,
|
|
1202601
|
+
const content5 = (await (0, import_promises25.readFile)(absoluteFilepath)).toString();
|
|
1202519
1202602
|
await ((_a5 = visitor.markdownPage) == null ? void 0 : _a5.call(visitor, {
|
|
1202520
1202603
|
title: navigationItem.page,
|
|
1202521
1202604
|
content: content5,
|
|
@@ -1203762,7 +1203845,7 @@ var import_fiddle_sdk3 = __toESM(require_fiddle_sdk());
|
|
|
1203762
1203845
|
var import_axios3 = __toESM(require_axios4());
|
|
1203763
1203846
|
var import_fs3 = require("fs");
|
|
1203764
1203847
|
var import_path18 = __toESM(require("path"));
|
|
1203765
|
-
var
|
|
1203848
|
+
var import_promises26 = require("stream/promises");
|
|
1203766
1203849
|
var import_tar = __toESM(require_tar());
|
|
1203767
1203850
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
1203768
1203851
|
var FIDDLE = createFiddleService();
|
|
@@ -1203891,7 +1203974,7 @@ async function downloadDependency({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1203891
1203974
|
});
|
|
1203892
1203975
|
const tmpDir = await import_tmp_promise2.default.dir();
|
|
1203893
1203976
|
const outputTarPath = import_path18.default.join(tmpDir.path, "api.tgz");
|
|
1203894
|
-
await (0,
|
|
1203977
|
+
await (0, import_promises26.pipeline)(request.data, (0, import_fs3.createWriteStream)(outputTarPath));
|
|
1203895
1203978
|
await import_tar.default.extract({ file: outputTarPath, cwd: absolutePathToLocalOutput });
|
|
1203896
1203979
|
}
|
|
1203897
1203980
|
function stringifyDependency(dependency) {
|
|
@@ -1205146,7 +1205229,7 @@ function buildPathParameter({ pathParameter, context, fileContainingReference })
|
|
|
1205146
1205229
|
}
|
|
1205147
1205230
|
|
|
1205148
1205231
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/parse.js
|
|
1205149
|
-
var
|
|
1205232
|
+
var import_promises28 = require("fs/promises");
|
|
1205150
1205233
|
|
|
1205151
1205234
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/getExtension.js
|
|
1205152
1205235
|
function getExtension(object4, extension3) {
|
|
@@ -1209689,11 +1209772,11 @@ var import_swagger_parser = __toESM(require_lib17());
|
|
|
1209689
1209772
|
var import_openapi_core = __toESM(require_lib19());
|
|
1209690
1209773
|
|
|
1209691
1209774
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/mergeWithOverrides.js
|
|
1209692
|
-
var
|
|
1209775
|
+
var import_promises27 = require("fs/promises");
|
|
1209693
1209776
|
async function mergeWithOverrides({ absoluteFilepathToOverrides, data: data2, context }) {
|
|
1209694
1209777
|
let parsedOverrides = null;
|
|
1209695
1209778
|
try {
|
|
1209696
|
-
const contents = (await (0,
|
|
1209779
|
+
const contents = (await (0, import_promises27.readFile)(absoluteFilepathToOverrides, "utf8")).toString();
|
|
1209697
1209780
|
try {
|
|
1209698
1209781
|
parsedOverrides = JSON.parse(contents);
|
|
1209699
1209782
|
} catch (err) {
|
|
@@ -1212045,7 +1212128,7 @@ async function parse4({ specs, taskContext, optionOverrides }) {
|
|
|
1212045
1212128
|
groups: {}
|
|
1212046
1212129
|
};
|
|
1212047
1212130
|
for (const spec of specs) {
|
|
1212048
|
-
const contents = (await (0,
|
|
1212131
|
+
const contents = (await (0, import_promises28.readFile)(spec.absoluteFilepath)).toString();
|
|
1212049
1212132
|
if (contents.includes("openapi") || contents.includes("swagger")) {
|
|
1212050
1212133
|
const openApiDocument = await loadOpenAPI({
|
|
1212051
1212134
|
absolutePathToOpenAPI: spec.absoluteFilepath,
|
|
@@ -1212144,7 +1212227,7 @@ function merge3(ir1, ir2) {
|
|
|
1212144
1212227
|
};
|
|
1212145
1212228
|
}
|
|
1212146
1212229
|
async function loadAsyncAPI({ absoluteFilePathToAsyncAPI, absoluteFilePathToAsyncAPIOverrides, context }) {
|
|
1212147
|
-
const contents = (await (0,
|
|
1212230
|
+
const contents = (await (0, import_promises28.readFile)(absoluteFilePathToAsyncAPI)).toString();
|
|
1212148
1212231
|
const parsed = await js_yaml_default.load(contents);
|
|
1212149
1212232
|
if (absoluteFilePathToAsyncAPIOverrides != null) {
|
|
1212150
1212233
|
return await mergeWithOverrides({
|
|
@@ -1214510,7 +1214593,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
|
|
|
1214510
1214593
|
}
|
|
1214511
1214594
|
|
|
1214512
1214595
|
// pnp:/home/runner/work/fern/fern/packages/cli/workspace-loader/lib/loadDocsWorkspace.js
|
|
1214513
|
-
var
|
|
1214596
|
+
var import_promises29 = require("fs/promises");
|
|
1214514
1214597
|
var import_path21 = __toESM(require("path"));
|
|
1214515
1214598
|
async function loadDocsWorkspace({ fernDirectory, context }) {
|
|
1214516
1214599
|
const docsConfigurationFile = join(fernDirectory, RelativeFilePath.of(DOCS_CONFIGURATION_FILENAME));
|
|
@@ -1214543,7 +1214626,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context })
|
|
|
1214543
1214626
|
});
|
|
1214544
1214627
|
}
|
|
1214545
1214628
|
async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context }) {
|
|
1214546
|
-
const contentsStr = await (0,
|
|
1214629
|
+
const contentsStr = await (0, import_promises29.readFile)(absolutePathOfConfiguration);
|
|
1214547
1214630
|
const contentsJson = js_yaml_default.load(contentsStr.toString());
|
|
1214548
1214631
|
return await validateSchema2({
|
|
1214549
1214632
|
value: contentsJson,
|
|
@@ -1214630,7 +1214713,7 @@ async function visitAllPackageMarkers(workspace, visitor) {
|
|
|
1214630
1214713
|
}
|
|
1214631
1214714
|
|
|
1214632
1214715
|
// pnp:/home/runner/work/fern/fern/packages/cli/project-loader/lib/loadProject.js
|
|
1214633
|
-
var
|
|
1214716
|
+
var import_promises30 = require("fs/promises");
|
|
1214634
1214717
|
|
|
1214635
1214718
|
// pnp:/home/runner/work/fern/fern/packages/cli/project-loader/lib/handleFailedWorkspaceParserResult.js
|
|
1214636
1214719
|
function handleFailedWorkspaceParserResult(result2, logger) {
|
|
@@ -1214743,7 +1214826,7 @@ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLi
|
|
|
1214743
1214826
|
const apisDirectory = join(fernDirectory, RelativeFilePath.of(APIS_DIRECTORY));
|
|
1214744
1214827
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
1214745
1214828
|
if (apisDirectoryExists) {
|
|
1214746
|
-
const apiDirectoryContents = await (0,
|
|
1214829
|
+
const apiDirectoryContents = await (0, import_promises30.readdir)(apisDirectory, { withFileTypes: true });
|
|
1214747
1214830
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all5, item) => {
|
|
1214748
1214831
|
if (item.isDirectory()) {
|
|
1214749
1214832
|
all5.push(item.name);
|
|
@@ -1216498,7 +1216581,7 @@ var yargs_default = Yargs;
|
|
|
1216498
1216581
|
|
|
1216499
1216582
|
// pnp:/home/runner/work/fern/fern/packages/cli/init/src/utils/loadOpenApiFromUrl.ts
|
|
1216500
1216583
|
var import_axios4 = __toESM(require_axios4());
|
|
1216501
|
-
var
|
|
1216584
|
+
var import_promises31 = require("fs/promises");
|
|
1216502
1216585
|
var import_path27 = require("path");
|
|
1216503
1216586
|
var import_tmp_promise3 = __toESM(require_tmp_promise());
|
|
1216504
1216587
|
async function loadOpenAPIFromUrl({ url, logger }) {
|
|
@@ -1216510,7 +1216593,7 @@ async function loadOpenAPIFromUrl({ url, logger }) {
|
|
|
1216510
1216593
|
const filePath = (0, import_path27.join)(tmpDir.path, "openapi.yml");
|
|
1216511
1216594
|
logger.debug("tmpDir", tmpDir.path);
|
|
1216512
1216595
|
logger.debug("filePath", filePath);
|
|
1216513
|
-
await (0,
|
|
1216596
|
+
await (0, import_promises31.writeFile)(filePath, yamlData);
|
|
1216514
1216597
|
return {
|
|
1216515
1216598
|
status: "success" /* Success */,
|
|
1216516
1216599
|
filePath
|
|
@@ -1218214,10 +1218297,10 @@ var CliContext = class {
|
|
|
1218214
1218297
|
return "fern-api";
|
|
1218215
1218298
|
}
|
|
1218216
1218299
|
getPackageVersion() {
|
|
1218217
|
-
if ("0.
|
|
1218300
|
+
if ("0.36.0-rc1" == null) {
|
|
1218218
1218301
|
this.logger.error("CLI_VERSION is not defined");
|
|
1218219
1218302
|
}
|
|
1218220
|
-
return "0.
|
|
1218303
|
+
return "0.36.0-rc1";
|
|
1218221
1218304
|
}
|
|
1218222
1218305
|
getCliName() {
|
|
1218223
1218306
|
if ("fern" == null) {
|
|
@@ -1218390,7 +1218473,7 @@ function wrapWorkspaceNameForPrefix(workspaceName) {
|
|
|
1218390
1218473
|
}
|
|
1218391
1218474
|
|
|
1218392
1218475
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
1218393
|
-
var
|
|
1218476
|
+
var import_promises32 = require("fs/promises");
|
|
1218394
1218477
|
async function addGeneratorToWorkspaces({
|
|
1218395
1218478
|
project: { apiWorkspaces },
|
|
1218396
1218479
|
generatorName,
|
|
@@ -1218411,7 +1218494,7 @@ async function addGeneratorToWorkspaces({
|
|
|
1218411
1218494
|
groupName,
|
|
1218412
1218495
|
context
|
|
1218413
1218496
|
});
|
|
1218414
|
-
await (0,
|
|
1218497
|
+
await (0, import_promises32.writeFile)(
|
|
1218415
1218498
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1218416
1218499
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1218417
1218500
|
}),
|
|
@@ -1225894,7 +1225977,7 @@ function filterServiceTypeReferenceInfoForAudiences(serviceTypeReferenceInfo, fi
|
|
|
1225894
1225977
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/DocsDefinitionResolver.js
|
|
1225895
1225978
|
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
1225896
1225979
|
var import_utc3 = __toESM(require_utc());
|
|
1225897
|
-
var
|
|
1225980
|
+
var import_promises33 = require("fs/promises");
|
|
1225898
1225981
|
var import_gray_matter3 = __toESM(require_gray_matter());
|
|
1225899
1225982
|
|
|
1225900
1225983
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/utils/isSubpackage.js
|
|
@@ -1227986,6 +1228069,12 @@ var DocsDefinitionResolver = class {
|
|
|
1227986
1228069
|
absolutePathToMdx: this.resolveFilepath(relativePath),
|
|
1227987
1228070
|
context: this.taskContext
|
|
1227988
1228071
|
});
|
|
1228072
|
+
this.parsedDocsConfig.pages[RelativeFilePath.of(relativePath)] = await replaceReferencedCode({
|
|
1228073
|
+
markdown,
|
|
1228074
|
+
absolutePathToFernFolder: this.docsWorkspace.absoluteFilepath,
|
|
1228075
|
+
absolutePathToMdx: this.resolveFilepath(relativePath),
|
|
1228076
|
+
context: this.taskContext
|
|
1228077
|
+
});
|
|
1227989
1228078
|
}
|
|
1227990
1228079
|
const filesToUploadSet = collectFilesFromDocsConfig(this.parsedDocsConfig);
|
|
1227991
1228080
|
for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
|
|
@@ -1228034,7 +1228123,7 @@ var DocsDefinitionResolver = class {
|
|
|
1228034
1228123
|
const jsFilePaths = /* @__PURE__ */ new Set();
|
|
1228035
1228124
|
await Promise.all(this._parsedDocsConfig.experimental.mdxComponents.map(async (filepath) => {
|
|
1228036
1228125
|
const absoluteFilePath = resolve(this.docsWorkspace.absoluteFilepath, filepath);
|
|
1228037
|
-
const stats = await (0,
|
|
1228126
|
+
const stats = await (0, import_promises33.stat)(absoluteFilePath);
|
|
1228038
1228127
|
if (stats.isDirectory()) {
|
|
1228039
1228128
|
const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx}");
|
|
1228040
1228129
|
files.forEach((file) => {
|
|
@@ -1228046,7 +1228135,7 @@ var DocsDefinitionResolver = class {
|
|
|
1228046
1228135
|
}));
|
|
1228047
1228136
|
jsFiles = Object.fromEntries(await Promise.all([...jsFilePaths].map(async (filePath) => {
|
|
1228048
1228137
|
const relativeFilePath = this.toRelativeFilepath(filePath);
|
|
1228049
|
-
const contents = (await (0,
|
|
1228138
|
+
const contents = (await (0, import_promises33.readFile)(filePath)).toString();
|
|
1228050
1228139
|
return [relativeFilePath, contents];
|
|
1228051
1228140
|
})));
|
|
1228052
1228141
|
}
|
|
@@ -1230118,10 +1230207,10 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
1230118
1230207
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-preview/lib/downloadLocalDocsBundle.js
|
|
1230119
1230208
|
var import_decompress = __toESM(require_decompress());
|
|
1230120
1230209
|
var import_fs8 = require("fs");
|
|
1230121
|
-
var
|
|
1230210
|
+
var import_promises34 = require("fs/promises");
|
|
1230122
1230211
|
var import_os3 = require("os");
|
|
1230123
1230212
|
var import_path29 = __toESM(require("path"));
|
|
1230124
|
-
var
|
|
1230213
|
+
var import_promises35 = require("stream/promises");
|
|
1230125
1230214
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
1230126
1230215
|
var import_xml2js = __toESM(require_xml2js());
|
|
1230127
1230216
|
var ETAG_FILENAME = "etag";
|
|
@@ -1230152,7 +1230241,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1230152
1230241
|
let currentETag = void 0;
|
|
1230153
1230242
|
if (currentETagExists) {
|
|
1230154
1230243
|
logger.debug("Reading existing ETag");
|
|
1230155
|
-
currentETag = (await (0,
|
|
1230244
|
+
currentETag = (await (0, import_promises34.readFile)(eTagFilepath)).toString();
|
|
1230156
1230245
|
}
|
|
1230157
1230246
|
if (currentETag != null && currentETag === eTag) {
|
|
1230158
1230247
|
logger.debug("ETag matches. Using already downloaded bundle");
|
|
@@ -1230174,18 +1230263,18 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1230174
1230263
|
type: "failure"
|
|
1230175
1230264
|
};
|
|
1230176
1230265
|
}
|
|
1230177
|
-
await (0,
|
|
1230266
|
+
await (0, import_promises35.pipeline)(contents, (0, import_fs8.createWriteStream)(outputZipPath));
|
|
1230178
1230267
|
logger.debug(`Wrote output.zip to ${outputZipPath}`);
|
|
1230179
1230268
|
const absolutePathToPreviewFolder = getPathToPreviewFolder();
|
|
1230180
1230269
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1230181
|
-
await (0,
|
|
1230270
|
+
await (0, import_promises34.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1230182
1230271
|
}
|
|
1230183
|
-
await (0,
|
|
1230272
|
+
await (0, import_promises34.mkdir)(absolutePathToPreviewFolder, { recursive: true });
|
|
1230184
1230273
|
logger.debug(`rm -rf ${absolutePathToPreviewFolder}`);
|
|
1230185
1230274
|
const absolutePathToBundleFolder = getPathToBundleFolder();
|
|
1230186
|
-
await (0,
|
|
1230275
|
+
await (0, import_promises34.mkdir)(absolutePathToBundleFolder, { recursive: true });
|
|
1230187
1230276
|
await (0, import_decompress.default)(outputZipPath, absolutePathToBundleFolder);
|
|
1230188
|
-
await (0,
|
|
1230277
|
+
await (0, import_promises34.writeFile)(eTagFilepath, eTag);
|
|
1230189
1230278
|
logger.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
|
|
1230190
1230279
|
return {
|
|
1230191
1230280
|
type: "success"
|
|
@@ -1255285,7 +1255374,7 @@ var supportedExtensions = new Set(extensions);
|
|
|
1255285
1255374
|
var supportedMimeTypes = new Set(mimeTypes);
|
|
1255286
1255375
|
|
|
1255287
1255376
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/docs-validator/lib/rules/valid-file-types/valid-file-types.js
|
|
1255288
|
-
var
|
|
1255377
|
+
var import_promises36 = require("fs/promises");
|
|
1255289
1255378
|
var import_path32 = __toESM(require("path"));
|
|
1255290
1255379
|
var ALLOWED_FILE_TYPES = /* @__PURE__ */ new Set([
|
|
1255291
1255380
|
"image/jpeg",
|
|
@@ -1255362,7 +1255451,7 @@ var ValidFileTypes = {
|
|
|
1255362
1255451
|
}
|
|
1255363
1255452
|
};
|
|
1255364
1255453
|
var getViolationsForFile = async (absoluteFilepath) => {
|
|
1255365
|
-
const file = await (0,
|
|
1255454
|
+
const file = await (0, import_promises36.readFile)(absoluteFilepath);
|
|
1255366
1255455
|
const fileType = await fileTypeFromBuffer(file);
|
|
1255367
1255456
|
if (fileType != null) {
|
|
1255368
1255457
|
if (ALLOWED_FILE_TYPES.has(fileType.mime)) {
|
|
@@ -1255635,7 +1255724,7 @@ async function formatWorkspaces({
|
|
|
1255635
1255724
|
}
|
|
1255636
1255725
|
|
|
1255637
1255726
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
1255638
|
-
var
|
|
1255727
|
+
var import_promises37 = require("fs/promises");
|
|
1255639
1255728
|
var import_path35 = __toESM(require("path"));
|
|
1255640
1255729
|
|
|
1255641
1255730
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/validator/lib/rules/valid-field-names/regex.js
|
|
@@ -1259788,7 +1259877,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
1259788
1259877
|
snippetsConfig: {}
|
|
1259789
1259878
|
});
|
|
1259790
1259879
|
const resolvedOutputFilePath = import_path35.default.resolve(outputFilepath);
|
|
1259791
|
-
await (0,
|
|
1259880
|
+
await (0, import_promises37.writeFile)(resolvedOutputFilePath, await stringifyLargeObject(apiDefinition, { pretty: true }));
|
|
1259792
1259881
|
context.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
1259793
1259882
|
});
|
|
1259794
1259883
|
})
|
|
@@ -1269436,7 +1269525,7 @@ function migrateIntermediateRepresentationThroughVersion({ intermediateRepresent
|
|
|
1269436
1269525
|
}
|
|
1269437
1269526
|
|
|
1269438
1269527
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts
|
|
1269439
|
-
var
|
|
1269528
|
+
var import_promises38 = require("fs/promises");
|
|
1269440
1269529
|
var import_path36 = __toESM(require("path"));
|
|
1269441
1269530
|
async function generateIrForWorkspaces({
|
|
1269442
1269531
|
project,
|
|
@@ -1269466,7 +1269555,7 @@ async function generateIrForWorkspaces({
|
|
|
1269466
1269555
|
readme
|
|
1269467
1269556
|
});
|
|
1269468
1269557
|
const irOutputFilePath = import_path36.default.resolve(irFilepath);
|
|
1269469
|
-
await (0,
|
|
1269558
|
+
await (0, import_promises38.writeFile)(
|
|
1269470
1269559
|
irOutputFilePath,
|
|
1269471
1269560
|
await stringifyLargeObject(intermediateRepresentation, { pretty: true })
|
|
1269472
1269561
|
);
|
|
@@ -1269509,7 +1269598,7 @@ async function getIntermediateRepresentation({
|
|
|
1269509
1269598
|
}
|
|
1269510
1269599
|
|
|
1269511
1269600
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-openapi-ir/generateOpenAPIIrForWorkspaces.ts
|
|
1269512
|
-
var
|
|
1269601
|
+
var import_promises39 = require("fs/promises");
|
|
1269513
1269602
|
var import_path37 = __toESM(require("path"));
|
|
1269514
1269603
|
async function generateOpenAPIIrForWorkspaces({
|
|
1269515
1269604
|
project,
|
|
@@ -1269532,7 +1269621,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1269532
1269621
|
const openApiIrJson = await serialization_exports3.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
1269533
1269622
|
skipValidation: true
|
|
1269534
1269623
|
});
|
|
1269535
|
-
await (0,
|
|
1269624
|
+
await (0, import_promises39.writeFile)(irOutputFilePath, await stringifyLargeObject(openApiIrJson, { pretty: true }));
|
|
1269536
1269625
|
context.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
1269537
1269626
|
});
|
|
1269538
1269627
|
})
|
|
@@ -1269540,7 +1269629,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1269540
1269629
|
}
|
|
1269541
1269630
|
|
|
1269542
1269631
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
1269543
|
-
var
|
|
1269632
|
+
var import_promises40 = require("fs/promises");
|
|
1269544
1269633
|
async function writeOverridesForWorkspaces({
|
|
1269545
1269634
|
project,
|
|
1269546
1269635
|
includeModels,
|
|
@@ -1269565,7 +1269654,7 @@ async function writeOverridesForWorkspaces({
|
|
|
1269565
1269654
|
async function readExistingOverrides(overridesFilepath, context) {
|
|
1269566
1269655
|
let parsedOverrides = null;
|
|
1269567
1269656
|
try {
|
|
1269568
|
-
const contents = (await (0,
|
|
1269657
|
+
const contents = (await (0, import_promises40.readFile)(overridesFilepath, "utf8")).toString();
|
|
1269569
1269658
|
try {
|
|
1269570
1269659
|
parsedOverrides = JSON.parse(contents);
|
|
1269571
1269660
|
} catch (err) {
|
|
@@ -1269621,7 +1269710,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
1269621
1269710
|
}
|
|
1269622
1269711
|
}
|
|
1269623
1269712
|
const components = { schemas };
|
|
1269624
|
-
await (0,
|
|
1269713
|
+
await (0, import_promises40.writeFile)(
|
|
1269625
1269714
|
join(dirname(spec.absoluteFilepath), RelativeFilePath.of("openapi-overrides.yml")),
|
|
1269626
1269715
|
js_yaml_default.dump({ paths, components })
|
|
1269627
1269716
|
);
|
|
@@ -1269887,7 +1269976,7 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1269887
1269976
|
|
|
1269888
1269977
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/docker-utils/lib/runDocker.js
|
|
1269889
1269978
|
var import_dockerode2 = __toESM(require_docker());
|
|
1269890
|
-
var
|
|
1269979
|
+
var import_promises41 = require("fs/promises");
|
|
1269891
1269980
|
var import_stream4 = require("stream");
|
|
1269892
1269981
|
var import_tmp_promise5 = __toESM(require_tmp_promise());
|
|
1269893
1269982
|
async function runDocker({ imageName, args, binds, writeLogsToFile = true, removeAfterCompletion = false }) {
|
|
@@ -1269924,7 +1270013,7 @@ async function tryRunDocker({ docker, imageName, args, binds, removeAfterComplet
|
|
|
1269924
1270013
|
if (status.StatusCode !== 0) {
|
|
1269925
1270014
|
if (writeLogsToFile) {
|
|
1269926
1270015
|
const tmpFile = await import_tmp_promise5.default.file();
|
|
1269927
|
-
await (0,
|
|
1270016
|
+
await (0, import_promises41.writeFile)(tmpFile.path, logs);
|
|
1269928
1270017
|
throw new Error(`Docker exited with a non-zero exit code. Logs here: ${tmpFile.path}`);
|
|
1269929
1270018
|
} else {
|
|
1269930
1270019
|
throw new Error("Docker exited with a non-zero exit code.");
|
|
@@ -1269946,7 +1270035,7 @@ async function pullImage(docker, imageName) {
|
|
|
1269946
1270035
|
|
|
1269947
1270036
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/runGenerator.js
|
|
1269948
1270037
|
var FernGeneratorExecParsing = __toESM(require_serialization32());
|
|
1269949
|
-
var
|
|
1270038
|
+
var import_promises43 = require("fs/promises");
|
|
1269950
1270039
|
var import_tmp_promise7 = __toESM(require_tmp_promise());
|
|
1269951
1270040
|
|
|
1269952
1270041
|
// pnp:/home/runner/work/fern/fern/packages/commons/logging-execa/lib/loggingExeca.js
|
|
@@ -1269972,7 +1270061,7 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
|
|
|
1269972
1270061
|
|
|
1269973
1270062
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/LocalTaskHandler.js
|
|
1269974
1270063
|
var import_decompress2 = __toESM(require_decompress());
|
|
1269975
|
-
var
|
|
1270064
|
+
var import_promises42 = require("fs/promises");
|
|
1269976
1270065
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
1269977
1270066
|
var LocalTaskHandler = class {
|
|
1269978
1270067
|
context;
|
|
@@ -1270018,7 +1270107,7 @@ var LocalTaskHandler = class {
|
|
|
1270018
1270107
|
const tmpOutputResolutionDir = AbsoluteFilePath.of((await import_tmp_promise6.default.dir({})).path);
|
|
1270019
1270108
|
const absolutePathToFernignore = AbsoluteFilePath.of(join(this.absolutePathToLocalOutput, RelativeFilePath.of(FERNIGNORE_FILENAME)));
|
|
1270020
1270109
|
const fernIngnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1270021
|
-
await (0,
|
|
1270110
|
+
await (0, import_promises42.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1270022
1270111
|
await this.runGitCommand(["init"], tmpOutputResolutionDir);
|
|
1270023
1270112
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1270024
1270113
|
const response = await this.runGitCommand(["config", "--list"], tmpOutputResolutionDir);
|
|
@@ -1270031,16 +1270120,16 @@ var LocalTaskHandler = class {
|
|
|
1270031
1270120
|
await this.copyGeneratedFilesToDirectory(tmpOutputResolutionDir);
|
|
1270032
1270121
|
await this.runGitCommand(["reset", "--", ...fernIngnorePaths], tmpOutputResolutionDir);
|
|
1270033
1270122
|
await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
1270034
|
-
await (0,
|
|
1270035
|
-
await (0,
|
|
1270123
|
+
await (0, import_promises42.rmdir)(this.absolutePathToLocalOutput, { recursive: true });
|
|
1270124
|
+
await (0, import_promises42.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
|
|
1270036
1270125
|
}
|
|
1270037
1270126
|
async copyGeneratedFilesNoFernIgnore() {
|
|
1270038
1270127
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
1270039
|
-
await (0,
|
|
1270128
|
+
await (0, import_promises42.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
1270040
1270129
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
1270041
1270130
|
}
|
|
1270042
1270131
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
1270043
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
1270132
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises42.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
1270044
1270133
|
if (firstLocalOutputItem == null) {
|
|
1270045
1270134
|
return;
|
|
1270046
1270135
|
}
|
|
@@ -1270048,15 +1270137,15 @@ var LocalTaskHandler = class {
|
|
|
1270048
1270137
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
1270049
1270138
|
await (0, import_decompress2.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), outputPath);
|
|
1270050
1270139
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
1270051
|
-
await (0,
|
|
1270140
|
+
await (0, import_promises42.cp)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(localOutputItem)), join(outputPath, RelativeFilePath.of(localOutputItem)), { recursive: true });
|
|
1270052
1270141
|
}
|
|
1270053
1270142
|
} else {
|
|
1270054
|
-
await (0,
|
|
1270143
|
+
await (0, import_promises42.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
|
|
1270055
1270144
|
}
|
|
1270056
1270145
|
}
|
|
1270057
1270146
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
1270058
1270147
|
this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
|
|
1270059
|
-
await (0,
|
|
1270148
|
+
await (0, import_promises42.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
|
|
1270060
1270149
|
}
|
|
1270061
1270150
|
async runGitCommand(options2, cwd2) {
|
|
1270062
1270151
|
const response = await loggingExeca(this.context.logger, "git", options2, {
|
|
@@ -1270068,7 +1270157,7 @@ var LocalTaskHandler = class {
|
|
|
1270068
1270157
|
};
|
|
1270069
1270158
|
var NEW_LINE_REGEX = /\r?\n/;
|
|
1270070
1270159
|
async function getFernIgnorePaths({ absolutePathToFernignore }) {
|
|
1270071
|
-
const fernIgnoreFileContents = (await (0,
|
|
1270160
|
+
const fernIgnoreFileContents = (await (0, import_promises42.readFile)(absolutePathToFernignore)).toString();
|
|
1270072
1270161
|
return [
|
|
1270073
1270162
|
FERNIGNORE_FILENAME,
|
|
1270074
1270163
|
...fernIgnoreFileContents.trim().split(NEW_LINE_REGEX).filter((line) => !line.startsWith("#") && line.length > 0)
|
|
@@ -1270157,7 +1270246,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
1270157
1270246
|
tmpdir: workspaceTempDir.path
|
|
1270158
1270247
|
});
|
|
1270159
1270248
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
1270160
|
-
await (0,
|
|
1270249
|
+
await (0, import_promises43.writeFile)(absolutePathToIr, JSON.stringify(intermediateRepresentation, void 0, 4));
|
|
1270161
1270250
|
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
1270162
1270251
|
return absolutePathToIr;
|
|
1270163
1270252
|
}
|
|
@@ -1270186,7 +1270275,7 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
|
|
|
1270186
1270275
|
if (!parsedConfig.ok) {
|
|
1270187
1270276
|
throw new Error(`Failed to parse config.json into ${absolutePathToWriteConfigJson}`);
|
|
1270188
1270277
|
}
|
|
1270189
|
-
await (0,
|
|
1270278
|
+
await (0, import_promises43.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(parsedConfig.value, void 0, 4));
|
|
1270190
1270279
|
const doesConfigJsonExist = await waitUntilPathExists(absolutePathToWriteConfigJson, 5e3);
|
|
1270191
1270280
|
if (!doesConfigJsonExist) {
|
|
1270192
1270281
|
throw new Error(`Failed to create ${absolutePathToWriteConfigJson}`);
|
|
@@ -1270255,8 +1270344,8 @@ var import_fiddle_sdk5 = __toESM(require_fiddle_sdk());
|
|
|
1270255
1270344
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
1270256
1270345
|
var import_axios5 = __toESM(require_axios4());
|
|
1270257
1270346
|
var import_fs9 = require("fs");
|
|
1270258
|
-
var
|
|
1270259
|
-
var
|
|
1270347
|
+
var import_promises44 = require("fs/promises");
|
|
1270348
|
+
var import_promises45 = require("stream/promises");
|
|
1270260
1270349
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context }) {
|
|
1270261
1270350
|
try {
|
|
1270262
1270351
|
await downloadFileForTask({
|
|
@@ -1270273,17 +1270362,17 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
1270273
1270362
|
responseType: "stream"
|
|
1270274
1270363
|
});
|
|
1270275
1270364
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1270276
|
-
await (0,
|
|
1270365
|
+
await (0, import_promises44.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1270277
1270366
|
}
|
|
1270278
|
-
await (0,
|
|
1270279
|
-
await (0,
|
|
1270367
|
+
await (0, import_promises44.mkdir)(dirname(absolutePathToLocalOutput), { recursive: true });
|
|
1270368
|
+
await (0, import_promises45.pipeline)(request.data, (0, import_fs9.createWriteStream)(absolutePathToLocalOutput));
|
|
1270280
1270369
|
}
|
|
1270281
1270370
|
|
|
1270282
1270371
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
1270283
1270372
|
var import_fiddle_sdk4 = __toESM(require_fiddle_sdk());
|
|
1270284
1270373
|
var import_axios6 = __toESM(require_axios4());
|
|
1270285
1270374
|
var import_form_data2 = __toESM(require_form_data());
|
|
1270286
|
-
var
|
|
1270375
|
+
var import_promises46 = require("fs/promises");
|
|
1270287
1270376
|
var import_tar2 = __toESM(require_tar());
|
|
1270288
1270377
|
var import_tmp_promise9 = __toESM(require_tmp_promise());
|
|
1270289
1270378
|
|
|
@@ -1270349,15 +1270438,15 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270349
1270438
|
context.logger.debug(`Writing mock fern definition to ${absolutePathToTmpDir}`);
|
|
1270350
1270439
|
const absolutePathToTmpFernDirectory = join(absolutePathToTmpDir, RelativeFilePath.of(FERN_DIRECTORY));
|
|
1270351
1270440
|
const absolutePathToTmpDefinitionDirectory = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
1270352
|
-
await (0,
|
|
1270441
|
+
await (0, import_promises46.mkdir)(absolutePathToTmpDefinitionDirectory, { recursive: true });
|
|
1270353
1270442
|
const absolutePathToApiYml = join(absolutePathToTmpDefinitionDirectory, RelativeFilePath.of(ROOT_API_FILENAME));
|
|
1270354
|
-
await (0,
|
|
1270443
|
+
await (0, import_promises46.writeFile)(absolutePathToApiYml, js_yaml_default.dump(workspace.definition.rootApiFile.contents));
|
|
1270355
1270444
|
await writeFernDefinition({
|
|
1270356
1270445
|
absolutePathToDefinitionDirectory: absolutePathToTmpDefinitionDirectory,
|
|
1270357
1270446
|
definition: workspace.definition
|
|
1270358
1270447
|
});
|
|
1270359
1270448
|
const absolutePathToFernConfigJson = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(PROJECT_CONFIG_FILENAME));
|
|
1270360
|
-
await (0,
|
|
1270449
|
+
await (0, import_promises46.writeFile)(absolutePathToFernConfigJson, JSON.stringify(projectConfig.rawConfig, void 0, 2));
|
|
1270361
1270450
|
const tarPath = join(absolutePathToTmpDir, RelativeFilePath.of("definition.tgz"));
|
|
1270362
1270451
|
await import_tar2.default.create({ file: tarPath, cwd: absolutePathToTmpFernDirectory }, ["."]);
|
|
1270363
1270452
|
context.logger.debug("Getting upload URL for Fern definition.");
|
|
@@ -1270376,7 +1270465,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270376
1270465
|
}
|
|
1270377
1270466
|
} else {
|
|
1270378
1270467
|
context.logger.debug("Uploading definition...");
|
|
1270379
|
-
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0,
|
|
1270468
|
+
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0, import_promises46.readFile)(tarPath));
|
|
1270380
1270469
|
fernDefinitionMetadata = {
|
|
1270381
1270470
|
definitionS3DownloadUrl: definitionUploadUrlRequest.body.s3Url,
|
|
1270382
1270471
|
outputPath: ".mock",
|
|
@@ -1270438,14 +1270527,14 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1270438
1270527
|
async function writeFernDefinition({ absolutePathToDefinitionDirectory, definition: definition3 }) {
|
|
1270439
1270528
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1270440
1270529
|
const absolutePathToDefinitionFile = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1270441
|
-
await (0,
|
|
1270442
|
-
await (0,
|
|
1270530
|
+
await (0, import_promises46.mkdir)(dirname(absolutePathToDefinitionFile), { recursive: true });
|
|
1270531
|
+
await (0, import_promises46.writeFile)(absolutePathToDefinitionFile, js_yaml_default.dump(definitionFile.contents));
|
|
1270443
1270532
|
}
|
|
1270444
1270533
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1270445
1270534
|
if (packageMarker.contents.export == null) {
|
|
1270446
1270535
|
const absolutePathToPackageMarker = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1270447
|
-
await (0,
|
|
1270448
|
-
await (0,
|
|
1270536
|
+
await (0, import_promises46.mkdir)(dirname(absolutePathToPackageMarker), { recursive: true });
|
|
1270537
|
+
await (0, import_promises46.writeFile)(absolutePathToPackageMarker, js_yaml_default.dump(packageMarker.contents));
|
|
1270449
1270538
|
}
|
|
1270450
1270539
|
}
|
|
1270451
1270540
|
for (const [relativePath, importedDefinition] of Object.entries(definition3.importedDefinitions)) {
|
|
@@ -1270561,9 +1270650,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
1270561
1270650
|
var import_axios7 = __toESM(require_axios4());
|
|
1270562
1270651
|
var import_decompress3 = __toESM(require_decompress());
|
|
1270563
1270652
|
var import_fs10 = require("fs");
|
|
1270564
|
-
var
|
|
1270653
|
+
var import_promises47 = require("fs/promises");
|
|
1270565
1270654
|
var import_path40 = __toESM(require("path"));
|
|
1270566
|
-
var
|
|
1270655
|
+
var import_promises48 = require("stream/promises");
|
|
1270567
1270656
|
var import_tmp_promise10 = __toESM(require_tmp_promise());
|
|
1270568
1270657
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
1270569
1270658
|
var RemoteTaskHandler = class {
|
|
@@ -1270679,11 +1270768,11 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1270679
1270768
|
});
|
|
1270680
1270769
|
const tmpDir = await import_tmp_promise10.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1270681
1270770
|
const outputZipPath = import_path40.default.join(tmpDir.path, "output.zip");
|
|
1270682
|
-
await (0,
|
|
1270771
|
+
await (0, import_promises48.pipeline)(request.data, (0, import_fs10.createWriteStream)(outputZipPath));
|
|
1270683
1270772
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1270684
|
-
await (0,
|
|
1270773
|
+
await (0, import_promises47.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1270685
1270774
|
}
|
|
1270686
|
-
await (0,
|
|
1270775
|
+
await (0, import_promises47.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
1270687
1270776
|
await (0, import_decompress3.default)(outputZipPath, absolutePathToLocalOutput);
|
|
1270688
1270777
|
}
|
|
1270689
1270778
|
function convertLogLevel(logLevel) {
|
|
@@ -1270820,7 +1270909,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
1270820
1270909
|
|
|
1270821
1270910
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
1270822
1270911
|
var import_axios8 = __toESM(require_axios4());
|
|
1270823
|
-
var
|
|
1270912
|
+
var import_promises49 = require("fs/promises");
|
|
1270824
1270913
|
var mime = __toESM(require_mime_types());
|
|
1270825
1270914
|
|
|
1270826
1270915
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
@@ -1270975,7 +1271064,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context, batchSize)
|
|
|
1270975
1271064
|
const absoluteFilePath = resolve(docsWorkspacePath, relativeFilePath);
|
|
1270976
1271065
|
try {
|
|
1270977
1271066
|
const mimeType = mime.lookup(absoluteFilePath);
|
|
1270978
|
-
await import_axios8.default.put(uploadUrl, await (0,
|
|
1271067
|
+
await import_axios8.default.put(uploadUrl, await (0, import_promises49.readFile)(absoluteFilePath), {
|
|
1270979
1271068
|
headers: {
|
|
1270980
1271069
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
1270981
1271070
|
}
|
|
@@ -1271555,7 +1271644,7 @@ async function mockServer({
|
|
|
1271555
1271644
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
1271556
1271645
|
var import_fiddle_sdk6 = __toESM(require_fiddle_sdk());
|
|
1271557
1271646
|
var import_axios9 = __toESM(require_axios4());
|
|
1271558
|
-
var
|
|
1271647
|
+
var import_promises50 = require("fs/promises");
|
|
1271559
1271648
|
var import_path41 = __toESM(require("path"));
|
|
1271560
1271649
|
var import_tar3 = __toESM(require_tar());
|
|
1271561
1271650
|
var import_tmp_promise11 = __toESM(require_tmp_promise());
|
|
@@ -1271604,7 +1271693,7 @@ async function registerWorkspacesV1({
|
|
|
1271604
1271693
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1271605
1271694
|
await import_tar3.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
|
|
1271606
1271695
|
context.logger.info("Uploading definition...");
|
|
1271607
|
-
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
1271696
|
+
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises50.readFile)(tarPath));
|
|
1271608
1271697
|
context.logger.info(
|
|
1271609
1271698
|
`Registered @${project.config.organization}/${workspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
1271610
1271699
|
);
|
|
@@ -1271728,20 +1271817,20 @@ async function generateToken({
|
|
|
1271728
1271817
|
|
|
1271729
1271818
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/updateApiSpec.ts
|
|
1271730
1271819
|
var fs9 = __toESM(require("fs"));
|
|
1271731
|
-
var
|
|
1271820
|
+
var import_promises51 = require("fs/promises");
|
|
1271732
1271821
|
var import_stream5 = require("stream");
|
|
1271733
|
-
var
|
|
1271822
|
+
var import_promises52 = require("stream/promises");
|
|
1271734
1271823
|
async function fetchAndWriteFile(url, path44, logger) {
|
|
1271735
1271824
|
const resp = await fetch(url);
|
|
1271736
1271825
|
if (resp.ok && resp.body) {
|
|
1271737
1271826
|
logger.debug("Origin successfully fetched, writing to file");
|
|
1271738
1271827
|
const fileStream = fs9.createWriteStream(path44);
|
|
1271739
|
-
await (0,
|
|
1271740
|
-
const fileContents = await (0,
|
|
1271828
|
+
await (0, import_promises52.finished)(import_stream5.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
1271829
|
+
const fileContents = await (0, import_promises51.readFile)(path44, "utf8");
|
|
1271741
1271830
|
try {
|
|
1271742
|
-
await (0,
|
|
1271831
|
+
await (0, import_promises51.writeFile)(path44, JSON.stringify(JSON.parse(fileContents), void 0, 2), "utf8");
|
|
1271743
1271832
|
} catch (e) {
|
|
1271744
|
-
await (0,
|
|
1271833
|
+
await (0, import_promises51.writeFile)(path44, js_yaml_default.dump(js_yaml_default.load(fileContents)), "utf8");
|
|
1271745
1271834
|
}
|
|
1271746
1271835
|
logger.debug("File written successfully");
|
|
1271747
1271836
|
}
|
|
@@ -1271815,17 +1271904,17 @@ async function updateApiSpec({
|
|
|
1271815
1271904
|
}
|
|
1271816
1271905
|
|
|
1271817
1271906
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
1271818
|
-
var
|
|
1271907
|
+
var import_promises55 = require("fs/promises");
|
|
1271819
1271908
|
|
|
1271820
1271909
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
1271821
|
-
var
|
|
1271910
|
+
var import_promises53 = require("fs/promises");
|
|
1271822
1271911
|
var FERN_DIRECTORY2 = "fern";
|
|
1271823
1271912
|
async function loadWorkspaces(context) {
|
|
1271824
1271913
|
const fernDirectory = await getFernDirectory2();
|
|
1271825
1271914
|
if (fernDirectory == null) {
|
|
1271826
1271915
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
1271827
1271916
|
}
|
|
1271828
|
-
const fernDirectoryContents = await (0,
|
|
1271917
|
+
const fernDirectoryContents = await (0, import_promises53.readdir)(fernDirectory, { withFileTypes: true });
|
|
1271829
1271918
|
return fernDirectoryContents.reduce((all5, item) => {
|
|
1271830
1271919
|
if (item.isDirectory()) {
|
|
1271831
1271920
|
all5.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -1271860,7 +1271949,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
1271860
1271949
|
}
|
|
1271861
1271950
|
|
|
1271862
1271951
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1271863
|
-
var
|
|
1271952
|
+
var import_promises54 = require("fs/promises");
|
|
1271864
1271953
|
|
|
1271865
1271954
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
1271866
1271955
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -1271883,7 +1271972,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
1271883
1271972
|
|
|
1271884
1271973
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1271885
1271974
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
1271886
|
-
const contentsStr = await (0,
|
|
1271975
|
+
const contentsStr = await (0, import_promises54.readFile)(absolutePathToGeneratorsConfiguration);
|
|
1271887
1271976
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1271888
1271977
|
return await validateSchema({
|
|
1271889
1271978
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -1271919,7 +1272008,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
1271919
1272008
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
1271920
1272009
|
});
|
|
1271921
1272010
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
1271922
|
-
await (0,
|
|
1272011
|
+
await (0, import_promises55.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
1271923
1272012
|
}
|
|
1271924
1272013
|
function migrateConfiguration(oldConfiguration) {
|
|
1271925
1272014
|
return {
|
|
@@ -1271945,7 +1272034,7 @@ var versionMigrations = {
|
|
|
1271945
1272034
|
var __default = versionMigrations;
|
|
1271946
1272035
|
|
|
1271947
1272036
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
1271948
|
-
var
|
|
1272037
|
+
var import_promises56 = require("fs/promises");
|
|
1271949
1272038
|
|
|
1271950
1272039
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
1271951
1272040
|
var import_glob_promise2 = __toESM(require_lib());
|
|
@@ -1271979,7 +1272068,7 @@ var migration2 = {
|
|
|
1271979
1272068
|
try {
|
|
1271980
1272069
|
const fileContents = await getFileContents(yamlFilepath);
|
|
1271981
1272070
|
const newContents = addDiscriminantToFile(fileContents);
|
|
1271982
|
-
await (0,
|
|
1272071
|
+
await (0, import_promises56.writeFile)(yamlFilepath, newContents);
|
|
1271983
1272072
|
} catch (error) {
|
|
1271984
1272073
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
1271985
1272074
|
}
|
|
@@ -1271987,7 +1272076,7 @@ var migration2 = {
|
|
|
1271987
1272076
|
}
|
|
1271988
1272077
|
};
|
|
1271989
1272078
|
async function getFileContents(filepath) {
|
|
1271990
|
-
const buffer3 = await (0,
|
|
1272079
|
+
const buffer3 = await (0, import_promises56.readFile)(filepath);
|
|
1271991
1272080
|
return buffer3.toString();
|
|
1271992
1272081
|
}
|
|
1271993
1272082
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -1272016,7 +1272105,7 @@ var versionMigrations2 = {
|
|
|
1272016
1272105
|
var __default2 = versionMigrations2;
|
|
1272017
1272106
|
|
|
1272018
1272107
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
1272019
|
-
var
|
|
1272108
|
+
var import_promises57 = require("fs/promises");
|
|
1272020
1272109
|
var import_yaml = __toESM(require_dist4());
|
|
1272021
1272110
|
|
|
1272022
1272111
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -1272057,7 +1272146,7 @@ var migration3 = {
|
|
|
1272057
1272146
|
}
|
|
1272058
1272147
|
};
|
|
1272059
1272148
|
async function migrateFile(filepath, context) {
|
|
1272060
|
-
const contents = await (0,
|
|
1272149
|
+
const contents = await (0, import_promises57.readFile)(filepath);
|
|
1272061
1272150
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
1272062
1272151
|
const types3 = parsedDocument.get("types");
|
|
1272063
1272152
|
if (types3 == null) {
|
|
@@ -1272089,7 +1272178,7 @@ async function migrateFile(filepath, context) {
|
|
|
1272089
1272178
|
}
|
|
1272090
1272179
|
}
|
|
1272091
1272180
|
}
|
|
1272092
|
-
await (0,
|
|
1272181
|
+
await (0, import_promises57.writeFile)(filepath, parsedDocument.toString());
|
|
1272093
1272182
|
}
|
|
1272094
1272183
|
|
|
1272095
1272184
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -1272100,7 +1272189,7 @@ var versionMigrations3 = {
|
|
|
1272100
1272189
|
var __default3 = versionMigrations3;
|
|
1272101
1272190
|
|
|
1272102
1272191
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
1272103
|
-
var
|
|
1272192
|
+
var import_promises58 = require("fs/promises");
|
|
1272104
1272193
|
var import_yaml2 = __toESM(require_dist4());
|
|
1272105
1272194
|
|
|
1272106
1272195
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1272141,7 +1272230,7 @@ var migration4 = {
|
|
|
1272141
1272230
|
}
|
|
1272142
1272231
|
};
|
|
1272143
1272232
|
async function migrateGeneratorsYml(filepath, context) {
|
|
1272144
|
-
const contents = await (0,
|
|
1272233
|
+
const contents = await (0, import_promises58.readFile)(filepath);
|
|
1272145
1272234
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
1272146
1272235
|
const draftGenerators = parsedDocument.get("draft");
|
|
1272147
1272236
|
if (draftGenerators == null) {
|
|
@@ -1272168,7 +1272257,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
1272168
1272257
|
draftGenerator.set("output-path", name3.value.includes("openapi") ? "./generated-openapi" : name3.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
1272169
1272258
|
}
|
|
1272170
1272259
|
});
|
|
1272171
|
-
await (0,
|
|
1272260
|
+
await (0, import_promises58.writeFile)(filepath, parsedDocument.toString());
|
|
1272172
1272261
|
}
|
|
1272173
1272262
|
|
|
1272174
1272263
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -1272179,7 +1272268,7 @@ var versionMigrations4 = {
|
|
|
1272179
1272268
|
var __default4 = versionMigrations4;
|
|
1272180
1272269
|
|
|
1272181
1272270
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
1272182
|
-
var
|
|
1272271
|
+
var import_promises59 = require("fs/promises");
|
|
1272183
1272272
|
var import_yaml3 = __toESM(require_dist4());
|
|
1272184
1272273
|
|
|
1272185
1272274
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -1272220,7 +1272309,7 @@ var migration5 = {
|
|
|
1272220
1272309
|
}
|
|
1272221
1272310
|
};
|
|
1272222
1272311
|
async function migrateFile2(filepath, context) {
|
|
1272223
|
-
const contents = await (0,
|
|
1272312
|
+
const contents = await (0, import_promises59.readFile)(filepath);
|
|
1272224
1272313
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
1272225
1272314
|
const addType = (typeName, typeDeclaration) => {
|
|
1272226
1272315
|
const types3 = parsedDocument.get("types");
|
|
@@ -1272264,7 +1272353,7 @@ async function migrateFile2(filepath, context) {
|
|
|
1272264
1272353
|
}
|
|
1272265
1272354
|
}
|
|
1272266
1272355
|
}
|
|
1272267
|
-
await (0,
|
|
1272356
|
+
await (0, import_promises59.writeFile)(filepath, parsedDocument.toString());
|
|
1272268
1272357
|
}
|
|
1272269
1272358
|
|
|
1272270
1272359
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -1272275,7 +1272364,7 @@ var versionMigrations5 = {
|
|
|
1272275
1272364
|
var __default5 = versionMigrations5;
|
|
1272276
1272365
|
|
|
1272277
1272366
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
1272278
|
-
var
|
|
1272367
|
+
var import_promises60 = require("fs/promises");
|
|
1272279
1272368
|
var import_yaml4 = __toESM(require_dist4());
|
|
1272280
1272369
|
|
|
1272281
1272370
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1272316,7 +1272405,7 @@ var migration6 = {
|
|
|
1272316
1272405
|
}
|
|
1272317
1272406
|
};
|
|
1272318
1272407
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
1272319
|
-
const contents = await (0,
|
|
1272408
|
+
const contents = await (0, import_promises60.readFile)(filepath);
|
|
1272320
1272409
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
1272321
1272410
|
const releaseGenerators = parsedDocument.get("release");
|
|
1272322
1272411
|
if (releaseGenerators == null) {
|
|
@@ -1272354,7 +1272443,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
1272354
1272443
|
}
|
|
1272355
1272444
|
releaseGenerator.delete("outputs");
|
|
1272356
1272445
|
});
|
|
1272357
|
-
await (0,
|
|
1272446
|
+
await (0, import_promises60.writeFile)(filepath, parsedDocument.toString());
|
|
1272358
1272447
|
}
|
|
1272359
1272448
|
|
|
1272360
1272449
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -1272365,7 +1272454,7 @@ var versionMigrations6 = {
|
|
|
1272365
1272454
|
var __default6 = versionMigrations6;
|
|
1272366
1272455
|
|
|
1272367
1272456
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
1272368
|
-
var
|
|
1272457
|
+
var import_promises61 = require("fs/promises");
|
|
1272369
1272458
|
|
|
1272370
1272459
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
1272371
1272460
|
var import_glob_promise7 = __toESM(require_lib());
|
|
@@ -1272396,9 +1272485,9 @@ var migration7 = {
|
|
|
1272396
1272485
|
run: async ({ context }) => {
|
|
1272397
1272486
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
1272398
1272487
|
for (const filepath of yamlFiles) {
|
|
1272399
|
-
const contents = await (0,
|
|
1272488
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
1272400
1272489
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
1272401
|
-
await (0,
|
|
1272490
|
+
await (0, import_promises61.writeFile)(filepath, newContents);
|
|
1272402
1272491
|
}
|
|
1272403
1272492
|
}
|
|
1272404
1272493
|
};
|
|
@@ -1272411,7 +1272500,7 @@ var versionMigrations7 = {
|
|
|
1272411
1272500
|
var __default7 = versionMigrations7;
|
|
1272412
1272501
|
|
|
1272413
1272502
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
1272414
|
-
var
|
|
1272503
|
+
var import_promises62 = require("fs/promises");
|
|
1272415
1272504
|
|
|
1272416
1272505
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
1272417
1272506
|
var import_glob_promise8 = __toESM(require_lib());
|
|
@@ -1272442,9 +1272531,9 @@ var migration8 = {
|
|
|
1272442
1272531
|
run: async ({ context }) => {
|
|
1272443
1272532
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
1272444
1272533
|
for (const filepath of yamlFiles) {
|
|
1272445
|
-
const contents = await (0,
|
|
1272534
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
1272446
1272535
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
1272447
|
-
await (0,
|
|
1272536
|
+
await (0, import_promises62.writeFile)(filepath, newContents);
|
|
1272448
1272537
|
}
|
|
1272449
1272538
|
}
|
|
1272450
1272539
|
};
|
|
@@ -1272457,7 +1272546,7 @@ var versionMigrations8 = {
|
|
|
1272457
1272546
|
var __default8 = versionMigrations8;
|
|
1272458
1272547
|
|
|
1272459
1272548
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
1272460
|
-
var
|
|
1272549
|
+
var import_promises63 = require("fs/promises");
|
|
1272461
1272550
|
|
|
1272462
1272551
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
1272463
1272552
|
var import_glob_promise9 = __toESM(require_lib());
|
|
@@ -1272564,7 +1272653,7 @@ var migration9 = {
|
|
|
1272564
1272653
|
}
|
|
1272565
1272654
|
};
|
|
1272566
1272655
|
async function migrateGeneratorsYml3(filepath) {
|
|
1272567
|
-
const contentsStr = await (0,
|
|
1272656
|
+
const contentsStr = await (0, import_promises63.readFile)(filepath);
|
|
1272568
1272657
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
1272569
1272658
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
1272570
1272659
|
let newGeneratorsConfiguration = {};
|
|
@@ -1272582,7 +1272671,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
1272582
1272671
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
1272583
1272672
|
};
|
|
1272584
1272673
|
}
|
|
1272585
|
-
await (0,
|
|
1272674
|
+
await (0, import_promises63.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
1272586
1272675
|
}
|
|
1272587
1272676
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
1272588
1272677
|
const newSchema = {
|
|
@@ -1272657,7 +1272746,7 @@ var versionMigrations9 = {
|
|
|
1272657
1272746
|
var __default9 = versionMigrations9;
|
|
1272658
1272747
|
|
|
1272659
1272748
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
1272660
|
-
var
|
|
1272749
|
+
var import_promises64 = require("fs/promises");
|
|
1272661
1272750
|
var import_yaml5 = __toESM(require_dist4());
|
|
1272662
1272751
|
|
|
1272663
1272752
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -1272698,7 +1272787,7 @@ var migration10 = {
|
|
|
1272698
1272787
|
}
|
|
1272699
1272788
|
};
|
|
1272700
1272789
|
async function migrateRootApiFile(filepath) {
|
|
1272701
|
-
const contents = await (0,
|
|
1272790
|
+
const contents = await (0, import_promises64.readFile)(filepath);
|
|
1272702
1272791
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
1272703
1272792
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
1272704
1272793
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -1272709,7 +1272798,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
1272709
1272798
|
"property-name": errorDiscriminant.value
|
|
1272710
1272799
|
});
|
|
1272711
1272800
|
parsedDocument.delete("error-discriminant");
|
|
1272712
|
-
await (0,
|
|
1272801
|
+
await (0, import_promises64.writeFile)(filepath, parsedDocument.toString());
|
|
1272713
1272802
|
}
|
|
1272714
1272803
|
|
|
1272715
1272804
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -1272720,7 +1272809,7 @@ var versionMigrations10 = {
|
|
|
1272720
1272809
|
var __default10 = versionMigrations10;
|
|
1272721
1272810
|
|
|
1272722
1272811
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
1272723
|
-
var
|
|
1272812
|
+
var import_promises65 = require("fs/promises");
|
|
1272724
1272813
|
var import_yaml6 = __toESM(require_dist4());
|
|
1272725
1272814
|
|
|
1272726
1272815
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -1272761,7 +1272850,7 @@ var migration11 = {
|
|
|
1272761
1272850
|
}
|
|
1272762
1272851
|
};
|
|
1272763
1272852
|
async function migrateYamlFile(filepath, context) {
|
|
1272764
|
-
const contents = await (0,
|
|
1272853
|
+
const contents = await (0, import_promises65.readFile)(filepath);
|
|
1272765
1272854
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
1272766
1272855
|
const services = parsedDocument.get("services");
|
|
1272767
1272856
|
if (services == null) {
|
|
@@ -1272801,7 +1272890,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
1272801
1272890
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
1272802
1272891
|
}
|
|
1272803
1272892
|
}
|
|
1272804
|
-
await (0,
|
|
1272893
|
+
await (0, import_promises65.writeFile)(filepath, parsedDocument.toString());
|
|
1272805
1272894
|
}
|
|
1272806
1272895
|
}
|
|
1272807
1272896
|
function convertEndpoint17({ document: document6, endpoint }) {
|
|
@@ -1272885,10 +1272974,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
1272885
1272974
|
var LegacyDocsSerializers = __toESM(require_serialization33());
|
|
1272886
1272975
|
|
|
1272887
1272976
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
1272888
|
-
var
|
|
1272977
|
+
var import_promises66 = require("fs/promises");
|
|
1272889
1272978
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
1272890
1272979
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1272891
|
-
const contentsStr = await (0,
|
|
1272980
|
+
const contentsStr = await (0, import_promises66.readFile)(filepath);
|
|
1272892
1272981
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1272893
1272982
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
1272894
1272983
|
if (result2.ok) {
|
|
@@ -1272906,7 +1272995,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
1272906
1272995
|
}
|
|
1272907
1272996
|
|
|
1272908
1272997
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
1272909
|
-
var
|
|
1272998
|
+
var import_promises68 = require("fs/promises");
|
|
1272910
1272999
|
|
|
1272911
1273000
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
1272912
1273001
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -1273087,10 +1273176,10 @@ __export(legacy_exports, {
|
|
|
1273087
1273176
|
});
|
|
1273088
1273177
|
|
|
1273089
1273178
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
1273090
|
-
var
|
|
1273179
|
+
var import_promises67 = require("fs/promises");
|
|
1273091
1273180
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
1273092
1273181
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
1273093
|
-
const contentsStr = await (0,
|
|
1273182
|
+
const contentsStr = await (0, import_promises67.readFile)(filepath);
|
|
1273094
1273183
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1273095
1273184
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
1273096
1273185
|
if (result2.success) {
|
|
@@ -1273210,7 +1273299,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
1273210
1273299
|
var APIS_DIRECTORY2 = "apis";
|
|
1273211
1273300
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
1273212
1273301
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
1273213
|
-
await (0,
|
|
1273302
|
+
await (0, import_promises68.mkdir)(absolutePathToApisDirectory);
|
|
1273214
1273303
|
for (const workspace of workspaces) {
|
|
1273215
1273304
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1273216
1273305
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -1273218,11 +1273307,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
1273218
1273307
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
1273219
1273308
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1273220
1273309
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1273221
|
-
await (0,
|
|
1273310
|
+
await (0, import_promises68.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1273222
1273311
|
}
|
|
1273223
1273312
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1273224
1273313
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1273225
|
-
await (0,
|
|
1273314
|
+
await (0, import_promises68.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273226
1273315
|
}
|
|
1273227
1273316
|
}
|
|
1273228
1273317
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -1273235,7 +1273324,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
1273235
1273324
|
generatorsConfiguration,
|
|
1273236
1273325
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1273237
1273326
|
});
|
|
1273238
|
-
await (0,
|
|
1273327
|
+
await (0, import_promises68.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273239
1273328
|
return convertedResponse.docsURLs;
|
|
1273240
1273329
|
}
|
|
1273241
1273330
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -1273249,19 +1273338,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
1273249
1273338
|
apiName
|
|
1273250
1273339
|
});
|
|
1273251
1273340
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1273252
|
-
await (0,
|
|
1273341
|
+
await (0, import_promises68.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1273253
1273342
|
}
|
|
1273254
1273343
|
|
|
1273255
1273344
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
1273256
|
-
var
|
|
1273345
|
+
var import_promises69 = require("fs/promises");
|
|
1273257
1273346
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1273258
1273347
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
1273259
1273348
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
1273260
1273349
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1273261
1273350
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1273262
1273351
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1273263
|
-
await (0,
|
|
1273264
|
-
await (0,
|
|
1273352
|
+
await (0, import_promises69.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1273353
|
+
await (0, import_promises69.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273265
1273354
|
}
|
|
1273266
1273355
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
1273267
1273356
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1273274,7 +1273363,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
1273274
1273363
|
apiName: void 0
|
|
1273275
1273364
|
});
|
|
1273276
1273365
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1273277
|
-
await (0,
|
|
1273366
|
+
await (0, import_promises69.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1273278
1273367
|
}
|
|
1273279
1273368
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
1273280
1273369
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1273286,22 +1273375,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
1273286
1273375
|
generatorsConfiguration,
|
|
1273287
1273376
|
pathModificationStrategy: "MoveUp"
|
|
1273288
1273377
|
});
|
|
1273289
|
-
await (0,
|
|
1273378
|
+
await (0, import_promises69.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273290
1273379
|
return convertedResponse.docsURLs;
|
|
1273291
1273380
|
}
|
|
1273292
1273381
|
|
|
1273293
1273382
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
1273294
|
-
var
|
|
1273383
|
+
var import_promises70 = require("fs/promises");
|
|
1273295
1273384
|
var APIS_DIRECTORY3 = "apis";
|
|
1273296
1273385
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
1273297
1273386
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
1273298
|
-
await (0,
|
|
1273387
|
+
await (0, import_promises70.mkdir)(absolutePathToApisDirectory);
|
|
1273299
1273388
|
for (const workspace of workspaces) {
|
|
1273300
1273389
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1273301
1273390
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
1273302
1273391
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1273303
1273392
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1273304
|
-
await (0,
|
|
1273393
|
+
await (0, import_promises70.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1273305
1273394
|
}
|
|
1273306
1273395
|
}
|
|
1273307
1273396
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -1273314,15 +1273403,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
1273314
1273403
|
generatorsConfiguration,
|
|
1273315
1273404
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1273316
1273405
|
});
|
|
1273317
|
-
await (0,
|
|
1273406
|
+
await (0, import_promises70.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273318
1273407
|
}
|
|
1273319
1273408
|
|
|
1273320
1273409
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
1273321
|
-
var
|
|
1273410
|
+
var import_promises71 = require("fs/promises");
|
|
1273322
1273411
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1273323
1273412
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
1273324
1273413
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1273325
|
-
await (0,
|
|
1273414
|
+
await (0, import_promises71.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
1273326
1273415
|
}
|
|
1273327
1273416
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
1273328
1273417
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1273334,7 +1273423,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
1273334
1273423
|
generatorsConfiguration,
|
|
1273335
1273424
|
pathModificationStrategy: "MoveUp"
|
|
1273336
1273425
|
});
|
|
1273337
|
-
await (0,
|
|
1273426
|
+
await (0, import_promises71.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1273338
1273427
|
}
|
|
1273339
1273428
|
|
|
1273340
1273429
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -1273411,7 +1273500,7 @@ var versionMigrations12 = {
|
|
|
1273411
1273500
|
var __default12 = versionMigrations12;
|
|
1273412
1273501
|
|
|
1273413
1273502
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
1273414
|
-
var
|
|
1273503
|
+
var import_promises72 = require("fs/promises");
|
|
1273415
1273504
|
var import_yaml7 = __toESM(require_dist4());
|
|
1273416
1273505
|
|
|
1273417
1273506
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -1273452,7 +1273541,7 @@ var migration13 = {
|
|
|
1273452
1273541
|
}
|
|
1273453
1273542
|
};
|
|
1273454
1273543
|
async function migrateYamlFile2(filepath, context) {
|
|
1273455
|
-
const contents = await (0,
|
|
1273544
|
+
const contents = await (0, import_promises72.readFile)(filepath);
|
|
1273456
1273545
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
1273457
1273546
|
const types3 = parsedDocument.get("types");
|
|
1273458
1273547
|
if (types3 == null) {
|
|
@@ -1273478,7 +1273567,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
1273478
1273567
|
examples.set(i2, { value });
|
|
1273479
1273568
|
}
|
|
1273480
1273569
|
}
|
|
1273481
|
-
await (0,
|
|
1273570
|
+
await (0, import_promises72.writeFile)(filepath, parsedDocument.toString());
|
|
1273482
1273571
|
}
|
|
1273483
1273572
|
|
|
1273484
1273573
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -1273489,7 +1273578,7 @@ var versionMigrations13 = {
|
|
|
1273489
1273578
|
var __default13 = versionMigrations13;
|
|
1273490
1273579
|
|
|
1273491
1273580
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
1273492
|
-
var
|
|
1273581
|
+
var import_promises73 = require("fs/promises");
|
|
1273493
1273582
|
var import_yaml8 = __toESM(require_dist4());
|
|
1273494
1273583
|
|
|
1273495
1273584
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -1273530,7 +1273619,7 @@ var migration14 = {
|
|
|
1273530
1273619
|
}
|
|
1273531
1273620
|
};
|
|
1273532
1273621
|
async function migrateYamlFile3(filepath, context) {
|
|
1273533
|
-
const contents = await (0,
|
|
1273622
|
+
const contents = await (0, import_promises73.readFile)(filepath);
|
|
1273534
1273623
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
1273535
1273624
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
1273536
1273625
|
return context.failAndThrow("File is not a map");
|
|
@@ -1273560,7 +1273649,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
1273560
1273649
|
pair.value = firstService.value;
|
|
1273561
1273650
|
}
|
|
1273562
1273651
|
}
|
|
1273563
|
-
await (0,
|
|
1273652
|
+
await (0, import_promises73.writeFile)(filepath, parsedDocument.toString());
|
|
1273564
1273653
|
}
|
|
1273565
1273654
|
|
|
1273566
1273655
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -1273571,7 +1273660,7 @@ var versionMigrations14 = {
|
|
|
1273571
1273660
|
var __default14 = versionMigrations14;
|
|
1273572
1273661
|
|
|
1273573
1273662
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
1273574
|
-
var
|
|
1273663
|
+
var import_promises74 = require("fs/promises");
|
|
1273575
1273664
|
var import_yaml9 = __toESM(require_dist4());
|
|
1273576
1273665
|
|
|
1273577
1273666
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -1273612,7 +1273701,7 @@ var migration15 = {
|
|
|
1273612
1273701
|
}
|
|
1273613
1273702
|
};
|
|
1273614
1273703
|
async function migrateYamlFile4(filepath, context) {
|
|
1273615
|
-
const contents = await (0,
|
|
1273704
|
+
const contents = await (0, import_promises74.readFile)(filepath);
|
|
1273616
1273705
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
1273617
1273706
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
1273618
1273707
|
return context.failAndThrow("File is not a map");
|
|
@@ -1273631,7 +1273720,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
1273631
1273720
|
}
|
|
1273632
1273721
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
1273633
1273722
|
parsedDocument.contents.items.unshift(docsPair);
|
|
1273634
|
-
await (0,
|
|
1273723
|
+
await (0, import_promises74.writeFile)(filepath, parsedDocument.toString());
|
|
1273635
1273724
|
}
|
|
1273636
1273725
|
|
|
1273637
1273726
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -1273642,7 +1273731,7 @@ var versionMigrations15 = {
|
|
|
1273642
1273731
|
var __default15 = versionMigrations15;
|
|
1273643
1273732
|
|
|
1273644
1273733
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
1273645
|
-
var
|
|
1273734
|
+
var import_promises75 = require("fs/promises");
|
|
1273646
1273735
|
|
|
1273647
1273736
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
1273648
1273737
|
var import_glob_promise15 = __toESM(require_lib());
|
|
@@ -1273682,14 +1273771,14 @@ var migration16 = {
|
|
|
1273682
1273771
|
}
|
|
1273683
1273772
|
};
|
|
1273684
1273773
|
async function migrateYamlFile5(filepath) {
|
|
1273685
|
-
const contents = await (0,
|
|
1273774
|
+
const contents = await (0, import_promises75.readFile)(filepath);
|
|
1273686
1273775
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
1273687
1273776
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
1273688
1273777
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
1273689
1273778
|
return `docs:
|
|
1273690
1273779
|
domain: "${domain2}.${domainSuffix}"`;
|
|
1273691
1273780
|
});
|
|
1273692
|
-
await (0,
|
|
1273781
|
+
await (0, import_promises75.writeFile)(filepath, updatedSnapshot.toString());
|
|
1273693
1273782
|
}
|
|
1273694
1273783
|
|
|
1273695
1273784
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -1273791,7 +1273880,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
1273791
1273880
|
}
|
|
1273792
1273881
|
|
|
1273793
1273882
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
1273794
|
-
var
|
|
1273883
|
+
var import_promises76 = require("fs/promises");
|
|
1273795
1273884
|
|
|
1273796
1273885
|
// pnp:/home/runner/work/fern/fern/.yarn/cache/immer-npm-9.0.15-6c734225db-92e3d63e81.zip/node_modules/immer/dist/immer.esm.mjs
|
|
1273797
1273886
|
function n(n2) {
|
|
@@ -1274280,7 +1274369,7 @@ async function upgrade({
|
|
|
1274280
1274369
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
1274281
1274370
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
1274282
1274371
|
});
|
|
1274283
|
-
await (0,
|
|
1274372
|
+
await (0, import_promises76.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
1274284
1274373
|
cliContext.logger.info(
|
|
1274285
1274374
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
1274286
1274375
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -1274302,7 +1274391,7 @@ async function upgrade({
|
|
|
1274302
1274391
|
}
|
|
1274303
1274392
|
|
|
1274304
1274393
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgradeGenerator.ts
|
|
1274305
|
-
var
|
|
1274394
|
+
var import_promises77 = require("fs/promises");
|
|
1274306
1274395
|
var import_path42 = __toESM(require("path"));
|
|
1274307
1274396
|
var semver3 = __toESM(require_semver8());
|
|
1274308
1274397
|
var import_yaml10 = __toESM(require_dist4());
|
|
@@ -1274318,7 +1274407,7 @@ async function loadAndUpdateGenerators({
|
|
|
1274318
1274407
|
context.failAndThrow("Generators configuration file was not found, no generators to upgrade.");
|
|
1274319
1274408
|
return void 0;
|
|
1274320
1274409
|
}
|
|
1274321
|
-
const contents = await (0,
|
|
1274410
|
+
const contents = await (0, import_promises77.readFile)(filepath);
|
|
1274322
1274411
|
context.logger.debug(`Found generators: ${contents.toString()}`);
|
|
1274323
1274412
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
1274324
1274413
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -1274408,7 +1274497,7 @@ async function upgradeGenerator2({
|
|
|
1274408
1274497
|
includeMajor
|
|
1274409
1274498
|
});
|
|
1274410
1274499
|
if (updatedConfiguration != null) {
|
|
1274411
|
-
await (0,
|
|
1274500
|
+
await (0, import_promises77.writeFile)(
|
|
1274412
1274501
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1274413
1274502
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1274414
1274503
|
}),
|
|
@@ -1274443,7 +1274532,7 @@ async function validateWorkspaces({
|
|
|
1274443
1274532
|
}
|
|
1274444
1274533
|
|
|
1274445
1274534
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1274446
|
-
var
|
|
1274535
|
+
var import_promises78 = require("fs/promises");
|
|
1274447
1274536
|
var import_path43 = __toESM(require("path"));
|
|
1274448
1274537
|
async function writeDefinitionForWorkspaces({
|
|
1274449
1274538
|
project,
|
|
@@ -1274505,22 +1274594,22 @@ async function writeFernDefinition2({
|
|
|
1274505
1274594
|
absolutePathToOutputDirectory
|
|
1274506
1274595
|
}) {
|
|
1274507
1274596
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
1274508
|
-
await (0,
|
|
1274597
|
+
await (0, import_promises78.rmdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1274509
1274598
|
}
|
|
1274510
|
-
await (0,
|
|
1274511
|
-
await (0,
|
|
1274599
|
+
await (0, import_promises78.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1274600
|
+
await (0, import_promises78.writeFile)(
|
|
1274512
1274601
|
join(absolutePathToOutputDirectory, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
1274513
1274602
|
js_yaml_default.dump(definition3.rootApiFile.contents)
|
|
1274514
1274603
|
);
|
|
1274515
1274604
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1274516
1274605
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1274517
|
-
await (0,
|
|
1274518
|
-
await (0,
|
|
1274606
|
+
await (0, import_promises78.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1274607
|
+
await (0, import_promises78.writeFile)(absoluteFilepath, js_yaml_default.dump(packageMarker.contents));
|
|
1274519
1274608
|
}
|
|
1274520
1274609
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1274521
1274610
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1274522
|
-
await (0,
|
|
1274523
|
-
await (0,
|
|
1274611
|
+
await (0, import_promises78.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1274612
|
+
await (0, import_promises78.writeFile)(absoluteFilepath, js_yaml_default.dump(definitionFile.contents));
|
|
1274524
1274613
|
}
|
|
1274525
1274614
|
}
|
|
1274526
1274615
|
|