fern-api 0.28.0 → 0.29.1-rc0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.cjs +249 -181
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -29561,7 +29561,7 @@ var require_agent = __commonJS({
|
|
|
29561
29561
|
var { Socket } = require("net");
|
|
29562
29562
|
var { Duplex } = require("stream");
|
|
29563
29563
|
var { resolve: resolve6 } = require("path");
|
|
29564
|
-
var { readFile:
|
|
29564
|
+
var { readFile: readFile42 } = require("fs");
|
|
29565
29565
|
var { execFile, spawn } = require("child_process");
|
|
29566
29566
|
var { isParsedKey, parseKey } = require_keyParser();
|
|
29567
29567
|
var {
|
|
@@ -29779,7 +29779,7 @@ var require_agent = __commonJS({
|
|
|
29779
29779
|
cb = once2(cb);
|
|
29780
29780
|
let socketPath = this.socketPath;
|
|
29781
29781
|
let triedCygpath = false;
|
|
29782
|
-
|
|
29782
|
+
readFile42(socketPath, function readCygsocket(err, data2) {
|
|
29783
29783
|
if (err) {
|
|
29784
29784
|
if (triedCygpath)
|
|
29785
29785
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
@@ -29788,7 +29788,7 @@ var require_agent = __commonJS({
|
|
|
29788
29788
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
29789
29789
|
triedCygpath = true;
|
|
29790
29790
|
socketPath = stdout.toString().replace(/[\r\n]/g, "");
|
|
29791
|
-
|
|
29791
|
+
readFile42(socketPath, readCygsocket);
|
|
29792
29792
|
});
|
|
29793
29793
|
return;
|
|
29794
29794
|
}
|
|
@@ -66819,8 +66819,8 @@ var require_graceful_fs = __commonJS({
|
|
|
66819
66819
|
fs10.createReadStream = createReadStream;
|
|
66820
66820
|
fs10.createWriteStream = createWriteStream7;
|
|
66821
66821
|
var fs$readFile = fs10.readFile;
|
|
66822
|
-
fs10.readFile =
|
|
66823
|
-
function
|
|
66822
|
+
fs10.readFile = readFile42;
|
|
66823
|
+
function readFile42(path42, options2, cb) {
|
|
66824
66824
|
if (typeof options2 === "function")
|
|
66825
66825
|
cb = options2, options2 = null;
|
|
66826
66826
|
return go$readFile(path42, options2, cb);
|
|
@@ -68327,7 +68327,7 @@ var require_jsonfile = __commonJS({
|
|
|
68327
68327
|
}
|
|
68328
68328
|
return obj;
|
|
68329
68329
|
}
|
|
68330
|
-
var
|
|
68330
|
+
var readFile42 = universalify.fromPromise(_readFile);
|
|
68331
68331
|
function readFileSync4(file, options2 = {}) {
|
|
68332
68332
|
if (typeof options2 === "string") {
|
|
68333
68333
|
options2 = { encoding: options2 };
|
|
@@ -68359,7 +68359,7 @@ var require_jsonfile = __commonJS({
|
|
|
68359
68359
|
return fs9.writeFileSync(file, str3, options2);
|
|
68360
68360
|
}
|
|
68361
68361
|
var jsonfile = {
|
|
68362
|
-
readFile:
|
|
68362
|
+
readFile: readFile42,
|
|
68363
68363
|
readFileSync: readFileSync4,
|
|
68364
68364
|
writeFile: writeFile40,
|
|
68365
68365
|
writeFileSync
|
|
@@ -131140,7 +131140,7 @@ ${error.message}`;
|
|
|
131140
131140
|
Object.defineProperty(exports22, "__esModule", {
|
|
131141
131141
|
value: true
|
|
131142
131142
|
});
|
|
131143
|
-
exports22.readFile =
|
|
131143
|
+
exports22.readFile = readFile42;
|
|
131144
131144
|
exports22.readFileSync = readFileSync4;
|
|
131145
131145
|
var _fs = _interopRequireDefault(require("fs"));
|
|
131146
131146
|
function _interopRequireDefault(obj) {
|
|
@@ -131159,7 +131159,7 @@ ${error.message}`;
|
|
|
131159
131159
|
});
|
|
131160
131160
|
});
|
|
131161
131161
|
}
|
|
131162
|
-
async function
|
|
131162
|
+
async function readFile42(filepath, options2 = {}) {
|
|
131163
131163
|
const throwNotFound = options2.throwNotFound === true;
|
|
131164
131164
|
try {
|
|
131165
131165
|
const content5 = await fsReadFileAsync(filepath, "utf8");
|
|
@@ -322680,8 +322680,8 @@ ${error.message}`;
|
|
|
322680
322680
|
cb(null, x2);
|
|
322681
322681
|
}
|
|
322682
322682
|
};
|
|
322683
|
-
var defaultReadPackage = function defaultReadPackage2(
|
|
322684
|
-
|
|
322683
|
+
var defaultReadPackage = function defaultReadPackage2(readFile42, pkgfile, cb) {
|
|
322684
|
+
readFile42(pkgfile, function(readFileErr, body) {
|
|
322685
322685
|
if (readFileErr)
|
|
322686
322686
|
cb(readFileErr);
|
|
322687
322687
|
else {
|
|
@@ -322717,7 +322717,7 @@ ${error.message}`;
|
|
|
322717
322717
|
opts = normalizeOptions(x2, opts);
|
|
322718
322718
|
var isFile = opts.isFile || defaultIsFile;
|
|
322719
322719
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
322720
|
-
var
|
|
322720
|
+
var readFile42 = opts.readFile || fs9.readFile;
|
|
322721
322721
|
var realpath = opts.realpath || defaultRealpath;
|
|
322722
322722
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
322723
322723
|
if (opts.readFile && opts.readPackage) {
|
|
@@ -322849,7 +322849,7 @@ ${error.message}`;
|
|
|
322849
322849
|
isFile(pkgfile, function(err2, ex) {
|
|
322850
322850
|
if (!ex)
|
|
322851
322851
|
return loadpkg(path42.dirname(dir), cb2);
|
|
322852
|
-
readPackage(
|
|
322852
|
+
readPackage(readFile42, pkgfile, function(err3, pkgParam) {
|
|
322853
322853
|
if (err3)
|
|
322854
322854
|
cb2(err3);
|
|
322855
322855
|
var pkg2 = pkgParam;
|
|
@@ -322877,7 +322877,7 @@ ${error.message}`;
|
|
|
322877
322877
|
return cb2(err2);
|
|
322878
322878
|
if (!ex)
|
|
322879
322879
|
return loadAsFile(path42.join(x22, "index"), fpkg, cb2);
|
|
322880
|
-
readPackage(
|
|
322880
|
+
readPackage(readFile42, pkgfile, function(err3, pkgParam) {
|
|
322881
322881
|
if (err3)
|
|
322882
322882
|
return cb2(err3);
|
|
322883
322883
|
var pkg2 = pkgParam;
|
|
@@ -367503,7 +367503,8 @@ var init_JsonRequest2 = __esm({
|
|
|
367503
367503
|
init_core3();
|
|
367504
367504
|
JsonRequest = schemas_exports5.objectWithoutOptionalProperties({
|
|
367505
367505
|
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema),
|
|
367506
|
-
contentType: schemas_exports5.string().optional()
|
|
367506
|
+
contentType: schemas_exports5.string().optional(),
|
|
367507
|
+
additionalProperties: schemas_exports5.boolean()
|
|
367507
367508
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
367508
367509
|
}
|
|
367509
367510
|
});
|
|
@@ -367844,7 +367845,8 @@ var init_ObjectSchema2 = __esm({
|
|
|
367844
367845
|
ObjectSchema2 = schemas_exports5.objectWithoutOptionalProperties({
|
|
367845
367846
|
allOf: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ReferencedSchema)),
|
|
367846
367847
|
properties: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ObjectProperty)),
|
|
367847
|
-
allOfPropertyConflicts: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).AllOfPropertyConflict))
|
|
367848
|
+
allOfPropertyConflicts: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).AllOfPropertyConflict)),
|
|
367849
|
+
additionalProperties: schemas_exports5.boolean()
|
|
367848
367850
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithSdkGroupName));
|
|
367849
367851
|
}
|
|
367850
367852
|
});
|
|
@@ -368299,7 +368301,8 @@ var init_JsonRequestWithExample2 = __esm({
|
|
|
368299
368301
|
JsonRequestWithExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
368300
368302
|
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample),
|
|
368301
368303
|
contentType: schemas_exports5.string().optional(),
|
|
368302
|
-
fullExamples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).NamedFullExample)).optional()
|
|
368304
|
+
fullExamples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).NamedFullExample)).optional(),
|
|
368305
|
+
additionalProperties: schemas_exports5.boolean()
|
|
368303
368306
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
368304
368307
|
}
|
|
368305
368308
|
});
|
|
@@ -368527,7 +368530,8 @@ var init_ObjectSchemaWithExample2 = __esm({
|
|
|
368527
368530
|
allOf: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ReferencedSchema)),
|
|
368528
368531
|
properties: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ObjectPropertyWithExample)),
|
|
368529
368532
|
allOfPropertyConflicts: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).AllOfPropertyConflict)),
|
|
368530
|
-
fullExamples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).NamedFullExample)).optional()
|
|
368533
|
+
fullExamples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).NamedFullExample)).optional(),
|
|
368534
|
+
additionalProperties: schemas_exports5.boolean()
|
|
368531
368535
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithSdkGroupName));
|
|
368532
368536
|
}
|
|
368533
368537
|
});
|
|
@@ -385937,7 +385941,7 @@ var require_parse7 = __commonJS({
|
|
|
385937
385941
|
extension: url.getExtension(path42)
|
|
385938
385942
|
};
|
|
385939
385943
|
try {
|
|
385940
|
-
const resolver3 = await
|
|
385944
|
+
const resolver3 = await readFile42(file, options2, $refs);
|
|
385941
385945
|
$ref.pathType = resolver3.plugin.name;
|
|
385942
385946
|
file.data = resolver3.result;
|
|
385943
385947
|
const parser2 = await parseFile(file, options2, $refs);
|
|
@@ -385950,7 +385954,7 @@ var require_parse7 = __commonJS({
|
|
|
385950
385954
|
throw err;
|
|
385951
385955
|
}
|
|
385952
385956
|
}
|
|
385953
|
-
function
|
|
385957
|
+
function readFile42(file, options2, $refs) {
|
|
385954
385958
|
return new Promise((resolve6, reject2) => {
|
|
385955
385959
|
let resolvers = plugins.all(options2.resolve);
|
|
385956
385960
|
resolvers = plugins.filter(resolvers, "canRead", file);
|
|
@@ -1012974,7 +1012978,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1012974
1012978
|
properties: {
|
|
1012975
1012979
|
...event,
|
|
1012976
1012980
|
...event.properties,
|
|
1012977
|
-
version: "0.
|
|
1012981
|
+
version: "0.29.1-rc0",
|
|
1012978
1012982
|
usingAccessToken: true
|
|
1012979
1012983
|
}
|
|
1012980
1012984
|
});
|
|
@@ -1013036,7 +1013040,7 @@ var UserPosthogManager = class {
|
|
|
1013036
1013040
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1013037
1013041
|
event: "CLI",
|
|
1013038
1013042
|
properties: {
|
|
1013039
|
-
version: "0.
|
|
1013043
|
+
version: "0.29.1-rc0",
|
|
1013040
1013044
|
...event,
|
|
1013041
1013045
|
...event.properties
|
|
1013042
1013046
|
}
|
|
@@ -1017741,6 +1017745,9 @@ function buildObjectTypeDeclaration({ schema: schema2, context, declarationFile
|
|
|
1017741
1017745
|
if (extendedSchemas.length > 0) {
|
|
1017742
1017746
|
objectTypeDeclaration.extends = extendedSchemas;
|
|
1017743
1017747
|
}
|
|
1017748
|
+
if (schema2.additionalProperties) {
|
|
1017749
|
+
objectTypeDeclaration["extra-properties"] = true;
|
|
1017750
|
+
}
|
|
1017744
1017751
|
return {
|
|
1017745
1017752
|
name: schema2.nameOverride ?? schema2.generatedName,
|
|
1017746
1017753
|
schema: objectTypeDeclaration
|
|
@@ -1018438,7 +1018445,7 @@ function isReferenceObject(parameter) {
|
|
|
1018438
1018445
|
|
|
1018439
1018446
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertAdditionalProperties.js
|
|
1018440
1018447
|
function convertAdditionalProperties({ nameOverride, generatedName, breadcrumbs, additionalProperties, description, wrapAsNullable, context, groupName, example }) {
|
|
1018441
|
-
if (typeof additionalProperties === "boolean" ||
|
|
1018448
|
+
if (typeof additionalProperties === "boolean" || isAdditionalPropertiesAny(additionalProperties)) {
|
|
1018442
1018449
|
return wrapMap({
|
|
1018443
1018450
|
nameOverride,
|
|
1018444
1018451
|
generatedName,
|
|
@@ -1018493,9 +1018500,6 @@ function convertAdditionalProperties({ nameOverride, generatedName, breadcrumbs,
|
|
|
1018493
1018500
|
example
|
|
1018494
1018501
|
});
|
|
1018495
1018502
|
}
|
|
1018496
|
-
function isAdditionalPropertiesEmptyDictionary(additionalProperties) {
|
|
1018497
|
-
return !isReferenceObject(additionalProperties) && Object.keys(additionalProperties).length === 0;
|
|
1018498
|
-
}
|
|
1018499
1018503
|
function wrapMap({ nameOverride, generatedName, keySchema, valueSchema, wrapAsNullable, description, groupName, example }) {
|
|
1018500
1018504
|
if (wrapAsNullable) {
|
|
1018501
1018505
|
return SchemaWithExample.nullable({
|
|
@@ -1018524,6 +1018528,15 @@ function wrapMap({ nameOverride, generatedName, keySchema, valueSchema, wrapAsNu
|
|
|
1018524
1018528
|
example
|
|
1018525
1018529
|
});
|
|
1018526
1018530
|
}
|
|
1018531
|
+
function isAdditionalPropertiesAny(additionalProperties) {
|
|
1018532
|
+
if (additionalProperties == null) {
|
|
1018533
|
+
return false;
|
|
1018534
|
+
}
|
|
1018535
|
+
if (typeof additionalProperties === "boolean") {
|
|
1018536
|
+
return additionalProperties;
|
|
1018537
|
+
}
|
|
1018538
|
+
return !isReferenceObject(additionalProperties) && Object.keys(additionalProperties).length === 0;
|
|
1018539
|
+
}
|
|
1018527
1018540
|
|
|
1018528
1018541
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertArray.js
|
|
1018529
1018542
|
function convertArray({ nameOverride, generatedName, breadcrumbs, item, description, wrapAsNullable, context, groupName, example }) {
|
|
@@ -1019084,7 +1019097,8 @@ function convertSchemaWithExampleToSchema(schema2) {
|
|
|
1019084
1019097
|
description: schema2.description,
|
|
1019085
1019098
|
generatedName: schema2.generatedName,
|
|
1019086
1019099
|
nameOverride: schema2.nameOverride,
|
|
1019087
|
-
groupName: schema2.groupName
|
|
1019100
|
+
groupName: schema2.groupName,
|
|
1019101
|
+
additionalProperties: schema2.additionalProperties
|
|
1019088
1019102
|
});
|
|
1019089
1019103
|
case "array":
|
|
1019090
1019104
|
return Schema2.array({
|
|
@@ -1019305,7 +1019319,7 @@ function isObjectEqual(a2, b2) {
|
|
|
1019305
1019319
|
}
|
|
1019306
1019320
|
|
|
1019307
1019321
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/schema/convertObject.js
|
|
1019308
|
-
function convertObject({ nameOverride, generatedName, breadcrumbs, properties, description, required, wrapAsNullable, allOf, context, propertiesToExclude, groupName, fullExamples }) {
|
|
1019322
|
+
function convertObject({ nameOverride, generatedName, breadcrumbs, properties, description, required, wrapAsNullable, allOf, context, propertiesToExclude, groupName, fullExamples, additionalProperties }) {
|
|
1019309
1019323
|
const allRequired = [...required ?? []];
|
|
1019310
1019324
|
const propertiesToConvert = { ...properties };
|
|
1019311
1019325
|
const inlinedParentProperties = [];
|
|
@@ -1019441,10 +1019455,11 @@ function convertObject({ nameOverride, generatedName, breadcrumbs, properties, d
|
|
|
1019441
1019455
|
allOf: parents.map((parent2) => parent2.convertedSchema),
|
|
1019442
1019456
|
allOfPropertyConflicts,
|
|
1019443
1019457
|
groupName,
|
|
1019444
|
-
fullExamples
|
|
1019458
|
+
fullExamples,
|
|
1019459
|
+
additionalProperties
|
|
1019445
1019460
|
});
|
|
1019446
1019461
|
}
|
|
1019447
|
-
function wrapObject({ nameOverride, generatedName, wrapAsNullable, properties, description, allOf, allOfPropertyConflicts, groupName, fullExamples }) {
|
|
1019462
|
+
function wrapObject({ nameOverride, generatedName, wrapAsNullable, properties, description, allOf, allOfPropertyConflicts, groupName, fullExamples, additionalProperties }) {
|
|
1019448
1019463
|
if (wrapAsNullable) {
|
|
1019449
1019464
|
return SchemaWithExample.nullable({
|
|
1019450
1019465
|
nameOverride,
|
|
@@ -1019457,7 +1019472,8 @@ function wrapObject({ nameOverride, generatedName, wrapAsNullable, properties, d
|
|
|
1019457
1019472
|
allOf,
|
|
1019458
1019473
|
allOfPropertyConflicts,
|
|
1019459
1019474
|
groupName,
|
|
1019460
|
-
fullExamples
|
|
1019475
|
+
fullExamples,
|
|
1019476
|
+
additionalProperties: isAdditionalPropertiesAny(additionalProperties)
|
|
1019461
1019477
|
}),
|
|
1019462
1019478
|
description,
|
|
1019463
1019479
|
groupName
|
|
@@ -1019471,7 +1019487,8 @@ function wrapObject({ nameOverride, generatedName, wrapAsNullable, properties, d
|
|
|
1019471
1019487
|
allOf,
|
|
1019472
1019488
|
allOfPropertyConflicts,
|
|
1019473
1019489
|
groupName,
|
|
1019474
|
-
fullExamples
|
|
1019490
|
+
fullExamples,
|
|
1019491
|
+
additionalProperties: isAdditionalPropertiesAny(additionalProperties)
|
|
1019475
1019492
|
});
|
|
1019476
1019493
|
}
|
|
1019477
1019494
|
function getAllProperties({ schema: schema2, context, breadcrumbs }) {
|
|
@@ -1020139,7 +1020156,8 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
1020139
1020156
|
context,
|
|
1020140
1020157
|
propertiesToExclude,
|
|
1020141
1020158
|
groupName,
|
|
1020142
|
-
fullExamples
|
|
1020159
|
+
fullExamples,
|
|
1020160
|
+
additionalProperties: schema2.additionalProperties
|
|
1020143
1020161
|
});
|
|
1020144
1020162
|
}
|
|
1020145
1020163
|
if (schema2.type === "object" && hasNoOneOf(schema2) && hasNoAllOf(schema2) && hasNoProperties(schema2)) {
|
|
@@ -1021146,7 +1021164,8 @@ function convertSchemaToSchemaWithExample(schema2) {
|
|
|
1021146
1021164
|
generatedName: schema2.generatedName,
|
|
1021147
1021165
|
nameOverride: schema2.nameOverride,
|
|
1021148
1021166
|
groupName: schema2.groupName,
|
|
1021149
|
-
fullExamples: void 0
|
|
1021167
|
+
fullExamples: void 0,
|
|
1021168
|
+
additionalProperties: schema2.additionalProperties
|
|
1021150
1021169
|
});
|
|
1021151
1021170
|
case "array":
|
|
1021152
1021171
|
return SchemaWithExample.array({
|
|
@@ -1021761,7 +1021780,8 @@ function convertMultipartRequestToSchema(request) {
|
|
|
1021761
1021780
|
description: request.description,
|
|
1021762
1021781
|
nameOverride: void 0,
|
|
1021763
1021782
|
generatedName: "",
|
|
1021764
|
-
groupName: void 0
|
|
1021783
|
+
groupName: void 0,
|
|
1021784
|
+
additionalProperties: false
|
|
1021765
1021785
|
});
|
|
1021766
1021786
|
}
|
|
1021767
1021787
|
|
|
@@ -1022901,7 +1022921,8 @@ function convertRequest({ requestBody, document: document6, context, requestBrea
|
|
|
1022901
1022921
|
description: void 0,
|
|
1022902
1022922
|
schema: requestSchema,
|
|
1022903
1022923
|
contentType: void 0,
|
|
1022904
|
-
fullExamples: jsonMediaObject.examples
|
|
1022924
|
+
fullExamples: jsonMediaObject.examples,
|
|
1022925
|
+
additionalProperties: !isReferenceObject(jsonMediaObject.schema) && isAdditionalPropertiesAny(jsonMediaObject.schema.additionalProperties)
|
|
1022905
1022926
|
});
|
|
1022906
1022927
|
}
|
|
1022907
1022928
|
function resolveSchema(schema2, document6) {
|
|
@@ -1025411,6 +1025432,9 @@ function getRequest({ declarationFile, context, request, requestNameOverride, ge
|
|
|
1025411
1025432
|
if (extendedSchemas.length > 0) {
|
|
1025412
1025433
|
requestBodySchema.extends = extendedSchemas;
|
|
1025413
1025434
|
}
|
|
1025435
|
+
if (request.additionalProperties) {
|
|
1025436
|
+
requestBodySchema["extra-properties"] = true;
|
|
1025437
|
+
}
|
|
1025414
1025438
|
const convertedRequestValue = {
|
|
1025415
1025439
|
name: requestNameOverride ?? resolvedSchema.nameOverride ?? resolvedSchema.generatedName,
|
|
1025416
1025440
|
"query-parameters": queryParameters,
|
|
@@ -1030337,10 +1030361,10 @@ var CliContext = class {
|
|
|
1030337
1030361
|
return "fern-api";
|
|
1030338
1030362
|
}
|
|
1030339
1030363
|
getPackageVersion() {
|
|
1030340
|
-
if ("0.
|
|
1030364
|
+
if ("0.29.1-rc0" == null) {
|
|
1030341
1030365
|
this.logger.error("CLI_VERSION is not defined");
|
|
1030342
1030366
|
}
|
|
1030343
|
-
return "0.
|
|
1030367
|
+
return "0.29.1-rc0";
|
|
1030344
1030368
|
}
|
|
1030345
1030369
|
getCliName() {
|
|
1030346
1030370
|
if ("fern" == null) {
|
|
@@ -1037426,7 +1037450,7 @@ function filterServiceTypeReferenceInfoForAudiences(serviceTypeReferenceInfo, fi
|
|
|
1037426
1037450
|
}
|
|
1037427
1037451
|
|
|
1037428
1037452
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/DocsDefinitionResolver.js
|
|
1037429
|
-
var
|
|
1037453
|
+
var import_gray_matter3 = __toESM(require_gray_matter());
|
|
1037430
1037454
|
|
|
1037431
1037455
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/convertDocsSnippetsConfigToFdr.js
|
|
1037432
1037456
|
function convertDocsSnippetsConfigToFdr(snippetsConfiguration) {
|
|
@@ -1044758,6 +1044782,43 @@ function trimAnchor(text8) {
|
|
|
1044758
1044782
|
return text8.replace(/#.*$/, "");
|
|
1044759
1044783
|
}
|
|
1044760
1044784
|
|
|
1044785
|
+
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/replaceReferencedMarkdown.js
|
|
1044786
|
+
var import_promises31 = require("fs/promises");
|
|
1044787
|
+
var import_gray_matter2 = __toESM(require_gray_matter());
|
|
1044788
|
+
async function defaultMarkdownLoader(filepath) {
|
|
1044789
|
+
const { content: content5 } = (0, import_gray_matter2.default)(await (0, import_promises31.readFile)(filepath));
|
|
1044790
|
+
return content5;
|
|
1044791
|
+
}
|
|
1044792
|
+
async function replaceReferencedMarkdown({
|
|
1044793
|
+
markdown,
|
|
1044794
|
+
absolutePathToFernFolder,
|
|
1044795
|
+
absolutePathToMdx,
|
|
1044796
|
+
context,
|
|
1044797
|
+
markdownLoader = defaultMarkdownLoader
|
|
1044798
|
+
}) {
|
|
1044799
|
+
if (!markdown.includes("<Markdown")) {
|
|
1044800
|
+
return markdown;
|
|
1044801
|
+
}
|
|
1044802
|
+
const regex3 = /<Markdown\s+src={?['"]([^'"]+.mdx?)['"](?! \+)}?\s*\/>/g;
|
|
1044803
|
+
let newMarkdown = markdown;
|
|
1044804
|
+
let match;
|
|
1044805
|
+
while ((match = regex3.exec(markdown)) != null) {
|
|
1044806
|
+
const matchString = match[0];
|
|
1044807
|
+
const src = match[1];
|
|
1044808
|
+
if (matchString == null || src == null) {
|
|
1044809
|
+
throw new Error(`Failed to parse regex "${match}" in ${absolutePathToMdx}`);
|
|
1044810
|
+
}
|
|
1044811
|
+
const filepath = resolve(src.startsWith("/") ? absolutePathToFernFolder : dirname(absolutePathToMdx), RelativeFilePath.of(src.replace(/^\//, "")));
|
|
1044812
|
+
try {
|
|
1044813
|
+
newMarkdown = newMarkdown.replace(matchString, await markdownLoader(filepath));
|
|
1044814
|
+
} catch (e) {
|
|
1044815
|
+
context.failAndThrow(`Failed to read markdown file "${src}" referenced in ${absolutePathToMdx}`, e);
|
|
1044816
|
+
break;
|
|
1044817
|
+
}
|
|
1044818
|
+
}
|
|
1044819
|
+
return newMarkdown;
|
|
1044820
|
+
}
|
|
1044821
|
+
|
|
1044761
1044822
|
// pnp:/home/circleci/project/packages/cli/docs-resolver/lib/wrapWithHttps.js
|
|
1044762
1044823
|
function wrapWithHttps(url) {
|
|
1044763
1044824
|
return url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`;
|
|
@@ -1044805,6 +1044866,14 @@ var DocsDefinitionResolver = class {
|
|
|
1044805
1044866
|
});
|
|
1044806
1044867
|
});
|
|
1044807
1044868
|
this.markdownFilesToFullSlugs = this.getMarkdownFilesToFullSlugs(this.parsedDocsConfig.pages);
|
|
1044869
|
+
for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
|
|
1044870
|
+
this.parsedDocsConfig.pages[RelativeFilePath.of(relativePath)] = await replaceReferencedMarkdown({
|
|
1044871
|
+
markdown,
|
|
1044872
|
+
absolutePathToFernFolder: this.docsWorkspace.absoluteFilepath,
|
|
1044873
|
+
absolutePathToMdx: this.resolveFilepath(relativePath),
|
|
1044874
|
+
context: this.taskContext
|
|
1044875
|
+
});
|
|
1044876
|
+
}
|
|
1044808
1044877
|
const filesToUploadSet = collectFilesFromDocsConfig(this.parsedDocsConfig);
|
|
1044809
1044878
|
for (const [relativePath, markdown] of Object.entries(this.parsedDocsConfig.pages)) {
|
|
1044810
1044879
|
const { filepaths, markdown: newMarkdown } = parseImagePaths(markdown, {
|
|
@@ -1044813,7 +1044882,7 @@ var DocsDefinitionResolver = class {
|
|
|
1044813
1044882
|
});
|
|
1044814
1044883
|
this.parsedDocsConfig.pages[RelativeFilePath.of(relativePath)] = newMarkdown;
|
|
1044815
1044884
|
for (const filepath of filepaths) {
|
|
1044816
|
-
filesToUploadSet.add(
|
|
1044885
|
+
filesToUploadSet.add(filepath);
|
|
1044817
1044886
|
}
|
|
1044818
1044887
|
}
|
|
1044819
1044888
|
const filesToUpload = Array.from(filesToUploadSet).map((absoluteFilePath) => ({
|
|
@@ -1044861,7 +1044930,7 @@ var DocsDefinitionResolver = class {
|
|
|
1044861
1044930
|
getMarkdownFilesToFullSlugs(pages) {
|
|
1044862
1044931
|
const mdxFilePathToSlug = /* @__PURE__ */ new Map();
|
|
1044863
1044932
|
for (const [relativePath, markdown] of Object.entries(pages)) {
|
|
1044864
|
-
const frontmatter = (0,
|
|
1044933
|
+
const frontmatter = (0, import_gray_matter3.default)(markdown);
|
|
1044865
1044934
|
const slug = frontmatter.data.slug;
|
|
1044866
1044935
|
if (typeof slug === "string" && slug.trim().length > 0) {
|
|
1044867
1044936
|
mdxFilePathToSlug.set(this.resolveFilepath(relativePath), slug.trim());
|
|
@@ -1044927,8 +1044996,7 @@ var DocsDefinitionResolver = class {
|
|
|
1044927
1044996
|
const versions = await Promise.all(this.parsedDocsConfig.navigation.versions.map(async (version3) => {
|
|
1044928
1044997
|
const convertedNavigation = await this.convertUnversionedNavigationConfig({
|
|
1044929
1044998
|
navigationConfig: version3.navigation,
|
|
1044930
|
-
tabs: version3.tabs
|
|
1044931
|
-
version: version3.version
|
|
1044999
|
+
tabs: version3.tabs
|
|
1044932
1045000
|
});
|
|
1044933
1045001
|
return {
|
|
1044934
1045002
|
version: version3.version,
|
|
@@ -1045028,7 +1045096,7 @@ var DocsDefinitionResolver = class {
|
|
|
1045028
1045096
|
assertNever(item);
|
|
1045029
1045097
|
}
|
|
1045030
1045098
|
}
|
|
1045031
|
-
async convertUnversionedNavigationConfig({ navigationConfig, tabs
|
|
1045099
|
+
async convertUnversionedNavigationConfig({ navigationConfig, tabs }) {
|
|
1045032
1045100
|
switch (navigationConfig.type) {
|
|
1045033
1045101
|
case "untabbed": {
|
|
1045034
1045102
|
const untabbedItems = await Promise.all(navigationConfig.items.map((item) => this.convertNavigationItem(item)));
|
|
@@ -1046882,10 +1046950,10 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
1046882
1046950
|
// pnp:/home/circleci/project/packages/cli/docs-preview/lib/downloadLocalDocsBundle.js
|
|
1046883
1046951
|
var import_decompress = __toESM(require_decompress());
|
|
1046884
1046952
|
var import_fs8 = require("fs");
|
|
1046885
|
-
var
|
|
1046953
|
+
var import_promises32 = require("fs/promises");
|
|
1046886
1046954
|
var import_os3 = require("os");
|
|
1046887
1046955
|
var import_path28 = __toESM(require("path"));
|
|
1046888
|
-
var
|
|
1046956
|
+
var import_promises33 = require("stream/promises");
|
|
1046889
1046957
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
1046890
1046958
|
var import_xml2js = __toESM(require_xml2js());
|
|
1046891
1046959
|
var ETAG_FILENAME = "etag";
|
|
@@ -1046916,7 +1046984,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1046916
1046984
|
let currentETag = void 0;
|
|
1046917
1046985
|
if (currentETagExists) {
|
|
1046918
1046986
|
logger.debug("Reading existing ETag");
|
|
1046919
|
-
currentETag = (await (0,
|
|
1046987
|
+
currentETag = (await (0, import_promises32.readFile)(eTagFilepath)).toString();
|
|
1046920
1046988
|
}
|
|
1046921
1046989
|
if (currentETag != null && currentETag === eTag) {
|
|
1046922
1046990
|
logger.debug("ETag matches. Using already downloaded bundle");
|
|
@@ -1046938,18 +1047006,18 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1046938
1047006
|
type: "failure"
|
|
1046939
1047007
|
};
|
|
1046940
1047008
|
}
|
|
1046941
|
-
await (0,
|
|
1047009
|
+
await (0, import_promises33.pipeline)(contents, (0, import_fs8.createWriteStream)(outputZipPath));
|
|
1046942
1047010
|
logger.debug(`Wrote output.zip to ${outputZipPath}`);
|
|
1046943
1047011
|
const absolutePathToPreviewFolder = getPathToPreviewFolder();
|
|
1046944
1047012
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1046945
|
-
await (0,
|
|
1047013
|
+
await (0, import_promises32.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1046946
1047014
|
}
|
|
1046947
|
-
await (0,
|
|
1047015
|
+
await (0, import_promises32.mkdir)(absolutePathToPreviewFolder, { recursive: true });
|
|
1046948
1047016
|
logger.debug(`rm -rf ${absolutePathToPreviewFolder}`);
|
|
1046949
1047017
|
const absolutePathToBundleFolder = getPathToBundleFolder();
|
|
1046950
|
-
await (0,
|
|
1047018
|
+
await (0, import_promises32.mkdir)(absolutePathToBundleFolder, { recursive: true });
|
|
1046951
1047019
|
await (0, import_decompress.default)(outputZipPath, absolutePathToBundleFolder);
|
|
1046952
|
-
await (0,
|
|
1047020
|
+
await (0, import_promises32.writeFile)(eTagFilepath, eTag);
|
|
1046953
1047021
|
logger.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
|
|
1046954
1047022
|
return {
|
|
1046955
1047023
|
type: "success"
|
|
@@ -1071761,7 +1071829,7 @@ async function formatWorkspaces({
|
|
|
1071761
1071829
|
}
|
|
1071762
1071830
|
|
|
1071763
1071831
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
1071764
|
-
var
|
|
1071832
|
+
var import_promises34 = require("fs/promises");
|
|
1071765
1071833
|
var import_path33 = __toESM(require("path"));
|
|
1071766
1071834
|
|
|
1071767
1071835
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/rules/valid-field-names/regex.js
|
|
@@ -1075716,7 +1075784,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
1075716
1075784
|
snippetsConfig: {}
|
|
1075717
1075785
|
});
|
|
1075718
1075786
|
const resolvedOutputFilePath = import_path33.default.resolve(outputFilepath);
|
|
1075719
|
-
await (0,
|
|
1075787
|
+
await (0, import_promises34.writeFile)(resolvedOutputFilePath, await stringifyLargeObject(apiDefinition, { pretty: true }));
|
|
1075720
1075788
|
context.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
1075721
1075789
|
});
|
|
1075722
1075790
|
})
|
|
@@ -1082998,7 +1083066,7 @@ function migrateIntermediateRepresentationThroughVersion({ intermediateRepresent
|
|
|
1082998
1083066
|
}
|
|
1082999
1083067
|
|
|
1083000
1083068
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts
|
|
1083001
|
-
var
|
|
1083069
|
+
var import_promises35 = require("fs/promises");
|
|
1083002
1083070
|
var import_path34 = __toESM(require("path"));
|
|
1083003
1083071
|
async function generateIrForWorkspaces({
|
|
1083004
1083072
|
project,
|
|
@@ -1083023,7 +1083091,7 @@ async function generateIrForWorkspaces({
|
|
|
1083023
1083091
|
version: version3
|
|
1083024
1083092
|
});
|
|
1083025
1083093
|
const irOutputFilePath = import_path34.default.resolve(irFilepath);
|
|
1083026
|
-
await (0,
|
|
1083094
|
+
await (0, import_promises35.writeFile)(
|
|
1083027
1083095
|
irOutputFilePath,
|
|
1083028
1083096
|
await stringifyLargeObject(intermediateRepresentation, { pretty: true })
|
|
1083029
1083097
|
);
|
|
@@ -1083062,7 +1083130,7 @@ async function getIntermediateRepresentation({
|
|
|
1083062
1083130
|
}
|
|
1083063
1083131
|
|
|
1083064
1083132
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/generate-openapi-ir/generateOpenAPIIrForWorkspaces.ts
|
|
1083065
|
-
var
|
|
1083133
|
+
var import_promises36 = require("fs/promises");
|
|
1083066
1083134
|
var import_path35 = __toESM(require("path"));
|
|
1083067
1083135
|
async function generateOpenAPIIrForWorkspaces({
|
|
1083068
1083136
|
project,
|
|
@@ -1083084,7 +1083152,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1083084
1083152
|
const openApiIrJson = await serialization_exports3.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
1083085
1083153
|
skipValidation: true
|
|
1083086
1083154
|
});
|
|
1083087
|
-
await (0,
|
|
1083155
|
+
await (0, import_promises36.writeFile)(irOutputFilePath, await stringifyLargeObject(openApiIrJson, { pretty: true }));
|
|
1083088
1083156
|
context.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
1083089
1083157
|
});
|
|
1083090
1083158
|
})
|
|
@@ -1083092,7 +1083160,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1083092
1083160
|
}
|
|
1083093
1083161
|
|
|
1083094
1083162
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
1083095
|
-
var
|
|
1083163
|
+
var import_promises37 = require("fs/promises");
|
|
1083096
1083164
|
async function writeOverridesForWorkspaces({
|
|
1083097
1083165
|
project,
|
|
1083098
1083166
|
includeModels,
|
|
@@ -1083117,7 +1083185,7 @@ async function writeOverridesForWorkspaces({
|
|
|
1083117
1083185
|
async function readExistingOverrides(overridesFilepath, context) {
|
|
1083118
1083186
|
let parsedOverrides = null;
|
|
1083119
1083187
|
try {
|
|
1083120
|
-
const contents = (await (0,
|
|
1083188
|
+
const contents = (await (0, import_promises37.readFile)(overridesFilepath, "utf8")).toString();
|
|
1083121
1083189
|
try {
|
|
1083122
1083190
|
parsedOverrides = JSON.parse(contents);
|
|
1083123
1083191
|
} catch (err) {
|
|
@@ -1083175,7 +1083243,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
1083175
1083243
|
}
|
|
1083176
1083244
|
}
|
|
1083177
1083245
|
const components = { schemas };
|
|
1083178
|
-
await (0,
|
|
1083246
|
+
await (0, import_promises37.writeFile)(
|
|
1083179
1083247
|
join(dirname(spec.absoluteFilepath), RelativeFilePath.of("openapi-overrides.yml")),
|
|
1083180
1083248
|
js_yaml_default.dump({ paths, components })
|
|
1083181
1083249
|
);
|
|
@@ -1083438,7 +1083506,7 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1083438
1083506
|
|
|
1083439
1083507
|
// pnp:/home/circleci/project/packages/cli/generation/local-generation/docker-utils/lib/runDocker.js
|
|
1083440
1083508
|
var import_dockerode2 = __toESM(require_docker());
|
|
1083441
|
-
var
|
|
1083509
|
+
var import_promises38 = require("fs/promises");
|
|
1083442
1083510
|
var import_stream4 = require("stream");
|
|
1083443
1083511
|
var import_tmp_promise5 = __toESM(require_tmp_promise());
|
|
1083444
1083512
|
async function runDocker({ imageName, args, binds, writeLogsToFile = true, removeAfterCompletion = false }) {
|
|
@@ -1083475,7 +1083543,7 @@ async function tryRunDocker({ docker, imageName, args, binds, removeAfterComplet
|
|
|
1083475
1083543
|
if (status.StatusCode !== 0) {
|
|
1083476
1083544
|
if (writeLogsToFile) {
|
|
1083477
1083545
|
const tmpFile = await import_tmp_promise5.default.file();
|
|
1083478
|
-
await (0,
|
|
1083546
|
+
await (0, import_promises38.writeFile)(tmpFile.path, logs);
|
|
1083479
1083547
|
throw new Error(`Docker exited with a non-zero exit code. Logs here: ${tmpFile.path}`);
|
|
1083480
1083548
|
} else {
|
|
1083481
1083549
|
throw new Error("Docker exited with a non-zero exit code.");
|
|
@@ -1083497,7 +1083565,7 @@ async function pullImage(docker, imageName) {
|
|
|
1083497
1083565
|
|
|
1083498
1083566
|
// pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/runGenerator.js
|
|
1083499
1083567
|
var FernGeneratorExecParsing = __toESM(require_serialization25());
|
|
1083500
|
-
var
|
|
1083568
|
+
var import_promises40 = require("fs/promises");
|
|
1083501
1083569
|
var import_tmp_promise7 = __toESM(require_tmp_promise());
|
|
1083502
1083570
|
|
|
1083503
1083571
|
// pnp:/home/circleci/project/packages/commons/logging-execa/lib/loggingExeca.js
|
|
@@ -1083523,7 +1083591,7 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
|
|
|
1083523
1083591
|
|
|
1083524
1083592
|
// pnp:/home/circleci/project/packages/cli/generation/local-generation/local-workspace-runner/lib/LocalTaskHandler.js
|
|
1083525
1083593
|
var import_decompress2 = __toESM(require_decompress());
|
|
1083526
|
-
var
|
|
1083594
|
+
var import_promises39 = require("fs/promises");
|
|
1083527
1083595
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
1083528
1083596
|
var LocalTaskHandler = class {
|
|
1083529
1083597
|
context;
|
|
@@ -1083569,7 +1083637,7 @@ var LocalTaskHandler = class {
|
|
|
1083569
1083637
|
const tmpOutputResolutionDir = AbsoluteFilePath.of((await import_tmp_promise6.default.dir({})).path);
|
|
1083570
1083638
|
const absolutePathToFernignore = AbsoluteFilePath.of(join(this.absolutePathToLocalOutput, RelativeFilePath.of(FERNIGNORE_FILENAME)));
|
|
1083571
1083639
|
const fernIngnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1083572
|
-
await (0,
|
|
1083640
|
+
await (0, import_promises39.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1083573
1083641
|
await this.runGitCommand(["init"], tmpOutputResolutionDir);
|
|
1083574
1083642
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1083575
1083643
|
const response = await this.runGitCommand(["config", "--list"], tmpOutputResolutionDir);
|
|
@@ -1083582,16 +1083650,16 @@ var LocalTaskHandler = class {
|
|
|
1083582
1083650
|
await this.copyGeneratedFilesToDirectory(tmpOutputResolutionDir);
|
|
1083583
1083651
|
await this.runGitCommand(["reset", "--", ...fernIngnorePaths], tmpOutputResolutionDir);
|
|
1083584
1083652
|
await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
1083585
|
-
await (0,
|
|
1083586
|
-
await (0,
|
|
1083653
|
+
await (0, import_promises39.rmdir)(this.absolutePathToLocalOutput, { recursive: true });
|
|
1083654
|
+
await (0, import_promises39.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
|
|
1083587
1083655
|
}
|
|
1083588
1083656
|
async copyGeneratedFilesNoFernIgnore() {
|
|
1083589
1083657
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
1083590
|
-
await (0,
|
|
1083658
|
+
await (0, import_promises39.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
1083591
1083659
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
1083592
1083660
|
}
|
|
1083593
1083661
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
1083594
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
1083662
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises39.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
1083595
1083663
|
if (firstLocalOutputItem == null) {
|
|
1083596
1083664
|
return;
|
|
1083597
1083665
|
}
|
|
@@ -1083599,15 +1083667,15 @@ var LocalTaskHandler = class {
|
|
|
1083599
1083667
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
1083600
1083668
|
await (0, import_decompress2.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), outputPath);
|
|
1083601
1083669
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
1083602
|
-
await (0,
|
|
1083670
|
+
await (0, import_promises39.cp)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(localOutputItem)), join(outputPath, RelativeFilePath.of(localOutputItem)), { recursive: true });
|
|
1083603
1083671
|
}
|
|
1083604
1083672
|
} else {
|
|
1083605
|
-
await (0,
|
|
1083673
|
+
await (0, import_promises39.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
|
|
1083606
1083674
|
}
|
|
1083607
1083675
|
}
|
|
1083608
1083676
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
1083609
1083677
|
this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
|
|
1083610
|
-
await (0,
|
|
1083678
|
+
await (0, import_promises39.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
|
|
1083611
1083679
|
}
|
|
1083612
1083680
|
async runGitCommand(options2, cwd2) {
|
|
1083613
1083681
|
const response = await loggingExeca(this.context.logger, "git", options2, {
|
|
@@ -1083619,7 +1083687,7 @@ var LocalTaskHandler = class {
|
|
|
1083619
1083687
|
};
|
|
1083620
1083688
|
var NEW_LINE_REGEX = /\r?\n/;
|
|
1083621
1083689
|
async function getFernIgnorePaths({ absolutePathToFernignore }) {
|
|
1083622
|
-
const fernIgnoreFileContents = (await (0,
|
|
1083690
|
+
const fernIgnoreFileContents = (await (0, import_promises39.readFile)(absolutePathToFernignore)).toString();
|
|
1083623
1083691
|
return [
|
|
1083624
1083692
|
FERNIGNORE_FILENAME,
|
|
1083625
1083693
|
...fernIgnoreFileContents.trim().split(NEW_LINE_REGEX).filter((line) => !line.startsWith("#") && line.length > 0)
|
|
@@ -1083708,7 +1083776,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
1083708
1083776
|
tmpdir: workspaceTempDir.path
|
|
1083709
1083777
|
});
|
|
1083710
1083778
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
1083711
|
-
await (0,
|
|
1083779
|
+
await (0, import_promises40.writeFile)(absolutePathToIr, JSON.stringify(intermediateRepresentation, void 0, 4));
|
|
1083712
1083780
|
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
1083713
1083781
|
return absolutePathToIr;
|
|
1083714
1083782
|
}
|
|
@@ -1083737,7 +1083805,7 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
|
|
|
1083737
1083805
|
if (!parsedConfig.ok) {
|
|
1083738
1083806
|
throw new Error(`Failed to parse config.json into ${absolutePathToWriteConfigJson}`);
|
|
1083739
1083807
|
}
|
|
1083740
|
-
await (0,
|
|
1083808
|
+
await (0, import_promises40.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(parsedConfig.value, void 0, 4));
|
|
1083741
1083809
|
const doesConfigJsonExist = await waitUntilPathExists(absolutePathToWriteConfigJson, 5e3);
|
|
1083742
1083810
|
if (!doesConfigJsonExist) {
|
|
1083743
1083811
|
throw new Error(`Failed to create ${absolutePathToWriteConfigJson}`);
|
|
@@ -1083797,8 +1083865,8 @@ async function getWorkspaceTempDir() {
|
|
|
1083797
1083865
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
1083798
1083866
|
var import_axios5 = __toESM(require_axios4());
|
|
1083799
1083867
|
var import_fs9 = require("fs");
|
|
1083800
|
-
var
|
|
1083801
|
-
var
|
|
1083868
|
+
var import_promises41 = require("fs/promises");
|
|
1083869
|
+
var import_promises42 = require("stream/promises");
|
|
1083802
1083870
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context }) {
|
|
1083803
1083871
|
try {
|
|
1083804
1083872
|
await downloadFileForTask({
|
|
@@ -1083815,17 +1083883,17 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
1083815
1083883
|
responseType: "stream"
|
|
1083816
1083884
|
});
|
|
1083817
1083885
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1083818
|
-
await (0,
|
|
1083886
|
+
await (0, import_promises41.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1083819
1083887
|
}
|
|
1083820
|
-
await (0,
|
|
1083821
|
-
await (0,
|
|
1083888
|
+
await (0, import_promises41.mkdir)(dirname(absolutePathToLocalOutput), { recursive: true });
|
|
1083889
|
+
await (0, import_promises42.pipeline)(request.data, (0, import_fs9.createWriteStream)(absolutePathToLocalOutput));
|
|
1083822
1083890
|
}
|
|
1083823
1083891
|
|
|
1083824
1083892
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
1083825
1083893
|
var import_fiddle_sdk4 = __toESM(require_fiddle_sdk());
|
|
1083826
1083894
|
var import_axios6 = __toESM(require_axios4());
|
|
1083827
1083895
|
var import_form_data3 = __toESM(require_form_data());
|
|
1083828
|
-
var
|
|
1083896
|
+
var import_promises43 = require("fs/promises");
|
|
1083829
1083897
|
var import_path38 = __toESM(require("path"));
|
|
1083830
1083898
|
var import_tar2 = __toESM(require_tar());
|
|
1083831
1083899
|
var import_tmp_promise9 = __toESM(require_tmp_promise());
|
|
@@ -1083900,7 +1083968,7 @@ async function createJob({ workspace, organization, generatorInvocation, version
|
|
|
1083900
1083968
|
}
|
|
1083901
1083969
|
} else {
|
|
1083902
1083970
|
context.logger.debug("Uploading definition...");
|
|
1083903
|
-
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0,
|
|
1083971
|
+
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0, import_promises43.readFile)(tarPath));
|
|
1083904
1083972
|
fernDefinitionMetadata = {
|
|
1083905
1083973
|
definitionS3DownloadUrl: definitionUploadUrlRequest.body.s3Url,
|
|
1083906
1083974
|
outputPath: ".mock"
|
|
@@ -1084064,9 +1084132,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
1084064
1084132
|
var import_axios7 = __toESM(require_axios4());
|
|
1084065
1084133
|
var import_decompress3 = __toESM(require_decompress());
|
|
1084066
1084134
|
var import_fs10 = require("fs");
|
|
1084067
|
-
var
|
|
1084135
|
+
var import_promises44 = require("fs/promises");
|
|
1084068
1084136
|
var import_path39 = __toESM(require("path"));
|
|
1084069
|
-
var
|
|
1084137
|
+
var import_promises45 = require("stream/promises");
|
|
1084070
1084138
|
var import_tmp_promise10 = __toESM(require_tmp_promise());
|
|
1084071
1084139
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
1084072
1084140
|
var RemoteTaskHandler = class {
|
|
@@ -1084182,11 +1084250,11 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1084182
1084250
|
});
|
|
1084183
1084251
|
const tmpDir = await import_tmp_promise10.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1084184
1084252
|
const outputZipPath = import_path39.default.join(tmpDir.path, "output.zip");
|
|
1084185
|
-
await (0,
|
|
1084253
|
+
await (0, import_promises45.pipeline)(request.data, (0, import_fs10.createWriteStream)(outputZipPath));
|
|
1084186
1084254
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1084187
|
-
await (0,
|
|
1084255
|
+
await (0, import_promises44.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1084188
1084256
|
}
|
|
1084189
|
-
await (0,
|
|
1084257
|
+
await (0, import_promises44.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
1084190
1084258
|
await (0, import_decompress3.default)(outputZipPath, absolutePathToLocalOutput);
|
|
1084191
1084259
|
}
|
|
1084192
1084260
|
function convertLogLevel(logLevel) {
|
|
@@ -1084292,7 +1084360,7 @@ async function runRemoteGenerationForAPIWorkspace({ organization, workspace, con
|
|
|
1084292
1084360
|
|
|
1084293
1084361
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
1084294
1084362
|
var import_axios8 = __toESM(require_axios4());
|
|
1084295
|
-
var
|
|
1084363
|
+
var import_promises46 = require("fs/promises");
|
|
1084296
1084364
|
var mime = __toESM(require_mime_types());
|
|
1084297
1084365
|
|
|
1084298
1084366
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
@@ -1084445,7 +1084513,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context, batchSize)
|
|
|
1084445
1084513
|
const absoluteFilePath = resolve(docsWorkspacePath, relativeFilePath);
|
|
1084446
1084514
|
try {
|
|
1084447
1084515
|
const mimeType = mime.lookup(absoluteFilePath);
|
|
1084448
|
-
await import_axios8.default.put(uploadUrl, await (0,
|
|
1084516
|
+
await import_axios8.default.put(uploadUrl, await (0, import_promises46.readFile)(absoluteFilePath), {
|
|
1084449
1084517
|
headers: {
|
|
1084450
1084518
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
1084451
1084519
|
}
|
|
@@ -1084828,7 +1084896,7 @@ function getRequestHandler(endpoint) {
|
|
|
1084828
1084896
|
return;
|
|
1084829
1084897
|
}
|
|
1084830
1084898
|
}
|
|
1084831
|
-
res.status(404).send(
|
|
1084899
|
+
res.status(404).send(`Unrecognized example request: ${JSON.stringify(req2.headers)} ${JSON.stringify(req2.params)} ${JSON.stringify(req2.body)}`);
|
|
1084832
1084900
|
};
|
|
1084833
1084901
|
}
|
|
1084834
1084902
|
function isRequestMatch(req2, example) {
|
|
@@ -1084949,7 +1085017,7 @@ async function mockServer({
|
|
|
1084949
1085017
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
1084950
1085018
|
var import_fiddle_sdk5 = __toESM(require_fiddle_sdk());
|
|
1084951
1085019
|
var import_axios9 = __toESM(require_axios4());
|
|
1084952
|
-
var
|
|
1085020
|
+
var import_promises47 = require("fs/promises");
|
|
1084953
1085021
|
var import_path40 = __toESM(require("path"));
|
|
1084954
1085022
|
var import_tar3 = __toESM(require_tar());
|
|
1084955
1085023
|
var import_tmp_promise11 = __toESM(require_tmp_promise());
|
|
@@ -1084998,7 +1085066,7 @@ async function registerWorkspacesV1({
|
|
|
1084998
1085066
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1084999
1085067
|
await import_tar3.default.create({ file: tarPath, cwd: workspace.absoluteFilepath }, ["."]);
|
|
1085000
1085068
|
context.logger.info("Uploading definition...");
|
|
1085001
|
-
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
1085069
|
+
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises47.readFile)(tarPath));
|
|
1085002
1085070
|
context.logger.info(
|
|
1085003
1085071
|
`Registered @${project.config.organization}/${workspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
1085004
1085072
|
);
|
|
@@ -1085123,21 +1085191,21 @@ async function generateToken({
|
|
|
1085123
1085191
|
|
|
1085124
1085192
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/updateApiSpec.ts
|
|
1085125
1085193
|
var fs8 = __toESM(require("fs"));
|
|
1085126
|
-
var
|
|
1085194
|
+
var import_promises48 = require("fs/promises");
|
|
1085127
1085195
|
var import_path41 = __toESM(require("path"));
|
|
1085128
1085196
|
var import_stream5 = require("stream");
|
|
1085129
|
-
var
|
|
1085197
|
+
var import_promises49 = require("stream/promises");
|
|
1085130
1085198
|
async function fetchAndWriteFile(url, path42, logger) {
|
|
1085131
1085199
|
const resp = await fetch(url);
|
|
1085132
1085200
|
if (resp.ok && resp.body) {
|
|
1085133
1085201
|
logger.debug("Origin successfully fetched, writing to file");
|
|
1085134
1085202
|
const fileStream = fs8.createWriteStream(path42);
|
|
1085135
|
-
await (0,
|
|
1085136
|
-
const fileContents = await (0,
|
|
1085203
|
+
await (0, import_promises49.finished)(import_stream5.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
1085204
|
+
const fileContents = await (0, import_promises48.readFile)(path42, "utf8");
|
|
1085137
1085205
|
try {
|
|
1085138
|
-
await (0,
|
|
1085206
|
+
await (0, import_promises48.writeFile)(path42, JSON.stringify(JSON.parse(fileContents), void 0, 2), "utf8");
|
|
1085139
1085207
|
} catch (e) {
|
|
1085140
|
-
await (0,
|
|
1085208
|
+
await (0, import_promises48.writeFile)(path42, js_yaml_default.dump(js_yaml_default.load(fileContents)), "utf8");
|
|
1085141
1085209
|
}
|
|
1085142
1085210
|
logger.debug("File written successfully");
|
|
1085143
1085211
|
}
|
|
@@ -1085199,17 +1085267,17 @@ async function updateApiSpec({
|
|
|
1085199
1085267
|
}
|
|
1085200
1085268
|
|
|
1085201
1085269
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
1085202
|
-
var
|
|
1085270
|
+
var import_promises52 = require("fs/promises");
|
|
1085203
1085271
|
|
|
1085204
1085272
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
1085205
|
-
var
|
|
1085273
|
+
var import_promises50 = require("fs/promises");
|
|
1085206
1085274
|
var FERN_DIRECTORY2 = "fern";
|
|
1085207
1085275
|
async function loadWorkspaces(context) {
|
|
1085208
1085276
|
const fernDirectory = await getFernDirectory2();
|
|
1085209
1085277
|
if (fernDirectory == null) {
|
|
1085210
1085278
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
1085211
1085279
|
}
|
|
1085212
|
-
const fernDirectoryContents = await (0,
|
|
1085280
|
+
const fernDirectoryContents = await (0, import_promises50.readdir)(fernDirectory, { withFileTypes: true });
|
|
1085213
1085281
|
return fernDirectoryContents.reduce((all5, item) => {
|
|
1085214
1085282
|
if (item.isDirectory()) {
|
|
1085215
1085283
|
all5.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -1085244,7 +1085312,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
1085244
1085312
|
}
|
|
1085245
1085313
|
|
|
1085246
1085314
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1085247
|
-
var
|
|
1085315
|
+
var import_promises51 = require("fs/promises");
|
|
1085248
1085316
|
|
|
1085249
1085317
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
1085250
1085318
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -1085267,7 +1085335,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
1085267
1085335
|
|
|
1085268
1085336
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1085269
1085337
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
1085270
|
-
const contentsStr = await (0,
|
|
1085338
|
+
const contentsStr = await (0, import_promises51.readFile)(absolutePathToGeneratorsConfiguration);
|
|
1085271
1085339
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1085272
1085340
|
return await validateSchema({
|
|
1085273
1085341
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -1085303,7 +1085371,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
1085303
1085371
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
1085304
1085372
|
});
|
|
1085305
1085373
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
1085306
|
-
await (0,
|
|
1085374
|
+
await (0, import_promises52.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
1085307
1085375
|
}
|
|
1085308
1085376
|
function migrateConfiguration(oldConfiguration) {
|
|
1085309
1085377
|
return {
|
|
@@ -1085329,7 +1085397,7 @@ var versionMigrations = {
|
|
|
1085329
1085397
|
var __default = versionMigrations;
|
|
1085330
1085398
|
|
|
1085331
1085399
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
1085332
|
-
var
|
|
1085400
|
+
var import_promises53 = require("fs/promises");
|
|
1085333
1085401
|
|
|
1085334
1085402
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
1085335
1085403
|
var import_glob_promise2 = __toESM(require_lib11());
|
|
@@ -1085363,7 +1085431,7 @@ var migration2 = {
|
|
|
1085363
1085431
|
try {
|
|
1085364
1085432
|
const fileContents = await getFileContents(yamlFilepath);
|
|
1085365
1085433
|
const newContents = addDiscriminantToFile(fileContents);
|
|
1085366
|
-
await (0,
|
|
1085434
|
+
await (0, import_promises53.writeFile)(yamlFilepath, newContents);
|
|
1085367
1085435
|
} catch (error) {
|
|
1085368
1085436
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
1085369
1085437
|
}
|
|
@@ -1085371,7 +1085439,7 @@ var migration2 = {
|
|
|
1085371
1085439
|
}
|
|
1085372
1085440
|
};
|
|
1085373
1085441
|
async function getFileContents(filepath) {
|
|
1085374
|
-
const buffer3 = await (0,
|
|
1085442
|
+
const buffer3 = await (0, import_promises53.readFile)(filepath);
|
|
1085375
1085443
|
return buffer3.toString();
|
|
1085376
1085444
|
}
|
|
1085377
1085445
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -1085400,7 +1085468,7 @@ var versionMigrations2 = {
|
|
|
1085400
1085468
|
var __default2 = versionMigrations2;
|
|
1085401
1085469
|
|
|
1085402
1085470
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
1085403
|
-
var
|
|
1085471
|
+
var import_promises54 = require("fs/promises");
|
|
1085404
1085472
|
var import_yaml = __toESM(require_dist3());
|
|
1085405
1085473
|
|
|
1085406
1085474
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -1085441,7 +1085509,7 @@ var migration3 = {
|
|
|
1085441
1085509
|
}
|
|
1085442
1085510
|
};
|
|
1085443
1085511
|
async function migrateFile(filepath, context) {
|
|
1085444
|
-
const contents = await (0,
|
|
1085512
|
+
const contents = await (0, import_promises54.readFile)(filepath);
|
|
1085445
1085513
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
1085446
1085514
|
const types3 = parsedDocument.get("types");
|
|
1085447
1085515
|
if (types3 == null) {
|
|
@@ -1085473,7 +1085541,7 @@ async function migrateFile(filepath, context) {
|
|
|
1085473
1085541
|
}
|
|
1085474
1085542
|
}
|
|
1085475
1085543
|
}
|
|
1085476
|
-
await (0,
|
|
1085544
|
+
await (0, import_promises54.writeFile)(filepath, parsedDocument.toString());
|
|
1085477
1085545
|
}
|
|
1085478
1085546
|
|
|
1085479
1085547
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -1085484,7 +1085552,7 @@ var versionMigrations3 = {
|
|
|
1085484
1085552
|
var __default3 = versionMigrations3;
|
|
1085485
1085553
|
|
|
1085486
1085554
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
1085487
|
-
var
|
|
1085555
|
+
var import_promises55 = require("fs/promises");
|
|
1085488
1085556
|
var import_yaml2 = __toESM(require_dist3());
|
|
1085489
1085557
|
|
|
1085490
1085558
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1085525,7 +1085593,7 @@ var migration4 = {
|
|
|
1085525
1085593
|
}
|
|
1085526
1085594
|
};
|
|
1085527
1085595
|
async function migrateGeneratorsYml(filepath, context) {
|
|
1085528
|
-
const contents = await (0,
|
|
1085596
|
+
const contents = await (0, import_promises55.readFile)(filepath);
|
|
1085529
1085597
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
1085530
1085598
|
const draftGenerators = parsedDocument.get("draft");
|
|
1085531
1085599
|
if (draftGenerators == null) {
|
|
@@ -1085552,7 +1085620,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
1085552
1085620
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
1085553
1085621
|
}
|
|
1085554
1085622
|
});
|
|
1085555
|
-
await (0,
|
|
1085623
|
+
await (0, import_promises55.writeFile)(filepath, parsedDocument.toString());
|
|
1085556
1085624
|
}
|
|
1085557
1085625
|
|
|
1085558
1085626
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -1085563,7 +1085631,7 @@ var versionMigrations4 = {
|
|
|
1085563
1085631
|
var __default4 = versionMigrations4;
|
|
1085564
1085632
|
|
|
1085565
1085633
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
1085566
|
-
var
|
|
1085634
|
+
var import_promises56 = require("fs/promises");
|
|
1085567
1085635
|
var import_yaml3 = __toESM(require_dist3());
|
|
1085568
1085636
|
|
|
1085569
1085637
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -1085604,7 +1085672,7 @@ var migration5 = {
|
|
|
1085604
1085672
|
}
|
|
1085605
1085673
|
};
|
|
1085606
1085674
|
async function migrateFile2(filepath, context) {
|
|
1085607
|
-
const contents = await (0,
|
|
1085675
|
+
const contents = await (0, import_promises56.readFile)(filepath);
|
|
1085608
1085676
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
1085609
1085677
|
const addType = (typeName, typeDeclaration) => {
|
|
1085610
1085678
|
const types3 = parsedDocument.get("types");
|
|
@@ -1085648,7 +1085716,7 @@ async function migrateFile2(filepath, context) {
|
|
|
1085648
1085716
|
}
|
|
1085649
1085717
|
}
|
|
1085650
1085718
|
}
|
|
1085651
|
-
await (0,
|
|
1085719
|
+
await (0, import_promises56.writeFile)(filepath, parsedDocument.toString());
|
|
1085652
1085720
|
}
|
|
1085653
1085721
|
|
|
1085654
1085722
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -1085659,7 +1085727,7 @@ var versionMigrations5 = {
|
|
|
1085659
1085727
|
var __default5 = versionMigrations5;
|
|
1085660
1085728
|
|
|
1085661
1085729
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
1085662
|
-
var
|
|
1085730
|
+
var import_promises57 = require("fs/promises");
|
|
1085663
1085731
|
var import_yaml4 = __toESM(require_dist3());
|
|
1085664
1085732
|
|
|
1085665
1085733
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1085700,7 +1085768,7 @@ var migration6 = {
|
|
|
1085700
1085768
|
}
|
|
1085701
1085769
|
};
|
|
1085702
1085770
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
1085703
|
-
const contents = await (0,
|
|
1085771
|
+
const contents = await (0, import_promises57.readFile)(filepath);
|
|
1085704
1085772
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
1085705
1085773
|
const releaseGenerators = parsedDocument.get("release");
|
|
1085706
1085774
|
if (releaseGenerators == null) {
|
|
@@ -1085738,7 +1085806,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
1085738
1085806
|
}
|
|
1085739
1085807
|
releaseGenerator.delete("outputs");
|
|
1085740
1085808
|
});
|
|
1085741
|
-
await (0,
|
|
1085809
|
+
await (0, import_promises57.writeFile)(filepath, parsedDocument.toString());
|
|
1085742
1085810
|
}
|
|
1085743
1085811
|
|
|
1085744
1085812
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -1085749,7 +1085817,7 @@ var versionMigrations6 = {
|
|
|
1085749
1085817
|
var __default6 = versionMigrations6;
|
|
1085750
1085818
|
|
|
1085751
1085819
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
1085752
|
-
var
|
|
1085820
|
+
var import_promises58 = require("fs/promises");
|
|
1085753
1085821
|
|
|
1085754
1085822
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
1085755
1085823
|
var import_glob_promise7 = __toESM(require_lib11());
|
|
@@ -1085780,9 +1085848,9 @@ var migration7 = {
|
|
|
1085780
1085848
|
run: async ({ context }) => {
|
|
1085781
1085849
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
1085782
1085850
|
for (const filepath of yamlFiles) {
|
|
1085783
|
-
const contents = await (0,
|
|
1085851
|
+
const contents = await (0, import_promises58.readFile)(filepath);
|
|
1085784
1085852
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
1085785
|
-
await (0,
|
|
1085853
|
+
await (0, import_promises58.writeFile)(filepath, newContents);
|
|
1085786
1085854
|
}
|
|
1085787
1085855
|
}
|
|
1085788
1085856
|
};
|
|
@@ -1085795,7 +1085863,7 @@ var versionMigrations7 = {
|
|
|
1085795
1085863
|
var __default7 = versionMigrations7;
|
|
1085796
1085864
|
|
|
1085797
1085865
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
1085798
|
-
var
|
|
1085866
|
+
var import_promises59 = require("fs/promises");
|
|
1085799
1085867
|
|
|
1085800
1085868
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
1085801
1085869
|
var import_glob_promise8 = __toESM(require_lib11());
|
|
@@ -1085826,9 +1085894,9 @@ var migration8 = {
|
|
|
1085826
1085894
|
run: async ({ context }) => {
|
|
1085827
1085895
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
1085828
1085896
|
for (const filepath of yamlFiles) {
|
|
1085829
|
-
const contents = await (0,
|
|
1085897
|
+
const contents = await (0, import_promises59.readFile)(filepath);
|
|
1085830
1085898
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
1085831
|
-
await (0,
|
|
1085899
|
+
await (0, import_promises59.writeFile)(filepath, newContents);
|
|
1085832
1085900
|
}
|
|
1085833
1085901
|
}
|
|
1085834
1085902
|
};
|
|
@@ -1085841,7 +1085909,7 @@ var versionMigrations8 = {
|
|
|
1085841
1085909
|
var __default8 = versionMigrations8;
|
|
1085842
1085910
|
|
|
1085843
1085911
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
1085844
|
-
var
|
|
1085912
|
+
var import_promises60 = require("fs/promises");
|
|
1085845
1085913
|
|
|
1085846
1085914
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
1085847
1085915
|
var import_glob_promise9 = __toESM(require_lib11());
|
|
@@ -1085948,7 +1086016,7 @@ var migration9 = {
|
|
|
1085948
1086016
|
}
|
|
1085949
1086017
|
};
|
|
1085950
1086018
|
async function migrateGeneratorsYml3(filepath) {
|
|
1085951
|
-
const contentsStr = await (0,
|
|
1086019
|
+
const contentsStr = await (0, import_promises60.readFile)(filepath);
|
|
1085952
1086020
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
1085953
1086021
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
1085954
1086022
|
let newGeneratorsConfiguration = {};
|
|
@@ -1085966,7 +1086034,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
1085966
1086034
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
1085967
1086035
|
};
|
|
1085968
1086036
|
}
|
|
1085969
|
-
await (0,
|
|
1086037
|
+
await (0, import_promises60.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
1085970
1086038
|
}
|
|
1085971
1086039
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
1085972
1086040
|
const newSchema = {
|
|
@@ -1086041,7 +1086109,7 @@ var versionMigrations9 = {
|
|
|
1086041
1086109
|
var __default9 = versionMigrations9;
|
|
1086042
1086110
|
|
|
1086043
1086111
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
1086044
|
-
var
|
|
1086112
|
+
var import_promises61 = require("fs/promises");
|
|
1086045
1086113
|
var import_yaml5 = __toESM(require_dist3());
|
|
1086046
1086114
|
|
|
1086047
1086115
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -1086082,7 +1086150,7 @@ var migration10 = {
|
|
|
1086082
1086150
|
}
|
|
1086083
1086151
|
};
|
|
1086084
1086152
|
async function migrateRootApiFile(filepath) {
|
|
1086085
|
-
const contents = await (0,
|
|
1086153
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
1086086
1086154
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
1086087
1086155
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
1086088
1086156
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -1086093,7 +1086161,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
1086093
1086161
|
"property-name": errorDiscriminant.value
|
|
1086094
1086162
|
});
|
|
1086095
1086163
|
parsedDocument.delete("error-discriminant");
|
|
1086096
|
-
await (0,
|
|
1086164
|
+
await (0, import_promises61.writeFile)(filepath, parsedDocument.toString());
|
|
1086097
1086165
|
}
|
|
1086098
1086166
|
|
|
1086099
1086167
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -1086104,7 +1086172,7 @@ var versionMigrations10 = {
|
|
|
1086104
1086172
|
var __default10 = versionMigrations10;
|
|
1086105
1086173
|
|
|
1086106
1086174
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
1086107
|
-
var
|
|
1086175
|
+
var import_promises62 = require("fs/promises");
|
|
1086108
1086176
|
var import_yaml6 = __toESM(require_dist3());
|
|
1086109
1086177
|
|
|
1086110
1086178
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -1086145,7 +1086213,7 @@ var migration11 = {
|
|
|
1086145
1086213
|
}
|
|
1086146
1086214
|
};
|
|
1086147
1086215
|
async function migrateYamlFile(filepath, context) {
|
|
1086148
|
-
const contents = await (0,
|
|
1086216
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
1086149
1086217
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
1086150
1086218
|
const services = parsedDocument.get("services");
|
|
1086151
1086219
|
if (services == null) {
|
|
@@ -1086185,7 +1086253,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
1086185
1086253
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
1086186
1086254
|
}
|
|
1086187
1086255
|
}
|
|
1086188
|
-
await (0,
|
|
1086256
|
+
await (0, import_promises62.writeFile)(filepath, parsedDocument.toString());
|
|
1086189
1086257
|
}
|
|
1086190
1086258
|
}
|
|
1086191
1086259
|
function convertEndpoint14({ document: document6, endpoint }) {
|
|
@@ -1086269,10 +1086337,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
1086269
1086337
|
var LegacyDocsSerializers = __toESM(require_serialization26());
|
|
1086270
1086338
|
|
|
1086271
1086339
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
1086272
|
-
var
|
|
1086340
|
+
var import_promises63 = require("fs/promises");
|
|
1086273
1086341
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
1086274
1086342
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1086275
|
-
const contentsStr = await (0,
|
|
1086343
|
+
const contentsStr = await (0, import_promises63.readFile)(filepath);
|
|
1086276
1086344
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1086277
1086345
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
1086278
1086346
|
if (result2.ok) {
|
|
@@ -1086290,7 +1086358,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
1086290
1086358
|
}
|
|
1086291
1086359
|
|
|
1086292
1086360
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
1086293
|
-
var
|
|
1086361
|
+
var import_promises65 = require("fs/promises");
|
|
1086294
1086362
|
|
|
1086295
1086363
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
1086296
1086364
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -1086471,10 +1086539,10 @@ __export(legacy_exports, {
|
|
|
1086471
1086539
|
});
|
|
1086472
1086540
|
|
|
1086473
1086541
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
1086474
|
-
var
|
|
1086542
|
+
var import_promises64 = require("fs/promises");
|
|
1086475
1086543
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
1086476
1086544
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
1086477
|
-
const contentsStr = await (0,
|
|
1086545
|
+
const contentsStr = await (0, import_promises64.readFile)(filepath);
|
|
1086478
1086546
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1086479
1086547
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
1086480
1086548
|
if (result2.success) {
|
|
@@ -1086594,7 +1086662,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
1086594
1086662
|
var APIS_DIRECTORY2 = "apis";
|
|
1086595
1086663
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
1086596
1086664
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
1086597
|
-
await (0,
|
|
1086665
|
+
await (0, import_promises65.mkdir)(absolutePathToApisDirectory);
|
|
1086598
1086666
|
for (const workspace of workspaces) {
|
|
1086599
1086667
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1086600
1086668
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -1086602,11 +1086670,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
1086602
1086670
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
1086603
1086671
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1086604
1086672
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1086605
|
-
await (0,
|
|
1086673
|
+
await (0, import_promises65.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1086606
1086674
|
}
|
|
1086607
1086675
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1086608
1086676
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1086609
|
-
await (0,
|
|
1086677
|
+
await (0, import_promises65.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1086610
1086678
|
}
|
|
1086611
1086679
|
}
|
|
1086612
1086680
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -1086619,7 +1086687,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
1086619
1086687
|
generatorsConfiguration,
|
|
1086620
1086688
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1086621
1086689
|
});
|
|
1086622
|
-
await (0,
|
|
1086690
|
+
await (0, import_promises65.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1086623
1086691
|
return convertedResponse.docsURLs;
|
|
1086624
1086692
|
}
|
|
1086625
1086693
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -1086633,19 +1086701,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
1086633
1086701
|
apiName
|
|
1086634
1086702
|
});
|
|
1086635
1086703
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1086636
|
-
await (0,
|
|
1086704
|
+
await (0, import_promises65.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1086637
1086705
|
}
|
|
1086638
1086706
|
|
|
1086639
1086707
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
1086640
|
-
var
|
|
1086708
|
+
var import_promises66 = require("fs/promises");
|
|
1086641
1086709
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1086642
1086710
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
1086643
1086711
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
1086644
1086712
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1086645
1086713
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1086646
1086714
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1086647
|
-
await (0,
|
|
1086648
|
-
await (0,
|
|
1086715
|
+
await (0, import_promises66.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1086716
|
+
await (0, import_promises66.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1086649
1086717
|
}
|
|
1086650
1086718
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
1086651
1086719
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1086658,7 +1086726,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
1086658
1086726
|
apiName: void 0
|
|
1086659
1086727
|
});
|
|
1086660
1086728
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1086661
|
-
await (0,
|
|
1086729
|
+
await (0, import_promises66.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1086662
1086730
|
}
|
|
1086663
1086731
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
1086664
1086732
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1086670,22 +1086738,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
1086670
1086738
|
generatorsConfiguration,
|
|
1086671
1086739
|
pathModificationStrategy: "MoveUp"
|
|
1086672
1086740
|
});
|
|
1086673
|
-
await (0,
|
|
1086741
|
+
await (0, import_promises66.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1086674
1086742
|
return convertedResponse.docsURLs;
|
|
1086675
1086743
|
}
|
|
1086676
1086744
|
|
|
1086677
1086745
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
1086678
|
-
var
|
|
1086746
|
+
var import_promises67 = require("fs/promises");
|
|
1086679
1086747
|
var APIS_DIRECTORY3 = "apis";
|
|
1086680
1086748
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
1086681
1086749
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
1086682
|
-
await (0,
|
|
1086750
|
+
await (0, import_promises67.mkdir)(absolutePathToApisDirectory);
|
|
1086683
1086751
|
for (const workspace of workspaces) {
|
|
1086684
1086752
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1086685
1086753
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
1086686
1086754
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1086687
1086755
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1086688
|
-
await (0,
|
|
1086756
|
+
await (0, import_promises67.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1086689
1086757
|
}
|
|
1086690
1086758
|
}
|
|
1086691
1086759
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -1086698,15 +1086766,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
1086698
1086766
|
generatorsConfiguration,
|
|
1086699
1086767
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1086700
1086768
|
});
|
|
1086701
|
-
await (0,
|
|
1086769
|
+
await (0, import_promises67.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1086702
1086770
|
}
|
|
1086703
1086771
|
|
|
1086704
1086772
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
1086705
|
-
var
|
|
1086773
|
+
var import_promises68 = require("fs/promises");
|
|
1086706
1086774
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1086707
1086775
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
1086708
1086776
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1086709
|
-
await (0,
|
|
1086777
|
+
await (0, import_promises68.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
1086710
1086778
|
}
|
|
1086711
1086779
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
1086712
1086780
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1086718,7 +1086786,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
1086718
1086786
|
generatorsConfiguration,
|
|
1086719
1086787
|
pathModificationStrategy: "MoveUp"
|
|
1086720
1086788
|
});
|
|
1086721
|
-
await (0,
|
|
1086789
|
+
await (0, import_promises68.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1086722
1086790
|
}
|
|
1086723
1086791
|
|
|
1086724
1086792
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -1086795,7 +1086863,7 @@ var versionMigrations12 = {
|
|
|
1086795
1086863
|
var __default12 = versionMigrations12;
|
|
1086796
1086864
|
|
|
1086797
1086865
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
1086798
|
-
var
|
|
1086866
|
+
var import_promises69 = require("fs/promises");
|
|
1086799
1086867
|
var import_yaml7 = __toESM(require_dist3());
|
|
1086800
1086868
|
|
|
1086801
1086869
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -1086836,7 +1086904,7 @@ var migration13 = {
|
|
|
1086836
1086904
|
}
|
|
1086837
1086905
|
};
|
|
1086838
1086906
|
async function migrateYamlFile2(filepath, context) {
|
|
1086839
|
-
const contents = await (0,
|
|
1086907
|
+
const contents = await (0, import_promises69.readFile)(filepath);
|
|
1086840
1086908
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
1086841
1086909
|
const types3 = parsedDocument.get("types");
|
|
1086842
1086910
|
if (types3 == null) {
|
|
@@ -1086862,7 +1086930,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
1086862
1086930
|
examples.set(i2, { value });
|
|
1086863
1086931
|
}
|
|
1086864
1086932
|
}
|
|
1086865
|
-
await (0,
|
|
1086933
|
+
await (0, import_promises69.writeFile)(filepath, parsedDocument.toString());
|
|
1086866
1086934
|
}
|
|
1086867
1086935
|
|
|
1086868
1086936
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -1086873,7 +1086941,7 @@ var versionMigrations13 = {
|
|
|
1086873
1086941
|
var __default13 = versionMigrations13;
|
|
1086874
1086942
|
|
|
1086875
1086943
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
1086876
|
-
var
|
|
1086944
|
+
var import_promises70 = require("fs/promises");
|
|
1086877
1086945
|
var import_yaml8 = __toESM(require_dist3());
|
|
1086878
1086946
|
|
|
1086879
1086947
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -1086914,7 +1086982,7 @@ var migration14 = {
|
|
|
1086914
1086982
|
}
|
|
1086915
1086983
|
};
|
|
1086916
1086984
|
async function migrateYamlFile3(filepath, context) {
|
|
1086917
|
-
const contents = await (0,
|
|
1086985
|
+
const contents = await (0, import_promises70.readFile)(filepath);
|
|
1086918
1086986
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
1086919
1086987
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
1086920
1086988
|
return context.failAndThrow("File is not a map");
|
|
@@ -1086944,7 +1087012,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
1086944
1087012
|
pair.value = firstService.value;
|
|
1086945
1087013
|
}
|
|
1086946
1087014
|
}
|
|
1086947
|
-
await (0,
|
|
1087015
|
+
await (0, import_promises70.writeFile)(filepath, parsedDocument.toString());
|
|
1086948
1087016
|
}
|
|
1086949
1087017
|
|
|
1086950
1087018
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -1086955,7 +1087023,7 @@ var versionMigrations14 = {
|
|
|
1086955
1087023
|
var __default14 = versionMigrations14;
|
|
1086956
1087024
|
|
|
1086957
1087025
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
1086958
|
-
var
|
|
1087026
|
+
var import_promises71 = require("fs/promises");
|
|
1086959
1087027
|
var import_yaml9 = __toESM(require_dist3());
|
|
1086960
1087028
|
|
|
1086961
1087029
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -1086996,7 +1087064,7 @@ var migration15 = {
|
|
|
1086996
1087064
|
}
|
|
1086997
1087065
|
};
|
|
1086998
1087066
|
async function migrateYamlFile4(filepath, context) {
|
|
1086999
|
-
const contents = await (0,
|
|
1087067
|
+
const contents = await (0, import_promises71.readFile)(filepath);
|
|
1087000
1087068
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
1087001
1087069
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
1087002
1087070
|
return context.failAndThrow("File is not a map");
|
|
@@ -1087015,7 +1087083,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
1087015
1087083
|
}
|
|
1087016
1087084
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
1087017
1087085
|
parsedDocument.contents.items.unshift(docsPair);
|
|
1087018
|
-
await (0,
|
|
1087086
|
+
await (0, import_promises71.writeFile)(filepath, parsedDocument.toString());
|
|
1087019
1087087
|
}
|
|
1087020
1087088
|
|
|
1087021
1087089
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -1087026,7 +1087094,7 @@ var versionMigrations15 = {
|
|
|
1087026
1087094
|
var __default15 = versionMigrations15;
|
|
1087027
1087095
|
|
|
1087028
1087096
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
1087029
|
-
var
|
|
1087097
|
+
var import_promises72 = require("fs/promises");
|
|
1087030
1087098
|
|
|
1087031
1087099
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
1087032
1087100
|
var import_glob_promise15 = __toESM(require_lib11());
|
|
@@ -1087066,14 +1087134,14 @@ var migration16 = {
|
|
|
1087066
1087134
|
}
|
|
1087067
1087135
|
};
|
|
1087068
1087136
|
async function migrateYamlFile5(filepath) {
|
|
1087069
|
-
const contents = await (0,
|
|
1087137
|
+
const contents = await (0, import_promises72.readFile)(filepath);
|
|
1087070
1087138
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
1087071
1087139
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
1087072
1087140
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
1087073
1087141
|
return `docs:
|
|
1087074
1087142
|
domain: "${domain2}.${domainSuffix}"`;
|
|
1087075
1087143
|
});
|
|
1087076
|
-
await (0,
|
|
1087144
|
+
await (0, import_promises72.writeFile)(filepath, updatedSnapshot.toString());
|
|
1087077
1087145
|
}
|
|
1087078
1087146
|
|
|
1087079
1087147
|
// pnp:/home/circleci/project/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -1087175,7 +1087243,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
1087175
1087243
|
}
|
|
1087176
1087244
|
|
|
1087177
1087245
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
1087178
|
-
var
|
|
1087246
|
+
var import_promises73 = require("fs/promises");
|
|
1087179
1087247
|
|
|
1087180
1087248
|
// pnp:/home/circleci/project/.yarn/cache/immer-npm-9.0.15-6c734225db-92e3d63e81.zip/node_modules/immer/dist/immer.esm.mjs
|
|
1087181
1087249
|
function n(n2) {
|
|
@@ -1087664,7 +1087732,7 @@ async function upgrade({
|
|
|
1087664
1087732
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
1087665
1087733
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
1087666
1087734
|
});
|
|
1087667
|
-
await (0,
|
|
1087735
|
+
await (0, import_promises73.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
1087668
1087736
|
cliContext.logger.info(
|
|
1087669
1087737
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
1087670
1087738
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -1087686,7 +1087754,7 @@ async function upgrade({
|
|
|
1087686
1087754
|
}
|
|
1087687
1087755
|
|
|
1087688
1087756
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/upgrade/upgradeGenerator.ts
|
|
1087689
|
-
var
|
|
1087757
|
+
var import_promises74 = require("fs/promises");
|
|
1087690
1087758
|
async function upgradeSpecificGroupGenerator({
|
|
1087691
1087759
|
context,
|
|
1087692
1087760
|
generator,
|
|
@@ -1087742,7 +1087810,7 @@ async function upgradeGenerator2({
|
|
|
1087742
1087810
|
}
|
|
1087743
1087811
|
}
|
|
1087744
1087812
|
}
|
|
1087745
|
-
await (0,
|
|
1087813
|
+
await (0, import_promises74.writeFile)(
|
|
1087746
1087814
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1087747
1087815
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1087748
1087816
|
}),
|
|
@@ -1087780,7 +1087848,7 @@ async function validateWorkspaces({
|
|
|
1087780
1087848
|
}
|
|
1087781
1087849
|
|
|
1087782
1087850
|
// pnp:/home/circleci/project/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1087783
|
-
var
|
|
1087851
|
+
var import_promises75 = require("fs/promises");
|
|
1087784
1087852
|
var import_path42 = __toESM(require("path"));
|
|
1087785
1087853
|
async function writeDefinitionForWorkspaces({
|
|
1087786
1087854
|
project,
|
|
@@ -1087840,22 +1087908,22 @@ async function writeFernDefinition({
|
|
|
1087840
1087908
|
absolutePathToOutputDirectory
|
|
1087841
1087909
|
}) {
|
|
1087842
1087910
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
1087843
|
-
await (0,
|
|
1087911
|
+
await (0, import_promises75.rmdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1087844
1087912
|
}
|
|
1087845
|
-
await (0,
|
|
1087846
|
-
await (0,
|
|
1087913
|
+
await (0, import_promises75.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1087914
|
+
await (0, import_promises75.writeFile)(
|
|
1087847
1087915
|
join(absolutePathToOutputDirectory, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
1087848
1087916
|
js_yaml_default.dump(definition3.rootApiFile.contents)
|
|
1087849
1087917
|
);
|
|
1087850
1087918
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1087851
1087919
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1087852
|
-
await (0,
|
|
1087853
|
-
await (0,
|
|
1087920
|
+
await (0, import_promises75.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1087921
|
+
await (0, import_promises75.writeFile)(absoluteFilepath, js_yaml_default.dump(packageMarker.contents));
|
|
1087854
1087922
|
}
|
|
1087855
1087923
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1087856
1087924
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1087857
|
-
await (0,
|
|
1087858
|
-
await (0,
|
|
1087925
|
+
await (0, import_promises75.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1087926
|
+
await (0, import_promises75.writeFile)(absoluteFilepath, js_yaml_default.dump(definitionFile.contents));
|
|
1087859
1087927
|
}
|
|
1087860
1087928
|
}
|
|
1087861
1087929
|
|