@fern-api/fern-api-dev 5.55.2 → 5.56.0
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/cli.cjs +314 -144
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -99819,8 +99819,8 @@ var require_graceful_fs = __commonJS({
|
|
|
99819
99819
|
}
|
|
99820
99820
|
}
|
|
99821
99821
|
var fs$writeFile = fs35.writeFile;
|
|
99822
|
-
fs35.writeFile =
|
|
99823
|
-
function
|
|
99822
|
+
fs35.writeFile = writeFile99;
|
|
99823
|
+
function writeFile99(path119, data2, options2, cb) {
|
|
99824
99824
|
if (typeof options2 === "function")
|
|
99825
99825
|
cb = options2, options2 = null;
|
|
99826
99826
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -129372,7 +129372,8 @@ var init_OpenApiSettingsSchema2 = __esm({
|
|
|
129372
129372
|
"resolve-aliases": ResolveAliases.optional(),
|
|
129373
129373
|
"group-multi-api-environments": schemas_exports8.boolean().optional(),
|
|
129374
129374
|
"default-integer-format": DefaultIntegerFormat2.optional(),
|
|
129375
|
-
"infer-discriminated-union-base-properties": schemas_exports8.boolean().optional()
|
|
129375
|
+
"infer-discriminated-union-base-properties": schemas_exports8.boolean().optional(),
|
|
129376
|
+
"disambiguate-request-names": schemas_exports8.boolean().optional()
|
|
129376
129377
|
}).extend(BaseApiSettingsSchema);
|
|
129377
129378
|
}
|
|
129378
129379
|
});
|
|
@@ -150769,7 +150770,8 @@ var init_options2 = __esm({
|
|
|
150769
150770
|
inferForwardCompatible: false,
|
|
150770
150771
|
coerceConstsTo: "enums-coerceable-to-literals",
|
|
150771
150772
|
respectByteFormat: false,
|
|
150772
|
-
shouldInferDiscriminatedUnionBaseProperties: false
|
|
150773
|
+
shouldInferDiscriminatedUnionBaseProperties: false,
|
|
150774
|
+
disambiguateRequestNames: true
|
|
150773
150775
|
};
|
|
150774
150776
|
}
|
|
150775
150777
|
});
|
|
@@ -164834,6 +164836,9 @@ function endpointHasNonRequestBodyParameters({ context: context3, convertedParam
|
|
|
164834
164836
|
function getDisambiguatedRequestName({ baseBreadcrumbs, requestBreadcrumbs, isMultipleRequests, request: request7, context: context3 }) {
|
|
164835
164837
|
const nameBreadcrumbs = isMultipleRequests ? getDifferentiatedBreadcrumbs({ breadcrumbs: requestBreadcrumbs, request: request7 }) : requestBreadcrumbs;
|
|
164836
164838
|
const computedName = getGeneratedTypeName(nameBreadcrumbs, context3.options.preserveSchemaIds);
|
|
164839
|
+
if (!context3.options.disambiguateRequestNames) {
|
|
164840
|
+
return computedName;
|
|
164841
|
+
}
|
|
164837
164842
|
const componentSchemas = context3.document.components?.schemas;
|
|
164838
164843
|
if (componentSchemas == null) {
|
|
164839
164844
|
return computedName;
|
|
@@ -197626,7 +197631,8 @@ var init_getAPIDefinitionSettings = __esm({
|
|
|
197626
197631
|
resolveSchemaCollisions: "resolveSchemaCollisions",
|
|
197627
197632
|
inferForwardCompatible: "inferForwardCompatible",
|
|
197628
197633
|
coerceConstsTo: "coerceConstsTo",
|
|
197629
|
-
shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties"
|
|
197634
|
+
shouldInferDiscriminatedUnionBaseProperties: "shouldInferDiscriminatedUnionBaseProperties",
|
|
197635
|
+
disambiguateRequestNames: "disambiguateRequestNames"
|
|
197630
197636
|
};
|
|
197631
197637
|
}
|
|
197632
197638
|
});
|
|
@@ -259145,7 +259151,8 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
259145
259151
|
multiServerStrategy: settings?.["multi-server-strategy"],
|
|
259146
259152
|
defaultIntegerFormat: settings?.["default-integer-format"],
|
|
259147
259153
|
pathParameterOrder: settings?.["path-parameter-order"],
|
|
259148
|
-
shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"]
|
|
259154
|
+
shouldInferDiscriminatedUnionBaseProperties: settings?.["infer-discriminated-union-base-properties"],
|
|
259155
|
+
disambiguateRequestNames: settings?.["disambiguate-request-names"]
|
|
259149
259156
|
};
|
|
259150
259157
|
}
|
|
259151
259158
|
function parseAsyncApiDefinitionSettingsSchema(settings) {
|
|
@@ -260004,7 +260011,8 @@ var init_convertGeneratorsConfiguration = __esm({
|
|
|
260004
260011
|
resolveSchemaCollisions: void 0,
|
|
260005
260012
|
inferForwardCompatible: void 0,
|
|
260006
260013
|
coerceConstsTo: void 0,
|
|
260007
|
-
shouldInferDiscriminatedUnionBaseProperties: void 0
|
|
260014
|
+
shouldInferDiscriminatedUnionBaseProperties: void 0,
|
|
260015
|
+
disambiguateRequestNames: void 0
|
|
260008
260016
|
};
|
|
260009
260017
|
}
|
|
260010
260018
|
});
|
|
@@ -455307,13 +455315,13 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
|
|
|
455307
455315
|
}
|
|
455308
455316
|
}
|
|
455309
455317
|
}
|
|
455310
|
-
const { writeFile:
|
|
455318
|
+
const { writeFile: writeFile99 } = await import("fs/promises");
|
|
455311
455319
|
const yamlContent = index_vite_proxy_tmp_default.dump(parsed, {
|
|
455312
455320
|
indent: 2,
|
|
455313
455321
|
lineWidth: -1,
|
|
455314
455322
|
noRefs: true
|
|
455315
455323
|
});
|
|
455316
|
-
await
|
|
455324
|
+
await writeFile99(overrideFilePath, yamlContent, "utf-8");
|
|
455317
455325
|
context3.logger.info(`Removed ${validationResult.invalidCount} invalid AI examples from ai_examples_override.yml`);
|
|
455318
455326
|
return {
|
|
455319
455327
|
removedCount: validationResult.invalidCount,
|
|
@@ -478555,8 +478563,8 @@ var require_graceful_fs2 = __commonJS({
|
|
|
478555
478563
|
}
|
|
478556
478564
|
}
|
|
478557
478565
|
var fs$writeFile = fs35.writeFile;
|
|
478558
|
-
fs35.writeFile =
|
|
478559
|
-
function
|
|
478566
|
+
fs35.writeFile = writeFile99;
|
|
478567
|
+
function writeFile99(path119, data2, options2, cb) {
|
|
478560
478568
|
if (typeof options2 === "function")
|
|
478561
478569
|
cb = options2, options2 = null;
|
|
478562
478570
|
return go$writeFile(path119, data2, options2, cb);
|
|
@@ -571784,7 +571792,7 @@ var require_dist24 = __commonJS({
|
|
|
571784
571792
|
return copy;
|
|
571785
571793
|
}
|
|
571786
571794
|
};
|
|
571787
|
-
var
|
|
571795
|
+
var import_promises214 = require("fs/promises");
|
|
571788
571796
|
var import_node_path310 = require("path");
|
|
571789
571797
|
async function resolveInputs(args) {
|
|
571790
571798
|
const {
|
|
@@ -571837,7 +571845,7 @@ var require_dist24 = __commonJS({
|
|
|
571837
571845
|
}
|
|
571838
571846
|
}
|
|
571839
571847
|
const oursPath = (0, import_node_path310.join)(outputDir, resolvedPath);
|
|
571840
|
-
const ours = await (0,
|
|
571848
|
+
const ours = await (0, import_promises214.readFile)(oursPath, "utf-8").catch(() => null);
|
|
571841
571849
|
let ghostTheirs = null;
|
|
571842
571850
|
let baseTreeUnreachable = false;
|
|
571843
571851
|
if (!base4 && !renameSourcePath) {
|
|
@@ -572079,7 +572087,7 @@ var require_dist24 = __commonJS({
|
|
|
572079
572087
|
conflictReasonHint
|
|
572080
572088
|
};
|
|
572081
572089
|
}
|
|
572082
|
-
var
|
|
572090
|
+
var import_promises215 = require("fs/promises");
|
|
572083
572091
|
var import_node_path45 = require("path");
|
|
572084
572092
|
async function runMergeAndRecord(args) {
|
|
572085
572093
|
const { plan, inputs, patch: patch5, accumulator } = args;
|
|
@@ -572089,14 +572097,14 @@ var require_dist24 = __commonJS({
|
|
|
572089
572097
|
}
|
|
572090
572098
|
if (plan.kind === "new-file-only-user") {
|
|
572091
572099
|
accumulator.recordMerge(resolvedPath, plan.theirs, patch5.base_generation);
|
|
572092
|
-
await (0,
|
|
572093
|
-
await (0,
|
|
572100
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572101
|
+
await (0, import_promises215.writeFile)(oursPath, plan.theirs);
|
|
572094
572102
|
return { file: resolvedPath, status: "merged", reason: "new-file" };
|
|
572095
572103
|
}
|
|
572096
572104
|
if (plan.kind === "new-file-both") {
|
|
572097
572105
|
const merged2 = threeWayMerge("", ours, plan.theirs);
|
|
572098
|
-
await (0,
|
|
572099
|
-
await (0,
|
|
572106
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572107
|
+
await (0, import_promises215.writeFile)(oursPath, merged2.content);
|
|
572100
572108
|
const unreachableFlag = plan.baseTreeUnreachable ? { baseTreeUnreachable: true } : {};
|
|
572101
572109
|
if (merged2.hasConflicts) {
|
|
572102
572110
|
return {
|
|
@@ -572112,8 +572120,8 @@ var require_dist24 = __commonJS({
|
|
|
572112
572120
|
return { file: resolvedPath, status: "merged", ...unreachableFlag };
|
|
572113
572121
|
}
|
|
572114
572122
|
const merged = threeWayMerge(plan.mergeBase, ours, plan.theirs);
|
|
572115
|
-
await (0,
|
|
572116
|
-
await (0,
|
|
572123
|
+
await (0, import_promises215.mkdir)((0, import_node_path45.dirname)(oursPath), { recursive: true });
|
|
572124
|
+
await (0, import_promises215.writeFile)(oursPath, merged.content);
|
|
572117
572125
|
if (merged.hasConflicts) {
|
|
572118
572126
|
accumulator.recordConflict(resolvedPath, plan.theirs, patch5.base_generation);
|
|
572119
572127
|
return {
|
|
@@ -620636,7 +620644,7 @@ var require_jsonfile = __commonJS({
|
|
|
620636
620644
|
const str2 = stringify5(obj, options2);
|
|
620637
620645
|
await universalify.fromCallback(fs34.writeFile)(file4, str2, options2);
|
|
620638
620646
|
}
|
|
620639
|
-
var
|
|
620647
|
+
var writeFile99 = universalify.fromPromise(_writeFile);
|
|
620640
620648
|
function writeFileSync9(file4, obj, options2 = {}) {
|
|
620641
620649
|
const fs34 = options2.fs || _fs;
|
|
620642
620650
|
const str2 = stringify5(obj, options2);
|
|
@@ -620645,7 +620653,7 @@ var require_jsonfile = __commonJS({
|
|
|
620645
620653
|
module4.exports = {
|
|
620646
620654
|
readFile: readFile119,
|
|
620647
620655
|
readFileSync: readFileSync19,
|
|
620648
|
-
writeFile:
|
|
620656
|
+
writeFile: writeFile99,
|
|
620649
620657
|
writeFileSync: writeFileSync9
|
|
620650
620658
|
};
|
|
620651
620659
|
}
|
|
@@ -678367,7 +678375,14 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
|
|
|
678367
678375
|
* so SDKs can expose them directly on the union type without casting.
|
|
678368
678376
|
* Defaults to false.
|
|
678369
678377
|
*/
|
|
678370
|
-
inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional()
|
|
678378
|
+
inferDiscriminatedUnionBaseProperties: external_exports.boolean().optional(),
|
|
678379
|
+
/**
|
|
678380
|
+
* If true, disambiguate generated request wrapper names that collide with
|
|
678381
|
+
* component schema names by replacing the "Request" suffix with "Body".
|
|
678382
|
+
* If false, keep the original "Request" suffix regardless of collisions.
|
|
678383
|
+
* Defaults to true.
|
|
678384
|
+
*/
|
|
678385
|
+
"disambiguate-request-names": external_exports.boolean().optional()
|
|
678371
678386
|
});
|
|
678372
678387
|
|
|
678373
678388
|
// ../config/lib/schemas/specs/OpenApiSpecSchema.js
|
|
@@ -686956,7 +686971,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686956
686971
|
properties: {
|
|
686957
686972
|
...event,
|
|
686958
686973
|
...event.properties,
|
|
686959
|
-
version: "5.
|
|
686974
|
+
version: "5.56.0",
|
|
686960
686975
|
usingAccessToken: true,
|
|
686961
686976
|
...getRunIdProperties()
|
|
686962
686977
|
}
|
|
@@ -687022,7 +687037,7 @@ var UserPosthogManager = class {
|
|
|
687022
687037
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
687023
687038
|
event: "CLI",
|
|
687024
687039
|
properties: {
|
|
687025
|
-
version: "5.
|
|
687040
|
+
version: "5.56.0",
|
|
687026
687041
|
...event,
|
|
687027
687042
|
...event.properties,
|
|
687028
687043
|
usingAccessToken: false,
|
|
@@ -693834,7 +693849,8 @@ var LegacyApiSpecAdapter = class {
|
|
|
693834
693849
|
groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
|
|
693835
693850
|
defaultIntegerFormat: this.adaptDefaultIntegerFormat(settings.defaultIntegerFormat),
|
|
693836
693851
|
coerceConstsTo: settings.coerceConstsTo,
|
|
693837
|
-
shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties
|
|
693852
|
+
shouldInferDiscriminatedUnionBaseProperties: settings.inferDiscriminatedUnionBaseProperties,
|
|
693853
|
+
disambiguateRequestNames: settings["disambiguate-request-names"]
|
|
693838
693854
|
};
|
|
693839
693855
|
const hasSettings = Object.values(result).some((v3) => v3 != null);
|
|
693840
693856
|
return hasSettings ? result : void 0;
|
|
@@ -832441,10 +832457,10 @@ var IntermediateRepresentationMigratorBuilderImpl = class {
|
|
|
832441
832457
|
constructor(migrations) {
|
|
832442
832458
|
this.migrations = migrations;
|
|
832443
832459
|
}
|
|
832444
|
-
withMigration(
|
|
832460
|
+
withMigration(migration24) {
|
|
832445
832461
|
return new BuildaleIntermediateRepresentationMigratorBuilderImpl([
|
|
832446
832462
|
...this.migrations,
|
|
832447
|
-
|
|
832463
|
+
migration24
|
|
832448
832464
|
]);
|
|
832449
832465
|
}
|
|
832450
832466
|
};
|
|
@@ -832462,14 +832478,14 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832462
832478
|
migrateForGenerator({ intermediateRepresentation, context: context3, targetGenerator }) {
|
|
832463
832479
|
return this.migrate({
|
|
832464
832480
|
intermediateRepresentation,
|
|
832465
|
-
shouldMigrate: (
|
|
832481
|
+
shouldMigrate: (migration24) => this.shouldRunMigration({ migration: migration24, targetGenerator }),
|
|
832466
832482
|
context: context3,
|
|
832467
832483
|
targetGenerator
|
|
832468
832484
|
});
|
|
832469
832485
|
}
|
|
832470
|
-
migrateThroughMigration({ migration:
|
|
832486
|
+
migrateThroughMigration({ migration: migration24, intermediateRepresentation, context: context3, targetGenerator }) {
|
|
832471
832487
|
return this.migrateThroughVersion({
|
|
832472
|
-
version:
|
|
832488
|
+
version: migration24.earlierVersion,
|
|
832473
832489
|
intermediateRepresentation,
|
|
832474
832490
|
context: context3,
|
|
832475
832491
|
targetGenerator
|
|
@@ -832531,24 +832547,24 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832531
832547
|
unrecognizedObjectKeys: "strip"
|
|
832532
832548
|
});
|
|
832533
832549
|
};
|
|
832534
|
-
for (const
|
|
832535
|
-
if (!shouldMigrate(
|
|
832550
|
+
for (const migration24 of this.migrations) {
|
|
832551
|
+
if (!shouldMigrate(migration24)) {
|
|
832536
832552
|
break;
|
|
832537
832553
|
}
|
|
832538
|
-
context3.logger.debug(`Migrating IR from ${
|
|
832539
|
-
migrated =
|
|
832554
|
+
context3.logger.debug(`Migrating IR from ${migration24.laterVersion} to ${migration24.earlierVersion}`);
|
|
832555
|
+
migrated = migration24.migrateBackwards(migrated, {
|
|
832540
832556
|
taskContext: context3,
|
|
832541
832557
|
targetGenerator
|
|
832542
832558
|
});
|
|
832543
|
-
jsonify = () => Promise.resolve().then(() =>
|
|
832559
|
+
jsonify = () => Promise.resolve().then(() => migration24.jsonifyEarlierVersion(migrated));
|
|
832544
832560
|
}
|
|
832545
832561
|
return {
|
|
832546
832562
|
ir: migrated,
|
|
832547
832563
|
jsonify
|
|
832548
832564
|
};
|
|
832549
832565
|
}
|
|
832550
|
-
shouldRunMigration({ migration:
|
|
832551
|
-
const minVersionToExclude =
|
|
832566
|
+
shouldRunMigration({ migration: migration24, targetGenerator }) {
|
|
832567
|
+
const minVersionToExclude = migration24.firstGeneratorVersionToConsumeNewIR[targetGenerator.name];
|
|
832552
832568
|
if (minVersionToExclude == null) {
|
|
832553
832569
|
throw new CliError({
|
|
832554
832570
|
message: `Cannot migrate intermediate representation. Unrecognized generator: ${targetGenerator.name}. If leveraging a custom generator, ensure you are specifying "ir-version" within the generator configuration.`,
|
|
@@ -832560,7 +832576,7 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832560
832576
|
return true;
|
|
832561
832577
|
case GeneratorWasNotCreatedYet:
|
|
832562
832578
|
throw new CliError({
|
|
832563
|
-
message: `Cannot migrate intermediate representation. Generator was created after intermediate representation ${
|
|
832579
|
+
message: `Cannot migrate intermediate representation. Generator was created after intermediate representation ${migration24.laterVersion}.`,
|
|
832564
832580
|
code: CliError.Code.VersionError
|
|
832565
832581
|
});
|
|
832566
832582
|
}
|
|
@@ -832575,9 +832591,9 @@ var IntermediateRepresentationMigratorImpl = class {
|
|
|
832575
832591
|
}
|
|
832576
832592
|
getIRVersionForGenerator({ targetGenerator }) {
|
|
832577
832593
|
let lastIrVersion = this.migrations[0]?.laterVersion;
|
|
832578
|
-
for (const
|
|
832579
|
-
if (this.shouldRunMigration({ migration:
|
|
832580
|
-
lastIrVersion =
|
|
832594
|
+
for (const migration24 of this.migrations) {
|
|
832595
|
+
if (this.shouldRunMigration({ migration: migration24, targetGenerator })) {
|
|
832596
|
+
lastIrVersion = migration24.earlierVersion;
|
|
832581
832597
|
} else {
|
|
832582
832598
|
break;
|
|
832583
832599
|
}
|
|
@@ -868116,7 +868132,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
868116
868132
|
var LOGS_FOLDER_NAME = "logs";
|
|
868117
868133
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
868118
868134
|
function getCliSource() {
|
|
868119
|
-
const version7 = "5.
|
|
868135
|
+
const version7 = "5.56.0";
|
|
868120
868136
|
return `cli@${version7}`;
|
|
868121
868137
|
}
|
|
868122
868138
|
var DebugLogger = class {
|
|
@@ -900510,7 +900526,7 @@ var LegacyDocsPublisher = class {
|
|
|
900510
900526
|
previewId,
|
|
900511
900527
|
disableTemplates: void 0,
|
|
900512
900528
|
skipUpload,
|
|
900513
|
-
cliVersion: "5.
|
|
900529
|
+
cliVersion: "5.56.0",
|
|
900514
900530
|
loginCommand: "fern auth login"
|
|
900515
900531
|
});
|
|
900516
900532
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -957274,20 +957290,20 @@ Please check your internet connection and npm configuration, then try again.`,
|
|
|
957274
957290
|
* Returns migrations where: from < migration.version <= to
|
|
957275
957291
|
*/
|
|
957276
957292
|
filterMigrations({ migrations, from: from4, to: to2 }) {
|
|
957277
|
-
return migrations.filter((
|
|
957278
|
-
const migrationVersion = import_semver14.default.parse(
|
|
957293
|
+
return migrations.filter((migration24) => {
|
|
957294
|
+
const migrationVersion = import_semver14.default.parse(migration24.version);
|
|
957279
957295
|
const fromVersion = import_semver14.default.parse(from4);
|
|
957280
957296
|
const toVersion = import_semver14.default.parse(to2);
|
|
957281
957297
|
if (migrationVersion == null) {
|
|
957282
|
-
this.logger.warn(`Migration has invalid semver version: ${
|
|
957298
|
+
this.logger.warn(`Migration has invalid semver version: ${migration24.version}. Skipping.`);
|
|
957283
957299
|
return false;
|
|
957284
957300
|
}
|
|
957285
957301
|
if (fromVersion == null) {
|
|
957286
|
-
this.logger.warn(`Invalid 'from' version: ${from4}. Skipping migration ${
|
|
957302
|
+
this.logger.warn(`Invalid 'from' version: ${from4}. Skipping migration ${migration24.version}.`);
|
|
957287
957303
|
return false;
|
|
957288
957304
|
}
|
|
957289
957305
|
if (toVersion == null) {
|
|
957290
|
-
this.logger.warn(`Invalid 'to' version: ${to2}. Skipping migration ${
|
|
957306
|
+
this.logger.warn(`Invalid 'to' version: ${to2}. Skipping migration ${migration24.version}.`);
|
|
957291
957307
|
return false;
|
|
957292
957308
|
}
|
|
957293
957309
|
return import_semver14.default.gt(migrationVersion, fromVersion) && import_semver14.default.lte(migrationVersion, toVersion);
|
|
@@ -957307,17 +957323,17 @@ Please check your internet connection and npm configuration, then try again.`,
|
|
|
957307
957323
|
runMigrations({ migrations, config: config5 }) {
|
|
957308
957324
|
let currentConfig = config5;
|
|
957309
957325
|
const appliedVersions = [];
|
|
957310
|
-
for (const
|
|
957326
|
+
for (const migration24 of migrations) {
|
|
957311
957327
|
try {
|
|
957312
|
-
currentConfig =
|
|
957328
|
+
currentConfig = migration24.migrateGeneratorConfig({
|
|
957313
957329
|
config: currentConfig,
|
|
957314
957330
|
context: { logger: this.logger }
|
|
957315
957331
|
});
|
|
957316
|
-
appliedVersions.push(
|
|
957332
|
+
appliedVersions.push(migration24.version);
|
|
957317
957333
|
} catch (error50) {
|
|
957318
957334
|
const errorMessage = extractErrorMessage(error50);
|
|
957319
957335
|
throw new CliError({
|
|
957320
|
-
message: `Failed to apply migration for version ${
|
|
957336
|
+
message: `Failed to apply migration for version ${migration24.version}.
|
|
957321
957337
|
|
|
957322
957338
|
Reason: ${errorMessage}
|
|
957323
957339
|
|
|
@@ -957513,9 +957529,9 @@ var UpdateCommand = class {
|
|
|
957513
957529
|
context3.stderr.info(`${Icons.success} ${source_default.green("Updated SDK targets:")}`);
|
|
957514
957530
|
for (const update of updates) {
|
|
957515
957531
|
context3.stderr.info(source_default.green(` ${update.name}: ${source_default.dim(update.currentVersion)} \u2192 ${update.latestVersion}`));
|
|
957516
|
-
const
|
|
957517
|
-
if (
|
|
957518
|
-
context3.stderr.info(source_default.dim(` Applied ${
|
|
957532
|
+
const migration24 = migrationInfo.get(update.name);
|
|
957533
|
+
if (migration24 != null) {
|
|
957534
|
+
context3.stderr.info(source_default.dim(` Applied ${migration24.migrationsApplied} config migration(s): ${migration24.appliedVersions.join(", ")}`));
|
|
957519
957535
|
}
|
|
957520
957536
|
if (update.changelogUrl != null) {
|
|
957521
957537
|
context3.stderr.info(source_default.dim(` Changelog: ${update.changelogUrl}`));
|
|
@@ -966779,7 +966795,7 @@ function getAutomationContextFromEnv() {
|
|
|
966779
966795
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
966780
966796
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
966781
966797
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
966782
|
-
cli_version: "5.
|
|
966798
|
+
cli_version: "5.56.0"
|
|
966783
966799
|
};
|
|
966784
966800
|
}
|
|
966785
966801
|
function isAutomationMode() {
|
|
@@ -967611,7 +967627,7 @@ var CliContext = class _CliContext {
|
|
|
967611
967627
|
if (false) {
|
|
967612
967628
|
this.logger.error("CLI_VERSION is not defined");
|
|
967613
967629
|
}
|
|
967614
|
-
return "5.
|
|
967630
|
+
return "5.56.0";
|
|
967615
967631
|
}
|
|
967616
967632
|
getCliName() {
|
|
967617
967633
|
if (false) {
|
|
@@ -968426,20 +968442,20 @@ If the problem persists, you can:
|
|
|
968426
968442
|
}
|
|
968427
968443
|
function filterMigrations(params2) {
|
|
968428
968444
|
const { migrations, from: from4, to: to2, logger: logger4 } = params2;
|
|
968429
|
-
return migrations.filter((
|
|
968430
|
-
const migrationVersion = import_semver15.default.parse(
|
|
968445
|
+
return migrations.filter((migration24) => {
|
|
968446
|
+
const migrationVersion = import_semver15.default.parse(migration24.version);
|
|
968431
968447
|
const fromVersion = import_semver15.default.parse(from4);
|
|
968432
968448
|
const toVersion = import_semver15.default.parse(to2);
|
|
968433
968449
|
if (migrationVersion == null) {
|
|
968434
|
-
logger4.warn(`Migration has invalid semver version: ${
|
|
968450
|
+
logger4.warn(`Migration has invalid semver version: ${migration24.version}. Skipping this migration.`);
|
|
968435
968451
|
return false;
|
|
968436
968452
|
}
|
|
968437
968453
|
if (fromVersion == null) {
|
|
968438
|
-
logger4.warn(`Invalid 'from' version: ${from4}. Skipping migration ${
|
|
968454
|
+
logger4.warn(`Invalid 'from' version: ${from4}. Skipping migration ${migration24.version}.`);
|
|
968439
968455
|
return false;
|
|
968440
968456
|
}
|
|
968441
968457
|
if (toVersion == null) {
|
|
968442
|
-
logger4.warn(`Invalid 'to' version: ${to2}. Skipping migration ${
|
|
968458
|
+
logger4.warn(`Invalid 'to' version: ${to2}. Skipping migration ${migration24.version}.`);
|
|
968443
968459
|
return false;
|
|
968444
968460
|
}
|
|
968445
968461
|
return import_semver15.default.gt(migrationVersion, fromVersion) && import_semver15.default.lte(migrationVersion, toVersion);
|
|
@@ -968459,17 +968475,17 @@ function runMigrations(params2) {
|
|
|
968459
968475
|
const { migrations, logger: logger4 } = params2;
|
|
968460
968476
|
let currentConfig = params2.config;
|
|
968461
968477
|
const appliedVersions = [];
|
|
968462
|
-
for (const
|
|
968478
|
+
for (const migration24 of migrations) {
|
|
968463
968479
|
try {
|
|
968464
968480
|
const context3 = {
|
|
968465
968481
|
logger: logger4
|
|
968466
968482
|
};
|
|
968467
|
-
currentConfig =
|
|
968468
|
-
appliedVersions.push(
|
|
968483
|
+
currentConfig = migration24.migrateGeneratorConfig({ config: currentConfig, context: context3 });
|
|
968484
|
+
appliedVersions.push(migration24.version);
|
|
968469
968485
|
} catch (error50) {
|
|
968470
968486
|
const errorMessage = extractErrorMessage(error50);
|
|
968471
968487
|
throw new CliError({
|
|
968472
|
-
message: `Failed to apply migration for version ${
|
|
968488
|
+
message: `Failed to apply migration for version ${migration24.version}.
|
|
968473
968489
|
|
|
968474
968490
|
Reason: ${errorMessage}
|
|
968475
968491
|
|
|
@@ -970865,7 +970881,7 @@ function listPreviewGroups({
|
|
|
970865
970881
|
init_lib19();
|
|
970866
970882
|
init_lib6();
|
|
970867
970883
|
init_source();
|
|
970868
|
-
var
|
|
970884
|
+
var import_promises195 = require("fs/promises");
|
|
970869
970885
|
|
|
970870
970886
|
// ../cli-migrations/lib/runMigrations.js
|
|
970871
970887
|
init_lib4();
|
|
@@ -973939,6 +973955,159 @@ var versionMigrations22 = {
|
|
|
973939
973955
|
};
|
|
973940
973956
|
var __default22 = versionMigrations22;
|
|
973941
973957
|
|
|
973958
|
+
// ../cli-migrations/lib/migrations/4.106.1/disable-disambiguate-request-names/migration.js
|
|
973959
|
+
init_lib19();
|
|
973960
|
+
init_lib8();
|
|
973961
|
+
init_source();
|
|
973962
|
+
var import_promises193 = require("fs/promises");
|
|
973963
|
+
init_js_yaml();
|
|
973964
|
+
var migration23 = {
|
|
973965
|
+
name: "disable-disambiguate-request-names",
|
|
973966
|
+
summary: `Sets 'disambiguate-request-names: false' for existing OpenAPI specs to preserve backwards compatibility.
|
|
973967
|
+
Starting with version 4.106.1, generated request wrapper names that collide with component schema names
|
|
973968
|
+
are disambiguated by replacing the "Request" suffix with "Body". This migration explicitly disables that
|
|
973969
|
+
behavior so existing projects keep their current request wrapper names.`,
|
|
973970
|
+
run: async ({ context: context3 }) => {
|
|
973971
|
+
const absolutePathToFernDirectory = await getFernDirectory();
|
|
973972
|
+
if (absolutePathToFernDirectory == null) {
|
|
973973
|
+
context3.failAndThrow("Fern directory not found. Failed to run migration");
|
|
973974
|
+
return;
|
|
973975
|
+
}
|
|
973976
|
+
const { files, directories } = await getFilesAndDirectories8(absolutePathToFernDirectory);
|
|
973977
|
+
const apisDirectory = directories.find((dir) => dir.name === "apis");
|
|
973978
|
+
if (apisDirectory == null) {
|
|
973979
|
+
await updateGeneratorsYml6({
|
|
973980
|
+
context: context3,
|
|
973981
|
+
files
|
|
973982
|
+
});
|
|
973983
|
+
} else {
|
|
973984
|
+
for (const workspace of apisDirectory.contents) {
|
|
973985
|
+
if (workspace.type !== "directory") {
|
|
973986
|
+
continue;
|
|
973987
|
+
}
|
|
973988
|
+
const absoluteFilepathToWorkspace = join8(absolutePathToFernDirectory, RelativeFilePath2.of("apis"), RelativeFilePath2.of(workspace.name));
|
|
973989
|
+
await updateGeneratorsYml6({
|
|
973990
|
+
context: context3,
|
|
973991
|
+
...await getFilesAndDirectories8(join8(absoluteFilepathToWorkspace))
|
|
973992
|
+
});
|
|
973993
|
+
}
|
|
973994
|
+
}
|
|
973995
|
+
}
|
|
973996
|
+
};
|
|
973997
|
+
async function updateGeneratorsYml6({ context: context3, files }) {
|
|
973998
|
+
const generatorsYmlFile = files.find((file4) => file4.name === "generators.yml" || file4.name === "generators.yaml");
|
|
973999
|
+
if (generatorsYmlFile == null) {
|
|
974000
|
+
return;
|
|
974001
|
+
}
|
|
974002
|
+
const generatorsYmlContents = index_vite_proxy_tmp_default.load(generatorsYmlFile.contents);
|
|
974003
|
+
if (generatorsYmlContents == null || typeof generatorsYmlContents !== "object") {
|
|
974004
|
+
return;
|
|
974005
|
+
}
|
|
974006
|
+
let modified = false;
|
|
974007
|
+
const doc = generatorsYmlContents;
|
|
974008
|
+
if ("api" in doc && typeof doc.api === "object" && doc.api != null) {
|
|
974009
|
+
const api2 = doc.api;
|
|
974010
|
+
if ("specs" in api2 && Array.isArray(api2.specs)) {
|
|
974011
|
+
for (const spec of api2.specs) {
|
|
974012
|
+
if (typeof spec !== "object" || spec == null) {
|
|
974013
|
+
continue;
|
|
974014
|
+
}
|
|
974015
|
+
const specObj = spec;
|
|
974016
|
+
if (!("openapi" in specObj)) {
|
|
974017
|
+
continue;
|
|
974018
|
+
}
|
|
974019
|
+
if (!("settings" in specObj) || typeof specObj.settings !== "object" || specObj.settings == null) {
|
|
974020
|
+
specObj.settings = {};
|
|
974021
|
+
}
|
|
974022
|
+
const settings = specObj.settings;
|
|
974023
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974024
|
+
settings["disambiguate-request-names"] = false;
|
|
974025
|
+
modified = true;
|
|
974026
|
+
}
|
|
974027
|
+
}
|
|
974028
|
+
}
|
|
974029
|
+
if ("settings" in api2 && typeof api2.settings === "object" && api2.settings != null) {
|
|
974030
|
+
const settings = api2.settings;
|
|
974031
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974032
|
+
settings["disambiguate-request-names"] = false;
|
|
974033
|
+
modified = true;
|
|
974034
|
+
}
|
|
974035
|
+
} else if (!("specs" in api2)) {
|
|
974036
|
+
if (!("settings" in api2)) {
|
|
974037
|
+
api2.settings = { "disambiguate-request-names": false };
|
|
974038
|
+
modified = true;
|
|
974039
|
+
}
|
|
974040
|
+
}
|
|
974041
|
+
}
|
|
974042
|
+
if ("groups" in doc && typeof doc.groups === "object" && doc.groups != null) {
|
|
974043
|
+
const groups2 = doc.groups;
|
|
974044
|
+
for (const groupName of Object.keys(groups2)) {
|
|
974045
|
+
const group = groups2[groupName];
|
|
974046
|
+
if (typeof group !== "object" || group == null) {
|
|
974047
|
+
continue;
|
|
974048
|
+
}
|
|
974049
|
+
const groupObj = group;
|
|
974050
|
+
if (!("generators" in groupObj) || !Array.isArray(groupObj.generators)) {
|
|
974051
|
+
continue;
|
|
974052
|
+
}
|
|
974053
|
+
for (const generator of groupObj.generators) {
|
|
974054
|
+
if (typeof generator !== "object" || generator == null) {
|
|
974055
|
+
continue;
|
|
974056
|
+
}
|
|
974057
|
+
const generatorObj = generator;
|
|
974058
|
+
if (!("api" in generatorObj) || typeof generatorObj.api !== "object" || generatorObj.api == null) {
|
|
974059
|
+
continue;
|
|
974060
|
+
}
|
|
974061
|
+
const apiObj = generatorObj.api;
|
|
974062
|
+
if (!("settings" in apiObj) || typeof apiObj.settings !== "object" || apiObj.settings == null) {
|
|
974063
|
+
continue;
|
|
974064
|
+
}
|
|
974065
|
+
const settings = apiObj.settings;
|
|
974066
|
+
if (!("disambiguate-request-names" in settings)) {
|
|
974067
|
+
settings["disambiguate-request-names"] = false;
|
|
974068
|
+
modified = true;
|
|
974069
|
+
}
|
|
974070
|
+
}
|
|
974071
|
+
}
|
|
974072
|
+
}
|
|
974073
|
+
if (!modified) {
|
|
974074
|
+
context3.logger.debug("No OpenAPI specs found for disambiguate-request-names migration. Skipping...");
|
|
974075
|
+
return;
|
|
974076
|
+
}
|
|
974077
|
+
const firstLine = generatorsYmlFile.contents.split("\n")[0];
|
|
974078
|
+
let schemaComment;
|
|
974079
|
+
if (firstLine?.startsWith("# yaml-language-server:")) {
|
|
974080
|
+
schemaComment = firstLine;
|
|
974081
|
+
}
|
|
974082
|
+
let documentToWrite = index_vite_proxy_tmp_default.dump(generatorsYmlContents);
|
|
974083
|
+
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
974084
|
+
documentToWrite = `${schemaComment}
|
|
974085
|
+
${documentToWrite}`;
|
|
974086
|
+
}
|
|
974087
|
+
await (0, import_promises193.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
974088
|
+
context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
974089
|
+
}
|
|
974090
|
+
async function getFilesAndDirectories8(absoluteFilepath) {
|
|
974091
|
+
const contents = await getDirectoryContents(absoluteFilepath);
|
|
974092
|
+
const files = [];
|
|
974093
|
+
const directories = [];
|
|
974094
|
+
for (const fileOrFolder of contents) {
|
|
974095
|
+
if (fileOrFolder.type === "directory") {
|
|
974096
|
+
directories.push(fileOrFolder);
|
|
974097
|
+
} else {
|
|
974098
|
+
files.push(fileOrFolder);
|
|
974099
|
+
}
|
|
974100
|
+
}
|
|
974101
|
+
return { files, directories };
|
|
974102
|
+
}
|
|
974103
|
+
|
|
974104
|
+
// ../cli-migrations/lib/migrations/4.106.1/index.js
|
|
974105
|
+
var versionMigrations23 = {
|
|
974106
|
+
version: "4.106.1",
|
|
974107
|
+
migrations: [migration23]
|
|
974108
|
+
};
|
|
974109
|
+
var __default23 = versionMigrations23;
|
|
974110
|
+
|
|
973942
974111
|
// ../cli-migrations/lib/migrations/all.js
|
|
973943
974112
|
var ALL_MIGRATIONS = [
|
|
973944
974113
|
__default,
|
|
@@ -973962,7 +974131,8 @@ var ALL_MIGRATIONS = [
|
|
|
973962
974131
|
__default19,
|
|
973963
974132
|
__default20,
|
|
973964
974133
|
__default21,
|
|
973965
|
-
__default22
|
|
974134
|
+
__default22,
|
|
974135
|
+
__default23
|
|
973966
974136
|
];
|
|
973967
974137
|
|
|
973968
974138
|
// ../cli-migrations/lib/migrations/getMigrationsToRun.js
|
|
@@ -973991,7 +974161,7 @@ async function runMigrations2({ fromVersion, toVersion, context: context3, yes =
|
|
|
973991
974161
|
context3.logger.debug("No migrations needed.");
|
|
973992
974162
|
return;
|
|
973993
974163
|
} else {
|
|
973994
|
-
context3.logger.debug("Migrations need to be run:\n" + migrationsToRun.flatMap(({ migrations }) => migrations.map((
|
|
974164
|
+
context3.logger.debug("Migrations need to be run:\n" + migrationsToRun.flatMap(({ migrations }) => migrations.map((migration24) => ` - ${migration24.name}`)).join("\n"));
|
|
973995
974165
|
}
|
|
973996
974166
|
if (yes) {
|
|
973997
974167
|
context3.logger.debug("Skipping migration confirmation prompt because --yes was provided.");
|
|
@@ -974006,13 +974176,13 @@ async function runMigrations2({ fromVersion, toVersion, context: context3, yes =
|
|
|
974006
974176
|
return;
|
|
974007
974177
|
}
|
|
974008
974178
|
}
|
|
974009
|
-
const migrationsWithTasks = migrationsToRun.flatMap(({ migrations, version: version7 }) => migrations.map((
|
|
974010
|
-
migration:
|
|
974011
|
-
context: context3.addInteractiveTask({ name: `${version7} ${
|
|
974179
|
+
const migrationsWithTasks = migrationsToRun.flatMap(({ migrations, version: version7 }) => migrations.map((migration24) => ({
|
|
974180
|
+
migration: migration24,
|
|
974181
|
+
context: context3.addInteractiveTask({ name: `${version7} ${migration24.name}` })
|
|
974012
974182
|
})));
|
|
974013
|
-
for (const { migration:
|
|
974183
|
+
for (const { migration: migration24, context: contextForMigration } of migrationsWithTasks) {
|
|
974014
974184
|
const finishableContext = contextForMigration.start();
|
|
974015
|
-
await
|
|
974185
|
+
await migration24.run({
|
|
974016
974186
|
context: finishableContext
|
|
974017
974187
|
});
|
|
974018
974188
|
finishableContext.finish();
|
|
@@ -974026,11 +974196,11 @@ async function askForConfirmation2(migrationsToRun) {
|
|
|
974026
974196
|
const QUESTION_KEY = "wantsToContinue";
|
|
974027
974197
|
const lines = ["Some migrations need to be run:"];
|
|
974028
974198
|
for (const { migrations } of migrationsToRun) {
|
|
974029
|
-
for (const
|
|
974199
|
+
for (const migration24 of migrations) {
|
|
974030
974200
|
lines.push(addPrefixToString({
|
|
974031
974201
|
prefix: " \u25E6 ",
|
|
974032
|
-
content: `${
|
|
974033
|
-
${source_default.dim(
|
|
974202
|
+
content: `${migration24.name}
|
|
974203
|
+
${source_default.dim(migration24.summary)}`
|
|
974034
974204
|
}));
|
|
974035
974205
|
}
|
|
974036
974206
|
}
|
|
@@ -974049,7 +974219,7 @@ init_lib33();
|
|
|
974049
974219
|
init_lib27();
|
|
974050
974220
|
init_lib6();
|
|
974051
974221
|
init_source();
|
|
974052
|
-
var
|
|
974222
|
+
var import_promises194 = require("fs/promises");
|
|
974053
974223
|
|
|
974054
974224
|
// ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
|
|
974055
974225
|
var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
|
|
@@ -975105,7 +975275,7 @@ async function upgrade({
|
|
|
975105
975275
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
975106
975276
|
draft.version = resolvedTargetVersion;
|
|
975107
975277
|
});
|
|
975108
|
-
await (0,
|
|
975278
|
+
await (0, import_promises194.writeFile)(
|
|
975109
975279
|
projectConfig2._absolutePath,
|
|
975110
975280
|
ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2))
|
|
975111
975281
|
);
|
|
@@ -975262,7 +975432,7 @@ async function upgradeGeneratorsForAllWorkspaces({
|
|
|
975262
975432
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
975263
975433
|
});
|
|
975264
975434
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
975265
|
-
await (0,
|
|
975435
|
+
await (0, import_promises195.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
975266
975436
|
}
|
|
975267
975437
|
for (const upgrade2 of result.appliedUpgrades) {
|
|
975268
975438
|
const normalizedName = addDefaultDockerOrgIfNotPresent(upgrade2.generatorName);
|
|
@@ -975740,7 +975910,7 @@ async function previewDocsWorkspace({
|
|
|
975740
975910
|
// src/commands/docs-diff/docsDiff.ts
|
|
975741
975911
|
init_lib8();
|
|
975742
975912
|
init_lib6();
|
|
975743
|
-
var
|
|
975913
|
+
var import_promises196 = require("fs/promises");
|
|
975744
975914
|
var import_pngjs2 = __toESM(require_png(), 1);
|
|
975745
975915
|
async function getSlugForFiles2({
|
|
975746
975916
|
previewUrl,
|
|
@@ -975963,8 +976133,8 @@ async function generateComparisons2({
|
|
|
975963
976133
|
afterPath,
|
|
975964
976134
|
comparisonBasePath
|
|
975965
976135
|
}) {
|
|
975966
|
-
const beforePng = import_pngjs2.PNG.sync.read(await (0,
|
|
975967
|
-
const afterPng = import_pngjs2.PNG.sync.read(await (0,
|
|
976136
|
+
const beforePng = import_pngjs2.PNG.sync.read(await (0, import_promises196.readFile)(beforePath));
|
|
976137
|
+
const afterPng = import_pngjs2.PNG.sync.read(await (0, import_promises196.readFile)(afterPath));
|
|
975968
976138
|
const beforeOriginalHeight = beforePng.height;
|
|
975969
976139
|
const afterOriginalHeight = afterPng.height;
|
|
975970
976140
|
const width = Math.max(beforePng.width, afterPng.width);
|
|
@@ -976002,7 +976172,7 @@ async function generateComparisons2({
|
|
|
976002
976172
|
const sideBySide = createSideBySideComparison2(croppedBefore, croppedAfter, 20, true);
|
|
976003
976173
|
const outPath = `${base4}-region-${i5 + 1}.png`;
|
|
976004
976174
|
const pngBuffer = import_pngjs2.PNG.sync.write(sideBySide);
|
|
976005
|
-
await (0,
|
|
976175
|
+
await (0, import_promises196.writeFile)(outPath, new Uint8Array(pngBuffer));
|
|
976006
976176
|
results.push({ changePercent, boundingBox, comparisonPath: outPath });
|
|
976007
976177
|
}
|
|
976008
976178
|
return results;
|
|
@@ -976081,7 +976251,7 @@ async function docsDiff({
|
|
|
976081
976251
|
outputDir.startsWith("/") ? outputDir : join8(cwd(), RelativeFilePath2.of(outputDir))
|
|
976082
976252
|
);
|
|
976083
976253
|
if (!await doesPathExist(outputPath)) {
|
|
976084
|
-
await (0,
|
|
976254
|
+
await (0, import_promises196.mkdir)(outputPath, { recursive: true });
|
|
976085
976255
|
}
|
|
976086
976256
|
const results = [];
|
|
976087
976257
|
await cliContext.runTask(async (context3) => {
|
|
@@ -976509,7 +976679,7 @@ init_lib6();
|
|
|
976509
976679
|
// src/commands/docs-theme/ThemeExporter.ts
|
|
976510
976680
|
init_lib12();
|
|
976511
976681
|
init_lib8();
|
|
976512
|
-
var
|
|
976682
|
+
var import_promises197 = require("fs/promises");
|
|
976513
976683
|
init_js_yaml();
|
|
976514
976684
|
var import_path109 = __toESM(require("path"), 1);
|
|
976515
976685
|
var ThemeExporter = class {
|
|
@@ -976522,18 +976692,18 @@ var ThemeExporter = class {
|
|
|
976522
976692
|
const docsDir = import_path109.default.dirname(docsYmlPath);
|
|
976523
976693
|
const outDir = output2 != null ? import_path109.default.resolve(process.cwd(), output2) : import_path109.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
976524
976694
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
976525
|
-
const raw = index_vite_proxy_tmp_default.load(await (0,
|
|
976695
|
+
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises197.readFile)(docsYmlPath, "utf-8"));
|
|
976526
976696
|
const themeConfig = {};
|
|
976527
976697
|
for (const [k4, v3] of Object.entries(raw)) {
|
|
976528
976698
|
if (docs_yml_exports.THEME_ELIGIBLE_YAML_KEYS.has(k4)) {
|
|
976529
976699
|
themeConfig[k4] = v3;
|
|
976530
976700
|
}
|
|
976531
976701
|
}
|
|
976532
|
-
await (0,
|
|
976702
|
+
await (0, import_promises197.mkdir)(outDir, { recursive: true });
|
|
976533
976703
|
const assetsDir = import_path109.default.join(outDir, "assets");
|
|
976534
|
-
await (0,
|
|
976704
|
+
await (0, import_promises197.mkdir)(assetsDir, { recursive: true });
|
|
976535
976705
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
976536
|
-
await (0,
|
|
976706
|
+
await (0, import_promises197.writeFile)(import_path109.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
976537
976707
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
976538
976708
|
}
|
|
976539
976709
|
};
|
|
@@ -976547,8 +976717,8 @@ async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
|
976547
976717
|
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path109.default.basename(abs) : relFromProject : relFromSource;
|
|
976548
976718
|
const dest = import_path109.default.join(assetsDir, destRelative);
|
|
976549
976719
|
try {
|
|
976550
|
-
await (0,
|
|
976551
|
-
await (0,
|
|
976720
|
+
await (0, import_promises197.mkdir)(import_path109.default.dirname(dest), { recursive: true });
|
|
976721
|
+
await (0, import_promises197.copyFile)(abs, dest);
|
|
976552
976722
|
return `./assets/${destRelative.split(import_path109.default.sep).join("/")}`;
|
|
976553
976723
|
} catch {
|
|
976554
976724
|
return obj;
|
|
@@ -976640,7 +976810,7 @@ async function listDocsThemes({
|
|
|
976640
976810
|
|
|
976641
976811
|
// src/commands/docs-theme/uploadDocsTheme.ts
|
|
976642
976812
|
init_lib6();
|
|
976643
|
-
var
|
|
976813
|
+
var import_promises199 = require("fs/promises");
|
|
976644
976814
|
init_js_yaml();
|
|
976645
976815
|
var import_path111 = __toESM(require("path"), 1);
|
|
976646
976816
|
|
|
@@ -976649,7 +976819,7 @@ init_lib8();
|
|
|
976649
976819
|
init_lib6();
|
|
976650
976820
|
var import_child_process13 = require("child_process");
|
|
976651
976821
|
var import_crypto10 = require("crypto");
|
|
976652
|
-
var
|
|
976822
|
+
var import_promises198 = require("fs/promises");
|
|
976653
976823
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
976654
976824
|
var import_path110 = __toESM(require("path"), 1);
|
|
976655
976825
|
function getGitRoot() {
|
|
@@ -976693,7 +976863,7 @@ var ThemeConfigProcessor = class {
|
|
|
976693
976863
|
filePaths.map(async (filePath) => {
|
|
976694
976864
|
const abs = import_path110.default.resolve(this.themeDir, filePath);
|
|
976695
976865
|
try {
|
|
976696
|
-
await (0,
|
|
976866
|
+
await (0, import_promises198.access)(abs);
|
|
976697
976867
|
} catch {
|
|
976698
976868
|
errors4.push(`Referenced file not found: ${abs}`);
|
|
976699
976869
|
}
|
|
@@ -976858,7 +977028,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
976858
977028
|
return { config: cfg, filesUploaded };
|
|
976859
977029
|
}
|
|
976860
977030
|
async uploadFileToCas(absolutePath) {
|
|
976861
|
-
const content5 = await (0,
|
|
977031
|
+
const content5 = await (0, import_promises198.readFile)(absolutePath);
|
|
976862
977032
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
976863
977033
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
976864
977034
|
return this.uploadToCas(content5, contentType, bindPath, import_path110.default.basename(absolutePath));
|
|
@@ -976973,7 +977143,7 @@ async function uploadDocsTheme({
|
|
|
976973
977143
|
await cliContext.runTask(async (context3) => {
|
|
976974
977144
|
let rawYaml;
|
|
976975
977145
|
try {
|
|
976976
|
-
const content5 = await (0,
|
|
977146
|
+
const content5 = await (0, import_promises199.readFile)(themeYmlPath, "utf-8");
|
|
976977
977147
|
rawYaml = index_vite_proxy_tmp_default.load(content5, { schema: index_vite_proxy_tmp_default.JSON_SCHEMA });
|
|
976978
977148
|
} catch {
|
|
976979
977149
|
context3.failAndThrow(
|
|
@@ -977028,7 +977198,7 @@ async function uploadDocsTheme({
|
|
|
977028
977198
|
// src/commands/downgrade/downgrade.ts
|
|
977029
977199
|
init_lib19();
|
|
977030
977200
|
init_lib6();
|
|
977031
|
-
var
|
|
977201
|
+
var import_promises200 = require("fs/promises");
|
|
977032
977202
|
function ensureFinalNewline2(content5) {
|
|
977033
977203
|
return content5.endsWith("\n") ? content5 : content5 + "\n";
|
|
977034
977204
|
}
|
|
@@ -977053,7 +977223,7 @@ async function downgrade({
|
|
|
977053
977223
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
977054
977224
|
draft.version = targetVersion;
|
|
977055
977225
|
});
|
|
977056
|
-
await (0,
|
|
977226
|
+
await (0, import_promises200.writeFile)(projectConfig._absolutePath, ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
977057
977227
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
977058
977228
|
}
|
|
977059
977229
|
|
|
@@ -977061,7 +977231,7 @@ async function downgrade({
|
|
|
977061
977231
|
init_lib36();
|
|
977062
977232
|
init_lib8();
|
|
977063
977233
|
init_lib22();
|
|
977064
|
-
var
|
|
977234
|
+
var import_promises201 = require("fs/promises");
|
|
977065
977235
|
init_js_yaml();
|
|
977066
977236
|
|
|
977067
977237
|
// src/commands/export/convertIrToOpenApi.ts
|
|
@@ -978483,8 +978653,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
978483
978653
|
ir: ir3,
|
|
978484
978654
|
mode: "openapi"
|
|
978485
978655
|
});
|
|
978486
|
-
await (0,
|
|
978487
|
-
await (0,
|
|
978656
|
+
await (0, import_promises201.mkdir)(dirname6(outputPath), { recursive: true });
|
|
978657
|
+
await (0, import_promises201.writeFile)(
|
|
978488
978658
|
outputPath,
|
|
978489
978659
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : index_vite_proxy_tmp_default.dump(openapi, { indent: indent4 })
|
|
978490
978660
|
);
|
|
@@ -979090,7 +979260,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
979090
979260
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
979091
979261
|
init_lib8();
|
|
979092
979262
|
init_lib6();
|
|
979093
|
-
var
|
|
979263
|
+
var import_promises202 = require("fs/promises");
|
|
979094
979264
|
init_js_yaml();
|
|
979095
979265
|
async function compareOpenAPISpecs({
|
|
979096
979266
|
originalPath,
|
|
@@ -979132,12 +979302,12 @@ async function compareOpenAPISpecs({
|
|
|
979132
979302
|
}
|
|
979133
979303
|
outputPath = join8(dirname6(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
979134
979304
|
}
|
|
979135
|
-
await (0,
|
|
979305
|
+
await (0, import_promises202.writeFile)(outputPath, index_vite_proxy_tmp_default.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
979136
979306
|
context3.logger.info(`Overrides written to ${outputPath}`);
|
|
979137
979307
|
});
|
|
979138
979308
|
}
|
|
979139
979309
|
async function loadSpec2(filepath, context3) {
|
|
979140
|
-
const contents = await (0,
|
|
979310
|
+
const contents = await (0, import_promises202.readFile)(filepath, "utf8");
|
|
979141
979311
|
try {
|
|
979142
979312
|
return JSON.parse(contents);
|
|
979143
979313
|
} catch {
|
|
@@ -979245,7 +979415,7 @@ init_lib35();
|
|
|
979245
979415
|
init_lib16();
|
|
979246
979416
|
init_lib15();
|
|
979247
979417
|
init_lib6();
|
|
979248
|
-
var
|
|
979418
|
+
var import_promises203 = require("fs/promises");
|
|
979249
979419
|
init_js_yaml();
|
|
979250
979420
|
async function writeOverridesForWorkspaces({
|
|
979251
979421
|
project,
|
|
@@ -979271,7 +979441,7 @@ async function writeOverridesForWorkspaces({
|
|
|
979271
979441
|
async function readExistingOverrides(overridesFilepath, context3) {
|
|
979272
979442
|
let parsedOverrides = null;
|
|
979273
979443
|
try {
|
|
979274
|
-
const contents = (await (0,
|
|
979444
|
+
const contents = (await (0, import_promises203.readFile)(overridesFilepath, "utf8")).toString();
|
|
979275
979445
|
try {
|
|
979276
979446
|
parsedOverrides = JSON.parse(contents);
|
|
979277
979447
|
} catch (err) {
|
|
@@ -979336,7 +979506,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
979336
979506
|
for (const overridesPath of overridesPaths) {
|
|
979337
979507
|
const existingOverrides = await readExistingOverrides(overridesPath, context3);
|
|
979338
979508
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides, includeModels, context: context3 });
|
|
979339
|
-
await (0,
|
|
979509
|
+
await (0, import_promises203.writeFile)(overridesPath, index_vite_proxy_tmp_default.dump(content5));
|
|
979340
979510
|
}
|
|
979341
979511
|
} else {
|
|
979342
979512
|
const content5 = generateOverridesContent({ ir: ir3, existingOverrides: {}, includeModels, context: context3 });
|
|
@@ -979350,7 +979520,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
979350
979520
|
overridesFilename = `${nameWithoutExt}-overrides${extension4}`;
|
|
979351
979521
|
}
|
|
979352
979522
|
}
|
|
979353
|
-
await (0,
|
|
979523
|
+
await (0, import_promises203.writeFile)(
|
|
979354
979524
|
join8(dirname6(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
979355
979525
|
index_vite_proxy_tmp_default.dump(content5)
|
|
979356
979526
|
);
|
|
@@ -979809,7 +979979,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
979809
979979
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
979810
979980
|
init_lib21();
|
|
979811
979981
|
init_source();
|
|
979812
|
-
var
|
|
979982
|
+
var import_promises204 = require("fs/promises");
|
|
979813
979983
|
async function generateJsonschemaForWorkspaces({
|
|
979814
979984
|
typeLocator,
|
|
979815
979985
|
project,
|
|
@@ -979857,9 +980027,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
979857
980027
|
context: context3
|
|
979858
980028
|
});
|
|
979859
980029
|
if (!await doesPathExist(dirname6(jsonschemaFilepath))) {
|
|
979860
|
-
await (0,
|
|
980030
|
+
await (0, import_promises204.mkdir)(dirname6(jsonschemaFilepath), { recursive: true });
|
|
979861
980031
|
}
|
|
979862
|
-
await (0,
|
|
980032
|
+
await (0, import_promises204.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
979863
980033
|
context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
979864
980034
|
});
|
|
979865
980035
|
})
|
|
@@ -979869,7 +980039,7 @@ async function generateJsonschemaForWorkspaces({
|
|
|
979869
980039
|
// src/commands/merge/mergeOpenAPIWithOverrides.ts
|
|
979870
980040
|
init_lib8();
|
|
979871
980041
|
init_lib6();
|
|
979872
|
-
var
|
|
980042
|
+
var import_promises205 = require("fs/promises");
|
|
979873
980043
|
init_js_yaml();
|
|
979874
980044
|
var HTTP_METHODS4 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
|
|
979875
980045
|
async function mergeOpenAPIWithOverrides({
|
|
@@ -979898,11 +980068,11 @@ async function mergeOpenAPIWithOverrides({
|
|
|
979898
980068
|
if (split2) {
|
|
979899
980069
|
const examples = extractEnrichedExamples2(openapi, merged);
|
|
979900
980070
|
const output2 = isJson ? JSON.stringify(examples, null, 2) : index_vite_proxy_tmp_default.dump(examples, { lineWidth: -1, noRefs: true });
|
|
979901
|
-
await (0,
|
|
980071
|
+
await (0, import_promises205.writeFile)(outputPath, output2);
|
|
979902
980072
|
context3.logger.info(`Extracted enriched examples written to ${outputPath}`);
|
|
979903
980073
|
} else {
|
|
979904
980074
|
const output2 = isJson ? JSON.stringify(merged, null, 2) : index_vite_proxy_tmp_default.dump(merged, { lineWidth: -1, noRefs: true });
|
|
979905
|
-
await (0,
|
|
980075
|
+
await (0, import_promises205.writeFile)(outputPath, output2);
|
|
979906
980076
|
if (outputPath === openapiPath) {
|
|
979907
980077
|
context3.logger.info(`Enriched ${openapiPath} in-place`);
|
|
979908
980078
|
} else {
|
|
@@ -979912,7 +980082,7 @@ async function mergeOpenAPIWithOverrides({
|
|
|
979912
980082
|
});
|
|
979913
980083
|
}
|
|
979914
980084
|
async function loadYamlOrJson(filepath, context3) {
|
|
979915
|
-
const contents = await (0,
|
|
980085
|
+
const contents = await (0, import_promises205.readFile)(filepath, "utf8");
|
|
979916
980086
|
try {
|
|
979917
980087
|
return JSON.parse(contents);
|
|
979918
980088
|
} catch {
|
|
@@ -980707,7 +980877,7 @@ init_lib35();
|
|
|
980707
980877
|
init_lib6();
|
|
980708
980878
|
init_esm19();
|
|
980709
980879
|
init_axios2();
|
|
980710
|
-
var
|
|
980880
|
+
var import_promises206 = require("fs/promises");
|
|
980711
980881
|
var import_path117 = __toESM(require("path"), 1);
|
|
980712
980882
|
init_index_min2();
|
|
980713
980883
|
var import_tmp_promise20 = __toESM(require_tmp_promise(), 1);
|
|
@@ -980761,7 +980931,7 @@ async function registerWorkspacesV1({
|
|
|
980761
980931
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
980762
980932
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
980763
980933
|
context3.logger.info("Uploading definition...");
|
|
980764
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
980934
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises206.readFile)(tarPath));
|
|
980765
980935
|
context3.logger.info(
|
|
980766
980936
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
980767
980937
|
);
|
|
@@ -980818,7 +980988,7 @@ function getAIEnhancerConfig2() {
|
|
|
980818
980988
|
// src/commands/resolve-specs/resolveSpecsForWorkspaces.ts
|
|
980819
980989
|
init_lib8();
|
|
980820
980990
|
init_lib35();
|
|
980821
|
-
var
|
|
980991
|
+
var import_promises207 = require("fs/promises");
|
|
980822
980992
|
var import_path118 = __toESM(require("path"), 1);
|
|
980823
980993
|
async function resolveSpecsForWorkspaces({
|
|
980824
980994
|
project,
|
|
@@ -980838,14 +981008,14 @@ async function resolveSpecsForWorkspaces({
|
|
|
980838
981008
|
return;
|
|
980839
981009
|
}
|
|
980840
981010
|
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path118.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
980841
|
-
await (0,
|
|
981011
|
+
await (0, import_promises207.mkdir)(workspaceOutputDir, { recursive: true });
|
|
980842
981012
|
const manifest = await collectRawSpecs({
|
|
980843
981013
|
specs,
|
|
980844
981014
|
hostOutputDir: workspaceOutputDir,
|
|
980845
981015
|
containerBaseDir: ".",
|
|
980846
981016
|
context: context3
|
|
980847
981017
|
});
|
|
980848
|
-
await (0,
|
|
981018
|
+
await (0, import_promises207.writeFile)(
|
|
980849
981019
|
import_path118.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
980850
981020
|
JSON.stringify(manifest, void 0, 4)
|
|
980851
981021
|
);
|
|
@@ -981055,7 +981225,7 @@ init_lib17();
|
|
|
981055
981225
|
init_lib19();
|
|
981056
981226
|
init_lib8();
|
|
981057
981227
|
init_lib6();
|
|
981058
|
-
var
|
|
981228
|
+
var import_promises208 = __toESM(require("fs/promises"), 1);
|
|
981059
981229
|
|
|
981060
981230
|
// src/commands/sdk-preview/computePreviewVersion.ts
|
|
981061
981231
|
var BASE_VERSION = "0.0.1";
|
|
@@ -981175,7 +981345,7 @@ async function sdkPreview({
|
|
|
981175
981345
|
const firstPath = pathOutputs[0];
|
|
981176
981346
|
const absolutePathToOutput = firstPath != null ? AbsoluteFilePath2.of(resolve6(cwd(), firstPath)) : void 0;
|
|
981177
981347
|
if (absolutePathToOutput != null) {
|
|
981178
|
-
await
|
|
981348
|
+
await import_promises208.default.mkdir(absolutePathToOutput, { recursive: true });
|
|
981179
981349
|
}
|
|
981180
981350
|
for (const workspace of project.apiWorkspaces) {
|
|
981181
981351
|
if (workspace.generatorsConfiguration == null) {
|
|
@@ -981365,7 +981535,7 @@ async function sdkPreview({
|
|
|
981365
981535
|
init_lib33();
|
|
981366
981536
|
init_lib6();
|
|
981367
981537
|
init_source();
|
|
981368
|
-
var
|
|
981538
|
+
var import_promises209 = require("fs/promises");
|
|
981369
981539
|
var import_path119 = require("path");
|
|
981370
981540
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
981371
981541
|
let command3;
|
|
@@ -981411,7 +981581,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
981411
981581
|
logger4.debug(`Found fern at: ${fernPath}`);
|
|
981412
981582
|
let resolvedPath;
|
|
981413
981583
|
try {
|
|
981414
|
-
resolvedPath = await (0,
|
|
981584
|
+
resolvedPath = await (0, import_promises209.realpath)(fernPath);
|
|
981415
981585
|
logger4.debug(`Resolved to: ${resolvedPath}`);
|
|
981416
981586
|
} catch (error50) {
|
|
981417
981587
|
logger4.debug(`Failed to resolve symlink: ${error50}`);
|
|
@@ -981725,22 +981895,22 @@ init_lib19();
|
|
|
981725
981895
|
init_lib8();
|
|
981726
981896
|
init_lib6();
|
|
981727
981897
|
var fs33 = __toESM(require("fs"), 1);
|
|
981728
|
-
var
|
|
981898
|
+
var import_promises210 = require("fs/promises");
|
|
981729
981899
|
init_graphql();
|
|
981730
981900
|
init_js_yaml();
|
|
981731
981901
|
var import_stream18 = require("stream");
|
|
981732
|
-
var
|
|
981902
|
+
var import_promises211 = require("stream/promises");
|
|
981733
981903
|
async function fetchAndWriteFile(url3, path119, logger4, indent4) {
|
|
981734
981904
|
const resp = await fetch(url3);
|
|
981735
981905
|
if (resp.ok && resp.body) {
|
|
981736
981906
|
logger4.debug("Origin successfully fetched, writing to file");
|
|
981737
981907
|
const fileStream = fs33.createWriteStream(path119);
|
|
981738
|
-
await (0,
|
|
981739
|
-
const fileContents = await (0,
|
|
981908
|
+
await (0, import_promises211.finished)(import_stream18.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
981909
|
+
const fileContents = await (0, import_promises210.readFile)(path119, "utf8");
|
|
981740
981910
|
try {
|
|
981741
|
-
await (0,
|
|
981911
|
+
await (0, import_promises210.writeFile)(path119, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
|
|
981742
981912
|
} catch (e2) {
|
|
981743
|
-
await (0,
|
|
981913
|
+
await (0, import_promises210.writeFile)(path119, index_vite_proxy_tmp_default.dump(index_vite_proxy_tmp_default.load(fileContents), { indent: indent4 }), "utf8");
|
|
981744
981914
|
}
|
|
981745
981915
|
logger4.debug("File written successfully");
|
|
981746
981916
|
}
|
|
@@ -981896,14 +982066,14 @@ async function tryDirectJSONFetch(url3, logger4) {
|
|
|
981896
982066
|
async function fetchGraphQLSchemaWithAutoDetection(url3, path119, logger4) {
|
|
981897
982067
|
const postResult = await tryGraphQLIntrospection(url3, logger4);
|
|
981898
982068
|
if (postResult.success) {
|
|
981899
|
-
await (0,
|
|
982069
|
+
await (0, import_promises210.writeFile)(path119, postResult.result, "utf8");
|
|
981900
982070
|
logger4.info("Successfully fetched GraphQL schema using POST introspection");
|
|
981901
982071
|
return;
|
|
981902
982072
|
}
|
|
981903
982073
|
logger4.debug(`POST introspection failed: ${postResult.error}`);
|
|
981904
982074
|
const getResult = await tryDirectJSONFetch(url3, logger4);
|
|
981905
982075
|
if (getResult.success) {
|
|
981906
|
-
await (0,
|
|
982076
|
+
await (0, import_promises210.writeFile)(path119, getResult.result, "utf8");
|
|
981907
982077
|
logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
|
|
981908
982078
|
return;
|
|
981909
982079
|
}
|
|
@@ -982613,7 +982783,7 @@ async function validateWorkspaces({
|
|
|
982613
982783
|
init_lib19();
|
|
982614
982784
|
init_lib8();
|
|
982615
982785
|
init_source();
|
|
982616
|
-
var
|
|
982786
|
+
var import_promises212 = require("fs/promises");
|
|
982617
982787
|
init_js_yaml();
|
|
982618
982788
|
var import_path121 = __toESM(require("path"), 1);
|
|
982619
982789
|
async function writeDefinitionForWorkspaces({
|
|
@@ -982695,22 +982865,22 @@ async function writeFernDefinition({
|
|
|
982695
982865
|
return a3.localeCompare(b5);
|
|
982696
982866
|
};
|
|
982697
982867
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
982698
|
-
await (0,
|
|
982868
|
+
await (0, import_promises212.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
982699
982869
|
}
|
|
982700
|
-
await (0,
|
|
982701
|
-
await (0,
|
|
982870
|
+
await (0, import_promises212.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
982871
|
+
await (0, import_promises212.writeFile)(
|
|
982702
982872
|
join8(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
982703
982873
|
index_vite_proxy_tmp_default.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
982704
982874
|
);
|
|
982705
982875
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
982706
982876
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
982707
|
-
await (0,
|
|
982708
|
-
await (0,
|
|
982877
|
+
await (0, import_promises212.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
982878
|
+
await (0, import_promises212.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(packageMarker.contents, { sortKeys }));
|
|
982709
982879
|
}
|
|
982710
982880
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
982711
982881
|
const absoluteFilepath = join8(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
982712
|
-
await (0,
|
|
982713
|
-
await (0,
|
|
982882
|
+
await (0, import_promises212.mkdir)(dirname6(absoluteFilepath), { recursive: true });
|
|
982883
|
+
await (0, import_promises212.writeFile)(absoluteFilepath, index_vite_proxy_tmp_default.dump(definitionFile.contents, { sortKeys }));
|
|
982714
982884
|
}
|
|
982715
982885
|
}
|
|
982716
982886
|
|
|
@@ -982718,7 +982888,7 @@ async function writeFernDefinition({
|
|
|
982718
982888
|
init_lib67();
|
|
982719
982889
|
init_lib8();
|
|
982720
982890
|
init_source();
|
|
982721
|
-
var
|
|
982891
|
+
var import_promises213 = require("fs/promises");
|
|
982722
982892
|
async function writeDocsDefinitionForProject({
|
|
982723
982893
|
project,
|
|
982724
982894
|
outputPath,
|
|
@@ -982750,7 +982920,7 @@ async function writeDocsDefinitionForProject({
|
|
|
982750
982920
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
982751
982921
|
});
|
|
982752
982922
|
const docsDefinition = await docsResolver.resolve();
|
|
982753
|
-
await (0,
|
|
982923
|
+
await (0, import_promises213.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
982754
982924
|
context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
982755
982925
|
});
|
|
982756
982926
|
}
|
package/package.json
CHANGED