@fern-api/fern-api-dev 3.44.0 → 3.44.1-2-g8d6db0b72a
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 +870 -796
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -31948,14 +31948,14 @@ var require_urlencoded = __commonJS({
|
|
|
31948
31948
|
}
|
|
31949
31949
|
return output2;
|
|
31950
31950
|
}
|
|
31951
|
-
function strictlySplitByteSequence(buf,
|
|
31951
|
+
function strictlySplitByteSequence(buf, cp10) {
|
|
31952
31952
|
const list14 = [];
|
|
31953
31953
|
let last4 = 0;
|
|
31954
|
-
let i11 = buf.indexOf(
|
|
31954
|
+
let i11 = buf.indexOf(cp10);
|
|
31955
31955
|
while (i11 >= 0) {
|
|
31956
31956
|
list14.push(buf.slice(last4, i11));
|
|
31957
31957
|
last4 = i11 + 1;
|
|
31958
|
-
i11 = buf.indexOf(
|
|
31958
|
+
i11 = buf.indexOf(cp10, last4);
|
|
31959
31959
|
}
|
|
31960
31960
|
if (last4 !== buf.length) {
|
|
31961
31961
|
list14.push(buf.slice(last4));
|
|
@@ -35853,7 +35853,7 @@ var require_base64 = __commonJS({
|
|
|
35853
35853
|
var cb_btou = function(cccc) {
|
|
35854
35854
|
switch (cccc.length) {
|
|
35855
35855
|
case 4:
|
|
35856
|
-
var
|
|
35856
|
+
var cp10 = (7 & cccc.charCodeAt(0)) << 18 | (63 & cccc.charCodeAt(1)) << 12 | (63 & cccc.charCodeAt(2)) << 6 | 63 & cccc.charCodeAt(3), offset2 = cp10 - 65536;
|
|
35857
35857
|
return _fromCC2((offset2 >>> 10) + 55296) + _fromCC2((offset2 & 1023) + 56320);
|
|
35858
35858
|
case 3:
|
|
35859
35859
|
return _fromCC2((15 & cccc.charCodeAt(0)) << 12 | (63 & cccc.charCodeAt(1)) << 6 | 63 & cccc.charCodeAt(2));
|
|
@@ -157604,12 +157604,12 @@ var require_code3 = __commonJS({
|
|
|
157604
157604
|
function isLineTerminator(ch3) {
|
|
157605
157605
|
return ch3 === 10 || ch3 === 13 || ch3 === 8232 || ch3 === 8233;
|
|
157606
157606
|
}
|
|
157607
|
-
function fromCodePoint2(
|
|
157608
|
-
if (
|
|
157609
|
-
return String.fromCharCode(
|
|
157607
|
+
function fromCodePoint2(cp10) {
|
|
157608
|
+
if (cp10 <= 65535) {
|
|
157609
|
+
return String.fromCharCode(cp10);
|
|
157610
157610
|
}
|
|
157611
|
-
var cu1 = String.fromCharCode(Math.floor((
|
|
157612
|
-
var cu22 = String.fromCharCode((
|
|
157611
|
+
var cu1 = String.fromCharCode(Math.floor((cp10 - 65536) / 1024) + 55296);
|
|
157612
|
+
var cu22 = String.fromCharCode((cp10 - 65536) % 1024 + 56320);
|
|
157613
157613
|
return cu1 + cu22;
|
|
157614
157614
|
}
|
|
157615
157615
|
IDENTIFIER_START = new Array(128);
|
|
@@ -162201,8 +162201,8 @@ var require_esprima = __commonJS({
|
|
|
162201
162201
|
return result;
|
|
162202
162202
|
};
|
|
162203
162203
|
JSXParser2.prototype.lexJSX = function() {
|
|
162204
|
-
var
|
|
162205
|
-
if (
|
|
162204
|
+
var cp10 = this.scanner.source.charCodeAt(this.scanner.index);
|
|
162205
|
+
if (cp10 === 60 || cp10 === 62 || cp10 === 47 || cp10 === 58 || cp10 === 61 || cp10 === 123 || cp10 === 125) {
|
|
162206
162206
|
var value = this.scanner.source[this.scanner.index++];
|
|
162207
162207
|
return {
|
|
162208
162208
|
type: 7,
|
|
@@ -162213,7 +162213,7 @@ var require_esprima = __commonJS({
|
|
|
162213
162213
|
end: this.scanner.index
|
|
162214
162214
|
};
|
|
162215
162215
|
}
|
|
162216
|
-
if (
|
|
162216
|
+
if (cp10 === 34 || cp10 === 39) {
|
|
162217
162217
|
var start2 = this.scanner.index;
|
|
162218
162218
|
var quote2 = this.scanner.source[this.scanner.index++];
|
|
162219
162219
|
var str3 = "";
|
|
@@ -162236,7 +162236,7 @@ var require_esprima = __commonJS({
|
|
|
162236
162236
|
end: this.scanner.index
|
|
162237
162237
|
};
|
|
162238
162238
|
}
|
|
162239
|
-
if (
|
|
162239
|
+
if (cp10 === 46) {
|
|
162240
162240
|
var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
|
|
162241
162241
|
var n23 = this.scanner.source.charCodeAt(this.scanner.index + 2);
|
|
162242
162242
|
var value = n1 === 46 && n23 === 46 ? "..." : ".";
|
|
@@ -162251,7 +162251,7 @@ var require_esprima = __commonJS({
|
|
|
162251
162251
|
end: this.scanner.index
|
|
162252
162252
|
};
|
|
162253
162253
|
}
|
|
162254
|
-
if (
|
|
162254
|
+
if (cp10 === 96) {
|
|
162255
162255
|
return {
|
|
162256
162256
|
type: 10,
|
|
162257
162257
|
value: "",
|
|
@@ -162261,7 +162261,7 @@ var require_esprima = __commonJS({
|
|
|
162261
162261
|
end: this.scanner.index
|
|
162262
162262
|
};
|
|
162263
162263
|
}
|
|
162264
|
-
if (character_1.Character.isIdentifierStart(
|
|
162264
|
+
if (character_1.Character.isIdentifierStart(cp10) && cp10 !== 92) {
|
|
162265
162265
|
var start2 = this.scanner.index;
|
|
162266
162266
|
++this.scanner.index;
|
|
162267
162267
|
while (!this.scanner.eof()) {
|
|
@@ -162591,33 +162591,33 @@ var require_esprima = __commonJS({
|
|
|
162591
162591
|
};
|
|
162592
162592
|
exports3.Character = {
|
|
162593
162593
|
/* tslint:disable:no-bitwise */
|
|
162594
|
-
fromCodePoint: function(
|
|
162595
|
-
return
|
|
162594
|
+
fromCodePoint: function(cp10) {
|
|
162595
|
+
return cp10 < 65536 ? String.fromCharCode(cp10) : String.fromCharCode(55296 + (cp10 - 65536 >> 10)) + String.fromCharCode(56320 + (cp10 - 65536 & 1023));
|
|
162596
162596
|
},
|
|
162597
162597
|
// https://tc39.github.io/ecma262/#sec-white-space
|
|
162598
|
-
isWhiteSpace: function(
|
|
162599
|
-
return
|
|
162598
|
+
isWhiteSpace: function(cp10) {
|
|
162599
|
+
return cp10 === 32 || cp10 === 9 || cp10 === 11 || cp10 === 12 || cp10 === 160 || cp10 >= 5760 && [5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(cp10) >= 0;
|
|
162600
162600
|
},
|
|
162601
162601
|
// https://tc39.github.io/ecma262/#sec-line-terminators
|
|
162602
|
-
isLineTerminator: function(
|
|
162603
|
-
return
|
|
162602
|
+
isLineTerminator: function(cp10) {
|
|
162603
|
+
return cp10 === 10 || cp10 === 13 || cp10 === 8232 || cp10 === 8233;
|
|
162604
162604
|
},
|
|
162605
162605
|
// https://tc39.github.io/ecma262/#sec-names-and-keywords
|
|
162606
|
-
isIdentifierStart: function(
|
|
162607
|
-
return
|
|
162606
|
+
isIdentifierStart: function(cp10) {
|
|
162607
|
+
return cp10 === 36 || cp10 === 95 || cp10 >= 65 && cp10 <= 90 || cp10 >= 97 && cp10 <= 122 || cp10 === 92 || cp10 >= 128 && Regex.NonAsciiIdentifierStart.test(exports3.Character.fromCodePoint(cp10));
|
|
162608
162608
|
},
|
|
162609
|
-
isIdentifierPart: function(
|
|
162610
|
-
return
|
|
162609
|
+
isIdentifierPart: function(cp10) {
|
|
162610
|
+
return cp10 === 36 || cp10 === 95 || cp10 >= 65 && cp10 <= 90 || cp10 >= 97 && cp10 <= 122 || cp10 >= 48 && cp10 <= 57 || cp10 === 92 || cp10 >= 128 && Regex.NonAsciiIdentifierPart.test(exports3.Character.fromCodePoint(cp10));
|
|
162611
162611
|
},
|
|
162612
162612
|
// https://tc39.github.io/ecma262/#sec-literals-numeric-literals
|
|
162613
|
-
isDecimalDigit: function(
|
|
162614
|
-
return
|
|
162613
|
+
isDecimalDigit: function(cp10) {
|
|
162614
|
+
return cp10 >= 48 && cp10 <= 57;
|
|
162615
162615
|
},
|
|
162616
|
-
isHexDigit: function(
|
|
162617
|
-
return
|
|
162616
|
+
isHexDigit: function(cp10) {
|
|
162617
|
+
return cp10 >= 48 && cp10 <= 57 || cp10 >= 65 && cp10 <= 70 || cp10 >= 97 && cp10 <= 102;
|
|
162618
162618
|
},
|
|
162619
|
-
isOctalDigit: function(
|
|
162620
|
-
return
|
|
162619
|
+
isOctalDigit: function(cp10) {
|
|
162620
|
+
return cp10 >= 48 && cp10 <= 55;
|
|
162621
162621
|
}
|
|
162622
162622
|
};
|
|
162623
162623
|
},
|
|
@@ -166691,15 +166691,15 @@ var require_esprima = __commonJS({
|
|
|
166691
166691
|
}
|
|
166692
166692
|
};
|
|
166693
166693
|
Scanner2.prototype.codePointAt = function(i11) {
|
|
166694
|
-
var
|
|
166695
|
-
if (
|
|
166694
|
+
var cp10 = this.source.charCodeAt(i11);
|
|
166695
|
+
if (cp10 >= 55296 && cp10 <= 56319) {
|
|
166696
166696
|
var second = this.source.charCodeAt(i11 + 1);
|
|
166697
166697
|
if (second >= 56320 && second <= 57343) {
|
|
166698
|
-
var first3 =
|
|
166699
|
-
|
|
166698
|
+
var first3 = cp10;
|
|
166699
|
+
cp10 = (first3 - 55296) * 1024 + second - 56320 + 65536;
|
|
166700
166700
|
}
|
|
166701
166701
|
}
|
|
166702
|
-
return
|
|
166702
|
+
return cp10;
|
|
166703
166703
|
};
|
|
166704
166704
|
Scanner2.prototype.scanHexEscape = function(prefix2) {
|
|
166705
166705
|
var len = prefix2 === "u" ? 4 : 2;
|
|
@@ -166751,11 +166751,11 @@ var require_esprima = __commonJS({
|
|
|
166751
166751
|
return this.source.slice(start2, this.index);
|
|
166752
166752
|
};
|
|
166753
166753
|
Scanner2.prototype.getComplexIdentifier = function() {
|
|
166754
|
-
var
|
|
166755
|
-
var id2 = character_1.Character.fromCodePoint(
|
|
166754
|
+
var cp10 = this.codePointAt(this.index);
|
|
166755
|
+
var id2 = character_1.Character.fromCodePoint(cp10);
|
|
166756
166756
|
this.index += id2.length;
|
|
166757
166757
|
var ch2;
|
|
166758
|
-
if (
|
|
166758
|
+
if (cp10 === 92) {
|
|
166759
166759
|
if (this.source.charCodeAt(this.index) !== 117) {
|
|
166760
166760
|
this.throwUnexpectedToken();
|
|
166761
166761
|
}
|
|
@@ -166772,14 +166772,14 @@ var require_esprima = __commonJS({
|
|
|
166772
166772
|
id2 = ch2;
|
|
166773
166773
|
}
|
|
166774
166774
|
while (!this.eof()) {
|
|
166775
|
-
|
|
166776
|
-
if (!character_1.Character.isIdentifierPart(
|
|
166775
|
+
cp10 = this.codePointAt(this.index);
|
|
166776
|
+
if (!character_1.Character.isIdentifierPart(cp10)) {
|
|
166777
166777
|
break;
|
|
166778
166778
|
}
|
|
166779
|
-
ch2 = character_1.Character.fromCodePoint(
|
|
166779
|
+
ch2 = character_1.Character.fromCodePoint(cp10);
|
|
166780
166780
|
id2 += ch2;
|
|
166781
166781
|
this.index += ch2.length;
|
|
166782
|
-
if (
|
|
166782
|
+
if (cp10 === 92) {
|
|
166783
166783
|
id2 = id2.substr(0, id2.length - 1);
|
|
166784
166784
|
if (this.source.charCodeAt(this.index) !== 117) {
|
|
166785
166785
|
this.throwUnexpectedToken();
|
|
@@ -167405,29 +167405,29 @@ var require_esprima = __commonJS({
|
|
|
167405
167405
|
end: this.index
|
|
167406
167406
|
};
|
|
167407
167407
|
}
|
|
167408
|
-
var
|
|
167409
|
-
if (character_1.Character.isIdentifierStart(
|
|
167408
|
+
var cp10 = this.source.charCodeAt(this.index);
|
|
167409
|
+
if (character_1.Character.isIdentifierStart(cp10)) {
|
|
167410
167410
|
return this.scanIdentifier();
|
|
167411
167411
|
}
|
|
167412
|
-
if (
|
|
167412
|
+
if (cp10 === 40 || cp10 === 41 || cp10 === 59) {
|
|
167413
167413
|
return this.scanPunctuator();
|
|
167414
167414
|
}
|
|
167415
|
-
if (
|
|
167415
|
+
if (cp10 === 39 || cp10 === 34) {
|
|
167416
167416
|
return this.scanStringLiteral();
|
|
167417
167417
|
}
|
|
167418
|
-
if (
|
|
167418
|
+
if (cp10 === 46) {
|
|
167419
167419
|
if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
|
|
167420
167420
|
return this.scanNumericLiteral();
|
|
167421
167421
|
}
|
|
167422
167422
|
return this.scanPunctuator();
|
|
167423
167423
|
}
|
|
167424
|
-
if (character_1.Character.isDecimalDigit(
|
|
167424
|
+
if (character_1.Character.isDecimalDigit(cp10)) {
|
|
167425
167425
|
return this.scanNumericLiteral();
|
|
167426
167426
|
}
|
|
167427
|
-
if (
|
|
167427
|
+
if (cp10 === 96 || cp10 === 125 && this.curlyStack[this.curlyStack.length - 1] === "${") {
|
|
167428
167428
|
return this.scanTemplate();
|
|
167429
167429
|
}
|
|
167430
|
-
if (
|
|
167430
|
+
if (cp10 >= 55296 && cp10 < 57343) {
|
|
167431
167431
|
if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
|
|
167432
167432
|
return this.scanIdentifier();
|
|
167433
167433
|
}
|
|
@@ -176369,19 +176369,19 @@ var require_identifier = __commonJS({
|
|
|
176369
176369
|
function isIdentifierName(name2) {
|
|
176370
176370
|
let isFirst = true;
|
|
176371
176371
|
for (let i11 = 0; i11 < name2.length; i11++) {
|
|
176372
|
-
let
|
|
176373
|
-
if ((
|
|
176372
|
+
let cp10 = name2.charCodeAt(i11);
|
|
176373
|
+
if ((cp10 & 64512) === 55296 && i11 + 1 < name2.length) {
|
|
176374
176374
|
const trail2 = name2.charCodeAt(++i11);
|
|
176375
176375
|
if ((trail2 & 64512) === 56320) {
|
|
176376
|
-
|
|
176376
|
+
cp10 = 65536 + ((cp10 & 1023) << 10) + (trail2 & 1023);
|
|
176377
176377
|
}
|
|
176378
176378
|
}
|
|
176379
176379
|
if (isFirst) {
|
|
176380
176380
|
isFirst = false;
|
|
176381
|
-
if (!isIdentifierStart2(
|
|
176381
|
+
if (!isIdentifierStart2(cp10)) {
|
|
176382
176382
|
return false;
|
|
176383
176383
|
}
|
|
176384
|
-
} else if (!isIdentifierChar2(
|
|
176384
|
+
} else if (!isIdentifierChar2(cp10)) {
|
|
176385
176385
|
return false;
|
|
176386
176386
|
}
|
|
176387
176387
|
}
|
|
@@ -225417,19 +225417,19 @@ var require_enoent = __commonJS({
|
|
|
225417
225417
|
spawnargs: original.args
|
|
225418
225418
|
});
|
|
225419
225419
|
}
|
|
225420
|
-
function hookChildProcess(
|
|
225420
|
+
function hookChildProcess(cp10, parsed) {
|
|
225421
225421
|
if (!isWin) {
|
|
225422
225422
|
return;
|
|
225423
225423
|
}
|
|
225424
|
-
const originalEmit =
|
|
225425
|
-
|
|
225424
|
+
const originalEmit = cp10.emit;
|
|
225425
|
+
cp10.emit = function(name2, arg1) {
|
|
225426
225426
|
if (name2 === "exit") {
|
|
225427
225427
|
const err = verifyENOENT(arg1, parsed);
|
|
225428
225428
|
if (err) {
|
|
225429
|
-
return originalEmit.call(
|
|
225429
|
+
return originalEmit.call(cp10, "error", err);
|
|
225430
225430
|
}
|
|
225431
225431
|
}
|
|
225432
|
-
return originalEmit.apply(
|
|
225432
|
+
return originalEmit.apply(cp10, arguments);
|
|
225433
225433
|
};
|
|
225434
225434
|
}
|
|
225435
225435
|
function verifyENOENT(status, parsed) {
|
|
@@ -225457,18 +225457,18 @@ var require_enoent = __commonJS({
|
|
|
225457
225457
|
var require_cross_spawn = __commonJS({
|
|
225458
225458
|
"../../../node_modules/.pnpm/cross-spawn@7.0.5/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
225459
225459
|
"use strict";
|
|
225460
|
-
var
|
|
225460
|
+
var cp10 = require("child_process");
|
|
225461
225461
|
var parse12 = require_parse5();
|
|
225462
225462
|
var enoent = require_enoent();
|
|
225463
225463
|
function spawn5(command2, args, options2) {
|
|
225464
225464
|
const parsed = parse12(command2, args, options2);
|
|
225465
|
-
const spawned =
|
|
225465
|
+
const spawned = cp10.spawn(parsed.command, parsed.args, parsed.options);
|
|
225466
225466
|
enoent.hookChildProcess(spawned, parsed);
|
|
225467
225467
|
return spawned;
|
|
225468
225468
|
}
|
|
225469
225469
|
function spawnSync5(command2, args, options2) {
|
|
225470
225470
|
const parsed = parse12(command2, args, options2);
|
|
225471
|
-
const result =
|
|
225471
|
+
const result = cp10.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
225472
225472
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
225473
225473
|
return result;
|
|
225474
225474
|
}
|
|
@@ -235165,12 +235165,12 @@ var require_send = __commonJS({
|
|
|
235165
235165
|
path70 = resolve10(path70);
|
|
235166
235166
|
}
|
|
235167
235167
|
if (containsDotFile(parts)) {
|
|
235168
|
-
var
|
|
235169
|
-
if (
|
|
235170
|
-
|
|
235168
|
+
var access4 = this._dotfiles;
|
|
235169
|
+
if (access4 === void 0) {
|
|
235170
|
+
access4 = parts[parts.length - 1][0] === "." ? this._hidden ? "allow" : "ignore" : "allow";
|
|
235171
235171
|
}
|
|
235172
|
-
debug7('%s dotfile "%s"',
|
|
235173
|
-
switch (
|
|
235172
|
+
debug7('%s dotfile "%s"', access4, path70);
|
|
235173
|
+
switch (access4) {
|
|
235174
235174
|
case "allow":
|
|
235175
235175
|
break;
|
|
235176
235176
|
case "deny":
|
|
@@ -1283612,8 +1283612,8 @@ var require_formdata_parser = __commonJS({
|
|
|
1283612
1283612
|
return false;
|
|
1283613
1283613
|
}
|
|
1283614
1283614
|
for (let i11 = 0; i11 < length; ++i11) {
|
|
1283615
|
-
const
|
|
1283616
|
-
if (!(
|
|
1283615
|
+
const cp10 = boundary.charCodeAt(i11);
|
|
1283616
|
+
if (!(cp10 >= 48 && cp10 <= 57 || cp10 >= 65 && cp10 <= 90 || cp10 >= 97 && cp10 <= 122 || cp10 === 39 || cp10 === 45 || cp10 === 95)) {
|
|
1283617
1283617
|
return false;
|
|
1283618
1283618
|
}
|
|
1283619
1283619
|
}
|
|
@@ -1329010,7 +1329010,7 @@ function sortBy(arr, criteria) {
|
|
|
1329010
1329010
|
return orderBy(arr, criteria, ["asc"]);
|
|
1329011
1329011
|
}
|
|
1329012
1329012
|
|
|
1329013
|
-
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.
|
|
1329013
|
+
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
|
|
1329014
1329014
|
var import_ts_essentials = __toESM(require_dist(), 1);
|
|
1329015
1329015
|
|
|
1329016
1329016
|
// ../../../node_modules/.pnpm/es-toolkit@1.43.0/node_modules/es-toolkit/dist/object/mapValues.mjs
|
|
@@ -1329031,7 +1329031,7 @@ function words2(str3) {
|
|
|
1329031
1329031
|
return Array.from(str3.match(CASE_SPLIT_PATTERN) ?? []);
|
|
1329032
1329032
|
}
|
|
1329033
1329033
|
|
|
1329034
|
-
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.
|
|
1329034
|
+
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
|
|
1329035
1329035
|
var import_qs = __toESM(require_lib2(), 1);
|
|
1329036
1329036
|
var import_ts_essentials2 = __toESM(require_dist(), 1);
|
|
1329037
1329037
|
var import_ts_essentials3 = __toESM(require_dist(), 1);
|
|
@@ -1334772,7 +1334772,7 @@ function kebabCase2(str3) {
|
|
|
1334772
1334772
|
return words$1.map((word) => word.toLowerCase()).join("-");
|
|
1334773
1334773
|
}
|
|
1334774
1334774
|
|
|
1334775
|
-
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.
|
|
1334775
|
+
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
|
|
1334776
1334776
|
var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
|
|
1334777
1334777
|
var import_ts_essentials4 = __toESM(require_dist(), 1);
|
|
1334778
1334778
|
var import_url_join2 = __toESM(require_url_join(), 1);
|
|
@@ -1334791,7 +1334791,7 @@ function once(func) {
|
|
|
1334791
1334791
|
};
|
|
1334792
1334792
|
}
|
|
1334793
1334793
|
|
|
1334794
|
-
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.
|
|
1334794
|
+
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
|
|
1334795
1334795
|
var import_ts_essentials6 = __toESM(require_dist(), 1);
|
|
1334796
1334796
|
var import_ts_essentials7 = __toESM(require_dist(), 1);
|
|
1334797
1334797
|
var import_url_join3 = __toESM(require_url_join(), 1);
|
|
@@ -1335021,7 +1335021,7 @@ var esm_default2 = typeof structuredClone === "function" ? (
|
|
|
1335021
1335021
|
(any8, options2) => options2 && ("json" in options2 || "lossy" in options2) ? deserialize(serialize(any8, options2)) : structuredClone(any8)
|
|
1335022
1335022
|
) : (any8, options2) => deserialize(serialize(any8, options2));
|
|
1335023
1335023
|
|
|
1335024
|
-
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.
|
|
1335024
|
+
// ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
|
|
1335025
1335025
|
var import_ts_essentials12 = __toESM(require_dist(), 1);
|
|
1335026
1335026
|
var __create2 = Object.create;
|
|
1335027
1335027
|
var __defProp2 = Object.defineProperty;
|
|
@@ -1336588,7 +1336588,7 @@ var ApiTypeIdVisitor = class _ApiTypeIdVisitor {
|
|
|
1336588
1336588
|
_ApiTypeIdVisitor.visitTypeShape(header.valueShape, visit3);
|
|
1336589
1336589
|
});
|
|
1336590
1336590
|
if (webhook.payloads?.[0] != null) {
|
|
1336591
|
-
_ApiTypeIdVisitor.
|
|
1336591
|
+
_ApiTypeIdVisitor.visitWebhookPayloadShape(webhook.payloads[0].shape, visit3);
|
|
1336592
1336592
|
}
|
|
1336593
1336593
|
webhook.responses?.forEach((response) => {
|
|
1336594
1336594
|
if (response.body != null) {
|
|
@@ -1336596,6 +1336596,13 @@ var ApiTypeIdVisitor = class _ApiTypeIdVisitor {
|
|
|
1336596
1336596
|
}
|
|
1336597
1336597
|
});
|
|
1336598
1336598
|
}
|
|
1336599
|
+
static visitWebhookPayloadShape(payloadShape, visit3) {
|
|
1336600
|
+
return visitDiscriminatedUnion_default(payloadShape)._visit({
|
|
1336601
|
+
object: (value) => _ApiTypeIdVisitor.visitObjectType(value, visit3),
|
|
1336602
|
+
alias: (value) => _ApiTypeIdVisitor.visitTypeReference(value.value, visit3),
|
|
1336603
|
+
formData: (value) => _ApiTypeIdVisitor.visitFormDataRequest(value, visit3)
|
|
1336604
|
+
});
|
|
1336605
|
+
}
|
|
1336599
1336606
|
static visitHttpRequestBodyShape(bodyShape, visit3) {
|
|
1336600
1336607
|
return visitDiscriminatedUnion_default(bodyShape)._visit({
|
|
1336601
1336608
|
object: (value) => _ApiTypeIdVisitor.visitObjectType(value, visit3),
|
|
@@ -1338164,10 +1338171,30 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
|
|
|
1338164
1338171
|
})
|
|
1338165
1338172
|
});
|
|
1338166
1338173
|
};
|
|
1338174
|
+
migrateWebhookPayloadShape = (shape) => {
|
|
1338175
|
+
return visitDiscriminatedUnion_default(shape)._visit({
|
|
1338176
|
+
object: (obj) => ({
|
|
1338177
|
+
type: "object",
|
|
1338178
|
+
extends: obj.extends,
|
|
1338179
|
+
properties: this.migrateObjectProperties(obj.properties),
|
|
1338180
|
+
extraProperties: void 0
|
|
1338181
|
+
}),
|
|
1338182
|
+
reference: (ref2) => ({
|
|
1338183
|
+
type: "alias",
|
|
1338184
|
+
value: this.migrateTypeReference(ref2.value)
|
|
1338185
|
+
}),
|
|
1338186
|
+
formData: (formData) => ({
|
|
1338187
|
+
type: "formData",
|
|
1338188
|
+
description: formData.description,
|
|
1338189
|
+
availability: formData.availability,
|
|
1338190
|
+
fields: this.migrateFormDataProperties(formData.properties)
|
|
1338191
|
+
})
|
|
1338192
|
+
});
|
|
1338193
|
+
};
|
|
1338167
1338194
|
migrateWebhookPayload = (payload) => {
|
|
1338168
1338195
|
return {
|
|
1338169
1338196
|
description: payload.description,
|
|
1338170
|
-
shape: this.
|
|
1338197
|
+
shape: this.migrateWebhookPayloadShape(payload.type)
|
|
1338171
1338198
|
};
|
|
1338172
1338199
|
};
|
|
1338173
1338200
|
migrateChannelExamples = (examples, messages2) => {
|
|
@@ -1386178,6 +1386205,7 @@ var Transformer = class _Transformer {
|
|
|
1386178
1386205
|
ExampleWebSocketSession: visitor.ExampleWebSocketSession ?? identity_default2,
|
|
1386179
1386206
|
TypeDefinition: visitor.TypeDefinition ?? identity_default2,
|
|
1386180
1386207
|
TypeShape: visitor.TypeShape ?? identity_default2,
|
|
1386208
|
+
WebhookPayloadShape: visitor.WebhookPayloadShape ?? identity_default2,
|
|
1386181
1386209
|
ObjectType: visitor.ObjectType ?? identity_default2,
|
|
1386182
1386210
|
ObjectProperty: visitor.ObjectProperty ?? identity_default2,
|
|
1386183
1386211
|
EnumValue: visitor.EnumValue ?? identity_default2,
|
|
@@ -1386241,6 +1386269,7 @@ var Transformer = class _Transformer {
|
|
|
1386241
1386269
|
ExampleWebSocketSession: visit3,
|
|
1386242
1386270
|
TypeDefinition: visit3,
|
|
1386243
1386271
|
TypeShape: visit3,
|
|
1386272
|
+
WebhookPayloadShape: visit3,
|
|
1386244
1386273
|
ObjectType: visit3,
|
|
1386245
1386274
|
ObjectProperty: visit3,
|
|
1386246
1386275
|
EnumValue: visit3,
|
|
@@ -1386325,6 +1386354,7 @@ var Transformer = class _Transformer {
|
|
|
1386325
1386354
|
WebSocketMessage: (message, key) => visitor.WebSocketMessage(this.webSocketMessage(message, key), key),
|
|
1386326
1386355
|
TypeDefinition: (type8, key) => visitor.TypeDefinition(this.typeDefinition(type8, key), key),
|
|
1386327
1386356
|
TypeShape: (shape, key) => visitor.TypeShape(this.typeShape(shape, key), key),
|
|
1386357
|
+
WebhookPayloadShape: (shape, key) => visitor.WebhookPayloadShape(this.webhookPayloadShape(shape, key), key),
|
|
1386328
1386358
|
ObjectType: (type8, key) => visitor.ObjectType(this.objectType(type8, key), key),
|
|
1386329
1386359
|
DiscriminatedUnionVariant: (variant, key) => visitor.DiscriminatedUnionVariant(this.objectType(variant, key), key),
|
|
1386330
1386360
|
FormDataRequest: (request6, key) => visitor.FormDataRequest(this.formDataRequest(request6, key), key),
|
|
@@ -1386471,9 +1386501,22 @@ var Transformer = class _Transformer {
|
|
|
1386471
1386501
|
};
|
|
1386472
1386502
|
};
|
|
1386473
1386503
|
webhookPayload = (payload, parentKey) => {
|
|
1386474
|
-
const shape = this.visitor.
|
|
1386504
|
+
const shape = this.visitor.WebhookPayloadShape(payload.shape, `${parentKey}/shape`);
|
|
1386475
1386505
|
return { ...payload, shape };
|
|
1386476
1386506
|
};
|
|
1386507
|
+
webhookPayloadShape = (shape, parentKey) => {
|
|
1386508
|
+
return visitDiscriminatedUnion_default(shape)._visit({
|
|
1386509
|
+
object: (value) => ({
|
|
1386510
|
+
...value,
|
|
1386511
|
+
...this.visitor.ObjectType(value, `${parentKey}/object`)
|
|
1386512
|
+
}),
|
|
1386513
|
+
alias: identity_default2,
|
|
1386514
|
+
formData: (value) => ({
|
|
1386515
|
+
...value,
|
|
1386516
|
+
...this.visitor.FormDataRequest(value, `${parentKey}/formData`)
|
|
1386517
|
+
})
|
|
1386518
|
+
});
|
|
1386519
|
+
};
|
|
1386477
1386520
|
webSocketChannel = (channel, parentKey) => {
|
|
1386478
1386521
|
const pathParameters = channel.pathParameters?.map((param) => ({
|
|
1386479
1386522
|
...this.visitor.ObjectProperty(param, `${parentKey}/path/${param.key}`),
|
|
@@ -1395588,10 +1395631,41 @@ function generateWebhookPayloadExample(shape, resolveTypeById) {
|
|
|
1395588
1395631
|
return generateExampleObject(shape, resolveTypeById, false, /* @__PURE__ */ new Set(), 0);
|
|
1395589
1395632
|
case "reference":
|
|
1395590
1395633
|
return generateExampleFromTypeReference(shape.value, resolveTypeById, false, /* @__PURE__ */ new Set(), 0);
|
|
1395634
|
+
case "formData":
|
|
1395635
|
+
return generateFormDataWebhookPayloadExample(shape, resolveTypeById);
|
|
1395591
1395636
|
default:
|
|
1395592
1395637
|
assertNever_default(shape);
|
|
1395593
1395638
|
}
|
|
1395594
1395639
|
}
|
|
1395640
|
+
function generateFormDataWebhookPayloadExample(formDataRequest, resolveTypeById) {
|
|
1395641
|
+
const example = {};
|
|
1395642
|
+
formDataRequest.properties.forEach((property10) => {
|
|
1395643
|
+
switch (property10.type) {
|
|
1395644
|
+
case "file": {
|
|
1395645
|
+
if (property10.value.isOptional) {
|
|
1395646
|
+
break;
|
|
1395647
|
+
}
|
|
1395648
|
+
if (property10.value.type === "fileArray") {
|
|
1395649
|
+
example[property10.value.key] = ["<filename1>", "<filename2>"];
|
|
1395650
|
+
} else {
|
|
1395651
|
+
example[property10.value.key] = "<filename1>";
|
|
1395652
|
+
}
|
|
1395653
|
+
break;
|
|
1395654
|
+
}
|
|
1395655
|
+
case "bodyProperty": {
|
|
1395656
|
+
example[property10.key] = generateExampleFromTypeReference(
|
|
1395657
|
+
property10.valueType,
|
|
1395658
|
+
resolveTypeById,
|
|
1395659
|
+
false,
|
|
1395660
|
+
/* @__PURE__ */ new Set(),
|
|
1395661
|
+
0
|
|
1395662
|
+
);
|
|
1395663
|
+
break;
|
|
1395664
|
+
}
|
|
1395665
|
+
}
|
|
1395666
|
+
});
|
|
1395667
|
+
return example;
|
|
1395668
|
+
}
|
|
1395595
1395669
|
function generateHttpRequestBodyExample(type8, resolveTypeById) {
|
|
1395596
1395670
|
switch (type8.type) {
|
|
1395597
1395671
|
case "object": {
|
|
@@ -1398279,7 +1398353,14 @@ var ApiTypeIdVisitor2 = class _ApiTypeIdVisitor2 {
|
|
|
1398279
1398353
|
webhook.headers.forEach((header) => {
|
|
1398280
1398354
|
_ApiTypeIdVisitor2.visitTypeReference(header.type, visit3);
|
|
1398281
1398355
|
});
|
|
1398282
|
-
_ApiTypeIdVisitor2.
|
|
1398356
|
+
_ApiTypeIdVisitor2.visitWebhookPayloadShape(webhook.payload.type, visit3);
|
|
1398357
|
+
}
|
|
1398358
|
+
static visitWebhookPayloadShape(payloadShape, visit3) {
|
|
1398359
|
+
return visitDiscriminatedUnion_default(payloadShape)._visit({
|
|
1398360
|
+
object: (value) => _ApiTypeIdVisitor2.visitObjectType(value, visit3),
|
|
1398361
|
+
reference: (value) => _ApiTypeIdVisitor2.visitTypeReference(value.value, visit3),
|
|
1398362
|
+
formData: (value) => _ApiTypeIdVisitor2.visitFormDataRequest(value, visit3)
|
|
1398363
|
+
});
|
|
1398283
1398364
|
}
|
|
1398284
1398365
|
static visitHttpRequestBodyShape(bodyShape, visit3) {
|
|
1398285
1398366
|
return visitDiscriminatedUnion_default(bodyShape)._visit({
|
|
@@ -1420006,7 +1420087,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1420006
1420087
|
properties: {
|
|
1420007
1420088
|
...event,
|
|
1420008
1420089
|
...event.properties,
|
|
1420009
|
-
version: "3.44.
|
|
1420090
|
+
version: "3.44.1-2-g8d6db0b72a",
|
|
1420010
1420091
|
usingAccessToken: true
|
|
1420011
1420092
|
}
|
|
1420012
1420093
|
});
|
|
@@ -1420105,7 +1420186,7 @@ var UserPosthogManager = class {
|
|
|
1420105
1420186
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1420106
1420187
|
event: "CLI",
|
|
1420107
1420188
|
properties: {
|
|
1420108
|
-
version: "3.44.
|
|
1420189
|
+
version: "3.44.1-2-g8d6db0b72a",
|
|
1420109
1420190
|
...event,
|
|
1420110
1420191
|
...event.properties,
|
|
1420111
1420192
|
usingAccessToken: false,
|
|
@@ -1449437,20 +1449518,20 @@ var SEQUENCES = {
|
|
|
1449437
1449518
|
PUBLIC: "public",
|
|
1449438
1449519
|
SYSTEM: "system"
|
|
1449439
1449520
|
};
|
|
1449440
|
-
function isSurrogate(
|
|
1449441
|
-
return
|
|
1449521
|
+
function isSurrogate(cp10) {
|
|
1449522
|
+
return cp10 >= 55296 && cp10 <= 57343;
|
|
1449442
1449523
|
}
|
|
1449443
|
-
function isSurrogatePair(
|
|
1449444
|
-
return
|
|
1449524
|
+
function isSurrogatePair(cp10) {
|
|
1449525
|
+
return cp10 >= 56320 && cp10 <= 57343;
|
|
1449445
1449526
|
}
|
|
1449446
1449527
|
function getSurrogatePairCodePoint(cp1, cp22) {
|
|
1449447
1449528
|
return (cp1 - 55296) * 1024 + 9216 + cp22;
|
|
1449448
1449529
|
}
|
|
1449449
|
-
function isControlCodePoint(
|
|
1449450
|
-
return
|
|
1449530
|
+
function isControlCodePoint(cp10) {
|
|
1449531
|
+
return cp10 !== 32 && cp10 !== 10 && cp10 !== 13 && cp10 !== 9 && cp10 !== 12 && cp10 >= 1 && cp10 <= 31 || cp10 >= 127 && cp10 <= 159;
|
|
1449451
1449532
|
}
|
|
1449452
|
-
function isUndefinedCodePoint(
|
|
1449453
|
-
return
|
|
1449533
|
+
function isUndefinedCodePoint(cp10) {
|
|
1449534
|
+
return cp10 >= 64976 && cp10 <= 65007 || UNDEFINED_CODE_POINTS.has(cp10);
|
|
1449454
1449535
|
}
|
|
1449455
1449536
|
|
|
1449456
1449537
|
// ../../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js
|
|
@@ -1449568,20 +1449649,20 @@ var Preprocessor = class {
|
|
|
1449568
1449649
|
this.gapStack.push(this.lastGapPos);
|
|
1449569
1449650
|
this.lastGapPos = this.pos;
|
|
1449570
1449651
|
}
|
|
1449571
|
-
_processSurrogate(
|
|
1449652
|
+
_processSurrogate(cp10) {
|
|
1449572
1449653
|
if (this.pos !== this.html.length - 1) {
|
|
1449573
1449654
|
const nextCp = this.html.charCodeAt(this.pos + 1);
|
|
1449574
1449655
|
if (isSurrogatePair(nextCp)) {
|
|
1449575
1449656
|
this.pos++;
|
|
1449576
1449657
|
this._addGap();
|
|
1449577
|
-
return getSurrogatePairCodePoint(
|
|
1449658
|
+
return getSurrogatePairCodePoint(cp10, nextCp);
|
|
1449578
1449659
|
}
|
|
1449579
1449660
|
} else if (!this.lastChunkWritten) {
|
|
1449580
1449661
|
this.endOfChunkHit = true;
|
|
1449581
1449662
|
return CODE_POINTS.EOF;
|
|
1449582
1449663
|
}
|
|
1449583
1449664
|
this._err(ERR.surrogateInInputStream);
|
|
1449584
|
-
return
|
|
1449665
|
+
return cp10;
|
|
1449585
1449666
|
}
|
|
1449586
1449667
|
willDropParsedChunk() {
|
|
1449587
1449668
|
return this.pos > this.bufferWaterline;
|
|
@@ -1449618,8 +1449699,8 @@ var Preprocessor = class {
|
|
|
1449618
1449699
|
return this.html.startsWith(pattern, this.pos);
|
|
1449619
1449700
|
}
|
|
1449620
1449701
|
for (let i11 = 0; i11 < pattern.length; i11++) {
|
|
1449621
|
-
const
|
|
1449622
|
-
if (
|
|
1449702
|
+
const cp10 = this.html.charCodeAt(this.pos + i11) | 32;
|
|
1449703
|
+
if (cp10 !== pattern.charCodeAt(i11)) {
|
|
1449623
1449704
|
return false;
|
|
1449624
1449705
|
}
|
|
1449625
1449706
|
}
|
|
@@ -1449645,13 +1449726,13 @@ var Preprocessor = class {
|
|
|
1449645
1449726
|
this.endOfChunkHit = !this.lastChunkWritten;
|
|
1449646
1449727
|
return CODE_POINTS.EOF;
|
|
1449647
1449728
|
}
|
|
1449648
|
-
let
|
|
1449649
|
-
if (
|
|
1449729
|
+
let cp10 = this.html.charCodeAt(this.pos);
|
|
1449730
|
+
if (cp10 === CODE_POINTS.CARRIAGE_RETURN) {
|
|
1449650
1449731
|
this.isEol = true;
|
|
1449651
1449732
|
this.skipNextNewLine = true;
|
|
1449652
1449733
|
return CODE_POINTS.LINE_FEED;
|
|
1449653
1449734
|
}
|
|
1449654
|
-
if (
|
|
1449735
|
+
if (cp10 === CODE_POINTS.LINE_FEED) {
|
|
1449655
1449736
|
this.isEol = true;
|
|
1449656
1449737
|
if (this.skipNextNewLine) {
|
|
1449657
1449738
|
this.line--;
|
|
@@ -1449661,19 +1449742,19 @@ var Preprocessor = class {
|
|
|
1449661
1449742
|
}
|
|
1449662
1449743
|
}
|
|
1449663
1449744
|
this.skipNextNewLine = false;
|
|
1449664
|
-
if (isSurrogate(
|
|
1449665
|
-
|
|
1449745
|
+
if (isSurrogate(cp10)) {
|
|
1449746
|
+
cp10 = this._processSurrogate(cp10);
|
|
1449666
1449747
|
}
|
|
1449667
|
-
const isCommonValidRange = this.handler.onParseError === null ||
|
|
1449748
|
+
const isCommonValidRange = this.handler.onParseError === null || cp10 > 31 && cp10 < 127 || cp10 === CODE_POINTS.LINE_FEED || cp10 === CODE_POINTS.CARRIAGE_RETURN || cp10 > 159 && cp10 < 64976;
|
|
1449668
1449749
|
if (!isCommonValidRange) {
|
|
1449669
|
-
this._checkForProblematicCharacters(
|
|
1449750
|
+
this._checkForProblematicCharacters(cp10);
|
|
1449670
1449751
|
}
|
|
1449671
|
-
return
|
|
1449752
|
+
return cp10;
|
|
1449672
1449753
|
}
|
|
1449673
|
-
_checkForProblematicCharacters(
|
|
1449674
|
-
if (isControlCodePoint(
|
|
1449754
|
+
_checkForProblematicCharacters(cp10) {
|
|
1449755
|
+
if (isControlCodePoint(cp10)) {
|
|
1449675
1449756
|
this._err(ERR.controlCharacterInInputStream);
|
|
1449676
|
-
} else if (isUndefinedCodePoint(
|
|
1449757
|
+
} else if (isUndefinedCodePoint(cp10)) {
|
|
1449677
1449758
|
this._err(ERR.noncharacterInInputStream);
|
|
1449678
1449759
|
}
|
|
1449679
1449760
|
}
|
|
@@ -1450701,29 +1450782,29 @@ var TokenizerMode = {
|
|
|
1450701
1450782
|
PLAINTEXT: State2.PLAINTEXT,
|
|
1450702
1450783
|
CDATA_SECTION: State2.CDATA_SECTION
|
|
1450703
1450784
|
};
|
|
1450704
|
-
function isAsciiDigit(
|
|
1450705
|
-
return
|
|
1450785
|
+
function isAsciiDigit(cp10) {
|
|
1450786
|
+
return cp10 >= CODE_POINTS.DIGIT_0 && cp10 <= CODE_POINTS.DIGIT_9;
|
|
1450706
1450787
|
}
|
|
1450707
|
-
function isAsciiUpper(
|
|
1450708
|
-
return
|
|
1450788
|
+
function isAsciiUpper(cp10) {
|
|
1450789
|
+
return cp10 >= CODE_POINTS.LATIN_CAPITAL_A && cp10 <= CODE_POINTS.LATIN_CAPITAL_Z;
|
|
1450709
1450790
|
}
|
|
1450710
|
-
function isAsciiLower(
|
|
1450711
|
-
return
|
|
1450791
|
+
function isAsciiLower(cp10) {
|
|
1450792
|
+
return cp10 >= CODE_POINTS.LATIN_SMALL_A && cp10 <= CODE_POINTS.LATIN_SMALL_Z;
|
|
1450712
1450793
|
}
|
|
1450713
|
-
function isAsciiLetter(
|
|
1450714
|
-
return isAsciiLower(
|
|
1450794
|
+
function isAsciiLetter(cp10) {
|
|
1450795
|
+
return isAsciiLower(cp10) || isAsciiUpper(cp10);
|
|
1450715
1450796
|
}
|
|
1450716
|
-
function isAsciiAlphaNumeric2(
|
|
1450717
|
-
return isAsciiLetter(
|
|
1450797
|
+
function isAsciiAlphaNumeric2(cp10) {
|
|
1450798
|
+
return isAsciiLetter(cp10) || isAsciiDigit(cp10);
|
|
1450718
1450799
|
}
|
|
1450719
|
-
function toAsciiLower(
|
|
1450720
|
-
return
|
|
1450800
|
+
function toAsciiLower(cp10) {
|
|
1450801
|
+
return cp10 + 32;
|
|
1450721
1450802
|
}
|
|
1450722
|
-
function isWhitespace2(
|
|
1450723
|
-
return
|
|
1450803
|
+
function isWhitespace2(cp10) {
|
|
1450804
|
+
return cp10 === CODE_POINTS.SPACE || cp10 === CODE_POINTS.LINE_FEED || cp10 === CODE_POINTS.TABULATION || cp10 === CODE_POINTS.FORM_FEED;
|
|
1450724
1450805
|
}
|
|
1450725
|
-
function isScriptDataDoubleEscapeSequenceEnd(
|
|
1450726
|
-
return isWhitespace2(
|
|
1450806
|
+
function isScriptDataDoubleEscapeSequenceEnd(cp10) {
|
|
1450807
|
+
return isWhitespace2(cp10) || cp10 === CODE_POINTS.SOLIDUS || cp10 === CODE_POINTS.GREATER_THAN_SIGN;
|
|
1450727
1450808
|
}
|
|
1450728
1450809
|
function getErrorForNumericCharacterReference(code5) {
|
|
1450729
1450810
|
if (code5 === CODE_POINTS.NULL) {
|
|
@@ -1450757,9 +1450838,9 @@ var Tokenizer = class {
|
|
|
1450757
1450838
|
this.currentAttr = { name: "", value: "" };
|
|
1450758
1450839
|
this.preprocessor = new Preprocessor(handler3);
|
|
1450759
1450840
|
this.currentLocation = this.getCurrentLocation(-1);
|
|
1450760
|
-
this.entityDecoder = new EntityDecoder(htmlDecodeTree, (
|
|
1450841
|
+
this.entityDecoder = new EntityDecoder(htmlDecodeTree, (cp10, consumed) => {
|
|
1450761
1450842
|
this.preprocessor.pos = this.entityStartPos + consumed - 1;
|
|
1450762
|
-
this._flushCodePointConsumedAsCharacterReference(
|
|
1450843
|
+
this._flushCodePointConsumedAsCharacterReference(cp10);
|
|
1450763
1450844
|
}, handler3.onParseError ? {
|
|
1450764
1450845
|
missingSemicolonAfterCharacterReference: () => {
|
|
1450765
1450846
|
this._err(ERR.missingSemicolonAfterCharacterReference, 1);
|
|
@@ -1450799,9 +1450880,9 @@ var Tokenizer = class {
|
|
|
1450799
1450880
|
this.inLoop = true;
|
|
1450800
1450881
|
while (this.active && !this.paused) {
|
|
1450801
1450882
|
this.consumedAfterSnapshot = 0;
|
|
1450802
|
-
const
|
|
1450883
|
+
const cp10 = this._consume();
|
|
1450803
1450884
|
if (!this._ensureHibernation()) {
|
|
1450804
|
-
this._callState(
|
|
1450885
|
+
this._callState(cp10);
|
|
1450805
1450886
|
}
|
|
1450806
1450887
|
}
|
|
1450807
1450888
|
this.inLoop = false;
|
|
@@ -1451036,9 +1451117,9 @@ var Tokenizer = class {
|
|
|
1451036
1451117
|
}
|
|
1451037
1451118
|
this._createCharacterToken(type8, ch2);
|
|
1451038
1451119
|
}
|
|
1451039
|
-
_emitCodePoint(
|
|
1451040
|
-
const type8 = isWhitespace2(
|
|
1451041
|
-
this._appendCharToCurrentCharacterToken(type8, String.fromCodePoint(
|
|
1451120
|
+
_emitCodePoint(cp10) {
|
|
1451121
|
+
const type8 = isWhitespace2(cp10) ? TokenType3.WHITESPACE_CHARACTER : cp10 === CODE_POINTS.NULL ? TokenType3.NULL_CHARACTER : TokenType3.CHARACTER;
|
|
1451122
|
+
this._appendCharToCurrentCharacterToken(type8, String.fromCodePoint(cp10));
|
|
1451042
1451123
|
}
|
|
1451043
1451124
|
//NOTE: used when we emit characters explicitly.
|
|
1451044
1451125
|
//This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
|
|
@@ -1451055,298 +1451136,298 @@ var Tokenizer = class {
|
|
|
1451055
1451136
|
_isCharacterReferenceInAttribute() {
|
|
1451056
1451137
|
return this.returnState === State2.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === State2.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === State2.ATTRIBUTE_VALUE_UNQUOTED;
|
|
1451057
1451138
|
}
|
|
1451058
|
-
_flushCodePointConsumedAsCharacterReference(
|
|
1451139
|
+
_flushCodePointConsumedAsCharacterReference(cp10) {
|
|
1451059
1451140
|
if (this._isCharacterReferenceInAttribute()) {
|
|
1451060
|
-
this.currentAttr.value += String.fromCodePoint(
|
|
1451141
|
+
this.currentAttr.value += String.fromCodePoint(cp10);
|
|
1451061
1451142
|
} else {
|
|
1451062
|
-
this._emitCodePoint(
|
|
1451143
|
+
this._emitCodePoint(cp10);
|
|
1451063
1451144
|
}
|
|
1451064
1451145
|
}
|
|
1451065
1451146
|
// Calling states this way turns out to be much faster than any other approach.
|
|
1451066
|
-
_callState(
|
|
1451147
|
+
_callState(cp10) {
|
|
1451067
1451148
|
switch (this.state) {
|
|
1451068
1451149
|
case State2.DATA: {
|
|
1451069
|
-
this._stateData(
|
|
1451150
|
+
this._stateData(cp10);
|
|
1451070
1451151
|
break;
|
|
1451071
1451152
|
}
|
|
1451072
1451153
|
case State2.RCDATA: {
|
|
1451073
|
-
this._stateRcdata(
|
|
1451154
|
+
this._stateRcdata(cp10);
|
|
1451074
1451155
|
break;
|
|
1451075
1451156
|
}
|
|
1451076
1451157
|
case State2.RAWTEXT: {
|
|
1451077
|
-
this._stateRawtext(
|
|
1451158
|
+
this._stateRawtext(cp10);
|
|
1451078
1451159
|
break;
|
|
1451079
1451160
|
}
|
|
1451080
1451161
|
case State2.SCRIPT_DATA: {
|
|
1451081
|
-
this._stateScriptData(
|
|
1451162
|
+
this._stateScriptData(cp10);
|
|
1451082
1451163
|
break;
|
|
1451083
1451164
|
}
|
|
1451084
1451165
|
case State2.PLAINTEXT: {
|
|
1451085
|
-
this._statePlaintext(
|
|
1451166
|
+
this._statePlaintext(cp10);
|
|
1451086
1451167
|
break;
|
|
1451087
1451168
|
}
|
|
1451088
1451169
|
case State2.TAG_OPEN: {
|
|
1451089
|
-
this._stateTagOpen(
|
|
1451170
|
+
this._stateTagOpen(cp10);
|
|
1451090
1451171
|
break;
|
|
1451091
1451172
|
}
|
|
1451092
1451173
|
case State2.END_TAG_OPEN: {
|
|
1451093
|
-
this._stateEndTagOpen(
|
|
1451174
|
+
this._stateEndTagOpen(cp10);
|
|
1451094
1451175
|
break;
|
|
1451095
1451176
|
}
|
|
1451096
1451177
|
case State2.TAG_NAME: {
|
|
1451097
|
-
this._stateTagName(
|
|
1451178
|
+
this._stateTagName(cp10);
|
|
1451098
1451179
|
break;
|
|
1451099
1451180
|
}
|
|
1451100
1451181
|
case State2.RCDATA_LESS_THAN_SIGN: {
|
|
1451101
|
-
this._stateRcdataLessThanSign(
|
|
1451182
|
+
this._stateRcdataLessThanSign(cp10);
|
|
1451102
1451183
|
break;
|
|
1451103
1451184
|
}
|
|
1451104
1451185
|
case State2.RCDATA_END_TAG_OPEN: {
|
|
1451105
|
-
this._stateRcdataEndTagOpen(
|
|
1451186
|
+
this._stateRcdataEndTagOpen(cp10);
|
|
1451106
1451187
|
break;
|
|
1451107
1451188
|
}
|
|
1451108
1451189
|
case State2.RCDATA_END_TAG_NAME: {
|
|
1451109
|
-
this._stateRcdataEndTagName(
|
|
1451190
|
+
this._stateRcdataEndTagName(cp10);
|
|
1451110
1451191
|
break;
|
|
1451111
1451192
|
}
|
|
1451112
1451193
|
case State2.RAWTEXT_LESS_THAN_SIGN: {
|
|
1451113
|
-
this._stateRawtextLessThanSign(
|
|
1451194
|
+
this._stateRawtextLessThanSign(cp10);
|
|
1451114
1451195
|
break;
|
|
1451115
1451196
|
}
|
|
1451116
1451197
|
case State2.RAWTEXT_END_TAG_OPEN: {
|
|
1451117
|
-
this._stateRawtextEndTagOpen(
|
|
1451198
|
+
this._stateRawtextEndTagOpen(cp10);
|
|
1451118
1451199
|
break;
|
|
1451119
1451200
|
}
|
|
1451120
1451201
|
case State2.RAWTEXT_END_TAG_NAME: {
|
|
1451121
|
-
this._stateRawtextEndTagName(
|
|
1451202
|
+
this._stateRawtextEndTagName(cp10);
|
|
1451122
1451203
|
break;
|
|
1451123
1451204
|
}
|
|
1451124
1451205
|
case State2.SCRIPT_DATA_LESS_THAN_SIGN: {
|
|
1451125
|
-
this._stateScriptDataLessThanSign(
|
|
1451206
|
+
this._stateScriptDataLessThanSign(cp10);
|
|
1451126
1451207
|
break;
|
|
1451127
1451208
|
}
|
|
1451128
1451209
|
case State2.SCRIPT_DATA_END_TAG_OPEN: {
|
|
1451129
|
-
this._stateScriptDataEndTagOpen(
|
|
1451210
|
+
this._stateScriptDataEndTagOpen(cp10);
|
|
1451130
1451211
|
break;
|
|
1451131
1451212
|
}
|
|
1451132
1451213
|
case State2.SCRIPT_DATA_END_TAG_NAME: {
|
|
1451133
|
-
this._stateScriptDataEndTagName(
|
|
1451214
|
+
this._stateScriptDataEndTagName(cp10);
|
|
1451134
1451215
|
break;
|
|
1451135
1451216
|
}
|
|
1451136
1451217
|
case State2.SCRIPT_DATA_ESCAPE_START: {
|
|
1451137
|
-
this._stateScriptDataEscapeStart(
|
|
1451218
|
+
this._stateScriptDataEscapeStart(cp10);
|
|
1451138
1451219
|
break;
|
|
1451139
1451220
|
}
|
|
1451140
1451221
|
case State2.SCRIPT_DATA_ESCAPE_START_DASH: {
|
|
1451141
|
-
this._stateScriptDataEscapeStartDash(
|
|
1451222
|
+
this._stateScriptDataEscapeStartDash(cp10);
|
|
1451142
1451223
|
break;
|
|
1451143
1451224
|
}
|
|
1451144
1451225
|
case State2.SCRIPT_DATA_ESCAPED: {
|
|
1451145
|
-
this._stateScriptDataEscaped(
|
|
1451226
|
+
this._stateScriptDataEscaped(cp10);
|
|
1451146
1451227
|
break;
|
|
1451147
1451228
|
}
|
|
1451148
1451229
|
case State2.SCRIPT_DATA_ESCAPED_DASH: {
|
|
1451149
|
-
this._stateScriptDataEscapedDash(
|
|
1451230
|
+
this._stateScriptDataEscapedDash(cp10);
|
|
1451150
1451231
|
break;
|
|
1451151
1451232
|
}
|
|
1451152
1451233
|
case State2.SCRIPT_DATA_ESCAPED_DASH_DASH: {
|
|
1451153
|
-
this._stateScriptDataEscapedDashDash(
|
|
1451234
|
+
this._stateScriptDataEscapedDashDash(cp10);
|
|
1451154
1451235
|
break;
|
|
1451155
1451236
|
}
|
|
1451156
1451237
|
case State2.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
|
|
1451157
|
-
this._stateScriptDataEscapedLessThanSign(
|
|
1451238
|
+
this._stateScriptDataEscapedLessThanSign(cp10);
|
|
1451158
1451239
|
break;
|
|
1451159
1451240
|
}
|
|
1451160
1451241
|
case State2.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {
|
|
1451161
|
-
this._stateScriptDataEscapedEndTagOpen(
|
|
1451242
|
+
this._stateScriptDataEscapedEndTagOpen(cp10);
|
|
1451162
1451243
|
break;
|
|
1451163
1451244
|
}
|
|
1451164
1451245
|
case State2.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {
|
|
1451165
|
-
this._stateScriptDataEscapedEndTagName(
|
|
1451246
|
+
this._stateScriptDataEscapedEndTagName(cp10);
|
|
1451166
1451247
|
break;
|
|
1451167
1451248
|
}
|
|
1451168
1451249
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
|
|
1451169
|
-
this._stateScriptDataDoubleEscapeStart(
|
|
1451250
|
+
this._stateScriptDataDoubleEscapeStart(cp10);
|
|
1451170
1451251
|
break;
|
|
1451171
1451252
|
}
|
|
1451172
1451253
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPED: {
|
|
1451173
|
-
this._stateScriptDataDoubleEscaped(
|
|
1451254
|
+
this._stateScriptDataDoubleEscaped(cp10);
|
|
1451174
1451255
|
break;
|
|
1451175
1451256
|
}
|
|
1451176
1451257
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
|
|
1451177
|
-
this._stateScriptDataDoubleEscapedDash(
|
|
1451258
|
+
this._stateScriptDataDoubleEscapedDash(cp10);
|
|
1451178
1451259
|
break;
|
|
1451179
1451260
|
}
|
|
1451180
1451261
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
|
|
1451181
|
-
this._stateScriptDataDoubleEscapedDashDash(
|
|
1451262
|
+
this._stateScriptDataDoubleEscapedDashDash(cp10);
|
|
1451182
1451263
|
break;
|
|
1451183
1451264
|
}
|
|
1451184
1451265
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
|
|
1451185
|
-
this._stateScriptDataDoubleEscapedLessThanSign(
|
|
1451266
|
+
this._stateScriptDataDoubleEscapedLessThanSign(cp10);
|
|
1451186
1451267
|
break;
|
|
1451187
1451268
|
}
|
|
1451188
1451269
|
case State2.SCRIPT_DATA_DOUBLE_ESCAPE_END: {
|
|
1451189
|
-
this._stateScriptDataDoubleEscapeEnd(
|
|
1451270
|
+
this._stateScriptDataDoubleEscapeEnd(cp10);
|
|
1451190
1451271
|
break;
|
|
1451191
1451272
|
}
|
|
1451192
1451273
|
case State2.BEFORE_ATTRIBUTE_NAME: {
|
|
1451193
|
-
this._stateBeforeAttributeName(
|
|
1451274
|
+
this._stateBeforeAttributeName(cp10);
|
|
1451194
1451275
|
break;
|
|
1451195
1451276
|
}
|
|
1451196
1451277
|
case State2.ATTRIBUTE_NAME: {
|
|
1451197
|
-
this._stateAttributeName(
|
|
1451278
|
+
this._stateAttributeName(cp10);
|
|
1451198
1451279
|
break;
|
|
1451199
1451280
|
}
|
|
1451200
1451281
|
case State2.AFTER_ATTRIBUTE_NAME: {
|
|
1451201
|
-
this._stateAfterAttributeName(
|
|
1451282
|
+
this._stateAfterAttributeName(cp10);
|
|
1451202
1451283
|
break;
|
|
1451203
1451284
|
}
|
|
1451204
1451285
|
case State2.BEFORE_ATTRIBUTE_VALUE: {
|
|
1451205
|
-
this._stateBeforeAttributeValue(
|
|
1451286
|
+
this._stateBeforeAttributeValue(cp10);
|
|
1451206
1451287
|
break;
|
|
1451207
1451288
|
}
|
|
1451208
1451289
|
case State2.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
|
|
1451209
|
-
this._stateAttributeValueDoubleQuoted(
|
|
1451290
|
+
this._stateAttributeValueDoubleQuoted(cp10);
|
|
1451210
1451291
|
break;
|
|
1451211
1451292
|
}
|
|
1451212
1451293
|
case State2.ATTRIBUTE_VALUE_SINGLE_QUOTED: {
|
|
1451213
|
-
this._stateAttributeValueSingleQuoted(
|
|
1451294
|
+
this._stateAttributeValueSingleQuoted(cp10);
|
|
1451214
1451295
|
break;
|
|
1451215
1451296
|
}
|
|
1451216
1451297
|
case State2.ATTRIBUTE_VALUE_UNQUOTED: {
|
|
1451217
|
-
this._stateAttributeValueUnquoted(
|
|
1451298
|
+
this._stateAttributeValueUnquoted(cp10);
|
|
1451218
1451299
|
break;
|
|
1451219
1451300
|
}
|
|
1451220
1451301
|
case State2.AFTER_ATTRIBUTE_VALUE_QUOTED: {
|
|
1451221
|
-
this._stateAfterAttributeValueQuoted(
|
|
1451302
|
+
this._stateAfterAttributeValueQuoted(cp10);
|
|
1451222
1451303
|
break;
|
|
1451223
1451304
|
}
|
|
1451224
1451305
|
case State2.SELF_CLOSING_START_TAG: {
|
|
1451225
|
-
this._stateSelfClosingStartTag(
|
|
1451306
|
+
this._stateSelfClosingStartTag(cp10);
|
|
1451226
1451307
|
break;
|
|
1451227
1451308
|
}
|
|
1451228
1451309
|
case State2.BOGUS_COMMENT: {
|
|
1451229
|
-
this._stateBogusComment(
|
|
1451310
|
+
this._stateBogusComment(cp10);
|
|
1451230
1451311
|
break;
|
|
1451231
1451312
|
}
|
|
1451232
1451313
|
case State2.MARKUP_DECLARATION_OPEN: {
|
|
1451233
|
-
this._stateMarkupDeclarationOpen(
|
|
1451314
|
+
this._stateMarkupDeclarationOpen(cp10);
|
|
1451234
1451315
|
break;
|
|
1451235
1451316
|
}
|
|
1451236
1451317
|
case State2.COMMENT_START: {
|
|
1451237
|
-
this._stateCommentStart(
|
|
1451318
|
+
this._stateCommentStart(cp10);
|
|
1451238
1451319
|
break;
|
|
1451239
1451320
|
}
|
|
1451240
1451321
|
case State2.COMMENT_START_DASH: {
|
|
1451241
|
-
this._stateCommentStartDash(
|
|
1451322
|
+
this._stateCommentStartDash(cp10);
|
|
1451242
1451323
|
break;
|
|
1451243
1451324
|
}
|
|
1451244
1451325
|
case State2.COMMENT: {
|
|
1451245
|
-
this._stateComment(
|
|
1451326
|
+
this._stateComment(cp10);
|
|
1451246
1451327
|
break;
|
|
1451247
1451328
|
}
|
|
1451248
1451329
|
case State2.COMMENT_LESS_THAN_SIGN: {
|
|
1451249
|
-
this._stateCommentLessThanSign(
|
|
1451330
|
+
this._stateCommentLessThanSign(cp10);
|
|
1451250
1451331
|
break;
|
|
1451251
1451332
|
}
|
|
1451252
1451333
|
case State2.COMMENT_LESS_THAN_SIGN_BANG: {
|
|
1451253
|
-
this._stateCommentLessThanSignBang(
|
|
1451334
|
+
this._stateCommentLessThanSignBang(cp10);
|
|
1451254
1451335
|
break;
|
|
1451255
1451336
|
}
|
|
1451256
1451337
|
case State2.COMMENT_LESS_THAN_SIGN_BANG_DASH: {
|
|
1451257
|
-
this._stateCommentLessThanSignBangDash(
|
|
1451338
|
+
this._stateCommentLessThanSignBangDash(cp10);
|
|
1451258
1451339
|
break;
|
|
1451259
1451340
|
}
|
|
1451260
1451341
|
case State2.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {
|
|
1451261
|
-
this._stateCommentLessThanSignBangDashDash(
|
|
1451342
|
+
this._stateCommentLessThanSignBangDashDash(cp10);
|
|
1451262
1451343
|
break;
|
|
1451263
1451344
|
}
|
|
1451264
1451345
|
case State2.COMMENT_END_DASH: {
|
|
1451265
|
-
this._stateCommentEndDash(
|
|
1451346
|
+
this._stateCommentEndDash(cp10);
|
|
1451266
1451347
|
break;
|
|
1451267
1451348
|
}
|
|
1451268
1451349
|
case State2.COMMENT_END: {
|
|
1451269
|
-
this._stateCommentEnd(
|
|
1451350
|
+
this._stateCommentEnd(cp10);
|
|
1451270
1451351
|
break;
|
|
1451271
1451352
|
}
|
|
1451272
1451353
|
case State2.COMMENT_END_BANG: {
|
|
1451273
|
-
this._stateCommentEndBang(
|
|
1451354
|
+
this._stateCommentEndBang(cp10);
|
|
1451274
1451355
|
break;
|
|
1451275
1451356
|
}
|
|
1451276
1451357
|
case State2.DOCTYPE: {
|
|
1451277
|
-
this._stateDoctype(
|
|
1451358
|
+
this._stateDoctype(cp10);
|
|
1451278
1451359
|
break;
|
|
1451279
1451360
|
}
|
|
1451280
1451361
|
case State2.BEFORE_DOCTYPE_NAME: {
|
|
1451281
|
-
this._stateBeforeDoctypeName(
|
|
1451362
|
+
this._stateBeforeDoctypeName(cp10);
|
|
1451282
1451363
|
break;
|
|
1451283
1451364
|
}
|
|
1451284
1451365
|
case State2.DOCTYPE_NAME: {
|
|
1451285
|
-
this._stateDoctypeName(
|
|
1451366
|
+
this._stateDoctypeName(cp10);
|
|
1451286
1451367
|
break;
|
|
1451287
1451368
|
}
|
|
1451288
1451369
|
case State2.AFTER_DOCTYPE_NAME: {
|
|
1451289
|
-
this._stateAfterDoctypeName(
|
|
1451370
|
+
this._stateAfterDoctypeName(cp10);
|
|
1451290
1451371
|
break;
|
|
1451291
1451372
|
}
|
|
1451292
1451373
|
case State2.AFTER_DOCTYPE_PUBLIC_KEYWORD: {
|
|
1451293
|
-
this._stateAfterDoctypePublicKeyword(
|
|
1451374
|
+
this._stateAfterDoctypePublicKeyword(cp10);
|
|
1451294
1451375
|
break;
|
|
1451295
1451376
|
}
|
|
1451296
1451377
|
case State2.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
|
|
1451297
|
-
this._stateBeforeDoctypePublicIdentifier(
|
|
1451378
|
+
this._stateBeforeDoctypePublicIdentifier(cp10);
|
|
1451298
1451379
|
break;
|
|
1451299
1451380
|
}
|
|
1451300
1451381
|
case State2.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
|
|
1451301
|
-
this._stateDoctypePublicIdentifierDoubleQuoted(
|
|
1451382
|
+
this._stateDoctypePublicIdentifierDoubleQuoted(cp10);
|
|
1451302
1451383
|
break;
|
|
1451303
1451384
|
}
|
|
1451304
1451385
|
case State2.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
|
|
1451305
|
-
this._stateDoctypePublicIdentifierSingleQuoted(
|
|
1451386
|
+
this._stateDoctypePublicIdentifierSingleQuoted(cp10);
|
|
1451306
1451387
|
break;
|
|
1451307
1451388
|
}
|
|
1451308
1451389
|
case State2.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
|
|
1451309
|
-
this._stateAfterDoctypePublicIdentifier(
|
|
1451390
|
+
this._stateAfterDoctypePublicIdentifier(cp10);
|
|
1451310
1451391
|
break;
|
|
1451311
1451392
|
}
|
|
1451312
1451393
|
case State2.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
|
|
1451313
|
-
this._stateBetweenDoctypePublicAndSystemIdentifiers(
|
|
1451394
|
+
this._stateBetweenDoctypePublicAndSystemIdentifiers(cp10);
|
|
1451314
1451395
|
break;
|
|
1451315
1451396
|
}
|
|
1451316
1451397
|
case State2.AFTER_DOCTYPE_SYSTEM_KEYWORD: {
|
|
1451317
|
-
this._stateAfterDoctypeSystemKeyword(
|
|
1451398
|
+
this._stateAfterDoctypeSystemKeyword(cp10);
|
|
1451318
1451399
|
break;
|
|
1451319
1451400
|
}
|
|
1451320
1451401
|
case State2.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
|
|
1451321
|
-
this._stateBeforeDoctypeSystemIdentifier(
|
|
1451402
|
+
this._stateBeforeDoctypeSystemIdentifier(cp10);
|
|
1451322
1451403
|
break;
|
|
1451323
1451404
|
}
|
|
1451324
1451405
|
case State2.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
|
|
1451325
|
-
this._stateDoctypeSystemIdentifierDoubleQuoted(
|
|
1451406
|
+
this._stateDoctypeSystemIdentifierDoubleQuoted(cp10);
|
|
1451326
1451407
|
break;
|
|
1451327
1451408
|
}
|
|
1451328
1451409
|
case State2.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
|
|
1451329
|
-
this._stateDoctypeSystemIdentifierSingleQuoted(
|
|
1451410
|
+
this._stateDoctypeSystemIdentifierSingleQuoted(cp10);
|
|
1451330
1451411
|
break;
|
|
1451331
1451412
|
}
|
|
1451332
1451413
|
case State2.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
|
|
1451333
|
-
this._stateAfterDoctypeSystemIdentifier(
|
|
1451414
|
+
this._stateAfterDoctypeSystemIdentifier(cp10);
|
|
1451334
1451415
|
break;
|
|
1451335
1451416
|
}
|
|
1451336
1451417
|
case State2.BOGUS_DOCTYPE: {
|
|
1451337
|
-
this._stateBogusDoctype(
|
|
1451418
|
+
this._stateBogusDoctype(cp10);
|
|
1451338
1451419
|
break;
|
|
1451339
1451420
|
}
|
|
1451340
1451421
|
case State2.CDATA_SECTION: {
|
|
1451341
|
-
this._stateCdataSection(
|
|
1451422
|
+
this._stateCdataSection(cp10);
|
|
1451342
1451423
|
break;
|
|
1451343
1451424
|
}
|
|
1451344
1451425
|
case State2.CDATA_SECTION_BRACKET: {
|
|
1451345
|
-
this._stateCdataSectionBracket(
|
|
1451426
|
+
this._stateCdataSectionBracket(cp10);
|
|
1451346
1451427
|
break;
|
|
1451347
1451428
|
}
|
|
1451348
1451429
|
case State2.CDATA_SECTION_END: {
|
|
1451349
|
-
this._stateCdataSectionEnd(
|
|
1451430
|
+
this._stateCdataSectionEnd(cp10);
|
|
1451350
1451431
|
break;
|
|
1451351
1451432
|
}
|
|
1451352
1451433
|
case State2.CHARACTER_REFERENCE: {
|
|
@@ -1451354,7 +1451435,7 @@ var Tokenizer = class {
|
|
|
1451354
1451435
|
break;
|
|
1451355
1451436
|
}
|
|
1451356
1451437
|
case State2.AMBIGUOUS_AMPERSAND: {
|
|
1451357
|
-
this._stateAmbiguousAmpersand(
|
|
1451438
|
+
this._stateAmbiguousAmpersand(cp10);
|
|
1451358
1451439
|
break;
|
|
1451359
1451440
|
}
|
|
1451360
1451441
|
default: {
|
|
@@ -1451365,8 +1451446,8 @@ var Tokenizer = class {
|
|
|
1451365
1451446
|
// State machine
|
|
1451366
1451447
|
// Data state
|
|
1451367
1451448
|
//------------------------------------------------------------------
|
|
1451368
|
-
_stateData(
|
|
1451369
|
-
switch (
|
|
1451449
|
+
_stateData(cp10) {
|
|
1451450
|
+
switch (cp10) {
|
|
1451370
1451451
|
case CODE_POINTS.LESS_THAN_SIGN: {
|
|
1451371
1451452
|
this.state = State2.TAG_OPEN;
|
|
1451372
1451453
|
break;
|
|
@@ -1451377,7 +1451458,7 @@ var Tokenizer = class {
|
|
|
1451377
1451458
|
}
|
|
1451378
1451459
|
case CODE_POINTS.NULL: {
|
|
1451379
1451460
|
this._err(ERR.unexpectedNullCharacter);
|
|
1451380
|
-
this._emitCodePoint(
|
|
1451461
|
+
this._emitCodePoint(cp10);
|
|
1451381
1451462
|
break;
|
|
1451382
1451463
|
}
|
|
1451383
1451464
|
case CODE_POINTS.EOF: {
|
|
@@ -1451385,14 +1451466,14 @@ var Tokenizer = class {
|
|
|
1451385
1451466
|
break;
|
|
1451386
1451467
|
}
|
|
1451387
1451468
|
default: {
|
|
1451388
|
-
this._emitCodePoint(
|
|
1451469
|
+
this._emitCodePoint(cp10);
|
|
1451389
1451470
|
}
|
|
1451390
1451471
|
}
|
|
1451391
1451472
|
}
|
|
1451392
1451473
|
// RCDATA state
|
|
1451393
1451474
|
//------------------------------------------------------------------
|
|
1451394
|
-
_stateRcdata(
|
|
1451395
|
-
switch (
|
|
1451475
|
+
_stateRcdata(cp10) {
|
|
1451476
|
+
switch (cp10) {
|
|
1451396
1451477
|
case CODE_POINTS.AMPERSAND: {
|
|
1451397
1451478
|
this._startCharacterReference();
|
|
1451398
1451479
|
break;
|
|
@@ -1451411,14 +1451492,14 @@ var Tokenizer = class {
|
|
|
1451411
1451492
|
break;
|
|
1451412
1451493
|
}
|
|
1451413
1451494
|
default: {
|
|
1451414
|
-
this._emitCodePoint(
|
|
1451495
|
+
this._emitCodePoint(cp10);
|
|
1451415
1451496
|
}
|
|
1451416
1451497
|
}
|
|
1451417
1451498
|
}
|
|
1451418
1451499
|
// RAWTEXT state
|
|
1451419
1451500
|
//------------------------------------------------------------------
|
|
1451420
|
-
_stateRawtext(
|
|
1451421
|
-
switch (
|
|
1451501
|
+
_stateRawtext(cp10) {
|
|
1451502
|
+
switch (cp10) {
|
|
1451422
1451503
|
case CODE_POINTS.LESS_THAN_SIGN: {
|
|
1451423
1451504
|
this.state = State2.RAWTEXT_LESS_THAN_SIGN;
|
|
1451424
1451505
|
break;
|
|
@@ -1451433,14 +1451514,14 @@ var Tokenizer = class {
|
|
|
1451433
1451514
|
break;
|
|
1451434
1451515
|
}
|
|
1451435
1451516
|
default: {
|
|
1451436
|
-
this._emitCodePoint(
|
|
1451517
|
+
this._emitCodePoint(cp10);
|
|
1451437
1451518
|
}
|
|
1451438
1451519
|
}
|
|
1451439
1451520
|
}
|
|
1451440
1451521
|
// Script data state
|
|
1451441
1451522
|
//------------------------------------------------------------------
|
|
1451442
|
-
_stateScriptData(
|
|
1451443
|
-
switch (
|
|
1451523
|
+
_stateScriptData(cp10) {
|
|
1451524
|
+
switch (cp10) {
|
|
1451444
1451525
|
case CODE_POINTS.LESS_THAN_SIGN: {
|
|
1451445
1451526
|
this.state = State2.SCRIPT_DATA_LESS_THAN_SIGN;
|
|
1451446
1451527
|
break;
|
|
@@ -1451455,14 +1451536,14 @@ var Tokenizer = class {
|
|
|
1451455
1451536
|
break;
|
|
1451456
1451537
|
}
|
|
1451457
1451538
|
default: {
|
|
1451458
|
-
this._emitCodePoint(
|
|
1451539
|
+
this._emitCodePoint(cp10);
|
|
1451459
1451540
|
}
|
|
1451460
1451541
|
}
|
|
1451461
1451542
|
}
|
|
1451462
1451543
|
// PLAINTEXT state
|
|
1451463
1451544
|
//------------------------------------------------------------------
|
|
1451464
|
-
_statePlaintext(
|
|
1451465
|
-
switch (
|
|
1451545
|
+
_statePlaintext(cp10) {
|
|
1451546
|
+
switch (cp10) {
|
|
1451466
1451547
|
case CODE_POINTS.NULL: {
|
|
1451467
1451548
|
this._err(ERR.unexpectedNullCharacter);
|
|
1451468
1451549
|
this._emitChars(REPLACEMENT_CHARACTER);
|
|
@@ -1451473,19 +1451554,19 @@ var Tokenizer = class {
|
|
|
1451473
1451554
|
break;
|
|
1451474
1451555
|
}
|
|
1451475
1451556
|
default: {
|
|
1451476
|
-
this._emitCodePoint(
|
|
1451557
|
+
this._emitCodePoint(cp10);
|
|
1451477
1451558
|
}
|
|
1451478
1451559
|
}
|
|
1451479
1451560
|
}
|
|
1451480
1451561
|
// Tag open state
|
|
1451481
1451562
|
//------------------------------------------------------------------
|
|
1451482
|
-
_stateTagOpen(
|
|
1451483
|
-
if (isAsciiLetter(
|
|
1451563
|
+
_stateTagOpen(cp10) {
|
|
1451564
|
+
if (isAsciiLetter(cp10)) {
|
|
1451484
1451565
|
this._createStartTagToken();
|
|
1451485
1451566
|
this.state = State2.TAG_NAME;
|
|
1451486
|
-
this._stateTagName(
|
|
1451567
|
+
this._stateTagName(cp10);
|
|
1451487
1451568
|
} else
|
|
1451488
|
-
switch (
|
|
1451569
|
+
switch (cp10) {
|
|
1451489
1451570
|
case CODE_POINTS.EXCLAMATION_MARK: {
|
|
1451490
1451571
|
this.state = State2.MARKUP_DECLARATION_OPEN;
|
|
1451491
1451572
|
break;
|
|
@@ -1451498,7 +1451579,7 @@ var Tokenizer = class {
|
|
|
1451498
1451579
|
this._err(ERR.unexpectedQuestionMarkInsteadOfTagName);
|
|
1451499
1451580
|
this._createCommentToken(1);
|
|
1451500
1451581
|
this.state = State2.BOGUS_COMMENT;
|
|
1451501
|
-
this._stateBogusComment(
|
|
1451582
|
+
this._stateBogusComment(cp10);
|
|
1451502
1451583
|
break;
|
|
1451503
1451584
|
}
|
|
1451504
1451585
|
case CODE_POINTS.EOF: {
|
|
@@ -1451511,19 +1451592,19 @@ var Tokenizer = class {
|
|
|
1451511
1451592
|
this._err(ERR.invalidFirstCharacterOfTagName);
|
|
1451512
1451593
|
this._emitChars("<");
|
|
1451513
1451594
|
this.state = State2.DATA;
|
|
1451514
|
-
this._stateData(
|
|
1451595
|
+
this._stateData(cp10);
|
|
1451515
1451596
|
}
|
|
1451516
1451597
|
}
|
|
1451517
1451598
|
}
|
|
1451518
1451599
|
// End tag open state
|
|
1451519
1451600
|
//------------------------------------------------------------------
|
|
1451520
|
-
_stateEndTagOpen(
|
|
1451521
|
-
if (isAsciiLetter(
|
|
1451601
|
+
_stateEndTagOpen(cp10) {
|
|
1451602
|
+
if (isAsciiLetter(cp10)) {
|
|
1451522
1451603
|
this._createEndTagToken();
|
|
1451523
1451604
|
this.state = State2.TAG_NAME;
|
|
1451524
|
-
this._stateTagName(
|
|
1451605
|
+
this._stateTagName(cp10);
|
|
1451525
1451606
|
} else
|
|
1451526
|
-
switch (
|
|
1451607
|
+
switch (cp10) {
|
|
1451527
1451608
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1451528
1451609
|
this._err(ERR.missingEndTagName);
|
|
1451529
1451610
|
this.state = State2.DATA;
|
|
@@ -1451539,15 +1451620,15 @@ var Tokenizer = class {
|
|
|
1451539
1451620
|
this._err(ERR.invalidFirstCharacterOfTagName);
|
|
1451540
1451621
|
this._createCommentToken(2);
|
|
1451541
1451622
|
this.state = State2.BOGUS_COMMENT;
|
|
1451542
|
-
this._stateBogusComment(
|
|
1451623
|
+
this._stateBogusComment(cp10);
|
|
1451543
1451624
|
}
|
|
1451544
1451625
|
}
|
|
1451545
1451626
|
}
|
|
1451546
1451627
|
// Tag name state
|
|
1451547
1451628
|
//------------------------------------------------------------------
|
|
1451548
|
-
_stateTagName(
|
|
1451629
|
+
_stateTagName(cp10) {
|
|
1451549
1451630
|
const token = this.currentToken;
|
|
1451550
|
-
switch (
|
|
1451631
|
+
switch (cp10) {
|
|
1451551
1451632
|
case CODE_POINTS.SPACE:
|
|
1451552
1451633
|
case CODE_POINTS.LINE_FEED:
|
|
1451553
1451634
|
case CODE_POINTS.TABULATION:
|
|
@@ -1451575,31 +1451656,31 @@ var Tokenizer = class {
|
|
|
1451575
1451656
|
break;
|
|
1451576
1451657
|
}
|
|
1451577
1451658
|
default: {
|
|
1451578
|
-
token.tagName += String.fromCodePoint(isAsciiUpper(
|
|
1451659
|
+
token.tagName += String.fromCodePoint(isAsciiUpper(cp10) ? toAsciiLower(cp10) : cp10);
|
|
1451579
1451660
|
}
|
|
1451580
1451661
|
}
|
|
1451581
1451662
|
}
|
|
1451582
1451663
|
// RCDATA less-than sign state
|
|
1451583
1451664
|
//------------------------------------------------------------------
|
|
1451584
|
-
_stateRcdataLessThanSign(
|
|
1451585
|
-
if (
|
|
1451665
|
+
_stateRcdataLessThanSign(cp10) {
|
|
1451666
|
+
if (cp10 === CODE_POINTS.SOLIDUS) {
|
|
1451586
1451667
|
this.state = State2.RCDATA_END_TAG_OPEN;
|
|
1451587
1451668
|
} else {
|
|
1451588
1451669
|
this._emitChars("<");
|
|
1451589
1451670
|
this.state = State2.RCDATA;
|
|
1451590
|
-
this._stateRcdata(
|
|
1451671
|
+
this._stateRcdata(cp10);
|
|
1451591
1451672
|
}
|
|
1451592
1451673
|
}
|
|
1451593
1451674
|
// RCDATA end tag open state
|
|
1451594
1451675
|
//------------------------------------------------------------------
|
|
1451595
|
-
_stateRcdataEndTagOpen(
|
|
1451596
|
-
if (isAsciiLetter(
|
|
1451676
|
+
_stateRcdataEndTagOpen(cp10) {
|
|
1451677
|
+
if (isAsciiLetter(cp10)) {
|
|
1451597
1451678
|
this.state = State2.RCDATA_END_TAG_NAME;
|
|
1451598
|
-
this._stateRcdataEndTagName(
|
|
1451679
|
+
this._stateRcdataEndTagName(cp10);
|
|
1451599
1451680
|
} else {
|
|
1451600
1451681
|
this._emitChars("</");
|
|
1451601
1451682
|
this.state = State2.RCDATA;
|
|
1451602
|
-
this._stateRcdata(
|
|
1451683
|
+
this._stateRcdata(cp10);
|
|
1451603
1451684
|
}
|
|
1451604
1451685
|
}
|
|
1451605
1451686
|
handleSpecialEndTag(_cp) {
|
|
@@ -1451609,8 +1451690,8 @@ var Tokenizer = class {
|
|
|
1451609
1451690
|
this._createEndTagToken();
|
|
1451610
1451691
|
const token = this.currentToken;
|
|
1451611
1451692
|
token.tagName = this.lastStartTagName;
|
|
1451612
|
-
const
|
|
1451613
|
-
switch (
|
|
1451693
|
+
const cp10 = this.preprocessor.peek(this.lastStartTagName.length);
|
|
1451694
|
+
switch (cp10) {
|
|
1451614
1451695
|
case CODE_POINTS.SPACE:
|
|
1451615
1451696
|
case CODE_POINTS.LINE_FEED:
|
|
1451616
1451697
|
case CODE_POINTS.TABULATION:
|
|
@@ -1451637,49 +1451718,49 @@ var Tokenizer = class {
|
|
|
1451637
1451718
|
}
|
|
1451638
1451719
|
// RCDATA end tag name state
|
|
1451639
1451720
|
//------------------------------------------------------------------
|
|
1451640
|
-
_stateRcdataEndTagName(
|
|
1451641
|
-
if (this.handleSpecialEndTag(
|
|
1451721
|
+
_stateRcdataEndTagName(cp10) {
|
|
1451722
|
+
if (this.handleSpecialEndTag(cp10)) {
|
|
1451642
1451723
|
this._emitChars("</");
|
|
1451643
1451724
|
this.state = State2.RCDATA;
|
|
1451644
|
-
this._stateRcdata(
|
|
1451725
|
+
this._stateRcdata(cp10);
|
|
1451645
1451726
|
}
|
|
1451646
1451727
|
}
|
|
1451647
1451728
|
// RAWTEXT less-than sign state
|
|
1451648
1451729
|
//------------------------------------------------------------------
|
|
1451649
|
-
_stateRawtextLessThanSign(
|
|
1451650
|
-
if (
|
|
1451730
|
+
_stateRawtextLessThanSign(cp10) {
|
|
1451731
|
+
if (cp10 === CODE_POINTS.SOLIDUS) {
|
|
1451651
1451732
|
this.state = State2.RAWTEXT_END_TAG_OPEN;
|
|
1451652
1451733
|
} else {
|
|
1451653
1451734
|
this._emitChars("<");
|
|
1451654
1451735
|
this.state = State2.RAWTEXT;
|
|
1451655
|
-
this._stateRawtext(
|
|
1451736
|
+
this._stateRawtext(cp10);
|
|
1451656
1451737
|
}
|
|
1451657
1451738
|
}
|
|
1451658
1451739
|
// RAWTEXT end tag open state
|
|
1451659
1451740
|
//------------------------------------------------------------------
|
|
1451660
|
-
_stateRawtextEndTagOpen(
|
|
1451661
|
-
if (isAsciiLetter(
|
|
1451741
|
+
_stateRawtextEndTagOpen(cp10) {
|
|
1451742
|
+
if (isAsciiLetter(cp10)) {
|
|
1451662
1451743
|
this.state = State2.RAWTEXT_END_TAG_NAME;
|
|
1451663
|
-
this._stateRawtextEndTagName(
|
|
1451744
|
+
this._stateRawtextEndTagName(cp10);
|
|
1451664
1451745
|
} else {
|
|
1451665
1451746
|
this._emitChars("</");
|
|
1451666
1451747
|
this.state = State2.RAWTEXT;
|
|
1451667
|
-
this._stateRawtext(
|
|
1451748
|
+
this._stateRawtext(cp10);
|
|
1451668
1451749
|
}
|
|
1451669
1451750
|
}
|
|
1451670
1451751
|
// RAWTEXT end tag name state
|
|
1451671
1451752
|
//------------------------------------------------------------------
|
|
1451672
|
-
_stateRawtextEndTagName(
|
|
1451673
|
-
if (this.handleSpecialEndTag(
|
|
1451753
|
+
_stateRawtextEndTagName(cp10) {
|
|
1451754
|
+
if (this.handleSpecialEndTag(cp10)) {
|
|
1451674
1451755
|
this._emitChars("</");
|
|
1451675
1451756
|
this.state = State2.RAWTEXT;
|
|
1451676
|
-
this._stateRawtext(
|
|
1451757
|
+
this._stateRawtext(cp10);
|
|
1451677
1451758
|
}
|
|
1451678
1451759
|
}
|
|
1451679
1451760
|
// Script data less-than sign state
|
|
1451680
1451761
|
//------------------------------------------------------------------
|
|
1451681
|
-
_stateScriptDataLessThanSign(
|
|
1451682
|
-
switch (
|
|
1451762
|
+
_stateScriptDataLessThanSign(cp10) {
|
|
1451763
|
+
switch (cp10) {
|
|
1451683
1451764
|
case CODE_POINTS.SOLIDUS: {
|
|
1451684
1451765
|
this.state = State2.SCRIPT_DATA_END_TAG_OPEN;
|
|
1451685
1451766
|
break;
|
|
@@ -1451692,57 +1451773,57 @@ var Tokenizer = class {
|
|
|
1451692
1451773
|
default: {
|
|
1451693
1451774
|
this._emitChars("<");
|
|
1451694
1451775
|
this.state = State2.SCRIPT_DATA;
|
|
1451695
|
-
this._stateScriptData(
|
|
1451776
|
+
this._stateScriptData(cp10);
|
|
1451696
1451777
|
}
|
|
1451697
1451778
|
}
|
|
1451698
1451779
|
}
|
|
1451699
1451780
|
// Script data end tag open state
|
|
1451700
1451781
|
//------------------------------------------------------------------
|
|
1451701
|
-
_stateScriptDataEndTagOpen(
|
|
1451702
|
-
if (isAsciiLetter(
|
|
1451782
|
+
_stateScriptDataEndTagOpen(cp10) {
|
|
1451783
|
+
if (isAsciiLetter(cp10)) {
|
|
1451703
1451784
|
this.state = State2.SCRIPT_DATA_END_TAG_NAME;
|
|
1451704
|
-
this._stateScriptDataEndTagName(
|
|
1451785
|
+
this._stateScriptDataEndTagName(cp10);
|
|
1451705
1451786
|
} else {
|
|
1451706
1451787
|
this._emitChars("</");
|
|
1451707
1451788
|
this.state = State2.SCRIPT_DATA;
|
|
1451708
|
-
this._stateScriptData(
|
|
1451789
|
+
this._stateScriptData(cp10);
|
|
1451709
1451790
|
}
|
|
1451710
1451791
|
}
|
|
1451711
1451792
|
// Script data end tag name state
|
|
1451712
1451793
|
//------------------------------------------------------------------
|
|
1451713
|
-
_stateScriptDataEndTagName(
|
|
1451714
|
-
if (this.handleSpecialEndTag(
|
|
1451794
|
+
_stateScriptDataEndTagName(cp10) {
|
|
1451795
|
+
if (this.handleSpecialEndTag(cp10)) {
|
|
1451715
1451796
|
this._emitChars("</");
|
|
1451716
1451797
|
this.state = State2.SCRIPT_DATA;
|
|
1451717
|
-
this._stateScriptData(
|
|
1451798
|
+
this._stateScriptData(cp10);
|
|
1451718
1451799
|
}
|
|
1451719
1451800
|
}
|
|
1451720
1451801
|
// Script data escape start state
|
|
1451721
1451802
|
//------------------------------------------------------------------
|
|
1451722
|
-
_stateScriptDataEscapeStart(
|
|
1451723
|
-
if (
|
|
1451803
|
+
_stateScriptDataEscapeStart(cp10) {
|
|
1451804
|
+
if (cp10 === CODE_POINTS.HYPHEN_MINUS) {
|
|
1451724
1451805
|
this.state = State2.SCRIPT_DATA_ESCAPE_START_DASH;
|
|
1451725
1451806
|
this._emitChars("-");
|
|
1451726
1451807
|
} else {
|
|
1451727
1451808
|
this.state = State2.SCRIPT_DATA;
|
|
1451728
|
-
this._stateScriptData(
|
|
1451809
|
+
this._stateScriptData(cp10);
|
|
1451729
1451810
|
}
|
|
1451730
1451811
|
}
|
|
1451731
1451812
|
// Script data escape start dash state
|
|
1451732
1451813
|
//------------------------------------------------------------------
|
|
1451733
|
-
_stateScriptDataEscapeStartDash(
|
|
1451734
|
-
if (
|
|
1451814
|
+
_stateScriptDataEscapeStartDash(cp10) {
|
|
1451815
|
+
if (cp10 === CODE_POINTS.HYPHEN_MINUS) {
|
|
1451735
1451816
|
this.state = State2.SCRIPT_DATA_ESCAPED_DASH_DASH;
|
|
1451736
1451817
|
this._emitChars("-");
|
|
1451737
1451818
|
} else {
|
|
1451738
1451819
|
this.state = State2.SCRIPT_DATA;
|
|
1451739
|
-
this._stateScriptData(
|
|
1451820
|
+
this._stateScriptData(cp10);
|
|
1451740
1451821
|
}
|
|
1451741
1451822
|
}
|
|
1451742
1451823
|
// Script data escaped state
|
|
1451743
1451824
|
//------------------------------------------------------------------
|
|
1451744
|
-
_stateScriptDataEscaped(
|
|
1451745
|
-
switch (
|
|
1451825
|
+
_stateScriptDataEscaped(cp10) {
|
|
1451826
|
+
switch (cp10) {
|
|
1451746
1451827
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451747
1451828
|
this.state = State2.SCRIPT_DATA_ESCAPED_DASH;
|
|
1451748
1451829
|
this._emitChars("-");
|
|
@@ -1451763,14 +1451844,14 @@ var Tokenizer = class {
|
|
|
1451763
1451844
|
break;
|
|
1451764
1451845
|
}
|
|
1451765
1451846
|
default: {
|
|
1451766
|
-
this._emitCodePoint(
|
|
1451847
|
+
this._emitCodePoint(cp10);
|
|
1451767
1451848
|
}
|
|
1451768
1451849
|
}
|
|
1451769
1451850
|
}
|
|
1451770
1451851
|
// Script data escaped dash state
|
|
1451771
1451852
|
//------------------------------------------------------------------
|
|
1451772
|
-
_stateScriptDataEscapedDash(
|
|
1451773
|
-
switch (
|
|
1451853
|
+
_stateScriptDataEscapedDash(cp10) {
|
|
1451854
|
+
switch (cp10) {
|
|
1451774
1451855
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451775
1451856
|
this.state = State2.SCRIPT_DATA_ESCAPED_DASH_DASH;
|
|
1451776
1451857
|
this._emitChars("-");
|
|
@@ -1451793,14 +1451874,14 @@ var Tokenizer = class {
|
|
|
1451793
1451874
|
}
|
|
1451794
1451875
|
default: {
|
|
1451795
1451876
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451796
|
-
this._emitCodePoint(
|
|
1451877
|
+
this._emitCodePoint(cp10);
|
|
1451797
1451878
|
}
|
|
1451798
1451879
|
}
|
|
1451799
1451880
|
}
|
|
1451800
1451881
|
// Script data escaped dash dash state
|
|
1451801
1451882
|
//------------------------------------------------------------------
|
|
1451802
|
-
_stateScriptDataEscapedDashDash(
|
|
1451803
|
-
switch (
|
|
1451883
|
+
_stateScriptDataEscapedDashDash(cp10) {
|
|
1451884
|
+
switch (cp10) {
|
|
1451804
1451885
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451805
1451886
|
this._emitChars("-");
|
|
1451806
1451887
|
break;
|
|
@@ -1451827,64 +1451908,64 @@ var Tokenizer = class {
|
|
|
1451827
1451908
|
}
|
|
1451828
1451909
|
default: {
|
|
1451829
1451910
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451830
|
-
this._emitCodePoint(
|
|
1451911
|
+
this._emitCodePoint(cp10);
|
|
1451831
1451912
|
}
|
|
1451832
1451913
|
}
|
|
1451833
1451914
|
}
|
|
1451834
1451915
|
// Script data escaped less-than sign state
|
|
1451835
1451916
|
//------------------------------------------------------------------
|
|
1451836
|
-
_stateScriptDataEscapedLessThanSign(
|
|
1451837
|
-
if (
|
|
1451917
|
+
_stateScriptDataEscapedLessThanSign(cp10) {
|
|
1451918
|
+
if (cp10 === CODE_POINTS.SOLIDUS) {
|
|
1451838
1451919
|
this.state = State2.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;
|
|
1451839
|
-
} else if (isAsciiLetter(
|
|
1451920
|
+
} else if (isAsciiLetter(cp10)) {
|
|
1451840
1451921
|
this._emitChars("<");
|
|
1451841
1451922
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPE_START;
|
|
1451842
|
-
this._stateScriptDataDoubleEscapeStart(
|
|
1451923
|
+
this._stateScriptDataDoubleEscapeStart(cp10);
|
|
1451843
1451924
|
} else {
|
|
1451844
1451925
|
this._emitChars("<");
|
|
1451845
1451926
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451846
|
-
this._stateScriptDataEscaped(
|
|
1451927
|
+
this._stateScriptDataEscaped(cp10);
|
|
1451847
1451928
|
}
|
|
1451848
1451929
|
}
|
|
1451849
1451930
|
// Script data escaped end tag open state
|
|
1451850
1451931
|
//------------------------------------------------------------------
|
|
1451851
|
-
_stateScriptDataEscapedEndTagOpen(
|
|
1451852
|
-
if (isAsciiLetter(
|
|
1451932
|
+
_stateScriptDataEscapedEndTagOpen(cp10) {
|
|
1451933
|
+
if (isAsciiLetter(cp10)) {
|
|
1451853
1451934
|
this.state = State2.SCRIPT_DATA_ESCAPED_END_TAG_NAME;
|
|
1451854
|
-
this._stateScriptDataEscapedEndTagName(
|
|
1451935
|
+
this._stateScriptDataEscapedEndTagName(cp10);
|
|
1451855
1451936
|
} else {
|
|
1451856
1451937
|
this._emitChars("</");
|
|
1451857
1451938
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451858
|
-
this._stateScriptDataEscaped(
|
|
1451939
|
+
this._stateScriptDataEscaped(cp10);
|
|
1451859
1451940
|
}
|
|
1451860
1451941
|
}
|
|
1451861
1451942
|
// Script data escaped end tag name state
|
|
1451862
1451943
|
//------------------------------------------------------------------
|
|
1451863
|
-
_stateScriptDataEscapedEndTagName(
|
|
1451864
|
-
if (this.handleSpecialEndTag(
|
|
1451944
|
+
_stateScriptDataEscapedEndTagName(cp10) {
|
|
1451945
|
+
if (this.handleSpecialEndTag(cp10)) {
|
|
1451865
1451946
|
this._emitChars("</");
|
|
1451866
1451947
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451867
|
-
this._stateScriptDataEscaped(
|
|
1451948
|
+
this._stateScriptDataEscaped(cp10);
|
|
1451868
1451949
|
}
|
|
1451869
1451950
|
}
|
|
1451870
1451951
|
// Script data double escape start state
|
|
1451871
1451952
|
//------------------------------------------------------------------
|
|
1451872
|
-
_stateScriptDataDoubleEscapeStart(
|
|
1451953
|
+
_stateScriptDataDoubleEscapeStart(cp10) {
|
|
1451873
1451954
|
if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) {
|
|
1451874
|
-
this._emitCodePoint(
|
|
1451955
|
+
this._emitCodePoint(cp10);
|
|
1451875
1451956
|
for (let i11 = 0; i11 < SEQUENCES.SCRIPT.length; i11++) {
|
|
1451876
1451957
|
this._emitCodePoint(this._consume());
|
|
1451877
1451958
|
}
|
|
1451878
1451959
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1451879
1451960
|
} else if (!this._ensureHibernation()) {
|
|
1451880
1451961
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451881
|
-
this._stateScriptDataEscaped(
|
|
1451962
|
+
this._stateScriptDataEscaped(cp10);
|
|
1451882
1451963
|
}
|
|
1451883
1451964
|
}
|
|
1451884
1451965
|
// Script data double escaped state
|
|
1451885
1451966
|
//------------------------------------------------------------------
|
|
1451886
|
-
_stateScriptDataDoubleEscaped(
|
|
1451887
|
-
switch (
|
|
1451967
|
+
_stateScriptDataDoubleEscaped(cp10) {
|
|
1451968
|
+
switch (cp10) {
|
|
1451888
1451969
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451889
1451970
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED_DASH;
|
|
1451890
1451971
|
this._emitChars("-");
|
|
@@ -1451906,14 +1451987,14 @@ var Tokenizer = class {
|
|
|
1451906
1451987
|
break;
|
|
1451907
1451988
|
}
|
|
1451908
1451989
|
default: {
|
|
1451909
|
-
this._emitCodePoint(
|
|
1451990
|
+
this._emitCodePoint(cp10);
|
|
1451910
1451991
|
}
|
|
1451911
1451992
|
}
|
|
1451912
1451993
|
}
|
|
1451913
1451994
|
// Script data double escaped dash state
|
|
1451914
1451995
|
//------------------------------------------------------------------
|
|
1451915
|
-
_stateScriptDataDoubleEscapedDash(
|
|
1451916
|
-
switch (
|
|
1451996
|
+
_stateScriptDataDoubleEscapedDash(cp10) {
|
|
1451997
|
+
switch (cp10) {
|
|
1451917
1451998
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451918
1451999
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH;
|
|
1451919
1452000
|
this._emitChars("-");
|
|
@@ -1451937,14 +1452018,14 @@ var Tokenizer = class {
|
|
|
1451937
1452018
|
}
|
|
1451938
1452019
|
default: {
|
|
1451939
1452020
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1451940
|
-
this._emitCodePoint(
|
|
1452021
|
+
this._emitCodePoint(cp10);
|
|
1451941
1452022
|
}
|
|
1451942
1452023
|
}
|
|
1451943
1452024
|
}
|
|
1451944
1452025
|
// Script data double escaped dash dash state
|
|
1451945
1452026
|
//------------------------------------------------------------------
|
|
1451946
|
-
_stateScriptDataDoubleEscapedDashDash(
|
|
1451947
|
-
switch (
|
|
1452027
|
+
_stateScriptDataDoubleEscapedDashDash(cp10) {
|
|
1452028
|
+
switch (cp10) {
|
|
1451948
1452029
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1451949
1452030
|
this._emitChars("-");
|
|
1451950
1452031
|
break;
|
|
@@ -1451972,39 +1452053,39 @@ var Tokenizer = class {
|
|
|
1451972
1452053
|
}
|
|
1451973
1452054
|
default: {
|
|
1451974
1452055
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1451975
|
-
this._emitCodePoint(
|
|
1452056
|
+
this._emitCodePoint(cp10);
|
|
1451976
1452057
|
}
|
|
1451977
1452058
|
}
|
|
1451978
1452059
|
}
|
|
1451979
1452060
|
// Script data double escaped less-than sign state
|
|
1451980
1452061
|
//------------------------------------------------------------------
|
|
1451981
|
-
_stateScriptDataDoubleEscapedLessThanSign(
|
|
1451982
|
-
if (
|
|
1452062
|
+
_stateScriptDataDoubleEscapedLessThanSign(cp10) {
|
|
1452063
|
+
if (cp10 === CODE_POINTS.SOLIDUS) {
|
|
1451983
1452064
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPE_END;
|
|
1451984
1452065
|
this._emitChars("/");
|
|
1451985
1452066
|
} else {
|
|
1451986
1452067
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1451987
|
-
this._stateScriptDataDoubleEscaped(
|
|
1452068
|
+
this._stateScriptDataDoubleEscaped(cp10);
|
|
1451988
1452069
|
}
|
|
1451989
1452070
|
}
|
|
1451990
1452071
|
// Script data double escape end state
|
|
1451991
1452072
|
//------------------------------------------------------------------
|
|
1451992
|
-
_stateScriptDataDoubleEscapeEnd(
|
|
1452073
|
+
_stateScriptDataDoubleEscapeEnd(cp10) {
|
|
1451993
1452074
|
if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) {
|
|
1451994
|
-
this._emitCodePoint(
|
|
1452075
|
+
this._emitCodePoint(cp10);
|
|
1451995
1452076
|
for (let i11 = 0; i11 < SEQUENCES.SCRIPT.length; i11++) {
|
|
1451996
1452077
|
this._emitCodePoint(this._consume());
|
|
1451997
1452078
|
}
|
|
1451998
1452079
|
this.state = State2.SCRIPT_DATA_ESCAPED;
|
|
1451999
1452080
|
} else if (!this._ensureHibernation()) {
|
|
1452000
1452081
|
this.state = State2.SCRIPT_DATA_DOUBLE_ESCAPED;
|
|
1452001
|
-
this._stateScriptDataDoubleEscaped(
|
|
1452082
|
+
this._stateScriptDataDoubleEscaped(cp10);
|
|
1452002
1452083
|
}
|
|
1452003
1452084
|
}
|
|
1452004
1452085
|
// Before attribute name state
|
|
1452005
1452086
|
//------------------------------------------------------------------
|
|
1452006
|
-
_stateBeforeAttributeName(
|
|
1452007
|
-
switch (
|
|
1452087
|
+
_stateBeforeAttributeName(cp10) {
|
|
1452088
|
+
switch (cp10) {
|
|
1452008
1452089
|
case CODE_POINTS.SPACE:
|
|
1452009
1452090
|
case CODE_POINTS.LINE_FEED:
|
|
1452010
1452091
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452015,7 +1452096,7 @@ var Tokenizer = class {
|
|
|
1452015
1452096
|
case CODE_POINTS.GREATER_THAN_SIGN:
|
|
1452016
1452097
|
case CODE_POINTS.EOF: {
|
|
1452017
1452098
|
this.state = State2.AFTER_ATTRIBUTE_NAME;
|
|
1452018
|
-
this._stateAfterAttributeName(
|
|
1452099
|
+
this._stateAfterAttributeName(cp10);
|
|
1452019
1452100
|
break;
|
|
1452020
1452101
|
}
|
|
1452021
1452102
|
case CODE_POINTS.EQUALS_SIGN: {
|
|
@@ -1452027,14 +1452108,14 @@ var Tokenizer = class {
|
|
|
1452027
1452108
|
default: {
|
|
1452028
1452109
|
this._createAttr("");
|
|
1452029
1452110
|
this.state = State2.ATTRIBUTE_NAME;
|
|
1452030
|
-
this._stateAttributeName(
|
|
1452111
|
+
this._stateAttributeName(cp10);
|
|
1452031
1452112
|
}
|
|
1452032
1452113
|
}
|
|
1452033
1452114
|
}
|
|
1452034
1452115
|
// Attribute name state
|
|
1452035
1452116
|
//------------------------------------------------------------------
|
|
1452036
|
-
_stateAttributeName(
|
|
1452037
|
-
switch (
|
|
1452117
|
+
_stateAttributeName(cp10) {
|
|
1452118
|
+
switch (cp10) {
|
|
1452038
1452119
|
case CODE_POINTS.SPACE:
|
|
1452039
1452120
|
case CODE_POINTS.LINE_FEED:
|
|
1452040
1452121
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452044,7 +1452125,7 @@ var Tokenizer = class {
|
|
|
1452044
1452125
|
case CODE_POINTS.EOF: {
|
|
1452045
1452126
|
this._leaveAttrName();
|
|
1452046
1452127
|
this.state = State2.AFTER_ATTRIBUTE_NAME;
|
|
1452047
|
-
this._stateAfterAttributeName(
|
|
1452128
|
+
this._stateAfterAttributeName(cp10);
|
|
1452048
1452129
|
break;
|
|
1452049
1452130
|
}
|
|
1452050
1452131
|
case CODE_POINTS.EQUALS_SIGN: {
|
|
@@ -1452056,7 +1452137,7 @@ var Tokenizer = class {
|
|
|
1452056
1452137
|
case CODE_POINTS.APOSTROPHE:
|
|
1452057
1452138
|
case CODE_POINTS.LESS_THAN_SIGN: {
|
|
1452058
1452139
|
this._err(ERR.unexpectedCharacterInAttributeName);
|
|
1452059
|
-
this.currentAttr.name += String.fromCodePoint(
|
|
1452140
|
+
this.currentAttr.name += String.fromCodePoint(cp10);
|
|
1452060
1452141
|
break;
|
|
1452061
1452142
|
}
|
|
1452062
1452143
|
case CODE_POINTS.NULL: {
|
|
@@ -1452065,14 +1452146,14 @@ var Tokenizer = class {
|
|
|
1452065
1452146
|
break;
|
|
1452066
1452147
|
}
|
|
1452067
1452148
|
default: {
|
|
1452068
|
-
this.currentAttr.name += String.fromCodePoint(isAsciiUpper(
|
|
1452149
|
+
this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp10) ? toAsciiLower(cp10) : cp10);
|
|
1452069
1452150
|
}
|
|
1452070
1452151
|
}
|
|
1452071
1452152
|
}
|
|
1452072
1452153
|
// After attribute name state
|
|
1452073
1452154
|
//------------------------------------------------------------------
|
|
1452074
|
-
_stateAfterAttributeName(
|
|
1452075
|
-
switch (
|
|
1452155
|
+
_stateAfterAttributeName(cp10) {
|
|
1452156
|
+
switch (cp10) {
|
|
1452076
1452157
|
case CODE_POINTS.SPACE:
|
|
1452077
1452158
|
case CODE_POINTS.LINE_FEED:
|
|
1452078
1452159
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452100,14 +1452181,14 @@ var Tokenizer = class {
|
|
|
1452100
1452181
|
default: {
|
|
1452101
1452182
|
this._createAttr("");
|
|
1452102
1452183
|
this.state = State2.ATTRIBUTE_NAME;
|
|
1452103
|
-
this._stateAttributeName(
|
|
1452184
|
+
this._stateAttributeName(cp10);
|
|
1452104
1452185
|
}
|
|
1452105
1452186
|
}
|
|
1452106
1452187
|
}
|
|
1452107
1452188
|
// Before attribute value state
|
|
1452108
1452189
|
//------------------------------------------------------------------
|
|
1452109
|
-
_stateBeforeAttributeValue(
|
|
1452110
|
-
switch (
|
|
1452190
|
+
_stateBeforeAttributeValue(cp10) {
|
|
1452191
|
+
switch (cp10) {
|
|
1452111
1452192
|
case CODE_POINTS.SPACE:
|
|
1452112
1452193
|
case CODE_POINTS.LINE_FEED:
|
|
1452113
1452194
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452130,14 +1452211,14 @@ var Tokenizer = class {
|
|
|
1452130
1452211
|
}
|
|
1452131
1452212
|
default: {
|
|
1452132
1452213
|
this.state = State2.ATTRIBUTE_VALUE_UNQUOTED;
|
|
1452133
|
-
this._stateAttributeValueUnquoted(
|
|
1452214
|
+
this._stateAttributeValueUnquoted(cp10);
|
|
1452134
1452215
|
}
|
|
1452135
1452216
|
}
|
|
1452136
1452217
|
}
|
|
1452137
1452218
|
// Attribute value (double-quoted) state
|
|
1452138
1452219
|
//------------------------------------------------------------------
|
|
1452139
|
-
_stateAttributeValueDoubleQuoted(
|
|
1452140
|
-
switch (
|
|
1452220
|
+
_stateAttributeValueDoubleQuoted(cp10) {
|
|
1452221
|
+
switch (cp10) {
|
|
1452141
1452222
|
case CODE_POINTS.QUOTATION_MARK: {
|
|
1452142
1452223
|
this.state = State2.AFTER_ATTRIBUTE_VALUE_QUOTED;
|
|
1452143
1452224
|
break;
|
|
@@ -1452157,14 +1452238,14 @@ var Tokenizer = class {
|
|
|
1452157
1452238
|
break;
|
|
1452158
1452239
|
}
|
|
1452159
1452240
|
default: {
|
|
1452160
|
-
this.currentAttr.value += String.fromCodePoint(
|
|
1452241
|
+
this.currentAttr.value += String.fromCodePoint(cp10);
|
|
1452161
1452242
|
}
|
|
1452162
1452243
|
}
|
|
1452163
1452244
|
}
|
|
1452164
1452245
|
// Attribute value (single-quoted) state
|
|
1452165
1452246
|
//------------------------------------------------------------------
|
|
1452166
|
-
_stateAttributeValueSingleQuoted(
|
|
1452167
|
-
switch (
|
|
1452247
|
+
_stateAttributeValueSingleQuoted(cp10) {
|
|
1452248
|
+
switch (cp10) {
|
|
1452168
1452249
|
case CODE_POINTS.APOSTROPHE: {
|
|
1452169
1452250
|
this.state = State2.AFTER_ATTRIBUTE_VALUE_QUOTED;
|
|
1452170
1452251
|
break;
|
|
@@ -1452184,14 +1452265,14 @@ var Tokenizer = class {
|
|
|
1452184
1452265
|
break;
|
|
1452185
1452266
|
}
|
|
1452186
1452267
|
default: {
|
|
1452187
|
-
this.currentAttr.value += String.fromCodePoint(
|
|
1452268
|
+
this.currentAttr.value += String.fromCodePoint(cp10);
|
|
1452188
1452269
|
}
|
|
1452189
1452270
|
}
|
|
1452190
1452271
|
}
|
|
1452191
1452272
|
// Attribute value (unquoted) state
|
|
1452192
1452273
|
//------------------------------------------------------------------
|
|
1452193
|
-
_stateAttributeValueUnquoted(
|
|
1452194
|
-
switch (
|
|
1452274
|
+
_stateAttributeValueUnquoted(cp10) {
|
|
1452275
|
+
switch (cp10) {
|
|
1452195
1452276
|
case CODE_POINTS.SPACE:
|
|
1452196
1452277
|
case CODE_POINTS.LINE_FEED:
|
|
1452197
1452278
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452221,7 +1452302,7 @@ var Tokenizer = class {
|
|
|
1452221
1452302
|
case CODE_POINTS.EQUALS_SIGN:
|
|
1452222
1452303
|
case CODE_POINTS.GRAVE_ACCENT: {
|
|
1452223
1452304
|
this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);
|
|
1452224
|
-
this.currentAttr.value += String.fromCodePoint(
|
|
1452305
|
+
this.currentAttr.value += String.fromCodePoint(cp10);
|
|
1452225
1452306
|
break;
|
|
1452226
1452307
|
}
|
|
1452227
1452308
|
case CODE_POINTS.EOF: {
|
|
@@ -1452230,14 +1452311,14 @@ var Tokenizer = class {
|
|
|
1452230
1452311
|
break;
|
|
1452231
1452312
|
}
|
|
1452232
1452313
|
default: {
|
|
1452233
|
-
this.currentAttr.value += String.fromCodePoint(
|
|
1452314
|
+
this.currentAttr.value += String.fromCodePoint(cp10);
|
|
1452234
1452315
|
}
|
|
1452235
1452316
|
}
|
|
1452236
1452317
|
}
|
|
1452237
1452318
|
// After attribute value (quoted) state
|
|
1452238
1452319
|
//------------------------------------------------------------------
|
|
1452239
|
-
_stateAfterAttributeValueQuoted(
|
|
1452240
|
-
switch (
|
|
1452320
|
+
_stateAfterAttributeValueQuoted(cp10) {
|
|
1452321
|
+
switch (cp10) {
|
|
1452241
1452322
|
case CODE_POINTS.SPACE:
|
|
1452242
1452323
|
case CODE_POINTS.LINE_FEED:
|
|
1452243
1452324
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452265,14 +1452346,14 @@ var Tokenizer = class {
|
|
|
1452265
1452346
|
default: {
|
|
1452266
1452347
|
this._err(ERR.missingWhitespaceBetweenAttributes);
|
|
1452267
1452348
|
this.state = State2.BEFORE_ATTRIBUTE_NAME;
|
|
1452268
|
-
this._stateBeforeAttributeName(
|
|
1452349
|
+
this._stateBeforeAttributeName(cp10);
|
|
1452269
1452350
|
}
|
|
1452270
1452351
|
}
|
|
1452271
1452352
|
}
|
|
1452272
1452353
|
// Self-closing start tag state
|
|
1452273
1452354
|
//------------------------------------------------------------------
|
|
1452274
|
-
_stateSelfClosingStartTag(
|
|
1452275
|
-
switch (
|
|
1452355
|
+
_stateSelfClosingStartTag(cp10) {
|
|
1452356
|
+
switch (cp10) {
|
|
1452276
1452357
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1452277
1452358
|
const token = this.currentToken;
|
|
1452278
1452359
|
token.selfClosing = true;
|
|
@@ -1452288,15 +1452369,15 @@ var Tokenizer = class {
|
|
|
1452288
1452369
|
default: {
|
|
1452289
1452370
|
this._err(ERR.unexpectedSolidusInTag);
|
|
1452290
1452371
|
this.state = State2.BEFORE_ATTRIBUTE_NAME;
|
|
1452291
|
-
this._stateBeforeAttributeName(
|
|
1452372
|
+
this._stateBeforeAttributeName(cp10);
|
|
1452292
1452373
|
}
|
|
1452293
1452374
|
}
|
|
1452294
1452375
|
}
|
|
1452295
1452376
|
// Bogus comment state
|
|
1452296
1452377
|
//------------------------------------------------------------------
|
|
1452297
|
-
_stateBogusComment(
|
|
1452378
|
+
_stateBogusComment(cp10) {
|
|
1452298
1452379
|
const token = this.currentToken;
|
|
1452299
|
-
switch (
|
|
1452380
|
+
switch (cp10) {
|
|
1452300
1452381
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1452301
1452382
|
this.state = State2.DATA;
|
|
1452302
1452383
|
this.emitCurrentComment(token);
|
|
@@ -1452313,13 +1452394,13 @@ var Tokenizer = class {
|
|
|
1452313
1452394
|
break;
|
|
1452314
1452395
|
}
|
|
1452315
1452396
|
default: {
|
|
1452316
|
-
token.data += String.fromCodePoint(
|
|
1452397
|
+
token.data += String.fromCodePoint(cp10);
|
|
1452317
1452398
|
}
|
|
1452318
1452399
|
}
|
|
1452319
1452400
|
}
|
|
1452320
1452401
|
// Markup declaration open state
|
|
1452321
1452402
|
//------------------------------------------------------------------
|
|
1452322
|
-
_stateMarkupDeclarationOpen(
|
|
1452403
|
+
_stateMarkupDeclarationOpen(cp10) {
|
|
1452323
1452404
|
if (this._consumeSequenceIfMatch(SEQUENCES.DASH_DASH, true)) {
|
|
1452324
1452405
|
this._createCommentToken(SEQUENCES.DASH_DASH.length + 1);
|
|
1452325
1452406
|
this.state = State2.COMMENT_START;
|
|
@@ -1452339,13 +1452420,13 @@ var Tokenizer = class {
|
|
|
1452339
1452420
|
this._err(ERR.incorrectlyOpenedComment);
|
|
1452340
1452421
|
this._createCommentToken(2);
|
|
1452341
1452422
|
this.state = State2.BOGUS_COMMENT;
|
|
1452342
|
-
this._stateBogusComment(
|
|
1452423
|
+
this._stateBogusComment(cp10);
|
|
1452343
1452424
|
}
|
|
1452344
1452425
|
}
|
|
1452345
1452426
|
// Comment start state
|
|
1452346
1452427
|
//------------------------------------------------------------------
|
|
1452347
|
-
_stateCommentStart(
|
|
1452348
|
-
switch (
|
|
1452428
|
+
_stateCommentStart(cp10) {
|
|
1452429
|
+
switch (cp10) {
|
|
1452349
1452430
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1452350
1452431
|
this.state = State2.COMMENT_START_DASH;
|
|
1452351
1452432
|
break;
|
|
@@ -1452359,15 +1452440,15 @@ var Tokenizer = class {
|
|
|
1452359
1452440
|
}
|
|
1452360
1452441
|
default: {
|
|
1452361
1452442
|
this.state = State2.COMMENT;
|
|
1452362
|
-
this._stateComment(
|
|
1452443
|
+
this._stateComment(cp10);
|
|
1452363
1452444
|
}
|
|
1452364
1452445
|
}
|
|
1452365
1452446
|
}
|
|
1452366
1452447
|
// Comment start dash state
|
|
1452367
1452448
|
//------------------------------------------------------------------
|
|
1452368
|
-
_stateCommentStartDash(
|
|
1452449
|
+
_stateCommentStartDash(cp10) {
|
|
1452369
1452450
|
const token = this.currentToken;
|
|
1452370
|
-
switch (
|
|
1452451
|
+
switch (cp10) {
|
|
1452371
1452452
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1452372
1452453
|
this.state = State2.COMMENT_END;
|
|
1452373
1452454
|
break;
|
|
@@ -1452387,15 +1452468,15 @@ var Tokenizer = class {
|
|
|
1452387
1452468
|
default: {
|
|
1452388
1452469
|
token.data += "-";
|
|
1452389
1452470
|
this.state = State2.COMMENT;
|
|
1452390
|
-
this._stateComment(
|
|
1452471
|
+
this._stateComment(cp10);
|
|
1452391
1452472
|
}
|
|
1452392
1452473
|
}
|
|
1452393
1452474
|
}
|
|
1452394
1452475
|
// Comment state
|
|
1452395
1452476
|
//------------------------------------------------------------------
|
|
1452396
|
-
_stateComment(
|
|
1452477
|
+
_stateComment(cp10) {
|
|
1452397
1452478
|
const token = this.currentToken;
|
|
1452398
|
-
switch (
|
|
1452479
|
+
switch (cp10) {
|
|
1452399
1452480
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1452400
1452481
|
this.state = State2.COMMENT_END_DASH;
|
|
1452401
1452482
|
break;
|
|
@@ -1452417,15 +1452498,15 @@ var Tokenizer = class {
|
|
|
1452417
1452498
|
break;
|
|
1452418
1452499
|
}
|
|
1452419
1452500
|
default: {
|
|
1452420
|
-
token.data += String.fromCodePoint(
|
|
1452501
|
+
token.data += String.fromCodePoint(cp10);
|
|
1452421
1452502
|
}
|
|
1452422
1452503
|
}
|
|
1452423
1452504
|
}
|
|
1452424
1452505
|
// Comment less-than sign state
|
|
1452425
1452506
|
//------------------------------------------------------------------
|
|
1452426
|
-
_stateCommentLessThanSign(
|
|
1452507
|
+
_stateCommentLessThanSign(cp10) {
|
|
1452427
1452508
|
const token = this.currentToken;
|
|
1452428
|
-
switch (
|
|
1452509
|
+
switch (cp10) {
|
|
1452429
1452510
|
case CODE_POINTS.EXCLAMATION_MARK: {
|
|
1452430
1452511
|
token.data += "!";
|
|
1452431
1452512
|
this.state = State2.COMMENT_LESS_THAN_SIGN_BANG;
|
|
@@ -1452437,44 +1452518,44 @@ var Tokenizer = class {
|
|
|
1452437
1452518
|
}
|
|
1452438
1452519
|
default: {
|
|
1452439
1452520
|
this.state = State2.COMMENT;
|
|
1452440
|
-
this._stateComment(
|
|
1452521
|
+
this._stateComment(cp10);
|
|
1452441
1452522
|
}
|
|
1452442
1452523
|
}
|
|
1452443
1452524
|
}
|
|
1452444
1452525
|
// Comment less-than sign bang state
|
|
1452445
1452526
|
//------------------------------------------------------------------
|
|
1452446
|
-
_stateCommentLessThanSignBang(
|
|
1452447
|
-
if (
|
|
1452527
|
+
_stateCommentLessThanSignBang(cp10) {
|
|
1452528
|
+
if (cp10 === CODE_POINTS.HYPHEN_MINUS) {
|
|
1452448
1452529
|
this.state = State2.COMMENT_LESS_THAN_SIGN_BANG_DASH;
|
|
1452449
1452530
|
} else {
|
|
1452450
1452531
|
this.state = State2.COMMENT;
|
|
1452451
|
-
this._stateComment(
|
|
1452532
|
+
this._stateComment(cp10);
|
|
1452452
1452533
|
}
|
|
1452453
1452534
|
}
|
|
1452454
1452535
|
// Comment less-than sign bang dash state
|
|
1452455
1452536
|
//------------------------------------------------------------------
|
|
1452456
|
-
_stateCommentLessThanSignBangDash(
|
|
1452457
|
-
if (
|
|
1452537
|
+
_stateCommentLessThanSignBangDash(cp10) {
|
|
1452538
|
+
if (cp10 === CODE_POINTS.HYPHEN_MINUS) {
|
|
1452458
1452539
|
this.state = State2.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH;
|
|
1452459
1452540
|
} else {
|
|
1452460
1452541
|
this.state = State2.COMMENT_END_DASH;
|
|
1452461
|
-
this._stateCommentEndDash(
|
|
1452542
|
+
this._stateCommentEndDash(cp10);
|
|
1452462
1452543
|
}
|
|
1452463
1452544
|
}
|
|
1452464
1452545
|
// Comment less-than sign bang dash dash state
|
|
1452465
1452546
|
//------------------------------------------------------------------
|
|
1452466
|
-
_stateCommentLessThanSignBangDashDash(
|
|
1452467
|
-
if (
|
|
1452547
|
+
_stateCommentLessThanSignBangDashDash(cp10) {
|
|
1452548
|
+
if (cp10 !== CODE_POINTS.GREATER_THAN_SIGN && cp10 !== CODE_POINTS.EOF) {
|
|
1452468
1452549
|
this._err(ERR.nestedComment);
|
|
1452469
1452550
|
}
|
|
1452470
1452551
|
this.state = State2.COMMENT_END;
|
|
1452471
|
-
this._stateCommentEnd(
|
|
1452552
|
+
this._stateCommentEnd(cp10);
|
|
1452472
1452553
|
}
|
|
1452473
1452554
|
// Comment end dash state
|
|
1452474
1452555
|
//------------------------------------------------------------------
|
|
1452475
|
-
_stateCommentEndDash(
|
|
1452556
|
+
_stateCommentEndDash(cp10) {
|
|
1452476
1452557
|
const token = this.currentToken;
|
|
1452477
|
-
switch (
|
|
1452558
|
+
switch (cp10) {
|
|
1452478
1452559
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1452479
1452560
|
this.state = State2.COMMENT_END;
|
|
1452480
1452561
|
break;
|
|
@@ -1452488,15 +1452569,15 @@ var Tokenizer = class {
|
|
|
1452488
1452569
|
default: {
|
|
1452489
1452570
|
token.data += "-";
|
|
1452490
1452571
|
this.state = State2.COMMENT;
|
|
1452491
|
-
this._stateComment(
|
|
1452572
|
+
this._stateComment(cp10);
|
|
1452492
1452573
|
}
|
|
1452493
1452574
|
}
|
|
1452494
1452575
|
}
|
|
1452495
1452576
|
// Comment end state
|
|
1452496
1452577
|
//------------------------------------------------------------------
|
|
1452497
|
-
_stateCommentEnd(
|
|
1452578
|
+
_stateCommentEnd(cp10) {
|
|
1452498
1452579
|
const token = this.currentToken;
|
|
1452499
|
-
switch (
|
|
1452580
|
+
switch (cp10) {
|
|
1452500
1452581
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1452501
1452582
|
this.state = State2.DATA;
|
|
1452502
1452583
|
this.emitCurrentComment(token);
|
|
@@ -1452519,15 +1452600,15 @@ var Tokenizer = class {
|
|
|
1452519
1452600
|
default: {
|
|
1452520
1452601
|
token.data += "--";
|
|
1452521
1452602
|
this.state = State2.COMMENT;
|
|
1452522
|
-
this._stateComment(
|
|
1452603
|
+
this._stateComment(cp10);
|
|
1452523
1452604
|
}
|
|
1452524
1452605
|
}
|
|
1452525
1452606
|
}
|
|
1452526
1452607
|
// Comment end bang state
|
|
1452527
1452608
|
//------------------------------------------------------------------
|
|
1452528
|
-
_stateCommentEndBang(
|
|
1452609
|
+
_stateCommentEndBang(cp10) {
|
|
1452529
1452610
|
const token = this.currentToken;
|
|
1452530
|
-
switch (
|
|
1452611
|
+
switch (cp10) {
|
|
1452531
1452612
|
case CODE_POINTS.HYPHEN_MINUS: {
|
|
1452532
1452613
|
token.data += "--!";
|
|
1452533
1452614
|
this.state = State2.COMMENT_END_DASH;
|
|
@@ -1452548,14 +1452629,14 @@ var Tokenizer = class {
|
|
|
1452548
1452629
|
default: {
|
|
1452549
1452630
|
token.data += "--!";
|
|
1452550
1452631
|
this.state = State2.COMMENT;
|
|
1452551
|
-
this._stateComment(
|
|
1452632
|
+
this._stateComment(cp10);
|
|
1452552
1452633
|
}
|
|
1452553
1452634
|
}
|
|
1452554
1452635
|
}
|
|
1452555
1452636
|
// DOCTYPE state
|
|
1452556
1452637
|
//------------------------------------------------------------------
|
|
1452557
|
-
_stateDoctype(
|
|
1452558
|
-
switch (
|
|
1452638
|
+
_stateDoctype(cp10) {
|
|
1452639
|
+
switch (cp10) {
|
|
1452559
1452640
|
case CODE_POINTS.SPACE:
|
|
1452560
1452641
|
case CODE_POINTS.LINE_FEED:
|
|
1452561
1452642
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452565,7 +1452646,7 @@ var Tokenizer = class {
|
|
|
1452565
1452646
|
}
|
|
1452566
1452647
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1452567
1452648
|
this.state = State2.BEFORE_DOCTYPE_NAME;
|
|
1452568
|
-
this._stateBeforeDoctypeName(
|
|
1452649
|
+
this._stateBeforeDoctypeName(cp10);
|
|
1452569
1452650
|
break;
|
|
1452570
1452651
|
}
|
|
1452571
1452652
|
case CODE_POINTS.EOF: {
|
|
@@ -1452580,18 +1452661,18 @@ var Tokenizer = class {
|
|
|
1452580
1452661
|
default: {
|
|
1452581
1452662
|
this._err(ERR.missingWhitespaceBeforeDoctypeName);
|
|
1452582
1452663
|
this.state = State2.BEFORE_DOCTYPE_NAME;
|
|
1452583
|
-
this._stateBeforeDoctypeName(
|
|
1452664
|
+
this._stateBeforeDoctypeName(cp10);
|
|
1452584
1452665
|
}
|
|
1452585
1452666
|
}
|
|
1452586
1452667
|
}
|
|
1452587
1452668
|
// Before DOCTYPE name state
|
|
1452588
1452669
|
//------------------------------------------------------------------
|
|
1452589
|
-
_stateBeforeDoctypeName(
|
|
1452590
|
-
if (isAsciiUpper(
|
|
1452591
|
-
this._createDoctypeToken(String.fromCharCode(toAsciiLower(
|
|
1452670
|
+
_stateBeforeDoctypeName(cp10) {
|
|
1452671
|
+
if (isAsciiUpper(cp10)) {
|
|
1452672
|
+
this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp10)));
|
|
1452592
1452673
|
this.state = State2.DOCTYPE_NAME;
|
|
1452593
1452674
|
} else
|
|
1452594
|
-
switch (
|
|
1452675
|
+
switch (cp10) {
|
|
1452595
1452676
|
case CODE_POINTS.SPACE:
|
|
1452596
1452677
|
case CODE_POINTS.LINE_FEED:
|
|
1452597
1452678
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452623,16 +1452704,16 @@ var Tokenizer = class {
|
|
|
1452623
1452704
|
break;
|
|
1452624
1452705
|
}
|
|
1452625
1452706
|
default: {
|
|
1452626
|
-
this._createDoctypeToken(String.fromCodePoint(
|
|
1452707
|
+
this._createDoctypeToken(String.fromCodePoint(cp10));
|
|
1452627
1452708
|
this.state = State2.DOCTYPE_NAME;
|
|
1452628
1452709
|
}
|
|
1452629
1452710
|
}
|
|
1452630
1452711
|
}
|
|
1452631
1452712
|
// DOCTYPE name state
|
|
1452632
1452713
|
//------------------------------------------------------------------
|
|
1452633
|
-
_stateDoctypeName(
|
|
1452714
|
+
_stateDoctypeName(cp10) {
|
|
1452634
1452715
|
const token = this.currentToken;
|
|
1452635
|
-
switch (
|
|
1452716
|
+
switch (cp10) {
|
|
1452636
1452717
|
case CODE_POINTS.SPACE:
|
|
1452637
1452718
|
case CODE_POINTS.LINE_FEED:
|
|
1452638
1452719
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452658,15 +1452739,15 @@ var Tokenizer = class {
|
|
|
1452658
1452739
|
break;
|
|
1452659
1452740
|
}
|
|
1452660
1452741
|
default: {
|
|
1452661
|
-
token.name += String.fromCodePoint(isAsciiUpper(
|
|
1452742
|
+
token.name += String.fromCodePoint(isAsciiUpper(cp10) ? toAsciiLower(cp10) : cp10);
|
|
1452662
1452743
|
}
|
|
1452663
1452744
|
}
|
|
1452664
1452745
|
}
|
|
1452665
1452746
|
// After DOCTYPE name state
|
|
1452666
1452747
|
//------------------------------------------------------------------
|
|
1452667
|
-
_stateAfterDoctypeName(
|
|
1452748
|
+
_stateAfterDoctypeName(cp10) {
|
|
1452668
1452749
|
const token = this.currentToken;
|
|
1452669
|
-
switch (
|
|
1452750
|
+
switch (cp10) {
|
|
1452670
1452751
|
case CODE_POINTS.SPACE:
|
|
1452671
1452752
|
case CODE_POINTS.LINE_FEED:
|
|
1452672
1452753
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452694,16 +1452775,16 @@ var Tokenizer = class {
|
|
|
1452694
1452775
|
this._err(ERR.invalidCharacterSequenceAfterDoctypeName);
|
|
1452695
1452776
|
token.forceQuirks = true;
|
|
1452696
1452777
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452697
|
-
this._stateBogusDoctype(
|
|
1452778
|
+
this._stateBogusDoctype(cp10);
|
|
1452698
1452779
|
}
|
|
1452699
1452780
|
}
|
|
1452700
1452781
|
}
|
|
1452701
1452782
|
}
|
|
1452702
1452783
|
// After DOCTYPE public keyword state
|
|
1452703
1452784
|
//------------------------------------------------------------------
|
|
1452704
|
-
_stateAfterDoctypePublicKeyword(
|
|
1452785
|
+
_stateAfterDoctypePublicKeyword(cp10) {
|
|
1452705
1452786
|
const token = this.currentToken;
|
|
1452706
|
-
switch (
|
|
1452787
|
+
switch (cp10) {
|
|
1452707
1452788
|
case CODE_POINTS.SPACE:
|
|
1452708
1452789
|
case CODE_POINTS.LINE_FEED:
|
|
1452709
1452790
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452741,15 +1452822,15 @@ var Tokenizer = class {
|
|
|
1452741
1452822
|
this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
|
|
1452742
1452823
|
token.forceQuirks = true;
|
|
1452743
1452824
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452744
|
-
this._stateBogusDoctype(
|
|
1452825
|
+
this._stateBogusDoctype(cp10);
|
|
1452745
1452826
|
}
|
|
1452746
1452827
|
}
|
|
1452747
1452828
|
}
|
|
1452748
1452829
|
// Before DOCTYPE public identifier state
|
|
1452749
1452830
|
//------------------------------------------------------------------
|
|
1452750
|
-
_stateBeforeDoctypePublicIdentifier(
|
|
1452831
|
+
_stateBeforeDoctypePublicIdentifier(cp10) {
|
|
1452751
1452832
|
const token = this.currentToken;
|
|
1452752
|
-
switch (
|
|
1452833
|
+
switch (cp10) {
|
|
1452753
1452834
|
case CODE_POINTS.SPACE:
|
|
1452754
1452835
|
case CODE_POINTS.LINE_FEED:
|
|
1452755
1452836
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452784,15 +1452865,15 @@ var Tokenizer = class {
|
|
|
1452784
1452865
|
this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
|
|
1452785
1452866
|
token.forceQuirks = true;
|
|
1452786
1452867
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452787
|
-
this._stateBogusDoctype(
|
|
1452868
|
+
this._stateBogusDoctype(cp10);
|
|
1452788
1452869
|
}
|
|
1452789
1452870
|
}
|
|
1452790
1452871
|
}
|
|
1452791
1452872
|
// DOCTYPE public identifier (double-quoted) state
|
|
1452792
1452873
|
//------------------------------------------------------------------
|
|
1452793
|
-
_stateDoctypePublicIdentifierDoubleQuoted(
|
|
1452874
|
+
_stateDoctypePublicIdentifierDoubleQuoted(cp10) {
|
|
1452794
1452875
|
const token = this.currentToken;
|
|
1452795
|
-
switch (
|
|
1452876
|
+
switch (cp10) {
|
|
1452796
1452877
|
case CODE_POINTS.QUOTATION_MARK: {
|
|
1452797
1452878
|
this.state = State2.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
|
|
1452798
1452879
|
break;
|
|
@@ -1452817,15 +1452898,15 @@ var Tokenizer = class {
|
|
|
1452817
1452898
|
break;
|
|
1452818
1452899
|
}
|
|
1452819
1452900
|
default: {
|
|
1452820
|
-
token.publicId += String.fromCodePoint(
|
|
1452901
|
+
token.publicId += String.fromCodePoint(cp10);
|
|
1452821
1452902
|
}
|
|
1452822
1452903
|
}
|
|
1452823
1452904
|
}
|
|
1452824
1452905
|
// DOCTYPE public identifier (single-quoted) state
|
|
1452825
1452906
|
//------------------------------------------------------------------
|
|
1452826
|
-
_stateDoctypePublicIdentifierSingleQuoted(
|
|
1452907
|
+
_stateDoctypePublicIdentifierSingleQuoted(cp10) {
|
|
1452827
1452908
|
const token = this.currentToken;
|
|
1452828
|
-
switch (
|
|
1452909
|
+
switch (cp10) {
|
|
1452829
1452910
|
case CODE_POINTS.APOSTROPHE: {
|
|
1452830
1452911
|
this.state = State2.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
|
|
1452831
1452912
|
break;
|
|
@@ -1452850,15 +1452931,15 @@ var Tokenizer = class {
|
|
|
1452850
1452931
|
break;
|
|
1452851
1452932
|
}
|
|
1452852
1452933
|
default: {
|
|
1452853
|
-
token.publicId += String.fromCodePoint(
|
|
1452934
|
+
token.publicId += String.fromCodePoint(cp10);
|
|
1452854
1452935
|
}
|
|
1452855
1452936
|
}
|
|
1452856
1452937
|
}
|
|
1452857
1452938
|
// After DOCTYPE public identifier state
|
|
1452858
1452939
|
//------------------------------------------------------------------
|
|
1452859
|
-
_stateAfterDoctypePublicIdentifier(
|
|
1452940
|
+
_stateAfterDoctypePublicIdentifier(cp10) {
|
|
1452860
1452941
|
const token = this.currentToken;
|
|
1452861
|
-
switch (
|
|
1452942
|
+
switch (cp10) {
|
|
1452862
1452943
|
case CODE_POINTS.SPACE:
|
|
1452863
1452944
|
case CODE_POINTS.LINE_FEED:
|
|
1452864
1452945
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452894,15 +1452975,15 @@ var Tokenizer = class {
|
|
|
1452894
1452975
|
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1452895
1452976
|
token.forceQuirks = true;
|
|
1452896
1452977
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452897
|
-
this._stateBogusDoctype(
|
|
1452978
|
+
this._stateBogusDoctype(cp10);
|
|
1452898
1452979
|
}
|
|
1452899
1452980
|
}
|
|
1452900
1452981
|
}
|
|
1452901
1452982
|
// Between DOCTYPE public and system identifiers state
|
|
1452902
1452983
|
//------------------------------------------------------------------
|
|
1452903
|
-
_stateBetweenDoctypePublicAndSystemIdentifiers(
|
|
1452984
|
+
_stateBetweenDoctypePublicAndSystemIdentifiers(cp10) {
|
|
1452904
1452985
|
const token = this.currentToken;
|
|
1452905
|
-
switch (
|
|
1452986
|
+
switch (cp10) {
|
|
1452906
1452987
|
case CODE_POINTS.SPACE:
|
|
1452907
1452988
|
case CODE_POINTS.LINE_FEED:
|
|
1452908
1452989
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452935,15 +1453016,15 @@ var Tokenizer = class {
|
|
|
1452935
1453016
|
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1452936
1453017
|
token.forceQuirks = true;
|
|
1452937
1453018
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452938
|
-
this._stateBogusDoctype(
|
|
1453019
|
+
this._stateBogusDoctype(cp10);
|
|
1452939
1453020
|
}
|
|
1452940
1453021
|
}
|
|
1452941
1453022
|
}
|
|
1452942
1453023
|
// After DOCTYPE system keyword state
|
|
1452943
1453024
|
//------------------------------------------------------------------
|
|
1452944
|
-
_stateAfterDoctypeSystemKeyword(
|
|
1453025
|
+
_stateAfterDoctypeSystemKeyword(cp10) {
|
|
1452945
1453026
|
const token = this.currentToken;
|
|
1452946
|
-
switch (
|
|
1453027
|
+
switch (cp10) {
|
|
1452947
1453028
|
case CODE_POINTS.SPACE:
|
|
1452948
1453029
|
case CODE_POINTS.LINE_FEED:
|
|
1452949
1453030
|
case CODE_POINTS.TABULATION:
|
|
@@ -1452981,15 +1453062,15 @@ var Tokenizer = class {
|
|
|
1452981
1453062
|
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1452982
1453063
|
token.forceQuirks = true;
|
|
1452983
1453064
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1452984
|
-
this._stateBogusDoctype(
|
|
1453065
|
+
this._stateBogusDoctype(cp10);
|
|
1452985
1453066
|
}
|
|
1452986
1453067
|
}
|
|
1452987
1453068
|
}
|
|
1452988
1453069
|
// Before DOCTYPE system identifier state
|
|
1452989
1453070
|
//------------------------------------------------------------------
|
|
1452990
|
-
_stateBeforeDoctypeSystemIdentifier(
|
|
1453071
|
+
_stateBeforeDoctypeSystemIdentifier(cp10) {
|
|
1452991
1453072
|
const token = this.currentToken;
|
|
1452992
|
-
switch (
|
|
1453073
|
+
switch (cp10) {
|
|
1452993
1453074
|
case CODE_POINTS.SPACE:
|
|
1452994
1453075
|
case CODE_POINTS.LINE_FEED:
|
|
1452995
1453076
|
case CODE_POINTS.TABULATION:
|
|
@@ -1453024,15 +1453105,15 @@ var Tokenizer = class {
|
|
|
1453024
1453105
|
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
|
|
1453025
1453106
|
token.forceQuirks = true;
|
|
1453026
1453107
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1453027
|
-
this._stateBogusDoctype(
|
|
1453108
|
+
this._stateBogusDoctype(cp10);
|
|
1453028
1453109
|
}
|
|
1453029
1453110
|
}
|
|
1453030
1453111
|
}
|
|
1453031
1453112
|
// DOCTYPE system identifier (double-quoted) state
|
|
1453032
1453113
|
//------------------------------------------------------------------
|
|
1453033
|
-
_stateDoctypeSystemIdentifierDoubleQuoted(
|
|
1453114
|
+
_stateDoctypeSystemIdentifierDoubleQuoted(cp10) {
|
|
1453034
1453115
|
const token = this.currentToken;
|
|
1453035
|
-
switch (
|
|
1453116
|
+
switch (cp10) {
|
|
1453036
1453117
|
case CODE_POINTS.QUOTATION_MARK: {
|
|
1453037
1453118
|
this.state = State2.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
|
|
1453038
1453119
|
break;
|
|
@@ -1453057,15 +1453138,15 @@ var Tokenizer = class {
|
|
|
1453057
1453138
|
break;
|
|
1453058
1453139
|
}
|
|
1453059
1453140
|
default: {
|
|
1453060
|
-
token.systemId += String.fromCodePoint(
|
|
1453141
|
+
token.systemId += String.fromCodePoint(cp10);
|
|
1453061
1453142
|
}
|
|
1453062
1453143
|
}
|
|
1453063
1453144
|
}
|
|
1453064
1453145
|
// DOCTYPE system identifier (single-quoted) state
|
|
1453065
1453146
|
//------------------------------------------------------------------
|
|
1453066
|
-
_stateDoctypeSystemIdentifierSingleQuoted(
|
|
1453147
|
+
_stateDoctypeSystemIdentifierSingleQuoted(cp10) {
|
|
1453067
1453148
|
const token = this.currentToken;
|
|
1453068
|
-
switch (
|
|
1453149
|
+
switch (cp10) {
|
|
1453069
1453150
|
case CODE_POINTS.APOSTROPHE: {
|
|
1453070
1453151
|
this.state = State2.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
|
|
1453071
1453152
|
break;
|
|
@@ -1453090,15 +1453171,15 @@ var Tokenizer = class {
|
|
|
1453090
1453171
|
break;
|
|
1453091
1453172
|
}
|
|
1453092
1453173
|
default: {
|
|
1453093
|
-
token.systemId += String.fromCodePoint(
|
|
1453174
|
+
token.systemId += String.fromCodePoint(cp10);
|
|
1453094
1453175
|
}
|
|
1453095
1453176
|
}
|
|
1453096
1453177
|
}
|
|
1453097
1453178
|
// After DOCTYPE system identifier state
|
|
1453098
1453179
|
//------------------------------------------------------------------
|
|
1453099
|
-
_stateAfterDoctypeSystemIdentifier(
|
|
1453180
|
+
_stateAfterDoctypeSystemIdentifier(cp10) {
|
|
1453100
1453181
|
const token = this.currentToken;
|
|
1453101
|
-
switch (
|
|
1453182
|
+
switch (cp10) {
|
|
1453102
1453183
|
case CODE_POINTS.SPACE:
|
|
1453103
1453184
|
case CODE_POINTS.LINE_FEED:
|
|
1453104
1453185
|
case CODE_POINTS.TABULATION:
|
|
@@ -1453120,15 +1453201,15 @@ var Tokenizer = class {
|
|
|
1453120
1453201
|
default: {
|
|
1453121
1453202
|
this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);
|
|
1453122
1453203
|
this.state = State2.BOGUS_DOCTYPE;
|
|
1453123
|
-
this._stateBogusDoctype(
|
|
1453204
|
+
this._stateBogusDoctype(cp10);
|
|
1453124
1453205
|
}
|
|
1453125
1453206
|
}
|
|
1453126
1453207
|
}
|
|
1453127
1453208
|
// Bogus DOCTYPE state
|
|
1453128
1453209
|
//------------------------------------------------------------------
|
|
1453129
|
-
_stateBogusDoctype(
|
|
1453210
|
+
_stateBogusDoctype(cp10) {
|
|
1453130
1453211
|
const token = this.currentToken;
|
|
1453131
|
-
switch (
|
|
1453212
|
+
switch (cp10) {
|
|
1453132
1453213
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1453133
1453214
|
this.emitCurrentDoctype(token);
|
|
1453134
1453215
|
this.state = State2.DATA;
|
|
@@ -1453148,8 +1453229,8 @@ var Tokenizer = class {
|
|
|
1453148
1453229
|
}
|
|
1453149
1453230
|
// CDATA section state
|
|
1453150
1453231
|
//------------------------------------------------------------------
|
|
1453151
|
-
_stateCdataSection(
|
|
1453152
|
-
switch (
|
|
1453232
|
+
_stateCdataSection(cp10) {
|
|
1453233
|
+
switch (cp10) {
|
|
1453153
1453234
|
case CODE_POINTS.RIGHT_SQUARE_BRACKET: {
|
|
1453154
1453235
|
this.state = State2.CDATA_SECTION_BRACKET;
|
|
1453155
1453236
|
break;
|
|
@@ -1453160,25 +1453241,25 @@ var Tokenizer = class {
|
|
|
1453160
1453241
|
break;
|
|
1453161
1453242
|
}
|
|
1453162
1453243
|
default: {
|
|
1453163
|
-
this._emitCodePoint(
|
|
1453244
|
+
this._emitCodePoint(cp10);
|
|
1453164
1453245
|
}
|
|
1453165
1453246
|
}
|
|
1453166
1453247
|
}
|
|
1453167
1453248
|
// CDATA section bracket state
|
|
1453168
1453249
|
//------------------------------------------------------------------
|
|
1453169
|
-
_stateCdataSectionBracket(
|
|
1453170
|
-
if (
|
|
1453250
|
+
_stateCdataSectionBracket(cp10) {
|
|
1453251
|
+
if (cp10 === CODE_POINTS.RIGHT_SQUARE_BRACKET) {
|
|
1453171
1453252
|
this.state = State2.CDATA_SECTION_END;
|
|
1453172
1453253
|
} else {
|
|
1453173
1453254
|
this._emitChars("]");
|
|
1453174
1453255
|
this.state = State2.CDATA_SECTION;
|
|
1453175
|
-
this._stateCdataSection(
|
|
1453256
|
+
this._stateCdataSection(cp10);
|
|
1453176
1453257
|
}
|
|
1453177
1453258
|
}
|
|
1453178
1453259
|
// CDATA section end state
|
|
1453179
1453260
|
//------------------------------------------------------------------
|
|
1453180
|
-
_stateCdataSectionEnd(
|
|
1453181
|
-
switch (
|
|
1453261
|
+
_stateCdataSectionEnd(cp10) {
|
|
1453262
|
+
switch (cp10) {
|
|
1453182
1453263
|
case CODE_POINTS.GREATER_THAN_SIGN: {
|
|
1453183
1453264
|
this.state = State2.DATA;
|
|
1453184
1453265
|
break;
|
|
@@ -1453190,7 +1453271,7 @@ var Tokenizer = class {
|
|
|
1453190
1453271
|
default: {
|
|
1453191
1453272
|
this._emitChars("]]");
|
|
1453192
1453273
|
this.state = State2.CDATA_SECTION;
|
|
1453193
|
-
this._stateCdataSection(
|
|
1453274
|
+
this._stateCdataSection(cp10);
|
|
1453194
1453275
|
}
|
|
1453195
1453276
|
}
|
|
1453196
1453277
|
}
|
|
@@ -1453219,15 +1453300,15 @@ var Tokenizer = class {
|
|
|
1453219
1453300
|
}
|
|
1453220
1453301
|
// Ambiguos ampersand state
|
|
1453221
1453302
|
//------------------------------------------------------------------
|
|
1453222
|
-
_stateAmbiguousAmpersand(
|
|
1453223
|
-
if (isAsciiAlphaNumeric2(
|
|
1453224
|
-
this._flushCodePointConsumedAsCharacterReference(
|
|
1453303
|
+
_stateAmbiguousAmpersand(cp10) {
|
|
1453304
|
+
if (isAsciiAlphaNumeric2(cp10)) {
|
|
1453305
|
+
this._flushCodePointConsumedAsCharacterReference(cp10);
|
|
1453225
1453306
|
} else {
|
|
1453226
|
-
if (
|
|
1453307
|
+
if (cp10 === CODE_POINTS.SEMICOLON) {
|
|
1453227
1453308
|
this._err(ERR.unknownNamedCharacterReference);
|
|
1453228
1453309
|
}
|
|
1453229
1453310
|
this.state = this.returnState;
|
|
1453230
|
-
this._callState(
|
|
1453311
|
+
this._callState(cp10);
|
|
1453231
1453312
|
}
|
|
1453232
1453313
|
}
|
|
1453233
1453314
|
};
|
|
@@ -1499477,7 +1499558,7 @@ var CliContext = class {
|
|
|
1499477
1499558
|
if (false) {
|
|
1499478
1499559
|
this.logger.error("CLI_VERSION is not defined");
|
|
1499479
1499560
|
}
|
|
1499480
|
-
return "3.44.
|
|
1499561
|
+
return "3.44.1-2-g8d6db0b72a";
|
|
1499481
1499562
|
}
|
|
1499482
1499563
|
getCliName() {
|
|
1499483
1499564
|
if (false) {
|
|
@@ -1543972,7 +1544053,7 @@ var OpenRPCConverterContext3_1 = class extends AbstractConverterContext {
|
|
|
1543972
1544053
|
};
|
|
1543973
1544054
|
|
|
1543974
1544055
|
// ../workspace/lazy-fern-workspace/lib/OSSWorkspace.js
|
|
1543975
|
-
var
|
|
1544056
|
+
var import_promises48 = require("fs/promises");
|
|
1543976
1544057
|
|
|
1543977
1544058
|
// ../../commons/casings-generator/src/reserved.ts
|
|
1543978
1544059
|
var RESERVED_KEYWORDS2 = {
|
|
@@ -1544788,60 +1544869,45 @@ function createLoggingExecutable(executable, { logger, ...loggingExecaOptions }
|
|
|
1544788
1544869
|
}
|
|
1544789
1544870
|
|
|
1544790
1544871
|
// ../workspace/lazy-fern-workspace/lib/protobuf/ProtobufIRGenerator.js
|
|
1544791
|
-
var
|
|
1544872
|
+
var import_promises46 = require("fs/promises");
|
|
1544792
1544873
|
var import_path32 = __toESM(require("path"), 1);
|
|
1544793
1544874
|
var import_tmp_promise7 = __toESM(require_tmp_promise(), 1);
|
|
1544794
1544875
|
|
|
1544795
1544876
|
// ../workspace/lazy-fern-workspace/lib/protobuf/utils.js
|
|
1544796
|
-
var import_promises46 = require("fs/promises");
|
|
1544797
1544877
|
var import_tmp_promise6 = __toESM(require_tmp_promise(), 1);
|
|
1544798
1544878
|
function isNetworkError(errorMessage) {
|
|
1544799
|
-
return errorMessage.includes("server hosted at that remote is unavailable") || errorMessage.includes("failed to connect") || errorMessage.includes("network") || errorMessage.includes("ENOTFOUND") || errorMessage.includes("ETIMEDOUT") || errorMessage.includes("TIMEDOUT") || errorMessage.includes("timed out");
|
|
1544879
|
+
return errorMessage.includes("server hosted at that remote is unavailable") || errorMessage.includes("fetch failed") || errorMessage.includes("failed to connect") || errorMessage.includes("network") || errorMessage.includes("ENOTFOUND") || errorMessage.includes("ETIMEDOUT") || errorMessage.includes("TIMEDOUT") || errorMessage.includes("timed out") || errorMessage.includes("ECONNREFUSED") || errorMessage.includes("ECONNRESET") || errorMessage.includes("socket hang up");
|
|
1544800
1544880
|
}
|
|
1544801
|
-
|
|
1544802
|
-
|
|
1544803
|
-
|
|
1544804
|
-
|
|
1544805
|
-
|
|
1544806
|
-
bufLockExists = true;
|
|
1544807
|
-
logger.debug(`Found buf.lock at: ${bufLockPath}`);
|
|
1544808
|
-
} catch {
|
|
1544809
|
-
logger.debug(`No buf.lock found at: ${bufLockPath}`);
|
|
1544881
|
+
var airGapDetectionResult;
|
|
1544882
|
+
var airGapDetectionPromise;
|
|
1544883
|
+
async function detectAirGappedMode(url2, logger, timeoutMs = 5e3) {
|
|
1544884
|
+
if (airGapDetectionResult !== void 0) {
|
|
1544885
|
+
return airGapDetectionResult;
|
|
1544810
1544886
|
}
|
|
1544811
|
-
if (
|
|
1544812
|
-
|
|
1544887
|
+
if (airGapDetectionPromise == null) {
|
|
1544888
|
+
airGapDetectionPromise = performAirGapDetection(url2, logger, timeoutMs);
|
|
1544813
1544889
|
}
|
|
1544814
|
-
|
|
1544890
|
+
return airGapDetectionPromise;
|
|
1544891
|
+
}
|
|
1544892
|
+
async function performAirGapDetection(url2, logger, timeoutMs) {
|
|
1544893
|
+
logger.debug(`Detecting air-gapped mode by checking connectivity to ${url2}`);
|
|
1544815
1544894
|
try {
|
|
1544816
|
-
|
|
1544817
|
-
|
|
1544818
|
-
|
|
1544819
|
-
|
|
1544820
|
-
|
|
1544821
|
-
|
|
1544822
|
-
|
|
1544823
|
-
|
|
1544824
|
-
|
|
1544825
|
-
|
|
1544826
|
-
|
|
1544827
|
-
|
|
1544828
|
-
|
|
1544829
|
-
});
|
|
1544830
|
-
logger.debug("Network check succeeded - not in air-gapped mode");
|
|
1544831
|
-
return false;
|
|
1544832
|
-
} catch (error2) {
|
|
1544833
|
-
const errorMessage = error2 instanceof Error ? error2.message : String(error2);
|
|
1544834
|
-
if (isNetworkError(errorMessage)) {
|
|
1544835
|
-
logger.debug(`Network check failed - entering air-gapped mode: ${errorMessage.substring(0, 100)}`);
|
|
1544836
|
-
return true;
|
|
1544837
|
-
}
|
|
1544838
|
-
return false;
|
|
1544839
|
-
}
|
|
1544840
|
-
} finally {
|
|
1544841
|
-
try {
|
|
1544842
|
-
await (0, import_promises46.rm)(tmpDir, { recursive: true, force: true });
|
|
1544843
|
-
} catch {
|
|
1544895
|
+
await fetch(url2, {
|
|
1544896
|
+
method: "GET",
|
|
1544897
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
1544898
|
+
});
|
|
1544899
|
+
airGapDetectionResult = false;
|
|
1544900
|
+
logger.debug("Network check succeeded - not in air-gapped mode");
|
|
1544901
|
+
return false;
|
|
1544902
|
+
} catch (error2) {
|
|
1544903
|
+
const errorMessage = error2 instanceof Error ? error2.message : String(error2);
|
|
1544904
|
+
if (isNetworkError(errorMessage)) {
|
|
1544905
|
+
airGapDetectionResult = true;
|
|
1544906
|
+
logger.debug(`Network check failed - entering air-gapped mode: ${errorMessage}`);
|
|
1544907
|
+
return true;
|
|
1544844
1544908
|
}
|
|
1544909
|
+
airGapDetectionResult = false;
|
|
1544910
|
+
return false;
|
|
1544845
1544911
|
}
|
|
1544846
1544912
|
}
|
|
1544847
1544913
|
var PROTOBUF_GENERATOR_CONFIG_FILENAME = "buf.gen.yaml";
|
|
@@ -1544959,7 +1545025,7 @@ var ProtobufIRGenerator = class {
|
|
|
1544959
1545025
|
this.context.logger.info(`Using buf export with version: ${version6}`);
|
|
1544960
1545026
|
const tmpBufConfigFile = await import_tmp_promise7.default.file({ postfix: ".yaml" });
|
|
1544961
1545027
|
const configContent = version6 === "v1" ? PROTOBUF_EXPORT_CONFIG_V1 : PROTOBUF_EXPORT_CONFIG_V2;
|
|
1544962
|
-
await (0,
|
|
1545028
|
+
await (0, import_promises46.writeFile)(tmpBufConfigFile.path, configContent, "utf8");
|
|
1544963
1545029
|
try {
|
|
1544964
1545030
|
const result = await runExeca(this.context.logger, "buf", [
|
|
1544965
1545031
|
"export",
|
|
@@ -1544988,7 +1545054,7 @@ var ProtobufIRGenerator = class {
|
|
|
1544988
1545054
|
}
|
|
1544989
1545055
|
}
|
|
1544990
1545056
|
async copyProtobufFilesFromRoot({ protobufGeneratorConfigPath, absoluteFilepathToProtobufRoot }) {
|
|
1544991
|
-
await (0,
|
|
1545057
|
+
await (0, import_promises46.cp)(absoluteFilepathToProtobufRoot, protobufGeneratorConfigPath, {
|
|
1544992
1545058
|
recursive: true,
|
|
1544993
1545059
|
filter: (src) => {
|
|
1544994
1545060
|
const basename5 = import_path32.default.basename(src);
|
|
@@ -1544997,7 +1545063,7 @@ var ProtobufIRGenerator = class {
|
|
|
1544997
1545063
|
});
|
|
1544998
1545064
|
}
|
|
1544999
1545065
|
async setupRemainingProtobufConfig({ protobufGeneratorConfigPath }) {
|
|
1545000
|
-
await (0,
|
|
1545066
|
+
await (0, import_promises46.writeFile)(join2(protobufGeneratorConfigPath, RelativeFilePath2.of("package.json")), PROTOBUF_MODULE_PACKAGE_JSON);
|
|
1545001
1545067
|
await runExeca(void 0, "npm", ["install"], {
|
|
1545002
1545068
|
cwd: protobufGeneratorConfigPath,
|
|
1545003
1545069
|
stdout: "ignore",
|
|
@@ -1545008,10 +1545074,10 @@ var ProtobufIRGenerator = class {
|
|
|
1545008
1545074
|
stdout: "ignore",
|
|
1545009
1545075
|
stderr: "pipe"
|
|
1545010
1545076
|
});
|
|
1545011
|
-
await (0,
|
|
1545077
|
+
await (0, import_promises46.writeFile)(join2(protobufGeneratorConfigPath, RelativeFilePath2.of(PROTOBUF_GENERATOR_CONFIG_FILENAME)), PROTOBUF_GEN_CONFIG);
|
|
1545012
1545078
|
const shellProxyPath = join2(protobufGeneratorConfigPath, RelativeFilePath2.of(PROTOBUF_SHELL_PROXY_FILENAME));
|
|
1545013
|
-
await (0,
|
|
1545014
|
-
await (0,
|
|
1545079
|
+
await (0, import_promises46.writeFile)(shellProxyPath, PROTOBUF_SHELL_PROXY);
|
|
1545080
|
+
await (0, import_promises46.chmod)(shellProxyPath, 493);
|
|
1545015
1545081
|
}
|
|
1545016
1545082
|
async doGenerateLocal({ cwd: cwd2, deps }) {
|
|
1545017
1545083
|
const which = createLoggingExecutable("which", {
|
|
@@ -1545033,13 +1545099,13 @@ var ProtobufIRGenerator = class {
|
|
|
1545033
1545099
|
stderr: "pipe"
|
|
1545034
1545100
|
});
|
|
1545035
1545101
|
try {
|
|
1545036
|
-
await (0,
|
|
1545102
|
+
await (0, import_promises46.writeFile)(bufYamlPath, configContent);
|
|
1545037
1545103
|
if (deps.length > 0) {
|
|
1545038
1545104
|
if (this.isAirGapped) {
|
|
1545039
1545105
|
this.context.logger.debug("Air-gapped mode: skipping buf dep update");
|
|
1545040
1545106
|
const bufLockPath = join2(cwd2, RelativeFilePath2.of("buf.lock"));
|
|
1545041
1545107
|
try {
|
|
1545042
|
-
await (0,
|
|
1545108
|
+
await (0, import_promises46.access)(bufLockPath);
|
|
1545043
1545109
|
} catch {
|
|
1545044
1545110
|
this.context.failAndThrow("Air-gapped mode requires a pre-cached buf.lock file. Please run 'buf dep update' at build time to cache dependencies.");
|
|
1545045
1545111
|
}
|
|
@@ -1545051,9 +1545117,9 @@ var ProtobufIRGenerator = class {
|
|
|
1545051
1545117
|
if (bufGenerateResult.exitCode !== 0) {
|
|
1545052
1545118
|
this.context.failAndThrow(bufGenerateResult.stderr);
|
|
1545053
1545119
|
}
|
|
1545054
|
-
await (0,
|
|
1545120
|
+
await (0, import_promises46.unlink)(bufYamlPath);
|
|
1545055
1545121
|
} catch (error2) {
|
|
1545056
|
-
await (0,
|
|
1545122
|
+
await (0, import_promises46.unlink)(bufYamlPath);
|
|
1545057
1545123
|
throw error2;
|
|
1545058
1545124
|
}
|
|
1545059
1545125
|
return join2(cwd2, RelativeFilePath2.of(PROTOBUF_GENERATOR_OUTPUT_FILEPATH));
|
|
@@ -1545064,7 +1545130,7 @@ var ProtobufIRGenerator = class {
|
|
|
1545064
1545130
|
};
|
|
1545065
1545131
|
|
|
1545066
1545132
|
// ../workspace/lazy-fern-workspace/lib/protobuf/ProtobufOpenAPIGenerator.js
|
|
1545067
|
-
var
|
|
1545133
|
+
var import_promises47 = require("fs/promises");
|
|
1545068
1545134
|
var import_tmp_promise8 = __toESM(require_tmp_promise(), 1);
|
|
1545069
1545135
|
var PROTOBUF_GENERATOR_CONFIG_FILENAME2 = "buf.gen.yaml";
|
|
1545070
1545136
|
var PROTOBUF_GENERATOR_OUTPUT_PATH2 = "output";
|
|
@@ -1545105,8 +1545171,8 @@ var ProtobufOpenAPIGenerator = class {
|
|
|
1545105
1545171
|
}
|
|
1545106
1545172
|
async setupProtobufGeneratorConfig({ absoluteFilepathToProtobufRoot, relativeFilepathToProtobufRoot }) {
|
|
1545107
1545173
|
const protobufGeneratorConfigPath = AbsoluteFilePath2.of((await import_tmp_promise8.default.dir()).path);
|
|
1545108
|
-
await (0,
|
|
1545109
|
-
await (0,
|
|
1545174
|
+
await (0, import_promises47.cp)(absoluteFilepathToProtobufRoot, protobufGeneratorConfigPath, { recursive: true });
|
|
1545175
|
+
await (0, import_promises47.writeFile)(join2(protobufGeneratorConfigPath, RelativeFilePath2.of(PROTOBUF_GENERATOR_CONFIG_FILENAME2)), getProtobufGeneratorConfig({ relativeFilepathToProtobufRoot }));
|
|
1545110
1545176
|
return protobufGeneratorConfigPath;
|
|
1545111
1545177
|
}
|
|
1545112
1545178
|
async doGenerateLocal({ cwd: cwd2, target, deps, existingBufLockContents }) {
|
|
@@ -1545137,15 +1545203,15 @@ var ProtobufOpenAPIGenerator = class {
|
|
|
1545137
1545203
|
stderr: "pipe"
|
|
1545138
1545204
|
});
|
|
1545139
1545205
|
try {
|
|
1545140
|
-
await (0,
|
|
1545206
|
+
await (0, import_promises47.writeFile)(bufYamlPath, configContent);
|
|
1545141
1545207
|
if (existingBufLockContents != null) {
|
|
1545142
|
-
await (0,
|
|
1545208
|
+
await (0, import_promises47.writeFile)(bufLockPath, existingBufLockContents);
|
|
1545143
1545209
|
cleanupBufLock = true;
|
|
1545144
1545210
|
} else if (deps.length > 0) {
|
|
1545145
1545211
|
if (this.isAirGapped) {
|
|
1545146
1545212
|
this.context.logger.debug("Air-gapped mode: skipping buf dep update");
|
|
1545147
1545213
|
try {
|
|
1545148
|
-
await (0,
|
|
1545214
|
+
await (0, import_promises47.access)(bufLockPath);
|
|
1545149
1545215
|
} catch {
|
|
1545150
1545216
|
this.context.failAndThrow("Air-gapped mode requires a pre-cached buf.lock file. Please run 'buf dep update' at build time to cache dependencies.");
|
|
1545151
1545217
|
}
|
|
@@ -1545153,7 +1545219,7 @@ var ProtobufOpenAPIGenerator = class {
|
|
|
1545153
1545219
|
await buf(["dep", "update"]);
|
|
1545154
1545220
|
}
|
|
1545155
1545221
|
try {
|
|
1545156
|
-
bufLockContents = await (0,
|
|
1545222
|
+
bufLockContents = await (0, import_promises47.readFile)(bufLockPath, "utf-8");
|
|
1545157
1545223
|
} catch {
|
|
1545158
1545224
|
bufLockContents = void 0;
|
|
1545159
1545225
|
}
|
|
@@ -1545163,14 +1545229,14 @@ var ProtobufOpenAPIGenerator = class {
|
|
|
1545163
1545229
|
this.context.failAndThrow(bufGenerateResult.stderr);
|
|
1545164
1545230
|
}
|
|
1545165
1545231
|
if (cleanupBufLock) {
|
|
1545166
|
-
await (0,
|
|
1545232
|
+
await (0, import_promises47.unlink)(bufLockPath);
|
|
1545167
1545233
|
}
|
|
1545168
|
-
await (0,
|
|
1545234
|
+
await (0, import_promises47.unlink)(bufYamlPath);
|
|
1545169
1545235
|
} catch (error2) {
|
|
1545170
1545236
|
if (cleanupBufLock) {
|
|
1545171
|
-
await (0,
|
|
1545237
|
+
await (0, import_promises47.unlink)(bufLockPath);
|
|
1545172
1545238
|
}
|
|
1545173
|
-
await (0,
|
|
1545239
|
+
await (0, import_promises47.unlink)(bufYamlPath);
|
|
1545174
1545240
|
throw error2;
|
|
1545175
1545241
|
}
|
|
1545176
1545242
|
return {
|
|
@@ -1545470,7 +1545536,7 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
|
|
|
1545470
1545536
|
local: true,
|
|
1545471
1545537
|
deps: spec.dependencies
|
|
1545472
1545538
|
});
|
|
1545473
|
-
const result = await (0,
|
|
1545539
|
+
const result = await (0, import_promises48.readFile)(protobufIRFilepath, "utf-8");
|
|
1545474
1545540
|
const casingsGenerator = constructCasingsGenerator2({
|
|
1545475
1545541
|
generationLanguage: "typescript",
|
|
1545476
1545542
|
keywords: void 0,
|
|
@@ -1545727,7 +1545793,7 @@ function parseIssue(issue) {
|
|
|
1545727
1545793
|
}
|
|
1545728
1545794
|
|
|
1545729
1545795
|
// ../workspace/loader/lib/listFernFiles.js
|
|
1545730
|
-
var
|
|
1545796
|
+
var import_promises49 = require("fs/promises");
|
|
1545731
1545797
|
async function listFernFiles2(root6, extensionGlob) {
|
|
1545732
1545798
|
const files = [];
|
|
1545733
1545799
|
for (const absoluteFilepath of await listFiles(root6, extensionGlob)) {
|
|
@@ -1545742,7 +1545808,7 @@ async function createFernFile2({ relativeFilepath, absoluteFilepath }) {
|
|
|
1545742
1545808
|
return {
|
|
1545743
1545809
|
relativeFilepath,
|
|
1545744
1545810
|
absoluteFilepath,
|
|
1545745
|
-
fileContents: (await (0,
|
|
1545811
|
+
fileContents: (await (0, import_promises49.readFile)(absoluteFilepath)).toString()
|
|
1545746
1545812
|
};
|
|
1545747
1545813
|
}
|
|
1545748
1545814
|
|
|
@@ -1545994,7 +1546060,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context: context2, cl
|
|
|
1545994
1546060
|
}
|
|
1545995
1546061
|
|
|
1545996
1546062
|
// ../workspace/loader/lib/loadDocsWorkspace.js
|
|
1545997
|
-
var
|
|
1546063
|
+
var import_promises50 = require("fs/promises");
|
|
1545998
1546064
|
|
|
1545999
1546065
|
// ../workspace/loader/lib/docs-yml.schema.json
|
|
1546000
1546066
|
var docs_yml_schema_exports = {};
|
|
@@ -1551155,7 +1551221,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context: co
|
|
|
1551155
1551221
|
});
|
|
1551156
1551222
|
}
|
|
1551157
1551223
|
async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context: context2 }) {
|
|
1551158
|
-
const contentsStr = await (0,
|
|
1551224
|
+
const contentsStr = await (0, import_promises50.readFile)(absolutePathOfConfiguration);
|
|
1551159
1551225
|
const contentsJson = jsYaml.load(contentsStr.toString());
|
|
1551160
1551226
|
const result = validateAgainstJsonSchema(contentsJson, docs_yml_schema_exports, {
|
|
1551161
1551227
|
filePath: absolutePathOfConfiguration
|
|
@@ -1551184,7 +1551250,7 @@ ${result.error?.message ?? "Unknown error"}`);
|
|
|
1551184
1551250
|
}
|
|
1551185
1551251
|
|
|
1551186
1551252
|
// ../project-loader/lib/loadProject.js
|
|
1551187
|
-
var
|
|
1551253
|
+
var import_promises51 = require("fs/promises");
|
|
1551188
1551254
|
async function loadProject({ context: context2, nameOverride, ...args }) {
|
|
1551189
1551255
|
const fernDirectory = await getFernDirectory(nameOverride);
|
|
1551190
1551256
|
if (fernDirectory == null) {
|
|
@@ -1551239,7 +1551305,7 @@ async function loadApis({ cliName, fernDirectory, context: context2, cliVersion,
|
|
|
1551239
1551305
|
const apisDirectory = join2(fernDirectory, RelativeFilePath2.of(APIS_DIRECTORY));
|
|
1551240
1551306
|
const apisDirectoryExists = await doesPathExist(apisDirectory);
|
|
1551241
1551307
|
if (apisDirectoryExists) {
|
|
1551242
|
-
const apiDirectoryContents = await (0,
|
|
1551308
|
+
const apiDirectoryContents = await (0, import_promises51.readdir)(apisDirectory, { withFileTypes: true });
|
|
1551243
1551309
|
const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all9, item) => {
|
|
1551244
1551310
|
if (item.isDirectory()) {
|
|
1551245
1551311
|
all9.push(item.name);
|
|
@@ -1551316,10 +1551382,10 @@ async function loadProjectAndRegisterWorkspacesWithContext(cliContext, args, reg
|
|
|
1551316
1551382
|
|
|
1551317
1551383
|
// src/cliV2.ts
|
|
1551318
1551384
|
var import_generators_sdk4 = __toESM(require_generators_sdk(), 1);
|
|
1551319
|
-
var
|
|
1551385
|
+
var import_promises56 = require("fs/promises");
|
|
1551320
1551386
|
|
|
1551321
1551387
|
// src/commands/generator-list/getGeneratorList.ts
|
|
1551322
|
-
var
|
|
1551388
|
+
var import_promises52 = require("fs/promises");
|
|
1551323
1551389
|
var GenerationModeFilter = {
|
|
1551324
1551390
|
GitHub: "github",
|
|
1551325
1551391
|
Local: "local-file-system",
|
|
@@ -1551379,7 +1551445,7 @@ async function getGeneratorList({
|
|
|
1551379
1551445
|
return;
|
|
1551380
1551446
|
}
|
|
1551381
1551447
|
try {
|
|
1551382
|
-
await (0,
|
|
1551448
|
+
await (0, import_promises52.writeFile)(outputLocation, generatorsListYaml);
|
|
1551383
1551449
|
} catch (error2) {
|
|
1551384
1551450
|
cliContext.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error2);
|
|
1551385
1551451
|
}
|
|
@@ -1551445,7 +1551511,7 @@ async function getGeneratorMetadata({
|
|
|
1551445
1551511
|
}
|
|
1551446
1551512
|
|
|
1551447
1551513
|
// src/commands/organization/getOrganization.ts
|
|
1551448
|
-
var
|
|
1551514
|
+
var import_promises53 = require("fs/promises");
|
|
1551449
1551515
|
async function getOrganization({
|
|
1551450
1551516
|
project,
|
|
1551451
1551517
|
outputLocation,
|
|
@@ -1551457,20 +1551523,20 @@ async function getOrganization({
|
|
|
1551457
1551523
|
return;
|
|
1551458
1551524
|
}
|
|
1551459
1551525
|
try {
|
|
1551460
|
-
await (0,
|
|
1551526
|
+
await (0, import_promises53.writeFile)(outputLocation, org);
|
|
1551461
1551527
|
} catch (error2) {
|
|
1551462
1551528
|
context2.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error2);
|
|
1551463
1551529
|
}
|
|
1551464
1551530
|
}
|
|
1551465
1551531
|
|
|
1551466
1551532
|
// src/commands/upgrade/upgradeGenerator.ts
|
|
1551467
|
-
var
|
|
1551533
|
+
var import_promises55 = require("fs/promises");
|
|
1551468
1551534
|
var import_path34 = __toESM(require("path"), 1);
|
|
1551469
1551535
|
var import_semver8 = __toESM(require_semver2(), 1);
|
|
1551470
1551536
|
var import_yaml = __toESM(require_dist4(), 1);
|
|
1551471
1551537
|
|
|
1551472
1551538
|
// src/commands/upgrade/migrations/loader.ts
|
|
1551473
|
-
var
|
|
1551539
|
+
var import_promises54 = require("fs/promises");
|
|
1551474
1551540
|
var import_os4 = require("os");
|
|
1551475
1551541
|
var import_path33 = require("path");
|
|
1551476
1551542
|
var import_semver7 = __toESM(require_semver2(), 1);
|
|
@@ -1551481,7 +1551547,7 @@ function getMigrationCacheDir() {
|
|
|
1551481
1551547
|
async function loadMigrationModule(params2) {
|
|
1551482
1551548
|
const { generatorName, logger } = params2;
|
|
1551483
1551549
|
const cacheDir = getMigrationCacheDir();
|
|
1551484
|
-
await (0,
|
|
1551550
|
+
await (0, import_promises54.mkdir)(cacheDir, { recursive: true });
|
|
1551485
1551551
|
try {
|
|
1551486
1551552
|
await loggingExeca(logger, "npm", [
|
|
1551487
1551553
|
"install",
|
|
@@ -1551494,7 +1551560,7 @@ async function loadMigrationModule(params2) {
|
|
|
1551494
1551560
|
]);
|
|
1551495
1551561
|
const packageDir = (0, import_path33.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME);
|
|
1551496
1551562
|
const packageJsonPath = (0, import_path33.join)(packageDir, "package.json");
|
|
1551497
|
-
const packageJsonContent = await (0,
|
|
1551563
|
+
const packageJsonContent = await (0, import_promises54.readFile)(packageJsonPath, "utf-8");
|
|
1551498
1551564
|
const packageJson2 = JSON.parse(packageJsonContent);
|
|
1551499
1551565
|
if (packageJson2.main == null) {
|
|
1551500
1551566
|
throw new Error(`No main field found in package.json for ${MIGRATION_PACKAGE_NAME}`);
|
|
@@ -1551645,7 +1551711,7 @@ async function loadAndUpdateGenerators({
|
|
|
1551645
1551711
|
context2.logger.debug("Generators configuration file was not found, no generators to upgrade.");
|
|
1551646
1551712
|
return { updatedConfiguration: void 0, skippedMajorUpgrades: [], appliedUpgrades: [], alreadyUpToDate: [] };
|
|
1551647
1551713
|
}
|
|
1551648
|
-
const contents = await (0,
|
|
1551714
|
+
const contents = await (0, import_promises55.readFile)(filepath);
|
|
1551649
1551715
|
context2.logger.debug(`Found generators: ${contents.toString()}`);
|
|
1551650
1551716
|
const parsedDocument = import_yaml.default.parseDocument(contents.toString());
|
|
1551651
1551717
|
const generatorGroups = parsedDocument.get("groups");
|
|
@@ -1551826,7 +1551892,7 @@ async function upgradeGenerator({
|
|
|
1551826
1551892
|
absolutePathToWorkspace: workspace.absoluteFilePath
|
|
1551827
1551893
|
});
|
|
1551828
1551894
|
if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
|
|
1551829
|
-
await (0,
|
|
1551895
|
+
await (0, import_promises55.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
|
|
1551830
1551896
|
}
|
|
1551831
1551897
|
allSkippedMajorUpgrades.push(...result.skippedMajorUpgrades);
|
|
1551832
1551898
|
if (result.appliedUpgrades.length > 0) {
|
|
@@ -1552180,7 +1552246,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
1552180
1552246
|
}
|
|
1552181
1552247
|
if (argv.output) {
|
|
1552182
1552248
|
try {
|
|
1552183
|
-
await (0,
|
|
1552249
|
+
await (0, import_promises56.writeFile)(argv.output, JSON.stringify(generatorMetadata, null, 2));
|
|
1552184
1552250
|
} catch (error2) {
|
|
1552185
1552251
|
cliContext.failAndThrow(
|
|
1552186
1552252
|
`Could not write file to the specified location: ${argv.output}`,
|
|
@@ -1552194,7 +1552260,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
1552194
1552260
|
}
|
|
1552195
1552261
|
|
|
1552196
1552262
|
// src/commands/add-generator/addGeneratorToWorkspaces.ts
|
|
1552197
|
-
var
|
|
1552263
|
+
var import_promises57 = require("fs/promises");
|
|
1552198
1552264
|
async function addGeneratorToWorkspaces({
|
|
1552199
1552265
|
project: { apiWorkspaces },
|
|
1552200
1552266
|
generatorName,
|
|
@@ -1552221,7 +1552287,7 @@ async function addGeneratorToWorkspaces({
|
|
|
1552221
1552287
|
if (absolutePathToGeneratorsConfiguration == null) {
|
|
1552222
1552288
|
return;
|
|
1552223
1552289
|
}
|
|
1552224
|
-
await (0,
|
|
1552290
|
+
await (0, import_promises57.writeFile)(
|
|
1552225
1552291
|
absolutePathToGeneratorsConfiguration,
|
|
1552226
1552292
|
"# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + jsYaml.dump(newConfiguration)
|
|
1552227
1552293
|
);
|
|
@@ -1552232,7 +1552298,7 @@ async function addGeneratorToWorkspaces({
|
|
|
1552232
1552298
|
}
|
|
1552233
1552299
|
|
|
1552234
1552300
|
// src/commands/diff/diff.ts
|
|
1552235
|
-
var
|
|
1552301
|
+
var import_promises58 = require("fs/promises");
|
|
1552236
1552302
|
var import_semver9 = __toESM(require_semver2(), 1);
|
|
1552237
1552303
|
async function diff({
|
|
1552238
1552304
|
context: context2,
|
|
@@ -1552275,7 +1552341,7 @@ async function readIr({
|
|
|
1552275
1552341
|
context2.failWithoutThrowing(`File not found: ${absoluteFilepath}`);
|
|
1552276
1552342
|
throw new FernCliError();
|
|
1552277
1552343
|
}
|
|
1552278
|
-
const ir14 = await (0,
|
|
1552344
|
+
const ir14 = await (0, import_promises58.readFile)(absoluteFilepath, "utf-8");
|
|
1552279
1552345
|
const parsed = serialization_exports4.IntermediateRepresentation.parse(JSON.parse(ir14));
|
|
1552280
1552346
|
if (!parsed.ok) {
|
|
1552281
1552347
|
context2.failWithoutThrowing(`Invalid --${flagName}; expected a filepath containing a valid IR`);
|
|
@@ -1570028,9 +1570094,9 @@ function replaceFrontmatterImagesforLogo(data2, mapImage) {
|
|
|
1570028
1570094
|
}
|
|
1570029
1570095
|
|
|
1570030
1570096
|
// ../docs-markdown-utils/lib/replaceReferencedCode.js
|
|
1570031
|
-
var
|
|
1570097
|
+
var import_promises59 = require("fs/promises");
|
|
1570032
1570098
|
async function defaultFileLoader(filepath) {
|
|
1570033
|
-
const file = await (0,
|
|
1570099
|
+
const file = await (0, import_promises59.readFile)(filepath);
|
|
1570034
1570100
|
return file.toString();
|
|
1570035
1570101
|
}
|
|
1570036
1570102
|
function isUrl2(src) {
|
|
@@ -1570197,10 +1570263,10 @@ ${replacement}
|
|
|
1570197
1570263
|
}
|
|
1570198
1570264
|
|
|
1570199
1570265
|
// ../docs-markdown-utils/lib/replaceReferencedMarkdown.js
|
|
1570200
|
-
var
|
|
1570266
|
+
var import_promises60 = require("fs/promises");
|
|
1570201
1570267
|
var import_gray_matter5 = __toESM(require_gray_matter(), 1);
|
|
1570202
1570268
|
async function defaultMarkdownLoader(filepath) {
|
|
1570203
|
-
const { content: content5 } = (0, import_gray_matter5.default)(await (0,
|
|
1570269
|
+
const { content: content5 } = (0, import_gray_matter5.default)(await (0, import_promises60.readFile)(filepath));
|
|
1570204
1570270
|
return content5;
|
|
1570205
1570271
|
}
|
|
1570206
1570272
|
function extractAttributes(markdownTag) {
|
|
@@ -1577951,7 +1578017,7 @@ function computeServiceTypeReferenceInfo(irGraph) {
|
|
|
1577951
1578017
|
// ../docs-resolver/lib/DocsDefinitionResolver.js
|
|
1577952
1578018
|
var import_dayjs3 = __toESM(require_dayjs_min(), 1);
|
|
1577953
1578019
|
var import_utc3 = __toESM(require_utc(), 1);
|
|
1577954
|
-
var
|
|
1578020
|
+
var import_promises64 = require("fs/promises");
|
|
1577955
1578021
|
var import_gray_matter6 = __toESM(require_gray_matter(), 1);
|
|
1577956
1578022
|
|
|
1577957
1578023
|
// ../../../node_modules/.pnpm/@fern-api+ui-core-utils@0.129.4-b6c699ad2/node_modules/@fern-api/ui-core-utils/dist/assertNever.js
|
|
@@ -1579676,10 +1579742,10 @@ var HeapAsync = (
|
|
|
1579676
1579742
|
};
|
|
1579677
1579743
|
HeapAsync2.prototype._applyLimit = function() {
|
|
1579678
1579744
|
if (this._limit && this._limit < this.heapArray.length) {
|
|
1579679
|
-
var
|
|
1579680
|
-
while (
|
|
1579745
|
+
var rm15 = this.heapArray.length - this._limit;
|
|
1579746
|
+
while (rm15) {
|
|
1579681
1579747
|
this.heapArray.pop();
|
|
1579682
|
-
--
|
|
1579748
|
+
--rm15;
|
|
1579683
1579749
|
}
|
|
1579684
1579750
|
}
|
|
1579685
1579751
|
};
|
|
@@ -1580508,10 +1580574,10 @@ var Heap = (
|
|
|
1580508
1580574
|
};
|
|
1580509
1580575
|
Heap2.prototype._applyLimit = function() {
|
|
1580510
1580576
|
if (this._limit > 0 && this._limit < this.heapArray.length) {
|
|
1580511
|
-
var
|
|
1580512
|
-
while (
|
|
1580577
|
+
var rm15 = this.heapArray.length - this._limit;
|
|
1580578
|
+
while (rm15) {
|
|
1580513
1580579
|
this.heapArray.pop();
|
|
1580514
|
-
--
|
|
1580580
|
+
--rm15;
|
|
1580515
1580581
|
}
|
|
1580516
1580582
|
}
|
|
1580517
1580583
|
};
|
|
@@ -1582065,7 +1582131,7 @@ var OpenAPIPruner = class {
|
|
|
1582065
1582131
|
};
|
|
1582066
1582132
|
|
|
1582067
1582133
|
// ../register/lib/ai-example-enhancer/enhanceExamplesWithAI.js
|
|
1582068
|
-
var
|
|
1582134
|
+
var import_promises63 = require("fs/promises");
|
|
1582069
1582135
|
|
|
1582070
1582136
|
// ../register/lib/ai-example-enhancer/lambdaClient.js
|
|
1582071
1582137
|
var DEFAULT_AI_ENHANCEMENT_MAX_RETRIES = 0;
|
|
@@ -1582142,6 +1582208,14 @@ var LambdaExampleEnhancer = class {
|
|
|
1582142
1582208
|
enhancedResponseExample: request6.originalResponseExample
|
|
1582143
1582209
|
};
|
|
1582144
1582210
|
}
|
|
1582211
|
+
const isAirGapped = await detectAirGappedMode(`${this.venusOrigin}/health`, this.context.logger);
|
|
1582212
|
+
if (isAirGapped) {
|
|
1582213
|
+
this.context.logger.debug("Skipping AI example enhancement in air-gapped environment");
|
|
1582214
|
+
return {
|
|
1582215
|
+
enhancedRequestExample: request6.originalRequestExample,
|
|
1582216
|
+
enhancedResponseExample: request6.originalResponseExample
|
|
1582217
|
+
};
|
|
1582218
|
+
}
|
|
1582145
1582219
|
let jwt3;
|
|
1582146
1582220
|
try {
|
|
1582147
1582221
|
jwt3 = await this.getJwt();
|
|
@@ -1582274,12 +1582348,12 @@ var SpinnerStatusCoordinator = class _SpinnerStatusCoordinator {
|
|
|
1582274
1582348
|
};
|
|
1582275
1582349
|
|
|
1582276
1582350
|
// ../register/lib/ai-example-enhancer/validateAiExamples.js
|
|
1582277
|
-
var
|
|
1582351
|
+
var import_promises61 = require("fs/promises");
|
|
1582278
1582352
|
async function parseAiExamplesOverride(sourceFilePath, context2) {
|
|
1582279
1582353
|
const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
|
|
1582280
1582354
|
const aiExamples = [];
|
|
1582281
1582355
|
try {
|
|
1582282
|
-
const existingContent = await (0,
|
|
1582356
|
+
const existingContent = await (0, import_promises61.readFile)(overrideFilePath, "utf-8");
|
|
1582283
1582357
|
const parsed = jsYaml.load(existingContent);
|
|
1582284
1582358
|
if (parsed && typeof parsed === "object" && "paths" in parsed) {
|
|
1582285
1582359
|
const paths = parsed.paths;
|
|
@@ -1582328,7 +1582402,7 @@ async function validateAiExamplesFromFile({ sourceFilePath, context: context2 })
|
|
|
1582328
1582402
|
}
|
|
1582329
1582403
|
let spec;
|
|
1582330
1582404
|
try {
|
|
1582331
|
-
const specContent = await (0,
|
|
1582405
|
+
const specContent = await (0, import_promises61.readFile)(sourceFilePath, "utf-8");
|
|
1582332
1582406
|
try {
|
|
1582333
1582407
|
spec = JSON.parse(specContent);
|
|
1582334
1582408
|
} catch {
|
|
@@ -1582387,7 +1582461,7 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context2 }) {
|
|
|
1582387
1582461
|
}
|
|
1582388
1582462
|
const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
|
|
1582389
1582463
|
try {
|
|
1582390
|
-
const existingContent = await (0,
|
|
1582464
|
+
const existingContent = await (0, import_promises61.readFile)(overrideFilePath, "utf-8");
|
|
1582391
1582465
|
const parsed = jsYaml.load(existingContent);
|
|
1582392
1582466
|
if (!parsed || !parsed.paths) {
|
|
1582393
1582467
|
return {
|
|
@@ -1582431,12 +1582505,12 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context2 }) {
|
|
|
1582431
1582505
|
}
|
|
1582432
1582506
|
|
|
1582433
1582507
|
// ../register/lib/ai-example-enhancer/writeAiExamplesOverride.js
|
|
1582434
|
-
var
|
|
1582508
|
+
var import_promises62 = require("fs/promises");
|
|
1582435
1582509
|
async function loadExistingOverrideCoverage(sourceFilePath, context2) {
|
|
1582436
1582510
|
const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
|
|
1582437
1582511
|
const coveredEndpoints = /* @__PURE__ */ new Set();
|
|
1582438
1582512
|
try {
|
|
1582439
|
-
const existingContent = await (0,
|
|
1582513
|
+
const existingContent = await (0, import_promises62.readFile)(overrideFilePath, "utf-8");
|
|
1582440
1582514
|
const parsed = jsYaml.load(existingContent);
|
|
1582441
1582515
|
if (parsed && typeof parsed === "object" && "paths" in parsed) {
|
|
1582442
1582516
|
const paths = parsed.paths;
|
|
@@ -1582515,7 +1582589,7 @@ async function writeAiExamplesOverride({ enhancedExamples, sourceFilePath, conte
|
|
|
1582515
1582589
|
try {
|
|
1582516
1582590
|
let existingOverride = {};
|
|
1582517
1582591
|
try {
|
|
1582518
|
-
const existingContent = await (0,
|
|
1582592
|
+
const existingContent = await (0, import_promises62.readFile)(overrideFilePath, "utf-8");
|
|
1582519
1582593
|
const parsed = jsYaml.load(existingContent);
|
|
1582520
1582594
|
if (parsed && typeof parsed === "object") {
|
|
1582521
1582595
|
existingOverride = parsed;
|
|
@@ -1582558,7 +1582632,7 @@ async function writeAiExamplesOverride({ enhancedExamples, sourceFilePath, conte
|
|
|
1582558
1582632
|
lineWidth: -1,
|
|
1582559
1582633
|
noRefs: true
|
|
1582560
1582634
|
});
|
|
1582561
|
-
await (0,
|
|
1582635
|
+
await (0, import_promises62.writeFile)(overrideFilePath, yamlContent, "utf-8");
|
|
1582562
1582636
|
context2.logger.debug(`AI enhanced examples written to: ${overrideFilePath}`);
|
|
1582563
1582637
|
} catch (error2) {
|
|
1582564
1582638
|
context2.logger.warn(`Failed to write AI examples override file: ${error2}`);
|
|
@@ -1582761,7 +1582835,7 @@ async function performAIEnhancement(apiDefinition, config2, context2, token, org
|
|
|
1582761
1582835
|
let endpointsNeedingRegeneration = /* @__PURE__ */ new Set();
|
|
1582762
1582836
|
if (sourceFilePath != null) {
|
|
1582763
1582837
|
try {
|
|
1582764
|
-
const specContent = await (0,
|
|
1582838
|
+
const specContent = await (0, import_promises63.readFile)(sourceFilePath, "utf-8");
|
|
1582765
1582839
|
if (!isOpenApiSpec(specContent)) {
|
|
1582766
1582840
|
context2.logger.debug("Non-OpenAPI spec detected, skipping AI example enhancement");
|
|
1582767
1582841
|
return apiDefinition;
|
|
@@ -1585567,7 +1585641,7 @@ var DocsDefinitionResolver = class {
|
|
|
1585567
1585641
|
const jsFilePaths = /* @__PURE__ */ new Set();
|
|
1585568
1585642
|
await Promise.all(this._parsedDocsConfig.experimental.mdxComponents.map(async (filepath) => {
|
|
1585569
1585643
|
const absoluteFilePath = resolve5(this.docsWorkspace.absoluteFilePath, filepath);
|
|
1585570
|
-
const stats = await (0,
|
|
1585644
|
+
const stats = await (0, import_promises64.stat)(absoluteFilePath);
|
|
1585571
1585645
|
if (stats.isDirectory()) {
|
|
1585572
1585646
|
const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx,md,mdx}");
|
|
1585573
1585647
|
files.forEach((file) => {
|
|
@@ -1585579,7 +1585653,7 @@ var DocsDefinitionResolver = class {
|
|
|
1585579
1585653
|
}));
|
|
1585580
1585654
|
jsFiles = Object.fromEntries(await Promise.all([...jsFilePaths].map(async (filePath) => {
|
|
1585581
1585655
|
const relativeFilePath = this.toRelativeFilepath(filePath);
|
|
1585582
|
-
const contents = (await (0,
|
|
1585656
|
+
const contents = (await (0, import_promises64.readFile)(filePath)).toString();
|
|
1585583
1585657
|
return [relativeFilePath, contents];
|
|
1585584
1585658
|
})));
|
|
1585585
1585659
|
const mdxTime = performance.now() - mdxStart;
|
|
@@ -1593616,7 +1593690,7 @@ async function generateFdrFromOpenApiWorkspace(workspace, context2) {
|
|
|
1593616
1593690
|
// ../docs-preview/lib/runAppPreviewServer.js
|
|
1593617
1593691
|
var import_cors = __toESM(require_lib16(), 1);
|
|
1593618
1593692
|
var import_express = __toESM(require_express3(), 1);
|
|
1593619
|
-
var
|
|
1593693
|
+
var import_promises70 = require("fs/promises");
|
|
1593620
1593694
|
var import_http6 = __toESM(require("http"), 1);
|
|
1593621
1593695
|
var import_path39 = __toESM(require("path"), 1);
|
|
1593622
1593696
|
|
|
@@ -1595288,13 +1595362,13 @@ var watcher_default = Watcher;
|
|
|
1595288
1595362
|
init_wrapper();
|
|
1595289
1595363
|
|
|
1595290
1595364
|
// ../docs-preview/lib/DebugLogger.js
|
|
1595291
|
-
var
|
|
1595365
|
+
var import_promises65 = require("fs/promises");
|
|
1595292
1595366
|
var import_os5 = require("os");
|
|
1595293
1595367
|
var import_path37 = __toESM(require("path"), 1);
|
|
1595294
1595368
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1595295
1595369
|
var LOGS_FOLDER_NAME = "logs";
|
|
1595296
1595370
|
function getCliSource() {
|
|
1595297
|
-
const version6 = "3.44.
|
|
1595371
|
+
const version6 = "3.44.1-2-g8d6db0b72a";
|
|
1595298
1595372
|
return `cli@${version6}`;
|
|
1595299
1595373
|
}
|
|
1595300
1595374
|
var DebugLogger = class {
|
|
@@ -1595314,7 +1595388,7 @@ var DebugLogger = class {
|
|
|
1595314
1595388
|
const localStorageFolder = join2(AbsoluteFilePath2.of((0, import_os5.homedir)()), RelativeFilePath2.of(LOCAL_STORAGE_FOLDER4));
|
|
1595315
1595389
|
const logsDir = join2(localStorageFolder, RelativeFilePath2.of(LOGS_FOLDER_NAME));
|
|
1595316
1595390
|
if (!await doesPathExist(logsDir)) {
|
|
1595317
|
-
await (0,
|
|
1595391
|
+
await (0, import_promises65.mkdir)(logsDir, { recursive: true });
|
|
1595318
1595392
|
}
|
|
1595319
1595393
|
const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
1595320
1595394
|
const logFileName = `${timestamp2}.debug.log`;
|
|
@@ -1595327,7 +1595401,7 @@ var DebugLogger = class {
|
|
|
1595327
1595401
|
"================================================================================",
|
|
1595328
1595402
|
""
|
|
1595329
1595403
|
].join("\n");
|
|
1595330
|
-
await (0,
|
|
1595404
|
+
await (0, import_promises65.writeFile)(this.logFilePath, header, "utf-8");
|
|
1595331
1595405
|
this.initialized = true;
|
|
1595332
1595406
|
}
|
|
1595333
1595407
|
/**
|
|
@@ -1595345,7 +1595419,7 @@ var DebugLogger = class {
|
|
|
1595345
1595419
|
}
|
|
1595346
1595420
|
const line = JSON.stringify(entry) + "\n";
|
|
1595347
1595421
|
try {
|
|
1595348
|
-
await (0,
|
|
1595422
|
+
await (0, import_promises65.appendFile)(this.logFilePath, line, "utf-8");
|
|
1595349
1595423
|
} catch (error2) {
|
|
1595350
1595424
|
}
|
|
1595351
1595425
|
}
|
|
@@ -1595469,7 +1595543,7 @@ var DebugLogger = class {
|
|
|
1595469
1595543
|
// ../docs-preview/lib/downloadLocalDocsBundle.js
|
|
1595470
1595544
|
var import_cli_progress = __toESM(require_cli_progress(), 1);
|
|
1595471
1595545
|
var import_decompress = __toESM(require_decompress(), 1);
|
|
1595472
|
-
var
|
|
1595546
|
+
var import_promises66 = require("fs/promises");
|
|
1595473
1595547
|
var import_os6 = require("os");
|
|
1595474
1595548
|
var import_tmp_promise9 = __toESM(require_tmp_promise(), 1);
|
|
1595475
1595549
|
var import_xml2js = __toESM(require_xml2js(), 1);
|
|
@@ -1595557,7 +1595631,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595557
1595631
|
let currentETag = void 0;
|
|
1595558
1595632
|
if (currentETagExists) {
|
|
1595559
1595633
|
logger.debug("Reading existing ETag");
|
|
1595560
|
-
currentETag = (await (0,
|
|
1595634
|
+
currentETag = (await (0, import_promises66.readFile)(eTagFilepath)).toString();
|
|
1595561
1595635
|
}
|
|
1595562
1595636
|
if (currentETag != null && currentETag === eTag) {
|
|
1595563
1595637
|
logger.debug("ETag matches. Using already downloaded bundle");
|
|
@@ -1595621,16 +1595695,16 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595621
1595695
|
}
|
|
1595622
1595696
|
}
|
|
1595623
1595697
|
const nodeBuffer = Buffer.concat(chunks);
|
|
1595624
|
-
await (0,
|
|
1595698
|
+
await (0, import_promises66.writeFile)(outputZipPath, new Uint8Array(nodeBuffer));
|
|
1595625
1595699
|
logger.debug(`Wrote ${tryTar ? "output.tar.gz" : "output.zip"} to ${outputZipPath}`);
|
|
1595626
1595700
|
const absolutePathToPreviewFolder = getPathToPreviewFolder({ app });
|
|
1595627
1595701
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1595628
1595702
|
logger.debug(`Removing previously cached bundle at: ${absolutePathToPreviewFolder}`);
|
|
1595629
|
-
await (0,
|
|
1595703
|
+
await (0, import_promises66.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1595630
1595704
|
}
|
|
1595631
|
-
await (0,
|
|
1595705
|
+
await (0, import_promises66.mkdir)(absolutePathToPreviewFolder, { recursive: true });
|
|
1595632
1595706
|
const absolutePathToBundleFolder = getPathToBundleFolder({ app });
|
|
1595633
|
-
await (0,
|
|
1595707
|
+
await (0, import_promises66.mkdir)(absolutePathToBundleFolder, { recursive: true });
|
|
1595634
1595708
|
logger.debug(`Decompressing bundle from ${outputZipPath} to ${absolutePathToBundleFolder}`);
|
|
1595635
1595709
|
let unzipProgressBar;
|
|
1595636
1595710
|
let unzipInterval;
|
|
@@ -1595665,7 +1595739,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595665
1595739
|
unzipProgressBar.stop();
|
|
1595666
1595740
|
}
|
|
1595667
1595741
|
}
|
|
1595668
|
-
await (0,
|
|
1595742
|
+
await (0, import_promises66.writeFile)(eTagFilepath, eTag);
|
|
1595669
1595743
|
logger.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
|
|
1595670
1595744
|
if (app) {
|
|
1595671
1595745
|
logger.debug("Checking if pnpm is installed");
|
|
@@ -1595747,15 +1595821,15 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595747
1595821
|
}
|
|
1595748
1595822
|
if (!pnpmfileExists) {
|
|
1595749
1595823
|
logger.debug(`Writing pnpmfile.cjs at ${pnpmfilePath}`);
|
|
1595750
|
-
await (0,
|
|
1595824
|
+
await (0, import_promises66.writeFile)(pnpmfilePath, PNPMFILE_CJS_CONTENTS);
|
|
1595751
1595825
|
}
|
|
1595752
1595826
|
if (!npmrcExists) {
|
|
1595753
1595827
|
logger.debug(`Writing .npmrc at ${npmrcPath}`);
|
|
1595754
|
-
await (0,
|
|
1595828
|
+
await (0, import_promises66.writeFile)(npmrcPath, NPMRC_CONTENTS);
|
|
1595755
1595829
|
}
|
|
1595756
1595830
|
if (instrumentationJsExists) {
|
|
1595757
1595831
|
logger.debug(`Removing instrumentation.js at ${absPathToInstrumentationJs}`);
|
|
1595758
|
-
await (0,
|
|
1595832
|
+
await (0, import_promises66.rm)(absPathToInstrumentationJs);
|
|
1595759
1595833
|
}
|
|
1595760
1595834
|
try {
|
|
1595761
1595835
|
logger.debug("Running pnpm install within standalone");
|
|
@@ -1595775,7 +1595849,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595775
1595849
|
logger.error(`Error: ${error2}`);
|
|
1595776
1595850
|
const absolutePathToPreviewFolder = getPathToPreviewFolder({ app });
|
|
1595777
1595851
|
if (await doesPathExist(absolutePathToPreviewFolder)) {
|
|
1595778
|
-
await (0,
|
|
1595852
|
+
await (0, import_promises66.rm)(absolutePathToPreviewFolder, { recursive: true });
|
|
1595779
1595853
|
}
|
|
1595780
1595854
|
logger.debug(`Removing incomplete bundle: rm -rf ${absolutePathToPreviewFolder}`);
|
|
1595781
1595855
|
return {
|
|
@@ -1595785,7 +1595859,7 @@ async function downloadBundle({ bucketUrl, logger, preferCached, app = false, tr
|
|
|
1595785
1595859
|
}
|
|
1595786
1595860
|
|
|
1595787
1595861
|
// ../docs-preview/lib/previewDocs.js
|
|
1595788
|
-
var
|
|
1595862
|
+
var import_promises69 = require("fs/promises");
|
|
1595789
1595863
|
var import_gray_matter10 = __toESM(require_gray_matter(), 1);
|
|
1595790
1595864
|
|
|
1595791
1595865
|
// ../docs-markdown-utils/src/extract-literals.ts
|
|
@@ -1596628,9 +1596702,9 @@ function replaceFrontmatterImagesforLogo2(data2, mapImage) {
|
|
|
1596628
1596702
|
}
|
|
1596629
1596703
|
|
|
1596630
1596704
|
// ../docs-markdown-utils/src/replaceReferencedCode.ts
|
|
1596631
|
-
var
|
|
1596705
|
+
var import_promises67 = require("fs/promises");
|
|
1596632
1596706
|
async function defaultFileLoader2(filepath) {
|
|
1596633
|
-
const file = await (0,
|
|
1596707
|
+
const file = await (0, import_promises67.readFile)(filepath);
|
|
1596634
1596708
|
return file.toString();
|
|
1596635
1596709
|
}
|
|
1596636
1596710
|
function isUrl3(src) {
|
|
@@ -1596804,10 +1596878,10 @@ ${replacement}
|
|
|
1596804
1596878
|
}
|
|
1596805
1596879
|
|
|
1596806
1596880
|
// ../docs-markdown-utils/src/replaceReferencedMarkdown.ts
|
|
1596807
|
-
var
|
|
1596881
|
+
var import_promises68 = require("fs/promises");
|
|
1596808
1596882
|
var import_gray_matter9 = __toESM(require_gray_matter(), 1);
|
|
1596809
1596883
|
async function defaultMarkdownLoader2(filepath) {
|
|
1596810
|
-
const { content: content5 } = (0, import_gray_matter9.default)(await (0,
|
|
1596884
|
+
const { content: content5 } = (0, import_gray_matter9.default)(await (0, import_promises68.readFile)(filepath));
|
|
1596811
1596885
|
return content5;
|
|
1596812
1596886
|
}
|
|
1596813
1596887
|
function extractAttributes2(markdownTag) {
|
|
@@ -1597006,7 +1597080,7 @@ async function getPreviewDocsDefinition({ domain: domain2, project, context: con
|
|
|
1597006
1597080
|
navAffectingChange = true;
|
|
1597007
1597081
|
continue;
|
|
1597008
1597082
|
}
|
|
1597009
|
-
const markdown = (await (0,
|
|
1597083
|
+
const markdown = (await (0, import_promises69.readFile)(absoluteFilePath)).toString();
|
|
1597010
1597084
|
const isNewFile = previousValue == null;
|
|
1597011
1597085
|
if (isNewFile) {
|
|
1597012
1597086
|
navAffectingChange = true;
|
|
@@ -1597394,7 +1597468,7 @@ var SnippetDependencyTracker = class {
|
|
|
1597394
1597468
|
const markdownFiles = await this.findMarkdownFiles(docsWorkspace.absoluteFilePath);
|
|
1597395
1597469
|
for (const markdownFile of markdownFiles) {
|
|
1597396
1597470
|
try {
|
|
1597397
|
-
const content5 = await (0,
|
|
1597471
|
+
const content5 = await (0, import_promises70.readFile)(markdownFile, "utf-8");
|
|
1597398
1597472
|
const referencedFiles = this.extractReferences(content5, markdownFile, docsWorkspace.absoluteFilePath);
|
|
1597399
1597473
|
this.pageToSnippets.set(markdownFile, referencedFiles);
|
|
1597400
1597474
|
for (const referencedFile of referencedFiles) {
|
|
@@ -1597476,7 +1597550,7 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
|
|
|
1597476
1597550
|
const appPreviewFolder = getPathToPreviewFolder({ app: true });
|
|
1597477
1597551
|
if (await doesPathExist(appPreviewFolder)) {
|
|
1597478
1597552
|
context2.logger.info("Force download requested. Deleting cached bundle...");
|
|
1597479
|
-
await (0,
|
|
1597553
|
+
await (0, import_promises70.rm)(appPreviewFolder, { recursive: true });
|
|
1597480
1597554
|
}
|
|
1597481
1597555
|
}
|
|
1597482
1597556
|
if (bundlePath != null) {
|
|
@@ -1599969,7 +1600043,7 @@ async function validateVersionConfigFileSchema({ value }) {
|
|
|
1599969
1600043
|
}
|
|
1599970
1600044
|
|
|
1599971
1600045
|
// ../yaml/docs-validator/lib/docsAst/visitDocsConfigFileYamlAst.js
|
|
1599972
|
-
var
|
|
1600046
|
+
var import_promises72 = require("fs/promises");
|
|
1599973
1600047
|
|
|
1599974
1600048
|
// ../yaml/docs-validator/lib/docsAst/products-yml.schema.json
|
|
1599975
1600049
|
var products_yml_schema_exports = {};
|
|
@@ -1601820,7 +1601894,7 @@ async function visitFilepath({ absoluteFilepathToConfiguration, rawUnresolvedFil
|
|
|
1601820
1601894
|
}
|
|
1601821
1601895
|
|
|
1601822
1601896
|
// ../yaml/docs-validator/lib/docsAst/visitNavigationAst.js
|
|
1601823
|
-
var
|
|
1601897
|
+
var import_promises71 = require("fs/promises");
|
|
1601824
1601898
|
|
|
1601825
1601899
|
// ../yaml/docs-validator/lib/utils/asyncPool.js
|
|
1601826
1601900
|
async function asyncPool(limit, items, fn4) {
|
|
@@ -1601971,13 +1602045,13 @@ async function visitNavigationItem2({ absolutePathToFernFolder, navigationItem,
|
|
|
1601971
1602045
|
if (navigationItemIsPage(navigationItem)) {
|
|
1601972
1602046
|
const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), navigationItem.path);
|
|
1601973
1602047
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1601974
|
-
const fileStats = await (0,
|
|
1602048
|
+
const fileStats = await (0, import_promises71.stat)(absoluteFilepath);
|
|
1601975
1602049
|
const fileSizeMB = fileStats.size / (1024 * 1024);
|
|
1601976
1602050
|
if (fileSizeMB > 1) {
|
|
1601977
1602051
|
context2.logger.trace(`Processing large markdown file: ${navigationItem.path} (${fileSizeMB.toFixed(2)} MB)`);
|
|
1601978
1602052
|
}
|
|
1601979
1602053
|
const startTime = performance.now();
|
|
1601980
|
-
const content5 = (await (0,
|
|
1602054
|
+
const content5 = (await (0, import_promises71.readFile)(absoluteFilepath, "utf8")).toString();
|
|
1601981
1602055
|
const readTime = performance.now() - startTime;
|
|
1601982
1602056
|
if (readTime > 2e3) {
|
|
1601983
1602057
|
context2.logger.debug(`Slow file read: ${navigationItem.path} took ${readTime.toFixed(0)}ms`);
|
|
@@ -1602024,12 +1602098,12 @@ async function visitNavigationItem2({ absolutePathToFernFolder, navigationItem,
|
|
|
1602024
1602098
|
context2.logger.trace(`Starting changelog processing for directory: ${changelogDir}`);
|
|
1602025
1602099
|
if (await doesPathExist(changelogDir)) {
|
|
1602026
1602100
|
const startTime = performance.now();
|
|
1602027
|
-
const files = await (0,
|
|
1602101
|
+
const files = await (0, import_promises71.readdir)(changelogDir);
|
|
1602028
1602102
|
const markdownFiles = files.filter((file) => file.endsWith(".md") || file.endsWith(".mdx"));
|
|
1602029
1602103
|
context2.logger.debug(`Processing ${markdownFiles.length} changelog files in ${changelogDir}`);
|
|
1602030
1602104
|
await asyncPool(VALIDATION_CONCURRENCY, markdownFiles, async (file) => {
|
|
1602031
1602105
|
const absoluteFilepath = resolve5(changelogDir, file);
|
|
1602032
|
-
const content5 = (await (0,
|
|
1602106
|
+
const content5 = (await (0, import_promises71.readFile)(absoluteFilepath, "utf8")).toString();
|
|
1602033
1602107
|
context2.logger.trace(`Validating changelog file: ${file}`);
|
|
1602034
1602108
|
await visitor.markdownPage?.({
|
|
1602035
1602109
|
title: file,
|
|
@@ -1602219,7 +1602293,7 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
|
|
|
1602219
1602293
|
willBeUploaded: false
|
|
1602220
1602294
|
});
|
|
1602221
1602295
|
const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), product.path);
|
|
1602222
|
-
const content5 = jsYaml.load((await (0,
|
|
1602296
|
+
const content5 = jsYaml.load((await (0, import_promises72.readFile)(absoluteFilepath)).toString());
|
|
1602223
1602297
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1602224
1602298
|
await visitor.productFile?.({
|
|
1602225
1602299
|
path: product.path,
|
|
@@ -1602297,7 +1602371,7 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
|
|
|
1602297
1602371
|
willBeUploaded: false
|
|
1602298
1602372
|
});
|
|
1602299
1602373
|
const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), version6.path);
|
|
1602300
|
-
const content5 = jsYaml.load((await (0,
|
|
1602374
|
+
const content5 = jsYaml.load((await (0, import_promises72.readFile)(absoluteFilepath)).toString());
|
|
1602301
1602375
|
if (await doesPathExist(absoluteFilepath)) {
|
|
1602302
1602376
|
await visitor.versionFile?.({
|
|
1602303
1602377
|
path: version6.path,
|
|
@@ -1602731,7 +1602805,7 @@ var import_web = require("stream/web");
|
|
|
1602731
1602805
|
var import_node_stream5 = require("stream");
|
|
1602732
1602806
|
|
|
1602733
1602807
|
// ../../../node_modules/.pnpm/strtok3@9.1.1/node_modules/strtok3/lib/index.js
|
|
1602734
|
-
var
|
|
1602808
|
+
var import_promises74 = require("fs/promises");
|
|
1602735
1602809
|
|
|
1602736
1602810
|
// ../../../node_modules/.pnpm/peek-readable@5.4.2/node_modules/peek-readable/lib/EndOfStreamError.js
|
|
1602737
1602811
|
var defaultMessages = "End-Of-Stream";
|
|
@@ -1603102,14 +1603176,14 @@ function fromBuffer(uint8Array, options2) {
|
|
|
1603102
1603176
|
}
|
|
1603103
1603177
|
|
|
1603104
1603178
|
// ../../../node_modules/.pnpm/strtok3@9.1.1/node_modules/strtok3/lib/FileTokenizer.js
|
|
1603105
|
-
var
|
|
1603179
|
+
var import_promises73 = require("fs/promises");
|
|
1603106
1603180
|
var FileTokenizer = class _FileTokenizer extends AbstractTokenizer {
|
|
1603107
1603181
|
/**
|
|
1603108
1603182
|
* Create tokenizer from provided file path
|
|
1603109
1603183
|
* @param sourceFilePath File path
|
|
1603110
1603184
|
*/
|
|
1603111
1603185
|
static async fromFile(sourceFilePath) {
|
|
1603112
|
-
const fileHandle = await (0,
|
|
1603186
|
+
const fileHandle = await (0, import_promises73.open)(sourceFilePath, "r");
|
|
1603113
1603187
|
const stat3 = await fileHandle.stat();
|
|
1603114
1603188
|
return new _FileTokenizer(fileHandle, { fileInfo: { path: sourceFilePath, size: stat3.size } });
|
|
1603115
1603189
|
}
|
|
@@ -1603241,9 +1603315,9 @@ function decodeUTF8(bytes) {
|
|
|
1603241
1603315
|
const b23 = bytes[i11++] & 63;
|
|
1603242
1603316
|
const b32 = bytes[i11++] & 63;
|
|
1603243
1603317
|
const b42 = bytes[i11++] & 63;
|
|
1603244
|
-
let
|
|
1603245
|
-
|
|
1603246
|
-
out += String.fromCharCode(55296 + (
|
|
1603318
|
+
let cp10 = (b1 & 7) << 18 | b23 << 12 | b32 << 6 | b42;
|
|
1603319
|
+
cp10 -= 65536;
|
|
1603320
|
+
out += String.fromCharCode(55296 + (cp10 >> 10 & 1023), 56320 + (cp10 & 1023));
|
|
1603247
1603321
|
}
|
|
1603248
1603322
|
}
|
|
1603249
1603323
|
return out;
|
|
@@ -1605071,7 +1605145,7 @@ var supportedExtensions = new Set(extensions);
|
|
|
1605071
1605145
|
var supportedMimeTypes = new Set(mimeTypes);
|
|
1605072
1605146
|
|
|
1605073
1605147
|
// ../yaml/docs-validator/lib/rules/valid-file-types/valid-file-types.js
|
|
1605074
|
-
var
|
|
1605148
|
+
var import_promises75 = require("fs/promises");
|
|
1605075
1605149
|
var import_path41 = __toESM(require("path"), 1);
|
|
1605076
1605150
|
var ALLOWED_FILE_TYPES = /* @__PURE__ */ new Set([
|
|
1605077
1605151
|
// image files
|
|
@@ -1605192,7 +1605266,7 @@ var ValidFileTypes = {
|
|
|
1605192
1605266
|
}
|
|
1605193
1605267
|
};
|
|
1605194
1605268
|
var getViolationsForFile = async (absoluteFilepath) => {
|
|
1605195
|
-
const file = new Uint8Array(await (0,
|
|
1605269
|
+
const file = new Uint8Array(await (0, import_promises75.readFile)(absoluteFilepath));
|
|
1605196
1605270
|
const fileType = await fileTypeFromBuffer(file);
|
|
1605197
1605271
|
if (fileType != null) {
|
|
1605198
1605272
|
if (ALLOWED_FILE_TYPES.has(fileType.mime)) {
|
|
@@ -1605231,7 +1605305,7 @@ var getViolationsForFile = async (absoluteFilepath) => {
|
|
|
1605231
1605305
|
};
|
|
1605232
1605306
|
|
|
1605233
1605307
|
// ../yaml/docs-validator/lib/rules/valid-frontmatter/valid-frontmatter.js
|
|
1605234
|
-
var
|
|
1605308
|
+
var import_promises76 = require("fs/promises");
|
|
1605235
1605309
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
1605236
1605310
|
var ValidFrontmatter = {
|
|
1605237
1605311
|
name: "valid-frontmatter",
|
|
@@ -1605242,7 +1605316,7 @@ var ValidFrontmatter = {
|
|
|
1605242
1605316
|
return [];
|
|
1605243
1605317
|
}
|
|
1605244
1605318
|
try {
|
|
1605245
|
-
const fileContents = await (0,
|
|
1605319
|
+
const fileContents = await (0, import_promises76.readFile)(absoluteFilepath, "utf-8");
|
|
1605246
1605320
|
(0, import_gray_matter11.default)(fileContents);
|
|
1605247
1605321
|
return [];
|
|
1605248
1605322
|
} catch (error2) {
|
|
@@ -1610118,7 +1610192,7 @@ async function parseMarkdown({ markdown, absoluteFilepath, absolutePathToFernFol
|
|
|
1610118
1610192
|
}
|
|
1610119
1610193
|
|
|
1610120
1610194
|
// ../yaml/docs-validator/lib/rules/valid-markdown-file-reference/valid-markdown-file-reference.js
|
|
1610121
|
-
var
|
|
1610195
|
+
var import_promises77 = require("fs/promises");
|
|
1610122
1610196
|
var import_gray_matter12 = __toESM(require_gray_matter(), 1);
|
|
1610123
1610197
|
var ValidMarkdownFileReferences = {
|
|
1610124
1610198
|
name: "valid-markdown-file-references",
|
|
@@ -1610129,7 +1610203,7 @@ var ValidMarkdownFileReferences = {
|
|
|
1610129
1610203
|
return [];
|
|
1610130
1610204
|
}
|
|
1610131
1610205
|
try {
|
|
1610132
|
-
const fileContents = await (0,
|
|
1610206
|
+
const fileContents = await (0, import_promises77.readFile)(absoluteFilepath, "utf-8");
|
|
1610133
1610207
|
const { content: content5 } = (0, import_gray_matter12.default)(fileContents, {});
|
|
1610134
1610208
|
const tree = parseMarkdownToTree(content5);
|
|
1610135
1610209
|
const errors4 = [];
|
|
@@ -1611271,7 +1611345,7 @@ function createDocsConfigFileAstVisitorForRules({ relativeFilepath, allRuleVisit
|
|
|
1611271
1611345
|
}
|
|
1611272
1611346
|
|
|
1611273
1611347
|
// ../yaml/docs-validator/lib/rules/no-non-component-refs/no-non-component-refs.js
|
|
1611274
|
-
var
|
|
1611348
|
+
var import_promises78 = require("fs/promises");
|
|
1611275
1611349
|
var NoNonComponentRefsRule = {
|
|
1611276
1611350
|
name: "no-non-component-refs",
|
|
1611277
1611351
|
create: ({ ossWorkspaces, logger, workspace: docsWorkspace }) => {
|
|
@@ -1611285,7 +1611359,7 @@ var NoNonComponentRefsRule = {
|
|
|
1611285
1611359
|
if (!processedFiles.has(spec.absoluteFilepath)) {
|
|
1611286
1611360
|
processedFiles.add(spec.absoluteFilepath);
|
|
1611287
1611361
|
try {
|
|
1611288
|
-
const contents = (await (0,
|
|
1611362
|
+
const contents = (await (0, import_promises78.readFile)(spec.absoluteFilepath)).toString();
|
|
1611289
1611363
|
const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
|
|
1611290
1611364
|
const isOpenApiV2 = contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"));
|
|
1611291
1611365
|
if (isOpenApiV2) {
|
|
@@ -1611325,7 +1611399,7 @@ var NoNonComponentRefsRule = {
|
|
|
1611325
1611399
|
};
|
|
1611326
1611400
|
|
|
1611327
1611401
|
// ../yaml/docs-validator/lib/rules/no-openapi-v2-in-docs/no-openapi-v2-in-docs.js
|
|
1611328
|
-
var
|
|
1611402
|
+
var import_promises79 = require("fs/promises");
|
|
1611329
1611403
|
var NoOpenApiV2InDocsRule = {
|
|
1611330
1611404
|
name: "no-openapi-v2-in-docs",
|
|
1611331
1611405
|
create: ({ ossWorkspaces, logger, workspace: docsWorkspace }) => {
|
|
@@ -1611338,7 +1611412,7 @@ var NoOpenApiV2InDocsRule = {
|
|
|
1611338
1611412
|
if (spec.type === "openapi" && !processedFiles.has(spec.absoluteFilepath)) {
|
|
1611339
1611413
|
processedFiles.add(spec.absoluteFilepath);
|
|
1611340
1611414
|
try {
|
|
1611341
|
-
const contents = (await (0,
|
|
1611415
|
+
const contents = (await (0, import_promises79.readFile)(spec.absoluteFilepath)).toString();
|
|
1611342
1611416
|
const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
|
|
1611343
1611417
|
if (contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"))) {
|
|
1611344
1611418
|
violations.push({
|
|
@@ -1611461,7 +1611535,7 @@ var ValidInstanceUrlRule = {
|
|
|
1611461
1611535
|
};
|
|
1611462
1611536
|
|
|
1611463
1611537
|
// ../yaml/docs-validator/lib/rules/valid-local-references/valid-local-references.js
|
|
1611464
|
-
var
|
|
1611538
|
+
var import_promises80 = require("fs/promises");
|
|
1611465
1611539
|
function validateReference(ref2, spec) {
|
|
1611466
1611540
|
const pathParts = ref2.replace(/^#\//, "").split("/").map((part) => (
|
|
1611467
1611541
|
// Decode JSON Pointer escapes: ~1 -> /, ~0 -> ~
|
|
@@ -1611528,7 +1611602,7 @@ var ValidLocalReferencesRule = {
|
|
|
1611528
1611602
|
if (spec.type === "openapi" && !processedFiles.has(spec.absoluteFilepath)) {
|
|
1611529
1611603
|
processedFiles.add(spec.absoluteFilepath);
|
|
1611530
1611604
|
try {
|
|
1611531
|
-
const contents = (await (0,
|
|
1611605
|
+
const contents = (await (0, import_promises80.readFile)(spec.absoluteFilepath)).toString();
|
|
1611532
1611606
|
const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
|
|
1611533
1611607
|
const isOpenApiV2 = contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"));
|
|
1611534
1611608
|
if (isOpenApiV2) {
|
|
@@ -1611581,7 +1611655,7 @@ var ValidLocalReferencesRule = {
|
|
|
1611581
1611655
|
};
|
|
1611582
1611656
|
|
|
1611583
1611657
|
// ../yaml/docs-validator/lib/rules/valid-openapi-examples/valid-openapi-examples.js
|
|
1611584
|
-
var
|
|
1611658
|
+
var import_promises81 = require("fs/promises");
|
|
1611585
1611659
|
var ValidOpenApiExamples = {
|
|
1611586
1611660
|
name: "valid-openapi-examples",
|
|
1611587
1611661
|
create: ({ ossWorkspaces, logger, workspace: docsWorkspace }) => {
|
|
@@ -1611679,7 +1611753,7 @@ var ValidOpenApiExamples = {
|
|
|
1611679
1611753
|
};
|
|
1611680
1611754
|
async function validateOpenApiExamples({ specPath, logger }) {
|
|
1611681
1611755
|
try {
|
|
1611682
|
-
const specContent = await (0,
|
|
1611756
|
+
const specContent = await (0, import_promises81.readFile)(specPath, "utf-8");
|
|
1611683
1611757
|
let spec;
|
|
1611684
1611758
|
try {
|
|
1611685
1611759
|
spec = JSON.parse(specContent);
|
|
@@ -1612373,7 +1612447,7 @@ Found ${previewDeployments.length} preview deployment(s):
|
|
|
1612373
1612447
|
}
|
|
1612374
1612448
|
|
|
1612375
1612449
|
// src/commands/downgrade/downgrade.ts
|
|
1612376
|
-
var
|
|
1612450
|
+
var import_promises82 = require("fs/promises");
|
|
1612377
1612451
|
|
|
1612378
1612452
|
// ../../../node_modules/.pnpm/immer@10.1.3/node_modules/immer/dist/immer.mjs
|
|
1612379
1612453
|
var NOTHING = Symbol.for("immer-nothing");
|
|
@@ -1613062,12 +1613136,12 @@ async function downgrade({
|
|
|
1613062
1613136
|
const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
|
|
1613063
1613137
|
draft.version = targetVersion;
|
|
1613064
1613138
|
});
|
|
1613065
|
-
await (0,
|
|
1613139
|
+
await (0, import_promises82.writeFile)(projectConfig._absolutePath, ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2)));
|
|
1613066
1613140
|
cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
|
|
1613067
1613141
|
}
|
|
1613068
1613142
|
|
|
1613069
1613143
|
// src/commands/export/generateOpenAPIForWorkspaces.ts
|
|
1613070
|
-
var
|
|
1613144
|
+
var import_promises83 = require("fs/promises");
|
|
1613071
1613145
|
|
|
1613072
1613146
|
// src/commands/export/converters/servicesConverter.ts
|
|
1613073
1613147
|
var import_openapi_types3 = __toESM(require_dist20(), 1);
|
|
@@ -1614320,8 +1614394,8 @@ async function generateOpenAPIForWorkspaces({
|
|
|
1614320
1614394
|
ir: ir14,
|
|
1614321
1614395
|
mode: "openapi"
|
|
1614322
1614396
|
});
|
|
1614323
|
-
await (0,
|
|
1614324
|
-
await (0,
|
|
1614397
|
+
await (0, import_promises83.mkdir)(dirname4(outputPath), { recursive: true });
|
|
1614398
|
+
await (0, import_promises83.writeFile)(
|
|
1614325
1614399
|
outputPath,
|
|
1614326
1614400
|
outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent3) : jsYaml.dump(openapi, { indent: indent3 })
|
|
1614327
1614401
|
);
|
|
@@ -1614360,10 +1614434,10 @@ var APPROVED_DIRECTORIES_FILENAME = "approved-output-directories";
|
|
|
1614360
1614434
|
var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
|
|
1614361
1614435
|
|
|
1614362
1614436
|
// src/commands/generate/checkOutputDirectory.ts
|
|
1614363
|
-
var
|
|
1614437
|
+
var import_promises86 = require("fs/promises");
|
|
1614364
1614438
|
|
|
1614365
1614439
|
// src/persistence/output-directories/getOutputDirectories.ts
|
|
1614366
|
-
var
|
|
1614440
|
+
var import_promises84 = require("fs/promises");
|
|
1614367
1614441
|
|
|
1614368
1614442
|
// src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
|
|
1614369
1614443
|
var import_os7 = require("os");
|
|
@@ -1614382,17 +1614456,17 @@ async function getOutputDirectories() {
|
|
|
1614382
1614456
|
if (!doesOutputDirectoriesFileExist) {
|
|
1614383
1614457
|
return [];
|
|
1614384
1614458
|
}
|
|
1614385
|
-
const outputDirectoriesFileContents = await (0,
|
|
1614459
|
+
const outputDirectoriesFileContents = await (0, import_promises84.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
|
|
1614386
1614460
|
const outputDirectories = JSON.parse(outputDirectoriesFileContents);
|
|
1614387
1614461
|
return outputDirectories;
|
|
1614388
1614462
|
}
|
|
1614389
1614463
|
|
|
1614390
1614464
|
// src/persistence/output-directories/storeOutputDirectories.ts
|
|
1614391
|
-
var
|
|
1614465
|
+
var import_promises85 = require("fs/promises");
|
|
1614392
1614466
|
var import_path43 = __toESM(require("path"), 1);
|
|
1614393
1614467
|
async function storeOutputDirectories(outputDirectories) {
|
|
1614394
|
-
await (0,
|
|
1614395
|
-
await (0,
|
|
1614468
|
+
await (0, import_promises85.mkdir)(import_path43.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
|
|
1614469
|
+
await (0, import_promises85.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
|
|
1614396
1614470
|
}
|
|
1614397
1614471
|
|
|
1614398
1614472
|
// src/commands/generate/checkOutputDirectory.ts
|
|
@@ -1614414,7 +1614488,7 @@ async function checkOutputDirectory(outputPath, cliContext, force) {
|
|
|
1614414
1614488
|
shouldProceed: true
|
|
1614415
1614489
|
};
|
|
1614416
1614490
|
}
|
|
1614417
|
-
const files = await (0,
|
|
1614491
|
+
const files = await (0, import_promises86.readdir)(outputPath);
|
|
1614418
1614492
|
if (files.length === 0) {
|
|
1614419
1614493
|
return {
|
|
1614420
1614494
|
shouldProceed: true
|
|
@@ -1614776,7 +1614850,7 @@ var AutoVersioningService = class {
|
|
|
1614776
1614850
|
};
|
|
1614777
1614851
|
|
|
1614778
1614852
|
// ../generation/local-generation/docker-utils/lib/runDocker.js
|
|
1614779
|
-
var
|
|
1614853
|
+
var import_promises87 = require("fs/promises");
|
|
1614780
1614854
|
var import_tmp_promise10 = __toESM(require_tmp_promise(), 1);
|
|
1614781
1614855
|
async function runContainer({ logger, imageName, args = [], binds = [], envVars = {}, ports = {}, writeLogsToFile = true, removeAfterCompletion = false, runner }) {
|
|
1614782
1614856
|
const tryRun = () => tryRunContainer({
|
|
@@ -1614825,7 +1614899,7 @@ async function tryRunContainer({ logger, imageName, args, binds, envVars = {}, p
|
|
|
1614825
1614899
|
const logs = stdout + stderr;
|
|
1614826
1614900
|
if (writeLogsToFile) {
|
|
1614827
1614901
|
const tmpFile = await import_tmp_promise10.default.file();
|
|
1614828
|
-
await (0,
|
|
1614902
|
+
await (0, import_promises87.writeFile)(tmpFile.path, logs);
|
|
1614829
1614903
|
logger.info(`Generator logs here: ${tmpFile.path}`);
|
|
1614830
1614904
|
}
|
|
1614831
1614905
|
if (exitCode == null) {
|
|
@@ -1614918,7 +1614992,7 @@ var ContainerExecutionEnvironment = class {
|
|
|
1614918
1614992
|
|
|
1614919
1614993
|
// ../generation/local-generation/local-workspace-runner/lib/runGenerator.js
|
|
1614920
1614994
|
var import_serialization = __toESM(require_serialization3(), 1);
|
|
1614921
|
-
var
|
|
1614995
|
+
var import_promises89 = require("fs/promises");
|
|
1614922
1614996
|
var path54 = __toESM(require("path"), 1);
|
|
1614923
1614997
|
var import_path46 = require("path");
|
|
1614924
1614998
|
var import_tmp_promise12 = __toESM(require_tmp_promise(), 1);
|
|
@@ -1628744,7 +1628818,7 @@ function configureBamlClient(config2) {
|
|
|
1628744
1628818
|
|
|
1628745
1628819
|
// ../generation/local-generation/local-workspace-runner/lib/LocalTaskHandler.js
|
|
1628746
1628820
|
var import_decompress2 = __toESM(require_decompress(), 1);
|
|
1628747
|
-
var
|
|
1628821
|
+
var import_promises88 = require("fs/promises");
|
|
1628748
1628822
|
var import_os8 = require("os");
|
|
1628749
1628823
|
var import_path45 = require("path");
|
|
1628750
1628824
|
var import_semver10 = __toESM(require_semver2(), 1);
|
|
@@ -1628827,7 +1628901,7 @@ var LocalTaskHandler = class {
|
|
|
1628827
1628901
|
try {
|
|
1628828
1628902
|
this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
|
|
1628829
1628903
|
diffFile = await this.generateDiffFile();
|
|
1628830
|
-
const diffContent = await (0,
|
|
1628904
|
+
const diffContent = await (0, import_promises88.readFile)(diffFile, "utf-8");
|
|
1628831
1628905
|
if (diffContent.trim().length === 0) {
|
|
1628832
1628906
|
this.context.logger.info("No changes detected in generated SDK");
|
|
1628833
1628907
|
return null;
|
|
@@ -1628874,7 +1628948,7 @@ var LocalTaskHandler = class {
|
|
|
1628874
1628948
|
} finally {
|
|
1628875
1628949
|
if (diffFile) {
|
|
1628876
1628950
|
try {
|
|
1628877
|
-
await (0,
|
|
1628951
|
+
await (0, import_promises88.rm)(diffFile);
|
|
1628878
1628952
|
} catch (cleanupError) {
|
|
1628879
1628953
|
this.context.logger.warn(`Failed to delete temp diff file: ${diffFile}`, String(cleanupError));
|
|
1628880
1628954
|
}
|
|
@@ -1628953,7 +1629027,7 @@ var LocalTaskHandler = class {
|
|
|
1628953
1629027
|
const tmpOutputResolutionDir = AbsoluteFilePath2.of((await import_tmp_promise11.default.dir({})).path);
|
|
1628954
1629028
|
const absolutePathToFernignore = AbsoluteFilePath2.of(join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME)));
|
|
1628955
1629029
|
const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1628956
|
-
await (0,
|
|
1629030
|
+
await (0, import_promises88.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1628957
1629031
|
await this.runGitCommand(["init"], tmpOutputResolutionDir);
|
|
1628958
1629032
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1628959
1629033
|
const response = await this.runGitCommand(["config", "--list"], tmpOutputResolutionDir);
|
|
@@ -1628967,13 +1629041,13 @@ var LocalTaskHandler = class {
|
|
|
1628967
1629041
|
await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
|
|
1628968
1629042
|
await this.runGitCommand(["reset", "--", ...fernIgnorePaths], tmpOutputResolutionDir);
|
|
1628969
1629043
|
await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
|
|
1628970
|
-
await (0,
|
|
1628971
|
-
await (0,
|
|
1628972
|
-
await (0,
|
|
1629044
|
+
await (0, import_promises88.rm)(join2(tmpOutputResolutionDir, RelativeFilePath2.of(".git")), { recursive: true });
|
|
1629045
|
+
await (0, import_promises88.rm)(this.absolutePathToLocalOutput, { recursive: true });
|
|
1629046
|
+
await (0, import_promises88.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
|
|
1628973
1629047
|
}
|
|
1628974
1629048
|
async copyGeneratedFilesNoFernIgnorePreservingGit() {
|
|
1628975
|
-
const contents = await (0,
|
|
1628976
|
-
await Promise.all(contents.filter((item) => item !== ".git").map((item) => (0,
|
|
1629049
|
+
const contents = await (0, import_promises88.readdir)(this.absolutePathToLocalOutput);
|
|
1629050
|
+
await Promise.all(contents.filter((item) => item !== ".git").map((item) => (0, import_promises88.rm)(join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(item)), {
|
|
1628977
1629051
|
force: true,
|
|
1628978
1629052
|
recursive: true
|
|
1628979
1629053
|
})));
|
|
@@ -1628981,11 +1629055,11 @@ var LocalTaskHandler = class {
|
|
|
1628981
1629055
|
}
|
|
1628982
1629056
|
async copyGeneratedFilesNoFernIgnoreDeleteAll() {
|
|
1628983
1629057
|
this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
|
|
1628984
|
-
await (0,
|
|
1629058
|
+
await (0, import_promises88.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
|
|
1628985
1629059
|
await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
|
|
1628986
1629060
|
}
|
|
1628987
1629061
|
async copyGeneratedFilesToDirectory(outputPath) {
|
|
1628988
|
-
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0,
|
|
1629062
|
+
const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises88.readdir)(this.absolutePathToTmpOutputDirectory);
|
|
1628989
1629063
|
if (firstLocalOutputItem == null) {
|
|
1628990
1629064
|
return;
|
|
1628991
1629065
|
}
|
|
@@ -1628993,15 +1629067,15 @@ var LocalTaskHandler = class {
|
|
|
1628993
1629067
|
if (firstLocalOutputItem.endsWith(".zip")) {
|
|
1628994
1629068
|
await (0, import_decompress2.default)(join2(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(firstLocalOutputItem)), outputPath);
|
|
1628995
1629069
|
for (const localOutputItem of remaininglocalOutputItems) {
|
|
1628996
|
-
await (0,
|
|
1629070
|
+
await (0, import_promises88.cp)(join2(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(localOutputItem)), join2(outputPath, RelativeFilePath2.of(localOutputItem)), { recursive: true });
|
|
1628997
1629071
|
}
|
|
1628998
1629072
|
} else {
|
|
1628999
|
-
await (0,
|
|
1629073
|
+
await (0, import_promises88.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
|
|
1629000
1629074
|
}
|
|
1629001
1629075
|
}
|
|
1629002
1629076
|
async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
|
|
1629003
1629077
|
this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
|
|
1629004
|
-
await (0,
|
|
1629078
|
+
await (0, import_promises88.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
|
|
1629005
1629079
|
}
|
|
1629006
1629080
|
async runGitCommand(options2, cwd2) {
|
|
1629007
1629081
|
const response = await loggingExeca(this.context.logger, "git", options2, {
|
|
@@ -1629056,24 +1629130,24 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
1629056
1629130
|
context2.logger.debug("Wrote IR to: " + absolutePathToIr);
|
|
1629057
1629131
|
const configJsonFile = (0, import_path46.join)(workspaceTempDir.path, GENERATOR_CONFIG_FILENAME);
|
|
1629058
1629132
|
const absolutePathToWriteConfigJson = AbsoluteFilePath2.of(configJsonFile);
|
|
1629059
|
-
await (0,
|
|
1629133
|
+
await (0, import_promises89.writeFile)(configJsonFile, "");
|
|
1629060
1629134
|
context2.logger.debug("Will write config.json to: " + absolutePathToWriteConfigJson);
|
|
1629061
1629135
|
const tmpOutputDirectory = (0, import_path46.join)(workspaceTempDir.path, CODEGEN_OUTPUT_DIRECTORY_NAME);
|
|
1629062
1629136
|
const absolutePathToTmpOutputDirectory = AbsoluteFilePath2.of(tmpOutputDirectory);
|
|
1629063
|
-
await (0,
|
|
1629137
|
+
await (0, import_promises89.mkdir)(tmpOutputDirectory, { recursive: true });
|
|
1629064
1629138
|
context2.logger.debug("Will write output to: " + absolutePathToTmpOutputDirectory);
|
|
1629065
1629139
|
let absolutePathToTmpSnippetJSON = void 0;
|
|
1629066
1629140
|
if (absolutePathToLocalSnippetJSON != null) {
|
|
1629067
1629141
|
const snippetJsonFile = (0, import_path46.join)(workspaceTempDir.path, "snippet.json");
|
|
1629068
1629142
|
absolutePathToTmpSnippetJSON = AbsoluteFilePath2.of(snippetJsonFile);
|
|
1629069
|
-
await (0,
|
|
1629143
|
+
await (0, import_promises89.writeFile)(snippetJsonFile, "");
|
|
1629070
1629144
|
context2.logger.debug("Will write snippet.json to: " + absolutePathToTmpSnippetJSON);
|
|
1629071
1629145
|
}
|
|
1629072
1629146
|
let absolutePathToTmpSnippetTemplatesJSON = void 0;
|
|
1629073
1629147
|
if (absolutePathToLocalSnippetTemplateJSON != null) {
|
|
1629074
1629148
|
const snippetTemplatesJsonFile = (0, import_path46.join)(workspaceTempDir.path, SNIPPET_TEMPLATES_JSON_FILENAME);
|
|
1629075
1629149
|
absolutePathToTmpSnippetTemplatesJSON = AbsoluteFilePath2.of(snippetTemplatesJsonFile);
|
|
1629076
|
-
await (0,
|
|
1629150
|
+
await (0, import_promises89.writeFile)(snippetTemplatesJsonFile, "");
|
|
1629077
1629151
|
context2.logger.debug("Will write snippet-templates.json to: " + absolutePathToTmpSnippetTemplatesJSON);
|
|
1629078
1629152
|
}
|
|
1629079
1629153
|
const environment2 = executionEnvironment ?? new ContainerExecutionEnvironment({
|
|
@@ -1629109,7 +1629183,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
1629109
1629183
|
whiteLabel,
|
|
1629110
1629184
|
paths
|
|
1629111
1629185
|
});
|
|
1629112
|
-
await (0,
|
|
1629186
|
+
await (0, import_promises89.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(await import_serialization.GeneratorConfig.jsonOrThrow(config2), void 0, 4));
|
|
1629113
1629187
|
const absolutePathToLicenseFile = extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig);
|
|
1629114
1629188
|
await environment2.execute({
|
|
1629115
1629189
|
generatorName: generatorInvocation.name,
|
|
@@ -1629351,8 +1629425,8 @@ var import_fiddle_sdk5 = __toESM(require_fiddle_sdk(), 1);
|
|
|
1629351
1629425
|
|
|
1629352
1629426
|
// ../generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
|
|
1629353
1629427
|
var import_fs17 = require("fs");
|
|
1629354
|
-
var
|
|
1629355
|
-
var
|
|
1629428
|
+
var import_promises90 = require("fs/promises");
|
|
1629429
|
+
var import_promises91 = require("stream/promises");
|
|
1629356
1629430
|
async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context: context2 }) {
|
|
1629357
1629431
|
try {
|
|
1629358
1629432
|
await downloadFileForTask({
|
|
@@ -1629369,22 +1629443,22 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
|
|
|
1629369
1629443
|
responseType: "stream"
|
|
1629370
1629444
|
});
|
|
1629371
1629445
|
if (await doesPathExist(absolutePathToLocalOutput)) {
|
|
1629372
|
-
await (0,
|
|
1629446
|
+
await (0, import_promises90.rm)(absolutePathToLocalOutput, { recursive: true });
|
|
1629373
1629447
|
}
|
|
1629374
|
-
await (0,
|
|
1629375
|
-
await (0,
|
|
1629448
|
+
await (0, import_promises90.mkdir)(dirname4(absolutePathToLocalOutput), { recursive: true });
|
|
1629449
|
+
await (0, import_promises91.pipeline)(request6.data, (0, import_fs17.createWriteStream)(absolutePathToLocalOutput));
|
|
1629376
1629450
|
}
|
|
1629377
1629451
|
|
|
1629378
1629452
|
// ../generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
1629379
1629453
|
var import_fiddle_sdk4 = __toESM(require_fiddle_sdk(), 1);
|
|
1629380
1629454
|
var import_form_data4 = __toESM(require_form_data(), 1);
|
|
1629381
|
-
var
|
|
1629455
|
+
var import_promises92 = require("fs/promises");
|
|
1629382
1629456
|
var import_url_join23 = __toESM(require_url_join(), 1);
|
|
1629383
1629457
|
async function createAndStartJob({ projectConfig, workspace, organization, intermediateRepresentation, generatorInvocation, version: version6, context: context2, shouldLogS3Url, token, whitelabel, irVersionOverride, absolutePathToPreview, fernignorePath }) {
|
|
1629384
1629458
|
let fernignoreContents;
|
|
1629385
1629459
|
if (fernignorePath != null) {
|
|
1629386
1629460
|
try {
|
|
1629387
|
-
fernignoreContents = await (0,
|
|
1629461
|
+
fernignoreContents = await (0, import_promises92.readFile)(fernignorePath, "utf-8");
|
|
1629388
1629462
|
} catch (error2) {
|
|
1629389
1629463
|
context2.failAndThrow(`Failed to read fernignore file at ${fernignorePath}: ${error2}`);
|
|
1629390
1629464
|
}
|
|
@@ -1629576,9 +1629650,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context: context2 })
|
|
|
1629576
1629650
|
// ../generation/remote-generation/remote-workspace-runner/lib/RemoteTaskHandler.js
|
|
1629577
1629651
|
var import_decompress3 = __toESM(require_decompress(), 1);
|
|
1629578
1629652
|
var import_fs18 = require("fs");
|
|
1629579
|
-
var
|
|
1629653
|
+
var import_promises93 = require("fs/promises");
|
|
1629580
1629654
|
var import_path47 = __toESM(require("path"), 1);
|
|
1629581
|
-
var
|
|
1629655
|
+
var import_promises94 = require("stream/promises");
|
|
1629582
1629656
|
|
|
1629583
1629657
|
// ../../../node_modules/.pnpm/terminal-link@3.0.0/node_modules/terminal-link/index.js
|
|
1629584
1629658
|
var import_supports_hyperlinks = __toESM(require_supports_hyperlinks(), 1);
|
|
@@ -1629746,9 +1629820,9 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
|
|
|
1629746
1629820
|
});
|
|
1629747
1629821
|
const tmpDir = await import_tmp_promise13.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1629748
1629822
|
const outputZipPath = import_path47.default.join(tmpDir.path, "output.zip");
|
|
1629749
|
-
await (0,
|
|
1629823
|
+
await (0, import_promises94.pipeline)(request6.data, (0, import_fs18.createWriteStream)(outputZipPath));
|
|
1629750
1629824
|
await forceRemoveDirectory(absolutePathToLocalOutput);
|
|
1629751
|
-
await (0,
|
|
1629825
|
+
await (0, import_promises93.mkdir)(absolutePathToLocalOutput, { recursive: true });
|
|
1629752
1629826
|
await (0, import_decompress3.default)(outputZipPath, absolutePathToLocalOutput);
|
|
1629753
1629827
|
}
|
|
1629754
1629828
|
async function forceRemoveDirectory(dirPath) {
|
|
@@ -1629756,22 +1629830,22 @@ async function forceRemoveDirectory(dirPath) {
|
|
|
1629756
1629830
|
return;
|
|
1629757
1629831
|
}
|
|
1629758
1629832
|
await makeWritableRecursive(dirPath);
|
|
1629759
|
-
await (0,
|
|
1629833
|
+
await (0, import_promises93.rm)(dirPath, { recursive: true, force: true });
|
|
1629760
1629834
|
}
|
|
1629761
1629835
|
async function makeWritableRecursive(dirPath) {
|
|
1629762
1629836
|
try {
|
|
1629763
|
-
const entries10 = await (0,
|
|
1629837
|
+
const entries10 = await (0, import_promises93.readdir)(dirPath, { withFileTypes: true });
|
|
1629764
1629838
|
for (const entry of entries10) {
|
|
1629765
1629839
|
const fullPath = AbsoluteFilePath2.of(import_path47.default.join(dirPath, entry.name));
|
|
1629766
1629840
|
if (entry.isDirectory()) {
|
|
1629767
1629841
|
await makeWritableRecursive(fullPath);
|
|
1629768
1629842
|
}
|
|
1629769
1629843
|
try {
|
|
1629770
|
-
await (0,
|
|
1629844
|
+
await (0, import_promises93.chmod)(fullPath, 493);
|
|
1629771
1629845
|
} catch {
|
|
1629772
1629846
|
}
|
|
1629773
1629847
|
}
|
|
1629774
|
-
await (0,
|
|
1629848
|
+
await (0, import_promises93.chmod)(dirPath, 493);
|
|
1629775
1629849
|
} catch {
|
|
1629776
1629850
|
}
|
|
1629777
1629851
|
}
|
|
@@ -1629822,7 +1629896,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
|
|
|
1629822
1629896
|
const tmpOutputResolutionDir = AbsoluteFilePath2.of((await import_tmp_promise13.default.dir({})).path);
|
|
1629823
1629897
|
const absolutePathToFernignore = join2(absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME));
|
|
1629824
1629898
|
const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
|
|
1629825
|
-
await (0,
|
|
1629899
|
+
await (0, import_promises93.cp)(absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
|
|
1629826
1629900
|
await runGitCommand(["init"], tmpOutputResolutionDir, context2);
|
|
1629827
1629901
|
await runGitCommand(["add", "."], tmpOutputResolutionDir, context2);
|
|
1629828
1629902
|
const gitConfigResponse = await runGitCommand(["config", "--list"], tmpOutputResolutionDir, context2);
|
|
@@ -1629838,7 +1629912,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
|
|
|
1629838
1629912
|
await runGitCommand(["restore", "."], tmpOutputResolutionDir, context2);
|
|
1629839
1629913
|
await forceRemoveDirectory(join2(tmpOutputResolutionDir, RelativeFilePath2.of(".git")));
|
|
1629840
1629914
|
await forceRemoveDirectory(absolutePathToLocalOutput);
|
|
1629841
|
-
await (0,
|
|
1629915
|
+
await (0, import_promises93.cp)(tmpOutputResolutionDir, absolutePathToLocalOutput, { recursive: true });
|
|
1629842
1629916
|
}
|
|
1629843
1629917
|
async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath }) {
|
|
1629844
1629918
|
const request6 = await axios_default.get(s3PreSignedReadUrl, {
|
|
@@ -1629846,12 +1629920,12 @@ async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath
|
|
|
1629846
1629920
|
});
|
|
1629847
1629921
|
const tmpDir = await import_tmp_promise13.default.dir({ prefix: "fern", unsafeCleanup: true });
|
|
1629848
1629922
|
const outputZipPath = import_path47.default.join(tmpDir.path, "output.zip");
|
|
1629849
|
-
await (0,
|
|
1629923
|
+
await (0, import_promises94.pipeline)(request6.data, (0, import_fs18.createWriteStream)(outputZipPath));
|
|
1629850
1629924
|
await (0, import_decompress3.default)(outputZipPath, outputPath);
|
|
1629851
1629925
|
}
|
|
1629852
1629926
|
|
|
1629853
1629927
|
// ../generation/remote-generation/remote-workspace-runner/lib/SourceUploader.js
|
|
1629854
|
-
var
|
|
1629928
|
+
var import_promises95 = require("fs/promises");
|
|
1629855
1629929
|
var import_tmp_promise14 = __toESM(require_tmp_promise(), 1);
|
|
1629856
1629930
|
var PROTOBUF_ZIP_FILENAME = "proto.zip";
|
|
1629857
1629931
|
var SourceUploader = class {
|
|
@@ -1629872,7 +1629946,7 @@ var SourceUploader = class {
|
|
|
1629872
1629946
|
}
|
|
1629873
1629947
|
async uploadSource(source2, uploadURL) {
|
|
1629874
1629948
|
const uploadCommand = await this.getUploadCommand(source2);
|
|
1629875
|
-
const fileData = await (0,
|
|
1629949
|
+
const fileData = await (0, import_promises95.readFile)(uploadCommand.absoluteFilePath);
|
|
1629876
1629950
|
const response = await fetch(uploadURL, {
|
|
1629877
1629951
|
method: "PUT",
|
|
1629878
1629952
|
body: fileData,
|
|
@@ -1629892,7 +1629966,7 @@ var SourceUploader = class {
|
|
|
1629892
1629966
|
absoluteFilePath,
|
|
1629893
1629967
|
cleanup: async () => {
|
|
1629894
1629968
|
this.context.logger.debug(`Removing ${absoluteFilePath}`);
|
|
1629895
|
-
await (0,
|
|
1629969
|
+
await (0, import_promises95.unlink)(absoluteFilePath);
|
|
1629896
1629970
|
}
|
|
1629897
1629971
|
};
|
|
1629898
1629972
|
}
|
|
@@ -1630334,7 +1630408,7 @@ async function runRemoteGenerationForAPIWorkspace({ projectConfig, organization,
|
|
|
1630334
1630408
|
|
|
1630335
1630409
|
// ../generation/remote-generation/remote-workspace-runner/lib/publishDocs.js
|
|
1630336
1630410
|
var import_crypto9 = require("crypto");
|
|
1630337
|
-
var
|
|
1630411
|
+
var import_promises96 = require("fs/promises");
|
|
1630338
1630412
|
var mime = __toESM(require_mime_types(), 1);
|
|
1630339
1630413
|
|
|
1630340
1630414
|
// ../generation/remote-generation/remote-workspace-runner/lib/measureImageSizes.js
|
|
@@ -1630391,7 +1630465,7 @@ var MEASURE_IMAGE_BATCH_SIZE = 10;
|
|
|
1630391
1630465
|
var UPLOAD_FILE_BATCH_SIZE = 10;
|
|
1630392
1630466
|
var HASH_CONCURRENCY = parseInt(process.env.FERN_DOCS_ASSET_HASH_CONCURRENCY ?? "32", 10);
|
|
1630393
1630467
|
async function calculateFileHash(absoluteFilePath) {
|
|
1630394
|
-
const fileBuffer = await (0,
|
|
1630468
|
+
const fileBuffer = await (0, import_promises96.readFile)(absoluteFilePath);
|
|
1630395
1630469
|
return (0, import_crypto9.createHash)("sha256").update(new Uint8Array(fileBuffer)).digest("hex");
|
|
1630396
1630470
|
}
|
|
1630397
1630471
|
async function publishDocs({ token, organization, docsWorkspace, domain: domain2, customDomains, apiWorkspaces, ossWorkspaces, context: context2, preview, editThisPage, isPrivate = false, disableTemplates = false, skipUpload = false, withAiExamples = true, excludeApis = false, targetAudiences }) {
|
|
@@ -1630708,7 +1630782,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context2, batchSize
|
|
|
1630708
1630782
|
const absoluteFilePath = resolve5(docsWorkspacePath, relativeFilePath);
|
|
1630709
1630783
|
try {
|
|
1630710
1630784
|
const mimeType = mime.lookup(absoluteFilePath);
|
|
1630711
|
-
await axios_default.put(uploadUrl, await (0,
|
|
1630785
|
+
await axios_default.put(uploadUrl, await (0, import_promises96.readFile)(absoluteFilePath), {
|
|
1630712
1630786
|
headers: {
|
|
1630713
1630787
|
"Content-Type": mimeType === false ? "application/octet-stream" : mimeType,
|
|
1630714
1630788
|
// Set max cache control for S3 uploads
|
|
@@ -1640682,14 +1640756,14 @@ async function validateGeneratorsYmlFile({ contents, allRuleVisitors, cliVersion
|
|
|
1640682
1640756
|
}
|
|
1640683
1640757
|
|
|
1640684
1640758
|
// ../workspace/oss-validator/lib/rules/no-duplicate-overrides/no-duplicate-overrides.js
|
|
1640685
|
-
var
|
|
1640759
|
+
var import_promises97 = require("fs/promises");
|
|
1640686
1640760
|
var NoDuplicateOverridesRule = {
|
|
1640687
1640761
|
name: "no-duplicate-overrides",
|
|
1640688
1640762
|
run: async ({ workspace, specs, context: context2 }) => {
|
|
1640689
1640763
|
const violations = [];
|
|
1640690
1640764
|
const seenMethodsByAudience = /* @__PURE__ */ new Map();
|
|
1640691
1640765
|
for (const spec of specs) {
|
|
1640692
|
-
const contents = (await (0,
|
|
1640766
|
+
const contents = (await (0, import_promises97.readFile)(spec.absoluteFilepath)).toString();
|
|
1640693
1640767
|
if (contents.includes("openapi") || contents.includes("swagger")) {
|
|
1640694
1640768
|
const openAPI = await loadOpenAPI({
|
|
1640695
1640769
|
absolutePathToOpenAPI: spec.absoluteFilepath,
|
|
@@ -1641515,7 +1641589,7 @@ async function generateOpenAPIIrForWorkspaces({
|
|
|
1641515
1641589
|
}
|
|
1641516
1641590
|
|
|
1641517
1641591
|
// src/commands/generate-overrides/compareOpenAPISpecs.ts
|
|
1641518
|
-
var
|
|
1641592
|
+
var import_promises98 = require("fs/promises");
|
|
1641519
1641593
|
async function compareOpenAPISpecs({
|
|
1641520
1641594
|
originalPath,
|
|
1641521
1641595
|
modifiedPath,
|
|
@@ -1641552,12 +1641626,12 @@ async function compareOpenAPISpecs({
|
|
|
1641552
1641626
|
}
|
|
1641553
1641627
|
outputPath = join2(dirname4(originalPath), RelativeFilePath2.of(overridesFilename));
|
|
1641554
1641628
|
}
|
|
1641555
|
-
await (0,
|
|
1641629
|
+
await (0, import_promises98.writeFile)(outputPath, jsYaml.dump(overrides, { lineWidth: -1, noRefs: true }));
|
|
1641556
1641630
|
context2.logger.info(`Overrides written to ${outputPath}`);
|
|
1641557
1641631
|
});
|
|
1641558
1641632
|
}
|
|
1641559
1641633
|
async function loadSpec(filepath, context2) {
|
|
1641560
|
-
const contents = await (0,
|
|
1641634
|
+
const contents = await (0, import_promises98.readFile)(filepath, "utf8");
|
|
1641561
1641635
|
try {
|
|
1641562
1641636
|
return JSON.parse(contents);
|
|
1641563
1641637
|
} catch {
|
|
@@ -1641658,7 +1641732,7 @@ function deepEqual(a10, b18) {
|
|
|
1641658
1641732
|
}
|
|
1641659
1641733
|
|
|
1641660
1641734
|
// src/commands/generate-overrides/writeOverridesForWorkspaces.ts
|
|
1641661
|
-
var
|
|
1641735
|
+
var import_promises99 = require("fs/promises");
|
|
1641662
1641736
|
async function writeOverridesForWorkspaces({
|
|
1641663
1641737
|
project,
|
|
1641664
1641738
|
includeModels,
|
|
@@ -1641683,7 +1641757,7 @@ async function writeOverridesForWorkspaces({
|
|
|
1641683
1641757
|
async function readExistingOverrides(overridesFilepath, context2) {
|
|
1641684
1641758
|
let parsedOverrides = null;
|
|
1641685
1641759
|
try {
|
|
1641686
|
-
const contents = (await (0,
|
|
1641760
|
+
const contents = (await (0, import_promises99.readFile)(overridesFilepath, "utf8")).toString();
|
|
1641687
1641761
|
try {
|
|
1641688
1641762
|
parsedOverrides = JSON.parse(contents);
|
|
1641689
1641763
|
} catch (err) {
|
|
@@ -1641747,7 +1641821,7 @@ async function writeDefinitionForOpenAPIWorkspace({
|
|
|
1641747
1641821
|
overridesFilename = `${nameWithoutExt}-overrides${extension2}`;
|
|
1641748
1641822
|
}
|
|
1641749
1641823
|
}
|
|
1641750
|
-
await (0,
|
|
1641824
|
+
await (0, import_promises99.writeFile)(
|
|
1641751
1641825
|
join2(dirname4(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
|
|
1641752
1641826
|
jsYaml.dump({ paths, components })
|
|
1641753
1641827
|
);
|
|
@@ -1642112,7 +1642186,7 @@ function convertIRtoJsonSchema(args) {
|
|
|
1642112
1642186
|
}
|
|
1642113
1642187
|
|
|
1642114
1642188
|
// src/commands/jsonschema/generateJsonschemaForWorkspace.ts
|
|
1642115
|
-
var
|
|
1642189
|
+
var import_promises100 = require("fs/promises");
|
|
1642116
1642190
|
async function generateJsonschemaForWorkspaces({
|
|
1642117
1642191
|
typeLocator,
|
|
1642118
1642192
|
project,
|
|
@@ -1642160,9 +1642234,9 @@ async function generateJsonschemaForWorkspaces({
|
|
|
1642160
1642234
|
context: context2
|
|
1642161
1642235
|
});
|
|
1642162
1642236
|
if (!await doesPathExist(dirname4(jsonschemaFilepath))) {
|
|
1642163
|
-
await (0,
|
|
1642237
|
+
await (0, import_promises100.mkdir)(dirname4(jsonschemaFilepath), { recursive: true });
|
|
1642164
1642238
|
}
|
|
1642165
|
-
await (0,
|
|
1642239
|
+
await (0, import_promises100.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
|
|
1642166
1642240
|
context2.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
|
|
1642167
1642241
|
});
|
|
1642168
1642242
|
})
|
|
@@ -1642519,7 +1642593,7 @@ async function mockServer({
|
|
|
1642519
1642593
|
|
|
1642520
1642594
|
// src/commands/register/registerWorkspacesV1.ts
|
|
1642521
1642595
|
var import_fiddle_sdk7 = __toESM(require_fiddle_sdk(), 1);
|
|
1642522
|
-
var
|
|
1642596
|
+
var import_promises101 = require("fs/promises");
|
|
1642523
1642597
|
var import_path56 = __toESM(require("path"), 1);
|
|
1642524
1642598
|
var import_tar2 = __toESM(require_tar(), 1);
|
|
1642525
1642599
|
var import_tmp_promise16 = __toESM(require_tmp_promise(), 1);
|
|
@@ -1642569,7 +1642643,7 @@ async function registerWorkspacesV1({
|
|
|
1642569
1642643
|
context2.logger.debug(`Compressing definition at ${tmpDir.path}`);
|
|
1642570
1642644
|
await (0, import_tar2.create)({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
|
|
1642571
1642645
|
context2.logger.info("Uploading definition...");
|
|
1642572
|
-
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0,
|
|
1642646
|
+
await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises101.readFile)(tarPath));
|
|
1642573
1642647
|
context2.logger.info(
|
|
1642574
1642648
|
`Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
|
|
1642575
1642649
|
);
|
|
@@ -1642707,7 +1642781,7 @@ async function generateDiff({
|
|
|
1642707
1642781
|
}
|
|
1642708
1642782
|
|
|
1642709
1642783
|
// src/commands/self-update/selfUpdate.ts
|
|
1642710
|
-
var
|
|
1642784
|
+
var import_promises102 = require("fs/promises");
|
|
1642711
1642785
|
var import_path57 = require("path");
|
|
1642712
1642786
|
async function getPackageManagerBinDir(logger, pm) {
|
|
1642713
1642787
|
let command2;
|
|
@@ -1642753,7 +1642827,7 @@ async function detectInstallationMethod(logger) {
|
|
|
1642753
1642827
|
logger.debug(`Found fern at: ${fernPath}`);
|
|
1642754
1642828
|
let resolvedPath;
|
|
1642755
1642829
|
try {
|
|
1642756
|
-
resolvedPath = await (0,
|
|
1642830
|
+
resolvedPath = await (0, import_promises102.realpath)(fernPath);
|
|
1642757
1642831
|
logger.debug(`Resolved to: ${resolvedPath}`);
|
|
1642758
1642832
|
} catch (error2) {
|
|
1642759
1642833
|
logger.debug(`Failed to resolve symlink: ${error2}`);
|
|
@@ -1643034,20 +1643108,20 @@ async function generateToken({
|
|
|
1643034
1643108
|
|
|
1643035
1643109
|
// src/commands/upgrade/updateApiSpec.ts
|
|
1643036
1643110
|
var fs22 = __toESM(require("fs"), 1);
|
|
1643037
|
-
var
|
|
1643111
|
+
var import_promises103 = require("fs/promises");
|
|
1643038
1643112
|
var import_stream9 = require("stream");
|
|
1643039
|
-
var
|
|
1643113
|
+
var import_promises104 = require("stream/promises");
|
|
1643040
1643114
|
async function fetchAndWriteFile(url2, path69, logger, indent3) {
|
|
1643041
1643115
|
const resp = await fetch(url2);
|
|
1643042
1643116
|
if (resp.ok && resp.body) {
|
|
1643043
1643117
|
logger.debug("Origin successfully fetched, writing to file");
|
|
1643044
1643118
|
const fileStream = fs22.createWriteStream(path69);
|
|
1643045
|
-
await (0,
|
|
1643046
|
-
const fileContents = await (0,
|
|
1643119
|
+
await (0, import_promises104.finished)(import_stream9.Readable.fromWeb(resp.body).pipe(fileStream));
|
|
1643120
|
+
const fileContents = await (0, import_promises103.readFile)(path69, "utf8");
|
|
1643047
1643121
|
try {
|
|
1643048
|
-
await (0,
|
|
1643122
|
+
await (0, import_promises103.writeFile)(path69, JSON.stringify(JSON.parse(fileContents), void 0, indent3), "utf8");
|
|
1643049
1643123
|
} catch (e6) {
|
|
1643050
|
-
await (0,
|
|
1643124
|
+
await (0, import_promises103.writeFile)(path69, jsYaml.dump(jsYaml.load(fileContents), { indent: indent3 }), "utf8");
|
|
1643051
1643125
|
}
|
|
1643052
1643126
|
logger.debug("File written successfully");
|
|
1643053
1643127
|
}
|
|
@@ -1643143,7 +1643217,7 @@ async function processDefinitions({
|
|
|
1643143
1643217
|
}
|
|
1643144
1643218
|
|
|
1643145
1643219
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
|
|
1643146
|
-
var
|
|
1643220
|
+
var import_promises105 = require("fs/promises");
|
|
1643147
1643221
|
|
|
1643148
1643222
|
// ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
|
|
1643149
1643223
|
var FERN_DIRECTORY2 = "fern";
|
|
@@ -1643177,7 +1643251,7 @@ var migration = {
|
|
|
1643177
1643251
|
try {
|
|
1643178
1643252
|
const fileContents = await getFileContents(yamlFilepath);
|
|
1643179
1643253
|
const newContents = addDiscriminantToFile(fileContents);
|
|
1643180
|
-
await (0,
|
|
1643254
|
+
await (0, import_promises105.writeFile)(yamlFilepath, newContents);
|
|
1643181
1643255
|
} catch (error2) {
|
|
1643182
1643256
|
context2.failAndThrow("Failed to migrate " + yamlFilepath, error2);
|
|
1643183
1643257
|
}
|
|
@@ -1643185,7 +1643259,7 @@ var migration = {
|
|
|
1643185
1643259
|
}
|
|
1643186
1643260
|
};
|
|
1643187
1643261
|
async function getFileContents(filepath) {
|
|
1643188
|
-
const buffer = await (0,
|
|
1643262
|
+
const buffer = await (0, import_promises105.readFile)(filepath);
|
|
1643189
1643263
|
return buffer.toString();
|
|
1643190
1643264
|
}
|
|
1643191
1643265
|
var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
|
|
@@ -1643214,7 +1643288,7 @@ var versionMigrations = {
|
|
|
1643214
1643288
|
var __default = versionMigrations;
|
|
1643215
1643289
|
|
|
1643216
1643290
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
|
|
1643217
|
-
var
|
|
1643291
|
+
var import_promises106 = require("fs/promises");
|
|
1643218
1643292
|
var import_yaml3 = __toESM(require_dist4(), 1);
|
|
1643219
1643293
|
|
|
1643220
1643294
|
// ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
|
|
@@ -1643255,7 +1643329,7 @@ var migration2 = {
|
|
|
1643255
1643329
|
}
|
|
1643256
1643330
|
};
|
|
1643257
1643331
|
async function migrateFile(filepath, context2) {
|
|
1643258
|
-
const contents = await (0,
|
|
1643332
|
+
const contents = await (0, import_promises106.readFile)(filepath);
|
|
1643259
1643333
|
const parsedDocument = import_yaml3.default.parseDocument(contents.toString());
|
|
1643260
1643334
|
const types4 = parsedDocument.get("types");
|
|
1643261
1643335
|
if (types4 == null) {
|
|
@@ -1643287,7 +1643361,7 @@ async function migrateFile(filepath, context2) {
|
|
|
1643287
1643361
|
}
|
|
1643288
1643362
|
}
|
|
1643289
1643363
|
}
|
|
1643290
|
-
await (0,
|
|
1643364
|
+
await (0, import_promises106.writeFile)(filepath, parsedDocument.toString());
|
|
1643291
1643365
|
}
|
|
1643292
1643366
|
|
|
1643293
1643367
|
// ../cli-migrations/lib/migrations/0.0.203/index.js
|
|
@@ -1643298,7 +1643372,7 @@ var versionMigrations2 = {
|
|
|
1643298
1643372
|
var __default2 = versionMigrations2;
|
|
1643299
1643373
|
|
|
1643300
1643374
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
|
|
1643301
|
-
var
|
|
1643375
|
+
var import_promises107 = require("fs/promises");
|
|
1643302
1643376
|
var import_yaml4 = __toESM(require_dist4(), 1);
|
|
1643303
1643377
|
|
|
1643304
1643378
|
// ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1643339,7 +1643413,7 @@ var migration3 = {
|
|
|
1643339
1643413
|
}
|
|
1643340
1643414
|
};
|
|
1643341
1643415
|
async function migrateGeneratorsYml(filepath, context2) {
|
|
1643342
|
-
const contents = await (0,
|
|
1643416
|
+
const contents = await (0, import_promises107.readFile)(filepath);
|
|
1643343
1643417
|
const parsedDocument = import_yaml4.default.parseDocument(contents.toString());
|
|
1643344
1643418
|
const draftGenerators = parsedDocument.get("draft");
|
|
1643345
1643419
|
if (draftGenerators == null) {
|
|
@@ -1643366,7 +1643440,7 @@ async function migrateGeneratorsYml(filepath, context2) {
|
|
|
1643366
1643440
|
draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
|
|
1643367
1643441
|
}
|
|
1643368
1643442
|
});
|
|
1643369
|
-
await (0,
|
|
1643443
|
+
await (0, import_promises107.writeFile)(filepath, parsedDocument.toString());
|
|
1643370
1643444
|
}
|
|
1643371
1643445
|
|
|
1643372
1643446
|
// ../cli-migrations/lib/migrations/0.0.207/index.js
|
|
@@ -1643377,7 +1643451,7 @@ var versionMigrations3 = {
|
|
|
1643377
1643451
|
var __default3 = versionMigrations3;
|
|
1643378
1643452
|
|
|
1643379
1643453
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
|
|
1643380
|
-
var
|
|
1643454
|
+
var import_promises108 = require("fs/promises");
|
|
1643381
1643455
|
var import_yaml5 = __toESM(require_dist4(), 1);
|
|
1643382
1643456
|
|
|
1643383
1643457
|
// ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
|
|
@@ -1643418,7 +1643492,7 @@ var migration4 = {
|
|
|
1643418
1643492
|
}
|
|
1643419
1643493
|
};
|
|
1643420
1643494
|
async function migrateFile2(filepath, context2) {
|
|
1643421
|
-
const contents = await (0,
|
|
1643495
|
+
const contents = await (0, import_promises108.readFile)(filepath);
|
|
1643422
1643496
|
const parsedDocument = import_yaml5.default.parseDocument(contents.toString());
|
|
1643423
1643497
|
const addType = (typeName, typeDeclaration) => {
|
|
1643424
1643498
|
const types4 = parsedDocument.get("types");
|
|
@@ -1643462,7 +1643536,7 @@ async function migrateFile2(filepath, context2) {
|
|
|
1643462
1643536
|
}
|
|
1643463
1643537
|
}
|
|
1643464
1643538
|
}
|
|
1643465
|
-
await (0,
|
|
1643539
|
+
await (0, import_promises108.writeFile)(filepath, parsedDocument.toString());
|
|
1643466
1643540
|
}
|
|
1643467
1643541
|
|
|
1643468
1643542
|
// ../cli-migrations/lib/migrations/0.0.210/index.js
|
|
@@ -1643473,7 +1643547,7 @@ var versionMigrations4 = {
|
|
|
1643473
1643547
|
var __default4 = versionMigrations4;
|
|
1643474
1643548
|
|
|
1643475
1643549
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
|
|
1643476
|
-
var
|
|
1643550
|
+
var import_promises109 = require("fs/promises");
|
|
1643477
1643551
|
var import_yaml6 = __toESM(require_dist4(), 1);
|
|
1643478
1643552
|
|
|
1643479
1643553
|
// ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
|
|
@@ -1643514,7 +1643588,7 @@ var migration5 = {
|
|
|
1643514
1643588
|
}
|
|
1643515
1643589
|
};
|
|
1643516
1643590
|
async function migrateGeneratorsYml2(filepath, context2) {
|
|
1643517
|
-
const contents = await (0,
|
|
1643591
|
+
const contents = await (0, import_promises109.readFile)(filepath);
|
|
1643518
1643592
|
const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
|
|
1643519
1643593
|
const releaseGenerators = parsedDocument.get("release");
|
|
1643520
1643594
|
if (releaseGenerators == null) {
|
|
@@ -1643552,7 +1643626,7 @@ async function migrateGeneratorsYml2(filepath, context2) {
|
|
|
1643552
1643626
|
}
|
|
1643553
1643627
|
releaseGenerator.delete("outputs");
|
|
1643554
1643628
|
});
|
|
1643555
|
-
await (0,
|
|
1643629
|
+
await (0, import_promises109.writeFile)(filepath, parsedDocument.toString());
|
|
1643556
1643630
|
}
|
|
1643557
1643631
|
|
|
1643558
1643632
|
// ../cli-migrations/lib/migrations/0.0.212/index.js
|
|
@@ -1643563,7 +1643637,7 @@ var versionMigrations5 = {
|
|
|
1643563
1643637
|
var __default5 = versionMigrations5;
|
|
1643564
1643638
|
|
|
1643565
1643639
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
|
|
1643566
|
-
var
|
|
1643640
|
+
var import_promises110 = require("fs/promises");
|
|
1643567
1643641
|
|
|
1643568
1643642
|
// ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
|
|
1643569
1643643
|
var FERN_DIRECTORY7 = "fern";
|
|
@@ -1643594,9 +1643668,9 @@ var migration6 = {
|
|
|
1643594
1643668
|
run: async ({ context: context2 }) => {
|
|
1643595
1643669
|
const yamlFiles = await getAllYamlFiles4(context2);
|
|
1643596
1643670
|
for (const filepath of yamlFiles) {
|
|
1643597
|
-
const contents = await (0,
|
|
1643671
|
+
const contents = await (0, import_promises110.readFile)(filepath);
|
|
1643598
1643672
|
const newContents = contents.toString().replaceAll(" alias:", " type:");
|
|
1643599
|
-
await (0,
|
|
1643673
|
+
await (0, import_promises110.writeFile)(filepath, newContents);
|
|
1643600
1643674
|
}
|
|
1643601
1643675
|
}
|
|
1643602
1643676
|
};
|
|
@@ -1643609,7 +1643683,7 @@ var versionMigrations6 = {
|
|
|
1643609
1643683
|
var __default6 = versionMigrations6;
|
|
1643610
1643684
|
|
|
1643611
1643685
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
|
|
1643612
|
-
var
|
|
1643686
|
+
var import_promises111 = require("fs/promises");
|
|
1643613
1643687
|
|
|
1643614
1643688
|
// ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
|
|
1643615
1643689
|
var FERN_DIRECTORY8 = "fern";
|
|
@@ -1643640,9 +1643714,9 @@ var migration7 = {
|
|
|
1643640
1643714
|
run: async ({ context: context2 }) => {
|
|
1643641
1643715
|
const yamlFiles = await getAllRootApiYamlFiles(context2);
|
|
1643642
1643716
|
for (const filepath of yamlFiles) {
|
|
1643643
|
-
const contents = await (0,
|
|
1643717
|
+
const contents = await (0, import_promises111.readFile)(filepath);
|
|
1643644
1643718
|
const newContents = contents.toString() + "\nerror-discriminant: error";
|
|
1643645
|
-
await (0,
|
|
1643719
|
+
await (0, import_promises111.writeFile)(filepath, newContents);
|
|
1643646
1643720
|
}
|
|
1643647
1643721
|
}
|
|
1643648
1643722
|
};
|
|
@@ -1643655,7 +1643729,7 @@ var versionMigrations7 = {
|
|
|
1643655
1643729
|
var __default7 = versionMigrations7;
|
|
1643656
1643730
|
|
|
1643657
1643731
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
|
|
1643658
|
-
var
|
|
1643732
|
+
var import_promises112 = require("fs/promises");
|
|
1643659
1643733
|
|
|
1643660
1643734
|
// ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
|
|
1643661
1643735
|
var FERN_DIRECTORY9 = "fern";
|
|
@@ -1643762,7 +1643836,7 @@ var migration8 = {
|
|
|
1643762
1643836
|
}
|
|
1643763
1643837
|
};
|
|
1643764
1643838
|
async function migrateGeneratorsYml3(filepath) {
|
|
1643765
|
-
const contentsStr = await (0,
|
|
1643839
|
+
const contentsStr = await (0, import_promises112.readFile)(filepath);
|
|
1643766
1643840
|
const contents = jsYaml.load(contentsStr.toString());
|
|
1643767
1643841
|
const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
|
|
1643768
1643842
|
let newGeneratorsConfiguration = {};
|
|
@@ -1643780,7 +1643854,7 @@ async function migrateGeneratorsYml3(filepath) {
|
|
|
1643780
1643854
|
generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
|
|
1643781
1643855
|
};
|
|
1643782
1643856
|
}
|
|
1643783
|
-
await (0,
|
|
1643857
|
+
await (0, import_promises112.writeFile)(filepath, jsYaml.dump(newGeneratorsConfiguration));
|
|
1643784
1643858
|
}
|
|
1643785
1643859
|
function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
|
|
1643786
1643860
|
const newSchema = {
|
|
@@ -1643855,7 +1643929,7 @@ var versionMigrations8 = {
|
|
|
1643855
1643929
|
var __default8 = versionMigrations8;
|
|
1643856
1643930
|
|
|
1643857
1643931
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
|
|
1643858
|
-
var
|
|
1643932
|
+
var import_promises113 = require("fs/promises");
|
|
1643859
1643933
|
var import_yaml7 = __toESM(require_dist4(), 1);
|
|
1643860
1643934
|
|
|
1643861
1643935
|
// ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
|
|
@@ -1643896,7 +1643970,7 @@ var migration9 = {
|
|
|
1643896
1643970
|
}
|
|
1643897
1643971
|
};
|
|
1643898
1643972
|
async function migrateRootApiFile(filepath) {
|
|
1643899
|
-
const contents = await (0,
|
|
1643973
|
+
const contents = await (0, import_promises113.readFile)(filepath);
|
|
1643900
1643974
|
const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
|
|
1643901
1643975
|
const errorDiscriminant = parsedDocument.get("error-discriminant", true);
|
|
1643902
1643976
|
if (errorDiscriminant == null || !import_yaml7.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
|
|
@@ -1643907,7 +1643981,7 @@ async function migrateRootApiFile(filepath) {
|
|
|
1643907
1643981
|
"property-name": errorDiscriminant.value
|
|
1643908
1643982
|
});
|
|
1643909
1643983
|
parsedDocument.delete("error-discriminant");
|
|
1643910
|
-
await (0,
|
|
1643984
|
+
await (0, import_promises113.writeFile)(filepath, parsedDocument.toString());
|
|
1643911
1643985
|
}
|
|
1643912
1643986
|
|
|
1643913
1643987
|
// ../cli-migrations/lib/migrations/0.0.248/index.js
|
|
@@ -1643918,7 +1643992,7 @@ var versionMigrations9 = {
|
|
|
1643918
1643992
|
var __default9 = versionMigrations9;
|
|
1643919
1643993
|
|
|
1643920
1643994
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
|
|
1643921
|
-
var
|
|
1643995
|
+
var import_promises114 = require("fs/promises");
|
|
1643922
1643996
|
var import_yaml8 = __toESM(require_dist4(), 1);
|
|
1643923
1643997
|
|
|
1643924
1643998
|
// ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
|
|
@@ -1643959,7 +1644033,7 @@ var migration10 = {
|
|
|
1643959
1644033
|
}
|
|
1643960
1644034
|
};
|
|
1643961
1644035
|
async function migrateYamlFile(filepath, context2) {
|
|
1643962
|
-
const contents = await (0,
|
|
1644036
|
+
const contents = await (0, import_promises114.readFile)(filepath);
|
|
1643963
1644037
|
const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
|
|
1643964
1644038
|
const services = parsedDocument.get("services");
|
|
1643965
1644039
|
if (services == null) {
|
|
@@ -1643999,7 +1644073,7 @@ async function migrateYamlFile(filepath, context2) {
|
|
|
1643999
1644073
|
context2.failWithoutThrowing("Failed to convert endpoint", e6);
|
|
1644000
1644074
|
}
|
|
1644001
1644075
|
}
|
|
1644002
|
-
await (0,
|
|
1644076
|
+
await (0, import_promises114.writeFile)(filepath, parsedDocument.toString());
|
|
1644003
1644077
|
}
|
|
1644004
1644078
|
}
|
|
1644005
1644079
|
function convertEndpoint20({ document: document4, endpoint: endpoint3 }) {
|
|
@@ -1644078,7 +1644152,7 @@ var versionMigrations10 = {
|
|
|
1644078
1644152
|
var __default10 = versionMigrations10;
|
|
1644079
1644153
|
|
|
1644080
1644154
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
|
|
1644081
|
-
var
|
|
1644155
|
+
var import_promises115 = require("fs/promises");
|
|
1644082
1644156
|
var import_yaml9 = __toESM(require_dist4(), 1);
|
|
1644083
1644157
|
|
|
1644084
1644158
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
|
|
@@ -1644119,7 +1644193,7 @@ var migration11 = {
|
|
|
1644119
1644193
|
}
|
|
1644120
1644194
|
};
|
|
1644121
1644195
|
async function migrateYamlFile2(filepath, context2) {
|
|
1644122
|
-
const contents = await (0,
|
|
1644196
|
+
const contents = await (0, import_promises115.readFile)(filepath);
|
|
1644123
1644197
|
const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
|
|
1644124
1644198
|
const types4 = parsedDocument.get("types");
|
|
1644125
1644199
|
if (types4 == null) {
|
|
@@ -1644145,7 +1644219,7 @@ async function migrateYamlFile2(filepath, context2) {
|
|
|
1644145
1644219
|
examples.set(i11, { value });
|
|
1644146
1644220
|
}
|
|
1644147
1644221
|
}
|
|
1644148
|
-
await (0,
|
|
1644222
|
+
await (0, import_promises115.writeFile)(filepath, parsedDocument.toString());
|
|
1644149
1644223
|
}
|
|
1644150
1644224
|
|
|
1644151
1644225
|
// ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
|
|
@@ -1644156,7 +1644230,7 @@ var versionMigrations11 = {
|
|
|
1644156
1644230
|
var __default11 = versionMigrations11;
|
|
1644157
1644231
|
|
|
1644158
1644232
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
|
|
1644159
|
-
var
|
|
1644233
|
+
var import_promises116 = require("fs/promises");
|
|
1644160
1644234
|
var import_yaml10 = __toESM(require_dist4(), 1);
|
|
1644161
1644235
|
|
|
1644162
1644236
|
// ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
|
|
@@ -1644197,7 +1644271,7 @@ var migration12 = {
|
|
|
1644197
1644271
|
}
|
|
1644198
1644272
|
};
|
|
1644199
1644273
|
async function migrateYamlFile3(filepath, context2) {
|
|
1644200
|
-
const contents = await (0,
|
|
1644274
|
+
const contents = await (0, import_promises116.readFile)(filepath);
|
|
1644201
1644275
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
1644202
1644276
|
if (!import_yaml10.default.isMap(parsedDocument.contents)) {
|
|
1644203
1644277
|
return context2.failAndThrow("File is not a map");
|
|
@@ -1644227,7 +1644301,7 @@ async function migrateYamlFile3(filepath, context2) {
|
|
|
1644227
1644301
|
pair.value = firstService.value;
|
|
1644228
1644302
|
}
|
|
1644229
1644303
|
}
|
|
1644230
|
-
await (0,
|
|
1644304
|
+
await (0, import_promises116.writeFile)(filepath, parsedDocument.toString());
|
|
1644231
1644305
|
}
|
|
1644232
1644306
|
|
|
1644233
1644307
|
// ../cli-migrations/lib/migrations/0.3.23/index.js
|
|
@@ -1644238,7 +1644312,7 @@ var versionMigrations12 = {
|
|
|
1644238
1644312
|
var __default12 = versionMigrations12;
|
|
1644239
1644313
|
|
|
1644240
1644314
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
|
|
1644241
|
-
var
|
|
1644315
|
+
var import_promises117 = require("fs/promises");
|
|
1644242
1644316
|
var import_yaml11 = __toESM(require_dist4(), 1);
|
|
1644243
1644317
|
|
|
1644244
1644318
|
// ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
|
|
@@ -1644279,7 +1644353,7 @@ var migration13 = {
|
|
|
1644279
1644353
|
}
|
|
1644280
1644354
|
};
|
|
1644281
1644355
|
async function migrateYamlFile4(filepath, context2) {
|
|
1644282
|
-
const contents = await (0,
|
|
1644356
|
+
const contents = await (0, import_promises117.readFile)(filepath);
|
|
1644283
1644357
|
const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
|
|
1644284
1644358
|
if (!import_yaml11.default.isMap(parsedDocument.contents)) {
|
|
1644285
1644359
|
return context2.failAndThrow("File is not a map");
|
|
@@ -1644298,7 +1644372,7 @@ async function migrateYamlFile4(filepath, context2) {
|
|
|
1644298
1644372
|
}
|
|
1644299
1644373
|
service.items.splice(indexOfServiceDocsPair, 1);
|
|
1644300
1644374
|
parsedDocument.contents.items.unshift(docsPair);
|
|
1644301
|
-
await (0,
|
|
1644375
|
+
await (0, import_promises117.writeFile)(filepath, parsedDocument.toString());
|
|
1644302
1644376
|
}
|
|
1644303
1644377
|
|
|
1644304
1644378
|
// ../cli-migrations/lib/migrations/0.5.4/index.js
|
|
@@ -1644309,7 +1644383,7 @@ var versionMigrations13 = {
|
|
|
1644309
1644383
|
var __default13 = versionMigrations13;
|
|
1644310
1644384
|
|
|
1644311
1644385
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
|
|
1644312
|
-
var
|
|
1644386
|
+
var import_promises118 = require("fs/promises");
|
|
1644313
1644387
|
|
|
1644314
1644388
|
// ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
|
|
1644315
1644389
|
var FERN_DIRECTORY15 = "fern";
|
|
@@ -1644349,14 +1644423,14 @@ var migration14 = {
|
|
|
1644349
1644423
|
}
|
|
1644350
1644424
|
};
|
|
1644351
1644425
|
async function migrateYamlFile5(filepath) {
|
|
1644352
|
-
const contents = await (0,
|
|
1644426
|
+
const contents = await (0, import_promises118.readFile)(filepath);
|
|
1644353
1644427
|
const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
|
|
1644354
1644428
|
const regex5 = /(docs:\s*domain:\s*)"([^"]*)"/g;
|
|
1644355
1644429
|
const updatedSnapshot = contents.toString().replace(regex5, (_match, _prefix, domain2) => {
|
|
1644356
1644430
|
return `docs:
|
|
1644357
1644431
|
domain: "${domain2}.${domainSuffix}"`;
|
|
1644358
1644432
|
});
|
|
1644359
|
-
await (0,
|
|
1644433
|
+
await (0, import_promises118.writeFile)(filepath, updatedSnapshot.toString());
|
|
1644360
1644434
|
}
|
|
1644361
1644435
|
|
|
1644362
1644436
|
// ../cli-migrations/lib/migrations/0.9.10/index.js
|
|
@@ -1644372,10 +1644446,10 @@ var import_legacy_docs_config = __toESM(require_legacy_docs_config(), 1);
|
|
|
1644372
1644446
|
var LegacyDocsSerializers = __toESM(require_serialization44(), 1);
|
|
1644373
1644447
|
|
|
1644374
1644448
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
|
|
1644375
|
-
var
|
|
1644449
|
+
var import_promises119 = require("fs/promises");
|
|
1644376
1644450
|
async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
|
|
1644377
1644451
|
const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1644378
|
-
const contentsStr = await (0,
|
|
1644452
|
+
const contentsStr = await (0, import_promises119.readFile)(filepath);
|
|
1644379
1644453
|
const contentsParsed = jsYaml.load(contentsStr.toString());
|
|
1644380
1644454
|
const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
|
|
1644381
1644455
|
if (result.ok) {
|
|
@@ -1644393,7 +1644467,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
|
|
|
1644393
1644467
|
}
|
|
1644394
1644468
|
|
|
1644395
1644469
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
|
|
1644396
|
-
var
|
|
1644470
|
+
var import_promises121 = require("fs/promises");
|
|
1644397
1644471
|
|
|
1644398
1644472
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
|
|
1644399
1644473
|
function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
|
|
@@ -1644571,10 +1644645,10 @@ __export(legacy_exports, {
|
|
|
1644571
1644645
|
});
|
|
1644572
1644646
|
|
|
1644573
1644647
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
|
|
1644574
|
-
var
|
|
1644648
|
+
var import_promises120 = require("fs/promises");
|
|
1644575
1644649
|
async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
|
|
1644576
1644650
|
const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
|
|
1644577
|
-
const contentsStr = await (0,
|
|
1644651
|
+
const contentsStr = await (0, import_promises120.readFile)(filepath);
|
|
1644578
1644652
|
const contentsParsed = jsYaml.load(contentsStr.toString());
|
|
1644579
1644653
|
const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
|
|
1644580
1644654
|
if (result.success) {
|
|
@@ -1644604,7 +1644678,7 @@ function migrateDocsInstances(docsURLs) {
|
|
|
1644604
1644678
|
var APIS_DIRECTORY2 = "apis";
|
|
1644605
1644679
|
async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
|
|
1644606
1644680
|
const absolutePathToApisDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
|
|
1644607
|
-
await (0,
|
|
1644681
|
+
await (0, import_promises121.mkdir)(absolutePathToApisDirectory);
|
|
1644608
1644682
|
for (const workspace of workspaces) {
|
|
1644609
1644683
|
const absolutePathToWorkspace = join2(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
1644610
1644684
|
const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
|
|
@@ -1644612,11 +1644686,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
|
|
|
1644612
1644686
|
await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
|
|
1644613
1644687
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1644614
1644688
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1644615
|
-
await (0,
|
|
1644689
|
+
await (0, import_promises121.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1644616
1644690
|
}
|
|
1644617
1644691
|
const absolutePathToNestedWorkspace = join2(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
1644618
1644692
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1644619
|
-
await (0,
|
|
1644693
|
+
await (0, import_promises121.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1644620
1644694
|
}
|
|
1644621
1644695
|
}
|
|
1644622
1644696
|
async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
@@ -1644629,7 +1644703,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
|
|
|
1644629
1644703
|
generatorsConfiguration,
|
|
1644630
1644704
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1644631
1644705
|
});
|
|
1644632
|
-
await (0,
|
|
1644706
|
+
await (0, import_promises121.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
1644633
1644707
|
return convertedResponse.docsURLs;
|
|
1644634
1644708
|
}
|
|
1644635
1644709
|
async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
|
|
@@ -1644643,19 +1644717,19 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
|
|
|
1644643
1644717
|
apiName
|
|
1644644
1644718
|
});
|
|
1644645
1644719
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1644646
|
-
await (0,
|
|
1644720
|
+
await (0, import_promises121.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
|
|
1644647
1644721
|
}
|
|
1644648
1644722
|
|
|
1644649
1644723
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
|
|
1644650
|
-
var
|
|
1644724
|
+
var import_promises122 = require("fs/promises");
|
|
1644651
1644725
|
async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1644652
1644726
|
const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
|
|
1644653
1644727
|
await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
|
|
1644654
1644728
|
const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
|
|
1644655
1644729
|
await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
|
|
1644656
1644730
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1644657
|
-
await (0,
|
|
1644658
|
-
await (0,
|
|
1644731
|
+
await (0, import_promises122.rm)(absolutePathToDocsFolder, { recursive: true });
|
|
1644732
|
+
await (0, import_promises122.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1644659
1644733
|
}
|
|
1644660
1644734
|
async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
1644661
1644735
|
const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1644668,7 +1644742,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
|
|
|
1644668
1644742
|
apiName: void 0
|
|
1644669
1644743
|
});
|
|
1644670
1644744
|
const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
|
|
1644671
|
-
await (0,
|
|
1644745
|
+
await (0, import_promises122.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
|
|
1644672
1644746
|
}
|
|
1644673
1644747
|
async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
1644674
1644748
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1644680,22 +1644754,22 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
|
|
|
1644680
1644754
|
generatorsConfiguration,
|
|
1644681
1644755
|
pathModificationStrategy: "MoveUp"
|
|
1644682
1644756
|
});
|
|
1644683
|
-
await (0,
|
|
1644757
|
+
await (0, import_promises122.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
1644684
1644758
|
return convertedResponse.docsURLs;
|
|
1644685
1644759
|
}
|
|
1644686
1644760
|
|
|
1644687
1644761
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
|
|
1644688
|
-
var
|
|
1644762
|
+
var import_promises123 = require("fs/promises");
|
|
1644689
1644763
|
var APIS_DIRECTORY3 = "apis";
|
|
1644690
1644764
|
async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
|
|
1644691
1644765
|
const absolutePathToApisDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
|
|
1644692
|
-
await (0,
|
|
1644766
|
+
await (0, import_promises123.mkdir)(absolutePathToApisDirectory);
|
|
1644693
1644767
|
for (const workspace of workspaces) {
|
|
1644694
1644768
|
const absolutePathToWorkspace = join2(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
|
|
1644695
1644769
|
await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
|
|
1644696
1644770
|
const absolutePathToNestedWorkspace = join2(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
|
|
1644697
1644771
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
|
|
1644698
|
-
await (0,
|
|
1644772
|
+
await (0, import_promises123.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1644699
1644773
|
}
|
|
1644700
1644774
|
}
|
|
1644701
1644775
|
async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
@@ -1644708,15 +1644782,15 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
|
|
|
1644708
1644782
|
generatorsConfiguration,
|
|
1644709
1644783
|
pathModificationStrategy: PathModificationStrategy.Nest
|
|
1644710
1644784
|
});
|
|
1644711
|
-
await (0,
|
|
1644785
|
+
await (0, import_promises123.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
1644712
1644786
|
}
|
|
1644713
1644787
|
|
|
1644714
1644788
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
|
|
1644715
|
-
var
|
|
1644789
|
+
var import_promises124 = require("fs/promises");
|
|
1644716
1644790
|
async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
|
|
1644717
1644791
|
await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
|
|
1644718
1644792
|
await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
|
|
1644719
|
-
await (0,
|
|
1644793
|
+
await (0, import_promises124.rm)(absolutePathToWorkspace, { recursive: true });
|
|
1644720
1644794
|
}
|
|
1644721
1644795
|
async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
1644722
1644796
|
const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
|
|
@@ -1644728,7 +1644802,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
|
|
|
1644728
1644802
|
generatorsConfiguration,
|
|
1644729
1644803
|
pathModificationStrategy: "MoveUp"
|
|
1644730
1644804
|
});
|
|
1644731
|
-
await (0,
|
|
1644805
|
+
await (0, import_promises124.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
|
|
1644732
1644806
|
}
|
|
1644733
1644807
|
|
|
1644734
1644808
|
// ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
|
|
@@ -1644805,7 +1644879,7 @@ var versionMigrations15 = {
|
|
|
1644805
1644879
|
var __default15 = versionMigrations15;
|
|
1644806
1644880
|
|
|
1644807
1644881
|
// ../cli-migrations/lib/migrations/0.41.0-rc0/require-generators-yml/migration.js
|
|
1644808
|
-
var
|
|
1644882
|
+
var import_promises125 = require("fs/promises");
|
|
1644809
1644883
|
var import_yaml12 = __toESM(require_dist4(), 1);
|
|
1644810
1644884
|
var migration16 = {
|
|
1644811
1644885
|
name: "require-generators-yml",
|
|
@@ -1644848,7 +1644922,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
1644848
1644922
|
if (existingGeneratorsYml == null) {
|
|
1644849
1644923
|
if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
|
|
1644850
1644924
|
const absolutePathToGeneratorsYml = join2(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
|
|
1644851
|
-
await (0,
|
|
1644925
|
+
await (0, import_promises125.writeFile)(absolutePathToGeneratorsYml, jsYaml.dump({
|
|
1644852
1644926
|
api: {
|
|
1644853
1644927
|
path: join2(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
1644854
1644928
|
}
|
|
@@ -1644863,7 +1644937,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
|
|
|
1644863
1644937
|
parsedDocument.set("api", {
|
|
1644864
1644938
|
path: join2(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
|
|
1644865
1644939
|
});
|
|
1644866
|
-
await (0,
|
|
1644940
|
+
await (0, import_promises125.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
|
|
1644867
1644941
|
context2.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
|
|
1644868
1644942
|
}
|
|
1644869
1644943
|
}
|
|
@@ -1644890,7 +1644964,7 @@ var versionMigrations16 = {
|
|
|
1644890
1644964
|
var __default16 = versionMigrations16;
|
|
1644891
1644965
|
|
|
1644892
1644966
|
// ../cli-migrations/lib/migrations/0.54.0-rc0/use-generators-yml-specs/migration.js
|
|
1644893
|
-
var
|
|
1644967
|
+
var import_promises126 = require("fs/promises");
|
|
1644894
1644968
|
var import_yaml13 = __toESM(require_dist4(), 1);
|
|
1644895
1644969
|
var migration17 = {
|
|
1644896
1644970
|
name: "generators-yml-use-api-specs",
|
|
@@ -1645070,7 +1645144,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
|
|
|
1645070
1645144
|
if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
|
|
1645071
1645145
|
documentToWrite = `${schemaComment}${documentToWrite}`;
|
|
1645072
1645146
|
}
|
|
1645073
|
-
await (0,
|
|
1645147
|
+
await (0, import_promises126.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1645074
1645148
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1645075
1645149
|
}
|
|
1645076
1645150
|
async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context2, namespace }) {
|
|
@@ -1645117,7 +1645191,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
|
|
|
1645117
1645191
|
}
|
|
1645118
1645192
|
let specContent;
|
|
1645119
1645193
|
try {
|
|
1645120
|
-
const fileContents = await (0,
|
|
1645194
|
+
const fileContents = await (0, import_promises126.readFile)(absoluteSpecPath, { encoding: "utf-8" });
|
|
1645121
1645195
|
specContent = jsYaml.load(fileContents);
|
|
1645122
1645196
|
} catch (e6) {
|
|
1645123
1645197
|
context2.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e6}. Skipping...`);
|
|
@@ -1645220,7 +1645294,7 @@ var versionMigrations17 = {
|
|
|
1645220
1645294
|
var __default17 = versionMigrations17;
|
|
1645221
1645295
|
|
|
1645222
1645296
|
// ../cli-migrations/lib/migrations/0.82.1/add-path-parameter-order-setting/migration.js
|
|
1645223
|
-
var
|
|
1645297
|
+
var import_promises127 = require("fs/promises");
|
|
1645224
1645298
|
var migration18 = {
|
|
1645225
1645299
|
name: "add-path-parameter-order-setting",
|
|
1645226
1645300
|
summary: `Adds the 'path-parameter-order' setting to existing API configurations to maintain backwards compatibility.
|
|
@@ -1645308,7 +1645382,7 @@ async function updateGeneratorsYml({ context: context2, files }) {
|
|
|
1645308
1645382
|
documentToWrite = `${schemaComment}
|
|
1645309
1645383
|
${documentToWrite}`;
|
|
1645310
1645384
|
}
|
|
1645311
|
-
await (0,
|
|
1645385
|
+
await (0, import_promises127.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1645312
1645386
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1645313
1645387
|
}
|
|
1645314
1645388
|
async function getFilesAndDirectories3(absoluteFilepath) {
|
|
@@ -1645344,7 +1645418,7 @@ var versionMigrations18 = {
|
|
|
1645344
1645418
|
var __default18 = versionMigrations18;
|
|
1645345
1645419
|
|
|
1645346
1645420
|
// ../cli-migrations/lib/migrations/1.0.0/update-settings-defaults/migration.js
|
|
1645347
|
-
var
|
|
1645421
|
+
var import_promises128 = require("fs/promises");
|
|
1645348
1645422
|
var migration19 = {
|
|
1645349
1645423
|
name: "update-1_0_0-defaults",
|
|
1645350
1645424
|
summary: `The defaults of the API spec settings have changed.
|
|
@@ -1645519,7 +1645593,7 @@ async function updateGeneratorsYml2({ context: context2, files }) {
|
|
|
1645519
1645593
|
documentToWrite = `${schemaComment}
|
|
1645520
1645594
|
${documentToWrite}`;
|
|
1645521
1645595
|
}
|
|
1645522
|
-
await (0,
|
|
1645596
|
+
await (0, import_promises128.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1645523
1645597
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1645524
1645598
|
}
|
|
1645525
1645599
|
async function getFilesAndDirectories4(absoluteFilepath) {
|
|
@@ -1645588,7 +1645662,7 @@ var versionMigrations19 = {
|
|
|
1645588
1645662
|
var __default19 = versionMigrations19;
|
|
1645589
1645663
|
|
|
1645590
1645664
|
// ../cli-migrations/lib/migrations/2.0.0-rc0/update-settings-defaults/migration.js
|
|
1645591
|
-
var
|
|
1645665
|
+
var import_promises129 = require("fs/promises");
|
|
1645592
1645666
|
var migration20 = {
|
|
1645593
1645667
|
name: "update-2_0_0-defaults",
|
|
1645594
1645668
|
summary: `The default of 'coerce-enums-to-literals' has changed from true to false.
|
|
@@ -1645763,7 +1645837,7 @@ async function updateGeneratorsYml3({ context: context2, files }) {
|
|
|
1645763
1645837
|
documentToWrite = `${schemaComment}
|
|
1645764
1645838
|
${documentToWrite}`;
|
|
1645765
1645839
|
}
|
|
1645766
|
-
await (0,
|
|
1645840
|
+
await (0, import_promises129.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1645767
1645841
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1645768
1645842
|
}
|
|
1645769
1645843
|
async function getFilesAndDirectories5(absoluteFilepath) {
|
|
@@ -1645809,7 +1645883,7 @@ var versionMigrations20 = {
|
|
|
1645809
1645883
|
var __default20 = versionMigrations20;
|
|
1645810
1645884
|
|
|
1645811
1645885
|
// ../cli-migrations/lib/migrations/2.13.0/migrate-deprecated-generator-api-settings/migration.js
|
|
1645812
|
-
var
|
|
1645886
|
+
var import_promises130 = require("fs/promises");
|
|
1645813
1645887
|
var migration21 = {
|
|
1645814
1645888
|
name: "migrate-deprecated-generator-api-settings",
|
|
1645815
1645889
|
summary: `Migrates deprecated generator-level API settings keys to their new equivalents:
|
|
@@ -1645900,7 +1645974,7 @@ async function updateGeneratorsYml4({ context: context2, files }) {
|
|
|
1645900
1645974
|
documentToWrite = `${schemaComment}
|
|
1645901
1645975
|
${documentToWrite}`;
|
|
1645902
1645976
|
}
|
|
1645903
|
-
await (0,
|
|
1645977
|
+
await (0, import_promises130.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1645904
1645978
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1645905
1645979
|
}
|
|
1645906
1645980
|
function migrateDeprecatedSettings(settings, context2) {
|
|
@@ -1645946,7 +1646020,7 @@ var versionMigrations21 = {
|
|
|
1645946
1646020
|
var __default21 = versionMigrations21;
|
|
1645947
1646021
|
|
|
1645948
1646022
|
// ../cli-migrations/lib/migrations/3.0.0/enable-smart-casing/migration.js
|
|
1645949
|
-
var
|
|
1646023
|
+
var import_promises131 = require("fs/promises");
|
|
1645950
1646024
|
var migration22 = {
|
|
1645951
1646025
|
name: "enable-smart-casing",
|
|
1645952
1646026
|
summary: `Sets 'smart-casing: false' for existing generators to preserve backwards compatibility.
|
|
@@ -1646030,7 +1646104,7 @@ async function updateGeneratorsYml5({ context: context2, files }) {
|
|
|
1646030
1646104
|
documentToWrite = `${schemaComment}
|
|
1646031
1646105
|
${documentToWrite}`;
|
|
1646032
1646106
|
}
|
|
1646033
|
-
await (0,
|
|
1646107
|
+
await (0, import_promises131.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
|
|
1646034
1646108
|
context2.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
|
|
1646035
1646109
|
}
|
|
1646036
1646110
|
function setSmartCasingFalseIfNotConfigured(generator, context2) {
|
|
@@ -1646171,7 +1646245,7 @@ ${source_default.dim(migration23.summary)}`
|
|
|
1646171
1646245
|
}
|
|
1646172
1646246
|
|
|
1646173
1646247
|
// src/commands/upgrade/upgrade.ts
|
|
1646174
|
-
var
|
|
1646248
|
+
var import_promises132 = require("fs/promises");
|
|
1646175
1646249
|
|
|
1646176
1646250
|
// src/cwd.ts
|
|
1646177
1646251
|
var FERN_CWD_ENV_VAR = "FERN_CWD";
|
|
@@ -1646488,7 +1646562,7 @@ async function upgrade({
|
|
|
1646488
1646562
|
const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
|
|
1646489
1646563
|
draft.version = resolvedTargetVersion;
|
|
1646490
1646564
|
});
|
|
1646491
|
-
await (0,
|
|
1646565
|
+
await (0, import_promises132.writeFile)(
|
|
1646492
1646566
|
projectConfig2._absolutePath,
|
|
1646493
1646567
|
ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2))
|
|
1646494
1646568
|
);
|
|
@@ -1646913,7 +1646987,7 @@ async function validateWorkspaces({
|
|
|
1646913
1646987
|
}
|
|
1646914
1646988
|
|
|
1646915
1646989
|
// src/commands/write-definition/writeDefinitionForWorkspaces.ts
|
|
1646916
|
-
var
|
|
1646990
|
+
var import_promises133 = require("fs/promises");
|
|
1646917
1646991
|
var import_path58 = __toESM(require("path"), 1);
|
|
1646918
1646992
|
async function writeDefinitionForWorkspaces({
|
|
1646919
1646993
|
project,
|
|
@@ -1646994,27 +1647068,27 @@ async function writeFernDefinition({
|
|
|
1646994
1647068
|
return a10.localeCompare(b18);
|
|
1646995
1647069
|
};
|
|
1646996
1647070
|
if (await doesPathExist(absolutePathToOutputDirectory)) {
|
|
1646997
|
-
await (0,
|
|
1647071
|
+
await (0, import_promises133.rm)(absolutePathToOutputDirectory, { recursive: true });
|
|
1646998
1647072
|
}
|
|
1646999
|
-
await (0,
|
|
1647000
|
-
await (0,
|
|
1647073
|
+
await (0, import_promises133.mkdir)(absolutePathToOutputDirectory, { recursive: true });
|
|
1647074
|
+
await (0, import_promises133.writeFile)(
|
|
1647001
1647075
|
join2(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
|
|
1647002
1647076
|
jsYaml.dump(definition3.rootApiFile.contents, { sortKeys })
|
|
1647003
1647077
|
);
|
|
1647004
1647078
|
for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
|
|
1647005
1647079
|
const absoluteFilepath = join2(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
1647006
|
-
await (0,
|
|
1647007
|
-
await (0,
|
|
1647080
|
+
await (0, import_promises133.mkdir)(dirname4(absoluteFilepath), { recursive: true });
|
|
1647081
|
+
await (0, import_promises133.writeFile)(absoluteFilepath, jsYaml.dump(packageMarker.contents, { sortKeys }));
|
|
1647008
1647082
|
}
|
|
1647009
1647083
|
for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
|
|
1647010
1647084
|
const absoluteFilepath = join2(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
|
|
1647011
|
-
await (0,
|
|
1647012
|
-
await (0,
|
|
1647085
|
+
await (0, import_promises133.mkdir)(dirname4(absoluteFilepath), { recursive: true });
|
|
1647086
|
+
await (0, import_promises133.writeFile)(absoluteFilepath, jsYaml.dump(definitionFile.contents, { sortKeys }));
|
|
1647013
1647087
|
}
|
|
1647014
1647088
|
}
|
|
1647015
1647089
|
|
|
1647016
1647090
|
// src/commands/write-docs-definition/writeDocsDefinitionForProject.ts
|
|
1647017
|
-
var
|
|
1647091
|
+
var import_promises134 = require("fs/promises");
|
|
1647018
1647092
|
async function writeDocsDefinitionForProject({
|
|
1647019
1647093
|
project,
|
|
1647020
1647094
|
outputPath,
|
|
@@ -1647046,7 +1647120,7 @@ async function writeDocsDefinitionForProject({
|
|
|
1647046
1647120
|
targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
|
|
1647047
1647121
|
});
|
|
1647048
1647122
|
const docsDefinition = await docsResolver.resolve();
|
|
1647049
|
-
await (0,
|
|
1647123
|
+
await (0, import_promises134.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
|
|
1647050
1647124
|
context2.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
|
|
1647051
1647125
|
});
|
|
1647052
1647126
|
}
|
|
@@ -1647054,7 +1647128,7 @@ async function writeDocsDefinitionForProject({
|
|
|
1647054
1647128
|
// src/commands/write-translation/writeTranslationForProject.ts
|
|
1647055
1647129
|
var import_cli_progress2 = __toESM(require_cli_progress(), 1);
|
|
1647056
1647130
|
var import_fs21 = require("fs");
|
|
1647057
|
-
var
|
|
1647131
|
+
var import_promises138 = require("fs/promises");
|
|
1647058
1647132
|
var import_is_ci2 = __toESM(require_is_ci(), 1);
|
|
1647059
1647133
|
var import_path61 = __toESM(require("path"), 1);
|
|
1647060
1647134
|
|
|
@@ -1647539,7 +1647613,7 @@ function shouldProcessFile(filePath, stub) {
|
|
|
1647539
1647613
|
}
|
|
1647540
1647614
|
|
|
1647541
1647615
|
// src/commands/write-translation/docs-config-utils.ts
|
|
1647542
|
-
var
|
|
1647616
|
+
var import_promises135 = require("fs/promises");
|
|
1647543
1647617
|
|
|
1647544
1647618
|
// src/commands/write-translation/url-utils.ts
|
|
1647545
1647619
|
function addLanguageSuffixToUrl(url2, language) {
|
|
@@ -1647696,7 +1647770,7 @@ async function createLanguageSpecificDocsConfig({
|
|
|
1647696
1647770
|
stub = false
|
|
1647697
1647771
|
}) {
|
|
1647698
1647772
|
try {
|
|
1647699
|
-
const originalConfigContent = await (0,
|
|
1647773
|
+
const originalConfigContent = await (0, import_promises135.readFile)(originalDocsConfigPath, "utf-8");
|
|
1647700
1647774
|
const transformation = {
|
|
1647701
1647775
|
filePath: DOCS_CONFIGURATION_FILENAME,
|
|
1647702
1647776
|
language,
|
|
@@ -1647710,7 +1647784,7 @@ async function createLanguageSpecificDocsConfig({
|
|
|
1647710
1647784
|
const modifiedConfigContent = jsYaml.dump(modifiedConfig, {
|
|
1647711
1647785
|
sortKeys: false
|
|
1647712
1647786
|
});
|
|
1647713
|
-
await (0,
|
|
1647787
|
+
await (0, import_promises135.writeFile)(modifiedConfigPath, modifiedConfigContent, "utf-8");
|
|
1647714
1647788
|
context2.logger.debug(`Created language-specific docs config: ${modifiedConfigPath}`);
|
|
1647715
1647789
|
} catch (error2) {
|
|
1647716
1647790
|
if (error2 instanceof Error && error2.message.includes("403")) {
|
|
@@ -1647722,11 +1647796,11 @@ async function createLanguageSpecificDocsConfig({
|
|
|
1647722
1647796
|
|
|
1647723
1647797
|
// src/commands/write-translation/file-collection-utils.ts
|
|
1647724
1647798
|
var import_fs19 = require("fs");
|
|
1647725
|
-
var
|
|
1647799
|
+
var import_promises136 = require("fs/promises");
|
|
1647726
1647800
|
var import_path59 = __toESM(require("path"), 1);
|
|
1647727
1647801
|
async function collectFiles(baseDirectory, relativeBase) {
|
|
1647728
1647802
|
const discoveredFiles = {};
|
|
1647729
|
-
const entries10 = await (0,
|
|
1647803
|
+
const entries10 = await (0, import_promises136.readdir)(baseDirectory);
|
|
1647730
1647804
|
for (const entry of entries10) {
|
|
1647731
1647805
|
if (entry === "translations") {
|
|
1647732
1647806
|
continue;
|
|
@@ -1647749,7 +1647823,7 @@ async function collectFiles(baseDirectory, relativeBase) {
|
|
|
1647749
1647823
|
// src/commands/write-translation/hash-utils.ts
|
|
1647750
1647824
|
var import_crypto10 = require("crypto");
|
|
1647751
1647825
|
var import_fs20 = require("fs");
|
|
1647752
|
-
var
|
|
1647826
|
+
var import_promises137 = require("fs/promises");
|
|
1647753
1647827
|
var import_path60 = __toESM(require("path"), 1);
|
|
1647754
1647828
|
function calculateContentHash(content5) {
|
|
1647755
1647829
|
return (0, import_crypto10.createHash)("sha256").update(content5, "utf-8").digest("hex");
|
|
@@ -1647760,7 +1647834,7 @@ async function loadHashMappings(translationsDirectory) {
|
|
|
1647760
1647834
|
return {};
|
|
1647761
1647835
|
}
|
|
1647762
1647836
|
try {
|
|
1647763
|
-
const hashesContent = await (0,
|
|
1647837
|
+
const hashesContent = await (0, import_promises137.readFile)(hashesFilePath, "utf-8");
|
|
1647764
1647838
|
const parsed = JSON.parse(hashesContent);
|
|
1647765
1647839
|
const { _comment, ...hashMappings } = parsed;
|
|
1647766
1647840
|
return hashMappings;
|
|
@@ -1647781,11 +1647855,11 @@ async function saveHashMappings(translationsDirectory, hashMappings) {
|
|
|
1647781
1647855
|
_comment: "This file is auto-generated by Fern to track source file changes for translation purposes. Do not edit manually - it will be overwritten on the next translation update.",
|
|
1647782
1647856
|
...sortedMappings
|
|
1647783
1647857
|
};
|
|
1647784
|
-
await (0,
|
|
1647858
|
+
await (0, import_promises137.writeFile)(hashesFilePath, JSON.stringify(fileContent, null, 2), "utf-8");
|
|
1647785
1647859
|
}
|
|
1647786
1647860
|
async function hasFileChanged(filePath, relativePath, previousHashes) {
|
|
1647787
1647861
|
try {
|
|
1647788
|
-
const content5 = await (0,
|
|
1647862
|
+
const content5 = await (0, import_promises137.readFile)(filePath, "utf-8");
|
|
1647789
1647863
|
const currentHash = calculateContentHash(content5);
|
|
1647790
1647864
|
const previousHash = previousHashes[relativePath];
|
|
1647791
1647865
|
return currentHash !== previousHash;
|
|
@@ -1647838,7 +1647912,7 @@ async function writeTranslationForProject({
|
|
|
1647838
1647912
|
}
|
|
1647839
1647913
|
if (!(0, import_fs21.existsSync)(translationsDirectory)) {
|
|
1647840
1647914
|
context2.logger.debug(`Creating translations directory at: ${translationsDirectory}`);
|
|
1647841
|
-
await (0,
|
|
1647915
|
+
await (0, import_promises138.mkdir)(translationsDirectory, { recursive: true });
|
|
1647842
1647916
|
}
|
|
1647843
1647917
|
const languageStats = {};
|
|
1647844
1647918
|
const targetLanguages = languages.filter((lang) => lang !== sourceLanguage);
|
|
@@ -1647851,7 +1647925,7 @@ async function writeTranslationForProject({
|
|
|
1647851
1647925
|
RelativeFilePath2.of("fern")
|
|
1647852
1647926
|
);
|
|
1647853
1647927
|
if (!(0, import_fs21.existsSync)(languageDirectory)) {
|
|
1647854
|
-
await (0,
|
|
1647928
|
+
await (0, import_promises138.mkdir)(languageDirectory, { recursive: true });
|
|
1647855
1647929
|
}
|
|
1647856
1647930
|
languageStats[language] = {
|
|
1647857
1647931
|
filesProcessed: 0,
|
|
@@ -1647953,7 +1648027,7 @@ async function writeTranslationForProject({
|
|
|
1647953
1648027
|
`[COMPLETED] ${DOCS_CONFIGURATION_FILENAME} -> ${language}/${DOCS_CONFIGURATION_FILENAME}`
|
|
1647954
1648028
|
);
|
|
1647955
1648029
|
}
|
|
1647956
|
-
const originalConfigContent = await (0,
|
|
1648030
|
+
const originalConfigContent = await (0, import_promises138.readFile)(originalDocsConfigPath, "utf-8");
|
|
1647957
1648031
|
await updateAndSaveHashForFile(
|
|
1647958
1648032
|
translationsDirectory,
|
|
1647959
1648033
|
hashMappings,
|
|
@@ -1647998,7 +1648072,7 @@ async function writeTranslationForProject({
|
|
|
1647998
1648072
|
continue;
|
|
1647999
1648073
|
}
|
|
1648000
1648074
|
cliContext.logger.debug(`[PROCESSING] ${relativePath} (detected changes)`);
|
|
1648001
|
-
const originalContent = await (0,
|
|
1648075
|
+
const originalContent = await (0, import_promises138.readFile)(filePath, "utf-8");
|
|
1648002
1648076
|
await updateAndSaveHashForFile(translationsDirectory, hashMappings, relativePath, originalContent);
|
|
1648003
1648077
|
const sourceStats = languageStats[sourceLanguage];
|
|
1648004
1648078
|
if (sourceStats) {
|
|
@@ -1648023,7 +1648097,7 @@ async function writeTranslationForProject({
|
|
|
1648023
1648097
|
const destPath = join2(languageDirectory, relativePath);
|
|
1648024
1648098
|
const destDir = import_path61.default.dirname(destPath);
|
|
1648025
1648099
|
if (!(0, import_fs21.existsSync)(destDir)) {
|
|
1648026
|
-
await (0,
|
|
1648100
|
+
await (0, import_promises138.mkdir)(destDir, { recursive: true });
|
|
1648027
1648101
|
}
|
|
1648028
1648102
|
const transformation = {
|
|
1648029
1648103
|
filePath: relativePath,
|
|
@@ -1648036,7 +1648110,7 @@ async function writeTranslationForProject({
|
|
|
1648036
1648110
|
cliContext,
|
|
1648037
1648111
|
stub
|
|
1648038
1648112
|
});
|
|
1648039
|
-
await (0,
|
|
1648113
|
+
await (0, import_promises138.writeFile)(destPath, transformedContent, "utf-8");
|
|
1648040
1648114
|
const languageStatsForLang = languageStats[language];
|
|
1648041
1648115
|
if (languageStatsForLang) {
|
|
1648042
1648116
|
languageStatsForLang.filesProcessed++;
|
|
@@ -1648067,9 +1648141,9 @@ async function writeTranslationForProject({
|
|
|
1648067
1648141
|
const destPath = join2(languageDirectory, relativePath);
|
|
1648068
1648142
|
const destDir = import_path61.default.dirname(destPath);
|
|
1648069
1648143
|
if (!(0, import_fs21.existsSync)(destDir)) {
|
|
1648070
|
-
await (0,
|
|
1648144
|
+
await (0, import_promises138.mkdir)(destDir, { recursive: true });
|
|
1648071
1648145
|
}
|
|
1648072
|
-
await (0,
|
|
1648146
|
+
await (0, import_promises138.copyFile)(filePath, destPath);
|
|
1648073
1648147
|
assetsCopied++;
|
|
1648074
1648148
|
cliContext.logger.debug(`[ASSET COPIED] ${relativePath} -> ${language}/${relativePath}`);
|
|
1648075
1648149
|
}
|