fern-api 0.37.7 → 0.37.9
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 +800 -774
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -33190,7 +33190,7 @@ var require_agent = __commonJS({
|
|
|
33190
33190
|
var { Socket } = require("net");
|
|
33191
33191
|
var { Duplex } = require("stream");
|
|
33192
33192
|
var { resolve: resolve6 } = require("path");
|
|
33193
|
-
var { readFile:
|
|
33193
|
+
var { readFile: readFile47 } = require("fs");
|
|
33194
33194
|
var { execFile, spawn } = require("child_process");
|
|
33195
33195
|
var { isParsedKey, parseKey } = require_keyParser();
|
|
33196
33196
|
var {
|
|
@@ -33408,7 +33408,7 @@ var require_agent = __commonJS({
|
|
|
33408
33408
|
cb = once3(cb);
|
|
33409
33409
|
let socketPath = this.socketPath;
|
|
33410
33410
|
let triedCygpath = false;
|
|
33411
|
-
|
|
33411
|
+
readFile47(socketPath, function readCygsocket(err, data2) {
|
|
33412
33412
|
if (err) {
|
|
33413
33413
|
if (triedCygpath)
|
|
33414
33414
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
@@ -33417,7 +33417,7 @@ var require_agent = __commonJS({
|
|
|
33417
33417
|
return cb(new Error("Invalid cygwin unix socket path"));
|
|
33418
33418
|
triedCygpath = true;
|
|
33419
33419
|
socketPath = stdout.toString().replace(/[\r\n]/g, "");
|
|
33420
|
-
|
|
33420
|
+
readFile47(socketPath, readCygsocket);
|
|
33421
33421
|
});
|
|
33422
33422
|
return;
|
|
33423
33423
|
}
|
|
@@ -35573,30 +35573,30 @@ var require_kex = __commonJS({
|
|
|
35573
35573
|
DISCONNECT_REASON.KEY_EXCHANGE_FAILED
|
|
35574
35574
|
);
|
|
35575
35575
|
}
|
|
35576
|
-
const
|
|
35577
|
-
hashString(
|
|
35578
|
-
hashString(
|
|
35579
|
-
hashString(
|
|
35580
|
-
hashString(
|
|
35576
|
+
const hash3 = createHash(this.hashName);
|
|
35577
|
+
hashString(hash3, isServer ? this._remoteIdentRaw : this._identRaw);
|
|
35578
|
+
hashString(hash3, isServer ? this._identRaw : this._remoteIdentRaw);
|
|
35579
|
+
hashString(hash3, isServer ? this._remoteKexinit : this._kexinit);
|
|
35580
|
+
hashString(hash3, isServer ? this._kexinit : this._remoteKexinit);
|
|
35581
35581
|
const serverPublicHostKey = isServer ? this._hostKey.getPublicSSH() : this._hostKey;
|
|
35582
|
-
hashString(
|
|
35582
|
+
hashString(hash3, serverPublicHostKey);
|
|
35583
35583
|
if (this.type === "groupex") {
|
|
35584
35584
|
const params = this.getDHParams();
|
|
35585
35585
|
const num = Buffer.allocUnsafe(4);
|
|
35586
35586
|
writeUInt32BE(num, this._minBits, 0);
|
|
35587
|
-
|
|
35587
|
+
hash3.update(num);
|
|
35588
35588
|
writeUInt32BE(num, this._prefBits, 0);
|
|
35589
|
-
|
|
35589
|
+
hash3.update(num);
|
|
35590
35590
|
writeUInt32BE(num, this._maxBits, 0);
|
|
35591
|
-
|
|
35592
|
-
hashString(
|
|
35593
|
-
hashString(
|
|
35591
|
+
hash3.update(num);
|
|
35592
|
+
hashString(hash3, params.prime);
|
|
35593
|
+
hashString(hash3, params.generator);
|
|
35594
35594
|
}
|
|
35595
|
-
hashString(
|
|
35595
|
+
hashString(hash3, isServer ? pubKey : this.getPublicKey());
|
|
35596
35596
|
const serverPublicKey = isServer ? this.getPublicKey() : pubKey;
|
|
35597
|
-
hashString(
|
|
35598
|
-
hashString(
|
|
35599
|
-
const exchangeHash =
|
|
35597
|
+
hashString(hash3, serverPublicKey);
|
|
35598
|
+
hashString(hash3, secret);
|
|
35599
|
+
const exchangeHash = hash3.digest();
|
|
35600
35600
|
if (!isServer) {
|
|
35601
35601
|
bufferParser.init(this._sig, 0);
|
|
35602
35602
|
const sigType = bufferParser.readString(true);
|
|
@@ -36569,10 +36569,10 @@ var require_kex = __commonJS({
|
|
|
36569
36569
|
})();
|
|
36570
36570
|
var hashString = (() => {
|
|
36571
36571
|
const LEN = Buffer.allocUnsafe(4);
|
|
36572
|
-
return (
|
|
36572
|
+
return (hash3, buf) => {
|
|
36573
36573
|
writeUInt32BE(LEN, buf.length, 0);
|
|
36574
|
-
|
|
36575
|
-
|
|
36574
|
+
hash3.update(LEN);
|
|
36575
|
+
hash3.update(buf);
|
|
36576
36576
|
};
|
|
36577
36577
|
})();
|
|
36578
36578
|
function generateKEXVal(len, hashName, secret, exchangeHash, sessionID, char) {
|
|
@@ -48486,12 +48486,12 @@ var require_common3 = __commonJS({
|
|
|
48486
48486
|
createDebug.skips = [];
|
|
48487
48487
|
createDebug.formatters = {};
|
|
48488
48488
|
function selectColor(namespace) {
|
|
48489
|
-
let
|
|
48489
|
+
let hash3 = 0;
|
|
48490
48490
|
for (let i2 = 0; i2 < namespace.length; i2++) {
|
|
48491
|
-
|
|
48492
|
-
|
|
48491
|
+
hash3 = (hash3 << 5) - hash3 + namespace.charCodeAt(i2);
|
|
48492
|
+
hash3 |= 0;
|
|
48493
48493
|
}
|
|
48494
|
-
return createDebug.colors[Math.abs(
|
|
48494
|
+
return createDebug.colors[Math.abs(hash3) % createDebug.colors.length];
|
|
48495
48495
|
}
|
|
48496
48496
|
createDebug.selectColor = selectColor;
|
|
48497
48497
|
function createDebug(namespace) {
|
|
@@ -70799,8 +70799,8 @@ var require_graceful_fs = __commonJS({
|
|
|
70799
70799
|
fs11.createReadStream = createReadStream2;
|
|
70800
70800
|
fs11.createWriteStream = createWriteStream7;
|
|
70801
70801
|
var fs$readFile = fs11.readFile;
|
|
70802
|
-
fs11.readFile =
|
|
70803
|
-
function
|
|
70802
|
+
fs11.readFile = readFile47;
|
|
70803
|
+
function readFile47(path44, options2, cb) {
|
|
70804
70804
|
if (typeof options2 === "function")
|
|
70805
70805
|
cb = options2, options2 = null;
|
|
70806
70806
|
return go$readFile(path44, options2, cb);
|
|
@@ -70816,8 +70816,8 @@ var require_graceful_fs = __commonJS({
|
|
|
70816
70816
|
}
|
|
70817
70817
|
}
|
|
70818
70818
|
var fs$writeFile = fs11.writeFile;
|
|
70819
|
-
fs11.writeFile =
|
|
70820
|
-
function
|
|
70819
|
+
fs11.writeFile = writeFile42;
|
|
70820
|
+
function writeFile42(path44, data2, options2, cb) {
|
|
70821
70821
|
if (typeof options2 === "function")
|
|
70822
70822
|
cb = options2, options2 = null;
|
|
70823
70823
|
return go$writeFile(path44, data2, options2, cb);
|
|
@@ -71859,14 +71859,14 @@ var require_empty = __commonJS({
|
|
|
71859
71859
|
var u2 = require_universalify().fromPromise;
|
|
71860
71860
|
var fs10 = require_fs2();
|
|
71861
71861
|
var path44 = require("path");
|
|
71862
|
-
var
|
|
71862
|
+
var mkdir15 = require_mkdirs();
|
|
71863
71863
|
var remove3 = require_remove();
|
|
71864
71864
|
var emptyDir = u2(async function emptyDir2(dir) {
|
|
71865
71865
|
let items;
|
|
71866
71866
|
try {
|
|
71867
71867
|
items = await fs10.readdir(dir);
|
|
71868
71868
|
} catch {
|
|
71869
|
-
return
|
|
71869
|
+
return mkdir15.mkdirs(dir);
|
|
71870
71870
|
}
|
|
71871
71871
|
return Promise.all(items.map((item) => remove3.remove(path44.join(dir, item))));
|
|
71872
71872
|
});
|
|
@@ -71875,7 +71875,7 @@ var require_empty = __commonJS({
|
|
|
71875
71875
|
try {
|
|
71876
71876
|
items = fs10.readdirSync(dir);
|
|
71877
71877
|
} catch {
|
|
71878
|
-
return
|
|
71878
|
+
return mkdir15.mkdirsSync(dir);
|
|
71879
71879
|
}
|
|
71880
71880
|
items.forEach((item) => {
|
|
71881
71881
|
item = path44.join(dir, item);
|
|
@@ -71898,7 +71898,7 @@ var require_file = __commonJS({
|
|
|
71898
71898
|
var u2 = require_universalify().fromCallback;
|
|
71899
71899
|
var path44 = require("path");
|
|
71900
71900
|
var fs10 = require_graceful_fs();
|
|
71901
|
-
var
|
|
71901
|
+
var mkdir15 = require_mkdirs();
|
|
71902
71902
|
function createFile(file, callback) {
|
|
71903
71903
|
function makeFile() {
|
|
71904
71904
|
fs10.writeFile(file, "", (err) => {
|
|
@@ -71914,7 +71914,7 @@ var require_file = __commonJS({
|
|
|
71914
71914
|
fs10.stat(dir, (err2, stats2) => {
|
|
71915
71915
|
if (err2) {
|
|
71916
71916
|
if (err2.code === "ENOENT") {
|
|
71917
|
-
return
|
|
71917
|
+
return mkdir15.mkdirs(dir, (err3) => {
|
|
71918
71918
|
if (err3)
|
|
71919
71919
|
return callback(err3);
|
|
71920
71920
|
makeFile();
|
|
@@ -71948,7 +71948,7 @@ var require_file = __commonJS({
|
|
|
71948
71948
|
}
|
|
71949
71949
|
} catch (err) {
|
|
71950
71950
|
if (err && err.code === "ENOENT")
|
|
71951
|
-
|
|
71951
|
+
mkdir15.mkdirsSync(dir);
|
|
71952
71952
|
else
|
|
71953
71953
|
throw err;
|
|
71954
71954
|
}
|
|
@@ -71968,7 +71968,7 @@ var require_link = __commonJS({
|
|
|
71968
71968
|
var u2 = require_universalify().fromCallback;
|
|
71969
71969
|
var path44 = require("path");
|
|
71970
71970
|
var fs10 = require_graceful_fs();
|
|
71971
|
-
var
|
|
71971
|
+
var mkdir15 = require_mkdirs();
|
|
71972
71972
|
var pathExists3 = require_path_exists().pathExists;
|
|
71973
71973
|
var { areIdentical } = require_stat();
|
|
71974
71974
|
function createLink(srcpath, dstpath, callback) {
|
|
@@ -71993,7 +71993,7 @@ var require_link = __commonJS({
|
|
|
71993
71993
|
return callback(err2);
|
|
71994
71994
|
if (dirExists)
|
|
71995
71995
|
return makeLink(srcpath, dstpath);
|
|
71996
|
-
|
|
71996
|
+
mkdir15.mkdirs(dir, (err3) => {
|
|
71997
71997
|
if (err3)
|
|
71998
71998
|
return callback(err3);
|
|
71999
71999
|
makeLink(srcpath, dstpath);
|
|
@@ -72020,7 +72020,7 @@ var require_link = __commonJS({
|
|
|
72020
72020
|
const dirExists = fs10.existsSync(dir);
|
|
72021
72021
|
if (dirExists)
|
|
72022
72022
|
return fs10.linkSync(srcpath, dstpath);
|
|
72023
|
-
|
|
72023
|
+
mkdir15.mkdirsSync(dir);
|
|
72024
72024
|
return fs10.linkSync(srcpath, dstpath);
|
|
72025
72025
|
}
|
|
72026
72026
|
module2.exports = {
|
|
@@ -72307,7 +72307,7 @@ var require_jsonfile = __commonJS({
|
|
|
72307
72307
|
}
|
|
72308
72308
|
return obj;
|
|
72309
72309
|
}
|
|
72310
|
-
var
|
|
72310
|
+
var readFile47 = universalify.fromPromise(_readFile);
|
|
72311
72311
|
function readFileSync4(file, options2 = {}) {
|
|
72312
72312
|
if (typeof options2 === "string") {
|
|
72313
72313
|
options2 = { encoding: options2 };
|
|
@@ -72332,16 +72332,16 @@ var require_jsonfile = __commonJS({
|
|
|
72332
72332
|
const str3 = stringify5(obj, options2);
|
|
72333
72333
|
await universalify.fromCallback(fs10.writeFile)(file, str3, options2);
|
|
72334
72334
|
}
|
|
72335
|
-
var
|
|
72335
|
+
var writeFile42 = universalify.fromPromise(_writeFile);
|
|
72336
72336
|
function writeFileSync(file, obj, options2 = {}) {
|
|
72337
72337
|
const fs10 = options2.fs || _fs;
|
|
72338
72338
|
const str3 = stringify5(obj, options2);
|
|
72339
72339
|
return fs10.writeFileSync(file, str3, options2);
|
|
72340
72340
|
}
|
|
72341
72341
|
var jsonfile = {
|
|
72342
|
-
readFile:
|
|
72342
|
+
readFile: readFile47,
|
|
72343
72343
|
readFileSync: readFileSync4,
|
|
72344
|
-
writeFile:
|
|
72344
|
+
writeFile: writeFile42,
|
|
72345
72345
|
writeFileSync
|
|
72346
72346
|
};
|
|
72347
72347
|
module2.exports = jsonfile;
|
|
@@ -72369,7 +72369,7 @@ var require_output_file = __commonJS({
|
|
|
72369
72369
|
var u2 = require_universalify().fromCallback;
|
|
72370
72370
|
var fs10 = require_graceful_fs();
|
|
72371
72371
|
var path44 = require("path");
|
|
72372
|
-
var
|
|
72372
|
+
var mkdir15 = require_mkdirs();
|
|
72373
72373
|
var pathExists3 = require_path_exists().pathExists;
|
|
72374
72374
|
function outputFile(file, data2, encoding, callback) {
|
|
72375
72375
|
if (typeof encoding === "function") {
|
|
@@ -72382,7 +72382,7 @@ var require_output_file = __commonJS({
|
|
|
72382
72382
|
return callback(err);
|
|
72383
72383
|
if (itDoes)
|
|
72384
72384
|
return fs10.writeFile(file, data2, encoding, callback);
|
|
72385
|
-
|
|
72385
|
+
mkdir15.mkdirs(dir, (err2) => {
|
|
72386
72386
|
if (err2)
|
|
72387
72387
|
return callback(err2);
|
|
72388
72388
|
fs10.writeFile(file, data2, encoding, callback);
|
|
@@ -72394,7 +72394,7 @@ var require_output_file = __commonJS({
|
|
|
72394
72394
|
if (fs10.existsSync(dir)) {
|
|
72395
72395
|
return fs10.writeFileSync(file, ...args);
|
|
72396
72396
|
}
|
|
72397
|
-
|
|
72397
|
+
mkdir15.mkdirsSync(dir);
|
|
72398
72398
|
fs10.writeFileSync(file, ...args);
|
|
72399
72399
|
}
|
|
72400
72400
|
module2.exports = {
|
|
@@ -84898,8 +84898,8 @@ var require_crypto_key = __commonJS({
|
|
|
84898
84898
|
function isAlgorithm(algorithm, name3) {
|
|
84899
84899
|
return algorithm.name === name3;
|
|
84900
84900
|
}
|
|
84901
|
-
function getHashLength(
|
|
84902
|
-
return parseInt(
|
|
84901
|
+
function getHashLength(hash3) {
|
|
84902
|
+
return parseInt(hash3.name.slice(4), 10);
|
|
84903
84903
|
}
|
|
84904
84904
|
function getNamedCurve(alg) {
|
|
84905
84905
|
switch (alg) {
|
|
@@ -90002,7 +90002,7 @@ var require_sync3 = __commonJS({
|
|
|
90002
90002
|
function syncMemoizer(options2) {
|
|
90003
90003
|
var cache = new lru_cache_1.default(options2);
|
|
90004
90004
|
var load2 = options2.load;
|
|
90005
|
-
var
|
|
90005
|
+
var hash3 = options2.hash;
|
|
90006
90006
|
var bypass = options2.bypass;
|
|
90007
90007
|
var itemMaxAge = options2.itemMaxAge;
|
|
90008
90008
|
var freeze = options2.freeze;
|
|
@@ -90021,7 +90021,7 @@ var require_sync3 = __commonJS({
|
|
|
90021
90021
|
return Object.assign(load2, defaultResult);
|
|
90022
90022
|
}
|
|
90023
90023
|
function del() {
|
|
90024
|
-
var key2 =
|
|
90024
|
+
var key2 = hash3.apply(void 0, __spread(arguments));
|
|
90025
90025
|
cache.del(key2);
|
|
90026
90026
|
}
|
|
90027
90027
|
function emit(event) {
|
|
@@ -90061,7 +90061,7 @@ var require_sync3 = __commonJS({
|
|
|
90061
90061
|
emit.apply(void 0, __spread(["miss"], args));
|
|
90062
90062
|
return load2.apply(void 0, __spread(args));
|
|
90063
90063
|
}
|
|
90064
|
-
var key2 =
|
|
90064
|
+
var key2 = hash3.apply(void 0, __spread(args));
|
|
90065
90065
|
var fromCache = cache.get(key2);
|
|
90066
90066
|
if (fromCache) {
|
|
90067
90067
|
emit.apply(void 0, __spread(["hit"], args));
|
|
@@ -90139,7 +90139,7 @@ var require_async2 = __commonJS({
|
|
|
90139
90139
|
function asyncMemoizer(options2) {
|
|
90140
90140
|
var cache = new lru_cache_1.default(options2);
|
|
90141
90141
|
var load2 = options2.load;
|
|
90142
|
-
var
|
|
90142
|
+
var hash3 = options2.hash;
|
|
90143
90143
|
var bypass = options2.bypass;
|
|
90144
90144
|
var itemMaxAge = options2.itemMaxAge;
|
|
90145
90145
|
var freeze = options2.freeze;
|
|
@@ -90164,7 +90164,7 @@ var require_async2 = __commonJS({
|
|
|
90164
90164
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
90165
90165
|
args[_i] = arguments[_i];
|
|
90166
90166
|
}
|
|
90167
|
-
var key2 =
|
|
90167
|
+
var key2 = hash3.apply(void 0, __spread(args));
|
|
90168
90168
|
cache.del(key2);
|
|
90169
90169
|
}
|
|
90170
90170
|
function add2(key2, parameters, result2) {
|
|
@@ -90219,10 +90219,10 @@ var require_async2 = __commonJS({
|
|
|
90219
90219
|
emit.apply(void 0, __spread(["miss"], parameters));
|
|
90220
90220
|
return load2.apply(void 0, __spread(args));
|
|
90221
90221
|
}
|
|
90222
|
-
if (parameters.length === 0 && !
|
|
90222
|
+
if (parameters.length === 0 && !hash3) {
|
|
90223
90223
|
key2 = "_";
|
|
90224
90224
|
} else {
|
|
90225
|
-
key2 =
|
|
90225
|
+
key2 = hash3.apply(void 0, __spread(parameters));
|
|
90226
90226
|
}
|
|
90227
90227
|
var fromCache = cache.get(key2);
|
|
90228
90228
|
if (fromCache) {
|
|
@@ -118178,9 +118178,9 @@ var require_rusha = __commonJS({
|
|
|
118178
118178
|
var blockSize = event.data.blockSize || 4 * 1024 * 1024;
|
|
118179
118179
|
var hasher = new Rusha(blockSize);
|
|
118180
118180
|
hasher.resetState();
|
|
118181
|
-
var done = function(err,
|
|
118181
|
+
var done = function(err, hash3) {
|
|
118182
118182
|
if (!err) {
|
|
118183
|
-
self.postMessage({ id, hash:
|
|
118183
|
+
self.postMessage({ id, hash: hash3 });
|
|
118184
118184
|
} else {
|
|
118185
118185
|
self.postMessage({ id, error: err.name });
|
|
118186
118186
|
}
|
|
@@ -135076,7 +135076,7 @@ ${error.message}`;
|
|
|
135076
135076
|
Object.defineProperty(exports22, "__esModule", {
|
|
135077
135077
|
value: true
|
|
135078
135078
|
});
|
|
135079
|
-
exports22.readFile =
|
|
135079
|
+
exports22.readFile = readFile47;
|
|
135080
135080
|
exports22.readFileSync = readFileSync4;
|
|
135081
135081
|
var _fs = _interopRequireDefault(require("fs"));
|
|
135082
135082
|
function _interopRequireDefault(obj) {
|
|
@@ -135095,7 +135095,7 @@ ${error.message}`;
|
|
|
135095
135095
|
});
|
|
135096
135096
|
});
|
|
135097
135097
|
}
|
|
135098
|
-
async function
|
|
135098
|
+
async function readFile47(filepath, options2 = {}) {
|
|
135099
135099
|
const throwNotFound = options2.throwNotFound === true;
|
|
135100
135100
|
try {
|
|
135101
135101
|
const content5 = await fsReadFileAsync(filepath, "utf8");
|
|
@@ -326169,7 +326169,7 @@ ${error.message}`;
|
|
|
326169
326169
|
"node_modules/resolve/lib/homedir.js"(exports22, module22) {
|
|
326170
326170
|
"use strict";
|
|
326171
326171
|
var os7 = require("os");
|
|
326172
|
-
module22.exports = os7.homedir || function
|
|
326172
|
+
module22.exports = os7.homedir || function homedir5() {
|
|
326173
326173
|
var home = process.env.HOME;
|
|
326174
326174
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
326175
326175
|
if (process.platform === "win32") {
|
|
@@ -326577,9 +326577,9 @@ ${error.message}`;
|
|
|
326577
326577
|
var normalizeOptions = require_normalize_options();
|
|
326578
326578
|
var isCore = require_is_core_module();
|
|
326579
326579
|
var realpathFS = fs10.realpath && typeof fs10.realpath.native === "function" ? fs10.realpath.native : fs10.realpath;
|
|
326580
|
-
var
|
|
326580
|
+
var homedir5 = getHomedir();
|
|
326581
326581
|
var defaultPaths = function() {
|
|
326582
|
-
return [path44.join(
|
|
326582
|
+
return [path44.join(homedir5, ".node_modules"), path44.join(homedir5, ".node_libraries")];
|
|
326583
326583
|
};
|
|
326584
326584
|
var defaultIsFile = function isFile2(file, cb) {
|
|
326585
326585
|
fs10.stat(file, function(err, stat3) {
|
|
@@ -326616,8 +326616,8 @@ ${error.message}`;
|
|
|
326616
326616
|
cb(null, x2);
|
|
326617
326617
|
}
|
|
326618
326618
|
};
|
|
326619
|
-
var defaultReadPackage = function defaultReadPackage2(
|
|
326620
|
-
|
|
326619
|
+
var defaultReadPackage = function defaultReadPackage2(readFile47, pkgfile, cb) {
|
|
326620
|
+
readFile47(pkgfile, function(readFileErr, body) {
|
|
326621
326621
|
if (readFileErr)
|
|
326622
326622
|
cb(readFileErr);
|
|
326623
326623
|
else {
|
|
@@ -326653,7 +326653,7 @@ ${error.message}`;
|
|
|
326653
326653
|
opts = normalizeOptions(x2, opts);
|
|
326654
326654
|
var isFile2 = opts.isFile || defaultIsFile;
|
|
326655
326655
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
326656
|
-
var
|
|
326656
|
+
var readFile47 = opts.readFile || fs10.readFile;
|
|
326657
326657
|
var realpath = opts.realpath || defaultRealpath;
|
|
326658
326658
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
326659
326659
|
if (opts.readFile && opts.readPackage) {
|
|
@@ -326785,7 +326785,7 @@ ${error.message}`;
|
|
|
326785
326785
|
isFile2(pkgfile, function(err2, ex) {
|
|
326786
326786
|
if (!ex)
|
|
326787
326787
|
return loadpkg(path44.dirname(dir), cb2);
|
|
326788
|
-
readPackage(
|
|
326788
|
+
readPackage(readFile47, pkgfile, function(err3, pkgParam) {
|
|
326789
326789
|
if (err3)
|
|
326790
326790
|
cb2(err3);
|
|
326791
326791
|
var pkg2 = pkgParam;
|
|
@@ -326813,7 +326813,7 @@ ${error.message}`;
|
|
|
326813
326813
|
return cb2(err2);
|
|
326814
326814
|
if (!ex)
|
|
326815
326815
|
return loadAsFile(path44.join(x22, "index"), fpkg, cb2);
|
|
326816
|
-
readPackage(
|
|
326816
|
+
readPackage(readFile47, pkgfile, function(err3, pkgParam) {
|
|
326817
326817
|
if (err3)
|
|
326818
326818
|
return cb2(err3);
|
|
326819
326819
|
var pkg2 = pkgParam;
|
|
@@ -327121,9 +327121,9 @@ ${error.message}`;
|
|
|
327121
327121
|
var nodeModulesPaths = require_node_modules_paths();
|
|
327122
327122
|
var normalizeOptions = require_normalize_options();
|
|
327123
327123
|
var realpathFS = fs10.realpathSync && typeof fs10.realpathSync.native === "function" ? fs10.realpathSync.native : fs10.realpathSync;
|
|
327124
|
-
var
|
|
327124
|
+
var homedir5 = getHomedir();
|
|
327125
327125
|
var defaultPaths = function() {
|
|
327126
|
-
return [path44.join(
|
|
327126
|
+
return [path44.join(homedir5, ".node_modules"), path44.join(homedir5, ".node_libraries")];
|
|
327127
327127
|
};
|
|
327128
327128
|
var defaultIsFile = function isFile2(file) {
|
|
327129
327129
|
try {
|
|
@@ -343312,8 +343312,8 @@ ${fromBody}`;
|
|
|
343312
343312
|
parts.push(...params);
|
|
343313
343313
|
}
|
|
343314
343314
|
if (node3.hash && node3.hash.pairs.length > 0) {
|
|
343315
|
-
const
|
|
343316
|
-
parts.push(
|
|
343315
|
+
const hash3 = print2("hash");
|
|
343316
|
+
parts.push(hash3);
|
|
343317
343317
|
}
|
|
343318
343318
|
if (parts.length === 0) {
|
|
343319
343319
|
return "";
|
|
@@ -348888,6 +348888,383 @@ ${text8}`;
|
|
|
348888
348888
|
}
|
|
348889
348889
|
});
|
|
348890
348890
|
|
|
348891
|
+
// pnp:/home/runner/work/fern/fern/.yarn/cache/object-hash-npm-3.0.0-d941e0cabe-80b4904bb3.zip/node_modules/object-hash/index.js
|
|
348892
|
+
var require_object_hash = __commonJS({
|
|
348893
|
+
"pnp:/home/runner/work/fern/fern/.yarn/cache/object-hash-npm-3.0.0-d941e0cabe-80b4904bb3.zip/node_modules/object-hash/index.js"(exports2, module2) {
|
|
348894
|
+
"use strict";
|
|
348895
|
+
var crypto = require("crypto");
|
|
348896
|
+
exports2 = module2.exports = objectHash;
|
|
348897
|
+
function objectHash(object4, options2) {
|
|
348898
|
+
options2 = applyDefaults(object4, options2);
|
|
348899
|
+
return hash3(object4, options2);
|
|
348900
|
+
}
|
|
348901
|
+
exports2.sha1 = function(object4) {
|
|
348902
|
+
return objectHash(object4);
|
|
348903
|
+
};
|
|
348904
|
+
exports2.keys = function(object4) {
|
|
348905
|
+
return objectHash(object4, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
|
|
348906
|
+
};
|
|
348907
|
+
exports2.MD5 = function(object4) {
|
|
348908
|
+
return objectHash(object4, { algorithm: "md5", encoding: "hex" });
|
|
348909
|
+
};
|
|
348910
|
+
exports2.keysMD5 = function(object4) {
|
|
348911
|
+
return objectHash(object4, { algorithm: "md5", encoding: "hex", excludeValues: true });
|
|
348912
|
+
};
|
|
348913
|
+
var hashes = crypto.getHashes ? crypto.getHashes().slice() : ["sha1", "md5"];
|
|
348914
|
+
hashes.push("passthrough");
|
|
348915
|
+
var encodings = ["buffer", "hex", "binary", "base64"];
|
|
348916
|
+
function applyDefaults(object4, sourceOptions) {
|
|
348917
|
+
sourceOptions = sourceOptions || {};
|
|
348918
|
+
var options2 = {};
|
|
348919
|
+
options2.algorithm = sourceOptions.algorithm || "sha1";
|
|
348920
|
+
options2.encoding = sourceOptions.encoding || "hex";
|
|
348921
|
+
options2.excludeValues = sourceOptions.excludeValues ? true : false;
|
|
348922
|
+
options2.algorithm = options2.algorithm.toLowerCase();
|
|
348923
|
+
options2.encoding = options2.encoding.toLowerCase();
|
|
348924
|
+
options2.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true;
|
|
348925
|
+
options2.respectType = sourceOptions.respectType === false ? false : true;
|
|
348926
|
+
options2.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
|
|
348927
|
+
options2.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
|
|
348928
|
+
options2.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true;
|
|
348929
|
+
options2.unorderedSets = sourceOptions.unorderedSets === false ? false : true;
|
|
348930
|
+
options2.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true;
|
|
348931
|
+
options2.replacer = sourceOptions.replacer || void 0;
|
|
348932
|
+
options2.excludeKeys = sourceOptions.excludeKeys || void 0;
|
|
348933
|
+
if (typeof object4 === "undefined") {
|
|
348934
|
+
throw new Error("Object argument required.");
|
|
348935
|
+
}
|
|
348936
|
+
for (var i2 = 0; i2 < hashes.length; ++i2) {
|
|
348937
|
+
if (hashes[i2].toLowerCase() === options2.algorithm.toLowerCase()) {
|
|
348938
|
+
options2.algorithm = hashes[i2];
|
|
348939
|
+
}
|
|
348940
|
+
}
|
|
348941
|
+
if (hashes.indexOf(options2.algorithm) === -1) {
|
|
348942
|
+
throw new Error('Algorithm "' + options2.algorithm + '" not supported. supported values: ' + hashes.join(", "));
|
|
348943
|
+
}
|
|
348944
|
+
if (encodings.indexOf(options2.encoding) === -1 && options2.algorithm !== "passthrough") {
|
|
348945
|
+
throw new Error('Encoding "' + options2.encoding + '" not supported. supported values: ' + encodings.join(", "));
|
|
348946
|
+
}
|
|
348947
|
+
return options2;
|
|
348948
|
+
}
|
|
348949
|
+
function isNativeFunction(f2) {
|
|
348950
|
+
if (typeof f2 !== "function") {
|
|
348951
|
+
return false;
|
|
348952
|
+
}
|
|
348953
|
+
var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
|
|
348954
|
+
return exp.exec(Function.prototype.toString.call(f2)) != null;
|
|
348955
|
+
}
|
|
348956
|
+
function hash3(object4, options2) {
|
|
348957
|
+
var hashingStream;
|
|
348958
|
+
if (options2.algorithm !== "passthrough") {
|
|
348959
|
+
hashingStream = crypto.createHash(options2.algorithm);
|
|
348960
|
+
} else {
|
|
348961
|
+
hashingStream = new PassThrough2();
|
|
348962
|
+
}
|
|
348963
|
+
if (typeof hashingStream.write === "undefined") {
|
|
348964
|
+
hashingStream.write = hashingStream.update;
|
|
348965
|
+
hashingStream.end = hashingStream.update;
|
|
348966
|
+
}
|
|
348967
|
+
var hasher = typeHasher(options2, hashingStream);
|
|
348968
|
+
hasher.dispatch(object4);
|
|
348969
|
+
if (!hashingStream.update) {
|
|
348970
|
+
hashingStream.end("");
|
|
348971
|
+
}
|
|
348972
|
+
if (hashingStream.digest) {
|
|
348973
|
+
return hashingStream.digest(options2.encoding === "buffer" ? void 0 : options2.encoding);
|
|
348974
|
+
}
|
|
348975
|
+
var buf = hashingStream.read();
|
|
348976
|
+
if (options2.encoding === "buffer") {
|
|
348977
|
+
return buf;
|
|
348978
|
+
}
|
|
348979
|
+
return buf.toString(options2.encoding);
|
|
348980
|
+
}
|
|
348981
|
+
exports2.writeToStream = function(object4, options2, stream) {
|
|
348982
|
+
if (typeof stream === "undefined") {
|
|
348983
|
+
stream = options2;
|
|
348984
|
+
options2 = {};
|
|
348985
|
+
}
|
|
348986
|
+
options2 = applyDefaults(object4, options2);
|
|
348987
|
+
return typeHasher(options2, stream).dispatch(object4);
|
|
348988
|
+
};
|
|
348989
|
+
function typeHasher(options2, writeTo, context) {
|
|
348990
|
+
context = context || [];
|
|
348991
|
+
var write2 = function(str3) {
|
|
348992
|
+
if (writeTo.update) {
|
|
348993
|
+
return writeTo.update(str3, "utf8");
|
|
348994
|
+
} else {
|
|
348995
|
+
return writeTo.write(str3, "utf8");
|
|
348996
|
+
}
|
|
348997
|
+
};
|
|
348998
|
+
return {
|
|
348999
|
+
dispatch: function(value) {
|
|
349000
|
+
if (options2.replacer) {
|
|
349001
|
+
value = options2.replacer(value);
|
|
349002
|
+
}
|
|
349003
|
+
var type2 = typeof value;
|
|
349004
|
+
if (value === null) {
|
|
349005
|
+
type2 = "null";
|
|
349006
|
+
}
|
|
349007
|
+
return this["_" + type2](value);
|
|
349008
|
+
},
|
|
349009
|
+
_object: function(object4) {
|
|
349010
|
+
var pattern = /\[object (.*)\]/i;
|
|
349011
|
+
var objString = Object.prototype.toString.call(object4);
|
|
349012
|
+
var objType = pattern.exec(objString);
|
|
349013
|
+
if (!objType) {
|
|
349014
|
+
objType = "unknown:[" + objString + "]";
|
|
349015
|
+
} else {
|
|
349016
|
+
objType = objType[1];
|
|
349017
|
+
}
|
|
349018
|
+
objType = objType.toLowerCase();
|
|
349019
|
+
var objectNumber = null;
|
|
349020
|
+
if ((objectNumber = context.indexOf(object4)) >= 0) {
|
|
349021
|
+
return this.dispatch("[CIRCULAR:" + objectNumber + "]");
|
|
349022
|
+
} else {
|
|
349023
|
+
context.push(object4);
|
|
349024
|
+
}
|
|
349025
|
+
if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object4)) {
|
|
349026
|
+
write2("buffer:");
|
|
349027
|
+
return write2(object4);
|
|
349028
|
+
}
|
|
349029
|
+
if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
|
|
349030
|
+
if (this["_" + objType]) {
|
|
349031
|
+
this["_" + objType](object4);
|
|
349032
|
+
} else if (options2.ignoreUnknown) {
|
|
349033
|
+
return write2("[" + objType + "]");
|
|
349034
|
+
} else {
|
|
349035
|
+
throw new Error('Unknown object type "' + objType + '"');
|
|
349036
|
+
}
|
|
349037
|
+
} else {
|
|
349038
|
+
var keys7 = Object.keys(object4);
|
|
349039
|
+
if (options2.unorderedObjects) {
|
|
349040
|
+
keys7 = keys7.sort();
|
|
349041
|
+
}
|
|
349042
|
+
if (options2.respectType !== false && !isNativeFunction(object4)) {
|
|
349043
|
+
keys7.splice(0, 0, "prototype", "__proto__", "constructor");
|
|
349044
|
+
}
|
|
349045
|
+
if (options2.excludeKeys) {
|
|
349046
|
+
keys7 = keys7.filter(function(key2) {
|
|
349047
|
+
return !options2.excludeKeys(key2);
|
|
349048
|
+
});
|
|
349049
|
+
}
|
|
349050
|
+
write2("object:" + keys7.length + ":");
|
|
349051
|
+
var self2 = this;
|
|
349052
|
+
return keys7.forEach(function(key2) {
|
|
349053
|
+
self2.dispatch(key2);
|
|
349054
|
+
write2(":");
|
|
349055
|
+
if (!options2.excludeValues) {
|
|
349056
|
+
self2.dispatch(object4[key2]);
|
|
349057
|
+
}
|
|
349058
|
+
write2(",");
|
|
349059
|
+
});
|
|
349060
|
+
}
|
|
349061
|
+
},
|
|
349062
|
+
_array: function(arr, unordered) {
|
|
349063
|
+
unordered = typeof unordered !== "undefined" ? unordered : options2.unorderedArrays !== false;
|
|
349064
|
+
var self2 = this;
|
|
349065
|
+
write2("array:" + arr.length + ":");
|
|
349066
|
+
if (!unordered || arr.length <= 1) {
|
|
349067
|
+
return arr.forEach(function(entry) {
|
|
349068
|
+
return self2.dispatch(entry);
|
|
349069
|
+
});
|
|
349070
|
+
}
|
|
349071
|
+
var contextAdditions = [];
|
|
349072
|
+
var entries6 = arr.map(function(entry) {
|
|
349073
|
+
var strm = new PassThrough2();
|
|
349074
|
+
var localContext = context.slice();
|
|
349075
|
+
var hasher = typeHasher(options2, strm, localContext);
|
|
349076
|
+
hasher.dispatch(entry);
|
|
349077
|
+
contextAdditions = contextAdditions.concat(localContext.slice(context.length));
|
|
349078
|
+
return strm.read().toString();
|
|
349079
|
+
});
|
|
349080
|
+
context = context.concat(contextAdditions);
|
|
349081
|
+
entries6.sort();
|
|
349082
|
+
return this._array(entries6, false);
|
|
349083
|
+
},
|
|
349084
|
+
_date: function(date4) {
|
|
349085
|
+
return write2("date:" + date4.toJSON());
|
|
349086
|
+
},
|
|
349087
|
+
_symbol: function(sym) {
|
|
349088
|
+
return write2("symbol:" + sym.toString());
|
|
349089
|
+
},
|
|
349090
|
+
_error: function(err) {
|
|
349091
|
+
return write2("error:" + err.toString());
|
|
349092
|
+
},
|
|
349093
|
+
_boolean: function(bool2) {
|
|
349094
|
+
return write2("bool:" + bool2.toString());
|
|
349095
|
+
},
|
|
349096
|
+
_string: function(string8) {
|
|
349097
|
+
write2("string:" + string8.length + ":");
|
|
349098
|
+
write2(string8.toString());
|
|
349099
|
+
},
|
|
349100
|
+
_function: function(fn2) {
|
|
349101
|
+
write2("fn:");
|
|
349102
|
+
if (isNativeFunction(fn2)) {
|
|
349103
|
+
this.dispatch("[native]");
|
|
349104
|
+
} else {
|
|
349105
|
+
this.dispatch(fn2.toString());
|
|
349106
|
+
}
|
|
349107
|
+
if (options2.respectFunctionNames !== false) {
|
|
349108
|
+
this.dispatch("function-name:" + String(fn2.name));
|
|
349109
|
+
}
|
|
349110
|
+
if (options2.respectFunctionProperties) {
|
|
349111
|
+
this._object(fn2);
|
|
349112
|
+
}
|
|
349113
|
+
},
|
|
349114
|
+
_number: function(number5) {
|
|
349115
|
+
return write2("number:" + number5.toString());
|
|
349116
|
+
},
|
|
349117
|
+
_xml: function(xml2) {
|
|
349118
|
+
return write2("xml:" + xml2.toString());
|
|
349119
|
+
},
|
|
349120
|
+
_null: function() {
|
|
349121
|
+
return write2("Null");
|
|
349122
|
+
},
|
|
349123
|
+
_undefined: function() {
|
|
349124
|
+
return write2("Undefined");
|
|
349125
|
+
},
|
|
349126
|
+
_regexp: function(regex3) {
|
|
349127
|
+
return write2("regex:" + regex3.toString());
|
|
349128
|
+
},
|
|
349129
|
+
_uint8array: function(arr) {
|
|
349130
|
+
write2("uint8array:");
|
|
349131
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349132
|
+
},
|
|
349133
|
+
_uint8clampedarray: function(arr) {
|
|
349134
|
+
write2("uint8clampedarray:");
|
|
349135
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349136
|
+
},
|
|
349137
|
+
_int8array: function(arr) {
|
|
349138
|
+
write2("int8array:");
|
|
349139
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349140
|
+
},
|
|
349141
|
+
_uint16array: function(arr) {
|
|
349142
|
+
write2("uint16array:");
|
|
349143
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349144
|
+
},
|
|
349145
|
+
_int16array: function(arr) {
|
|
349146
|
+
write2("int16array:");
|
|
349147
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349148
|
+
},
|
|
349149
|
+
_uint32array: function(arr) {
|
|
349150
|
+
write2("uint32array:");
|
|
349151
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349152
|
+
},
|
|
349153
|
+
_int32array: function(arr) {
|
|
349154
|
+
write2("int32array:");
|
|
349155
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349156
|
+
},
|
|
349157
|
+
_float32array: function(arr) {
|
|
349158
|
+
write2("float32array:");
|
|
349159
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349160
|
+
},
|
|
349161
|
+
_float64array: function(arr) {
|
|
349162
|
+
write2("float64array:");
|
|
349163
|
+
return this.dispatch(Array.prototype.slice.call(arr));
|
|
349164
|
+
},
|
|
349165
|
+
_arraybuffer: function(arr) {
|
|
349166
|
+
write2("arraybuffer:");
|
|
349167
|
+
return this.dispatch(new Uint8Array(arr));
|
|
349168
|
+
},
|
|
349169
|
+
_url: function(url) {
|
|
349170
|
+
return write2("url:" + url.toString(), "utf8");
|
|
349171
|
+
},
|
|
349172
|
+
_map: function(map12) {
|
|
349173
|
+
write2("map:");
|
|
349174
|
+
var arr = Array.from(map12);
|
|
349175
|
+
return this._array(arr, options2.unorderedSets !== false);
|
|
349176
|
+
},
|
|
349177
|
+
_set: function(set7) {
|
|
349178
|
+
write2("set:");
|
|
349179
|
+
var arr = Array.from(set7);
|
|
349180
|
+
return this._array(arr, options2.unorderedSets !== false);
|
|
349181
|
+
},
|
|
349182
|
+
_file: function(file) {
|
|
349183
|
+
write2("file:");
|
|
349184
|
+
return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
|
|
349185
|
+
},
|
|
349186
|
+
_blob: function() {
|
|
349187
|
+
if (options2.ignoreUnknown) {
|
|
349188
|
+
return write2("[blob]");
|
|
349189
|
+
}
|
|
349190
|
+
throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
|
|
349191
|
+
},
|
|
349192
|
+
_domwindow: function() {
|
|
349193
|
+
return write2("domwindow");
|
|
349194
|
+
},
|
|
349195
|
+
_bigint: function(number5) {
|
|
349196
|
+
return write2("bigint:" + number5.toString());
|
|
349197
|
+
},
|
|
349198
|
+
_process: function() {
|
|
349199
|
+
return write2("process");
|
|
349200
|
+
},
|
|
349201
|
+
_timer: function() {
|
|
349202
|
+
return write2("timer");
|
|
349203
|
+
},
|
|
349204
|
+
_pipe: function() {
|
|
349205
|
+
return write2("pipe");
|
|
349206
|
+
},
|
|
349207
|
+
_tcp: function() {
|
|
349208
|
+
return write2("tcp");
|
|
349209
|
+
},
|
|
349210
|
+
_udp: function() {
|
|
349211
|
+
return write2("udp");
|
|
349212
|
+
},
|
|
349213
|
+
_tty: function() {
|
|
349214
|
+
return write2("tty");
|
|
349215
|
+
},
|
|
349216
|
+
_statwatcher: function() {
|
|
349217
|
+
return write2("statwatcher");
|
|
349218
|
+
},
|
|
349219
|
+
_securecontext: function() {
|
|
349220
|
+
return write2("securecontext");
|
|
349221
|
+
},
|
|
349222
|
+
_connection: function() {
|
|
349223
|
+
return write2("connection");
|
|
349224
|
+
},
|
|
349225
|
+
_zlib: function() {
|
|
349226
|
+
return write2("zlib");
|
|
349227
|
+
},
|
|
349228
|
+
_context: function() {
|
|
349229
|
+
return write2("context");
|
|
349230
|
+
},
|
|
349231
|
+
_nodescript: function() {
|
|
349232
|
+
return write2("nodescript");
|
|
349233
|
+
},
|
|
349234
|
+
_httpparser: function() {
|
|
349235
|
+
return write2("httpparser");
|
|
349236
|
+
},
|
|
349237
|
+
_dataview: function() {
|
|
349238
|
+
return write2("dataview");
|
|
349239
|
+
},
|
|
349240
|
+
_signal: function() {
|
|
349241
|
+
return write2("signal");
|
|
349242
|
+
},
|
|
349243
|
+
_fsevent: function() {
|
|
349244
|
+
return write2("fsevent");
|
|
349245
|
+
},
|
|
349246
|
+
_tlswrap: function() {
|
|
349247
|
+
return write2("tlswrap");
|
|
349248
|
+
}
|
|
349249
|
+
};
|
|
349250
|
+
}
|
|
349251
|
+
function PassThrough2() {
|
|
349252
|
+
return {
|
|
349253
|
+
buf: "",
|
|
349254
|
+
write: function(b2) {
|
|
349255
|
+
this.buf += b2;
|
|
349256
|
+
},
|
|
349257
|
+
end: function(b2) {
|
|
349258
|
+
this.buf += b2;
|
|
349259
|
+
},
|
|
349260
|
+
read: function() {
|
|
349261
|
+
return this.buf;
|
|
349262
|
+
}
|
|
349263
|
+
};
|
|
349264
|
+
}
|
|
349265
|
+
}
|
|
349266
|
+
});
|
|
349267
|
+
|
|
348891
349268
|
// pnp:/home/runner/work/fern/fern/.yarn/cache/semver-npm-7.3.8-25a996cb4f-ba9c7cbbf2.zip/node_modules/semver/internal/constants.js
|
|
348892
349269
|
var require_constants3 = __commonJS({
|
|
348893
349270
|
"pnp:/home/runner/work/fern/fern/.yarn/cache/semver-npm-7.3.8-25a996cb4f-ba9c7cbbf2.zip/node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
@@ -369449,7 +369826,7 @@ var require_unpack = __commonJS({
|
|
|
369449
369826
|
var fs10 = require("fs");
|
|
369450
369827
|
var fsm = require_fs_minipass();
|
|
369451
369828
|
var path44 = require("path");
|
|
369452
|
-
var
|
|
369829
|
+
var mkdir15 = require_mkdir();
|
|
369453
369830
|
var wc = require_winchars();
|
|
369454
369831
|
var pathReservations = require_path_reservations();
|
|
369455
369832
|
var stripAbsolutePath = require_strip_absolute_path();
|
|
@@ -369696,7 +370073,7 @@ var require_unpack = __commonJS({
|
|
|
369696
370073
|
}
|
|
369697
370074
|
}
|
|
369698
370075
|
[MKDIR](dir, mode, cb) {
|
|
369699
|
-
|
|
370076
|
+
mkdir15(normPath(dir), {
|
|
369700
370077
|
uid: this.uid,
|
|
369701
370078
|
gid: this.gid,
|
|
369702
370079
|
processUid: this.processUid,
|
|
@@ -370095,7 +370472,7 @@ var require_unpack = __commonJS({
|
|
|
370095
370472
|
}
|
|
370096
370473
|
[MKDIR](dir, mode) {
|
|
370097
370474
|
try {
|
|
370098
|
-
return
|
|
370475
|
+
return mkdir15.sync(normPath(dir), {
|
|
370099
370476
|
uid: this.uid,
|
|
370100
370477
|
gid: this.gid,
|
|
370101
370478
|
processUid: this.processUid,
|
|
@@ -378376,10 +378753,10 @@ var require_util4 = __commonJS({
|
|
|
378376
378753
|
var codegen_1 = require_codegen();
|
|
378377
378754
|
var code_1 = require_code();
|
|
378378
378755
|
function toHash(arr) {
|
|
378379
|
-
const
|
|
378756
|
+
const hash3 = {};
|
|
378380
378757
|
for (const item of arr)
|
|
378381
|
-
|
|
378382
|
-
return
|
|
378758
|
+
hash3[item] = true;
|
|
378759
|
+
return hash3;
|
|
378383
378760
|
}
|
|
378384
378761
|
exports2.toHash = toHash;
|
|
378385
378762
|
function alwaysValidSchema(it, schema2) {
|
|
@@ -390836,7 +391213,7 @@ var require_parse9 = __commonJS({
|
|
|
390836
391213
|
extension: url.getExtension(path44)
|
|
390837
391214
|
};
|
|
390838
391215
|
try {
|
|
390839
|
-
const resolver3 = await
|
|
391216
|
+
const resolver3 = await readFile47(file, options2, $refs);
|
|
390840
391217
|
$ref.pathType = resolver3.plugin.name;
|
|
390841
391218
|
file.data = resolver3.result;
|
|
390842
391219
|
const parser2 = await parseFile(file, options2, $refs);
|
|
@@ -390849,7 +391226,7 @@ var require_parse9 = __commonJS({
|
|
|
390849
391226
|
throw err;
|
|
390850
391227
|
}
|
|
390851
391228
|
}
|
|
390852
|
-
function
|
|
391229
|
+
function readFile47(file, options2, $refs) {
|
|
390853
391230
|
return new Promise((resolve6, reject2) => {
|
|
390854
391231
|
let resolvers = plugins.all(options2.resolve);
|
|
390855
391232
|
resolvers = plugins.filter(resolvers, "canRead", file);
|
|
@@ -391017,7 +391394,7 @@ var require_bundle = __commonJS({
|
|
|
391017
391394
|
}
|
|
391018
391395
|
let depth = Pointer.parse(pathFromRoot).length;
|
|
391019
391396
|
let file = url.stripHash(pointer.path);
|
|
391020
|
-
let
|
|
391397
|
+
let hash3 = url.getHash(pointer.path);
|
|
391021
391398
|
let external = file !== $refs._root$Ref.path;
|
|
391022
391399
|
let extended = $Ref.isExtended$Ref($ref);
|
|
391023
391400
|
indirections += pointer.indirections;
|
|
@@ -391036,7 +391413,7 @@ var require_bundle = __commonJS({
|
|
|
391036
391413
|
pathFromRoot,
|
|
391037
391414
|
depth,
|
|
391038
391415
|
file,
|
|
391039
|
-
hash:
|
|
391416
|
+
hash: hash3,
|
|
391040
391417
|
value: pointer.value,
|
|
391041
391418
|
circular: pointer.circular,
|
|
391042
391419
|
extended,
|
|
@@ -391071,17 +391448,17 @@ var require_bundle = __commonJS({
|
|
|
391071
391448
|
}
|
|
391072
391449
|
}
|
|
391073
391450
|
});
|
|
391074
|
-
let file,
|
|
391451
|
+
let file, hash3, pathFromRoot;
|
|
391075
391452
|
for (let entry of inventory) {
|
|
391076
391453
|
if (!entry.external) {
|
|
391077
391454
|
entry.$ref.$ref = entry.hash;
|
|
391078
|
-
} else if (entry.file === file && entry.hash ===
|
|
391455
|
+
} else if (entry.file === file && entry.hash === hash3) {
|
|
391079
391456
|
entry.$ref.$ref = pathFromRoot;
|
|
391080
|
-
} else if (entry.file === file && entry.hash.indexOf(
|
|
391081
|
-
entry.$ref.$ref = Pointer.join(pathFromRoot, Pointer.parse(entry.hash.replace(
|
|
391457
|
+
} else if (entry.file === file && entry.hash.indexOf(hash3 + "/") === 0) {
|
|
391458
|
+
entry.$ref.$ref = Pointer.join(pathFromRoot, Pointer.parse(entry.hash.replace(hash3, "#")));
|
|
391082
391459
|
} else {
|
|
391083
391460
|
file = entry.file;
|
|
391084
|
-
|
|
391461
|
+
hash3 = entry.hash;
|
|
391085
391462
|
pathFromRoot = entry.pathFromRoot;
|
|
391086
391463
|
entry.$ref = entry.parent[entry.key] = $Ref.dereference(entry.$ref, entry.value);
|
|
391087
391464
|
if (entry.circular) {
|
|
@@ -400807,10 +401184,10 @@ var require_util5 = __commonJS({
|
|
|
400807
401184
|
var codegen_1 = require_codegen2();
|
|
400808
401185
|
var code_1 = require_code3();
|
|
400809
401186
|
function toHash(arr) {
|
|
400810
|
-
const
|
|
401187
|
+
const hash3 = {};
|
|
400811
401188
|
for (const item of arr)
|
|
400812
|
-
|
|
400813
|
-
return
|
|
401189
|
+
hash3[item] = true;
|
|
401190
|
+
return hash3;
|
|
400814
401191
|
}
|
|
400815
401192
|
exports2.toHash = toHash;
|
|
400816
401193
|
function alwaysValidSchema(it, schema2) {
|
|
@@ -414496,8 +414873,8 @@ var require_loader3 = __commonJS({
|
|
|
414496
414873
|
if (!line) {
|
|
414497
414874
|
return;
|
|
414498
414875
|
}
|
|
414499
|
-
var
|
|
414500
|
-
if (state.errorMap[
|
|
414876
|
+
var hash3 = message + position4;
|
|
414877
|
+
if (state.errorMap[hash3]) {
|
|
414501
414878
|
return;
|
|
414502
414879
|
}
|
|
414503
414880
|
var mark2 = new Mark(state.filename, state.input, position4, line.line, position4 - line.start);
|
|
@@ -414509,12 +414886,12 @@ var require_loader3 = __commonJS({
|
|
|
414509
414886
|
}
|
|
414510
414887
|
function throwError2(state, message) {
|
|
414511
414888
|
var error = generateError2(state, message);
|
|
414512
|
-
var
|
|
414513
|
-
if (state.errorMap[
|
|
414889
|
+
var hash3 = error.message + error.mark.position;
|
|
414890
|
+
if (state.errorMap[hash3]) {
|
|
414514
414891
|
return;
|
|
414515
414892
|
}
|
|
414516
414893
|
state.errors.push(error);
|
|
414517
|
-
state.errorMap[
|
|
414894
|
+
state.errorMap[hash3] = 1;
|
|
414518
414895
|
var or = state.position;
|
|
414519
414896
|
while (true) {
|
|
414520
414897
|
if (state.position >= state.input.length - 1) {
|
|
@@ -427073,21 +427450,21 @@ var require_clone4 = __commonJS({
|
|
|
427073
427450
|
function fastClone(obj) {
|
|
427074
427451
|
return Object.assign({}, obj);
|
|
427075
427452
|
}
|
|
427076
|
-
function circularClone(obj,
|
|
427077
|
-
if (!
|
|
427078
|
-
|
|
427453
|
+
function circularClone(obj, hash3) {
|
|
427454
|
+
if (!hash3)
|
|
427455
|
+
hash3 = /* @__PURE__ */ new WeakMap();
|
|
427079
427456
|
if (Object(obj) !== obj || obj instanceof Function)
|
|
427080
427457
|
return obj;
|
|
427081
|
-
if (
|
|
427082
|
-
return
|
|
427458
|
+
if (hash3.has(obj))
|
|
427459
|
+
return hash3.get(obj);
|
|
427083
427460
|
try {
|
|
427084
427461
|
var result2 = new obj.constructor();
|
|
427085
427462
|
} catch (e) {
|
|
427086
427463
|
result2 = Object.create(Object.getPrototypeOf(obj));
|
|
427087
427464
|
}
|
|
427088
|
-
|
|
427465
|
+
hash3.set(obj, result2);
|
|
427089
427466
|
return Object.assign(result2, ...Object.keys(obj).map(
|
|
427090
|
-
(key2) => ({ [key2]: circularClone(obj[key2],
|
|
427467
|
+
(key2) => ({ [key2]: circularClone(obj[key2], hash3) })
|
|
427091
427468
|
));
|
|
427092
427469
|
}
|
|
427093
427470
|
module2.exports = {
|
|
@@ -427487,17 +427864,17 @@ var require_oas_kit_common = __commonJS({
|
|
|
427487
427864
|
return arr.indexOf(e) < i2;
|
|
427488
427865
|
});
|
|
427489
427866
|
}
|
|
427490
|
-
function
|
|
427491
|
-
let
|
|
427867
|
+
function hash3(s2) {
|
|
427868
|
+
let hash4 = 0;
|
|
427492
427869
|
let chr;
|
|
427493
427870
|
if (s2.length === 0)
|
|
427494
|
-
return
|
|
427871
|
+
return hash4;
|
|
427495
427872
|
for (let i2 = 0; i2 < s2.length; i2++) {
|
|
427496
427873
|
chr = s2.charCodeAt(i2);
|
|
427497
|
-
|
|
427498
|
-
|
|
427874
|
+
hash4 = (hash4 << 5) - hash4 + chr;
|
|
427875
|
+
hash4 |= 0;
|
|
427499
427876
|
}
|
|
427500
|
-
return
|
|
427877
|
+
return hash4;
|
|
427501
427878
|
}
|
|
427502
427879
|
String.prototype.toCamelCase = function camelize() {
|
|
427503
427880
|
return this.toLowerCase().replace(/[-_ \/\.](.)/g, function(match, group1) {
|
|
@@ -427555,7 +427932,7 @@ var require_oas_kit_common = __commonJS({
|
|
|
427555
427932
|
allSame,
|
|
427556
427933
|
distinctArray,
|
|
427557
427934
|
firstDupe,
|
|
427558
|
-
hash:
|
|
427935
|
+
hash: hash3,
|
|
427559
427936
|
parameterTypeProperties,
|
|
427560
427937
|
arrayProperties,
|
|
427561
427938
|
httpMethods,
|
|
@@ -439053,383 +439430,6 @@ var require_semver6 = __commonJS({
|
|
|
439053
439430
|
}
|
|
439054
439431
|
});
|
|
439055
439432
|
|
|
439056
|
-
// pnp:/home/runner/work/fern/fern/.yarn/cache/object-hash-npm-3.0.0-d941e0cabe-80b4904bb3.zip/node_modules/object-hash/index.js
|
|
439057
|
-
var require_object_hash = __commonJS({
|
|
439058
|
-
"pnp:/home/runner/work/fern/fern/.yarn/cache/object-hash-npm-3.0.0-d941e0cabe-80b4904bb3.zip/node_modules/object-hash/index.js"(exports2, module2) {
|
|
439059
|
-
"use strict";
|
|
439060
|
-
var crypto = require("crypto");
|
|
439061
|
-
exports2 = module2.exports = objectHash;
|
|
439062
|
-
function objectHash(object4, options2) {
|
|
439063
|
-
options2 = applyDefaults(object4, options2);
|
|
439064
|
-
return hash2(object4, options2);
|
|
439065
|
-
}
|
|
439066
|
-
exports2.sha1 = function(object4) {
|
|
439067
|
-
return objectHash(object4);
|
|
439068
|
-
};
|
|
439069
|
-
exports2.keys = function(object4) {
|
|
439070
|
-
return objectHash(object4, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
|
|
439071
|
-
};
|
|
439072
|
-
exports2.MD5 = function(object4) {
|
|
439073
|
-
return objectHash(object4, { algorithm: "md5", encoding: "hex" });
|
|
439074
|
-
};
|
|
439075
|
-
exports2.keysMD5 = function(object4) {
|
|
439076
|
-
return objectHash(object4, { algorithm: "md5", encoding: "hex", excludeValues: true });
|
|
439077
|
-
};
|
|
439078
|
-
var hashes = crypto.getHashes ? crypto.getHashes().slice() : ["sha1", "md5"];
|
|
439079
|
-
hashes.push("passthrough");
|
|
439080
|
-
var encodings = ["buffer", "hex", "binary", "base64"];
|
|
439081
|
-
function applyDefaults(object4, sourceOptions) {
|
|
439082
|
-
sourceOptions = sourceOptions || {};
|
|
439083
|
-
var options2 = {};
|
|
439084
|
-
options2.algorithm = sourceOptions.algorithm || "sha1";
|
|
439085
|
-
options2.encoding = sourceOptions.encoding || "hex";
|
|
439086
|
-
options2.excludeValues = sourceOptions.excludeValues ? true : false;
|
|
439087
|
-
options2.algorithm = options2.algorithm.toLowerCase();
|
|
439088
|
-
options2.encoding = options2.encoding.toLowerCase();
|
|
439089
|
-
options2.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true;
|
|
439090
|
-
options2.respectType = sourceOptions.respectType === false ? false : true;
|
|
439091
|
-
options2.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
|
|
439092
|
-
options2.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
|
|
439093
|
-
options2.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true;
|
|
439094
|
-
options2.unorderedSets = sourceOptions.unorderedSets === false ? false : true;
|
|
439095
|
-
options2.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true;
|
|
439096
|
-
options2.replacer = sourceOptions.replacer || void 0;
|
|
439097
|
-
options2.excludeKeys = sourceOptions.excludeKeys || void 0;
|
|
439098
|
-
if (typeof object4 === "undefined") {
|
|
439099
|
-
throw new Error("Object argument required.");
|
|
439100
|
-
}
|
|
439101
|
-
for (var i2 = 0; i2 < hashes.length; ++i2) {
|
|
439102
|
-
if (hashes[i2].toLowerCase() === options2.algorithm.toLowerCase()) {
|
|
439103
|
-
options2.algorithm = hashes[i2];
|
|
439104
|
-
}
|
|
439105
|
-
}
|
|
439106
|
-
if (hashes.indexOf(options2.algorithm) === -1) {
|
|
439107
|
-
throw new Error('Algorithm "' + options2.algorithm + '" not supported. supported values: ' + hashes.join(", "));
|
|
439108
|
-
}
|
|
439109
|
-
if (encodings.indexOf(options2.encoding) === -1 && options2.algorithm !== "passthrough") {
|
|
439110
|
-
throw new Error('Encoding "' + options2.encoding + '" not supported. supported values: ' + encodings.join(", "));
|
|
439111
|
-
}
|
|
439112
|
-
return options2;
|
|
439113
|
-
}
|
|
439114
|
-
function isNativeFunction(f2) {
|
|
439115
|
-
if (typeof f2 !== "function") {
|
|
439116
|
-
return false;
|
|
439117
|
-
}
|
|
439118
|
-
var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
|
|
439119
|
-
return exp.exec(Function.prototype.toString.call(f2)) != null;
|
|
439120
|
-
}
|
|
439121
|
-
function hash2(object4, options2) {
|
|
439122
|
-
var hashingStream;
|
|
439123
|
-
if (options2.algorithm !== "passthrough") {
|
|
439124
|
-
hashingStream = crypto.createHash(options2.algorithm);
|
|
439125
|
-
} else {
|
|
439126
|
-
hashingStream = new PassThrough2();
|
|
439127
|
-
}
|
|
439128
|
-
if (typeof hashingStream.write === "undefined") {
|
|
439129
|
-
hashingStream.write = hashingStream.update;
|
|
439130
|
-
hashingStream.end = hashingStream.update;
|
|
439131
|
-
}
|
|
439132
|
-
var hasher = typeHasher(options2, hashingStream);
|
|
439133
|
-
hasher.dispatch(object4);
|
|
439134
|
-
if (!hashingStream.update) {
|
|
439135
|
-
hashingStream.end("");
|
|
439136
|
-
}
|
|
439137
|
-
if (hashingStream.digest) {
|
|
439138
|
-
return hashingStream.digest(options2.encoding === "buffer" ? void 0 : options2.encoding);
|
|
439139
|
-
}
|
|
439140
|
-
var buf = hashingStream.read();
|
|
439141
|
-
if (options2.encoding === "buffer") {
|
|
439142
|
-
return buf;
|
|
439143
|
-
}
|
|
439144
|
-
return buf.toString(options2.encoding);
|
|
439145
|
-
}
|
|
439146
|
-
exports2.writeToStream = function(object4, options2, stream) {
|
|
439147
|
-
if (typeof stream === "undefined") {
|
|
439148
|
-
stream = options2;
|
|
439149
|
-
options2 = {};
|
|
439150
|
-
}
|
|
439151
|
-
options2 = applyDefaults(object4, options2);
|
|
439152
|
-
return typeHasher(options2, stream).dispatch(object4);
|
|
439153
|
-
};
|
|
439154
|
-
function typeHasher(options2, writeTo, context) {
|
|
439155
|
-
context = context || [];
|
|
439156
|
-
var write2 = function(str3) {
|
|
439157
|
-
if (writeTo.update) {
|
|
439158
|
-
return writeTo.update(str3, "utf8");
|
|
439159
|
-
} else {
|
|
439160
|
-
return writeTo.write(str3, "utf8");
|
|
439161
|
-
}
|
|
439162
|
-
};
|
|
439163
|
-
return {
|
|
439164
|
-
dispatch: function(value) {
|
|
439165
|
-
if (options2.replacer) {
|
|
439166
|
-
value = options2.replacer(value);
|
|
439167
|
-
}
|
|
439168
|
-
var type2 = typeof value;
|
|
439169
|
-
if (value === null) {
|
|
439170
|
-
type2 = "null";
|
|
439171
|
-
}
|
|
439172
|
-
return this["_" + type2](value);
|
|
439173
|
-
},
|
|
439174
|
-
_object: function(object4) {
|
|
439175
|
-
var pattern = /\[object (.*)\]/i;
|
|
439176
|
-
var objString = Object.prototype.toString.call(object4);
|
|
439177
|
-
var objType = pattern.exec(objString);
|
|
439178
|
-
if (!objType) {
|
|
439179
|
-
objType = "unknown:[" + objString + "]";
|
|
439180
|
-
} else {
|
|
439181
|
-
objType = objType[1];
|
|
439182
|
-
}
|
|
439183
|
-
objType = objType.toLowerCase();
|
|
439184
|
-
var objectNumber = null;
|
|
439185
|
-
if ((objectNumber = context.indexOf(object4)) >= 0) {
|
|
439186
|
-
return this.dispatch("[CIRCULAR:" + objectNumber + "]");
|
|
439187
|
-
} else {
|
|
439188
|
-
context.push(object4);
|
|
439189
|
-
}
|
|
439190
|
-
if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object4)) {
|
|
439191
|
-
write2("buffer:");
|
|
439192
|
-
return write2(object4);
|
|
439193
|
-
}
|
|
439194
|
-
if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
|
|
439195
|
-
if (this["_" + objType]) {
|
|
439196
|
-
this["_" + objType](object4);
|
|
439197
|
-
} else if (options2.ignoreUnknown) {
|
|
439198
|
-
return write2("[" + objType + "]");
|
|
439199
|
-
} else {
|
|
439200
|
-
throw new Error('Unknown object type "' + objType + '"');
|
|
439201
|
-
}
|
|
439202
|
-
} else {
|
|
439203
|
-
var keys7 = Object.keys(object4);
|
|
439204
|
-
if (options2.unorderedObjects) {
|
|
439205
|
-
keys7 = keys7.sort();
|
|
439206
|
-
}
|
|
439207
|
-
if (options2.respectType !== false && !isNativeFunction(object4)) {
|
|
439208
|
-
keys7.splice(0, 0, "prototype", "__proto__", "constructor");
|
|
439209
|
-
}
|
|
439210
|
-
if (options2.excludeKeys) {
|
|
439211
|
-
keys7 = keys7.filter(function(key2) {
|
|
439212
|
-
return !options2.excludeKeys(key2);
|
|
439213
|
-
});
|
|
439214
|
-
}
|
|
439215
|
-
write2("object:" + keys7.length + ":");
|
|
439216
|
-
var self2 = this;
|
|
439217
|
-
return keys7.forEach(function(key2) {
|
|
439218
|
-
self2.dispatch(key2);
|
|
439219
|
-
write2(":");
|
|
439220
|
-
if (!options2.excludeValues) {
|
|
439221
|
-
self2.dispatch(object4[key2]);
|
|
439222
|
-
}
|
|
439223
|
-
write2(",");
|
|
439224
|
-
});
|
|
439225
|
-
}
|
|
439226
|
-
},
|
|
439227
|
-
_array: function(arr, unordered) {
|
|
439228
|
-
unordered = typeof unordered !== "undefined" ? unordered : options2.unorderedArrays !== false;
|
|
439229
|
-
var self2 = this;
|
|
439230
|
-
write2("array:" + arr.length + ":");
|
|
439231
|
-
if (!unordered || arr.length <= 1) {
|
|
439232
|
-
return arr.forEach(function(entry) {
|
|
439233
|
-
return self2.dispatch(entry);
|
|
439234
|
-
});
|
|
439235
|
-
}
|
|
439236
|
-
var contextAdditions = [];
|
|
439237
|
-
var entries6 = arr.map(function(entry) {
|
|
439238
|
-
var strm = new PassThrough2();
|
|
439239
|
-
var localContext = context.slice();
|
|
439240
|
-
var hasher = typeHasher(options2, strm, localContext);
|
|
439241
|
-
hasher.dispatch(entry);
|
|
439242
|
-
contextAdditions = contextAdditions.concat(localContext.slice(context.length));
|
|
439243
|
-
return strm.read().toString();
|
|
439244
|
-
});
|
|
439245
|
-
context = context.concat(contextAdditions);
|
|
439246
|
-
entries6.sort();
|
|
439247
|
-
return this._array(entries6, false);
|
|
439248
|
-
},
|
|
439249
|
-
_date: function(date4) {
|
|
439250
|
-
return write2("date:" + date4.toJSON());
|
|
439251
|
-
},
|
|
439252
|
-
_symbol: function(sym) {
|
|
439253
|
-
return write2("symbol:" + sym.toString());
|
|
439254
|
-
},
|
|
439255
|
-
_error: function(err) {
|
|
439256
|
-
return write2("error:" + err.toString());
|
|
439257
|
-
},
|
|
439258
|
-
_boolean: function(bool2) {
|
|
439259
|
-
return write2("bool:" + bool2.toString());
|
|
439260
|
-
},
|
|
439261
|
-
_string: function(string8) {
|
|
439262
|
-
write2("string:" + string8.length + ":");
|
|
439263
|
-
write2(string8.toString());
|
|
439264
|
-
},
|
|
439265
|
-
_function: function(fn2) {
|
|
439266
|
-
write2("fn:");
|
|
439267
|
-
if (isNativeFunction(fn2)) {
|
|
439268
|
-
this.dispatch("[native]");
|
|
439269
|
-
} else {
|
|
439270
|
-
this.dispatch(fn2.toString());
|
|
439271
|
-
}
|
|
439272
|
-
if (options2.respectFunctionNames !== false) {
|
|
439273
|
-
this.dispatch("function-name:" + String(fn2.name));
|
|
439274
|
-
}
|
|
439275
|
-
if (options2.respectFunctionProperties) {
|
|
439276
|
-
this._object(fn2);
|
|
439277
|
-
}
|
|
439278
|
-
},
|
|
439279
|
-
_number: function(number5) {
|
|
439280
|
-
return write2("number:" + number5.toString());
|
|
439281
|
-
},
|
|
439282
|
-
_xml: function(xml2) {
|
|
439283
|
-
return write2("xml:" + xml2.toString());
|
|
439284
|
-
},
|
|
439285
|
-
_null: function() {
|
|
439286
|
-
return write2("Null");
|
|
439287
|
-
},
|
|
439288
|
-
_undefined: function() {
|
|
439289
|
-
return write2("Undefined");
|
|
439290
|
-
},
|
|
439291
|
-
_regexp: function(regex3) {
|
|
439292
|
-
return write2("regex:" + regex3.toString());
|
|
439293
|
-
},
|
|
439294
|
-
_uint8array: function(arr) {
|
|
439295
|
-
write2("uint8array:");
|
|
439296
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439297
|
-
},
|
|
439298
|
-
_uint8clampedarray: function(arr) {
|
|
439299
|
-
write2("uint8clampedarray:");
|
|
439300
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439301
|
-
},
|
|
439302
|
-
_int8array: function(arr) {
|
|
439303
|
-
write2("int8array:");
|
|
439304
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439305
|
-
},
|
|
439306
|
-
_uint16array: function(arr) {
|
|
439307
|
-
write2("uint16array:");
|
|
439308
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439309
|
-
},
|
|
439310
|
-
_int16array: function(arr) {
|
|
439311
|
-
write2("int16array:");
|
|
439312
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439313
|
-
},
|
|
439314
|
-
_uint32array: function(arr) {
|
|
439315
|
-
write2("uint32array:");
|
|
439316
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439317
|
-
},
|
|
439318
|
-
_int32array: function(arr) {
|
|
439319
|
-
write2("int32array:");
|
|
439320
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439321
|
-
},
|
|
439322
|
-
_float32array: function(arr) {
|
|
439323
|
-
write2("float32array:");
|
|
439324
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439325
|
-
},
|
|
439326
|
-
_float64array: function(arr) {
|
|
439327
|
-
write2("float64array:");
|
|
439328
|
-
return this.dispatch(Array.prototype.slice.call(arr));
|
|
439329
|
-
},
|
|
439330
|
-
_arraybuffer: function(arr) {
|
|
439331
|
-
write2("arraybuffer:");
|
|
439332
|
-
return this.dispatch(new Uint8Array(arr));
|
|
439333
|
-
},
|
|
439334
|
-
_url: function(url) {
|
|
439335
|
-
return write2("url:" + url.toString(), "utf8");
|
|
439336
|
-
},
|
|
439337
|
-
_map: function(map12) {
|
|
439338
|
-
write2("map:");
|
|
439339
|
-
var arr = Array.from(map12);
|
|
439340
|
-
return this._array(arr, options2.unorderedSets !== false);
|
|
439341
|
-
},
|
|
439342
|
-
_set: function(set7) {
|
|
439343
|
-
write2("set:");
|
|
439344
|
-
var arr = Array.from(set7);
|
|
439345
|
-
return this._array(arr, options2.unorderedSets !== false);
|
|
439346
|
-
},
|
|
439347
|
-
_file: function(file) {
|
|
439348
|
-
write2("file:");
|
|
439349
|
-
return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
|
|
439350
|
-
},
|
|
439351
|
-
_blob: function() {
|
|
439352
|
-
if (options2.ignoreUnknown) {
|
|
439353
|
-
return write2("[blob]");
|
|
439354
|
-
}
|
|
439355
|
-
throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
|
|
439356
|
-
},
|
|
439357
|
-
_domwindow: function() {
|
|
439358
|
-
return write2("domwindow");
|
|
439359
|
-
},
|
|
439360
|
-
_bigint: function(number5) {
|
|
439361
|
-
return write2("bigint:" + number5.toString());
|
|
439362
|
-
},
|
|
439363
|
-
_process: function() {
|
|
439364
|
-
return write2("process");
|
|
439365
|
-
},
|
|
439366
|
-
_timer: function() {
|
|
439367
|
-
return write2("timer");
|
|
439368
|
-
},
|
|
439369
|
-
_pipe: function() {
|
|
439370
|
-
return write2("pipe");
|
|
439371
|
-
},
|
|
439372
|
-
_tcp: function() {
|
|
439373
|
-
return write2("tcp");
|
|
439374
|
-
},
|
|
439375
|
-
_udp: function() {
|
|
439376
|
-
return write2("udp");
|
|
439377
|
-
},
|
|
439378
|
-
_tty: function() {
|
|
439379
|
-
return write2("tty");
|
|
439380
|
-
},
|
|
439381
|
-
_statwatcher: function() {
|
|
439382
|
-
return write2("statwatcher");
|
|
439383
|
-
},
|
|
439384
|
-
_securecontext: function() {
|
|
439385
|
-
return write2("securecontext");
|
|
439386
|
-
},
|
|
439387
|
-
_connection: function() {
|
|
439388
|
-
return write2("connection");
|
|
439389
|
-
},
|
|
439390
|
-
_zlib: function() {
|
|
439391
|
-
return write2("zlib");
|
|
439392
|
-
},
|
|
439393
|
-
_context: function() {
|
|
439394
|
-
return write2("context");
|
|
439395
|
-
},
|
|
439396
|
-
_nodescript: function() {
|
|
439397
|
-
return write2("nodescript");
|
|
439398
|
-
},
|
|
439399
|
-
_httpparser: function() {
|
|
439400
|
-
return write2("httpparser");
|
|
439401
|
-
},
|
|
439402
|
-
_dataview: function() {
|
|
439403
|
-
return write2("dataview");
|
|
439404
|
-
},
|
|
439405
|
-
_signal: function() {
|
|
439406
|
-
return write2("signal");
|
|
439407
|
-
},
|
|
439408
|
-
_fsevent: function() {
|
|
439409
|
-
return write2("fsevent");
|
|
439410
|
-
},
|
|
439411
|
-
_tlswrap: function() {
|
|
439412
|
-
return write2("tlswrap");
|
|
439413
|
-
}
|
|
439414
|
-
};
|
|
439415
|
-
}
|
|
439416
|
-
function PassThrough2() {
|
|
439417
|
-
return {
|
|
439418
|
-
buf: "",
|
|
439419
|
-
write: function(b2) {
|
|
439420
|
-
this.buf += b2;
|
|
439421
|
-
},
|
|
439422
|
-
end: function(b2) {
|
|
439423
|
-
this.buf += b2;
|
|
439424
|
-
},
|
|
439425
|
-
read: function() {
|
|
439426
|
-
return this.buf;
|
|
439427
|
-
}
|
|
439428
|
-
};
|
|
439429
|
-
}
|
|
439430
|
-
}
|
|
439431
|
-
});
|
|
439432
|
-
|
|
439433
439433
|
// pnp:/home/runner/work/fern/fern/.yarn/cache/object-assign-npm-4.1.1-1004ad6dec-fcc6e4ea8c.zip/node_modules/object-assign/index.js
|
|
439434
439434
|
var require_object_assign = __commonJS({
|
|
439435
439435
|
"pnp:/home/runner/work/fern/fern/.yarn/cache/object-assign-npm-4.1.1-1004ad6dec-fcc6e4ea8c.zip/node_modules/object-assign/index.js"(exports2, module2) {
|
|
@@ -440735,12 +440735,12 @@ var require_debug5 = __commonJS({
|
|
|
440735
440735
|
exports2.formatters = {};
|
|
440736
440736
|
var prevTime;
|
|
440737
440737
|
function selectColor(namespace) {
|
|
440738
|
-
var
|
|
440738
|
+
var hash3 = 0, i2;
|
|
440739
440739
|
for (i2 in namespace) {
|
|
440740
|
-
|
|
440741
|
-
|
|
440740
|
+
hash3 = (hash3 << 5) - hash3 + namespace.charCodeAt(i2);
|
|
440741
|
+
hash3 |= 0;
|
|
440742
440742
|
}
|
|
440743
|
-
return exports2.colors[Math.abs(
|
|
440743
|
+
return exports2.colors[Math.abs(hash3) % exports2.colors.length];
|
|
440744
440744
|
}
|
|
440745
440745
|
function createDebug(namespace) {
|
|
440746
440746
|
function debug() {
|
|
@@ -444466,9 +444466,9 @@ var require_etag = __commonJS({
|
|
|
444466
444466
|
if (entity.length === 0) {
|
|
444467
444467
|
return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';
|
|
444468
444468
|
}
|
|
444469
|
-
var
|
|
444469
|
+
var hash3 = crypto.createHash("sha1").update(entity, "utf8").digest("base64").substring(0, 27);
|
|
444470
444470
|
var len = typeof entity === "string" ? Buffer.byteLength(entity, "utf8") : entity.length;
|
|
444471
|
-
return '"' + len.toString(16) + "-" +
|
|
444471
|
+
return '"' + len.toString(16) + "-" + hash3 + '"';
|
|
444472
444472
|
}
|
|
444473
444473
|
function etag(entity, options2) {
|
|
444474
444474
|
if (entity == null) {
|
|
@@ -459202,10 +459202,10 @@ var require_make_dir2 = __commonJS({
|
|
|
459202
459202
|
module2.exports = (input, opts) => Promise.resolve().then(() => {
|
|
459203
459203
|
checkPath(input);
|
|
459204
459204
|
opts = Object.assign({}, defaults3, opts);
|
|
459205
|
-
const
|
|
459205
|
+
const mkdir15 = pify(opts.fs.mkdir);
|
|
459206
459206
|
const stat3 = pify(opts.fs.stat);
|
|
459207
459207
|
const make = (pth) => {
|
|
459208
|
-
return
|
|
459208
|
+
return mkdir15(pth, opts.mode).then(() => pth).catch((err) => {
|
|
459209
459209
|
if (err.code === "ENOENT") {
|
|
459210
459210
|
if (err.message.includes("null bytes") || path44.dirname(pth) === pth) {
|
|
459211
459211
|
throw err;
|
|
@@ -1215398,7 +1215398,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1215398
1215398
|
properties: {
|
|
1215399
1215399
|
...event,
|
|
1215400
1215400
|
...event.properties,
|
|
1215401
|
-
version: "0.37.
|
|
1215401
|
+
version: "0.37.9",
|
|
1215402
1215402
|
usingAccessToken: true
|
|
1215403
1215403
|
}
|
|
1215404
1215404
|
});
|
|
@@ -1215460,7 +1215460,7 @@ var UserPosthogManager = class {
|
|
|
1215460
1215460
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1215461
1215461
|
event: "CLI",
|
|
1215462
1215462
|
properties: {
|
|
1215463
|
-
version: "0.37.
|
|
1215463
|
+
version: "0.37.9",
|
|
1215464
1215464
|
...event,
|
|
1215465
1215465
|
...event.properties
|
|
1215466
1215466
|
}
|
|
@@ -1217142,6 +1217142,9 @@ async function getValidAbsolutePathToOpenAPIFromFolder(context, absolutePathToOp
|
|
|
1217142
1217142
|
return absolutePathToOpenAPIFile;
|
|
1217143
1217143
|
}
|
|
1217144
1217144
|
|
|
1217145
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/workspace-loader/lib/workspaces/FernWorkspace.js
|
|
1217146
|
+
var import_object_hash = __toESM(require_object_hash());
|
|
1217147
|
+
|
|
1217145
1217148
|
// pnp:/home/runner/work/fern/fern/packages/cli/workspace-loader/lib/parseYamlFiles.js
|
|
1217146
1217149
|
async function parseYamlFiles(files) {
|
|
1217147
1217150
|
const parsedFiles = {};
|
|
@@ -1229484,8 +1229487,10 @@ function isRawMultipleBaseUrlsEnvironment(environment) {
|
|
|
1229484
1229487
|
var import_fiddle_sdk3 = __toESM(require_fiddle_sdk());
|
|
1229485
1229488
|
var import_axios3 = __toESM(require_axios4());
|
|
1229486
1229489
|
var import_fs3 = require("fs");
|
|
1229490
|
+
var import_promises26 = require("fs/promises");
|
|
1229491
|
+
var import_os3 = require("os");
|
|
1229487
1229492
|
var import_path18 = __toESM(require("path"));
|
|
1229488
|
-
var
|
|
1229493
|
+
var import_promises27 = require("stream/promises");
|
|
1229489
1229494
|
var import_tar = __toESM(require_tar());
|
|
1229490
1229495
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
1229491
1229496
|
var FIDDLE = createFiddleService();
|
|
@@ -1229531,6 +1229536,12 @@ async function loadDependency({ dependencyName, dependenciesConfiguration, conte
|
|
|
1229531
1229536
|
return { didSucceed: false, failure };
|
|
1229532
1229537
|
}
|
|
1229533
1229538
|
}
|
|
1229539
|
+
var DEPENDENCIES_FOLDER_NAME = "dependencies";
|
|
1229540
|
+
var METADATA_RESPONSE_FILENAME = "metadata.json";
|
|
1229541
|
+
var LOCAL_STORAGE_FOLDER3 = ".fern";
|
|
1229542
|
+
function getPathToLocalStorageDependency(dependency) {
|
|
1229543
|
+
return join(AbsoluteFilePath.of((0, import_os3.homedir)()), RelativeFilePath.of(LOCAL_STORAGE_FOLDER3), RelativeFilePath.of(DEPENDENCIES_FOLDER_NAME), RelativeFilePath.of(dependency.organization), RelativeFilePath.of(dependency.apiName), RelativeFilePath.of(dependency.version));
|
|
1229544
|
+
}
|
|
1229534
1229545
|
async function validateLocalDependencyAndGetDefinition({ dependency, context, cliVersion, settings }) {
|
|
1229535
1229546
|
context.logger.info("Parsing...");
|
|
1229536
1229547
|
const loadDependencyWorkspaceResult = await loadAPIWorkspace({
|
|
@@ -1229543,60 +1229554,72 @@ async function validateLocalDependencyAndGetDefinition({ dependency, context, cl
|
|
|
1229543
1229554
|
context.failWithoutThrowing("Failed to load api definition", loadDependencyWorkspaceResult.failures);
|
|
1229544
1229555
|
return void 0;
|
|
1229545
1229556
|
}
|
|
1229546
|
-
|
|
1229557
|
+
const definition3 = await loadDependencyWorkspaceResult.workspace.getDefinition({ context }, settings);
|
|
1229558
|
+
context.logger.info("Loaded...");
|
|
1229559
|
+
return definition3;
|
|
1229547
1229560
|
}
|
|
1229548
1229561
|
async function validateVersionedDependencyAndGetDefinition({ dependency, context, cliVersion, settings }) {
|
|
1229549
|
-
|
|
1229550
|
-
const
|
|
1229551
|
-
|
|
1229552
|
-
|
|
1229553
|
-
|
|
1229554
|
-
|
|
1229555
|
-
|
|
1229556
|
-
|
|
1229557
|
-
|
|
1229558
|
-
|
|
1229559
|
-
|
|
1229560
|
-
|
|
1229561
|
-
|
|
1229562
|
-
|
|
1229563
|
-
|
|
1229562
|
+
const pathToDependency = getPathToLocalStorageDependency(dependency);
|
|
1229563
|
+
const pathToDefinition = join(pathToDependency, RelativeFilePath.of(DEPENDENCIES_FOLDER_NAME));
|
|
1229564
|
+
const pathToMetadata = join(pathToDependency, RelativeFilePath.of(METADATA_RESPONSE_FILENAME));
|
|
1229565
|
+
let metadata;
|
|
1229566
|
+
if (!await doesPathExist(pathToDefinition) || !await doesPathExist(pathToMetadata)) {
|
|
1229567
|
+
context.logger.info("Downloading manifest...");
|
|
1229568
|
+
const response = await FIDDLE.definitionRegistry.get(import_fiddle_sdk3.FernFiddle.OrganizationId(dependency.organization), import_fiddle_sdk3.FernFiddle.ApiId(dependency.apiName), dependency.version);
|
|
1229569
|
+
if (!response.ok) {
|
|
1229570
|
+
response.error._visit({
|
|
1229571
|
+
orgDoesNotExistError: () => {
|
|
1229572
|
+
context.failWithoutThrowing("Organization does not exist");
|
|
1229573
|
+
},
|
|
1229574
|
+
apiDoesNotExistError: () => {
|
|
1229575
|
+
context.failWithoutThrowing("API does not exist");
|
|
1229576
|
+
},
|
|
1229577
|
+
versionDoesNotExistError: () => {
|
|
1229578
|
+
context.failWithoutThrowing("Version does not exist");
|
|
1229579
|
+
},
|
|
1229580
|
+
_other: (error) => {
|
|
1229581
|
+
context.failWithoutThrowing("Failed to download API manifest", error);
|
|
1229582
|
+
}
|
|
1229583
|
+
});
|
|
1229584
|
+
return void 0;
|
|
1229585
|
+
}
|
|
1229586
|
+
const parsedYamlVersionOfDependency = response.body.yamlSchemaVersion != null ? parseInt(response.body.yamlSchemaVersion) : void 0;
|
|
1229587
|
+
const parsedCliVersion = parseVersion(cliVersion);
|
|
1229588
|
+
const parsedCliVersionOfDependency = parseVersion(response.body.cliVersion);
|
|
1229589
|
+
if (parsedYamlVersionOfDependency != null) {
|
|
1229590
|
+
if (parsedYamlVersionOfDependency > YAML_SCHEMA_VERSION) {
|
|
1229591
|
+
context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a higher version of fern. Upgrade this workspace to ${response.body.cliVersion}`);
|
|
1229592
|
+
return void 0;
|
|
1229593
|
+
} else if (parsedYamlVersionOfDependency < YAML_SCHEMA_VERSION) {
|
|
1229594
|
+
context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a lower version of fern. Upgrade it to ${cliVersion}`);
|
|
1229595
|
+
return void 0;
|
|
1229564
1229596
|
}
|
|
1229565
|
-
})
|
|
1229566
|
-
|
|
1229567
|
-
}
|
|
1229568
|
-
const parsedYamlVersionOfDependency = response.body.yamlSchemaVersion != null ? parseInt(response.body.yamlSchemaVersion) : void 0;
|
|
1229569
|
-
const parsedCliVersion = parseVersion(cliVersion);
|
|
1229570
|
-
const parsedCliVersionOfDependency = parseVersion(response.body.cliVersion);
|
|
1229571
|
-
if (parsedYamlVersionOfDependency != null) {
|
|
1229572
|
-
if (parsedYamlVersionOfDependency > YAML_SCHEMA_VERSION) {
|
|
1229573
|
-
context.failWithoutThrowing(`${dependency.organization}/${dependency.apiName}@${dependency.version} on a higher version of fern. Upgrade this workspace to ${response.body.cliVersion}`);
|
|
1229597
|
+
} else if (parsedCliVersion.major !== parsedCliVersionOfDependency.major || parsedCliVersion.minor !== parsedCliVersionOfDependency.minor) {
|
|
1229598
|
+
context.failWithoutThrowing(`CLI version is ${response.body.cliVersion}. Expected ${parsedCliVersion.major}.${parsedCliVersion.minor}.x (to match current workspace).`);
|
|
1229574
1229599
|
return void 0;
|
|
1229575
|
-
}
|
|
1229576
|
-
|
|
1229600
|
+
}
|
|
1229601
|
+
context.logger.info("Downloading...");
|
|
1229602
|
+
context.logger.debug("Remote URL: " + response.body.definitionS3DownloadUrl);
|
|
1229603
|
+
await (0, import_promises26.mkdir)(pathToDefinition, { recursive: true });
|
|
1229604
|
+
try {
|
|
1229605
|
+
await downloadDependency({
|
|
1229606
|
+
s3PreSignedReadUrl: response.body.definitionS3DownloadUrl,
|
|
1229607
|
+
absolutePathToLocalOutput: pathToDefinition
|
|
1229608
|
+
});
|
|
1229609
|
+
} catch (error) {
|
|
1229610
|
+
context.failWithoutThrowing("Failed to download API", error);
|
|
1229577
1229611
|
return void 0;
|
|
1229578
1229612
|
}
|
|
1229579
|
-
|
|
1229580
|
-
|
|
1229581
|
-
|
|
1229582
|
-
|
|
1229583
|
-
context.logger.info("Downloading...");
|
|
1229584
|
-
const pathToDependency = AbsoluteFilePath.of((await import_tmp_promise2.default.dir()).path);
|
|
1229585
|
-
context.logger.debug("Remote URL: " + response.body.definitionS3DownloadUrl);
|
|
1229586
|
-
try {
|
|
1229587
|
-
await downloadDependency({
|
|
1229588
|
-
s3PreSignedReadUrl: response.body.definitionS3DownloadUrl,
|
|
1229589
|
-
absolutePathToLocalOutput: pathToDependency
|
|
1229590
|
-
});
|
|
1229591
|
-
} catch (error) {
|
|
1229592
|
-
context.failWithoutThrowing("Failed to download API", error);
|
|
1229593
|
-
return void 0;
|
|
1229613
|
+
metadata = response.body;
|
|
1229614
|
+
await (0, import_promises26.writeFile)(pathToMetadata, JSON.stringify(metadata));
|
|
1229615
|
+
} else {
|
|
1229616
|
+
metadata = JSON.parse((await (0, import_promises26.readFile)(pathToMetadata)).toString());
|
|
1229594
1229617
|
}
|
|
1229595
1229618
|
context.logger.info("Parsing...");
|
|
1229596
1229619
|
const loadDependencyWorkspaceResult = await loadAPIWorkspace({
|
|
1229597
|
-
absolutePathToWorkspace:
|
|
1229620
|
+
absolutePathToWorkspace: pathToDefinition,
|
|
1229598
1229621
|
context,
|
|
1229599
|
-
cliVersion:
|
|
1229622
|
+
cliVersion: metadata.cliVersion,
|
|
1229600
1229623
|
workspaceName: void 0
|
|
1229601
1229624
|
});
|
|
1229602
1229625
|
if (!loadDependencyWorkspaceResult.didSucceed) {
|
|
@@ -1229616,7 +1229639,7 @@ async function downloadDependency({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1229616
1229639
|
});
|
|
1229617
1229640
|
const tmpDir = await import_tmp_promise2.default.dir();
|
|
1229618
1229641
|
const outputTarPath = import_path18.default.join(tmpDir.path, "api.tgz");
|
|
1229619
|
-
await (0,
|
|
1229642
|
+
await (0, import_promises27.pipeline)(request.data, (0, import_fs3.createWriteStream)(outputTarPath));
|
|
1229620
1229643
|
await import_tar.default.extract({ file: outputTarPath, cwd: absolutePathToLocalOutput });
|
|
1229621
1229644
|
}
|
|
1229622
1229645
|
function stringifyDependency(dependency) {
|
|
@@ -1229802,7 +1229825,7 @@ var LazyFernWorkspace = class extends AbstractAPIWorkspace {
|
|
|
1229802
1229825
|
changelog;
|
|
1229803
1229826
|
context;
|
|
1229804
1229827
|
cliVersion;
|
|
1229805
|
-
|
|
1229828
|
+
fernWorkspaces = {};
|
|
1229806
1229829
|
constructor({ absoluteFilepath, workspaceName, generatorsConfiguration, changelog, cliVersion, context }) {
|
|
1229807
1229830
|
super();
|
|
1229808
1229831
|
this.absoluteFilepath = absoluteFilepath;
|
|
@@ -1229816,59 +1229839,57 @@ var LazyFernWorkspace = class extends AbstractAPIWorkspace {
|
|
|
1229816
1229839
|
return (await this.toFernWorkspace({ context }, settings)).definition;
|
|
1229817
1229840
|
}
|
|
1229818
1229841
|
async toFernWorkspace({ context }, settings) {
|
|
1229819
|
-
|
|
1229820
|
-
|
|
1229821
|
-
|
|
1229822
|
-
|
|
1229823
|
-
|
|
1229824
|
-
|
|
1229825
|
-
|
|
1229826
|
-
|
|
1229827
|
-
|
|
1229828
|
-
|
|
1229829
|
-
|
|
1229830
|
-
|
|
1229831
|
-
|
|
1229832
|
-
|
|
1229833
|
-
|
|
1229834
|
-
|
|
1229835
|
-
|
|
1229836
|
-
|
|
1229837
|
-
|
|
1229838
|
-
|
|
1229839
|
-
|
|
1229840
|
-
|
|
1229841
|
-
|
|
1229842
|
-
|
|
1229843
|
-
|
|
1229844
|
-
|
|
1229845
|
-
|
|
1229846
|
-
|
|
1229847
|
-
|
|
1229848
|
-
|
|
1229849
|
-
|
|
1229850
|
-
|
|
1229851
|
-
|
|
1229852
|
-
|
|
1229853
|
-
|
|
1229854
|
-
|
|
1229855
|
-
|
|
1229856
|
-
|
|
1229842
|
+
const key2 = (0, import_object_hash.default)(settings ?? {});
|
|
1229843
|
+
let workspace = this.fernWorkspaces[key2];
|
|
1229844
|
+
if (workspace == null) {
|
|
1229845
|
+
const defaultedContext = context || this.context;
|
|
1229846
|
+
const absolutePathToDefinition = join(this.absoluteFilepath, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
1229847
|
+
const dependenciesConfiguration = await dependencies_yml_exports.loadDependenciesConfiguration({
|
|
1229848
|
+
absolutePathToWorkspace: this.absoluteFilepath,
|
|
1229849
|
+
context: defaultedContext
|
|
1229850
|
+
});
|
|
1229851
|
+
const yamlFiles = await listFernFiles(absolutePathToDefinition, "{yml,yaml}");
|
|
1229852
|
+
const parseResult = await parseYamlFiles(yamlFiles);
|
|
1229853
|
+
if (!parseResult.didSucceed) {
|
|
1229854
|
+
handleFailedWorkspaceParserResultRaw(parseResult.failures, defaultedContext.logger);
|
|
1229855
|
+
return defaultedContext.failAndThrow();
|
|
1229856
|
+
}
|
|
1229857
|
+
const structuralValidationResult = validateStructureOfYamlFiles({
|
|
1229858
|
+
files: parseResult.files,
|
|
1229859
|
+
absolutePathToDefinition
|
|
1229860
|
+
});
|
|
1229861
|
+
if (!structuralValidationResult.didSucceed) {
|
|
1229862
|
+
handleFailedWorkspaceParserResultRaw(structuralValidationResult.failures, defaultedContext.logger);
|
|
1229863
|
+
return defaultedContext.failAndThrow();
|
|
1229864
|
+
}
|
|
1229865
|
+
const processPackageMarkersResult = await processPackageMarkers({
|
|
1229866
|
+
dependenciesConfiguration,
|
|
1229867
|
+
structuralValidationResult,
|
|
1229868
|
+
context: defaultedContext,
|
|
1229869
|
+
cliVersion: this.cliVersion,
|
|
1229870
|
+
settings
|
|
1229871
|
+
});
|
|
1229872
|
+
if (!processPackageMarkersResult.didSucceed) {
|
|
1229873
|
+
handleFailedWorkspaceParserResultRaw(processPackageMarkersResult.failures, defaultedContext.logger);
|
|
1229874
|
+
return defaultedContext.failAndThrow();
|
|
1229875
|
+
}
|
|
1229876
|
+
workspace = new FernWorkspace({
|
|
1229877
|
+
absoluteFilepath: this.absoluteFilepath,
|
|
1229878
|
+
generatorsConfiguration: this.generatorsConfiguration,
|
|
1229879
|
+
dependenciesConfiguration,
|
|
1229880
|
+
workspaceName: this.workspaceName,
|
|
1229881
|
+
definition: {
|
|
1229882
|
+
absoluteFilepath: absolutePathToDefinition,
|
|
1229883
|
+
rootApiFile: structuralValidationResult.rootApiFile,
|
|
1229884
|
+
namedDefinitionFiles: structuralValidationResult.namedDefinitionFiles,
|
|
1229885
|
+
packageMarkers: processPackageMarkersResult.packageMarkers,
|
|
1229886
|
+
importedDefinitions: processPackageMarkersResult.importedDefinitions
|
|
1229887
|
+
},
|
|
1229888
|
+
changelog: this.changelog
|
|
1229889
|
+
});
|
|
1229890
|
+
this.fernWorkspaces[key2] = workspace;
|
|
1229857
1229891
|
}
|
|
1229858
|
-
return
|
|
1229859
|
-
absoluteFilepath: this.absoluteFilepath,
|
|
1229860
|
-
generatorsConfiguration: this.generatorsConfiguration,
|
|
1229861
|
-
dependenciesConfiguration,
|
|
1229862
|
-
workspaceName: this.workspaceName,
|
|
1229863
|
-
definition: {
|
|
1229864
|
-
absoluteFilepath: absolutePathToDefinition,
|
|
1229865
|
-
rootApiFile: structuralValidationResult.rootApiFile,
|
|
1229866
|
-
namedDefinitionFiles: structuralValidationResult.namedDefinitionFiles,
|
|
1229867
|
-
packageMarkers: processPackageMarkersResult.packageMarkers,
|
|
1229868
|
-
importedDefinitions: processPackageMarkersResult.importedDefinitions
|
|
1229869
|
-
},
|
|
1229870
|
-
changelog: this.changelog
|
|
1229871
|
-
});
|
|
1229892
|
+
return workspace;
|
|
1229872
1229893
|
}
|
|
1229873
1229894
|
};
|
|
1229874
1229895
|
|
|
@@ -1230968,7 +1230989,7 @@ function buildPathParameter({ pathParameter, context, fileContainingReference })
|
|
|
1230968
1230989
|
}
|
|
1230969
1230990
|
|
|
1230970
1230991
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/parse.js
|
|
1230971
|
-
var
|
|
1230992
|
+
var import_promises29 = require("fs/promises");
|
|
1230972
1230993
|
|
|
1230973
1230994
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/getExtension.js
|
|
1230974
1230995
|
function getExtension(object4, extension3) {
|
|
@@ -1235524,11 +1235545,11 @@ var import_swagger_parser = __toESM(require_lib17());
|
|
|
1235524
1235545
|
var import_openapi_core = __toESM(require_lib19());
|
|
1235525
1235546
|
|
|
1235526
1235547
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/mergeWithOverrides.js
|
|
1235527
|
-
var
|
|
1235548
|
+
var import_promises28 = require("fs/promises");
|
|
1235528
1235549
|
async function mergeWithOverrides({ absoluteFilepathToOverrides, data: data2, context }) {
|
|
1235529
1235550
|
let parsedOverrides = null;
|
|
1235530
1235551
|
try {
|
|
1235531
|
-
const contents = (await (0,
|
|
1235552
|
+
const contents = (await (0, import_promises28.readFile)(absoluteFilepathToOverrides, "utf8")).toString();
|
|
1235532
1235553
|
try {
|
|
1235533
1235554
|
parsedOverrides = JSON.parse(contents);
|
|
1235534
1235555
|
} catch (err) {
|
|
@@ -1237880,7 +1237901,7 @@ async function parse4({ specs, taskContext, optionOverrides }) {
|
|
|
1237880
1237901
|
groups: {}
|
|
1237881
1237902
|
};
|
|
1237882
1237903
|
for (const spec of specs) {
|
|
1237883
|
-
const contents = (await (0,
|
|
1237904
|
+
const contents = (await (0, import_promises29.readFile)(spec.absoluteFilepath)).toString();
|
|
1237884
1237905
|
if (contents.includes("openapi") || contents.includes("swagger")) {
|
|
1237885
1237906
|
const openApiDocument = await loadOpenAPI({
|
|
1237886
1237907
|
absolutePathToOpenAPI: spec.absoluteFilepath,
|
|
@@ -1237979,7 +1238000,7 @@ function merge3(ir1, ir2) {
|
|
|
1237979
1238000
|
};
|
|
1237980
1238001
|
}
|
|
1237981
1238002
|
async function loadAsyncAPI({ absoluteFilePathToAsyncAPI, absoluteFilePathToAsyncAPIOverrides, context }) {
|
|
1237982
|
-
const contents = (await (0,
|
|
1238003
|
+
const contents = (await (0, import_promises29.readFile)(absoluteFilePathToAsyncAPI)).toString();
|
|
1237983
1238004
|
const parsed = await js_yaml_default.load(contents);
|
|
1237984
1238005
|
if (absoluteFilePathToAsyncAPIOverrides != null) {
|
|
1237985
1238006
|
return await mergeWithOverrides({
|
|
@@ -1240313,7 +1240334,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context, cliVersion,
|
|
|
1240313
1240334
|
}
|
|
1240314
1240335
|
|
|
1240315
1240336
|
// pnp:/home/runner/work/fern/fern/packages/cli/workspace-loader/lib/loadDocsWorkspace.js
|
|
1240316
|
-
var
|
|
1240337
|
+
var import_promises30 = require("fs/promises");
|
|
1240317
1240338
|
var import_path21 = __toESM(require("path"));
|
|
1240318
1240339
|
async function loadDocsWorkspace({ fernDirectory, context }) {
|
|
1240319
1240340
|
const docsConfigurationFile = join(fernDirectory, RelativeFilePath.of(DOCS_CONFIGURATION_FILENAME));
|
|
@@ -1240346,7 +1240367,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context })
|
|
|
1240346
1240367
|
});
|
|
1240347
1240368
|
}
|
|
1240348
1240369
|
async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context }) {
|
|
1240349
|
-
const contentsStr = await (0,
|
|
1240370
|
+
const contentsStr = await (0, import_promises30.readFile)(absolutePathOfConfiguration);
|
|
1240350
1240371
|
const contentsJson = js_yaml_default.load(contentsStr.toString());
|
|
1240351
1240372
|
return await validateSchema2({
|
|
1240352
1240373
|
value: contentsJson,
|
|
@@ -1240433,7 +1240454,7 @@ async function visitAllPackageMarkers(workspace, visitor) {
|
|
|
1240433
1240454
|
}
|
|
1240434
1240455
|
|
|
1240435
1240456
|
// pnp:/home/runner/work/fern/fern/packages/cli/project-loader/lib/loadProject.js
|
|
1240436
|
-
var
|
|
1240457
|
+
var import_promises31 = require("fs/promises");
|
|
1240437
1240458
|
async function loadProject({ cliName, cliVersion, commandLineApiWorkspace, defaultToAllApiWorkspaces, context, nameOverride }) {
|
|
1240438
1240459
|
const fernDirectory = await getFernDirectory(nameOverride);
|
|
1240439
1240460
|
if (fernDirectory == null) {
|
|
@@ -1240457,7 +1240478,7 @@ async function loadApis({ cliName, fernDirectory, context, cliVersion, commandLi
|
|
|
1240457
1240478
|
const apisDirectory = join(fernDirectory, RelativeFilePath.of(APIS_DIRECTORY));
|
|
1240458
1240479
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
1240459
1240480
|
if (apisDirectoryExists) {
|
|
1240460
|
-
const apiDirectoryContents = await (0,
|
|
1240481
|
+
const apiDirectoryContents = await (0, import_promises31.readdir)(apisDirectory, { withFileTypes: true });
|
|
1240461
1240482
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all5, item) => {
|
|
1240462
1240483
|
if (item.isDirectory()) {
|
|
1240463
1240484
|
all5.push(item.name);
|
|
@@ -1242212,7 +1242233,7 @@ var yargs_default = Yargs;
|
|
|
1242212
1242233
|
|
|
1242213
1242234
|
// pnp:/home/runner/work/fern/fern/packages/cli/init/src/utils/loadOpenApiFromUrl.ts
|
|
1242214
1242235
|
var import_axios4 = __toESM(require_axios4());
|
|
1242215
|
-
var
|
|
1242236
|
+
var import_promises32 = require("fs/promises");
|
|
1242216
1242237
|
var import_path27 = require("path");
|
|
1242217
1242238
|
var import_tmp_promise3 = __toESM(require_tmp_promise());
|
|
1242218
1242239
|
async function loadOpenAPIFromUrl({ url, logger }) {
|
|
@@ -1242224,7 +1242245,7 @@ async function loadOpenAPIFromUrl({ url, logger }) {
|
|
|
1242224
1242245
|
const filePath = (0, import_path27.join)(tmpDir.path, "openapi.yml");
|
|
1242225
1242246
|
logger.debug("tmpDir", tmpDir.path);
|
|
1242226
1242247
|
logger.debug("filePath", filePath);
|
|
1242227
|
-
await (0,
|
|
1242248
|
+
await (0, import_promises32.writeFile)(filePath, yamlData);
|
|
1242228
1242249
|
return {
|
|
1242229
1242250
|
status: "success" /* Success */,
|
|
1242230
1242251
|
filePath
|
|
@@ -1244396,10 +1244417,10 @@ var CliContext = class {
|
|
|
1244396
1244417
|
return "fern-api";
|
|
1244397
1244418
|
}
|
|
1244398
1244419
|
getPackageVersion() {
|
|
1244399
|
-
if ("0.37.
|
|
1244420
|
+
if ("0.37.9" == null) {
|
|
1244400
1244421
|
this.logger.error("CLI_VERSION is not defined");
|
|
1244401
1244422
|
}
|
|
1244402
|
-
return "0.37.
|
|
1244423
|
+
return "0.37.9";
|
|
1244403
1244424
|
}
|
|
1244404
1244425
|
getCliName() {
|
|
1244405
1244426
|
if ("fern" == null) {
|
|
@@ -1244572,7 +1244593,7 @@ function wrapWorkspaceNameForPrefix(workspaceName) {
|
|
|
1244572
1244593
|
}
|
|
1244573
1244594
|
|
|
1244574
1244595
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
1244575
|
-
var
|
|
1244596
|
+
var import_promises33 = require("fs/promises");
|
|
1244576
1244597
|
async function addGeneratorToWorkspaces({
|
|
1244577
1244598
|
project: { apiWorkspaces },
|
|
1244578
1244599
|
generatorName,
|
|
@@ -1244593,7 +1244614,7 @@ async function addGeneratorToWorkspaces({
|
|
|
1244593
1244614
|
groupName,
|
|
1244594
1244615
|
context
|
|
1244595
1244616
|
});
|
|
1244596
|
-
await (0,
|
|
1244617
|
+
await (0, import_promises33.writeFile)(
|
|
1244597
1244618
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1244598
1244619
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1244599
1244620
|
}),
|
|
@@ -1249227,13 +1249248,18 @@ function getReferencedTypesFromRawDeclaration({ typeDeclaration, file, typeResol
|
|
|
1249227
1249248
|
return types3;
|
|
1249228
1249249
|
},
|
|
1249229
1249250
|
discriminatedUnion: (unionDeclaration) => {
|
|
1249230
|
-
|
|
1249251
|
+
const types3 = [];
|
|
1249252
|
+
if (unionDeclaration["base-properties"] != null) {
|
|
1249253
|
+
types3.push(...Object.values(unionDeclaration["base-properties"]).map((property5) => typeof property5 === "string" ? property5 : property5.type));
|
|
1249254
|
+
}
|
|
1249255
|
+
types3.push(...Object.values(unionDeclaration.union).reduce((types4, singleUnionType) => {
|
|
1249231
1249256
|
const rawType = typeof singleUnionType === "string" ? singleUnionType : singleUnionType.type;
|
|
1249232
1249257
|
if (typeof rawType === "string") {
|
|
1249233
|
-
|
|
1249258
|
+
types4.push(rawType);
|
|
1249234
1249259
|
}
|
|
1249235
|
-
return
|
|
1249236
|
-
}, []);
|
|
1249260
|
+
return types4;
|
|
1249261
|
+
}, []));
|
|
1249262
|
+
return types3;
|
|
1249237
1249263
|
},
|
|
1249238
1249264
|
undiscriminatedUnion: (unionDeclaration) => {
|
|
1249239
1249265
|
return Object.values(unionDeclaration.union).reduce((types3, unionMember) => {
|
|
@@ -1249351,7 +1249377,7 @@ async function convertType({ typeDeclaration, file, typeResolver }) {
|
|
|
1249351
1249377
|
}
|
|
1249352
1249378
|
|
|
1249353
1249379
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/ir-generator/lib/examples/ExampleGenerator.js
|
|
1249354
|
-
var
|
|
1249380
|
+
var import_object_hash2 = __toESM(require_object_hash());
|
|
1249355
1249381
|
var ExampleGenerator = class {
|
|
1249356
1249382
|
ir;
|
|
1249357
1249383
|
userProvidedTypeExamples;
|
|
@@ -1249512,7 +1249538,7 @@ var ExampleGenerator = class {
|
|
|
1249512
1249538
|
};
|
|
1249513
1249539
|
return {
|
|
1249514
1249540
|
...exampleContent,
|
|
1249515
|
-
id: (0,
|
|
1249541
|
+
id: (0, import_object_hash2.default)(exampleContent)
|
|
1249516
1249542
|
};
|
|
1249517
1249543
|
});
|
|
1249518
1249544
|
if (successExamples.length === 0) {
|
|
@@ -1249525,7 +1249551,7 @@ var ExampleGenerator = class {
|
|
|
1249525
1249551
|
};
|
|
1249526
1249552
|
successExamples.push({
|
|
1249527
1249553
|
...exampleContent,
|
|
1249528
|
-
id: (0,
|
|
1249554
|
+
id: (0, import_object_hash2.default)(exampleContent)
|
|
1249529
1249555
|
});
|
|
1249530
1249556
|
}
|
|
1249531
1249557
|
const errorExamples = endpoint.errors.map((e) => {
|
|
@@ -1249535,7 +1249561,7 @@ var ExampleGenerator = class {
|
|
|
1249535
1249561
|
};
|
|
1249536
1249562
|
return {
|
|
1249537
1249563
|
...exampleContent,
|
|
1249538
|
-
id: (0,
|
|
1249564
|
+
id: (0, import_object_hash2.default)(exampleContent)
|
|
1249539
1249565
|
};
|
|
1249540
1249566
|
});
|
|
1249541
1249567
|
return [...successExamples, ...errorExamples];
|
|
@@ -1252257,7 +1252283,7 @@ function filterServiceTypeReferenceInfoForAudiences(serviceTypeReferenceInfo, fi
|
|
|
1252257
1252283
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/DocsDefinitionResolver.js
|
|
1252258
1252284
|
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
1252259
1252285
|
var import_utc3 = __toESM(require_utc());
|
|
1252260
|
-
var
|
|
1252286
|
+
var import_promises34 = require("fs/promises");
|
|
1252261
1252287
|
var import_gray_matter3 = __toESM(require_gray_matter());
|
|
1252262
1252288
|
|
|
1252263
1252289
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-resolver/lib/utils/isSubpackage.js
|
|
@@ -1254427,7 +1254453,7 @@ var DocsDefinitionResolver = class {
|
|
|
1254427
1254453
|
const jsFilePaths = /* @__PURE__ */ new Set();
|
|
1254428
1254454
|
await Promise.all(this._parsedDocsConfig.experimental.mdxComponents.map(async (filepath) => {
|
|
1254429
1254455
|
const absoluteFilePath = resolve(this.docsWorkspace.absoluteFilepath, filepath);
|
|
1254430
|
-
const stats = await (0,
|
|
1254456
|
+
const stats = await (0, import_promises34.stat)(absoluteFilePath);
|
|
1254431
1254457
|
if (stats.isDirectory()) {
|
|
1254432
1254458
|
const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx}");
|
|
1254433
1254459
|
files.forEach((file) => {
|
|
@@ -1254439,7 +1254465,7 @@ var DocsDefinitionResolver = class {
|
|
|
1254439
1254465
|
}));
|
|
1254440
1254466
|
jsFiles = Object.fromEntries(await Promise.all([...jsFilePaths].map(async (filePath) => {
|
|
1254441
1254467
|
const relativeFilePath = this.toRelativeFilepath(filePath);
|
|
1254442
|
-
const contents = (await (0,
|
|
1254468
|
+
const contents = (await (0, import_promises34.readFile)(filePath)).toString();
|
|
1254443
1254469
|
return [relativeFilePath, contents];
|
|
1254444
1254470
|
})));
|
|
1254445
1254471
|
}
|
|
@@ -1256511,24 +1256537,24 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
1256511
1256537
|
// pnp:/home/runner/work/fern/fern/packages/cli/docs-preview/lib/downloadLocalDocsBundle.js
|
|
1256512
1256538
|
var import_decompress = __toESM(require_decompress());
|
|
1256513
1256539
|
var import_fs8 = require("fs");
|
|
1256514
|
-
var
|
|
1256515
|
-
var
|
|
1256540
|
+
var import_promises35 = require("fs/promises");
|
|
1256541
|
+
var import_os4 = require("os");
|
|
1256516
1256542
|
var import_path29 = __toESM(require("path"));
|
|
1256517
|
-
var
|
|
1256543
|
+
var import_promises36 = require("stream/promises");
|
|
1256518
1256544
|
var import_tmp_promise4 = __toESM(require_tmp_promise());
|
|
1256519
1256545
|
var import_xml2js = __toESM(require_xml2js());
|
|
1256520
1256546
|
var ETAG_FILENAME = "etag";
|
|
1256521
1256547
|
var PREVIEW_FOLDER_NAME = "preview";
|
|
1256522
1256548
|
var BUNDLE_FOLDER_NAME = "bundle";
|
|
1256523
|
-
var
|
|
1256549
|
+
var LOCAL_STORAGE_FOLDER4 = ".fern";
|
|
1256524
1256550
|
function getPathToPreviewFolder() {
|
|
1256525
|
-
return join(AbsoluteFilePath.of((0,
|
|
1256551
|
+
return join(AbsoluteFilePath.of((0, import_os4.homedir)()), RelativeFilePath.of(LOCAL_STORAGE_FOLDER4), RelativeFilePath.of(PREVIEW_FOLDER_NAME));
|
|
1256526
1256552
|
}
|
|
1256527
1256553
|
function getPathToBundleFolder() {
|
|
1256528
|
-
return join(AbsoluteFilePath.of((0,
|
|
1256554
|
+
return join(AbsoluteFilePath.of((0, import_os4.homedir)()), RelativeFilePath.of(LOCAL_STORAGE_FOLDER4), RelativeFilePath.of(PREVIEW_FOLDER_NAME), RelativeFilePath.of(BUNDLE_FOLDER_NAME));
|
|
1256529
1256555
|
}
|
|
1256530
1256556
|
function getPathToEtagFile() {
|
|
1256531
|
-
return join(AbsoluteFilePath.of((0,
|
|
1256557
|
+
return join(AbsoluteFilePath.of((0, import_os4.homedir)()), RelativeFilePath.of(LOCAL_STORAGE_FOLDER4), RelativeFilePath.of(PREVIEW_FOLDER_NAME), RelativeFilePath.of(ETAG_FILENAME));
|
|
1256532
1256558
|
}
|
|
1256533
1256559
|
async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
1256534
1256560
|
var _a5, _b4, _c4, _d2, _e, _f, _g, _h;
|
|
@@ -1256545,7 +1256571,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1256545
1256571
|
let currentETag = void 0;
|
|
1256546
1256572
|
if (currentETagExists) {
|
|
1256547
1256573
|
logger.debug("Reading existing ETag");
|
|
1256548
|
-
currentETag = (await (0,
|
|
1256574
|
+
currentETag = (await (0, import_promises35.readFile)(eTagFilepath)).toString();
|
|
1256549
1256575
|
}
|
|
1256550
1256576
|
if (currentETag != null && currentETag === eTag) {
|
|
1256551
1256577
|
logger.debug("ETag matches. Using already downloaded bundle");
|
|
@@ -1256567,18 +1256593,18 @@ async function downloadBundle({ bucketUrl, logger, preferCached }) {
|
|
|
1256567
1256593
|
type: "failure"
|
|
1256568
1256594
|
};
|
|
1256569
1256595
|
}
|
|
1256570
|
-
await (0,
|
|
1256596
|
+
await (0, import_promises36.pipeline)(contents, (0, import_fs8.createWriteStream)(outputZipPath));
|
|
1256571
1256597
|
logger.debug(`Wrote output.zip to ${outputZipPath}`);
|
|
1256572
1256598
|
const absolutePathToPreviewFolder = getPathToPreviewFolder();
|
|
1256573
1256599
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1256574
|
-
await (0,
|
|
1256600
|
+
await (0, import_promises35.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1256575
1256601
|
}
|
|
1256576
|
-
await (0,
|
|
1256602
|
+
await (0, import_promises35.mkdir)(absolutePathToPreviewFolder, { recursive: true });
|
|
1256577
1256603
|
logger.debug(`rm -rf ${absolutePathToPreviewFolder}`);
|
|
1256578
1256604
|
const absolutePathToBundleFolder = getPathToBundleFolder();
|
|
1256579
|
-
await (0,
|
|
1256605
|
+
await (0, import_promises35.mkdir)(absolutePathToBundleFolder, { recursive: true });
|
|
1256580
1256606
|
await (0, import_decompress.default)(outputZipPath, absolutePathToBundleFolder);
|
|
1256581
|
-
await (0,
|
|
1256607
|
+
await (0, import_promises35.writeFile)(eTagFilepath, eTag);
|
|
1256582
1256608
|
logger.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
|
|
1256583
1256609
|
return {
|
|
1256584
1256610
|
type: "success"
|
|
@@ -1279093,7 +1279119,7 @@ function matter2(file, options2 = {}) {
|
|
|
1279093
1279119
|
}
|
|
1279094
1279120
|
|
|
1279095
1279121
|
// pnp:/home/runner/work/fern/fern/.yarn/__virtual__/next-mdx-remote-virtual-2f161f396c/0/cache/next-mdx-remote-npm-4.4.1-2a17ed923a-95cd77d03a.zip/node_modules/next-mdx-remote/dist/serialize.js
|
|
1279096
|
-
var
|
|
1279122
|
+
var import_os5 = __toESM(require("os"));
|
|
1279097
1279123
|
var lib$2 = {};
|
|
1279098
1279124
|
var lib$1 = {};
|
|
1279099
1279125
|
var jsTokens = {};
|
|
@@ -1280412,7 +1280438,7 @@ var hasFlag$1 = (flag, argv) => {
|
|
|
1280412
1280438
|
const terminatorPos = argv.indexOf("--");
|
|
1280413
1280439
|
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
|
|
1280414
1280440
|
};
|
|
1280415
|
-
var os5 =
|
|
1280441
|
+
var os5 = import_os5.default;
|
|
1280416
1280442
|
var hasFlag3 = hasFlag$1;
|
|
1280417
1280443
|
var env4 = process.env;
|
|
1280418
1280444
|
var forceColor;
|
|
@@ -1285896,7 +1285922,7 @@ var supportedExtensions = new Set(extensions);
|
|
|
1285896
1285922
|
var supportedMimeTypes = new Set(mimeTypes);
|
|
1285897
1285923
|
|
|
1285898
1285924
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/docs-validator/lib/rules/valid-file-types/valid-file-types.js
|
|
1285899
|
-
var
|
|
1285925
|
+
var import_promises37 = require("fs/promises");
|
|
1285900
1285926
|
var import_path34 = __toESM(require("path"));
|
|
1285901
1285927
|
var ALLOWED_FILE_TYPES = /* @__PURE__ */ new Set([
|
|
1285902
1285928
|
"image/jpeg",
|
|
@@ -1285973,7 +1285999,7 @@ var ValidFileTypes = {
|
|
|
1285973
1285999
|
}
|
|
1285974
1286000
|
};
|
|
1285975
1286001
|
var getViolationsForFile = async (absoluteFilepath) => {
|
|
1285976
|
-
const file = await (0,
|
|
1286002
|
+
const file = await (0, import_promises37.readFile)(absoluteFilepath);
|
|
1285977
1286003
|
const fileType = await fileTypeFromBuffer(file);
|
|
1285978
1286004
|
if (fileType != null) {
|
|
1285979
1286005
|
if (ALLOWED_FILE_TYPES.has(fileType.mime)) {
|
|
@@ -1286164,7 +1286190,7 @@ async function formatWorkspaces({
|
|
|
1286164
1286190
|
}
|
|
1286165
1286191
|
|
|
1286166
1286192
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
1286167
|
-
var
|
|
1286193
|
+
var import_promises38 = require("fs/promises");
|
|
1286168
1286194
|
var import_path35 = __toESM(require("path"));
|
|
1286169
1286195
|
|
|
1286170
1286196
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-ir/generateIrForFernWorkspace.ts
|
|
@@ -1286216,7 +1286242,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
1286216
1286242
|
snippetsConfig: {}
|
|
1286217
1286243
|
});
|
|
1286218
1286244
|
const resolvedOutputFilePath = import_path35.default.resolve(outputFilepath);
|
|
1286219
|
-
await (0,
|
|
1286245
|
+
await (0, import_promises38.writeFile)(resolvedOutputFilePath, await stringifyLargeObject(apiDefinition, { pretty: true }));
|
|
1286220
1286246
|
context.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
1286221
1286247
|
});
|
|
1286222
1286248
|
})
|
|
@@ -1296729,7 +1296755,7 @@ function migrateIntermediateRepresentationThroughVersion({ intermediateRepresent
|
|
|
1296729
1296755
|
}
|
|
1296730
1296756
|
|
|
1296731
1296757
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-ir/generateIrForWorkspaces.ts
|
|
1296732
|
-
var
|
|
1296758
|
+
var import_promises39 = require("fs/promises");
|
|
1296733
1296759
|
var import_path36 = __toESM(require("path"));
|
|
1296734
1296760
|
async function generateIrForWorkspaces({
|
|
1296735
1296761
|
project,
|
|
@@ -1296759,7 +1296785,7 @@ async function generateIrForWorkspaces({
|
|
|
1296759
1296785
|
readme
|
|
1296760
1296786
|
});
|
|
1296761
1296787
|
const irOutputFilePath = import_path36.default.resolve(irFilepath);
|
|
1296762
|
-
await (0,
|
|
1296788
|
+
await (0, import_promises39.writeFile)(
|
|
1296763
1296789
|
irOutputFilePath,
|
|
1296764
1296790
|
await stringifyLargeObject(intermediateRepresentation, { pretty: true })
|
|
1296765
1296791
|
);
|
|
@@ -1296802,7 +1296828,7 @@ async function getIntermediateRepresentation({
|
|
|
1296802
1296828
|
}
|
|
1296803
1296829
|
|
|
1296804
1296830
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-openapi-ir/generateOpenAPIIrForWorkspaces.ts
|
|
1296805
|
-
var
|
|
1296831
|
+
var import_promises40 = require("fs/promises");
|
|
1296806
1296832
|
var import_path37 = __toESM(require("path"));
|
|
1296807
1296833
|
async function generateOpenAPIIrForWorkspaces({
|
|
1296808
1296834
|
project,
|
|
@@ -1296825,7 +1296851,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1296825
1296851
|
const openApiIrJson = await serialization_exports3.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
1296826
1296852
|
skipValidation: true
|
|
1296827
1296853
|
});
|
|
1296828
|
-
await (0,
|
|
1296854
|
+
await (0, import_promises40.writeFile)(irOutputFilePath, await stringifyLargeObject(openApiIrJson, { pretty: true }));
|
|
1296829
1296855
|
context.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
1296830
1296856
|
});
|
|
1296831
1296857
|
})
|
|
@@ -1296833,7 +1296859,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1296833
1296859
|
}
|
|
1296834
1296860
|
|
|
1296835
1296861
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
1296836
|
-
var
|
|
1296862
|
+
var import_promises41 = require("fs/promises");
|
|
1296837
1296863
|
async function writeOverridesForWorkspaces({
|
|
1296838
1296864
|
project,
|
|
1296839
1296865
|
includeModels,
|
|
@@ -1296858,7 +1296884,7 @@ async function writeOverridesForWorkspaces({
|
|
|
1296858
1296884
|
async function readExistingOverrides(overridesFilepath, context) {
|
|
1296859
1296885
|
let parsedOverrides = null;
|
|
1296860
1296886
|
try {
|
|
1296861
|
-
const contents = (await (0,
|
|
1296887
|
+
const contents = (await (0, import_promises41.readFile)(overridesFilepath, "utf8")).toString();
|
|
1296862
1296888
|
try {
|
|
1296863
1296889
|
parsedOverrides = JSON.parse(contents);
|
|
1296864
1296890
|
} catch (err) {
|
|
@@ -1296914,7 +1296940,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
1296914
1296940
|
}
|
|
1296915
1296941
|
}
|
|
1296916
1296942
|
const components = { schemas };
|
|
1296917
|
-
await (0,
|
|
1296943
|
+
await (0, import_promises41.writeFile)(
|
|
1296918
1296944
|
join(dirname(spec.absoluteFilepath), RelativeFilePath.of("openapi-overrides.yml")),
|
|
1296919
1296945
|
js_yaml_default.dump({ paths, components })
|
|
1296920
1296946
|
);
|
|
@@ -1297180,7 +1297206,7 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1297180
1297206
|
|
|
1297181
1297207
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/docker-utils/lib/runDocker.js
|
|
1297182
1297208
|
var import_dockerode2 = __toESM(require_docker());
|
|
1297183
|
-
var
|
|
1297209
|
+
var import_promises42 = require("fs/promises");
|
|
1297184
1297210
|
var import_stream4 = require("stream");
|
|
1297185
1297211
|
var import_tmp_promise5 = __toESM(require_tmp_promise());
|
|
1297186
1297212
|
async function runDocker({ imageName, args, binds, writeLogsToFile = true, removeAfterCompletion = false }) {
|
|
@@ -1297217,7 +1297243,7 @@ async function tryRunDocker({ docker, imageName, args, binds, removeAfterComplet
|
|
|
1297217
1297243
|
if (status.StatusCode !== 0) {
|
|
1297218
1297244
|
if (writeLogsToFile) {
|
|
1297219
1297245
|
const tmpFile = await import_tmp_promise5.default.file();
|
|
1297220
|
-
await (0,
|
|
1297246
|
+
await (0, import_promises42.writeFile)(tmpFile.path, logs);
|
|
1297221
1297247
|
throw new Error(`Docker exited with a non-zero exit code. Logs here: ${tmpFile.path}`);
|
|
1297222
1297248
|
} else {
|
|
1297223
1297249
|
throw new Error("Docker exited with a non-zero exit code.");
|
|
@@ -1297239,7 +1297265,7 @@ async function pullImage(docker, imageName) {
|
|
|
1297239
1297265
|
|
|
1297240
1297266
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/runGenerator.js
|
|
1297241
1297267
|
var FernGeneratorExecParsing = __toESM(require_serialization33());
|
|
1297242
|
-
var
|
|
1297268
|
+
var import_promises44 = require("fs/promises");
|
|
1297243
1297269
|
var import_tmp_promise7 = __toESM(require_tmp_promise());
|
|
1297244
1297270
|
|
|
1297245
1297271
|
// pnp:/home/runner/work/fern/fern/packages/commons/logging-execa/lib/loggingExeca.js
|
|
@@ -1297265,7 +1297291,7 @@ async function loggingExeca(logger, executable, args = [], { doNotPipeOutput = f
|
|
|
1297265
1297291
|
|
|
1297266
1297292
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/LocalTaskHandler.js
|
|
1297267
1297293
|
var import_decompress2 = __toESM(require_decompress());
|
|
1297268
|
-
var
|
|
1297294
|
+
var import_promises43 = require("fs/promises");
|
|
1297269
1297295
|
var import_tmp_promise6 = __toESM(require_tmp_promise());
|
|
1297270
1297296
|
var LocalTaskHandler = class {
|
|
1297271
1297297
|
context;
|
|
@@ -1297311,7 +1297337,7 @@ var LocalTaskHandler = class {
|
|
|
1297311
1297337
|
const tmpOutputResolutionDir = AbsoluteFilePath.of((await import_tmp_promise6.default.dir({})).path);
|
|
1297312
1297338
|
const absolutePathToFernignore = AbsoluteFilePath.of(join(this.absolutePathToLocalOutput, RelativeFilePath.of(FERNIGNORE_FILENAME)));
|
|
1297313
1297339
|
const fernIngnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1297314
|
-
await (0,
|
|
1297340
|
+
await (0, import_promises43.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1297315
1297341
|
await this.runGitCommand(["init"], tmpOutputResolutionDir);
|
|
1297316
1297342
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1297317
1297343
|
const response = await this.runGitCommand(["config", "--list"], tmpOutputResolutionDir);
|
|
@@ -1297324,16 +1297350,16 @@ var LocalTaskHandler = class {
|
|
|
1297324
1297350
|
await this.copyGeneratedFilesToDirectory(tmpOutputResolutionDir);
|
|
1297325
1297351
|
await this.runGitCommand(["reset", "--", ...fernIngnorePaths], tmpOutputResolutionDir);
|
|
1297326
1297352
|
await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
1297327
|
-
await (0,
|
|
1297328
|
-
await (0,
|
|
1297353
|
+
await (0, import_promises43.rmdir)(this.absolutePathToLocalOutput, { recursive: true });
|
|
1297354
|
+
await (0, import_promises43.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
|
|
1297329
1297355
|
}
|
|
1297330
1297356
|
async copyGeneratedFilesNoFernIgnore() {
|
|
1297331
1297357
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
1297332
|
-
await (0,
|
|
1297358
|
+
await (0, import_promises43.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
1297333
1297359
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
1297334
1297360
|
}
|
|
1297335
1297361
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
1297336
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
1297362
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises43.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
1297337
1297363
|
if (firstLocalOutputItem == null) {
|
|
1297338
1297364
|
return;
|
|
1297339
1297365
|
}
|
|
@@ -1297341,15 +1297367,15 @@ var LocalTaskHandler = class {
|
|
|
1297341
1297367
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
1297342
1297368
|
await (0, import_decompress2.default)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(firstLocalOutputItem)), outputPath);
|
|
1297343
1297369
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
1297344
|
-
await (0,
|
|
1297370
|
+
await (0, import_promises43.cp)(join(this.absolutePathToTmpOutputDirectory, RelativeFilePath.of(localOutputItem)), join(outputPath, RelativeFilePath.of(localOutputItem)), { recursive: true });
|
|
1297345
1297371
|
}
|
|
1297346
1297372
|
} else {
|
|
1297347
|
-
await (0,
|
|
1297373
|
+
await (0, import_promises43.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
|
|
1297348
1297374
|
}
|
|
1297349
1297375
|
}
|
|
1297350
1297376
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
1297351
1297377
|
this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
|
|
1297352
|
-
await (0,
|
|
1297378
|
+
await (0, import_promises43.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
|
|
1297353
1297379
|
}
|
|
1297354
1297380
|
async runGitCommand(options2, cwd2) {
|
|
1297355
1297381
|
const response = await loggingExeca(this.context.logger, "git", options2, {
|
|
@@ -1297361,7 +1297387,7 @@ var LocalTaskHandler = class {
|
|
|
1297361
1297387
|
};
|
|
1297362
1297388
|
var NEW_LINE_REGEX = /\r?\n/;
|
|
1297363
1297389
|
async function getFernIgnorePaths({ absolutePathToFernignore }) {
|
|
1297364
|
-
const fernIgnoreFileContents = (await (0,
|
|
1297390
|
+
const fernIgnoreFileContents = (await (0, import_promises43.readFile)(absolutePathToFernignore)).toString();
|
|
1297365
1297391
|
return [
|
|
1297366
1297392
|
FERNIGNORE_FILENAME,
|
|
1297367
1297393
|
...fernIgnoreFileContents.trim().split(NEW_LINE_REGEX).filter((line) => !line.startsWith("#") && line.length > 0)
|
|
@@ -1297450,7 +1297476,7 @@ async function writeIrToFile({ workspace, audiences, generatorInvocation, worksp
|
|
|
1297450
1297476
|
tmpdir: workspaceTempDir.path
|
|
1297451
1297477
|
});
|
|
1297452
1297478
|
const absolutePathToIr = AbsoluteFilePath.of(irFile.path);
|
|
1297453
|
-
await (0,
|
|
1297479
|
+
await (0, import_promises44.writeFile)(absolutePathToIr, JSON.stringify(intermediateRepresentation, void 0, 4));
|
|
1297454
1297480
|
context.logger.debug(`Wrote IR to ${absolutePathToIr}`);
|
|
1297455
1297481
|
return absolutePathToIr;
|
|
1297456
1297482
|
}
|
|
@@ -1297479,7 +1297505,7 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
|
|
|
1297479
1297505
|
if (!parsedConfig.ok) {
|
|
1297480
1297506
|
throw new Error(`Failed to parse config.json into ${absolutePathToWriteConfigJson}`);
|
|
1297481
1297507
|
}
|
|
1297482
|
-
await (0,
|
|
1297508
|
+
await (0, import_promises44.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(parsedConfig.value, void 0, 4));
|
|
1297483
1297509
|
const doesConfigJsonExist = await waitUntilPathExists(absolutePathToWriteConfigJson, 5e3);
|
|
1297484
1297510
|
if (!doesConfigJsonExist) {
|
|
1297485
1297511
|
throw new Error(`Failed to create ${absolutePathToWriteConfigJson}`);
|
|
@@ -1297493,7 +1297519,7 @@ async function runGenerator({ workspaceName, organization, outputVersion, absolu
|
|
|
1297493
1297519
|
}
|
|
1297494
1297520
|
|
|
1297495
1297521
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/local-generation/local-workspace-runner/lib/runLocalGenerationForWorkspace.js
|
|
1297496
|
-
var
|
|
1297522
|
+
var import_os6 = __toESM(require("os"));
|
|
1297497
1297523
|
var import_path39 = __toESM(require("path"));
|
|
1297498
1297524
|
var import_tmp_promise8 = __toESM(require_tmp_promise());
|
|
1297499
1297525
|
async function runLocalGenerationForWorkspace({ projectConfig, workspace, generatorGroup, keepDocker, context }) {
|
|
@@ -1297537,7 +1297563,7 @@ async function runLocalGenerationForWorkspace({ projectConfig, workspace, genera
|
|
|
1297537
1297563
|
}
|
|
1297538
1297564
|
async function getWorkspaceTempDir() {
|
|
1297539
1297565
|
return import_tmp_promise8.default.dir({
|
|
1297540
|
-
tmpdir:
|
|
1297566
|
+
tmpdir: import_os6.default.platform() === "darwin" ? import_path39.default.join("/private", import_os6.default.tmpdir()) : void 0,
|
|
1297541
1297567
|
prefix: "fern"
|
|
1297542
1297568
|
});
|
|
1297543
1297569
|
}
|
|
@@ -1297548,8 +1297574,8 @@ var import_fiddle_sdk5 = __toESM(require_fiddle_sdk());
|
|
|
1297548
1297574
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
1297549
1297575
|
var import_axios5 = __toESM(require_axios4());
|
|
1297550
1297576
|
var import_fs9 = require("fs");
|
|
1297551
|
-
var
|
|
1297552
|
-
var
|
|
1297577
|
+
var import_promises45 = require("fs/promises");
|
|
1297578
|
+
var import_promises46 = require("stream/promises");
|
|
1297553
1297579
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context }) {
|
|
1297554
1297580
|
try {
|
|
1297555
1297581
|
await downloadFileForTask({
|
|
@@ -1297566,17 +1297592,17 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
1297566
1297592
|
responseType: "stream"
|
|
1297567
1297593
|
});
|
|
1297568
1297594
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1297569
|
-
await (0,
|
|
1297595
|
+
await (0, import_promises45.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1297570
1297596
|
}
|
|
1297571
|
-
await (0,
|
|
1297572
|
-
await (0,
|
|
1297597
|
+
await (0, import_promises45.mkdir)(dirname(absolutePathToLocalOutput), { recursive: true });
|
|
1297598
|
+
await (0, import_promises46.pipeline)(request.data, (0, import_fs9.createWriteStream)(absolutePathToLocalOutput));
|
|
1297573
1297599
|
}
|
|
1297574
1297600
|
|
|
1297575
1297601
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
1297576
1297602
|
var import_fiddle_sdk4 = __toESM(require_fiddle_sdk());
|
|
1297577
1297603
|
var import_axios6 = __toESM(require_axios4());
|
|
1297578
1297604
|
var import_form_data2 = __toESM(require_form_data());
|
|
1297579
|
-
var
|
|
1297605
|
+
var import_promises47 = require("fs/promises");
|
|
1297580
1297606
|
var import_tar2 = __toESM(require_tar());
|
|
1297581
1297607
|
var import_tmp_promise9 = __toESM(require_tmp_promise());
|
|
1297582
1297608
|
|
|
@@ -1297642,15 +1297668,15 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1297642
1297668
|
context.logger.debug(`Writing mock fern definition to ${absolutePathToTmpDir}`);
|
|
1297643
1297669
|
const absolutePathToTmpFernDirectory = join(absolutePathToTmpDir, RelativeFilePath.of(FERN_DIRECTORY));
|
|
1297644
1297670
|
const absolutePathToTmpDefinitionDirectory = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(DEFINITION_DIRECTORY));
|
|
1297645
|
-
await (0,
|
|
1297671
|
+
await (0, import_promises47.mkdir)(absolutePathToTmpDefinitionDirectory, { recursive: true });
|
|
1297646
1297672
|
const absolutePathToApiYml = join(absolutePathToTmpDefinitionDirectory, RelativeFilePath.of(ROOT_API_FILENAME));
|
|
1297647
|
-
await (0,
|
|
1297673
|
+
await (0, import_promises47.writeFile)(absolutePathToApiYml, js_yaml_default.dump(workspace.definition.rootApiFile.contents));
|
|
1297648
1297674
|
await writeFernDefinition({
|
|
1297649
1297675
|
absolutePathToDefinitionDirectory: absolutePathToTmpDefinitionDirectory,
|
|
1297650
1297676
|
definition: workspace.definition
|
|
1297651
1297677
|
});
|
|
1297652
1297678
|
const absolutePathToFernConfigJson = join(absolutePathToTmpFernDirectory, RelativeFilePath.of(PROJECT_CONFIG_FILENAME));
|
|
1297653
|
-
await (0,
|
|
1297679
|
+
await (0, import_promises47.writeFile)(absolutePathToFernConfigJson, JSON.stringify(projectConfig.rawConfig, void 0, 2));
|
|
1297654
1297680
|
const tarPath = join(absolutePathToTmpDir, RelativeFilePath.of("definition.tgz"));
|
|
1297655
1297681
|
await import_tar2.default.create({ file: tarPath, cwd: absolutePathToTmpFernDirectory }, ["."]);
|
|
1297656
1297682
|
context.logger.debug("Getting upload URL for Fern definition.");
|
|
@@ -1297669,7 +1297695,7 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1297669
1297695
|
}
|
|
1297670
1297696
|
} else {
|
|
1297671
1297697
|
context.logger.debug("Uploading definition...");
|
|
1297672
|
-
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0,
|
|
1297698
|
+
await import_axios6.default.put(definitionUploadUrlRequest.body.s3Url, await (0, import_promises47.readFile)(tarPath));
|
|
1297673
1297699
|
fernDefinitionMetadata = {
|
|
1297674
1297700
|
definitionS3DownloadUrl: definitionUploadUrlRequest.body.s3Url,
|
|
1297675
1297701
|
outputPath: ".mock",
|
|
@@ -1297731,14 +1297757,14 @@ async function createJob({ projectConfig, workspace, organization, generatorInvo
|
|
|
1297731
1297757
|
async function writeFernDefinition({ absolutePathToDefinitionDirectory, definition: definition3 }) {
|
|
1297732
1297758
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1297733
1297759
|
const absolutePathToDefinitionFile = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1297734
|
-
await (0,
|
|
1297735
|
-
await (0,
|
|
1297760
|
+
await (0, import_promises47.mkdir)(dirname(absolutePathToDefinitionFile), { recursive: true });
|
|
1297761
|
+
await (0, import_promises47.writeFile)(absolutePathToDefinitionFile, js_yaml_default.dump(definitionFile.contents));
|
|
1297736
1297762
|
}
|
|
1297737
1297763
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1297738
1297764
|
if (packageMarker.contents.export == null) {
|
|
1297739
1297765
|
const absolutePathToPackageMarker = join(absolutePathToDefinitionDirectory, RelativeFilePath.of(relativePath));
|
|
1297740
|
-
await (0,
|
|
1297741
|
-
await (0,
|
|
1297766
|
+
await (0, import_promises47.mkdir)(dirname(absolutePathToPackageMarker), { recursive: true });
|
|
1297767
|
+
await (0, import_promises47.writeFile)(absolutePathToPackageMarker, js_yaml_default.dump(packageMarker.contents));
|
|
1297742
1297768
|
}
|
|
1297743
1297769
|
}
|
|
1297744
1297770
|
for (const [relativePath, importedDefinition] of Object.entries(definition3.importedDefinitions)) {
|
|
@@ -1297854,9 +1297880,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context }) {
|
|
|
1297854
1297880
|
var import_axios7 = __toESM(require_axios4());
|
|
1297855
1297881
|
var import_decompress3 = __toESM(require_decompress());
|
|
1297856
1297882
|
var import_fs10 = require("fs");
|
|
1297857
|
-
var
|
|
1297883
|
+
var import_promises48 = require("fs/promises");
|
|
1297858
1297884
|
var import_path40 = __toESM(require("path"));
|
|
1297859
|
-
var
|
|
1297885
|
+
var import_promises49 = require("stream/promises");
|
|
1297860
1297886
|
var import_tmp_promise10 = __toESM(require_tmp_promise());
|
|
1297861
1297887
|
var _isFinished, _createdSnippets, _snippetsS3PreSignedReadUrl;
|
|
1297862
1297888
|
var RemoteTaskHandler = class {
|
|
@@ -1297972,11 +1297998,11 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1297972
1297998
|
});
|
|
1297973
1297999
|
const tmpDir = await import_tmp_promise10.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1297974
1298000
|
const outputZipPath = import_path40.default.join(tmpDir.path, "output.zip");
|
|
1297975
|
-
await (0,
|
|
1298001
|
+
await (0, import_promises49.pipeline)(request.data, (0, import_fs10.createWriteStream)(outputZipPath));
|
|
1297976
1298002
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1297977
|
-
await (0,
|
|
1298003
|
+
await (0, import_promises48.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1297978
1298004
|
}
|
|
1297979
|
-
await (0,
|
|
1298005
|
+
await (0, import_promises48.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
1297980
1298006
|
await (0, import_decompress3.default)(outputZipPath, absolutePathToLocalOutput);
|
|
1297981
1298007
|
}
|
|
1297982
1298008
|
function convertLogLevel(logLevel) {
|
|
@@ -1298122,7 +1298148,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
1298122
1298148
|
|
|
1298123
1298149
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
1298124
1298150
|
var import_axios8 = __toESM(require_axios4());
|
|
1298125
|
-
var
|
|
1298151
|
+
var import_promises50 = require("fs/promises");
|
|
1298126
1298152
|
var mime = __toESM(require_mime_types());
|
|
1298127
1298153
|
|
|
1298128
1298154
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
@@ -1298277,7 +1298303,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context, batchSize)
|
|
|
1298277
1298303
|
const absoluteFilePath = resolve(docsWorkspacePath, relativeFilePath);
|
|
1298278
1298304
|
try {
|
|
1298279
1298305
|
const mimeType = mime.lookup(absoluteFilePath);
|
|
1298280
|
-
await import_axios8.default.put(uploadUrl, await (0,
|
|
1298306
|
+
await import_axios8.default.put(uploadUrl, await (0, import_promises50.readFile)(absoluteFilePath), {
|
|
1298281
1298307
|
headers: {
|
|
1298282
1298308
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType
|
|
1298283
1298309
|
}
|
|
@@ -1298857,7 +1298883,7 @@ async function mockServer({
|
|
|
1298857
1298883
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/register/registerWorkspacesV1.ts
|
|
1298858
1298884
|
var import_fiddle_sdk6 = __toESM(require_fiddle_sdk());
|
|
1298859
1298885
|
var import_axios9 = __toESM(require_axios4());
|
|
1298860
|
-
var
|
|
1298886
|
+
var import_promises51 = require("fs/promises");
|
|
1298861
1298887
|
var import_path41 = __toESM(require("path"));
|
|
1298862
1298888
|
var import_tar3 = __toESM(require_tar());
|
|
1298863
1298889
|
var import_tmp_promise11 = __toESM(require_tmp_promise());
|
|
@@ -1298907,7 +1298933,7 @@ async function registerWorkspacesV1({
|
|
|
1298907
1298933
|
context.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1298908
1298934
|
await import_tar3.default.create({ file: tarPath, cwd: resolvedWorkspace.absoluteFilepath }, ["."]);
|
|
1298909
1298935
|
context.logger.info("Uploading definition...");
|
|
1298910
|
-
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
1298936
|
+
await import_axios9.default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises51.readFile)(tarPath));
|
|
1298911
1298937
|
context.logger.info(
|
|
1298912
1298938
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
1298913
1298939
|
);
|
|
@@ -1299031,20 +1299057,20 @@ async function generateToken({
|
|
|
1299031
1299057
|
|
|
1299032
1299058
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/updateApiSpec.ts
|
|
1299033
1299059
|
var fs9 = __toESM(require("fs"));
|
|
1299034
|
-
var
|
|
1299060
|
+
var import_promises52 = require("fs/promises");
|
|
1299035
1299061
|
var import_stream5 = require("stream");
|
|
1299036
|
-
var
|
|
1299062
|
+
var import_promises53 = require("stream/promises");
|
|
1299037
1299063
|
async function fetchAndWriteFile(url, path44, logger) {
|
|
1299038
1299064
|
const resp = await fetch(url);
|
|
1299039
1299065
|
if (resp.ok && resp.body) {
|
|
1299040
1299066
|
logger.debug("Origin successfully fetched, writing to file");
|
|
1299041
1299067
|
const fileStream = fs9.createWriteStream(path44);
|
|
1299042
|
-
await (0,
|
|
1299043
|
-
const fileContents = await (0,
|
|
1299068
|
+
await (0, import_promises53.finished)(import_stream5.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
1299069
|
+
const fileContents = await (0, import_promises52.readFile)(path44, "utf8");
|
|
1299044
1299070
|
try {
|
|
1299045
|
-
await (0,
|
|
1299071
|
+
await (0, import_promises52.writeFile)(path44, JSON.stringify(JSON.parse(fileContents), void 0, 2), "utf8");
|
|
1299046
1299072
|
} catch (e) {
|
|
1299047
|
-
await (0,
|
|
1299073
|
+
await (0, import_promises52.writeFile)(path44, js_yaml_default.dump(js_yaml_default.load(fileContents)), "utf8");
|
|
1299048
1299074
|
}
|
|
1299049
1299075
|
logger.debug("File written successfully");
|
|
1299050
1299076
|
}
|
|
@@ -1299121,17 +1299147,17 @@ async function updateApiSpec({
|
|
|
1299121
1299147
|
}
|
|
1299122
1299148
|
|
|
1299123
1299149
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/migration.js
|
|
1299124
|
-
var
|
|
1299150
|
+
var import_promises56 = require("fs/promises");
|
|
1299125
1299151
|
|
|
1299126
1299152
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/loadWorkspaces.js
|
|
1299127
|
-
var
|
|
1299153
|
+
var import_promises54 = require("fs/promises");
|
|
1299128
1299154
|
var FERN_DIRECTORY2 = "fern";
|
|
1299129
1299155
|
async function loadWorkspaces(context) {
|
|
1299130
1299156
|
const fernDirectory = await getFernDirectory2();
|
|
1299131
1299157
|
if (fernDirectory == null) {
|
|
1299132
1299158
|
context.failAndThrow(`Directory "${FERN_DIRECTORY2}" not found.`);
|
|
1299133
1299159
|
}
|
|
1299134
|
-
const fernDirectoryContents = await (0,
|
|
1299160
|
+
const fernDirectoryContents = await (0, import_promises54.readdir)(fernDirectory, { withFileTypes: true });
|
|
1299135
1299161
|
return fernDirectoryContents.reduce((all5, item) => {
|
|
1299136
1299162
|
if (item.isDirectory()) {
|
|
1299137
1299163
|
all5.push(join(fernDirectory, RelativeFilePath.of(item.name)));
|
|
@@ -1299166,7 +1299192,7 @@ function convertGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration
|
|
|
1299166
1299192
|
}
|
|
1299167
1299193
|
|
|
1299168
1299194
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1299169
|
-
var
|
|
1299195
|
+
var import_promises55 = require("fs/promises");
|
|
1299170
1299196
|
|
|
1299171
1299197
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/schemas/GenerateConfigSchema.js
|
|
1299172
1299198
|
var GenerateConfigSchema = z.strictObject({
|
|
@@ -1299189,7 +1299215,7 @@ var GeneratorsConfigurationSchema2 = z.strictObject({
|
|
|
1299189
1299215
|
|
|
1299190
1299216
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.188/generators-configuration/old-configuration/loadRawGeneratorsConfiguration.js
|
|
1299191
1299217
|
async function loadRawGeneratorsConfiguration2({ absolutePathToGeneratorsConfiguration, context }) {
|
|
1299192
|
-
const contentsStr = await (0,
|
|
1299218
|
+
const contentsStr = await (0, import_promises55.readFile)(absolutePathToGeneratorsConfiguration);
|
|
1299193
1299219
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1299194
1299220
|
return await validateSchema({
|
|
1299195
1299221
|
schema: GeneratorsConfigurationSchema2,
|
|
@@ -1299225,7 +1299251,7 @@ async function migrateWorkspace(pathToWorkspace, context) {
|
|
|
1299225
1299251
|
rawGeneratorsConfiguration: oldRawConfiguration
|
|
1299226
1299252
|
});
|
|
1299227
1299253
|
const migratedConfiguration = migrateConfiguration(oldConfiguration);
|
|
1299228
|
-
await (0,
|
|
1299254
|
+
await (0, import_promises56.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(migratedConfiguration));
|
|
1299229
1299255
|
}
|
|
1299230
1299256
|
function migrateConfiguration(oldConfiguration) {
|
|
1299231
1299257
|
return {
|
|
@@ -1299251,7 +1299277,7 @@ var versionMigrations = {
|
|
|
1299251
1299277
|
var __default = versionMigrations;
|
|
1299252
1299278
|
|
|
1299253
1299279
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
1299254
|
-
var
|
|
1299280
|
+
var import_promises57 = require("fs/promises");
|
|
1299255
1299281
|
|
|
1299256
1299282
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
1299257
1299283
|
var import_glob_promise2 = __toESM(require_lib());
|
|
@@ -1299285,7 +1299311,7 @@ var migration2 = {
|
|
|
1299285
1299311
|
try {
|
|
1299286
1299312
|
const fileContents = await getFileContents(yamlFilepath);
|
|
1299287
1299313
|
const newContents = addDiscriminantToFile(fileContents);
|
|
1299288
|
-
await (0,
|
|
1299314
|
+
await (0, import_promises57.writeFile)(yamlFilepath, newContents);
|
|
1299289
1299315
|
} catch (error) {
|
|
1299290
1299316
|
context.failAndThrow("Failed to migrate " + yamlFilepath, error);
|
|
1299291
1299317
|
}
|
|
@@ -1299293,7 +1299319,7 @@ var migration2 = {
|
|
|
1299293
1299319
|
}
|
|
1299294
1299320
|
};
|
|
1299295
1299321
|
async function getFileContents(filepath) {
|
|
1299296
|
-
const buffer3 = await (0,
|
|
1299322
|
+
const buffer3 = await (0, import_promises57.readFile)(filepath);
|
|
1299297
1299323
|
return buffer3.toString();
|
|
1299298
1299324
|
}
|
|
1299299
1299325
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -1299322,7 +1299348,7 @@ var versionMigrations2 = {
|
|
|
1299322
1299348
|
var __default2 = versionMigrations2;
|
|
1299323
1299349
|
|
|
1299324
1299350
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
1299325
|
-
var
|
|
1299351
|
+
var import_promises58 = require("fs/promises");
|
|
1299326
1299352
|
var import_yaml = __toESM(require_dist4());
|
|
1299327
1299353
|
|
|
1299328
1299354
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -1299363,7 +1299389,7 @@ var migration3 = {
|
|
|
1299363
1299389
|
}
|
|
1299364
1299390
|
};
|
|
1299365
1299391
|
async function migrateFile(filepath, context) {
|
|
1299366
|
-
const contents = await (0,
|
|
1299392
|
+
const contents = await (0, import_promises58.readFile)(filepath);
|
|
1299367
1299393
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
1299368
1299394
|
const types3 = parsedDocument.get("types");
|
|
1299369
1299395
|
if (types3 == null) {
|
|
@@ -1299395,7 +1299421,7 @@ async function migrateFile(filepath, context) {
|
|
|
1299395
1299421
|
}
|
|
1299396
1299422
|
}
|
|
1299397
1299423
|
}
|
|
1299398
|
-
await (0,
|
|
1299424
|
+
await (0, import_promises58.writeFile)(filepath, parsedDocument.toString());
|
|
1299399
1299425
|
}
|
|
1299400
1299426
|
|
|
1299401
1299427
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -1299406,7 +1299432,7 @@ var versionMigrations3 = {
|
|
|
1299406
1299432
|
var __default3 = versionMigrations3;
|
|
1299407
1299433
|
|
|
1299408
1299434
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
1299409
|
-
var
|
|
1299435
|
+
var import_promises59 = require("fs/promises");
|
|
1299410
1299436
|
var import_yaml2 = __toESM(require_dist4());
|
|
1299411
1299437
|
|
|
1299412
1299438
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1299447,7 +1299473,7 @@ var migration4 = {
|
|
|
1299447
1299473
|
}
|
|
1299448
1299474
|
};
|
|
1299449
1299475
|
async function migrateGeneratorsYml(filepath, context) {
|
|
1299450
|
-
const contents = await (0,
|
|
1299476
|
+
const contents = await (0, import_promises59.readFile)(filepath);
|
|
1299451
1299477
|
const parsedDocument = import_yaml2.default.parseDocument(contents.toString());
|
|
1299452
1299478
|
const draftGenerators = parsedDocument.get("draft");
|
|
1299453
1299479
|
if (draftGenerators == null) {
|
|
@@ -1299474,7 +1299500,7 @@ async function migrateGeneratorsYml(filepath, context) {
|
|
|
1299474
1299500
|
draftGenerator.set("output-path", name3.value.includes("openapi") ? "./generated-openapi" : name3.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
1299475
1299501
|
}
|
|
1299476
1299502
|
});
|
|
1299477
|
-
await (0,
|
|
1299503
|
+
await (0, import_promises59.writeFile)(filepath, parsedDocument.toString());
|
|
1299478
1299504
|
}
|
|
1299479
1299505
|
|
|
1299480
1299506
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -1299485,7 +1299511,7 @@ var versionMigrations4 = {
|
|
|
1299485
1299511
|
var __default4 = versionMigrations4;
|
|
1299486
1299512
|
|
|
1299487
1299513
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
1299488
|
-
var
|
|
1299514
|
+
var import_promises60 = require("fs/promises");
|
|
1299489
1299515
|
var import_yaml3 = __toESM(require_dist4());
|
|
1299490
1299516
|
|
|
1299491
1299517
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -1299526,7 +1299552,7 @@ var migration5 = {
|
|
|
1299526
1299552
|
}
|
|
1299527
1299553
|
};
|
|
1299528
1299554
|
async function migrateFile2(filepath, context) {
|
|
1299529
|
-
const contents = await (0,
|
|
1299555
|
+
const contents = await (0, import_promises60.readFile)(filepath);
|
|
1299530
1299556
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
1299531
1299557
|
const addType = (typeName, typeDeclaration) => {
|
|
1299532
1299558
|
const types3 = parsedDocument.get("types");
|
|
@@ -1299570,7 +1299596,7 @@ async function migrateFile2(filepath, context) {
|
|
|
1299570
1299596
|
}
|
|
1299571
1299597
|
}
|
|
1299572
1299598
|
}
|
|
1299573
|
-
await (0,
|
|
1299599
|
+
await (0, import_promises60.writeFile)(filepath, parsedDocument.toString());
|
|
1299574
1299600
|
}
|
|
1299575
1299601
|
|
|
1299576
1299602
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -1299581,7 +1299607,7 @@ var versionMigrations5 = {
|
|
|
1299581
1299607
|
var __default5 = versionMigrations5;
|
|
1299582
1299608
|
|
|
1299583
1299609
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
1299584
|
-
var
|
|
1299610
|
+
var import_promises61 = require("fs/promises");
|
|
1299585
1299611
|
var import_yaml4 = __toESM(require_dist4());
|
|
1299586
1299612
|
|
|
1299587
1299613
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1299622,7 +1299648,7 @@ var migration6 = {
|
|
|
1299622
1299648
|
}
|
|
1299623
1299649
|
};
|
|
1299624
1299650
|
async function migrateGeneratorsYml2(filepath, context) {
|
|
1299625
|
-
const contents = await (0,
|
|
1299651
|
+
const contents = await (0, import_promises61.readFile)(filepath);
|
|
1299626
1299652
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
1299627
1299653
|
const releaseGenerators = parsedDocument.get("release");
|
|
1299628
1299654
|
if (releaseGenerators == null) {
|
|
@@ -1299660,7 +1299686,7 @@ async function migrateGeneratorsYml2(filepath, context) {
|
|
|
1299660
1299686
|
}
|
|
1299661
1299687
|
releaseGenerator.delete("outputs");
|
|
1299662
1299688
|
});
|
|
1299663
|
-
await (0,
|
|
1299689
|
+
await (0, import_promises61.writeFile)(filepath, parsedDocument.toString());
|
|
1299664
1299690
|
}
|
|
1299665
1299691
|
|
|
1299666
1299692
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -1299671,7 +1299697,7 @@ var versionMigrations6 = {
|
|
|
1299671
1299697
|
var __default6 = versionMigrations6;
|
|
1299672
1299698
|
|
|
1299673
1299699
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
1299674
|
-
var
|
|
1299700
|
+
var import_promises62 = require("fs/promises");
|
|
1299675
1299701
|
|
|
1299676
1299702
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
1299677
1299703
|
var import_glob_promise7 = __toESM(require_lib());
|
|
@@ -1299702,9 +1299728,9 @@ var migration7 = {
|
|
|
1299702
1299728
|
run: async ({ context }) => {
|
|
1299703
1299729
|
const yamlFiles = await getAllYamlFiles4(context);
|
|
1299704
1299730
|
for (const filepath of yamlFiles) {
|
|
1299705
|
-
const contents = await (0,
|
|
1299731
|
+
const contents = await (0, import_promises62.readFile)(filepath);
|
|
1299706
1299732
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
1299707
|
-
await (0,
|
|
1299733
|
+
await (0, import_promises62.writeFile)(filepath, newContents);
|
|
1299708
1299734
|
}
|
|
1299709
1299735
|
}
|
|
1299710
1299736
|
};
|
|
@@ -1299717,7 +1299743,7 @@ var versionMigrations7 = {
|
|
|
1299717
1299743
|
var __default7 = versionMigrations7;
|
|
1299718
1299744
|
|
|
1299719
1299745
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
1299720
|
-
var
|
|
1299746
|
+
var import_promises63 = require("fs/promises");
|
|
1299721
1299747
|
|
|
1299722
1299748
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
1299723
1299749
|
var import_glob_promise8 = __toESM(require_lib());
|
|
@@ -1299748,9 +1299774,9 @@ var migration8 = {
|
|
|
1299748
1299774
|
run: async ({ context }) => {
|
|
1299749
1299775
|
const yamlFiles = await getAllRootApiYamlFiles(context);
|
|
1299750
1299776
|
for (const filepath of yamlFiles) {
|
|
1299751
|
-
const contents = await (0,
|
|
1299777
|
+
const contents = await (0, import_promises63.readFile)(filepath);
|
|
1299752
1299778
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
1299753
|
-
await (0,
|
|
1299779
|
+
await (0, import_promises63.writeFile)(filepath, newContents);
|
|
1299754
1299780
|
}
|
|
1299755
1299781
|
}
|
|
1299756
1299782
|
};
|
|
@@ -1299763,7 +1299789,7 @@ var versionMigrations8 = {
|
|
|
1299763
1299789
|
var __default8 = versionMigrations8;
|
|
1299764
1299790
|
|
|
1299765
1299791
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
1299766
|
-
var
|
|
1299792
|
+
var import_promises64 = require("fs/promises");
|
|
1299767
1299793
|
|
|
1299768
1299794
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
1299769
1299795
|
var import_glob_promise9 = __toESM(require_lib());
|
|
@@ -1299870,7 +1299896,7 @@ var migration9 = {
|
|
|
1299870
1299896
|
}
|
|
1299871
1299897
|
};
|
|
1299872
1299898
|
async function migrateGeneratorsYml3(filepath) {
|
|
1299873
|
-
const contentsStr = await (0,
|
|
1299899
|
+
const contentsStr = await (0, import_promises64.readFile)(filepath);
|
|
1299874
1299900
|
const contents = js_yaml_default.load(contentsStr.toString());
|
|
1299875
1299901
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema3.parse(contents);
|
|
1299876
1299902
|
let newGeneratorsConfiguration = {};
|
|
@@ -1299888,7 +1299914,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
1299888
1299914
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
1299889
1299915
|
};
|
|
1299890
1299916
|
}
|
|
1299891
|
-
await (0,
|
|
1299917
|
+
await (0, import_promises64.writeFile)(filepath, js_yaml_default.dump(newGeneratorsConfiguration));
|
|
1299892
1299918
|
}
|
|
1299893
1299919
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
1299894
1299920
|
const newSchema = {
|
|
@@ -1299963,7 +1299989,7 @@ var versionMigrations9 = {
|
|
|
1299963
1299989
|
var __default9 = versionMigrations9;
|
|
1299964
1299990
|
|
|
1299965
1299991
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
1299966
|
-
var
|
|
1299992
|
+
var import_promises65 = require("fs/promises");
|
|
1299967
1299993
|
var import_yaml5 = __toESM(require_dist4());
|
|
1299968
1299994
|
|
|
1299969
1299995
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -1300004,7 +1300030,7 @@ var migration10 = {
|
|
|
1300004
1300030
|
}
|
|
1300005
1300031
|
};
|
|
1300006
1300032
|
async function migrateRootApiFile(filepath) {
|
|
1300007
|
-
const contents = await (0,
|
|
1300033
|
+
const contents = await (0, import_promises65.readFile)(filepath);
|
|
1300008
1300034
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
1300009
1300035
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
1300010
1300036
|
if (errorDiscriminant == null || !import_yaml5.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -1300015,7 +1300041,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
1300015
1300041
|
"property-name": errorDiscriminant.value
|
|
1300016
1300042
|
});
|
|
1300017
1300043
|
parsedDocument.delete("error-discriminant");
|
|
1300018
|
-
await (0,
|
|
1300044
|
+
await (0, import_promises65.writeFile)(filepath, parsedDocument.toString());
|
|
1300019
1300045
|
}
|
|
1300020
1300046
|
|
|
1300021
1300047
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -1300026,7 +1300052,7 @@ var versionMigrations10 = {
|
|
|
1300026
1300052
|
var __default10 = versionMigrations10;
|
|
1300027
1300053
|
|
|
1300028
1300054
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
1300029
|
-
var
|
|
1300055
|
+
var import_promises66 = require("fs/promises");
|
|
1300030
1300056
|
var import_yaml6 = __toESM(require_dist4());
|
|
1300031
1300057
|
|
|
1300032
1300058
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -1300067,7 +1300093,7 @@ var migration11 = {
|
|
|
1300067
1300093
|
}
|
|
1300068
1300094
|
};
|
|
1300069
1300095
|
async function migrateYamlFile(filepath, context) {
|
|
1300070
|
-
const contents = await (0,
|
|
1300096
|
+
const contents = await (0, import_promises66.readFile)(filepath);
|
|
1300071
1300097
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
1300072
1300098
|
const services = parsedDocument.get("services");
|
|
1300073
1300099
|
if (services == null) {
|
|
@@ -1300107,7 +1300133,7 @@ async function migrateYamlFile(filepath, context) {
|
|
|
1300107
1300133
|
context.failWithoutThrowing("Failed to convert endpoint", e);
|
|
1300108
1300134
|
}
|
|
1300109
1300135
|
}
|
|
1300110
|
-
await (0,
|
|
1300136
|
+
await (0, import_promises66.writeFile)(filepath, parsedDocument.toString());
|
|
1300111
1300137
|
}
|
|
1300112
1300138
|
}
|
|
1300113
1300139
|
function convertEndpoint18({ document: document6, endpoint }) {
|
|
@@ -1300191,10 +1300217,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config());
|
|
|
1300191
1300217
|
var LegacyDocsSerializers = __toESM(require_serialization34());
|
|
1300192
1300218
|
|
|
1300193
1300219
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
1300194
|
-
var
|
|
1300220
|
+
var import_promises67 = require("fs/promises");
|
|
1300195
1300221
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
1300196
1300222
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1300197
|
-
const contentsStr = await (0,
|
|
1300223
|
+
const contentsStr = await (0, import_promises67.readFile)(filepath);
|
|
1300198
1300224
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1300199
1300225
|
const result2 = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
1300200
1300226
|
if (result2.ok) {
|
|
@@ -1300212,7 +1300238,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
1300212
1300238
|
}
|
|
1300213
1300239
|
|
|
1300214
1300240
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
1300215
|
-
var
|
|
1300241
|
+
var import_promises69 = require("fs/promises");
|
|
1300216
1300242
|
|
|
1300217
1300243
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
1300218
1300244
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -1300393,10 +1300419,10 @@ __export(legacy_exports, {
|
|
|
1300393
1300419
|
});
|
|
1300394
1300420
|
|
|
1300395
1300421
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
1300396
|
-
var
|
|
1300422
|
+
var import_promises68 = require("fs/promises");
|
|
1300397
1300423
|
async function loadRawGeneratorsConfiguration3({ absolutePathToWorkspace }) {
|
|
1300398
1300424
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
1300399
|
-
const contentsStr = await (0,
|
|
1300425
|
+
const contentsStr = await (0, import_promises68.readFile)(filepath);
|
|
1300400
1300426
|
const contentsParsed = js_yaml_default.load(contentsStr.toString());
|
|
1300401
1300427
|
const result2 = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
1300402
1300428
|
if (result2.success) {
|
|
@@ -1300516,7 +1300542,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
1300516
1300542
|
var APIS_DIRECTORY2 = "apis";
|
|
1300517
1300543
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
1300518
1300544
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY2));
|
|
1300519
|
-
await (0,
|
|
1300545
|
+
await (0, import_promises69.mkdir)(absolutePathToApisDirectory);
|
|
1300520
1300546
|
for (const workspace of workspaces) {
|
|
1300521
1300547
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1300522
1300548
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -1300524,11 +1300550,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
1300524
1300550
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
1300525
1300551
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1300526
1300552
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1300527
|
-
await (0,
|
|
1300553
|
+
await (0, import_promises69.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1300528
1300554
|
}
|
|
1300529
1300555
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1300530
1300556
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1300531
|
-
await (0,
|
|
1300557
|
+
await (0, import_promises69.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1300532
1300558
|
}
|
|
1300533
1300559
|
}
|
|
1300534
1300560
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -1300541,7 +1300567,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
1300541
1300567
|
generatorsConfiguration,
|
|
1300542
1300568
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1300543
1300569
|
});
|
|
1300544
|
-
await (0,
|
|
1300570
|
+
await (0, import_promises69.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1300545
1300571
|
return convertedResponse.docsURLs;
|
|
1300546
1300572
|
}
|
|
1300547
1300573
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -1300555,19 +1300581,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
1300555
1300581
|
apiName
|
|
1300556
1300582
|
});
|
|
1300557
1300583
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1300558
|
-
await (0,
|
|
1300584
|
+
await (0, import_promises69.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1300559
1300585
|
}
|
|
1300560
1300586
|
|
|
1300561
1300587
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
1300562
|
-
var
|
|
1300588
|
+
var import_promises70 = require("fs/promises");
|
|
1300563
1300589
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1300564
1300590
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
1300565
1300591
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
1300566
1300592
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1300567
1300593
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1300568
1300594
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1300569
|
-
await (0,
|
|
1300570
|
-
await (0,
|
|
1300595
|
+
await (0, import_promises70.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1300596
|
+
await (0, import_promises70.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1300571
1300597
|
}
|
|
1300572
1300598
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
1300573
1300599
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1300580,7 +1300606,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
1300580
1300606
|
apiName: void 0
|
|
1300581
1300607
|
});
|
|
1300582
1300608
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1300583
|
-
await (0,
|
|
1300609
|
+
await (0, import_promises70.writeFile)(absolutePathToDocsConfig, js_yaml_default.dump(convertedDocsConfig));
|
|
1300584
1300610
|
}
|
|
1300585
1300611
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
1300586
1300612
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1300592,22 +1300618,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
1300592
1300618
|
generatorsConfiguration,
|
|
1300593
1300619
|
pathModificationStrategy: "MoveUp"
|
|
1300594
1300620
|
});
|
|
1300595
|
-
await (0,
|
|
1300621
|
+
await (0, import_promises70.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1300596
1300622
|
return convertedResponse.docsURLs;
|
|
1300597
1300623
|
}
|
|
1300598
1300624
|
|
|
1300599
1300625
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
1300600
|
-
var
|
|
1300626
|
+
var import_promises71 = require("fs/promises");
|
|
1300601
1300627
|
var APIS_DIRECTORY3 = "apis";
|
|
1300602
1300628
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
1300603
1300629
|
const absolutePathToApisDirectory = join(absolutePathToFernDirectory, RelativeFilePath.of(APIS_DIRECTORY3));
|
|
1300604
|
-
await (0,
|
|
1300630
|
+
await (0, import_promises71.mkdir)(absolutePathToApisDirectory);
|
|
1300605
1300631
|
for (const workspace of workspaces) {
|
|
1300606
1300632
|
const absolutePathToWorkspace = join(absolutePathToFernDirectory, RelativeFilePath.of(workspace));
|
|
1300607
1300633
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
1300608
1300634
|
const absolutePathToNestedWorkspace = join(absolutePathToApisDirectory, RelativeFilePath.of(workspace));
|
|
1300609
1300635
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1300610
|
-
await (0,
|
|
1300636
|
+
await (0, import_promises71.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1300611
1300637
|
}
|
|
1300612
1300638
|
}
|
|
1300613
1300639
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -1300620,15 +1300646,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
1300620
1300646
|
generatorsConfiguration,
|
|
1300621
1300647
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1300622
1300648
|
});
|
|
1300623
|
-
await (0,
|
|
1300649
|
+
await (0, import_promises71.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1300624
1300650
|
}
|
|
1300625
1300651
|
|
|
1300626
1300652
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
1300627
|
-
var
|
|
1300653
|
+
var import_promises72 = require("fs/promises");
|
|
1300628
1300654
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1300629
1300655
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
1300630
1300656
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1300631
|
-
await (0,
|
|
1300657
|
+
await (0, import_promises72.rmdir)(absolutePathToWorkspace, { recursive: true });
|
|
1300632
1300658
|
}
|
|
1300633
1300659
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
1300634
1300660
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration3({ absolutePathToWorkspace });
|
|
@@ -1300640,7 +1300666,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
1300640
1300666
|
generatorsConfiguration,
|
|
1300641
1300667
|
pathModificationStrategy: "MoveUp"
|
|
1300642
1300668
|
});
|
|
1300643
|
-
await (0,
|
|
1300669
|
+
await (0, import_promises72.writeFile)(absolutePathToGeneratorsConfiguration, js_yaml_default.dump(convertedResponse.value));
|
|
1300644
1300670
|
}
|
|
1300645
1300671
|
|
|
1300646
1300672
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -1300717,7 +1300743,7 @@ var versionMigrations12 = {
|
|
|
1300717
1300743
|
var __default12 = versionMigrations12;
|
|
1300718
1300744
|
|
|
1300719
1300745
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
1300720
|
-
var
|
|
1300746
|
+
var import_promises73 = require("fs/promises");
|
|
1300721
1300747
|
var import_yaml7 = __toESM(require_dist4());
|
|
1300722
1300748
|
|
|
1300723
1300749
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -1300758,7 +1300784,7 @@ var migration13 = {
|
|
|
1300758
1300784
|
}
|
|
1300759
1300785
|
};
|
|
1300760
1300786
|
async function migrateYamlFile2(filepath, context) {
|
|
1300761
|
-
const contents = await (0,
|
|
1300787
|
+
const contents = await (0, import_promises73.readFile)(filepath);
|
|
1300762
1300788
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
1300763
1300789
|
const types3 = parsedDocument.get("types");
|
|
1300764
1300790
|
if (types3 == null) {
|
|
@@ -1300784,7 +1300810,7 @@ async function migrateYamlFile2(filepath, context) {
|
|
|
1300784
1300810
|
examples.set(i2, { value });
|
|
1300785
1300811
|
}
|
|
1300786
1300812
|
}
|
|
1300787
|
-
await (0,
|
|
1300813
|
+
await (0, import_promises73.writeFile)(filepath, parsedDocument.toString());
|
|
1300788
1300814
|
}
|
|
1300789
1300815
|
|
|
1300790
1300816
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -1300795,7 +1300821,7 @@ var versionMigrations13 = {
|
|
|
1300795
1300821
|
var __default13 = versionMigrations13;
|
|
1300796
1300822
|
|
|
1300797
1300823
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
1300798
|
-
var
|
|
1300824
|
+
var import_promises74 = require("fs/promises");
|
|
1300799
1300825
|
var import_yaml8 = __toESM(require_dist4());
|
|
1300800
1300826
|
|
|
1300801
1300827
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -1300836,7 +1300862,7 @@ var migration14 = {
|
|
|
1300836
1300862
|
}
|
|
1300837
1300863
|
};
|
|
1300838
1300864
|
async function migrateYamlFile3(filepath, context) {
|
|
1300839
|
-
const contents = await (0,
|
|
1300865
|
+
const contents = await (0, import_promises74.readFile)(filepath);
|
|
1300840
1300866
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
1300841
1300867
|
if (!import_yaml8.default.isMap(parsedDocument.contents)) {
|
|
1300842
1300868
|
return context.failAndThrow("File is not a map");
|
|
@@ -1300866,7 +1300892,7 @@ async function migrateYamlFile3(filepath, context) {
|
|
|
1300866
1300892
|
pair.value = firstService.value;
|
|
1300867
1300893
|
}
|
|
1300868
1300894
|
}
|
|
1300869
|
-
await (0,
|
|
1300895
|
+
await (0, import_promises74.writeFile)(filepath, parsedDocument.toString());
|
|
1300870
1300896
|
}
|
|
1300871
1300897
|
|
|
1300872
1300898
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -1300877,7 +1300903,7 @@ var versionMigrations14 = {
|
|
|
1300877
1300903
|
var __default14 = versionMigrations14;
|
|
1300878
1300904
|
|
|
1300879
1300905
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
1300880
|
-
var
|
|
1300906
|
+
var import_promises75 = require("fs/promises");
|
|
1300881
1300907
|
var import_yaml9 = __toESM(require_dist4());
|
|
1300882
1300908
|
|
|
1300883
1300909
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -1300918,7 +1300944,7 @@ var migration15 = {
|
|
|
1300918
1300944
|
}
|
|
1300919
1300945
|
};
|
|
1300920
1300946
|
async function migrateYamlFile4(filepath, context) {
|
|
1300921
|
-
const contents = await (0,
|
|
1300947
|
+
const contents = await (0, import_promises75.readFile)(filepath);
|
|
1300922
1300948
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
1300923
1300949
|
if (!import_yaml9.default.isMap(parsedDocument.contents)) {
|
|
1300924
1300950
|
return context.failAndThrow("File is not a map");
|
|
@@ -1300937,7 +1300963,7 @@ async function migrateYamlFile4(filepath, context) {
|
|
|
1300937
1300963
|
}
|
|
1300938
1300964
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
1300939
1300965
|
parsedDocument.contents.items.unshift(docsPair);
|
|
1300940
|
-
await (0,
|
|
1300966
|
+
await (0, import_promises75.writeFile)(filepath, parsedDocument.toString());
|
|
1300941
1300967
|
}
|
|
1300942
1300968
|
|
|
1300943
1300969
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -1300948,7 +1300974,7 @@ var versionMigrations15 = {
|
|
|
1300948
1300974
|
var __default15 = versionMigrations15;
|
|
1300949
1300975
|
|
|
1300950
1300976
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
1300951
|
-
var
|
|
1300977
|
+
var import_promises76 = require("fs/promises");
|
|
1300952
1300978
|
|
|
1300953
1300979
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
1300954
1300980
|
var import_glob_promise15 = __toESM(require_lib());
|
|
@@ -1300988,14 +1301014,14 @@ var migration16 = {
|
|
|
1300988
1301014
|
}
|
|
1300989
1301015
|
};
|
|
1300990
1301016
|
async function migrateYamlFile5(filepath) {
|
|
1300991
|
-
const contents = await (0,
|
|
1301017
|
+
const contents = await (0, import_promises76.readFile)(filepath);
|
|
1300992
1301018
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
1300993
1301019
|
const regex3 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
1300994
1301020
|
const updatedSnapshot = contents.toString().replace(regex3, (_match, _prefix, domain2) => {
|
|
1300995
1301021
|
return `docs:
|
|
1300996
1301022
|
domain: "${domain2}.${domainSuffix}"`;
|
|
1300997
1301023
|
});
|
|
1300998
|
-
await (0,
|
|
1301024
|
+
await (0, import_promises76.writeFile)(filepath, updatedSnapshot.toString());
|
|
1300999
1301025
|
}
|
|
1301000
1301026
|
|
|
1301001
1301027
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -1301097,7 +1301123,7 @@ ${source_default.dim(migration17.summary)}`
|
|
|
1301097
1301123
|
}
|
|
1301098
1301124
|
|
|
1301099
1301125
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgrade.ts
|
|
1301100
|
-
var
|
|
1301126
|
+
var import_promises77 = require("fs/promises");
|
|
1301101
1301127
|
|
|
1301102
1301128
|
// pnp:/home/runner/work/fern/fern/.yarn/cache/immer-npm-9.0.15-6c734225db-92e3d63e81.zip/node_modules/immer/dist/immer.esm.mjs
|
|
1301103
1301129
|
function n(n2) {
|
|
@@ -1301586,7 +1301612,7 @@ async function upgrade({
|
|
|
1301586
1301612
|
const newProjectConfig = immer_esm_default(projectConfig.rawConfig, (draft) => {
|
|
1301587
1301613
|
draft.version = fernCliUpgradeInfo.latestVersion;
|
|
1301588
1301614
|
});
|
|
1301589
|
-
await (0,
|
|
1301615
|
+
await (0, import_promises77.writeFile)(projectConfig._absolutePath, JSON.stringify(newProjectConfig, void 0, 2));
|
|
1301590
1301616
|
cliContext.logger.info(
|
|
1301591
1301617
|
`Upgrading from ${source_default.dim(cliContext.environment.packageVersion)} \u2192 ${source_default.green(
|
|
1301592
1301618
|
fernCliUpgradeInfo.latestVersion
|
|
@@ -1301608,7 +1301634,7 @@ async function upgrade({
|
|
|
1301608
1301634
|
}
|
|
1301609
1301635
|
|
|
1301610
1301636
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/upgrade/upgradeGenerator.ts
|
|
1301611
|
-
var
|
|
1301637
|
+
var import_promises78 = require("fs/promises");
|
|
1301612
1301638
|
var import_path42 = __toESM(require("path"));
|
|
1301613
1301639
|
var semver3 = __toESM(require_semver8());
|
|
1301614
1301640
|
var import_yaml10 = __toESM(require_dist4());
|
|
@@ -1301624,7 +1301650,7 @@ async function loadAndUpdateGenerators({
|
|
|
1301624
1301650
|
context.failAndThrow("Generators configuration file was not found, no generators to upgrade.");
|
|
1301625
1301651
|
return void 0;
|
|
1301626
1301652
|
}
|
|
1301627
|
-
const contents = await (0,
|
|
1301653
|
+
const contents = await (0, import_promises78.readFile)(filepath);
|
|
1301628
1301654
|
context.logger.debug(`Found generators: ${contents.toString()}`);
|
|
1301629
1301655
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
1301630
1301656
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -1301714,7 +1301740,7 @@ async function upgradeGenerator2({
|
|
|
1301714
1301740
|
includeMajor
|
|
1301715
1301741
|
});
|
|
1301716
1301742
|
if (updatedConfiguration != null) {
|
|
1301717
|
-
await (0,
|
|
1301743
|
+
await (0, import_promises78.writeFile)(
|
|
1301718
1301744
|
((_a5 = workspace.generatorsConfiguration) == null ? void 0 : _a5.absolutePathToConfiguration) ?? generators_yml_exports.getPathToGeneratorsConfiguration({
|
|
1301719
1301745
|
absolutePathToWorkspace: workspace.absoluteFilepath
|
|
1301720
1301746
|
}),
|
|
@@ -1301749,7 +1301775,7 @@ async function validateWorkspaces({
|
|
|
1301749
1301775
|
}
|
|
1301750
1301776
|
|
|
1301751
1301777
|
// pnp:/home/runner/work/fern/fern/packages/cli/cli/src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1301752
|
-
var
|
|
1301778
|
+
var import_promises79 = require("fs/promises");
|
|
1301753
1301779
|
var import_path43 = __toESM(require("path"));
|
|
1301754
1301780
|
async function writeDefinitionForWorkspaces({
|
|
1301755
1301781
|
project,
|
|
@@ -1301811,22 +1301837,22 @@ async function writeFernDefinition2({
|
|
|
1301811
1301837
|
absolutePathToOutputDirectory
|
|
1301812
1301838
|
}) {
|
|
1301813
1301839
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
1301814
|
-
await (0,
|
|
1301840
|
+
await (0, import_promises79.rmdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1301815
1301841
|
}
|
|
1301816
|
-
await (0,
|
|
1301817
|
-
await (0,
|
|
1301842
|
+
await (0, import_promises79.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1301843
|
+
await (0, import_promises79.writeFile)(
|
|
1301818
1301844
|
join(absolutePathToOutputDirectory, RelativeFilePath.of(ROOT_API_FILENAME)),
|
|
1301819
1301845
|
js_yaml_default.dump(definition3.rootApiFile.contents)
|
|
1301820
1301846
|
);
|
|
1301821
1301847
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1301822
1301848
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1301823
|
-
await (0,
|
|
1301824
|
-
await (0,
|
|
1301849
|
+
await (0, import_promises79.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1301850
|
+
await (0, import_promises79.writeFile)(absoluteFilepath, js_yaml_default.dump(packageMarker.contents));
|
|
1301825
1301851
|
}
|
|
1301826
1301852
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1301827
1301853
|
const absoluteFilepath = join(absolutePathToOutputDirectory, RelativeFilePath.of(relativePath));
|
|
1301828
|
-
await (0,
|
|
1301829
|
-
await (0,
|
|
1301854
|
+
await (0, import_promises79.mkdir)(dirname(absoluteFilepath), { recursive: true });
|
|
1301855
|
+
await (0, import_promises79.writeFile)(absoluteFilepath, js_yaml_default.dump(definitionFile.contents));
|
|
1301830
1301856
|
}
|
|
1301831
1301857
|
}
|
|
1301832
1301858
|
|