@fern-api/fern-api-dev 5.39.0 → 5.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +226 -79
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -52657,9 +52657,9 @@ var init_streamObjectToFile = __esm({
|
|
|
52657
52657
|
}
|
|
52658
52658
|
});
|
|
52659
52659
|
|
|
52660
|
-
// ../../../node_modules/.pnpm/tmp@0.2.
|
|
52660
|
+
// ../../../node_modules/.pnpm/tmp@0.2.6/node_modules/tmp/lib/tmp.js
|
|
52661
52661
|
var require_tmp = __commonJS({
|
|
52662
|
-
"../../../node_modules/.pnpm/tmp@0.2.
|
|
52662
|
+
"../../../node_modules/.pnpm/tmp@0.2.6/node_modules/tmp/lib/tmp.js"(exports2, module4) {
|
|
52663
52663
|
"use strict";
|
|
52664
52664
|
var fs38 = require("fs");
|
|
52665
52665
|
var os24 = require("os");
|
|
@@ -52910,13 +52910,20 @@ var require_tmp = __commonJS({
|
|
|
52910
52910
|
].join("");
|
|
52911
52911
|
return path117.join(tmpDir, opts.dir, name2);
|
|
52912
52912
|
}
|
|
52913
|
+
function _assertPath(path118) {
|
|
52914
|
+
if (path118.includes("..")) {
|
|
52915
|
+
throw new Error("Relative value not allowed");
|
|
52916
|
+
}
|
|
52917
|
+
return path118;
|
|
52918
|
+
}
|
|
52913
52919
|
function _assertOptionsBase(options2) {
|
|
52914
52920
|
if (!_isUndefined(options2.name)) {
|
|
52915
52921
|
const name2 = options2.name;
|
|
52916
52922
|
if (path117.isAbsolute(name2)) throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
52917
52923
|
const basename6 = path117.basename(name2);
|
|
52918
|
-
if (basename6 === ".." || basename6 === "." || basename6 !== name2)
|
|
52924
|
+
if (basename6 === ".." || basename6 === "." || basename6 !== name2) {
|
|
52919
52925
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
52926
|
+
}
|
|
52920
52927
|
}
|
|
52921
52928
|
if (!_isUndefined(options2.template) && !options2.template.match(TEMPLATE_PATTERN)) {
|
|
52922
52929
|
throw new Error(`Invalid template, found "${options2.template}".`);
|
|
@@ -52929,15 +52936,16 @@ var require_tmp = __commonJS({
|
|
|
52929
52936
|
options2.detachDescriptor = !!options2.detachDescriptor;
|
|
52930
52937
|
options2.discardDescriptor = !!options2.discardDescriptor;
|
|
52931
52938
|
options2.unsafeCleanup = !!options2.unsafeCleanup;
|
|
52932
|
-
options2.prefix = _isUndefined(options2.prefix) ? "" : options2.prefix;
|
|
52933
|
-
options2.postfix = _isUndefined(options2.postfix) ? "" : options2.postfix;
|
|
52939
|
+
options2.prefix = _isUndefined(options2.prefix) ? "" : _assertPath(options2.prefix);
|
|
52940
|
+
options2.postfix = _isUndefined(options2.postfix) ? "" : _assertPath(options2.postfix);
|
|
52941
|
+
options2.template = _isUndefined(options2.template) ? void 0 : _assertPath(options2.template);
|
|
52934
52942
|
}
|
|
52935
52943
|
function _getRelativePath(option, name2, tmpDir, cb) {
|
|
52936
52944
|
if (_isUndefined(name2)) return cb(null);
|
|
52937
52945
|
_resolvePath(name2, tmpDir, function(err, resolvedPath) {
|
|
52938
52946
|
if (err) return cb(err);
|
|
52939
52947
|
const relativePath = path117.relative(tmpDir, resolvedPath);
|
|
52940
|
-
if (
|
|
52948
|
+
if (relativePath.startsWith("..") || path117.isAbsolute(relativePath)) {
|
|
52941
52949
|
return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`));
|
|
52942
52950
|
}
|
|
52943
52951
|
cb(null, relativePath);
|
|
@@ -52947,7 +52955,7 @@ var require_tmp = __commonJS({
|
|
|
52947
52955
|
if (_isUndefined(name2)) return;
|
|
52948
52956
|
const resolvedPath = _resolvePathSync(name2, tmpDir);
|
|
52949
52957
|
const relativePath = path117.relative(tmpDir, resolvedPath);
|
|
52950
|
-
if (
|
|
52958
|
+
if (relativePath.startsWith("..") || path117.isAbsolute(relativePath)) {
|
|
52951
52959
|
throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`);
|
|
52952
52960
|
}
|
|
52953
52961
|
return relativePath;
|
|
@@ -108916,9 +108924,9 @@ var require_object_inspect = __commonJS({
|
|
|
108916
108924
|
}
|
|
108917
108925
|
});
|
|
108918
108926
|
|
|
108919
|
-
// ../../../node_modules/.pnpm/side-channel-list@1.0.
|
|
108927
|
+
// ../../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js
|
|
108920
108928
|
var require_side_channel_list = __commonJS({
|
|
108921
|
-
"../../../node_modules/.pnpm/side-channel-list@1.0.
|
|
108929
|
+
"../../../node_modules/.pnpm/side-channel-list@1.0.1/node_modules/side-channel-list/index.js"(exports2, module4) {
|
|
108922
108930
|
"use strict";
|
|
108923
108931
|
var inspect6 = require_object_inspect();
|
|
108924
108932
|
var $TypeError = require_type3();
|
|
@@ -108978,9 +108986,8 @@ var require_side_channel_list = __commonJS({
|
|
|
108978
108986
|
}
|
|
108979
108987
|
},
|
|
108980
108988
|
"delete": function(key2) {
|
|
108981
|
-
var root6 = $o8 && $o8.next;
|
|
108982
108989
|
var deletedNode = listDelete($o8, key2);
|
|
108983
|
-
if (deletedNode &&
|
|
108990
|
+
if (deletedNode && $o8 && !$o8.next) {
|
|
108984
108991
|
$o8 = void 0;
|
|
108985
108992
|
}
|
|
108986
108993
|
return !!deletedNode;
|
|
@@ -109996,9 +110003,9 @@ var require_side_channel = __commonJS({
|
|
|
109996
110003
|
}
|
|
109997
110004
|
});
|
|
109998
110005
|
|
|
109999
|
-
// ../../../node_modules/.pnpm/qs@6.15.
|
|
110006
|
+
// ../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/formats.js
|
|
110000
110007
|
var require_formats = __commonJS({
|
|
110001
|
-
"../../../node_modules/.pnpm/qs@6.15.
|
|
110008
|
+
"../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/formats.js"(exports2, module4) {
|
|
110002
110009
|
"use strict";
|
|
110003
110010
|
var replace2 = String.prototype.replace;
|
|
110004
110011
|
var percentTwenties = /%20/g;
|
|
@@ -110022,9 +110029,9 @@ var require_formats = __commonJS({
|
|
|
110022
110029
|
}
|
|
110023
110030
|
});
|
|
110024
110031
|
|
|
110025
|
-
// ../../../node_modules/.pnpm/qs@6.15.
|
|
110032
|
+
// ../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/utils.js
|
|
110026
110033
|
var require_utils22 = __commonJS({
|
|
110027
|
-
"../../../node_modules/.pnpm/qs@6.15.
|
|
110034
|
+
"../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/utils.js"(exports2, module4) {
|
|
110028
110035
|
"use strict";
|
|
110029
110036
|
var formats = require_formats();
|
|
110030
110037
|
var getSideChannel = require_side_channel();
|
|
@@ -110286,9 +110293,9 @@ var require_utils22 = __commonJS({
|
|
|
110286
110293
|
}
|
|
110287
110294
|
});
|
|
110288
110295
|
|
|
110289
|
-
// ../../../node_modules/.pnpm/qs@6.15.
|
|
110296
|
+
// ../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/stringify.js
|
|
110290
110297
|
var require_stringify = __commonJS({
|
|
110291
|
-
"../../../node_modules/.pnpm/qs@6.15.
|
|
110298
|
+
"../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/stringify.js"(exports2, module4) {
|
|
110292
110299
|
"use strict";
|
|
110293
110300
|
var getSideChannel = require_side_channel();
|
|
110294
110301
|
var utils2 = require_utils22();
|
|
@@ -110374,7 +110381,7 @@ var require_stringify = __commonJS({
|
|
|
110374
110381
|
}
|
|
110375
110382
|
if (obj === null) {
|
|
110376
110383
|
if (strictNullHandling) {
|
|
110377
|
-
return encoder && !encodeValuesOnly ? encoder(prefix2, defaults3.encoder, charset, "key", format3) : prefix2;
|
|
110384
|
+
return formatter(encoder && !encodeValuesOnly ? encoder(prefix2, defaults3.encoder, charset, "key", format3) : prefix2);
|
|
110378
110385
|
}
|
|
110379
110386
|
obj = "";
|
|
110380
110387
|
}
|
|
@@ -110392,7 +110399,9 @@ var require_stringify = __commonJS({
|
|
|
110392
110399
|
var objKeys;
|
|
110393
110400
|
if (generateArrayPrefix === "comma" && isArray7(obj)) {
|
|
110394
110401
|
if (encodeValuesOnly && encoder) {
|
|
110395
|
-
obj = utils2.maybeMap(obj,
|
|
110402
|
+
obj = utils2.maybeMap(obj, function(v9) {
|
|
110403
|
+
return v9 == null ? v9 : encoder(v9);
|
|
110404
|
+
});
|
|
110396
110405
|
}
|
|
110397
110406
|
objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
|
|
110398
110407
|
} else if (isArray7(filter8)) {
|
|
@@ -110530,6 +110539,9 @@ var require_stringify = __commonJS({
|
|
|
110530
110539
|
var sideChannel = getSideChannel();
|
|
110531
110540
|
for (var i9 = 0; i9 < objKeys.length; ++i9) {
|
|
110532
110541
|
var key2 = objKeys[i9];
|
|
110542
|
+
if (typeof key2 === "undefined" || key2 === null) {
|
|
110543
|
+
continue;
|
|
110544
|
+
}
|
|
110533
110545
|
var value2 = obj[key2];
|
|
110534
110546
|
if (options2.skipNulls && value2 === null) {
|
|
110535
110547
|
continue;
|
|
@@ -110559,9 +110571,9 @@ var require_stringify = __commonJS({
|
|
|
110559
110571
|
var prefix2 = options2.addQueryPrefix === true ? "?" : "";
|
|
110560
110572
|
if (options2.charsetSentinel) {
|
|
110561
110573
|
if (options2.charset === "iso-8859-1") {
|
|
110562
|
-
prefix2 += "utf8=%26%2310003%3B
|
|
110574
|
+
prefix2 += "utf8=%26%2310003%3B" + options2.delimiter;
|
|
110563
110575
|
} else {
|
|
110564
|
-
prefix2 += "utf8=%E2%9C%93
|
|
110576
|
+
prefix2 += "utf8=%E2%9C%93" + options2.delimiter;
|
|
110565
110577
|
}
|
|
110566
110578
|
}
|
|
110567
110579
|
return joined.length > 0 ? prefix2 + joined : "";
|
|
@@ -110569,9 +110581,9 @@ var require_stringify = __commonJS({
|
|
|
110569
110581
|
}
|
|
110570
110582
|
});
|
|
110571
110583
|
|
|
110572
|
-
// ../../../node_modules/.pnpm/qs@6.15.
|
|
110584
|
+
// ../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/parse.js
|
|
110573
110585
|
var require_parse2 = __commonJS({
|
|
110574
|
-
"../../../node_modules/.pnpm/qs@6.15.
|
|
110586
|
+
"../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/parse.js"(exports2, module4) {
|
|
110575
110587
|
"use strict";
|
|
110576
110588
|
var utils2 = require_utils22();
|
|
110577
110589
|
var has2 = Object.prototype.hasOwnProperty;
|
|
@@ -110623,9 +110635,9 @@ var require_parse2 = __commonJS({
|
|
|
110623
110635
|
var limit = options2.parameterLimit === Infinity ? void 0 : options2.parameterLimit;
|
|
110624
110636
|
var parts = cleanStr.split(
|
|
110625
110637
|
options2.delimiter,
|
|
110626
|
-
options2.throwOnLimitExceeded ? limit + 1 : limit
|
|
110638
|
+
options2.throwOnLimitExceeded && typeof limit !== "undefined" ? limit + 1 : limit
|
|
110627
110639
|
);
|
|
110628
|
-
if (options2.throwOnLimitExceeded && parts.length > limit) {
|
|
110640
|
+
if (options2.throwOnLimitExceeded && typeof limit !== "undefined" && parts.length > limit) {
|
|
110629
110641
|
throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
|
|
110630
110642
|
}
|
|
110631
110643
|
var skipIndex = -1;
|
|
@@ -110744,8 +110756,8 @@ var require_parse2 = __commonJS({
|
|
|
110744
110756
|
}
|
|
110745
110757
|
return leaf;
|
|
110746
110758
|
};
|
|
110747
|
-
var splitKeyIntoSegments = function splitKeyIntoSegments2(
|
|
110748
|
-
var key2 = options2.allowDots ?
|
|
110759
|
+
var splitKeyIntoSegments = function splitKeyIntoSegments2(originalKey, options2) {
|
|
110760
|
+
var key2 = options2.allowDots ? originalKey.replace(/\.([^.[]+)/g, "[$1]") : originalKey;
|
|
110749
110761
|
if (options2.depth <= 0) {
|
|
110750
110762
|
if (!options2.plainObjects && has2.call(Object.prototype, key2)) {
|
|
110751
110763
|
if (!options2.allowPrototypes) {
|
|
@@ -110754,37 +110766,56 @@ var require_parse2 = __commonJS({
|
|
|
110754
110766
|
}
|
|
110755
110767
|
return [key2];
|
|
110756
110768
|
}
|
|
110757
|
-
var
|
|
110758
|
-
var
|
|
110759
|
-
var
|
|
110760
|
-
var parent = segment ? key2.slice(0, segment.index) : key2;
|
|
110761
|
-
var keys25 = [];
|
|
110769
|
+
var segments = [];
|
|
110770
|
+
var first3 = key2.indexOf("[");
|
|
110771
|
+
var parent = first3 >= 0 ? key2.slice(0, first3) : key2;
|
|
110762
110772
|
if (parent) {
|
|
110763
110773
|
if (!options2.plainObjects && has2.call(Object.prototype, parent)) {
|
|
110764
110774
|
if (!options2.allowPrototypes) {
|
|
110765
110775
|
return;
|
|
110766
110776
|
}
|
|
110767
110777
|
}
|
|
110768
|
-
|
|
110778
|
+
segments[segments.length] = parent;
|
|
110769
110779
|
}
|
|
110770
|
-
var
|
|
110771
|
-
|
|
110772
|
-
|
|
110773
|
-
|
|
110774
|
-
|
|
110775
|
-
|
|
110776
|
-
|
|
110780
|
+
var n19 = key2.length;
|
|
110781
|
+
var open5 = first3;
|
|
110782
|
+
var collected = 0;
|
|
110783
|
+
while (open5 >= 0 && collected < options2.depth) {
|
|
110784
|
+
var level = 1;
|
|
110785
|
+
var i9 = open5 + 1;
|
|
110786
|
+
var close3 = -1;
|
|
110787
|
+
while (i9 < n19 && close3 < 0) {
|
|
110788
|
+
var cu5 = key2.charCodeAt(i9);
|
|
110789
|
+
if (cu5 === 91) {
|
|
110790
|
+
level += 1;
|
|
110791
|
+
} else if (cu5 === 93) {
|
|
110792
|
+
level -= 1;
|
|
110793
|
+
if (level === 0) {
|
|
110794
|
+
close3 = i9;
|
|
110795
|
+
}
|
|
110777
110796
|
}
|
|
110797
|
+
i9 += 1;
|
|
110798
|
+
}
|
|
110799
|
+
if (close3 < 0) {
|
|
110800
|
+
segments[segments.length] = "[" + key2.slice(open5) + "]";
|
|
110801
|
+
return segments;
|
|
110778
110802
|
}
|
|
110779
|
-
|
|
110803
|
+
var seg = key2.slice(open5, close3 + 1);
|
|
110804
|
+
var content5 = seg.slice(1, -1);
|
|
110805
|
+
if (!options2.plainObjects && has2.call(Object.prototype, content5) && !options2.allowPrototypes) {
|
|
110806
|
+
return;
|
|
110807
|
+
}
|
|
110808
|
+
segments[segments.length] = seg;
|
|
110809
|
+
collected += 1;
|
|
110810
|
+
open5 = key2.indexOf("[", close3 + 1);
|
|
110780
110811
|
}
|
|
110781
|
-
if (
|
|
110812
|
+
if (open5 >= 0) {
|
|
110782
110813
|
if (options2.strictDepth === true) {
|
|
110783
110814
|
throw new RangeError("Input depth exceeded depth option of " + options2.depth + " and strictDepth is true");
|
|
110784
110815
|
}
|
|
110785
|
-
|
|
110816
|
+
segments[segments.length] = "[" + key2.slice(open5) + "]";
|
|
110786
110817
|
}
|
|
110787
|
-
return
|
|
110818
|
+
return segments;
|
|
110788
110819
|
};
|
|
110789
110820
|
var parseKeys = function parseQueryStringKeys(givenKey, val, options2, valuesParsed) {
|
|
110790
110821
|
if (!givenKey) {
|
|
@@ -110868,9 +110899,9 @@ var require_parse2 = __commonJS({
|
|
|
110868
110899
|
}
|
|
110869
110900
|
});
|
|
110870
110901
|
|
|
110871
|
-
// ../../../node_modules/.pnpm/qs@6.15.
|
|
110902
|
+
// ../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/index.js
|
|
110872
110903
|
var require_lib3 = __commonJS({
|
|
110873
|
-
"../../../node_modules/.pnpm/qs@6.15.
|
|
110904
|
+
"../../../node_modules/.pnpm/qs@6.15.2/node_modules/qs/lib/index.js"(exports2, module4) {
|
|
110874
110905
|
"use strict";
|
|
110875
110906
|
var stringify5 = require_stringify();
|
|
110876
110907
|
var parse19 = require_parse2();
|
|
@@ -669350,7 +669381,7 @@ var AccessTokenPosthogManager = class {
|
|
|
669350
669381
|
properties: {
|
|
669351
669382
|
...event,
|
|
669352
669383
|
...event.properties,
|
|
669353
|
-
version: "5.
|
|
669384
|
+
version: "5.40.1",
|
|
669354
669385
|
usingAccessToken: true,
|
|
669355
669386
|
...getRunIdProperties()
|
|
669356
669387
|
}
|
|
@@ -669414,7 +669445,7 @@ var UserPosthogManager = class {
|
|
|
669414
669445
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
669415
669446
|
event: "CLI",
|
|
669416
669447
|
properties: {
|
|
669417
|
-
version: "5.
|
|
669448
|
+
version: "5.40.1",
|
|
669418
669449
|
...event,
|
|
669419
669450
|
...event.properties,
|
|
669420
669451
|
usingAccessToken: false,
|
|
@@ -854957,6 +854988,22 @@ var import_path58 = __toESM(require("path"), 1);
|
|
|
854957
854988
|
// ../yaml/docs-validator/lib/rules/valid-markdown-link/check-if-pathname-exists.js
|
|
854958
854989
|
init_lib8();
|
|
854959
854990
|
|
|
854991
|
+
// ../yaml/docs-validator/lib/rules/valid-markdown-link/dynamic-special-doc-page.js
|
|
854992
|
+
var DYNAMIC_SPEC_PATTERN = /^\/(openapi|asyncapi)\/.+\.(json|ya?ml)$/;
|
|
854993
|
+
function isDynamicSpecialDocPage(pathname, basePath) {
|
|
854994
|
+
if (DYNAMIC_SPEC_PATTERN.test(pathname)) {
|
|
854995
|
+
return true;
|
|
854996
|
+
}
|
|
854997
|
+
if (basePath != null) {
|
|
854998
|
+
const normalizedBase = basePath.startsWith("/") ? basePath : `/${basePath}`;
|
|
854999
|
+
if (pathname.startsWith(normalizedBase)) {
|
|
855000
|
+
const withoutBase = pathname.slice(normalizedBase.length);
|
|
855001
|
+
return DYNAMIC_SPEC_PATTERN.test(withoutBase);
|
|
855002
|
+
}
|
|
855003
|
+
}
|
|
855004
|
+
return false;
|
|
855005
|
+
}
|
|
855006
|
+
|
|
854960
855007
|
// ../yaml/docs-validator/lib/rules/valid-markdown-link/redirect-for-path.js
|
|
854961
855008
|
var import_url_join22 = __toESM(require_url_join(), 1);
|
|
854962
855009
|
function matchPath2(pattern, path117) {
|
|
@@ -855046,6 +855093,9 @@ async function checkIfPathnameExists({ pathname, markdown, absoluteFilepath, wor
|
|
|
855046
855093
|
if (isExternalUrl2(redirectedPath)) {
|
|
855047
855094
|
return true;
|
|
855048
855095
|
}
|
|
855096
|
+
if (isDynamicSpecialDocPage(redirectedPath, baseUrl.basePath)) {
|
|
855097
|
+
return true;
|
|
855098
|
+
}
|
|
855049
855099
|
if (markdown && pageSlugs.has(removeLeadingSlash(redirectedPath))) {
|
|
855050
855100
|
return true;
|
|
855051
855101
|
}
|
|
@@ -855441,7 +855491,16 @@ var ValidMarkdownLinks = {
|
|
|
855441
855491
|
});
|
|
855442
855492
|
const versionSlugs = collector.getVersionNodes().map((v9) => v9.slug);
|
|
855443
855493
|
const productSlugs = collector.getProductNodes().filter(navigation_exports.isInternalProductNode).map((p14) => p14.slug);
|
|
855444
|
-
const specialDocPages = [
|
|
855494
|
+
const specialDocPages = [
|
|
855495
|
+
"/llms-full.txt",
|
|
855496
|
+
"/llms.txt",
|
|
855497
|
+
"/openapi.json",
|
|
855498
|
+
"/openapi.yaml",
|
|
855499
|
+
"/openapi.yml",
|
|
855500
|
+
"/asyncapi.json",
|
|
855501
|
+
"/asyncapi.yaml",
|
|
855502
|
+
"/asyncapi.yml"
|
|
855503
|
+
];
|
|
855445
855504
|
for (const specialPage of specialDocPages) {
|
|
855446
855505
|
const pageWithBasePath = baseUrl.basePath ? `${removeLeadingSlash(baseUrl.basePath)}${specialPage}` : removeLeadingSlash(specialPage);
|
|
855447
855506
|
visitableSlugs.add(pageWithBasePath);
|
|
@@ -860327,7 +860386,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
860327
860386
|
var LOGS_FOLDER_NAME = "logs";
|
|
860328
860387
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
860329
860388
|
function getCliSource() {
|
|
860330
|
-
const version7 = "5.
|
|
860389
|
+
const version7 = "5.40.1";
|
|
860331
860390
|
return `cli@${version7}`;
|
|
860332
860391
|
}
|
|
860333
860392
|
var DebugLogger = class {
|
|
@@ -880967,7 +881026,7 @@ var LegacyDocsPublisher = class {
|
|
|
880967
881026
|
previewId,
|
|
880968
881027
|
disableTemplates: void 0,
|
|
880969
881028
|
skipUpload,
|
|
880970
|
-
cliVersion: "5.
|
|
881029
|
+
cliVersion: "5.40.1",
|
|
880971
881030
|
loginCommand: "fern auth login"
|
|
880972
881031
|
});
|
|
880973
881032
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -955887,7 +955946,7 @@ function getAutomationContextFromEnv() {
|
|
|
955887
955946
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
955888
955947
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
955889
955948
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
955890
|
-
cli_version: "5.
|
|
955949
|
+
cli_version: "5.40.1"
|
|
955891
955950
|
};
|
|
955892
955951
|
}
|
|
955893
955952
|
function isAutomationMode() {
|
|
@@ -956713,7 +956772,7 @@ var CliContext = class _CliContext {
|
|
|
956713
956772
|
if (false) {
|
|
956714
956773
|
this.logger.error("CLI_VERSION is not defined");
|
|
956715
956774
|
}
|
|
956716
|
-
return "5.
|
|
956775
|
+
return "5.40.1";
|
|
956717
956776
|
}
|
|
956718
956777
|
getCliName() {
|
|
956719
956778
|
if (false) {
|
|
@@ -965437,6 +965496,99 @@ Found ${previewDeployments.length} preview deployment(s):
|
|
|
965437
965496
|
});
|
|
965438
965497
|
}
|
|
965439
965498
|
|
|
965499
|
+
// src/commands/docs-theme/deleteDocsTheme.ts
|
|
965500
|
+
var import_node_readline6 = require("readline");
|
|
965501
|
+
init_lib6();
|
|
965502
|
+
|
|
965503
|
+
// src/commands/docs-theme/themeOrigin.ts
|
|
965504
|
+
var FDR_ORIGIN = process.env.OVERRIDE_FDR_ORIGIN ?? "https://registry.buildwithfern.com";
|
|
965505
|
+
function describeFetchError(error50) {
|
|
965506
|
+
if (!(error50 instanceof Error)) {
|
|
965507
|
+
return String(error50);
|
|
965508
|
+
}
|
|
965509
|
+
const cause = error50.cause;
|
|
965510
|
+
if (cause instanceof Error) {
|
|
965511
|
+
return cause.message;
|
|
965512
|
+
}
|
|
965513
|
+
return error50.message;
|
|
965514
|
+
}
|
|
965515
|
+
function parseErrorDetail(body) {
|
|
965516
|
+
try {
|
|
965517
|
+
const parsed = JSON.parse(body);
|
|
965518
|
+
const message = parsed.message ?? parsed.error?.message;
|
|
965519
|
+
if (typeof message === "string") {
|
|
965520
|
+
return message;
|
|
965521
|
+
}
|
|
965522
|
+
} catch {
|
|
965523
|
+
}
|
|
965524
|
+
return void 0;
|
|
965525
|
+
}
|
|
965526
|
+
|
|
965527
|
+
// src/commands/docs-theme/deleteDocsTheme.ts
|
|
965528
|
+
async function confirmDeletion(themeName) {
|
|
965529
|
+
const rl5 = (0, import_node_readline6.createInterface)({ input: process.stdin, output: process.stderr });
|
|
965530
|
+
return new Promise((resolve15) => {
|
|
965531
|
+
rl5.question(`Are you sure you want to delete the theme "${themeName}"? (y/N) `, (answer) => {
|
|
965532
|
+
rl5.close();
|
|
965533
|
+
resolve15(answer.trim().toLowerCase() === "y");
|
|
965534
|
+
});
|
|
965535
|
+
});
|
|
965536
|
+
}
|
|
965537
|
+
async function deleteDocsTheme({
|
|
965538
|
+
cliContext,
|
|
965539
|
+
name: name2,
|
|
965540
|
+
force
|
|
965541
|
+
}) {
|
|
965542
|
+
const token = await cliContext.runTask(async (context3) => {
|
|
965543
|
+
return askToLogin(context3);
|
|
965544
|
+
});
|
|
965545
|
+
if (token == null) {
|
|
965546
|
+
cliContext.failAndThrow("Failed to authenticate. Please run 'fern login' first.", void 0, {
|
|
965547
|
+
code: CliError.Code.AuthError
|
|
965548
|
+
});
|
|
965549
|
+
return;
|
|
965550
|
+
}
|
|
965551
|
+
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
965552
|
+
commandLineApiWorkspace: void 0,
|
|
965553
|
+
defaultToAllApiWorkspaces: true
|
|
965554
|
+
});
|
|
965555
|
+
const orgId = project.config.organization;
|
|
965556
|
+
if (!force) {
|
|
965557
|
+
const confirmed = await confirmDeletion(name2);
|
|
965558
|
+
if (!confirmed) {
|
|
965559
|
+
cliContext.logger.info("Deletion cancelled.");
|
|
965560
|
+
return;
|
|
965561
|
+
}
|
|
965562
|
+
}
|
|
965563
|
+
await cliContext.runTask(async (context3) => {
|
|
965564
|
+
const deleteUrl = `${FDR_ORIGIN}/v2/registry/themes/${orgId}/${encodeURIComponent(name2)}`;
|
|
965565
|
+
context3.logger.debug(`Deleting theme at ${deleteUrl}`);
|
|
965566
|
+
let res;
|
|
965567
|
+
try {
|
|
965568
|
+
res = await fetch(deleteUrl, {
|
|
965569
|
+
method: "DELETE",
|
|
965570
|
+
headers: { Authorization: `Bearer ${token.value}` }
|
|
965571
|
+
});
|
|
965572
|
+
} catch (err) {
|
|
965573
|
+
context3.failAndThrow(
|
|
965574
|
+
`Failed to delete theme "${name2}" \u2014 could not reach ${FDR_ORIGIN}: ${describeFetchError(err)}`,
|
|
965575
|
+
void 0,
|
|
965576
|
+
{ code: CliError.Code.NetworkError }
|
|
965577
|
+
);
|
|
965578
|
+
return;
|
|
965579
|
+
}
|
|
965580
|
+
if (!res.ok) {
|
|
965581
|
+
const body = await res.text();
|
|
965582
|
+
const detail = parseErrorDetail(body) ?? body;
|
|
965583
|
+
context3.failAndThrow(`Failed to delete theme "${name2}": HTTP ${res.status} \u2014 ${detail}`, void 0, {
|
|
965584
|
+
code: CliError.Code.NetworkError
|
|
965585
|
+
});
|
|
965586
|
+
return;
|
|
965587
|
+
}
|
|
965588
|
+
context3.logger.info(`Theme "${name2}" deleted for org "${orgId}"`);
|
|
965589
|
+
});
|
|
965590
|
+
}
|
|
965591
|
+
|
|
965440
965592
|
// src/commands/docs-theme/exportDocsTheme.ts
|
|
965441
965593
|
init_lib6();
|
|
965442
965594
|
|
|
@@ -965525,32 +965677,6 @@ async function exportDocsTheme({
|
|
|
965525
965677
|
|
|
965526
965678
|
// src/commands/docs-theme/listDocsThemes.ts
|
|
965527
965679
|
init_lib6();
|
|
965528
|
-
|
|
965529
|
-
// src/commands/docs-theme/themeOrigin.ts
|
|
965530
|
-
var FDR_ORIGIN = process.env.OVERRIDE_FDR_ORIGIN ?? "https://registry.buildwithfern.com";
|
|
965531
|
-
function describeFetchError(error50) {
|
|
965532
|
-
if (!(error50 instanceof Error)) {
|
|
965533
|
-
return String(error50);
|
|
965534
|
-
}
|
|
965535
|
-
const cause = error50.cause;
|
|
965536
|
-
if (cause instanceof Error) {
|
|
965537
|
-
return cause.message;
|
|
965538
|
-
}
|
|
965539
|
-
return error50.message;
|
|
965540
|
-
}
|
|
965541
|
-
function parseErrorDetail(body) {
|
|
965542
|
-
try {
|
|
965543
|
-
const parsed = JSON.parse(body);
|
|
965544
|
-
const message = parsed.message ?? parsed.error?.message;
|
|
965545
|
-
if (typeof message === "string") {
|
|
965546
|
-
return message;
|
|
965547
|
-
}
|
|
965548
|
-
} catch {
|
|
965549
|
-
}
|
|
965550
|
-
return void 0;
|
|
965551
|
-
}
|
|
965552
|
-
|
|
965553
|
-
// src/commands/docs-theme/listDocsThemes.ts
|
|
965554
965680
|
async function listDocsThemes({
|
|
965555
965681
|
cliContext,
|
|
965556
965682
|
org,
|
|
@@ -973035,12 +973161,33 @@ function addDocsCommand2(cli, cliContext) {
|
|
|
973035
973161
|
}
|
|
973036
973162
|
function addDocsThemeCommand(cli, cliContext) {
|
|
973037
973163
|
cli.command("theme", "Manage org-level themes for your documentation", (yargs) => {
|
|
973164
|
+
addDocsThemeDeleteCommand(yargs, cliContext);
|
|
973038
973165
|
addDocsThemeExportCommand(yargs, cliContext);
|
|
973039
973166
|
addDocsThemeListCommand(yargs, cliContext);
|
|
973040
973167
|
addDocsThemeUploadCommand(yargs, cliContext);
|
|
973041
973168
|
return yargs;
|
|
973042
973169
|
});
|
|
973043
973170
|
}
|
|
973171
|
+
function addDocsThemeDeleteCommand(cli, cliContext) {
|
|
973172
|
+
cli.command(
|
|
973173
|
+
"delete",
|
|
973174
|
+
false,
|
|
973175
|
+
(yargs) => yargs.option("name", {
|
|
973176
|
+
alias: "n",
|
|
973177
|
+
type: "string",
|
|
973178
|
+
description: "Name of the theme to delete",
|
|
973179
|
+
demandOption: true
|
|
973180
|
+
}).option("force", {
|
|
973181
|
+
alias: "f",
|
|
973182
|
+
type: "boolean",
|
|
973183
|
+
description: "Skip the confirmation prompt"
|
|
973184
|
+
}).example("$0 docs theme delete --name dark", "Delete the theme named 'dark'").example("$0 docs theme delete --name dark --force", "Delete without confirmation"),
|
|
973185
|
+
async (argv) => {
|
|
973186
|
+
cliContext.instrumentPostHogEvent({ command: "fern docs theme delete" });
|
|
973187
|
+
await deleteDocsTheme({ cliContext, name: argv.name, force: argv.force });
|
|
973188
|
+
}
|
|
973189
|
+
);
|
|
973190
|
+
}
|
|
973044
973191
|
function addDocsThemeExportCommand(cli, cliContext) {
|
|
973045
973192
|
cli.command(
|
|
973046
973193
|
"export",
|
package/package.json
CHANGED