@fern-api/fern-api-dev 5.84.0 → 5.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.cjs +1214 -116
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -45336,11 +45336,11 @@ var init_AbsoluteFilePath = __esm({
|
|
|
45336
45336
|
|
|
45337
45337
|
// ../../commons/path-utils/lib/basename.js
|
|
45338
45338
|
function basename3(path120, options2) {
|
|
45339
|
-
const
|
|
45339
|
+
const basename8 = path120.split("/").pop() ?? path120;
|
|
45340
45340
|
if (options2?.stripExtension) {
|
|
45341
|
-
return
|
|
45341
|
+
return basename8.split(".")[0] ?? basename8;
|
|
45342
45342
|
}
|
|
45343
|
-
return
|
|
45343
|
+
return basename8;
|
|
45344
45344
|
}
|
|
45345
45345
|
var init_basename = __esm({
|
|
45346
45346
|
"../../commons/path-utils/lib/basename.js"() {
|
|
@@ -53603,8 +53603,8 @@ var require_tmp = __commonJS({
|
|
|
53603
53603
|
if (!_isUndefined(options2.name)) {
|
|
53604
53604
|
const name2 = options2.name;
|
|
53605
53605
|
if (path120.isAbsolute(name2)) throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
53606
|
-
const
|
|
53607
|
-
if (
|
|
53606
|
+
const basename8 = path120.basename(name2);
|
|
53607
|
+
if (basename8 === ".." || basename8 === "." || basename8 !== name2) {
|
|
53608
53608
|
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
53609
53609
|
}
|
|
53610
53610
|
}
|
|
@@ -100826,7 +100826,7 @@ var require_graceful_fs = __commonJS({
|
|
|
100826
100826
|
polyfills(fs35);
|
|
100827
100827
|
fs35.gracefulify = patch5;
|
|
100828
100828
|
fs35.createReadStream = createReadStream5;
|
|
100829
|
-
fs35.createWriteStream =
|
|
100829
|
+
fs35.createWriteStream = createWriteStream9;
|
|
100830
100830
|
var fs$readFile = fs35.readFile;
|
|
100831
100831
|
fs35.readFile = readFile121;
|
|
100832
100832
|
function readFile121(path120, options2, cb) {
|
|
@@ -101038,7 +101038,7 @@ var require_graceful_fs = __commonJS({
|
|
|
101038
101038
|
function createReadStream5(path120, options2) {
|
|
101039
101039
|
return new fs35.ReadStream(path120, options2);
|
|
101040
101040
|
}
|
|
101041
|
-
function
|
|
101041
|
+
function createWriteStream9(path120, options2) {
|
|
101042
101042
|
return new fs35.WriteStream(path120, options2);
|
|
101043
101043
|
}
|
|
101044
101044
|
var fs$open = fs35.open;
|
|
@@ -130521,6 +130521,7 @@ var init_OpenApiSettingsSchema2 = __esm({
|
|
|
130521
130521
|
"additional-properties-defaults-to": schemas_exports8.boolean().optional(),
|
|
130522
130522
|
"type-dates-as-strings": schemas_exports8.boolean().optional(),
|
|
130523
130523
|
"preserve-single-schema-oneof": schemas_exports8.boolean().optional(),
|
|
130524
|
+
"preserve-one-of-in-all-of": schemas_exports8.boolean().optional(),
|
|
130524
130525
|
"inline-all-of-schemas": schemas_exports8.boolean().optional(),
|
|
130525
130526
|
"resolve-aliases": ResolveAliases.optional(),
|
|
130526
130527
|
"group-multi-api-environments": schemas_exports8.boolean().optional(),
|
|
@@ -152350,6 +152351,7 @@ var init_options2 = __esm({
|
|
|
152350
152351
|
additionalPropertiesDefaultsTo: false,
|
|
152351
152352
|
typeDatesAsStrings: false,
|
|
152352
152353
|
preserveSingleSchemaOneOf: false,
|
|
152354
|
+
preserveOneOfInAllOf: false,
|
|
152353
152355
|
inlineAllOfSchemas: false,
|
|
152354
152356
|
resolveAliases: false,
|
|
152355
152357
|
groupMultiApiEnvironments: false,
|
|
@@ -199499,6 +199501,7 @@ var init_getAPIDefinitionSettings = __esm({
|
|
|
199499
199501
|
additionalPropertiesDefaultsTo: "additionalPropertiesDefaultsTo",
|
|
199500
199502
|
typeDatesAsStrings: "typeDatesAsStrings",
|
|
199501
199503
|
preserveSingleSchemaOneOf: "preserveSingleSchemaOneOf",
|
|
199504
|
+
preserveOneOfInAllOf: "preserveOneOfInAllOf",
|
|
199502
199505
|
inlineAllOfSchemas: "inlineAllOfSchemas",
|
|
199503
199506
|
resolveAliases: "resolveAliases",
|
|
199504
199507
|
groupMultiApiEnvironments: "groupMultiApiEnvironments",
|
|
@@ -261165,6 +261168,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
|
|
|
261165
261168
|
additionalPropertiesDefaultsTo: settings?.["additional-properties-defaults-to"],
|
|
261166
261169
|
typeDatesAsStrings: settings?.["type-dates-as-strings"],
|
|
261167
261170
|
preserveSingleSchemaOneOf: settings?.["preserve-single-schema-oneof"],
|
|
261171
|
+
preserveOneOfInAllOf: settings?.["preserve-one-of-in-all-of"],
|
|
261168
261172
|
inlineAllOfSchemas: settings?.["inline-all-of-schemas"],
|
|
261169
261173
|
resolveAliases: settings?.["resolve-aliases"],
|
|
261170
261174
|
groupMultiApiEnvironments: settings?.["group-multi-api-environments"],
|
|
@@ -262023,6 +262027,7 @@ var init_convertGeneratorsConfiguration = __esm({
|
|
|
262023
262027
|
additionalPropertiesDefaultsTo: void 0,
|
|
262024
262028
|
typeDatesAsStrings: void 0,
|
|
262025
262029
|
preserveSingleSchemaOneOf: void 0,
|
|
262030
|
+
preserveOneOfInAllOf: void 0,
|
|
262026
262031
|
inlineAllOfSchemas: void 0,
|
|
262027
262032
|
resolveAliases: void 0,
|
|
262028
262033
|
groupMultiApiEnvironments: void 0,
|
|
@@ -347777,6 +347782,8 @@ var init_SchemaConverter = __esm({
|
|
|
347777
347782
|
"extensions"
|
|
347778
347783
|
];
|
|
347779
347784
|
SchemaConverter = class _SchemaConverter extends AbstractConverter {
|
|
347785
|
+
/** Upper bound on the variants produced by distributing an allOf over its unions. */
|
|
347786
|
+
static MAX_DISTRIBUTED_VARIANTS = 64;
|
|
347780
347787
|
schema;
|
|
347781
347788
|
id;
|
|
347782
347789
|
inlined;
|
|
@@ -347804,6 +347811,10 @@ var init_SchemaConverter = __esm({
|
|
|
347804
347811
|
if (maybeConvertedEnumSchema != null) {
|
|
347805
347812
|
return maybeConvertedEnumSchema;
|
|
347806
347813
|
}
|
|
347814
|
+
const maybeDistributedAllOfOverOneOf = this.tryDistributeAllOfOverOneOf();
|
|
347815
|
+
if (maybeDistributedAllOfOverOneOf != null) {
|
|
347816
|
+
return maybeDistributedAllOfOverOneOf;
|
|
347817
|
+
}
|
|
347807
347818
|
const maybeConvertedSingularAllOfSchema = this.tryConvertSingularAllOfSchema();
|
|
347808
347819
|
if (maybeConvertedSingularAllOfSchema != null) {
|
|
347809
347820
|
return maybeConvertedSingularAllOfSchema;
|
|
@@ -348001,6 +348012,101 @@ var init_SchemaConverter = __esm({
|
|
|
348001
348012
|
}
|
|
348002
348013
|
return void 0;
|
|
348003
348014
|
}
|
|
348015
|
+
/**
|
|
348016
|
+
* Distributes an allOf whose members include a union over that union, so that
|
|
348017
|
+
* `allOf: [oneOf: [A, B], S]` is converted as `oneOf: [allOf: [A, S], allOf: [B, S]]`.
|
|
348018
|
+
* Otherwise the union member is flattened into the parent object and its variants are lost.
|
|
348019
|
+
*
|
|
348020
|
+
* Only the first union is distributed here; the remaining allOf members are re-injected into
|
|
348021
|
+
* every variant, so any further unions are distributed by the recursive conversion below.
|
|
348022
|
+
*/
|
|
348023
|
+
tryDistributeAllOfOverOneOf() {
|
|
348024
|
+
if (!this.context.settings.preserveOneOfInAllOf) {
|
|
348025
|
+
return void 0;
|
|
348026
|
+
}
|
|
348027
|
+
const allOf = this.schema.allOf;
|
|
348028
|
+
if (!Array.isArray(allOf) || allOf.length === 0) {
|
|
348029
|
+
return void 0;
|
|
348030
|
+
}
|
|
348031
|
+
if (this.schema.oneOf != null || this.schema.anyOf != null) {
|
|
348032
|
+
return void 0;
|
|
348033
|
+
}
|
|
348034
|
+
const unions = this.getDistributableUnions(allOf);
|
|
348035
|
+
const firstUnion = unions[0];
|
|
348036
|
+
if (firstUnion == null) {
|
|
348037
|
+
return void 0;
|
|
348038
|
+
}
|
|
348039
|
+
const variantCount = unions.reduce((count, union23) => count * union23.variants.length, 1);
|
|
348040
|
+
if (variantCount > _SchemaConverter.MAX_DISTRIBUTED_VARIANTS) {
|
|
348041
|
+
this.context.logger.warn(`Not distributing allOf over its ${unions.length} unions at ${this.breadcrumbs.join(".")}: it would produce ${variantCount} variants (max ${_SchemaConverter.MAX_DISTRIBUTED_VARIANTS}).`);
|
|
348042
|
+
return void 0;
|
|
348043
|
+
}
|
|
348044
|
+
const sharedElements = allOf.filter((_5, index3) => index3 !== firstUnion.index);
|
|
348045
|
+
if (this.schema.properties != null || this.schema.required != null) {
|
|
348046
|
+
sharedElements.push({
|
|
348047
|
+
type: "object",
|
|
348048
|
+
properties: this.schema.properties,
|
|
348049
|
+
required: this.schema.required
|
|
348050
|
+
});
|
|
348051
|
+
}
|
|
348052
|
+
const siblings = { ...this.schema };
|
|
348053
|
+
delete siblings.allOf;
|
|
348054
|
+
delete siblings.properties;
|
|
348055
|
+
delete siblings.required;
|
|
348056
|
+
const distributedConverter = new _SchemaConverter({
|
|
348057
|
+
context: this.context,
|
|
348058
|
+
breadcrumbs: this.breadcrumbs,
|
|
348059
|
+
schema: {
|
|
348060
|
+
...siblings,
|
|
348061
|
+
oneOf: firstUnion.variants.map((variant) => {
|
|
348062
|
+
const title2 = this.getVariantTitle(variant);
|
|
348063
|
+
return { ...title2 != null ? { title: title2 } : {}, allOf: [variant, ...sharedElements] };
|
|
348064
|
+
})
|
|
348065
|
+
},
|
|
348066
|
+
id: this.id,
|
|
348067
|
+
inlined: this.inlined,
|
|
348068
|
+
nameOverride: this.nameOverride,
|
|
348069
|
+
visitedRefs: this.visitedRefs
|
|
348070
|
+
});
|
|
348071
|
+
return distributedConverter.convert();
|
|
348072
|
+
}
|
|
348073
|
+
getVariantTitle(variant) {
|
|
348074
|
+
if (!this.context.isReferenceObject(variant)) {
|
|
348075
|
+
return variant.title;
|
|
348076
|
+
}
|
|
348077
|
+
const resolved = this.context.resolveMaybeReference({
|
|
348078
|
+
schemaOrReference: variant,
|
|
348079
|
+
breadcrumbs: this.breadcrumbs
|
|
348080
|
+
});
|
|
348081
|
+
return resolved?.title ?? variant.$ref.split("/").pop();
|
|
348082
|
+
}
|
|
348083
|
+
/**
|
|
348084
|
+
* The allOf members that are plain unions of the parent's shape, in declaration order.
|
|
348085
|
+
*/
|
|
348086
|
+
getDistributableUnions(allOf) {
|
|
348087
|
+
const unions = [];
|
|
348088
|
+
for (const [index3, element4] of allOf.entries()) {
|
|
348089
|
+
const resolved = this.context.isReferenceObject(element4) ? this.context.resolveMaybeReference({
|
|
348090
|
+
schemaOrReference: element4,
|
|
348091
|
+
breadcrumbs: this.breadcrumbs
|
|
348092
|
+
}) : element4;
|
|
348093
|
+
if (resolved == null || resolved.properties != null) {
|
|
348094
|
+
continue;
|
|
348095
|
+
}
|
|
348096
|
+
if (resolved.type != null && resolved.type !== "object") {
|
|
348097
|
+
continue;
|
|
348098
|
+
}
|
|
348099
|
+
if (resolved.discriminator != null) {
|
|
348100
|
+
continue;
|
|
348101
|
+
}
|
|
348102
|
+
const variants = resolved.oneOf ?? resolved.anyOf;
|
|
348103
|
+
if (variants == null || variants.length === 0) {
|
|
348104
|
+
continue;
|
|
348105
|
+
}
|
|
348106
|
+
unions.push({ index: index3, variants });
|
|
348107
|
+
}
|
|
348108
|
+
return unions;
|
|
348109
|
+
}
|
|
348004
348110
|
tryConvertPrimitiveSchema() {
|
|
348005
348111
|
const primitiveConverter = new PrimitiveSchemaConverter({ context: this.context, schema: this.schema });
|
|
348006
348112
|
const primitiveType2 = primitiveConverter.convert();
|
|
@@ -359353,8 +359459,8 @@ var init_ProtobufIRGenerator = __esm({
|
|
|
359353
359459
|
await (0, import_promises35.cp)(absoluteFilepathToProtobufRoot, protobufGeneratorConfigPath, {
|
|
359354
359460
|
recursive: true,
|
|
359355
359461
|
filter: (src) => {
|
|
359356
|
-
const
|
|
359357
|
-
return
|
|
359462
|
+
const basename8 = import_path41.default.basename(src);
|
|
359463
|
+
return basename8 !== "buf.yaml" && !(basename8.startsWith("buf.gen.") && basename8.endsWith(".yaml"));
|
|
359358
359464
|
}
|
|
359359
359465
|
});
|
|
359360
359466
|
}
|
|
@@ -473781,7 +473887,7 @@ var require_view = __commonJS({
|
|
|
473781
473887
|
var path120 = require("path");
|
|
473782
473888
|
var fs34 = require("fs");
|
|
473783
473889
|
var dirname22 = path120.dirname;
|
|
473784
|
-
var
|
|
473890
|
+
var basename8 = path120.basename;
|
|
473785
473891
|
var extname2 = path120.extname;
|
|
473786
473892
|
var join28 = path120.join;
|
|
473787
473893
|
var resolve15 = path120.resolve;
|
|
@@ -473820,7 +473926,7 @@ var require_view = __commonJS({
|
|
|
473820
473926
|
var root6 = roots[i5];
|
|
473821
473927
|
var loc = resolve15(root6, name2);
|
|
473822
473928
|
var dir = dirname22(loc);
|
|
473823
|
-
var file4 =
|
|
473929
|
+
var file4 = basename8(loc);
|
|
473824
473930
|
path121 = this.resolve(dir, file4);
|
|
473825
473931
|
}
|
|
473826
473932
|
return path121;
|
|
@@ -473836,7 +473942,7 @@ var require_view = __commonJS({
|
|
|
473836
473942
|
if (stat7 && stat7.isFile()) {
|
|
473837
473943
|
return path121;
|
|
473838
473944
|
}
|
|
473839
|
-
path121 = join28(dir,
|
|
473945
|
+
path121 = join28(dir, basename8(file4, ext2), "index" + ext2);
|
|
473840
473946
|
stat7 = tryStat(path121);
|
|
473841
473947
|
if (stat7 && stat7.isFile()) {
|
|
473842
473948
|
return path121;
|
|
@@ -473859,7 +473965,7 @@ var require_content_disposition = __commonJS({
|
|
|
473859
473965
|
"use strict";
|
|
473860
473966
|
module4.exports = contentDisposition;
|
|
473861
473967
|
module4.exports.parse = parse19;
|
|
473862
|
-
var
|
|
473968
|
+
var basename8 = require("path").basename;
|
|
473863
473969
|
var Buffer6 = require_safe_buffer().Buffer;
|
|
473864
473970
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
473865
473971
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
@@ -473895,9 +474001,9 @@ var require_content_disposition = __commonJS({
|
|
|
473895
474001
|
if (typeof fallback2 === "string" && NON_LATIN1_REGEXP.test(fallback2)) {
|
|
473896
474002
|
throw new TypeError("fallback must be ISO-8859-1 string");
|
|
473897
474003
|
}
|
|
473898
|
-
var name2 =
|
|
474004
|
+
var name2 = basename8(filename);
|
|
473899
474005
|
var isQuotedString = TEXT_REGEXP.test(name2);
|
|
473900
|
-
var fallbackName = typeof fallback2 !== "string" ? fallback2 && getlatin1(name2) :
|
|
474006
|
+
var fallbackName = typeof fallback2 !== "string" ? fallback2 && getlatin1(name2) : basename8(fallback2);
|
|
473901
474007
|
var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
|
|
473902
474008
|
if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
|
|
473903
474009
|
params2["filename*"] = name2;
|
|
@@ -482688,7 +482794,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482688
482794
|
polyfills(fs35);
|
|
482689
482795
|
fs35.gracefulify = patch5;
|
|
482690
482796
|
fs35.createReadStream = createReadStream5;
|
|
482691
|
-
fs35.createWriteStream =
|
|
482797
|
+
fs35.createWriteStream = createWriteStream9;
|
|
482692
482798
|
var fs$readFile = fs35.readFile;
|
|
482693
482799
|
fs35.readFile = readFile121;
|
|
482694
482800
|
function readFile121(path120, options2, cb) {
|
|
@@ -482900,7 +483006,7 @@ var require_graceful_fs2 = __commonJS({
|
|
|
482900
483006
|
function createReadStream5(path120, options2) {
|
|
482901
483007
|
return new fs35.ReadStream(path120, options2);
|
|
482902
483008
|
}
|
|
482903
|
-
function
|
|
483009
|
+
function createWriteStream9(path120, options2) {
|
|
482904
483010
|
return new fs35.WriteStream(path120, options2);
|
|
482905
483011
|
}
|
|
482906
483012
|
var fs$open = fs35.open;
|
|
@@ -490724,7 +490830,7 @@ var require_yauzl = __commonJS({
|
|
|
490724
490830
|
exports2.getFileNameLowLevel = getFileNameLowLevel;
|
|
490725
490831
|
exports2.validateFileName = validateFileName;
|
|
490726
490832
|
exports2.parseExtraFields = parseExtraFields;
|
|
490727
|
-
exports2.ZipFile =
|
|
490833
|
+
exports2.ZipFile = ZipFile2;
|
|
490728
490834
|
exports2.Entry = Entry;
|
|
490729
490835
|
exports2.LocalFileHeader = LocalFileHeader;
|
|
490730
490836
|
exports2.RandomAccessReader = RandomAccessReader;
|
|
@@ -490833,19 +490939,19 @@ var require_yauzl = __commonJS({
|
|
|
490833
490939
|
}
|
|
490834
490940
|
entryCount = readUInt64LE(zip64EocdrBuffer, 32);
|
|
490835
490941
|
centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48);
|
|
490836
|
-
return callback(null, new
|
|
490942
|
+
return callback(null, new ZipFile2(reader, centralDirectoryOffset, totalSize, entryCount, comment6, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
|
|
490837
490943
|
});
|
|
490838
490944
|
}
|
|
490839
490945
|
if (diskNumber !== 0) {
|
|
490840
490946
|
return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber));
|
|
490841
490947
|
}
|
|
490842
|
-
return callback(null, new
|
|
490948
|
+
return callback(null, new ZipFile2(reader, centralDirectoryOffset, totalSize, entryCount, comment6, options2.autoClose, options2.lazyEntries, decodeStrings, options2.validateEntrySizes, options2.strictFileNames));
|
|
490843
490949
|
}
|
|
490844
490950
|
callback(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."));
|
|
490845
490951
|
});
|
|
490846
490952
|
}
|
|
490847
|
-
util5.inherits(
|
|
490848
|
-
function
|
|
490953
|
+
util5.inherits(ZipFile2, EventEmitter9);
|
|
490954
|
+
function ZipFile2(reader, centralDirectoryOffset, fileSize, entryCount, comment6, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) {
|
|
490849
490955
|
var self2 = this;
|
|
490850
490956
|
EventEmitter9.call(self2);
|
|
490851
490957
|
self2.reader = reader;
|
|
@@ -490869,7 +490975,7 @@ var require_yauzl = __commonJS({
|
|
|
490869
490975
|
self2.emittedError = false;
|
|
490870
490976
|
if (!self2.lazyEntries) self2._readEntry();
|
|
490871
490977
|
}
|
|
490872
|
-
|
|
490978
|
+
ZipFile2.prototype.close = function() {
|
|
490873
490979
|
if (!this.isOpen) return;
|
|
490874
490980
|
this.isOpen = false;
|
|
490875
490981
|
this.reader.unref();
|
|
@@ -490883,11 +490989,11 @@ var require_yauzl = __commonJS({
|
|
|
490883
490989
|
self2.emittedError = true;
|
|
490884
490990
|
self2.emit("error", err);
|
|
490885
490991
|
}
|
|
490886
|
-
|
|
490992
|
+
ZipFile2.prototype.readEntry = function() {
|
|
490887
490993
|
if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true");
|
|
490888
490994
|
this._readEntry();
|
|
490889
490995
|
};
|
|
490890
|
-
|
|
490996
|
+
ZipFile2.prototype._readEntry = function() {
|
|
490891
490997
|
var self2 = this;
|
|
490892
490998
|
if (self2.entryCount === self2.entriesRead) {
|
|
490893
490999
|
setImmediate(function() {
|
|
@@ -490991,7 +491097,7 @@ var require_yauzl = __commonJS({
|
|
|
490991
491097
|
});
|
|
490992
491098
|
});
|
|
490993
491099
|
};
|
|
490994
|
-
|
|
491100
|
+
ZipFile2.prototype.openReadStream = function(entry, options2, callback) {
|
|
490995
491101
|
var self2 = this;
|
|
490996
491102
|
var relativeStart = 0;
|
|
490997
491103
|
var relativeEnd = entry.compressedSize;
|
|
@@ -491073,7 +491179,7 @@ var require_yauzl = __commonJS({
|
|
|
491073
491179
|
);
|
|
491074
491180
|
});
|
|
491075
491181
|
};
|
|
491076
|
-
|
|
491182
|
+
ZipFile2.prototype.openReadStreamLowLevel = function(fileDataStart, compressedSize, relativeStart, relativeEnd, decompress3, uncompressedSize, callback) {
|
|
491077
491183
|
var self2 = this;
|
|
491078
491184
|
var fileDataEnd = fileDataStart + compressedSize;
|
|
491079
491185
|
var readStream2 = self2.reader.createReadStream({
|
|
@@ -491110,7 +491216,7 @@ var require_yauzl = __commonJS({
|
|
|
491110
491216
|
}
|
|
491111
491217
|
callback(null, endpointStream);
|
|
491112
491218
|
};
|
|
491113
|
-
|
|
491219
|
+
ZipFile2.prototype.readLocalFileHeader = function(entry, options2, callback) {
|
|
491114
491220
|
var self2 = this;
|
|
491115
491221
|
if (callback == null) {
|
|
491116
491222
|
callback = options2;
|
|
@@ -509826,8 +509932,8 @@ var init_Page = __esm({
|
|
|
509826
509932
|
throw error50;
|
|
509827
509933
|
}
|
|
509828
509934
|
if (options2.path) {
|
|
509829
|
-
const { createWriteStream:
|
|
509830
|
-
const stream5 =
|
|
509935
|
+
const { createWriteStream: createWriteStream9 } = environment.value.fs;
|
|
509936
|
+
const stream5 = createWriteStream9(options2.path, "binary");
|
|
509831
509937
|
recorder.pipe(stream5);
|
|
509832
509938
|
}
|
|
509833
509939
|
return recorder;
|
|
@@ -560739,7 +560845,7 @@ var require_extract_zip = __commonJS({
|
|
|
560739
560845
|
"../../../node_modules/.pnpm/extract-zip@2.0.1/node_modules/extract-zip/index.js"(exports2, module4) {
|
|
560740
560846
|
"use strict";
|
|
560741
560847
|
var debug9 = require_src()("extract-zip");
|
|
560742
|
-
var { createWriteStream:
|
|
560848
|
+
var { createWriteStream: createWriteStream9, promises: fs34 } = require("fs");
|
|
560743
560849
|
var getStream = require_get_stream3();
|
|
560744
560850
|
var path120 = require("path");
|
|
560745
560851
|
var { promisify: promisify14 } = require("util");
|
|
@@ -560834,7 +560940,7 @@ var require_extract_zip = __commonJS({
|
|
|
560834
560940
|
debug9("creating symlink", link3, dest);
|
|
560835
560941
|
await fs34.symlink(link3, dest);
|
|
560836
560942
|
} else {
|
|
560837
|
-
await pipeline6(readStream2,
|
|
560943
|
+
await pipeline6(readStream2, createWriteStream9(dest, { mode: procMode }));
|
|
560838
560944
|
}
|
|
560839
560945
|
}
|
|
560840
560946
|
getExtractedMode(entryMode, isDir) {
|
|
@@ -629292,6 +629398,955 @@ var require_lib19 = __commonJS({
|
|
|
629292
629398
|
}
|
|
629293
629399
|
});
|
|
629294
629400
|
|
|
629401
|
+
// ../../../node_modules/.pnpm/buffer-crc32@1.0.0/node_modules/buffer-crc32/dist/index.cjs
|
|
629402
|
+
var require_dist26 = __commonJS({
|
|
629403
|
+
"../../../node_modules/.pnpm/buffer-crc32@1.0.0/node_modules/buffer-crc32/dist/index.cjs"(exports2, module4) {
|
|
629404
|
+
"use strict";
|
|
629405
|
+
function getDefaultExportFromCjs(x4) {
|
|
629406
|
+
return x4 && x4.__esModule && Object.prototype.hasOwnProperty.call(x4, "default") ? x4["default"] : x4;
|
|
629407
|
+
}
|
|
629408
|
+
var CRC_TABLE = new Int32Array([
|
|
629409
|
+
0,
|
|
629410
|
+
1996959894,
|
|
629411
|
+
3993919788,
|
|
629412
|
+
2567524794,
|
|
629413
|
+
124634137,
|
|
629414
|
+
1886057615,
|
|
629415
|
+
3915621685,
|
|
629416
|
+
2657392035,
|
|
629417
|
+
249268274,
|
|
629418
|
+
2044508324,
|
|
629419
|
+
3772115230,
|
|
629420
|
+
2547177864,
|
|
629421
|
+
162941995,
|
|
629422
|
+
2125561021,
|
|
629423
|
+
3887607047,
|
|
629424
|
+
2428444049,
|
|
629425
|
+
498536548,
|
|
629426
|
+
1789927666,
|
|
629427
|
+
4089016648,
|
|
629428
|
+
2227061214,
|
|
629429
|
+
450548861,
|
|
629430
|
+
1843258603,
|
|
629431
|
+
4107580753,
|
|
629432
|
+
2211677639,
|
|
629433
|
+
325883990,
|
|
629434
|
+
1684777152,
|
|
629435
|
+
4251122042,
|
|
629436
|
+
2321926636,
|
|
629437
|
+
335633487,
|
|
629438
|
+
1661365465,
|
|
629439
|
+
4195302755,
|
|
629440
|
+
2366115317,
|
|
629441
|
+
997073096,
|
|
629442
|
+
1281953886,
|
|
629443
|
+
3579855332,
|
|
629444
|
+
2724688242,
|
|
629445
|
+
1006888145,
|
|
629446
|
+
1258607687,
|
|
629447
|
+
3524101629,
|
|
629448
|
+
2768942443,
|
|
629449
|
+
901097722,
|
|
629450
|
+
1119000684,
|
|
629451
|
+
3686517206,
|
|
629452
|
+
2898065728,
|
|
629453
|
+
853044451,
|
|
629454
|
+
1172266101,
|
|
629455
|
+
3705015759,
|
|
629456
|
+
2882616665,
|
|
629457
|
+
651767980,
|
|
629458
|
+
1373503546,
|
|
629459
|
+
3369554304,
|
|
629460
|
+
3218104598,
|
|
629461
|
+
565507253,
|
|
629462
|
+
1454621731,
|
|
629463
|
+
3485111705,
|
|
629464
|
+
3099436303,
|
|
629465
|
+
671266974,
|
|
629466
|
+
1594198024,
|
|
629467
|
+
3322730930,
|
|
629468
|
+
2970347812,
|
|
629469
|
+
795835527,
|
|
629470
|
+
1483230225,
|
|
629471
|
+
3244367275,
|
|
629472
|
+
3060149565,
|
|
629473
|
+
1994146192,
|
|
629474
|
+
31158534,
|
|
629475
|
+
2563907772,
|
|
629476
|
+
4023717930,
|
|
629477
|
+
1907459465,
|
|
629478
|
+
112637215,
|
|
629479
|
+
2680153253,
|
|
629480
|
+
3904427059,
|
|
629481
|
+
2013776290,
|
|
629482
|
+
251722036,
|
|
629483
|
+
2517215374,
|
|
629484
|
+
3775830040,
|
|
629485
|
+
2137656763,
|
|
629486
|
+
141376813,
|
|
629487
|
+
2439277719,
|
|
629488
|
+
3865271297,
|
|
629489
|
+
1802195444,
|
|
629490
|
+
476864866,
|
|
629491
|
+
2238001368,
|
|
629492
|
+
4066508878,
|
|
629493
|
+
1812370925,
|
|
629494
|
+
453092731,
|
|
629495
|
+
2181625025,
|
|
629496
|
+
4111451223,
|
|
629497
|
+
1706088902,
|
|
629498
|
+
314042704,
|
|
629499
|
+
2344532202,
|
|
629500
|
+
4240017532,
|
|
629501
|
+
1658658271,
|
|
629502
|
+
366619977,
|
|
629503
|
+
2362670323,
|
|
629504
|
+
4224994405,
|
|
629505
|
+
1303535960,
|
|
629506
|
+
984961486,
|
|
629507
|
+
2747007092,
|
|
629508
|
+
3569037538,
|
|
629509
|
+
1256170817,
|
|
629510
|
+
1037604311,
|
|
629511
|
+
2765210733,
|
|
629512
|
+
3554079995,
|
|
629513
|
+
1131014506,
|
|
629514
|
+
879679996,
|
|
629515
|
+
2909243462,
|
|
629516
|
+
3663771856,
|
|
629517
|
+
1141124467,
|
|
629518
|
+
855842277,
|
|
629519
|
+
2852801631,
|
|
629520
|
+
3708648649,
|
|
629521
|
+
1342533948,
|
|
629522
|
+
654459306,
|
|
629523
|
+
3188396048,
|
|
629524
|
+
3373015174,
|
|
629525
|
+
1466479909,
|
|
629526
|
+
544179635,
|
|
629527
|
+
3110523913,
|
|
629528
|
+
3462522015,
|
|
629529
|
+
1591671054,
|
|
629530
|
+
702138776,
|
|
629531
|
+
2966460450,
|
|
629532
|
+
3352799412,
|
|
629533
|
+
1504918807,
|
|
629534
|
+
783551873,
|
|
629535
|
+
3082640443,
|
|
629536
|
+
3233442989,
|
|
629537
|
+
3988292384,
|
|
629538
|
+
2596254646,
|
|
629539
|
+
62317068,
|
|
629540
|
+
1957810842,
|
|
629541
|
+
3939845945,
|
|
629542
|
+
2647816111,
|
|
629543
|
+
81470997,
|
|
629544
|
+
1943803523,
|
|
629545
|
+
3814918930,
|
|
629546
|
+
2489596804,
|
|
629547
|
+
225274430,
|
|
629548
|
+
2053790376,
|
|
629549
|
+
3826175755,
|
|
629550
|
+
2466906013,
|
|
629551
|
+
167816743,
|
|
629552
|
+
2097651377,
|
|
629553
|
+
4027552580,
|
|
629554
|
+
2265490386,
|
|
629555
|
+
503444072,
|
|
629556
|
+
1762050814,
|
|
629557
|
+
4150417245,
|
|
629558
|
+
2154129355,
|
|
629559
|
+
426522225,
|
|
629560
|
+
1852507879,
|
|
629561
|
+
4275313526,
|
|
629562
|
+
2312317920,
|
|
629563
|
+
282753626,
|
|
629564
|
+
1742555852,
|
|
629565
|
+
4189708143,
|
|
629566
|
+
2394877945,
|
|
629567
|
+
397917763,
|
|
629568
|
+
1622183637,
|
|
629569
|
+
3604390888,
|
|
629570
|
+
2714866558,
|
|
629571
|
+
953729732,
|
|
629572
|
+
1340076626,
|
|
629573
|
+
3518719985,
|
|
629574
|
+
2797360999,
|
|
629575
|
+
1068828381,
|
|
629576
|
+
1219638859,
|
|
629577
|
+
3624741850,
|
|
629578
|
+
2936675148,
|
|
629579
|
+
906185462,
|
|
629580
|
+
1090812512,
|
|
629581
|
+
3747672003,
|
|
629582
|
+
2825379669,
|
|
629583
|
+
829329135,
|
|
629584
|
+
1181335161,
|
|
629585
|
+
3412177804,
|
|
629586
|
+
3160834842,
|
|
629587
|
+
628085408,
|
|
629588
|
+
1382605366,
|
|
629589
|
+
3423369109,
|
|
629590
|
+
3138078467,
|
|
629591
|
+
570562233,
|
|
629592
|
+
1426400815,
|
|
629593
|
+
3317316542,
|
|
629594
|
+
2998733608,
|
|
629595
|
+
733239954,
|
|
629596
|
+
1555261956,
|
|
629597
|
+
3268935591,
|
|
629598
|
+
3050360625,
|
|
629599
|
+
752459403,
|
|
629600
|
+
1541320221,
|
|
629601
|
+
2607071920,
|
|
629602
|
+
3965973030,
|
|
629603
|
+
1969922972,
|
|
629604
|
+
40735498,
|
|
629605
|
+
2617837225,
|
|
629606
|
+
3943577151,
|
|
629607
|
+
1913087877,
|
|
629608
|
+
83908371,
|
|
629609
|
+
2512341634,
|
|
629610
|
+
3803740692,
|
|
629611
|
+
2075208622,
|
|
629612
|
+
213261112,
|
|
629613
|
+
2463272603,
|
|
629614
|
+
3855990285,
|
|
629615
|
+
2094854071,
|
|
629616
|
+
198958881,
|
|
629617
|
+
2262029012,
|
|
629618
|
+
4057260610,
|
|
629619
|
+
1759359992,
|
|
629620
|
+
534414190,
|
|
629621
|
+
2176718541,
|
|
629622
|
+
4139329115,
|
|
629623
|
+
1873836001,
|
|
629624
|
+
414664567,
|
|
629625
|
+
2282248934,
|
|
629626
|
+
4279200368,
|
|
629627
|
+
1711684554,
|
|
629628
|
+
285281116,
|
|
629629
|
+
2405801727,
|
|
629630
|
+
4167216745,
|
|
629631
|
+
1634467795,
|
|
629632
|
+
376229701,
|
|
629633
|
+
2685067896,
|
|
629634
|
+
3608007406,
|
|
629635
|
+
1308918612,
|
|
629636
|
+
956543938,
|
|
629637
|
+
2808555105,
|
|
629638
|
+
3495958263,
|
|
629639
|
+
1231636301,
|
|
629640
|
+
1047427035,
|
|
629641
|
+
2932959818,
|
|
629642
|
+
3654703836,
|
|
629643
|
+
1088359270,
|
|
629644
|
+
936918e3,
|
|
629645
|
+
2847714899,
|
|
629646
|
+
3736837829,
|
|
629647
|
+
1202900863,
|
|
629648
|
+
817233897,
|
|
629649
|
+
3183342108,
|
|
629650
|
+
3401237130,
|
|
629651
|
+
1404277552,
|
|
629652
|
+
615818150,
|
|
629653
|
+
3134207493,
|
|
629654
|
+
3453421203,
|
|
629655
|
+
1423857449,
|
|
629656
|
+
601450431,
|
|
629657
|
+
3009837614,
|
|
629658
|
+
3294710456,
|
|
629659
|
+
1567103746,
|
|
629660
|
+
711928724,
|
|
629661
|
+
3020668471,
|
|
629662
|
+
3272380065,
|
|
629663
|
+
1510334235,
|
|
629664
|
+
755167117
|
|
629665
|
+
]);
|
|
629666
|
+
function ensureBuffer(input3) {
|
|
629667
|
+
if (Buffer.isBuffer(input3)) {
|
|
629668
|
+
return input3;
|
|
629669
|
+
}
|
|
629670
|
+
if (typeof input3 === "number") {
|
|
629671
|
+
return Buffer.alloc(input3);
|
|
629672
|
+
} else if (typeof input3 === "string") {
|
|
629673
|
+
return Buffer.from(input3);
|
|
629674
|
+
} else {
|
|
629675
|
+
throw new Error("input must be buffer, number, or string, received " + typeof input3);
|
|
629676
|
+
}
|
|
629677
|
+
}
|
|
629678
|
+
function bufferizeInt(num) {
|
|
629679
|
+
const tmp22 = ensureBuffer(4);
|
|
629680
|
+
tmp22.writeInt32BE(num, 0);
|
|
629681
|
+
return tmp22;
|
|
629682
|
+
}
|
|
629683
|
+
function _crc32(buf, previous4) {
|
|
629684
|
+
buf = ensureBuffer(buf);
|
|
629685
|
+
if (Buffer.isBuffer(previous4)) {
|
|
629686
|
+
previous4 = previous4.readUInt32BE(0);
|
|
629687
|
+
}
|
|
629688
|
+
let crc = ~~previous4 ^ -1;
|
|
629689
|
+
for (var n2 = 0; n2 < buf.length; n2++) {
|
|
629690
|
+
crc = CRC_TABLE[(crc ^ buf[n2]) & 255] ^ crc >>> 8;
|
|
629691
|
+
}
|
|
629692
|
+
return crc ^ -1;
|
|
629693
|
+
}
|
|
629694
|
+
function crc322() {
|
|
629695
|
+
return bufferizeInt(_crc32.apply(null, arguments));
|
|
629696
|
+
}
|
|
629697
|
+
crc322.signed = function() {
|
|
629698
|
+
return _crc32.apply(null, arguments);
|
|
629699
|
+
};
|
|
629700
|
+
crc322.unsigned = function() {
|
|
629701
|
+
return _crc32.apply(null, arguments) >>> 0;
|
|
629702
|
+
};
|
|
629703
|
+
var bufferCrc32 = crc322;
|
|
629704
|
+
var index3 = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32);
|
|
629705
|
+
module4.exports = index3;
|
|
629706
|
+
}
|
|
629707
|
+
});
|
|
629708
|
+
|
|
629709
|
+
// ../../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
|
|
629710
|
+
var require_yazl = __commonJS({
|
|
629711
|
+
"../../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js"(exports2) {
|
|
629712
|
+
"use strict";
|
|
629713
|
+
var fs34 = require("fs");
|
|
629714
|
+
var Transform = require("stream").Transform;
|
|
629715
|
+
var PassThrough5 = require("stream").PassThrough;
|
|
629716
|
+
var zlib4 = require("zlib");
|
|
629717
|
+
var util5 = require("util");
|
|
629718
|
+
var EventEmitter9 = require("events").EventEmitter;
|
|
629719
|
+
var errorMonitor3 = require("events").errorMonitor;
|
|
629720
|
+
var crc322 = require_dist26();
|
|
629721
|
+
exports2.ZipFile = ZipFile2;
|
|
629722
|
+
exports2.dateToDosDateTime = dateToDosDateTime;
|
|
629723
|
+
util5.inherits(ZipFile2, EventEmitter9);
|
|
629724
|
+
function ZipFile2() {
|
|
629725
|
+
this.outputStream = new PassThrough5();
|
|
629726
|
+
this.entries = [];
|
|
629727
|
+
this.outputStreamCursor = 0;
|
|
629728
|
+
this.ended = false;
|
|
629729
|
+
this.allDone = false;
|
|
629730
|
+
this.forceZip64Eocd = false;
|
|
629731
|
+
this.errored = false;
|
|
629732
|
+
this.on(errorMonitor3, function() {
|
|
629733
|
+
this.errored = true;
|
|
629734
|
+
});
|
|
629735
|
+
}
|
|
629736
|
+
ZipFile2.prototype.addFile = function(realPath, metadataPath, options2) {
|
|
629737
|
+
var self2 = this;
|
|
629738
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629739
|
+
if (options2 == null) options2 = {};
|
|
629740
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629741
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629742
|
+
self2.entries.push(entry);
|
|
629743
|
+
fs34.stat(realPath, function(err, stats) {
|
|
629744
|
+
if (err) return self2.emit("error", err);
|
|
629745
|
+
if (!stats.isFile()) return self2.emit("error", new Error("not a file: " + realPath));
|
|
629746
|
+
entry.uncompressedSize = stats.size;
|
|
629747
|
+
if (options2.mtime == null) entry.setLastModDate(stats.mtime);
|
|
629748
|
+
if (options2.mode == null) entry.setFileAttributesMode(stats.mode);
|
|
629749
|
+
entry.setFileDataPumpFunction(function() {
|
|
629750
|
+
var readStream2 = fs34.createReadStream(realPath);
|
|
629751
|
+
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
629752
|
+
readStream2.on("error", function(err2) {
|
|
629753
|
+
self2.emit("error", err2);
|
|
629754
|
+
});
|
|
629755
|
+
pumpFileDataReadStream(self2, entry, readStream2);
|
|
629756
|
+
});
|
|
629757
|
+
pumpEntries(self2);
|
|
629758
|
+
});
|
|
629759
|
+
};
|
|
629760
|
+
ZipFile2.prototype.addReadStream = function(readStream2, metadataPath, options2) {
|
|
629761
|
+
this.addReadStreamLazy(metadataPath, options2, function(cb) {
|
|
629762
|
+
cb(null, readStream2);
|
|
629763
|
+
});
|
|
629764
|
+
};
|
|
629765
|
+
ZipFile2.prototype.addReadStreamLazy = function(metadataPath, options2, getReadStreamFunction) {
|
|
629766
|
+
var self2 = this;
|
|
629767
|
+
if (typeof options2 === "function") {
|
|
629768
|
+
getReadStreamFunction = options2;
|
|
629769
|
+
options2 = null;
|
|
629770
|
+
}
|
|
629771
|
+
if (options2 == null) options2 = {};
|
|
629772
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629773
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629774
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629775
|
+
self2.entries.push(entry);
|
|
629776
|
+
entry.setFileDataPumpFunction(function() {
|
|
629777
|
+
entry.state = Entry.FILE_DATA_IN_PROGRESS;
|
|
629778
|
+
getReadStreamFunction(function(err, readStream2) {
|
|
629779
|
+
if (err) return self2.emit("error", err);
|
|
629780
|
+
pumpFileDataReadStream(self2, entry, readStream2);
|
|
629781
|
+
});
|
|
629782
|
+
});
|
|
629783
|
+
pumpEntries(self2);
|
|
629784
|
+
};
|
|
629785
|
+
ZipFile2.prototype.addBuffer = function(buffer, metadataPath, options2) {
|
|
629786
|
+
var self2 = this;
|
|
629787
|
+
metadataPath = validateMetadataPath(metadataPath, false);
|
|
629788
|
+
if (buffer.length > 1073741823) throw new Error("buffer too large: " + buffer.length + " > 1073741823");
|
|
629789
|
+
if (options2 == null) options2 = {};
|
|
629790
|
+
if (options2.size != null) throw new Error("options.size not allowed");
|
|
629791
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629792
|
+
var entry = new Entry(metadataPath, false, options2);
|
|
629793
|
+
entry.uncompressedSize = buffer.length;
|
|
629794
|
+
entry.crc32 = crc322.unsigned(buffer);
|
|
629795
|
+
entry.crcAndFileSizeKnown = true;
|
|
629796
|
+
self2.entries.push(entry);
|
|
629797
|
+
if (entry.compressionLevel === 0) {
|
|
629798
|
+
setCompressedBuffer(buffer);
|
|
629799
|
+
} else {
|
|
629800
|
+
zlib4.deflateRaw(buffer, { level: entry.compressionLevel }, function(err, compressedBuffer) {
|
|
629801
|
+
setCompressedBuffer(compressedBuffer);
|
|
629802
|
+
});
|
|
629803
|
+
}
|
|
629804
|
+
function setCompressedBuffer(compressedBuffer) {
|
|
629805
|
+
entry.compressedSize = compressedBuffer.length;
|
|
629806
|
+
entry.setFileDataPumpFunction(function() {
|
|
629807
|
+
writeToOutputStream(self2, compressedBuffer);
|
|
629808
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629809
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629810
|
+
setImmediate(function() {
|
|
629811
|
+
pumpEntries(self2);
|
|
629812
|
+
});
|
|
629813
|
+
});
|
|
629814
|
+
pumpEntries(self2);
|
|
629815
|
+
}
|
|
629816
|
+
};
|
|
629817
|
+
ZipFile2.prototype.addEmptyDirectory = function(metadataPath, options2) {
|
|
629818
|
+
var self2 = this;
|
|
629819
|
+
metadataPath = validateMetadataPath(metadataPath, true);
|
|
629820
|
+
if (options2 == null) options2 = {};
|
|
629821
|
+
if (options2.size != null) throw new Error("options.size not allowed");
|
|
629822
|
+
if (options2.compress != null) throw new Error("options.compress not allowed");
|
|
629823
|
+
if (options2.compressionLevel != null) throw new Error("options.compressionLevel not allowed");
|
|
629824
|
+
if (shouldIgnoreAdding(self2)) return;
|
|
629825
|
+
var entry = new Entry(metadataPath, true, options2);
|
|
629826
|
+
self2.entries.push(entry);
|
|
629827
|
+
entry.setFileDataPumpFunction(function() {
|
|
629828
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629829
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629830
|
+
pumpEntries(self2);
|
|
629831
|
+
});
|
|
629832
|
+
pumpEntries(self2);
|
|
629833
|
+
};
|
|
629834
|
+
var eocdrSignatureBuffer = bufferFrom([80, 75, 5, 6]);
|
|
629835
|
+
ZipFile2.prototype.end = function(options2, calculatedTotalSizeCallback) {
|
|
629836
|
+
if (typeof options2 === "function") {
|
|
629837
|
+
calculatedTotalSizeCallback = options2;
|
|
629838
|
+
options2 = null;
|
|
629839
|
+
}
|
|
629840
|
+
if (options2 == null) options2 = {};
|
|
629841
|
+
if (this.ended) return;
|
|
629842
|
+
this.ended = true;
|
|
629843
|
+
if (this.errored) return;
|
|
629844
|
+
this.calculatedTotalSizeCallback = calculatedTotalSizeCallback;
|
|
629845
|
+
this.forceZip64Eocd = !!options2.forceZip64Format;
|
|
629846
|
+
if (options2.comment) {
|
|
629847
|
+
if (typeof options2.comment === "string") {
|
|
629848
|
+
this.comment = encodeCp437(options2.comment);
|
|
629849
|
+
} else {
|
|
629850
|
+
this.comment = options2.comment;
|
|
629851
|
+
}
|
|
629852
|
+
if (this.comment.length > 65535) throw new Error("comment is too large");
|
|
629853
|
+
if (bufferIncludes(this.comment, eocdrSignatureBuffer)) throw new Error("comment contains end of central directory record signature");
|
|
629854
|
+
} else {
|
|
629855
|
+
this.comment = EMPTY_BUFFER;
|
|
629856
|
+
}
|
|
629857
|
+
pumpEntries(this);
|
|
629858
|
+
};
|
|
629859
|
+
function writeToOutputStream(self2, buffer) {
|
|
629860
|
+
self2.outputStream.write(buffer);
|
|
629861
|
+
self2.outputStreamCursor += buffer.length;
|
|
629862
|
+
}
|
|
629863
|
+
function pumpFileDataReadStream(self2, entry, readStream2) {
|
|
629864
|
+
var crc32Watcher = new Crc32Watcher();
|
|
629865
|
+
var uncompressedSizeCounter = new ByteCounter();
|
|
629866
|
+
var compressor = entry.compressionLevel !== 0 ? new zlib4.DeflateRaw({ level: entry.compressionLevel }) : new PassThrough5();
|
|
629867
|
+
var compressedSizeCounter = new ByteCounter();
|
|
629868
|
+
readStream2.pipe(crc32Watcher).pipe(uncompressedSizeCounter).pipe(compressor).pipe(compressedSizeCounter).pipe(self2.outputStream, { end: false });
|
|
629869
|
+
compressedSizeCounter.on("end", function() {
|
|
629870
|
+
entry.crc32 = crc32Watcher.crc32;
|
|
629871
|
+
if (entry.uncompressedSize == null) {
|
|
629872
|
+
entry.uncompressedSize = uncompressedSizeCounter.byteCount;
|
|
629873
|
+
} else {
|
|
629874
|
+
if (entry.uncompressedSize !== uncompressedSizeCounter.byteCount) return self2.emit("error", new Error("file data stream has unexpected number of bytes"));
|
|
629875
|
+
}
|
|
629876
|
+
entry.compressedSize = compressedSizeCounter.byteCount;
|
|
629877
|
+
self2.outputStreamCursor += entry.compressedSize;
|
|
629878
|
+
writeToOutputStream(self2, entry.getDataDescriptor());
|
|
629879
|
+
entry.state = Entry.FILE_DATA_DONE;
|
|
629880
|
+
pumpEntries(self2);
|
|
629881
|
+
});
|
|
629882
|
+
}
|
|
629883
|
+
function determineCompressionLevel(options2) {
|
|
629884
|
+
if (options2.compress != null && options2.compressionLevel != null) {
|
|
629885
|
+
if (!!options2.compress !== !!options2.compressionLevel) throw new Error("conflicting settings for compress and compressionLevel");
|
|
629886
|
+
}
|
|
629887
|
+
if (options2.compressionLevel != null) return options2.compressionLevel;
|
|
629888
|
+
if (options2.compress === false) return 0;
|
|
629889
|
+
return 6;
|
|
629890
|
+
}
|
|
629891
|
+
function pumpEntries(self2) {
|
|
629892
|
+
if (self2.allDone || self2.errored) return;
|
|
629893
|
+
if (self2.ended && self2.calculatedTotalSizeCallback != null) {
|
|
629894
|
+
var calculatedTotalSize = calculateTotalSize(self2);
|
|
629895
|
+
if (calculatedTotalSize != null) {
|
|
629896
|
+
self2.calculatedTotalSizeCallback(calculatedTotalSize);
|
|
629897
|
+
self2.calculatedTotalSizeCallback = null;
|
|
629898
|
+
}
|
|
629899
|
+
}
|
|
629900
|
+
var entry = getFirstNotDoneEntry();
|
|
629901
|
+
function getFirstNotDoneEntry() {
|
|
629902
|
+
for (var i5 = 0; i5 < self2.entries.length; i5++) {
|
|
629903
|
+
var entry2 = self2.entries[i5];
|
|
629904
|
+
if (entry2.state < Entry.FILE_DATA_DONE) return entry2;
|
|
629905
|
+
}
|
|
629906
|
+
return null;
|
|
629907
|
+
}
|
|
629908
|
+
if (entry != null) {
|
|
629909
|
+
if (entry.state < Entry.READY_TO_PUMP_FILE_DATA) return;
|
|
629910
|
+
if (entry.state === Entry.FILE_DATA_IN_PROGRESS) return;
|
|
629911
|
+
entry.relativeOffsetOfLocalHeader = self2.outputStreamCursor;
|
|
629912
|
+
var localFileHeader = entry.getLocalFileHeader();
|
|
629913
|
+
writeToOutputStream(self2, localFileHeader);
|
|
629914
|
+
entry.doFileDataPump();
|
|
629915
|
+
} else {
|
|
629916
|
+
if (self2.ended) {
|
|
629917
|
+
self2.offsetOfStartOfCentralDirectory = self2.outputStreamCursor;
|
|
629918
|
+
self2.entries.forEach(function(entry2) {
|
|
629919
|
+
var centralDirectoryRecord = entry2.getCentralDirectoryRecord();
|
|
629920
|
+
writeToOutputStream(self2, centralDirectoryRecord);
|
|
629921
|
+
});
|
|
629922
|
+
writeToOutputStream(self2, getEndOfCentralDirectoryRecord(self2));
|
|
629923
|
+
self2.outputStream.end();
|
|
629924
|
+
self2.allDone = true;
|
|
629925
|
+
}
|
|
629926
|
+
}
|
|
629927
|
+
}
|
|
629928
|
+
function calculateTotalSize(self2) {
|
|
629929
|
+
var pretendOutputCursor = 0;
|
|
629930
|
+
var centralDirectorySize = 0;
|
|
629931
|
+
for (var i5 = 0; i5 < self2.entries.length; i5++) {
|
|
629932
|
+
var entry = self2.entries[i5];
|
|
629933
|
+
if (entry.compressionLevel !== 0) return -1;
|
|
629934
|
+
if (entry.state >= Entry.READY_TO_PUMP_FILE_DATA) {
|
|
629935
|
+
if (entry.uncompressedSize == null) return -1;
|
|
629936
|
+
} else {
|
|
629937
|
+
if (entry.uncompressedSize == null) return null;
|
|
629938
|
+
}
|
|
629939
|
+
entry.relativeOffsetOfLocalHeader = pretendOutputCursor;
|
|
629940
|
+
var useZip64Format = entry.useZip64Format();
|
|
629941
|
+
pretendOutputCursor += LOCAL_FILE_HEADER_FIXED_SIZE + entry.utf8FileName.length;
|
|
629942
|
+
pretendOutputCursor += entry.uncompressedSize;
|
|
629943
|
+
if (!entry.crcAndFileSizeKnown) {
|
|
629944
|
+
if (useZip64Format) {
|
|
629945
|
+
pretendOutputCursor += ZIP64_DATA_DESCRIPTOR_SIZE;
|
|
629946
|
+
} else {
|
|
629947
|
+
pretendOutputCursor += DATA_DESCRIPTOR_SIZE;
|
|
629948
|
+
}
|
|
629949
|
+
}
|
|
629950
|
+
centralDirectorySize += CENTRAL_DIRECTORY_RECORD_FIXED_SIZE + entry.utf8FileName.length + entry.fileComment.length;
|
|
629951
|
+
if (!entry.forceDosTimestamp) {
|
|
629952
|
+
centralDirectorySize += INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE;
|
|
629953
|
+
}
|
|
629954
|
+
if (useZip64Format) {
|
|
629955
|
+
centralDirectorySize += ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE;
|
|
629956
|
+
}
|
|
629957
|
+
}
|
|
629958
|
+
var endOfCentralDirectorySize = 0;
|
|
629959
|
+
if (self2.forceZip64Eocd || self2.entries.length >= 65535 || centralDirectorySize >= 65535 || pretendOutputCursor >= 4294967295) {
|
|
629960
|
+
endOfCentralDirectorySize += ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE;
|
|
629961
|
+
}
|
|
629962
|
+
endOfCentralDirectorySize += END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self2.comment.length;
|
|
629963
|
+
return pretendOutputCursor + centralDirectorySize + endOfCentralDirectorySize;
|
|
629964
|
+
}
|
|
629965
|
+
function shouldIgnoreAdding(self2) {
|
|
629966
|
+
if (self2.ended) throw new Error("cannot add entries after calling end()");
|
|
629967
|
+
if (self2.errored) return true;
|
|
629968
|
+
return false;
|
|
629969
|
+
}
|
|
629970
|
+
var ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 56;
|
|
629971
|
+
var ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE = 20;
|
|
629972
|
+
var END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 22;
|
|
629973
|
+
function getEndOfCentralDirectoryRecord(self2, actuallyJustTellMeHowLongItWouldBe) {
|
|
629974
|
+
var needZip64Format = false;
|
|
629975
|
+
var normalEntriesLength = self2.entries.length;
|
|
629976
|
+
if (self2.forceZip64Eocd || self2.entries.length >= 65535) {
|
|
629977
|
+
normalEntriesLength = 65535;
|
|
629978
|
+
needZip64Format = true;
|
|
629979
|
+
}
|
|
629980
|
+
var sizeOfCentralDirectory = self2.outputStreamCursor - self2.offsetOfStartOfCentralDirectory;
|
|
629981
|
+
var normalSizeOfCentralDirectory = sizeOfCentralDirectory;
|
|
629982
|
+
if (self2.forceZip64Eocd || sizeOfCentralDirectory >= 4294967295) {
|
|
629983
|
+
normalSizeOfCentralDirectory = 4294967295;
|
|
629984
|
+
needZip64Format = true;
|
|
629985
|
+
}
|
|
629986
|
+
var normalOffsetOfStartOfCentralDirectory = self2.offsetOfStartOfCentralDirectory;
|
|
629987
|
+
if (self2.forceZip64Eocd || self2.offsetOfStartOfCentralDirectory >= 4294967295) {
|
|
629988
|
+
normalOffsetOfStartOfCentralDirectory = 4294967295;
|
|
629989
|
+
needZip64Format = true;
|
|
629990
|
+
}
|
|
629991
|
+
if (actuallyJustTellMeHowLongItWouldBe) {
|
|
629992
|
+
if (needZip64Format) {
|
|
629993
|
+
return ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE + END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
|
|
629994
|
+
} else {
|
|
629995
|
+
return END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
|
|
629996
|
+
}
|
|
629997
|
+
}
|
|
629998
|
+
var eocdrBuffer = bufferAlloc(END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self2.comment.length);
|
|
629999
|
+
eocdrBuffer.writeUInt32LE(101010256, 0);
|
|
630000
|
+
eocdrBuffer.writeUInt16LE(0, 4);
|
|
630001
|
+
eocdrBuffer.writeUInt16LE(0, 6);
|
|
630002
|
+
eocdrBuffer.writeUInt16LE(normalEntriesLength, 8);
|
|
630003
|
+
eocdrBuffer.writeUInt16LE(normalEntriesLength, 10);
|
|
630004
|
+
eocdrBuffer.writeUInt32LE(normalSizeOfCentralDirectory, 12);
|
|
630005
|
+
eocdrBuffer.writeUInt32LE(normalOffsetOfStartOfCentralDirectory, 16);
|
|
630006
|
+
eocdrBuffer.writeUInt16LE(self2.comment.length, 20);
|
|
630007
|
+
self2.comment.copy(eocdrBuffer, 22);
|
|
630008
|
+
if (!needZip64Format) return eocdrBuffer;
|
|
630009
|
+
var zip64EocdrBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE);
|
|
630010
|
+
zip64EocdrBuffer.writeUInt32LE(101075792, 0);
|
|
630011
|
+
writeUInt64LE(zip64EocdrBuffer, ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE - 12, 4);
|
|
630012
|
+
zip64EocdrBuffer.writeUInt16LE(VERSION_MADE_BY, 12);
|
|
630013
|
+
zip64EocdrBuffer.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_ZIP64, 14);
|
|
630014
|
+
zip64EocdrBuffer.writeUInt32LE(0, 16);
|
|
630015
|
+
zip64EocdrBuffer.writeUInt32LE(0, 20);
|
|
630016
|
+
writeUInt64LE(zip64EocdrBuffer, self2.entries.length, 24);
|
|
630017
|
+
writeUInt64LE(zip64EocdrBuffer, self2.entries.length, 32);
|
|
630018
|
+
writeUInt64LE(zip64EocdrBuffer, sizeOfCentralDirectory, 40);
|
|
630019
|
+
writeUInt64LE(zip64EocdrBuffer, self2.offsetOfStartOfCentralDirectory, 48);
|
|
630020
|
+
var zip64EocdlBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE);
|
|
630021
|
+
zip64EocdlBuffer.writeUInt32LE(117853008, 0);
|
|
630022
|
+
zip64EocdlBuffer.writeUInt32LE(0, 4);
|
|
630023
|
+
writeUInt64LE(zip64EocdlBuffer, self2.outputStreamCursor, 8);
|
|
630024
|
+
zip64EocdlBuffer.writeUInt32LE(1, 16);
|
|
630025
|
+
return Buffer.concat([
|
|
630026
|
+
zip64EocdrBuffer,
|
|
630027
|
+
zip64EocdlBuffer,
|
|
630028
|
+
eocdrBuffer
|
|
630029
|
+
]);
|
|
630030
|
+
}
|
|
630031
|
+
function validateMetadataPath(metadataPath, isDirectory) {
|
|
630032
|
+
if (metadataPath === "") throw new Error("empty metadataPath");
|
|
630033
|
+
metadataPath = metadataPath.replace(/\\/g, "/");
|
|
630034
|
+
if (/^[a-zA-Z]:/.test(metadataPath) || /^\//.test(metadataPath)) throw new Error("absolute path: " + metadataPath);
|
|
630035
|
+
if (metadataPath.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + metadataPath);
|
|
630036
|
+
var looksLikeDirectory = /\/$/.test(metadataPath);
|
|
630037
|
+
if (isDirectory) {
|
|
630038
|
+
if (!looksLikeDirectory) metadataPath += "/";
|
|
630039
|
+
} else {
|
|
630040
|
+
if (looksLikeDirectory) throw new Error("file path cannot end with '/': " + metadataPath);
|
|
630041
|
+
}
|
|
630042
|
+
return metadataPath;
|
|
630043
|
+
}
|
|
630044
|
+
var EMPTY_BUFFER = bufferAlloc(0);
|
|
630045
|
+
function Entry(metadataPath, isDirectory, options2) {
|
|
630046
|
+
this.utf8FileName = bufferFrom(metadataPath);
|
|
630047
|
+
if (this.utf8FileName.length > 65535) throw new Error("utf8 file name too long. " + utf8FileName.length + " > 65535");
|
|
630048
|
+
this.isDirectory = isDirectory;
|
|
630049
|
+
this.state = Entry.WAITING_FOR_METADATA;
|
|
630050
|
+
this.setLastModDate(options2.mtime != null ? options2.mtime : /* @__PURE__ */ new Date());
|
|
630051
|
+
this.forceDosTimestamp = !!options2.forceDosTimestamp;
|
|
630052
|
+
if (options2.mode != null) {
|
|
630053
|
+
this.setFileAttributesMode(options2.mode);
|
|
630054
|
+
} else {
|
|
630055
|
+
this.setFileAttributesMode(isDirectory ? 16893 : 33204);
|
|
630056
|
+
}
|
|
630057
|
+
if (isDirectory) {
|
|
630058
|
+
this.crcAndFileSizeKnown = true;
|
|
630059
|
+
this.crc32 = 0;
|
|
630060
|
+
this.uncompressedSize = 0;
|
|
630061
|
+
this.compressedSize = 0;
|
|
630062
|
+
} else {
|
|
630063
|
+
this.crcAndFileSizeKnown = false;
|
|
630064
|
+
this.crc32 = null;
|
|
630065
|
+
this.uncompressedSize = null;
|
|
630066
|
+
this.compressedSize = null;
|
|
630067
|
+
if (options2.size != null) this.uncompressedSize = options2.size;
|
|
630068
|
+
}
|
|
630069
|
+
if (isDirectory) {
|
|
630070
|
+
this.compressionLevel = 0;
|
|
630071
|
+
} else {
|
|
630072
|
+
this.compressionLevel = determineCompressionLevel(options2);
|
|
630073
|
+
}
|
|
630074
|
+
this.forceZip64Format = !!options2.forceZip64Format;
|
|
630075
|
+
if (options2.fileComment) {
|
|
630076
|
+
if (typeof options2.fileComment === "string") {
|
|
630077
|
+
this.fileComment = bufferFrom(options2.fileComment, "utf-8");
|
|
630078
|
+
} else {
|
|
630079
|
+
this.fileComment = options2.fileComment;
|
|
630080
|
+
}
|
|
630081
|
+
if (this.fileComment.length > 65535) throw new Error("fileComment is too large");
|
|
630082
|
+
} else {
|
|
630083
|
+
this.fileComment = EMPTY_BUFFER;
|
|
630084
|
+
}
|
|
630085
|
+
}
|
|
630086
|
+
Entry.WAITING_FOR_METADATA = 0;
|
|
630087
|
+
Entry.READY_TO_PUMP_FILE_DATA = 1;
|
|
630088
|
+
Entry.FILE_DATA_IN_PROGRESS = 2;
|
|
630089
|
+
Entry.FILE_DATA_DONE = 3;
|
|
630090
|
+
Entry.prototype.setLastModDate = function(date26) {
|
|
630091
|
+
this.mtime = date26;
|
|
630092
|
+
var dosDateTime = dateToDosDateTime(date26);
|
|
630093
|
+
this.lastModFileTime = dosDateTime.time;
|
|
630094
|
+
this.lastModFileDate = dosDateTime.date;
|
|
630095
|
+
};
|
|
630096
|
+
Entry.prototype.setFileAttributesMode = function(mode) {
|
|
630097
|
+
if ((mode & 65535) !== mode) throw new Error("invalid mode. expected: 0 <= " + mode + " <= 65535");
|
|
630098
|
+
this.externalFileAttributes = mode << 16 >>> 0;
|
|
630099
|
+
};
|
|
630100
|
+
Entry.prototype.setFileDataPumpFunction = function(doFileDataPump) {
|
|
630101
|
+
this.doFileDataPump = doFileDataPump;
|
|
630102
|
+
this.state = Entry.READY_TO_PUMP_FILE_DATA;
|
|
630103
|
+
};
|
|
630104
|
+
Entry.prototype.useZip64Format = function() {
|
|
630105
|
+
return this.forceZip64Format || this.uncompressedSize != null && this.uncompressedSize > 4294967294 || this.compressedSize != null && this.compressedSize > 4294967294 || this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 4294967294;
|
|
630106
|
+
};
|
|
630107
|
+
var LOCAL_FILE_HEADER_FIXED_SIZE = 30;
|
|
630108
|
+
var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20;
|
|
630109
|
+
var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45;
|
|
630110
|
+
var VERSION_MADE_BY = 3 << 8 | 63;
|
|
630111
|
+
var FILE_NAME_IS_UTF8 = 1 << 11;
|
|
630112
|
+
var UNKNOWN_CRC32_AND_FILE_SIZES = 1 << 3;
|
|
630113
|
+
Entry.prototype.getLocalFileHeader = function() {
|
|
630114
|
+
var crc323 = 0;
|
|
630115
|
+
var compressedSize = 0;
|
|
630116
|
+
var uncompressedSize = 0;
|
|
630117
|
+
if (this.crcAndFileSizeKnown) {
|
|
630118
|
+
crc323 = this.crc32;
|
|
630119
|
+
compressedSize = this.compressedSize;
|
|
630120
|
+
uncompressedSize = this.uncompressedSize;
|
|
630121
|
+
}
|
|
630122
|
+
var fixedSizeStuff = bufferAlloc(LOCAL_FILE_HEADER_FIXED_SIZE);
|
|
630123
|
+
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
|
|
630124
|
+
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
|
|
630125
|
+
fixedSizeStuff.writeUInt32LE(67324752, 0);
|
|
630126
|
+
fixedSizeStuff.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_UTF8, 4);
|
|
630127
|
+
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 6);
|
|
630128
|
+
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 8);
|
|
630129
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 10);
|
|
630130
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 12);
|
|
630131
|
+
fixedSizeStuff.writeUInt32LE(crc323, 14);
|
|
630132
|
+
fixedSizeStuff.writeUInt32LE(compressedSize, 18);
|
|
630133
|
+
fixedSizeStuff.writeUInt32LE(uncompressedSize, 22);
|
|
630134
|
+
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 26);
|
|
630135
|
+
fixedSizeStuff.writeUInt16LE(0, 28);
|
|
630136
|
+
return Buffer.concat([
|
|
630137
|
+
fixedSizeStuff,
|
|
630138
|
+
// file name (variable size)
|
|
630139
|
+
this.utf8FileName
|
|
630140
|
+
// extra field (variable size)
|
|
630141
|
+
// no extra fields
|
|
630142
|
+
]);
|
|
630143
|
+
};
|
|
630144
|
+
var DATA_DESCRIPTOR_SIZE = 16;
|
|
630145
|
+
var ZIP64_DATA_DESCRIPTOR_SIZE = 24;
|
|
630146
|
+
Entry.prototype.getDataDescriptor = function() {
|
|
630147
|
+
if (this.crcAndFileSizeKnown) {
|
|
630148
|
+
return EMPTY_BUFFER;
|
|
630149
|
+
}
|
|
630150
|
+
if (!this.useZip64Format()) {
|
|
630151
|
+
var buffer = bufferAlloc(DATA_DESCRIPTOR_SIZE);
|
|
630152
|
+
buffer.writeUInt32LE(134695760, 0);
|
|
630153
|
+
buffer.writeUInt32LE(this.crc32, 4);
|
|
630154
|
+
buffer.writeUInt32LE(this.compressedSize, 8);
|
|
630155
|
+
buffer.writeUInt32LE(this.uncompressedSize, 12);
|
|
630156
|
+
return buffer;
|
|
630157
|
+
} else {
|
|
630158
|
+
var buffer = bufferAlloc(ZIP64_DATA_DESCRIPTOR_SIZE);
|
|
630159
|
+
buffer.writeUInt32LE(134695760, 0);
|
|
630160
|
+
buffer.writeUInt32LE(this.crc32, 4);
|
|
630161
|
+
writeUInt64LE(buffer, this.compressedSize, 8);
|
|
630162
|
+
writeUInt64LE(buffer, this.uncompressedSize, 16);
|
|
630163
|
+
return buffer;
|
|
630164
|
+
}
|
|
630165
|
+
};
|
|
630166
|
+
var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46;
|
|
630167
|
+
var INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE = 9;
|
|
630168
|
+
var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28;
|
|
630169
|
+
Entry.prototype.getCentralDirectoryRecord = function() {
|
|
630170
|
+
var fixedSizeStuff = bufferAlloc(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE);
|
|
630171
|
+
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
|
|
630172
|
+
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
|
|
630173
|
+
var izutefBuffer = EMPTY_BUFFER;
|
|
630174
|
+
if (!this.forceDosTimestamp) {
|
|
630175
|
+
izutefBuffer = bufferAlloc(INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE);
|
|
630176
|
+
izutefBuffer.writeUInt16LE(21589, 0);
|
|
630177
|
+
izutefBuffer.writeUInt16LE(INFO_ZIP_UNIVERSAL_TIMESTAMP_EXTRA_FIELD_SIZE - 4, 2);
|
|
630178
|
+
var EB_UT_FL_MTIME = 1 << 0;
|
|
630179
|
+
var EB_UT_FL_ATIME = 1 << 1;
|
|
630180
|
+
izutefBuffer.writeUInt8(EB_UT_FL_MTIME | EB_UT_FL_ATIME, 4);
|
|
630181
|
+
var timestamp = Math.floor(this.mtime.getTime() / 1e3);
|
|
630182
|
+
if (timestamp < -2147483648) timestamp = -2147483648;
|
|
630183
|
+
if (timestamp > 2147483647) timestamp = 2147483647;
|
|
630184
|
+
izutefBuffer.writeUInt32LE(timestamp, 5);
|
|
630185
|
+
}
|
|
630186
|
+
var normalCompressedSize = this.compressedSize;
|
|
630187
|
+
var normalUncompressedSize = this.uncompressedSize;
|
|
630188
|
+
var normalRelativeOffsetOfLocalHeader = this.relativeOffsetOfLocalHeader;
|
|
630189
|
+
var versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8;
|
|
630190
|
+
var zeiefBuffer = EMPTY_BUFFER;
|
|
630191
|
+
if (this.useZip64Format()) {
|
|
630192
|
+
normalCompressedSize = 4294967295;
|
|
630193
|
+
normalUncompressedSize = 4294967295;
|
|
630194
|
+
normalRelativeOffsetOfLocalHeader = 4294967295;
|
|
630195
|
+
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64;
|
|
630196
|
+
zeiefBuffer = bufferAlloc(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE);
|
|
630197
|
+
zeiefBuffer.writeUInt16LE(1, 0);
|
|
630198
|
+
zeiefBuffer.writeUInt16LE(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE - 4, 2);
|
|
630199
|
+
writeUInt64LE(zeiefBuffer, this.uncompressedSize, 4);
|
|
630200
|
+
writeUInt64LE(zeiefBuffer, this.compressedSize, 12);
|
|
630201
|
+
writeUInt64LE(zeiefBuffer, this.relativeOffsetOfLocalHeader, 20);
|
|
630202
|
+
}
|
|
630203
|
+
fixedSizeStuff.writeUInt32LE(33639248, 0);
|
|
630204
|
+
fixedSizeStuff.writeUInt16LE(VERSION_MADE_BY, 4);
|
|
630205
|
+
fixedSizeStuff.writeUInt16LE(versionNeededToExtract, 6);
|
|
630206
|
+
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 8);
|
|
630207
|
+
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 10);
|
|
630208
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 12);
|
|
630209
|
+
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 14);
|
|
630210
|
+
fixedSizeStuff.writeUInt32LE(this.crc32, 16);
|
|
630211
|
+
fixedSizeStuff.writeUInt32LE(normalCompressedSize, 20);
|
|
630212
|
+
fixedSizeStuff.writeUInt32LE(normalUncompressedSize, 24);
|
|
630213
|
+
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 28);
|
|
630214
|
+
fixedSizeStuff.writeUInt16LE(izutefBuffer.length + zeiefBuffer.length, 30);
|
|
630215
|
+
fixedSizeStuff.writeUInt16LE(this.fileComment.length, 32);
|
|
630216
|
+
fixedSizeStuff.writeUInt16LE(0, 34);
|
|
630217
|
+
fixedSizeStuff.writeUInt16LE(0, 36);
|
|
630218
|
+
fixedSizeStuff.writeUInt32LE(this.externalFileAttributes, 38);
|
|
630219
|
+
fixedSizeStuff.writeUInt32LE(normalRelativeOffsetOfLocalHeader, 42);
|
|
630220
|
+
return Buffer.concat([
|
|
630221
|
+
fixedSizeStuff,
|
|
630222
|
+
// file name (variable size)
|
|
630223
|
+
this.utf8FileName,
|
|
630224
|
+
// extra field (variable size)
|
|
630225
|
+
izutefBuffer,
|
|
630226
|
+
zeiefBuffer,
|
|
630227
|
+
// file comment (variable size)
|
|
630228
|
+
this.fileComment
|
|
630229
|
+
]);
|
|
630230
|
+
};
|
|
630231
|
+
Entry.prototype.getCompressionMethod = function() {
|
|
630232
|
+
var NO_COMPRESSION = 0;
|
|
630233
|
+
var DEFLATE_COMPRESSION = 8;
|
|
630234
|
+
return this.compressionLevel === 0 ? NO_COMPRESSION : DEFLATE_COMPRESSION;
|
|
630235
|
+
};
|
|
630236
|
+
var minDosDate = new Date(1980, 0, 1);
|
|
630237
|
+
var maxDosDate = new Date(2107, 11, 31, 23, 59, 58);
|
|
630238
|
+
function dateToDosDateTime(jsDate) {
|
|
630239
|
+
if (jsDate < minDosDate) jsDate = minDosDate;
|
|
630240
|
+
else if (jsDate > maxDosDate) jsDate = maxDosDate;
|
|
630241
|
+
var date26 = 0;
|
|
630242
|
+
date26 |= jsDate.getDate() & 31;
|
|
630243
|
+
date26 |= (jsDate.getMonth() + 1 & 15) << 5;
|
|
630244
|
+
date26 |= (jsDate.getFullYear() - 1980 & 127) << 9;
|
|
630245
|
+
var time3 = 0;
|
|
630246
|
+
time3 |= Math.floor(jsDate.getSeconds() / 2);
|
|
630247
|
+
time3 |= (jsDate.getMinutes() & 63) << 5;
|
|
630248
|
+
time3 |= (jsDate.getHours() & 31) << 11;
|
|
630249
|
+
return { date: date26, time: time3 };
|
|
630250
|
+
}
|
|
630251
|
+
function writeUInt64LE(buffer, n2, offset2) {
|
|
630252
|
+
var high = Math.floor(n2 / 4294967296);
|
|
630253
|
+
var low = n2 % 4294967296;
|
|
630254
|
+
buffer.writeUInt32LE(low, offset2);
|
|
630255
|
+
buffer.writeUInt32LE(high, offset2 + 4);
|
|
630256
|
+
}
|
|
630257
|
+
util5.inherits(ByteCounter, Transform);
|
|
630258
|
+
function ByteCounter(options2) {
|
|
630259
|
+
Transform.call(this, options2);
|
|
630260
|
+
this.byteCount = 0;
|
|
630261
|
+
}
|
|
630262
|
+
ByteCounter.prototype._transform = function(chunk2, encoding, cb) {
|
|
630263
|
+
this.byteCount += chunk2.length;
|
|
630264
|
+
cb(null, chunk2);
|
|
630265
|
+
};
|
|
630266
|
+
util5.inherits(Crc32Watcher, Transform);
|
|
630267
|
+
function Crc32Watcher(options2) {
|
|
630268
|
+
Transform.call(this, options2);
|
|
630269
|
+
this.crc32 = 0;
|
|
630270
|
+
}
|
|
630271
|
+
Crc32Watcher.prototype._transform = function(chunk2, encoding, cb) {
|
|
630272
|
+
this.crc32 = crc322.unsigned(chunk2, this.crc32);
|
|
630273
|
+
cb(null, chunk2);
|
|
630274
|
+
};
|
|
630275
|
+
var cp437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";
|
|
630276
|
+
if (cp437.length !== 256) throw new Error("assertion failure");
|
|
630277
|
+
var reverseCp437 = null;
|
|
630278
|
+
function encodeCp437(string28) {
|
|
630279
|
+
if (/^[\x20-\x7e]*$/.test(string28)) {
|
|
630280
|
+
return bufferFrom(string28, "utf-8");
|
|
630281
|
+
}
|
|
630282
|
+
if (reverseCp437 == null) {
|
|
630283
|
+
reverseCp437 = {};
|
|
630284
|
+
for (var i5 = 0; i5 < cp437.length; i5++) {
|
|
630285
|
+
reverseCp437[cp437[i5]] = i5;
|
|
630286
|
+
}
|
|
630287
|
+
}
|
|
630288
|
+
var result = bufferAlloc(string28.length);
|
|
630289
|
+
for (var i5 = 0; i5 < string28.length; i5++) {
|
|
630290
|
+
var b5 = reverseCp437[string28[i5]];
|
|
630291
|
+
if (b5 == null) throw new Error("character not encodable in CP437: " + JSON.stringify(string28[i5]));
|
|
630292
|
+
result[i5] = b5;
|
|
630293
|
+
}
|
|
630294
|
+
return result;
|
|
630295
|
+
}
|
|
630296
|
+
function bufferAlloc(size2) {
|
|
630297
|
+
bufferAlloc = modern;
|
|
630298
|
+
try {
|
|
630299
|
+
return bufferAlloc(size2);
|
|
630300
|
+
} catch (e2) {
|
|
630301
|
+
bufferAlloc = legacy;
|
|
630302
|
+
return bufferAlloc(size2);
|
|
630303
|
+
}
|
|
630304
|
+
function modern(size3) {
|
|
630305
|
+
return Buffer.allocUnsafe(size3);
|
|
630306
|
+
}
|
|
630307
|
+
function legacy(size3) {
|
|
630308
|
+
return new Buffer(size3);
|
|
630309
|
+
}
|
|
630310
|
+
}
|
|
630311
|
+
function bufferFrom(something, encoding) {
|
|
630312
|
+
bufferFrom = modern;
|
|
630313
|
+
try {
|
|
630314
|
+
return bufferFrom(something, encoding);
|
|
630315
|
+
} catch (e2) {
|
|
630316
|
+
bufferFrom = legacy;
|
|
630317
|
+
return bufferFrom(something, encoding);
|
|
630318
|
+
}
|
|
630319
|
+
function modern(something2, encoding2) {
|
|
630320
|
+
return Buffer.from(something2, encoding2);
|
|
630321
|
+
}
|
|
630322
|
+
function legacy(something2, encoding2) {
|
|
630323
|
+
return new Buffer(something2, encoding2);
|
|
630324
|
+
}
|
|
630325
|
+
}
|
|
630326
|
+
function bufferIncludes(buffer, content5) {
|
|
630327
|
+
bufferIncludes = modern;
|
|
630328
|
+
try {
|
|
630329
|
+
return bufferIncludes(buffer, content5);
|
|
630330
|
+
} catch (e2) {
|
|
630331
|
+
bufferIncludes = legacy;
|
|
630332
|
+
return bufferIncludes(buffer, content5);
|
|
630333
|
+
}
|
|
630334
|
+
function modern(buffer2, content6) {
|
|
630335
|
+
return buffer2.includes(content6);
|
|
630336
|
+
}
|
|
630337
|
+
function legacy(buffer2, content6) {
|
|
630338
|
+
for (var i5 = 0; i5 <= buffer2.length - content6.length; i5++) {
|
|
630339
|
+
for (var j5 = 0; ; j5++) {
|
|
630340
|
+
if (j5 === content6.length) return true;
|
|
630341
|
+
if (buffer2[i5 + j5] !== content6[j5]) break;
|
|
630342
|
+
}
|
|
630343
|
+
}
|
|
630344
|
+
return false;
|
|
630345
|
+
}
|
|
630346
|
+
}
|
|
630347
|
+
}
|
|
630348
|
+
});
|
|
630349
|
+
|
|
629295
630350
|
// ../../../node_modules/.pnpm/@fern-fern+docs-config@0.0.80/node_modules/@fern-fern/docs-config/api/resources/docs/types/DocsConfiguration.js
|
|
629296
630351
|
var require_DocsConfiguration = __commonJS({
|
|
629297
630352
|
"../../../node_modules/.pnpm/@fern-fern+docs-config@0.0.80/node_modules/@fern-fern/docs-config/api/resources/docs/types/DocsConfiguration.js"(exports2) {
|
|
@@ -683450,6 +684505,13 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
|
|
|
683450
684505
|
* Defaults to false.
|
|
683451
684506
|
*/
|
|
683452
684507
|
preserveSingleSchemaOneof: external_exports.boolean().optional(),
|
|
684508
|
+
/**
|
|
684509
|
+
* If true, an allOf containing a oneOf/anyOf member is distributed into a union, where each
|
|
684510
|
+
* variant is the union member merged with the remaining allOf members.
|
|
684511
|
+
* If false, the variants' properties are flattened into a single object and marked optional.
|
|
684512
|
+
* Defaults to false.
|
|
684513
|
+
*/
|
|
684514
|
+
preserveOneOfInAllOf: external_exports.boolean().optional(),
|
|
683453
684515
|
/**
|
|
683454
684516
|
* Whether to inline allOf schemas. If false, allOf schemas will be
|
|
683455
684517
|
* extended in the code generation.
|
|
@@ -692080,7 +693142,7 @@ var AccessTokenPosthogManager = class {
|
|
|
692080
693142
|
properties: {
|
|
692081
693143
|
...event,
|
|
692082
693144
|
...event.properties,
|
|
692083
|
-
version: "5.
|
|
693145
|
+
version: "5.86.0",
|
|
692084
693146
|
usingAccessToken: true,
|
|
692085
693147
|
...getRunIdProperties()
|
|
692086
693148
|
}
|
|
@@ -692146,7 +693208,7 @@ var UserPosthogManager = class {
|
|
|
692146
693208
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
692147
693209
|
event: "CLI",
|
|
692148
693210
|
properties: {
|
|
692149
|
-
version: "5.
|
|
693211
|
+
version: "5.86.0",
|
|
692150
693212
|
...event,
|
|
692151
693213
|
...event.properties,
|
|
692152
693214
|
usingAccessToken: false,
|
|
@@ -698953,6 +700015,7 @@ var LegacyApiSpecAdapter = class {
|
|
|
698953
700015
|
additionalPropertiesDefaultsTo: settings.additionalPropertiesDefaultsTo,
|
|
698954
700016
|
typeDatesAsStrings: settings.typeDatesAsStrings,
|
|
698955
700017
|
preserveSingleSchemaOneOf: settings.preserveSingleSchemaOneof,
|
|
700018
|
+
preserveOneOfInAllOf: settings.preserveOneOfInAllOf,
|
|
698956
700019
|
inlineAllOfSchemas: settings.inlineAllOfSchemas,
|
|
698957
700020
|
resolveAliases: settings.resolveAliases,
|
|
698958
700021
|
groupMultiApiEnvironments: settings.groupMultiApiEnvironments,
|
|
@@ -850835,10 +851898,10 @@ var VFile = class {
|
|
|
850835
851898
|
* @returns {undefined}
|
|
850836
851899
|
* Nothing.
|
|
850837
851900
|
*/
|
|
850838
|
-
set basename(
|
|
850839
|
-
assertNonEmpty(
|
|
850840
|
-
assertPart(
|
|
850841
|
-
this.path = import_node_path21.default.join(this.dirname || "",
|
|
851901
|
+
set basename(basename8) {
|
|
851902
|
+
assertNonEmpty(basename8, "basename");
|
|
851903
|
+
assertPart(basename8, "basename");
|
|
851904
|
+
this.path = import_node_path21.default.join(this.dirname || "", basename8);
|
|
850842
851905
|
}
|
|
850843
851906
|
/**
|
|
850844
851907
|
* Get the parent path (example: `'~'`).
|
|
@@ -871129,8 +872192,8 @@ function isMdxParseSymptom(violation, filesWithMdxParseErrors, mdxRawMessages) {
|
|
|
871129
872192
|
}
|
|
871130
872193
|
}
|
|
871131
872194
|
if (parts.length === 1) {
|
|
871132
|
-
const
|
|
871133
|
-
if (
|
|
872195
|
+
const basename8 = parts[0];
|
|
872196
|
+
if (basename8 != null && violation.message.includes(basename8)) {
|
|
871134
872197
|
return true;
|
|
871135
872198
|
}
|
|
871136
872199
|
}
|
|
@@ -871343,6 +872406,7 @@ var SETTINGS_KEY_MAP = {
|
|
|
871343
872406
|
"additional-properties-defaults-to": "additionalPropertiesDefaultsTo",
|
|
871344
872407
|
"type-dates-as-strings": "typeDatesAsStrings",
|
|
871345
872408
|
"preserve-single-schema-oneof": "preserveSingleSchemaOneof",
|
|
872409
|
+
"preserve-one-of-in-all-of": "preserveOneOfInAllOf",
|
|
871346
872410
|
"inline-all-of-schemas": "inlineAllOfSchemas",
|
|
871347
872411
|
"resolve-aliases": "resolveAliases",
|
|
871348
872412
|
"group-multi-api-environments": "groupMultiApiEnvironments",
|
|
@@ -872804,8 +873868,8 @@ var Migrator = class {
|
|
|
872804
873868
|
return { success: true, fernYml };
|
|
872805
873869
|
}
|
|
872806
873870
|
async findFernDirectory() {
|
|
872807
|
-
const
|
|
872808
|
-
if (
|
|
873871
|
+
const basename8 = this.cwd.split("/").pop();
|
|
873872
|
+
if (basename8 === FERN_DIRECTORY) {
|
|
872809
873873
|
return this.cwd;
|
|
872810
873874
|
}
|
|
872811
873875
|
const fernDir = join8(this.cwd, RelativeFilePath2.of(FERN_DIRECTORY));
|
|
@@ -873032,8 +874096,8 @@ function isMdxParseSymptom2(violation, filesWithMdxParseErrors, mdxRawMessages)
|
|
|
873032
874096
|
}
|
|
873033
874097
|
}
|
|
873034
874098
|
if (parts.length === 1) {
|
|
873035
|
-
const
|
|
873036
|
-
if (
|
|
874099
|
+
const basename8 = parts[0];
|
|
874100
|
+
if (basename8 != null && violation.message.includes(basename8)) {
|
|
873037
874101
|
return true;
|
|
873038
874102
|
}
|
|
873039
874103
|
}
|
|
@@ -873252,7 +874316,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
873252
874316
|
var LOGS_FOLDER_NAME = "logs";
|
|
873253
874317
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
873254
874318
|
function getCliSource() {
|
|
873255
|
-
const version7 = "5.
|
|
874319
|
+
const version7 = "5.86.0";
|
|
873256
874320
|
return `cli@${version7}`;
|
|
873257
874321
|
}
|
|
873258
874322
|
var DebugLogger = class {
|
|
@@ -883122,8 +884186,8 @@ var CdpPage = class _CdpPage extends Page {
|
|
|
883122
884186
|
return this.#buildMetricsObject(response.metrics);
|
|
883123
884187
|
}
|
|
883124
884188
|
async captureHeapSnapshot(options2) {
|
|
883125
|
-
const { createWriteStream:
|
|
883126
|
-
const stream5 =
|
|
884189
|
+
const { createWriteStream: createWriteStream9 } = environment.value.fs;
|
|
884190
|
+
const stream5 = createWriteStream9(options2.path);
|
|
883127
884191
|
const streamPromise = new Promise((resolve15, reject) => {
|
|
883128
884192
|
stream5.on("error", reject);
|
|
883129
884193
|
stream5.on("finish", resolve15);
|
|
@@ -905951,7 +907015,7 @@ var LegacyDocsPublisher = class {
|
|
|
905951
907015
|
previewId,
|
|
905952
907016
|
disableTemplates: void 0,
|
|
905953
907017
|
skipUpload,
|
|
905954
|
-
cliVersion: "5.
|
|
907018
|
+
cliVersion: "5.86.0",
|
|
905955
907019
|
loginCommand: "fern auth login"
|
|
905956
907020
|
});
|
|
905957
907021
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -907732,9 +908796,9 @@ var Wizard = class {
|
|
|
907732
908796
|
const defaultFilename = specFormat === "openapi" ? "openapi.yml" : "asyncapi.yml";
|
|
907733
908797
|
try {
|
|
907734
908798
|
const pathname = new URL(url3).pathname;
|
|
907735
|
-
const
|
|
907736
|
-
if (
|
|
907737
|
-
return
|
|
908799
|
+
const basename8 = import_path82.default.basename(pathname);
|
|
908800
|
+
if (basename8.includes(".")) {
|
|
908801
|
+
return basename8;
|
|
907738
908802
|
}
|
|
907739
908803
|
return defaultFilename;
|
|
907740
908804
|
} catch {
|
|
@@ -972826,7 +973890,7 @@ function getAutomationContextFromEnv() {
|
|
|
972826
973890
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
972827
973891
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
972828
973892
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
972829
|
-
cli_version: "5.
|
|
973893
|
+
cli_version: "5.86.0"
|
|
972830
973894
|
};
|
|
972831
973895
|
}
|
|
972832
973896
|
function isAutomationMode() {
|
|
@@ -973658,7 +974722,7 @@ var CliContext = class _CliContext {
|
|
|
973658
974722
|
if (false) {
|
|
973659
974723
|
this.logger.error("CLI_VERSION is not defined");
|
|
973660
974724
|
}
|
|
973661
|
-
return "5.
|
|
974725
|
+
return "5.86.0";
|
|
973662
974726
|
}
|
|
973663
974727
|
getCliName() {
|
|
973664
974728
|
if (false) {
|
|
@@ -975450,7 +976514,10 @@ init_esm19();
|
|
|
975450
976514
|
init_lib4();
|
|
975451
976515
|
init_lib8();
|
|
975452
976516
|
init_lib33();
|
|
976517
|
+
var import_fs41 = require("fs");
|
|
975453
976518
|
var import_promises168 = require("fs/promises");
|
|
976519
|
+
var import_path110 = require("path");
|
|
976520
|
+
var import_yazl = __toESM(require_yazl(), 1);
|
|
975454
976521
|
var PACK_OUTPUT_DIRECTORY = "fern-dist";
|
|
975455
976522
|
var PACK_DOCKER_IMAGES = {
|
|
975456
976523
|
typescript: "node:22",
|
|
@@ -975566,11 +976633,16 @@ async function packOutputForLanguage({
|
|
|
975566
976633
|
logArtifacts({ distDir, context: context3 });
|
|
975567
976634
|
return;
|
|
975568
976635
|
}
|
|
975569
|
-
case "go":
|
|
975570
|
-
|
|
975571
|
-
|
|
975572
|
-
|
|
976636
|
+
case "go": {
|
|
976637
|
+
await (0, import_promises168.mkdir)(distDir, { recursive: true });
|
|
976638
|
+
const zipName = `${(0, import_path110.basename)(outputPath)}-source.zip`;
|
|
976639
|
+
await zipDirectory({
|
|
976640
|
+
sourceDir: outputPath,
|
|
976641
|
+
zipPath: join8(distDir, RelativeFilePath2.of(zipName))
|
|
976642
|
+
});
|
|
976643
|
+
logArtifacts({ distDir, context: context3 });
|
|
975573
976644
|
return;
|
|
976645
|
+
}
|
|
975574
976646
|
case "swift":
|
|
975575
976647
|
context3.logger.warn(
|
|
975576
976648
|
"Swift SDKs are distributed as source packages (Swift Package Manager), so there is no package artifact to build. Share the output directory itself, or reference it as a local package dependency."
|
|
@@ -975613,6 +976685,32 @@ async function runPackCommands({
|
|
|
975613
976685
|
});
|
|
975614
976686
|
}
|
|
975615
976687
|
}
|
|
976688
|
+
async function zipDirectory({
|
|
976689
|
+
sourceDir,
|
|
976690
|
+
zipPath
|
|
976691
|
+
}) {
|
|
976692
|
+
const zip = new import_yazl.ZipFile();
|
|
976693
|
+
const addEntries = async (dir, prefix2) => {
|
|
976694
|
+
for (const entry of await (0, import_promises168.readdir)(dir, { withFileTypes: true })) {
|
|
976695
|
+
if (prefix2 === "" && (entry.name === PACK_OUTPUT_DIRECTORY || entry.name === ".git")) {
|
|
976696
|
+
continue;
|
|
976697
|
+
}
|
|
976698
|
+
const entryPath = join8(dir, RelativeFilePath2.of(entry.name));
|
|
976699
|
+
const entryName = prefix2 === "" ? entry.name : `${prefix2}/${entry.name}`;
|
|
976700
|
+
if (entry.isDirectory()) {
|
|
976701
|
+
await addEntries(entryPath, entryName);
|
|
976702
|
+
} else if (entry.isFile()) {
|
|
976703
|
+
zip.addFile(entryPath, entryName);
|
|
976704
|
+
}
|
|
976705
|
+
}
|
|
976706
|
+
};
|
|
976707
|
+
await addEntries(sourceDir, "");
|
|
976708
|
+
zip.end();
|
|
976709
|
+
await new Promise((resolve15, reject) => {
|
|
976710
|
+
zip.outputStream.on("error", reject);
|
|
976711
|
+
zip.outputStream.pipe((0, import_fs41.createWriteStream)(zipPath)).on("close", resolve15).on("error", reject);
|
|
976712
|
+
});
|
|
976713
|
+
}
|
|
975616
976714
|
async function removeDistDirIfEmpty(outputPath) {
|
|
975617
976715
|
const distDir = join8(outputPath, RelativeFilePath2.of(PACK_OUTPUT_DIRECTORY));
|
|
975618
976716
|
try {
|
|
@@ -976640,7 +977738,7 @@ function renderOverflowWarning(failureCount) {
|
|
|
976640
977738
|
|
|
976641
977739
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
976642
977740
|
init_lib4();
|
|
976643
|
-
var
|
|
977741
|
+
var import_fs42 = require("fs");
|
|
976644
977742
|
var import_promises169 = require("fs/promises");
|
|
976645
977743
|
var JSON_SCHEMA_VERSION = 1;
|
|
976646
977744
|
function renderStdoutSummary(results) {
|
|
@@ -976846,13 +977944,13 @@ function writeResultsSync({
|
|
|
976846
977944
|
const stepSummaryPath = getGithubStepSummaryPath();
|
|
976847
977945
|
if (stepSummaryPath != null) {
|
|
976848
977946
|
try {
|
|
976849
|
-
(0,
|
|
977947
|
+
(0, import_fs42.appendFileSync)(stepSummaryPath, renderMarkdownSummary(results), "utf8");
|
|
976850
977948
|
} catch {
|
|
976851
977949
|
}
|
|
976852
977950
|
}
|
|
976853
977951
|
if (jsonOutputPath != null) {
|
|
976854
977952
|
try {
|
|
976855
|
-
(0,
|
|
977953
|
+
(0, import_fs42.writeFileSync)(jsonOutputPath, JSON.stringify(renderJsonSummary(results), null, 2), "utf8");
|
|
976856
977954
|
} catch {
|
|
976857
977955
|
}
|
|
976858
977956
|
}
|
|
@@ -983335,7 +984433,7 @@ init_lib12();
|
|
|
983335
984433
|
init_lib8();
|
|
983336
984434
|
var import_promises201 = require("fs/promises");
|
|
983337
984435
|
init_js_yaml();
|
|
983338
|
-
var
|
|
984436
|
+
var import_path111 = __toESM(require("path"), 1);
|
|
983339
984437
|
var ThemeExporter = class {
|
|
983340
984438
|
constructor(docsWorkspace) {
|
|
983341
984439
|
this.docsWorkspace = docsWorkspace;
|
|
@@ -983343,8 +984441,8 @@ var ThemeExporter = class {
|
|
|
983343
984441
|
docsWorkspace;
|
|
983344
984442
|
async export({ output: output2, context: context3 }) {
|
|
983345
984443
|
const docsYmlPath = this.docsWorkspace.absoluteFilepathToDocsConfig;
|
|
983346
|
-
const docsDir =
|
|
983347
|
-
const outDir = output2 != null ?
|
|
984444
|
+
const docsDir = import_path111.default.dirname(docsYmlPath);
|
|
984445
|
+
const outDir = output2 != null ? import_path111.default.resolve(process.cwd(), output2) : import_path111.default.join(this.docsWorkspace.absoluteFilePath, "theme");
|
|
983348
984446
|
context3.logger.info(`Exporting theme-eligible fields from docs.yml \u2192 ${outDir}`);
|
|
983349
984447
|
const raw = index_vite_proxy_tmp_default.load(await (0, import_promises201.readFile)(docsYmlPath, "utf-8"));
|
|
983350
984448
|
const themeConfig = {};
|
|
@@ -983354,26 +984452,26 @@ var ThemeExporter = class {
|
|
|
983354
984452
|
}
|
|
983355
984453
|
}
|
|
983356
984454
|
await (0, import_promises201.mkdir)(outDir, { recursive: true });
|
|
983357
|
-
const assetsDir =
|
|
984455
|
+
const assetsDir = import_path111.default.join(outDir, "assets");
|
|
983358
984456
|
await (0, import_promises201.mkdir)(assetsDir, { recursive: true });
|
|
983359
984457
|
const exported = await copyLocalFiles(themeConfig, docsDir, assetsDir);
|
|
983360
|
-
await (0, import_promises201.writeFile)(
|
|
984458
|
+
await (0, import_promises201.writeFile)(import_path111.default.join(outDir, "theme.yml"), index_vite_proxy_tmp_default.dump(exported), "utf-8");
|
|
983361
984459
|
context3.logger.info(`Theme exported to ${outDir}/theme.yml`);
|
|
983362
984460
|
}
|
|
983363
984461
|
};
|
|
983364
984462
|
async function copyLocalFiles(obj, sourceDir, assetsDir) {
|
|
983365
984463
|
if (obj === null || typeof obj !== "object") {
|
|
983366
984464
|
if (typeof obj === "string" && !isURL(obj)) {
|
|
983367
|
-
const abs =
|
|
983368
|
-
const relFromSource =
|
|
983369
|
-
const projectRoot =
|
|
983370
|
-
const relFromProject =
|
|
983371
|
-
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ?
|
|
983372
|
-
const dest =
|
|
984465
|
+
const abs = import_path111.default.resolve(sourceDir, obj);
|
|
984466
|
+
const relFromSource = import_path111.default.relative(sourceDir, abs);
|
|
984467
|
+
const projectRoot = import_path111.default.dirname(sourceDir);
|
|
984468
|
+
const relFromProject = import_path111.default.relative(projectRoot, abs);
|
|
984469
|
+
const destRelative = relFromSource.startsWith("..") ? relFromProject.startsWith("..") ? import_path111.default.basename(abs) : relFromProject : relFromSource;
|
|
984470
|
+
const dest = import_path111.default.join(assetsDir, destRelative);
|
|
983373
984471
|
try {
|
|
983374
|
-
await (0, import_promises201.mkdir)(
|
|
984472
|
+
await (0, import_promises201.mkdir)(import_path111.default.dirname(dest), { recursive: true });
|
|
983375
984473
|
await (0, import_promises201.copyFile)(abs, dest);
|
|
983376
|
-
return `./assets/${destRelative.split(
|
|
984474
|
+
return `./assets/${destRelative.split(import_path111.default.sep).join("/")}`;
|
|
983377
984475
|
} catch {
|
|
983378
984476
|
return obj;
|
|
983379
984477
|
}
|
|
@@ -983466,7 +984564,7 @@ async function listDocsThemes({
|
|
|
983466
984564
|
init_lib6();
|
|
983467
984565
|
var import_promises203 = require("fs/promises");
|
|
983468
984566
|
init_js_yaml();
|
|
983469
|
-
var
|
|
984567
|
+
var import_path113 = __toESM(require("path"), 1);
|
|
983470
984568
|
|
|
983471
984569
|
// src/commands/docs-theme/ThemeConfigProcessor.ts
|
|
983472
984570
|
init_lib8();
|
|
@@ -983475,7 +984573,7 @@ var import_child_process13 = require("child_process");
|
|
|
983475
984573
|
var import_crypto10 = require("crypto");
|
|
983476
984574
|
var import_promises202 = require("fs/promises");
|
|
983477
984575
|
var import_mime_types2 = __toESM(require_mime_types(), 1);
|
|
983478
|
-
var
|
|
984576
|
+
var import_path112 = __toESM(require("path"), 1);
|
|
983479
984577
|
function getGitRoot() {
|
|
983480
984578
|
try {
|
|
983481
984579
|
return (0, import_child_process13.execSync)("git rev-parse --show-toplevel", { encoding: "utf-8" }).trim();
|
|
@@ -983484,9 +984582,9 @@ function getGitRoot() {
|
|
|
983484
984582
|
}
|
|
983485
984583
|
}
|
|
983486
984584
|
function posixBindPath(gitRoot, absolutePath) {
|
|
983487
|
-
const repoName =
|
|
983488
|
-
const relative6 =
|
|
983489
|
-
return [repoName, ...relative6.split(
|
|
984585
|
+
const repoName = import_path112.default.basename(gitRoot);
|
|
984586
|
+
const relative6 = import_path112.default.relative(gitRoot, absolutePath);
|
|
984587
|
+
return [repoName, ...relative6.split(import_path112.default.sep)].join("/");
|
|
983490
984588
|
}
|
|
983491
984589
|
var ThemeConfigProcessor = class {
|
|
983492
984590
|
themeDir;
|
|
@@ -983500,7 +984598,7 @@ var ThemeConfigProcessor = class {
|
|
|
983500
984598
|
token,
|
|
983501
984599
|
context: context3
|
|
983502
984600
|
}) {
|
|
983503
|
-
this.themeDir =
|
|
984601
|
+
this.themeDir = import_path112.default.join(docsWorkspace.absoluteFilePath, "theme");
|
|
983504
984602
|
this.orgId = orgId;
|
|
983505
984603
|
this.token = token;
|
|
983506
984604
|
this.gitRoot = getGitRoot();
|
|
@@ -983515,7 +984613,7 @@ var ThemeConfigProcessor = class {
|
|
|
983515
984613
|
const errors4 = [];
|
|
983516
984614
|
await Promise.all(
|
|
983517
984615
|
filePaths.map(async (filePath) => {
|
|
983518
|
-
const abs =
|
|
984616
|
+
const abs = import_path112.default.resolve(this.themeDir, filePath);
|
|
983519
984617
|
try {
|
|
983520
984618
|
await (0, import_promises202.access)(abs);
|
|
983521
984619
|
} catch {
|
|
@@ -983602,7 +984700,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983602
984700
|
if (isURL(value2)) {
|
|
983603
984701
|
return value2;
|
|
983604
984702
|
}
|
|
983605
|
-
const abs =
|
|
984703
|
+
const abs = import_path112.default.resolve(this.themeDir, value2);
|
|
983606
984704
|
this.context.logger.debug(` Uploading ${value2}...`);
|
|
983607
984705
|
const hash5 = await this.uploadFileToCas(abs);
|
|
983608
984706
|
filesUploaded++;
|
|
@@ -983685,7 +984783,7 @@ ${errors4.map((e2) => ` - ${e2}`).join("\n")}`,
|
|
|
983685
984783
|
const content5 = await (0, import_promises202.readFile)(absolutePath);
|
|
983686
984784
|
const contentType = import_mime_types2.default.lookup(absolutePath) || "application/octet-stream";
|
|
983687
984785
|
const bindPath = posixBindPath(this.gitRoot, absolutePath);
|
|
983688
|
-
return this.uploadToCas(content5, contentType, bindPath,
|
|
984786
|
+
return this.uploadToCas(content5, contentType, bindPath, import_path112.default.basename(absolutePath));
|
|
983689
984787
|
}
|
|
983690
984788
|
async uploadToCas(content5, contentType, bindPath, label) {
|
|
983691
984789
|
const hash5 = (0, import_crypto10.createHash)("sha256").update(content5).digest("hex");
|
|
@@ -983793,7 +984891,7 @@ async function uploadDocsTheme({
|
|
|
983793
984891
|
return;
|
|
983794
984892
|
}
|
|
983795
984893
|
const orgId = org ?? project.config.organization;
|
|
983796
|
-
const themeYmlPath =
|
|
984894
|
+
const themeYmlPath = import_path113.default.join(docsWorkspace.absoluteFilePath, "theme", "theme.yml");
|
|
983797
984895
|
await cliContext.runTask(async (context3) => {
|
|
983798
984896
|
let rawYaml;
|
|
983799
984897
|
try {
|
|
@@ -985640,7 +986738,7 @@ function summarizeValidationErrors(errors4) {
|
|
|
985640
986738
|
// src/commands/generate-dynamic-ir/generateDynamicIrForWorkspaces.ts
|
|
985641
986739
|
init_lib8();
|
|
985642
986740
|
init_lib6();
|
|
985643
|
-
var
|
|
986741
|
+
var import_path114 = __toESM(require("path"), 1);
|
|
985644
986742
|
|
|
985645
986743
|
// src/commands/generate-ir/generateIrForFernWorkspace.ts
|
|
985646
986744
|
init_lib36();
|
|
@@ -985707,7 +986805,7 @@ async function generateDynamicIrForWorkspaces({
|
|
|
985707
986805
|
code: CliError.Code.InternalError
|
|
985708
986806
|
});
|
|
985709
986807
|
}
|
|
985710
|
-
const irOutputFilePath =
|
|
986808
|
+
const irOutputFilePath = import_path114.default.resolve(irFilepath);
|
|
985711
986809
|
await streamObjectToFile(AbsoluteFilePath2.of(irOutputFilePath), intermediateRepresentation.dynamic);
|
|
985712
986810
|
context3.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
985713
986811
|
});
|
|
@@ -985718,7 +986816,7 @@ async function generateDynamicIrForWorkspaces({
|
|
|
985718
986816
|
// src/commands/generate-fdr/generateFdrApiDefinitionForWorkspaces.ts
|
|
985719
986817
|
init_lib8();
|
|
985720
986818
|
init_lib66();
|
|
985721
|
-
var
|
|
986819
|
+
var import_path115 = __toESM(require("path"), 1);
|
|
985722
986820
|
async function generateFdrApiDefinitionForWorkspaces({
|
|
985723
986821
|
project,
|
|
985724
986822
|
outputFilepath,
|
|
@@ -985755,7 +986853,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
985755
986853
|
},
|
|
985756
986854
|
context: context3
|
|
985757
986855
|
});
|
|
985758
|
-
const resolvedOutputFilePath = AbsoluteFilePath2.of(
|
|
986856
|
+
const resolvedOutputFilePath = AbsoluteFilePath2.of(import_path115.default.resolve(outputFilepath));
|
|
985759
986857
|
await streamObjectToFile(resolvedOutputFilePath, apiDefinition, { pretty: true });
|
|
985760
986858
|
context3.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
985761
986859
|
});
|
|
@@ -985767,7 +986865,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
985767
986865
|
init_lib8();
|
|
985768
986866
|
init_lib9();
|
|
985769
986867
|
init_lib35();
|
|
985770
|
-
var
|
|
986868
|
+
var import_path116 = __toESM(require("path"), 1);
|
|
985771
986869
|
async function generateIrForWorkspaces({
|
|
985772
986870
|
project,
|
|
985773
986871
|
irFilepath,
|
|
@@ -985797,7 +986895,7 @@ async function generateIrForWorkspaces({
|
|
|
985797
986895
|
readme,
|
|
985798
986896
|
directFromOpenapi
|
|
985799
986897
|
});
|
|
985800
|
-
const irOutputFilePath = AbsoluteFilePath2.of(
|
|
986898
|
+
const irOutputFilePath = AbsoluteFilePath2.of(import_path116.default.resolve(irFilepath));
|
|
985801
986899
|
await streamObjectToFile(irOutputFilePath, intermediateRepresentation, { pretty: true });
|
|
985802
986900
|
context3.logger.info(`Wrote IR to ${irOutputFilePath}`);
|
|
985803
986901
|
});
|
|
@@ -985854,7 +986952,7 @@ async function getIntermediateRepresentation2({
|
|
|
985854
986952
|
// src/commands/generate-openapi-fdr/generateOpenApiToFdrApiDefinitionForWorkspaces.ts
|
|
985855
986953
|
init_lib67();
|
|
985856
986954
|
init_lib8();
|
|
985857
|
-
var
|
|
986955
|
+
var import_path117 = __toESM(require("path"), 1);
|
|
985858
986956
|
async function generateOpenApiToFdrApiDefinitionForWorkspaces({
|
|
985859
986957
|
project,
|
|
985860
986958
|
outputFilepath,
|
|
@@ -985865,7 +986963,7 @@ async function generateOpenApiToFdrApiDefinitionForWorkspaces({
|
|
|
985865
986963
|
project.apiWorkspaces.map(async (workspace) => {
|
|
985866
986964
|
await cliContext.runTaskForWorkspace(workspace, async (context3) => {
|
|
985867
986965
|
const fdrApiDefinition = await generateFdrFromOpenApiWorkspaceV3(workspace, context3, audiences);
|
|
985868
|
-
const resolvedOutputFilePath = AbsoluteFilePath2.of(
|
|
986966
|
+
const resolvedOutputFilePath = AbsoluteFilePath2.of(import_path117.default.resolve(outputFilepath));
|
|
985869
986967
|
await streamObjectToFile(resolvedOutputFilePath, fdrApiDefinition, { pretty: true });
|
|
985870
986968
|
context3.logger.info(`Wrote FDR API definition to ${resolvedOutputFilePath}`);
|
|
985871
986969
|
});
|
|
@@ -985878,7 +986976,7 @@ init_lib8();
|
|
|
985878
986976
|
init_lib35();
|
|
985879
986977
|
init_lib13();
|
|
985880
986978
|
init_lib16();
|
|
985881
|
-
var
|
|
986979
|
+
var import_path118 = __toESM(require("path"), 1);
|
|
985882
986980
|
async function generateOpenAPIIrForWorkspaces({
|
|
985883
986981
|
project,
|
|
985884
986982
|
irFilepath,
|
|
@@ -985900,7 +986998,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
985900
986998
|
context: context3,
|
|
985901
986999
|
documents: await openAPILoader.loadDocuments({ context: context3, specs: openAPISpecs })
|
|
985902
987000
|
});
|
|
985903
|
-
const irOutputFilePath = AbsoluteFilePath2.of(
|
|
987001
|
+
const irOutputFilePath = AbsoluteFilePath2.of(import_path118.default.resolve(irFilepath));
|
|
985904
987002
|
const openApiIrJson = serialization_exports5.OpenApiIntermediateRepresentation.jsonOrThrow(openAPIIr, {
|
|
985905
987003
|
skipValidation: true
|
|
985906
987004
|
});
|
|
@@ -987532,7 +988630,7 @@ init_lib6();
|
|
|
987532
988630
|
init_esm19();
|
|
987533
988631
|
init_axios2();
|
|
987534
988632
|
var import_promises210 = require("fs/promises");
|
|
987535
|
-
var
|
|
988633
|
+
var import_path119 = __toESM(require("path"), 1);
|
|
987536
988634
|
init_index_min2();
|
|
987537
988635
|
var import_tmp_promise21 = __toESM(require_tmp_promise(), 1);
|
|
987538
988636
|
async function registerWorkspacesV1({
|
|
@@ -987581,7 +988679,7 @@ async function registerWorkspacesV1({
|
|
|
987581
988679
|
return;
|
|
987582
988680
|
}
|
|
987583
988681
|
const tmpDir = await import_tmp_promise21.default.dir();
|
|
987584
|
-
const tarPath =
|
|
988682
|
+
const tarPath = import_path119.default.join(tmpDir.path, "definition.tgz");
|
|
987585
988683
|
context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
987586
988684
|
await Kn({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
987587
988685
|
context3.logger.info("Uploading definition...");
|
|
@@ -987643,7 +988741,7 @@ function getAIEnhancerConfig2() {
|
|
|
987643
988741
|
init_lib8();
|
|
987644
988742
|
init_lib35();
|
|
987645
988743
|
var import_promises211 = require("fs/promises");
|
|
987646
|
-
var
|
|
988744
|
+
var import_path120 = __toESM(require("path"), 1);
|
|
987647
988745
|
async function resolveSpecsForWorkspaces({
|
|
987648
988746
|
project,
|
|
987649
988747
|
outputDir,
|
|
@@ -987661,7 +988759,7 @@ async function resolveSpecsForWorkspaces({
|
|
|
987661
988759
|
context3.logger.info("No specs found.");
|
|
987662
988760
|
return;
|
|
987663
988761
|
}
|
|
987664
|
-
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(
|
|
988762
|
+
const workspaceOutputDir = project.apiWorkspaces.length > 1 ? AbsoluteFilePath2.of(import_path120.default.join(outputDir, workspace.workspaceName ?? "api")) : outputDir;
|
|
987665
988763
|
await (0, import_promises211.mkdir)(workspaceOutputDir, { recursive: true });
|
|
987666
988764
|
const manifest = await collectRawSpecs({
|
|
987667
988765
|
specs,
|
|
@@ -987670,7 +988768,7 @@ async function resolveSpecsForWorkspaces({
|
|
|
987670
988768
|
context: context3
|
|
987671
988769
|
});
|
|
987672
988770
|
await (0, import_promises211.writeFile)(
|
|
987673
|
-
|
|
988771
|
+
import_path120.default.join(workspaceOutputDir, SPECS_MANIFEST_FILENAME),
|
|
987674
988772
|
JSON.stringify(manifest, void 0, 4)
|
|
987675
988773
|
);
|
|
987676
988774
|
context3.logger.info(`Resolved ${manifest.specs.length} spec(s) to ${workspaceOutputDir}`);
|
|
@@ -988190,7 +989288,7 @@ init_lib33();
|
|
|
988190
989288
|
init_lib6();
|
|
988191
989289
|
init_source();
|
|
988192
989290
|
var import_promises213 = require("fs/promises");
|
|
988193
|
-
var
|
|
989291
|
+
var import_path121 = require("path");
|
|
988194
989292
|
async function getPackageManagerBinDir(logger4, pm) {
|
|
988195
989293
|
let command3;
|
|
988196
989294
|
let args;
|
|
@@ -988269,16 +989367,16 @@ async function detectInstallationMethod(logger4) {
|
|
|
988269
989367
|
}
|
|
988270
989368
|
}
|
|
988271
989369
|
}
|
|
988272
|
-
const fernDir = (0,
|
|
989370
|
+
const fernDir = (0, import_path121.dirname)(resolvedPath);
|
|
988273
989371
|
logger4.debug(`fern directory: ${fernDir}`);
|
|
988274
989372
|
const packageManagers = ["pnpm", "yarn", "bun", "npm"];
|
|
988275
989373
|
for (const pm of packageManagers) {
|
|
988276
989374
|
const binDir = await getPackageManagerBinDir(logger4, pm);
|
|
988277
989375
|
if (binDir != null) {
|
|
988278
989376
|
logger4.debug(`${pm} bin dir: ${binDir}`);
|
|
988279
|
-
const normalizedFernDir = (0,
|
|
988280
|
-
const normalizedBinDir = (0,
|
|
988281
|
-
if (normalizedFernDir === normalizedBinDir || normalizedFernDir.startsWith(normalizedBinDir +
|
|
989377
|
+
const normalizedFernDir = (0, import_path121.normalize)(fernDir);
|
|
989378
|
+
const normalizedBinDir = (0, import_path121.normalize)(binDir);
|
|
989379
|
+
if (normalizedFernDir === normalizedBinDir || normalizedFernDir.startsWith(normalizedBinDir + import_path121.sep) || normalizedFernDir.startsWith(normalizedBinDir + "/") || normalizedFernDir.startsWith(normalizedBinDir + "\\")) {
|
|
988282
989380
|
return {
|
|
988283
989381
|
type: pm,
|
|
988284
989382
|
command: pm,
|
|
@@ -988288,8 +989386,8 @@ async function detectInstallationMethod(logger4) {
|
|
|
988288
989386
|
}
|
|
988289
989387
|
}
|
|
988290
989388
|
}
|
|
988291
|
-
const normalizedPath = (0,
|
|
988292
|
-
if (normalizedPath.includes(".pnpm") || normalizedPath.includes("pnpm-global") || normalizedPath.includes(`${
|
|
989389
|
+
const normalizedPath = (0, import_path121.normalize)(resolvedPath);
|
|
989390
|
+
if (normalizedPath.includes(".pnpm") || normalizedPath.includes("pnpm-global") || normalizedPath.includes(`${import_path121.sep}pnpm${import_path121.sep}`) || normalizedPath.includes("/pnpm/") || normalizedPath.includes("\\pnpm\\")) {
|
|
988293
989391
|
return {
|
|
988294
989392
|
type: "pnpm",
|
|
988295
989393
|
command: "pnpm",
|
|
@@ -988297,7 +989395,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988297
989395
|
resolvedPath
|
|
988298
989396
|
};
|
|
988299
989397
|
}
|
|
988300
|
-
if (normalizedPath.includes(`${
|
|
989398
|
+
if (normalizedPath.includes(`${import_path121.sep}.yarn${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}yarn${import_path121.sep}`) || normalizedPath.includes("/.yarn/") || normalizedPath.includes("/yarn/") || normalizedPath.includes("\\.yarn\\") || normalizedPath.includes("\\yarn\\")) {
|
|
988301
989399
|
return {
|
|
988302
989400
|
type: "yarn",
|
|
988303
989401
|
command: "yarn",
|
|
@@ -988305,7 +989403,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988305
989403
|
resolvedPath
|
|
988306
989404
|
};
|
|
988307
989405
|
}
|
|
988308
|
-
if (normalizedPath.includes(`${
|
|
989406
|
+
if (normalizedPath.includes(`${import_path121.sep}.bun${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}bun${import_path121.sep}`) || normalizedPath.includes("/.bun/") || normalizedPath.includes("/bun/") || normalizedPath.includes("\\.bun\\") || normalizedPath.includes("\\bun\\")) {
|
|
988309
989407
|
return {
|
|
988310
989408
|
type: "bun",
|
|
988311
989409
|
command: "bun",
|
|
@@ -988313,7 +989411,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988313
989411
|
resolvedPath
|
|
988314
989412
|
};
|
|
988315
989413
|
}
|
|
988316
|
-
if (normalizedPath.includes(`${
|
|
989414
|
+
if (normalizedPath.includes(`${import_path121.sep}lib${import_path121.sep}node_modules${import_path121.sep}`) || normalizedPath.includes(`${import_path121.sep}node_modules${import_path121.sep}`) || normalizedPath.includes("/lib/node_modules/") || normalizedPath.includes("/node_modules/") || normalizedPath.includes("\\lib\\node_modules\\") || normalizedPath.includes("\\node_modules\\")) {
|
|
988317
989415
|
return {
|
|
988318
989416
|
type: "npm",
|
|
988319
989417
|
command: "npm",
|
|
@@ -988327,7 +989425,7 @@ async function detectInstallationMethod(logger4) {
|
|
|
988327
989425
|
}
|
|
988328
989426
|
logger4.debug(` - Package manager bin directories checked: pnpm, yarn, bun, npm (none matched)`);
|
|
988329
989427
|
logger4.debug(
|
|
988330
|
-
` - Path patterns checked: .pnpm, pnpm-global, ${
|
|
989428
|
+
` - Path patterns checked: .pnpm, pnpm-global, ${import_path121.sep}pnpm${import_path121.sep}, .yarn, ${import_path121.sep}yarn${import_path121.sep}, .bun, ${import_path121.sep}bun${import_path121.sep}, ${import_path121.sep}node_modules${import_path121.sep}`
|
|
988331
989429
|
);
|
|
988332
989430
|
logger4.debug(` - Resolved path: ${resolvedPath}`);
|
|
988333
989431
|
logger4.debug(` - Directory: ${fernDir}`);
|
|
@@ -988874,9 +989972,9 @@ async function validateDocsBrokenLinks({
|
|
|
988874
989972
|
init_lib19();
|
|
988875
989973
|
init_lib64();
|
|
988876
989974
|
init_source();
|
|
988877
|
-
var
|
|
989975
|
+
var import_fs43 = require("fs");
|
|
988878
989976
|
var import_gray_matter12 = __toESM(require_gray_matter(), 1);
|
|
988879
|
-
var
|
|
989977
|
+
var import_path122 = __toESM(require("path"), 1);
|
|
988880
989978
|
function calculateVisualColumn(text9, charIndex, tabWidth = 4) {
|
|
988881
989979
|
let visualColumn = 0;
|
|
988882
989980
|
for (let i5 = 0; i5 < Math.min(charIndex, text9.length); i5++) {
|
|
@@ -988898,7 +989996,7 @@ var MdxValidationError = class {
|
|
|
988898
989996
|
column;
|
|
988899
989997
|
contextLines;
|
|
988900
989998
|
toString() {
|
|
988901
|
-
const relativePath =
|
|
989999
|
+
const relativePath = import_path122.default.relative(process.cwd(), this.filepath);
|
|
988902
990000
|
let formatted = source_default.red(` ${relativePath}`);
|
|
988903
990001
|
if (this.line != null) {
|
|
988904
990002
|
formatted += source_default.yellow(`:${this.line}`);
|
|
@@ -988950,7 +990048,7 @@ async function validateMdxFiles({
|
|
|
988950
990048
|
});
|
|
988951
990049
|
const filesToCheck = Array.from(new Set(allPages));
|
|
988952
990050
|
for (const filepath of filesToCheck) {
|
|
988953
|
-
const content5 = (0,
|
|
990051
|
+
const content5 = (0, import_fs43.readFileSync)(filepath, "utf-8");
|
|
988954
990052
|
try {
|
|
988955
990053
|
parseMarkdownToTree(content5);
|
|
988956
990054
|
} catch (error50) {
|
|
@@ -989439,7 +990537,7 @@ init_lib8();
|
|
|
989439
990537
|
init_source();
|
|
989440
990538
|
var import_promises216 = require("fs/promises");
|
|
989441
990539
|
init_js_yaml();
|
|
989442
|
-
var
|
|
990540
|
+
var import_path123 = __toESM(require("path"), 1);
|
|
989443
990541
|
async function writeDefinitionForWorkspaces({
|
|
989444
990542
|
project,
|
|
989445
990543
|
cliContext,
|
|
@@ -989477,7 +990575,7 @@ async function writeDefinitionForFernWorkspace({
|
|
|
989477
990575
|
absolutePathToOutputDirectory
|
|
989478
990576
|
});
|
|
989479
990577
|
context3.logger.info(
|
|
989480
|
-
source_default.green(`Wrote imported definition at ${
|
|
990578
|
+
source_default.green(`Wrote imported definition at ${import_path123.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
989481
990579
|
);
|
|
989482
990580
|
}
|
|
989483
990581
|
}
|
|
@@ -989494,7 +990592,7 @@ async function writeDefinitionForNonFernWorkspace({
|
|
|
989494
990592
|
absolutePathToOutputDirectory
|
|
989495
990593
|
});
|
|
989496
990594
|
context3.logger.info(
|
|
989497
|
-
source_default.green(`Wrote definition to ${
|
|
990595
|
+
source_default.green(`Wrote definition to ${import_path123.default.relative(process.cwd(), absolutePathToOutputDirectory)}`)
|
|
989498
990596
|
);
|
|
989499
990597
|
}
|
|
989500
990598
|
async function writeFernDefinition({
|