houdini 1.2.44 → 1.2.45
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/build/cmd-cjs/index.js +651 -844
- package/build/cmd-esm/index.js +501 -694
- package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
- package/build/codegen-cjs/index.js +649 -842
- package/build/codegen-esm/index.js +499 -692
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/typescript.d.ts +19 -0
- package/build/lib-cjs/index.js +667 -464
- package/build/lib-esm/index.js +661 -464
- package/build/runtime/client/index.d.ts +7 -1
- package/build/runtime/client/plugins/fragment.d.ts +2 -2
- package/build/runtime/client/plugins/mutation.d.ts +2 -1
- package/build/runtime/client/plugins/query.d.ts +2 -2
- package/build/runtime/lib/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +13 -2
- package/build/runtime/router/types.d.ts +3 -1
- package/build/runtime-cjs/client/index.d.ts +7 -1
- package/build/runtime-cjs/client/index.js +26 -11
- package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/fragment.js +4 -11
- package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-cjs/client/plugins/mutation.js +8 -15
- package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/query.js +4 -11
- package/build/runtime-cjs/lib/scalars.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.js +4 -0
- package/build/runtime-cjs/lib/types.d.ts +13 -2
- package/build/runtime-cjs/router/types.d.ts +3 -1
- package/build/runtime-esm/client/index.d.ts +7 -1
- package/build/runtime-esm/client/index.js +26 -11
- package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-esm/client/plugins/fragment.js +1 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-esm/client/plugins/mutation.js +1 -2
- package/build/runtime-esm/client/plugins/query.d.ts +2 -2
- package/build/runtime-esm/client/plugins/query.js +1 -2
- package/build/runtime-esm/lib/scalars.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.js +6 -0
- package/build/runtime-esm/lib/types.d.ts +13 -2
- package/build/runtime-esm/router/types.d.ts +3 -1
- package/build/test-cjs/index.js +664 -840
- package/build/test-esm/index.js +514 -690
- package/build/vite-cjs/index.js +761 -852
- package/build/vite-esm/index.js +611 -702
- package/package.json +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
- package/build/codegen/generators/typescript/types.d.ts +0 -10
package/build/lib-cjs/index.js
CHANGED
|
@@ -13560,14 +13560,14 @@ var require_lib3 = __commonJS({
|
|
|
13560
13560
|
this.preserveSpace = !!preserveSpace;
|
|
13561
13561
|
}
|
|
13562
13562
|
};
|
|
13563
|
-
var
|
|
13563
|
+
var types5 = {
|
|
13564
13564
|
brace: new TokContext("{"),
|
|
13565
13565
|
j_oTag: new TokContext("<tag"),
|
|
13566
13566
|
j_cTag: new TokContext("</tag"),
|
|
13567
13567
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
13568
13568
|
};
|
|
13569
13569
|
{
|
|
13570
|
-
|
|
13570
|
+
types5.template = new TokContext("`", true);
|
|
13571
13571
|
}
|
|
13572
13572
|
var beforeExpr = true;
|
|
13573
13573
|
var startsExpr = true;
|
|
@@ -14105,17 +14105,17 @@ var require_lib3 = __commonJS({
|
|
|
14105
14105
|
context.pop();
|
|
14106
14106
|
};
|
|
14107
14107
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
14108
|
-
context.push(
|
|
14108
|
+
context.push(types5.brace);
|
|
14109
14109
|
};
|
|
14110
14110
|
tokenTypes[22].updateContext = (context) => {
|
|
14111
|
-
if (context[context.length - 1] ===
|
|
14111
|
+
if (context[context.length - 1] === types5.template) {
|
|
14112
14112
|
context.pop();
|
|
14113
14113
|
} else {
|
|
14114
|
-
context.push(
|
|
14114
|
+
context.push(types5.template);
|
|
14115
14115
|
}
|
|
14116
14116
|
};
|
|
14117
14117
|
tokenTypes[142].updateContext = (context) => {
|
|
14118
|
-
context.push(
|
|
14118
|
+
context.push(types5.j_expr, types5.j_oTag);
|
|
14119
14119
|
};
|
|
14120
14120
|
}
|
|
14121
14121
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -14675,7 +14675,7 @@ var require_lib3 = __commonJS({
|
|
|
14675
14675
|
this.end = 0;
|
|
14676
14676
|
this.lastTokEndLoc = null;
|
|
14677
14677
|
this.lastTokStartLoc = null;
|
|
14678
|
-
this.context = [
|
|
14678
|
+
this.context = [types5.brace];
|
|
14679
14679
|
this.firstInvalidTemplateEscapePos = null;
|
|
14680
14680
|
this.strictErrors = /* @__PURE__ */ new Map();
|
|
14681
14681
|
this.tokensLength = 0;
|
|
@@ -18502,7 +18502,7 @@ var require_lib3 = __commonJS({
|
|
|
18502
18502
|
context
|
|
18503
18503
|
} = this.state;
|
|
18504
18504
|
const currentContext = context[context.length - 1];
|
|
18505
|
-
if (currentContext ===
|
|
18505
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
18506
18506
|
context.pop();
|
|
18507
18507
|
}
|
|
18508
18508
|
}
|
|
@@ -19524,9 +19524,9 @@ var require_lib3 = __commonJS({
|
|
|
19524
19524
|
switch (this.state.type) {
|
|
19525
19525
|
case 5:
|
|
19526
19526
|
node = this.startNode();
|
|
19527
|
-
this.setContext(
|
|
19527
|
+
this.setContext(types5.brace);
|
|
19528
19528
|
this.next();
|
|
19529
|
-
node = this.jsxParseExpressionContainer(node,
|
|
19529
|
+
node = this.jsxParseExpressionContainer(node, types5.j_oTag);
|
|
19530
19530
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
19531
19531
|
this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
19532
19532
|
}
|
|
@@ -19545,7 +19545,7 @@ var require_lib3 = __commonJS({
|
|
|
19545
19545
|
jsxParseSpreadChild(node) {
|
|
19546
19546
|
this.next();
|
|
19547
19547
|
node.expression = this.parseExpression();
|
|
19548
|
-
this.setContext(
|
|
19548
|
+
this.setContext(types5.j_expr);
|
|
19549
19549
|
this.state.canStartJSXElement = true;
|
|
19550
19550
|
this.expect(8);
|
|
19551
19551
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -19565,11 +19565,11 @@ var require_lib3 = __commonJS({
|
|
|
19565
19565
|
jsxParseAttribute() {
|
|
19566
19566
|
const node = this.startNode();
|
|
19567
19567
|
if (this.match(5)) {
|
|
19568
|
-
this.setContext(
|
|
19568
|
+
this.setContext(types5.brace);
|
|
19569
19569
|
this.next();
|
|
19570
19570
|
this.expect(21);
|
|
19571
19571
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
19572
|
-
this.setContext(
|
|
19572
|
+
this.setContext(types5.j_oTag);
|
|
19573
19573
|
this.state.canStartJSXElement = true;
|
|
19574
19574
|
this.expect(8);
|
|
19575
19575
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -19628,12 +19628,12 @@ var require_lib3 = __commonJS({
|
|
|
19628
19628
|
break;
|
|
19629
19629
|
case 5: {
|
|
19630
19630
|
const node2 = this.startNode();
|
|
19631
|
-
this.setContext(
|
|
19631
|
+
this.setContext(types5.brace);
|
|
19632
19632
|
this.next();
|
|
19633
19633
|
if (this.match(21)) {
|
|
19634
19634
|
children.push(this.jsxParseSpreadChild(node2));
|
|
19635
19635
|
} else {
|
|
19636
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
19636
|
+
children.push(this.jsxParseExpressionContainer(node2, types5.j_expr));
|
|
19637
19637
|
}
|
|
19638
19638
|
break;
|
|
19639
19639
|
}
|
|
@@ -19698,11 +19698,11 @@ var require_lib3 = __commonJS({
|
|
|
19698
19698
|
}
|
|
19699
19699
|
getTokenFromCode(code2) {
|
|
19700
19700
|
const context = this.curContext();
|
|
19701
|
-
if (context ===
|
|
19701
|
+
if (context === types5.j_expr) {
|
|
19702
19702
|
this.jsxReadToken();
|
|
19703
19703
|
return;
|
|
19704
19704
|
}
|
|
19705
|
-
if (context ===
|
|
19705
|
+
if (context === types5.j_oTag || context === types5.j_cTag) {
|
|
19706
19706
|
if (isIdentifierStart(code2)) {
|
|
19707
19707
|
this.jsxReadWord();
|
|
19708
19708
|
return;
|
|
@@ -19712,7 +19712,7 @@ var require_lib3 = __commonJS({
|
|
|
19712
19712
|
this.finishToken(143);
|
|
19713
19713
|
return;
|
|
19714
19714
|
}
|
|
19715
|
-
if ((code2 === 34 || code2 === 39) && context ===
|
|
19715
|
+
if ((code2 === 34 || code2 === 39) && context === types5.j_oTag) {
|
|
19716
19716
|
this.jsxReadString(code2);
|
|
19717
19717
|
return;
|
|
19718
19718
|
}
|
|
@@ -19730,17 +19730,17 @@ var require_lib3 = __commonJS({
|
|
|
19730
19730
|
type
|
|
19731
19731
|
} = this.state;
|
|
19732
19732
|
if (type === 56 && prevType === 142) {
|
|
19733
|
-
context.splice(-2, 2,
|
|
19733
|
+
context.splice(-2, 2, types5.j_cTag);
|
|
19734
19734
|
this.state.canStartJSXElement = false;
|
|
19735
19735
|
} else if (type === 142) {
|
|
19736
|
-
context.push(
|
|
19736
|
+
context.push(types5.j_oTag);
|
|
19737
19737
|
} else if (type === 143) {
|
|
19738
19738
|
const out = context[context.length - 1];
|
|
19739
|
-
if (out ===
|
|
19739
|
+
if (out === types5.j_oTag && prevType === 56 || out === types5.j_cTag) {
|
|
19740
19740
|
context.pop();
|
|
19741
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
19741
|
+
this.state.canStartJSXElement = context[context.length - 1] === types5.j_expr;
|
|
19742
19742
|
} else {
|
|
19743
|
-
this.setContext(
|
|
19743
|
+
this.setContext(types5.j_expr);
|
|
19744
19744
|
this.state.canStartJSXElement = true;
|
|
19745
19745
|
}
|
|
19746
19746
|
} else {
|
|
@@ -21115,14 +21115,14 @@ var require_lib3 = __commonJS({
|
|
|
21115
21115
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
21116
21116
|
const node = this.startNode();
|
|
21117
21117
|
const hasLeadingOperator = this.eat(operator);
|
|
21118
|
-
const
|
|
21118
|
+
const types6 = [];
|
|
21119
21119
|
do {
|
|
21120
|
-
|
|
21120
|
+
types6.push(parseConstituentType());
|
|
21121
21121
|
} while (this.eat(operator));
|
|
21122
|
-
if (
|
|
21123
|
-
return
|
|
21122
|
+
if (types6.length === 1 && !hasLeadingOperator) {
|
|
21123
|
+
return types6[0];
|
|
21124
21124
|
}
|
|
21125
|
-
node.types =
|
|
21125
|
+
node.types = types6;
|
|
21126
21126
|
return this.finishNode(node, kind);
|
|
21127
21127
|
}
|
|
21128
21128
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -21686,7 +21686,7 @@ var require_lib3 = __commonJS({
|
|
|
21686
21686
|
}));
|
|
21687
21687
|
if (node.params.length === 0) {
|
|
21688
21688
|
this.raise(TSErrors.EmptyTypeArguments, node);
|
|
21689
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
21689
|
+
} else if (!this.state.inType && this.curContext() === types5.brace) {
|
|
21690
21690
|
this.reScan_lt_gt();
|
|
21691
21691
|
}
|
|
21692
21692
|
this.expect(48);
|
|
@@ -22312,7 +22312,7 @@ var require_lib3 = __commonJS({
|
|
|
22312
22312
|
context
|
|
22313
22313
|
} = this.state;
|
|
22314
22314
|
const currentContext = context[context.length - 1];
|
|
22315
|
-
if (currentContext ===
|
|
22315
|
+
if (currentContext === types5.j_oTag || currentContext === types5.j_expr) {
|
|
22316
22316
|
context.pop();
|
|
22317
22317
|
}
|
|
22318
22318
|
}
|
|
@@ -27444,9 +27444,9 @@ var require_shared = __commonJS({
|
|
|
27444
27444
|
var tslib_1 = require_tslib();
|
|
27445
27445
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
27446
27446
|
function default_1(fork) {
|
|
27447
|
-
var
|
|
27448
|
-
var Type =
|
|
27449
|
-
var builtin =
|
|
27447
|
+
var types5 = fork.use(types_1.default);
|
|
27448
|
+
var Type = types5.Type;
|
|
27449
|
+
var builtin = types5.builtInTypes;
|
|
27450
27450
|
var isNumber = builtin.number;
|
|
27451
27451
|
function geq(than) {
|
|
27452
27452
|
return Type.from(function(value) {
|
|
@@ -27596,9 +27596,9 @@ var require_types = __commonJS({
|
|
|
27596
27596
|
}(BaseType);
|
|
27597
27597
|
var OrType = function(_super) {
|
|
27598
27598
|
tslib_1.__extends(OrType2, _super);
|
|
27599
|
-
function OrType2(
|
|
27599
|
+
function OrType2(types5) {
|
|
27600
27600
|
var _this = _super.call(this) || this;
|
|
27601
|
-
_this.types =
|
|
27601
|
+
_this.types = types5;
|
|
27602
27602
|
_this.kind = "OrType";
|
|
27603
27603
|
return _this;
|
|
27604
27604
|
}
|
|
@@ -27739,11 +27739,11 @@ var require_types = __commonJS({
|
|
|
27739
27739
|
function typesPlugin(_fork) {
|
|
27740
27740
|
var Type = {
|
|
27741
27741
|
or: function() {
|
|
27742
|
-
var
|
|
27742
|
+
var types5 = [];
|
|
27743
27743
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
27744
|
-
|
|
27744
|
+
types5[_i] = arguments[_i];
|
|
27745
27745
|
}
|
|
27746
|
-
return new OrType(
|
|
27746
|
+
return new OrType(types5.map(function(type) {
|
|
27747
27747
|
return Type.from(type);
|
|
27748
27748
|
}));
|
|
27749
27749
|
},
|
|
@@ -28188,9 +28188,9 @@ var require_path2 = __commonJS({
|
|
|
28188
28188
|
var Op = Object.prototype;
|
|
28189
28189
|
var hasOwn = Op.hasOwnProperty;
|
|
28190
28190
|
function pathPlugin(fork) {
|
|
28191
|
-
var
|
|
28192
|
-
var isArray =
|
|
28193
|
-
var isNumber =
|
|
28191
|
+
var types5 = fork.use(types_1.default);
|
|
28192
|
+
var isArray = types5.builtInTypes.array;
|
|
28193
|
+
var isNumber = types5.builtInTypes.number;
|
|
28194
28194
|
var Path = function Path2(value, parentPath, name) {
|
|
28195
28195
|
if (!(this instanceof Path2)) {
|
|
28196
28196
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -28492,13 +28492,13 @@ var require_scope = __commonJS({
|
|
|
28492
28492
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
28493
28493
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
28494
28494
|
function scopePlugin(fork) {
|
|
28495
|
-
var
|
|
28496
|
-
var Type =
|
|
28497
|
-
var namedTypes =
|
|
28495
|
+
var types5 = fork.use(types_1.default);
|
|
28496
|
+
var Type = types5.Type;
|
|
28497
|
+
var namedTypes = types5.namedTypes;
|
|
28498
28498
|
var Node = namedTypes.Node;
|
|
28499
28499
|
var Expression = namedTypes.Expression;
|
|
28500
|
-
var isArray =
|
|
28501
|
-
var b =
|
|
28500
|
+
var isArray = types5.builtInTypes.array;
|
|
28501
|
+
var b = types5.builders;
|
|
28502
28502
|
var Scope = function Scope2(path3, parentScope) {
|
|
28503
28503
|
if (!(this instanceof Scope2)) {
|
|
28504
28504
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -28561,7 +28561,7 @@ var require_scope = __commonJS({
|
|
|
28561
28561
|
++index;
|
|
28562
28562
|
}
|
|
28563
28563
|
var name = prefix + index;
|
|
28564
|
-
return this.bindings[name] =
|
|
28564
|
+
return this.bindings[name] = types5.builders.identifier(name);
|
|
28565
28565
|
};
|
|
28566
28566
|
Sp.injectTemporary = function(identifier, init) {
|
|
28567
28567
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -28637,7 +28637,7 @@ var require_scope = __commonJS({
|
|
|
28637
28637
|
bindings
|
|
28638
28638
|
);
|
|
28639
28639
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
28640
|
-
|
|
28640
|
+
types5.eachField(node, function(name, child) {
|
|
28641
28641
|
var childPath = path3.get(name);
|
|
28642
28642
|
if (!pathHasValue(childPath, child)) {
|
|
28643
28643
|
throw new Error("");
|
|
@@ -28715,24 +28715,24 @@ var require_scope = __commonJS({
|
|
|
28715
28715
|
addPattern(patternPath.get("argument"), bindings);
|
|
28716
28716
|
}
|
|
28717
28717
|
}
|
|
28718
|
-
function addTypePattern(patternPath,
|
|
28718
|
+
function addTypePattern(patternPath, types6) {
|
|
28719
28719
|
var pattern = patternPath.value;
|
|
28720
28720
|
namedTypes.Pattern.assert(pattern);
|
|
28721
28721
|
if (namedTypes.Identifier.check(pattern)) {
|
|
28722
|
-
if (hasOwn.call(
|
|
28723
|
-
|
|
28722
|
+
if (hasOwn.call(types6, pattern.name)) {
|
|
28723
|
+
types6[pattern.name].push(patternPath);
|
|
28724
28724
|
} else {
|
|
28725
|
-
|
|
28725
|
+
types6[pattern.name] = [patternPath];
|
|
28726
28726
|
}
|
|
28727
28727
|
}
|
|
28728
28728
|
}
|
|
28729
|
-
function addTypeParameter(parameterPath,
|
|
28729
|
+
function addTypeParameter(parameterPath, types6) {
|
|
28730
28730
|
var parameter = parameterPath.value;
|
|
28731
28731
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
28732
|
-
if (hasOwn.call(
|
|
28733
|
-
|
|
28732
|
+
if (hasOwn.call(types6, parameter.name)) {
|
|
28733
|
+
types6[parameter.name].push(parameterPath);
|
|
28734
28734
|
} else {
|
|
28735
|
-
|
|
28735
|
+
types6[parameter.name] = [parameterPath];
|
|
28736
28736
|
}
|
|
28737
28737
|
}
|
|
28738
28738
|
Sp.lookup = function(name) {
|
|
@@ -28773,11 +28773,11 @@ var require_node_path = __commonJS({
|
|
|
28773
28773
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
28774
28774
|
var shared_1 = require_shared();
|
|
28775
28775
|
function nodePathPlugin(fork) {
|
|
28776
|
-
var
|
|
28777
|
-
var n =
|
|
28778
|
-
var b =
|
|
28779
|
-
var isNumber =
|
|
28780
|
-
var isArray =
|
|
28776
|
+
var types5 = fork.use(types_1.default);
|
|
28777
|
+
var n = types5.namedTypes;
|
|
28778
|
+
var b = types5.builders;
|
|
28779
|
+
var isNumber = types5.builtInTypes.number;
|
|
28780
|
+
var isArray = types5.builtInTypes.array;
|
|
28781
28781
|
var Path = fork.use(path_1.default);
|
|
28782
28782
|
var Scope = fork.use(scope_1.default);
|
|
28783
28783
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -28868,7 +28868,7 @@ var require_node_path = __commonJS({
|
|
|
28868
28868
|
return scope || null;
|
|
28869
28869
|
};
|
|
28870
28870
|
NPp.getValueProperty = function(name) {
|
|
28871
|
-
return
|
|
28871
|
+
return types5.getFieldValue(this.value, name);
|
|
28872
28872
|
};
|
|
28873
28873
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
28874
28874
|
var pp = this.parentPath;
|
|
@@ -29010,7 +29010,7 @@ var require_node_path = __commonJS({
|
|
|
29010
29010
|
return node.some(containsCallExpression);
|
|
29011
29011
|
}
|
|
29012
29012
|
if (n.Node.check(node)) {
|
|
29013
|
-
return
|
|
29013
|
+
return types5.someField(node, function(_name, child) {
|
|
29014
29014
|
return containsCallExpression(child);
|
|
29015
29015
|
});
|
|
29016
29016
|
}
|
|
@@ -29131,11 +29131,11 @@ var require_path_visitor = __commonJS({
|
|
|
29131
29131
|
var shared_1 = require_shared();
|
|
29132
29132
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
29133
29133
|
function pathVisitorPlugin(fork) {
|
|
29134
|
-
var
|
|
29134
|
+
var types5 = fork.use(types_1.default);
|
|
29135
29135
|
var NodePath = fork.use(node_path_1.default);
|
|
29136
|
-
var isArray =
|
|
29137
|
-
var isObject2 =
|
|
29138
|
-
var isFunction =
|
|
29136
|
+
var isArray = types5.builtInTypes.array;
|
|
29137
|
+
var isObject2 = types5.builtInTypes.object;
|
|
29138
|
+
var isFunction = types5.builtInTypes.function;
|
|
29139
29139
|
var undefined2;
|
|
29140
29140
|
var PathVisitor = function PathVisitor2() {
|
|
29141
29141
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -29155,7 +29155,7 @@ var require_path_visitor = __commonJS({
|
|
|
29155
29155
|
typeNames[methodName.slice("visit".length)] = true;
|
|
29156
29156
|
}
|
|
29157
29157
|
}
|
|
29158
|
-
var supertypeTable =
|
|
29158
|
+
var supertypeTable = types5.computeSupertypeLookupTable(typeNames);
|
|
29159
29159
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
29160
29160
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
29161
29161
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -29274,7 +29274,7 @@ var require_path_visitor = __commonJS({
|
|
|
29274
29274
|
path3.each(visitor.visitWithoutReset, visitor);
|
|
29275
29275
|
} else if (!isObject2.check(value)) {
|
|
29276
29276
|
} else {
|
|
29277
|
-
var childNames =
|
|
29277
|
+
var childNames = types5.getFieldNames(value);
|
|
29278
29278
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
29279
29279
|
childNames.push("comments");
|
|
29280
29280
|
}
|
|
@@ -29283,7 +29283,7 @@ var require_path_visitor = __commonJS({
|
|
|
29283
29283
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
29284
29284
|
var childName = childNames[i2];
|
|
29285
29285
|
if (!hasOwn.call(value, childName)) {
|
|
29286
|
-
value[childName] =
|
|
29286
|
+
value[childName] = types5.getFieldValue(value, childName);
|
|
29287
29287
|
}
|
|
29288
29288
|
childPaths.push(path3.get(childName));
|
|
29289
29289
|
}
|
|
@@ -29426,13 +29426,13 @@ var require_equiv = __commonJS({
|
|
|
29426
29426
|
var shared_1 = require_shared();
|
|
29427
29427
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
29428
29428
|
function default_1(fork) {
|
|
29429
|
-
var
|
|
29430
|
-
var getFieldNames =
|
|
29431
|
-
var getFieldValue =
|
|
29432
|
-
var isArray =
|
|
29433
|
-
var isObject2 =
|
|
29434
|
-
var isDate =
|
|
29435
|
-
var isRegExp =
|
|
29429
|
+
var types5 = fork.use(types_1.default);
|
|
29430
|
+
var getFieldNames = types5.getFieldNames;
|
|
29431
|
+
var getFieldValue = types5.getFieldValue;
|
|
29432
|
+
var isArray = types5.builtInTypes.array;
|
|
29433
|
+
var isObject2 = types5.builtInTypes.object;
|
|
29434
|
+
var isDate = types5.builtInTypes.Date;
|
|
29435
|
+
var isRegExp = types5.builtInTypes.RegExp;
|
|
29436
29436
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
29437
29437
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
29438
29438
|
if (isArray.check(problemPath)) {
|
|
@@ -29585,24 +29585,24 @@ var require_fork = __commonJS({
|
|
|
29585
29585
|
var shared_1 = require_shared();
|
|
29586
29586
|
function default_1(plugins2) {
|
|
29587
29587
|
var fork = createFork();
|
|
29588
|
-
var
|
|
29588
|
+
var types5 = fork.use(types_1.default);
|
|
29589
29589
|
plugins2.forEach(fork.use);
|
|
29590
|
-
|
|
29590
|
+
types5.finalize();
|
|
29591
29591
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
29592
29592
|
return {
|
|
29593
|
-
Type:
|
|
29594
|
-
builtInTypes:
|
|
29595
|
-
namedTypes:
|
|
29596
|
-
builders:
|
|
29597
|
-
defineMethod:
|
|
29598
|
-
getFieldNames:
|
|
29599
|
-
getFieldValue:
|
|
29600
|
-
eachField:
|
|
29601
|
-
someField:
|
|
29602
|
-
getSupertypeNames:
|
|
29603
|
-
getBuilderName:
|
|
29593
|
+
Type: types5.Type,
|
|
29594
|
+
builtInTypes: types5.builtInTypes,
|
|
29595
|
+
namedTypes: types5.namedTypes,
|
|
29596
|
+
builders: types5.builders,
|
|
29597
|
+
defineMethod: types5.defineMethod,
|
|
29598
|
+
getFieldNames: types5.getFieldNames,
|
|
29599
|
+
getFieldValue: types5.getFieldValue,
|
|
29600
|
+
eachField: types5.eachField,
|
|
29601
|
+
someField: types5.someField,
|
|
29602
|
+
getSupertypeNames: types5.getSupertypeNames,
|
|
29603
|
+
getBuilderName: types5.getBuilderName,
|
|
29604
29604
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
29605
|
-
finalize:
|
|
29605
|
+
finalize: types5.finalize,
|
|
29606
29606
|
Path: fork.use(path_1.default),
|
|
29607
29607
|
NodePath: fork.use(node_path_1.default),
|
|
29608
29608
|
PathVisitor,
|
|
@@ -29772,8 +29772,8 @@ var require_core2 = __commonJS({
|
|
|
29772
29772
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
29773
29773
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29774
29774
|
function default_1(fork) {
|
|
29775
|
-
var
|
|
29776
|
-
var Type =
|
|
29775
|
+
var types5 = fork.use(types_1.default);
|
|
29776
|
+
var Type = types5.Type;
|
|
29777
29777
|
var def = Type.def;
|
|
29778
29778
|
var or = Type.or;
|
|
29779
29779
|
var shared = fork.use(shared_1.default);
|
|
@@ -29865,9 +29865,9 @@ var require_es6 = __commonJS({
|
|
|
29865
29865
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29866
29866
|
function default_1(fork) {
|
|
29867
29867
|
fork.use(core_1.default);
|
|
29868
|
-
var
|
|
29869
|
-
var def =
|
|
29870
|
-
var or =
|
|
29868
|
+
var types5 = fork.use(types_1.default);
|
|
29869
|
+
var def = types5.Type.def;
|
|
29870
|
+
var or = types5.Type.or;
|
|
29871
29871
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29872
29872
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
29873
29873
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -29957,8 +29957,8 @@ var require_es2017 = __commonJS({
|
|
|
29957
29957
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29958
29958
|
function default_1(fork) {
|
|
29959
29959
|
fork.use(es2016_1.default);
|
|
29960
|
-
var
|
|
29961
|
-
var def =
|
|
29960
|
+
var types5 = fork.use(types_1.default);
|
|
29961
|
+
var def = types5.Type.def;
|
|
29962
29962
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29963
29963
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
29964
29964
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -29981,9 +29981,9 @@ var require_es2018 = __commonJS({
|
|
|
29981
29981
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
29982
29982
|
function default_1(fork) {
|
|
29983
29983
|
fork.use(es2017_1.default);
|
|
29984
|
-
var
|
|
29985
|
-
var def =
|
|
29986
|
-
var or =
|
|
29984
|
+
var types5 = fork.use(types_1.default);
|
|
29985
|
+
var def = types5.Type.def;
|
|
29986
|
+
var or = types5.Type.or;
|
|
29987
29987
|
var defaults = fork.use(shared_1.default).defaults;
|
|
29988
29988
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
29989
29989
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -30014,9 +30014,9 @@ var require_es2019 = __commonJS({
|
|
|
30014
30014
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30015
30015
|
function default_1(fork) {
|
|
30016
30016
|
fork.use(es2018_1.default);
|
|
30017
|
-
var
|
|
30018
|
-
var def =
|
|
30019
|
-
var or =
|
|
30017
|
+
var types5 = fork.use(types_1.default);
|
|
30018
|
+
var def = types5.Type.def;
|
|
30019
|
+
var or = types5.Type.or;
|
|
30020
30020
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30021
30021
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
30022
30022
|
}
|
|
@@ -30040,9 +30040,9 @@ var require_es20202 = __commonJS({
|
|
|
30040
30040
|
function default_1(fork) {
|
|
30041
30041
|
fork.use(es2020_1.default);
|
|
30042
30042
|
fork.use(es2019_1.default);
|
|
30043
|
-
var
|
|
30044
|
-
var def =
|
|
30045
|
-
var or =
|
|
30043
|
+
var types5 = fork.use(types_1.default);
|
|
30044
|
+
var def = types5.Type.def;
|
|
30045
|
+
var or = types5.Type.or;
|
|
30046
30046
|
var shared = fork.use(shared_1.default);
|
|
30047
30047
|
var defaults = shared.defaults;
|
|
30048
30048
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -30092,8 +30092,8 @@ var require_es2022 = __commonJS({
|
|
|
30092
30092
|
var shared_1 = require_shared();
|
|
30093
30093
|
function default_1(fork) {
|
|
30094
30094
|
fork.use(es2021_1.default);
|
|
30095
|
-
var
|
|
30096
|
-
var def =
|
|
30095
|
+
var types5 = fork.use(types_1.default);
|
|
30096
|
+
var def = types5.Type.def;
|
|
30097
30097
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
30098
30098
|
}
|
|
30099
30099
|
exports.default = default_1;
|
|
@@ -30114,9 +30114,9 @@ var require_es_proposals = __commonJS({
|
|
|
30114
30114
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
30115
30115
|
function default_1(fork) {
|
|
30116
30116
|
fork.use(es2022_1.default);
|
|
30117
|
-
var
|
|
30118
|
-
var Type =
|
|
30119
|
-
var def =
|
|
30117
|
+
var types5 = fork.use(types_1.default);
|
|
30118
|
+
var Type = types5.Type;
|
|
30119
|
+
var def = types5.Type.def;
|
|
30120
30120
|
var or = Type.or;
|
|
30121
30121
|
var shared = fork.use(shared_1.default);
|
|
30122
30122
|
var defaults = shared.defaults;
|
|
@@ -30156,9 +30156,9 @@ var require_jsx = __commonJS({
|
|
|
30156
30156
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30157
30157
|
function default_1(fork) {
|
|
30158
30158
|
fork.use(es_proposals_1.default);
|
|
30159
|
-
var
|
|
30160
|
-
var def =
|
|
30161
|
-
var or =
|
|
30159
|
+
var types5 = fork.use(types_1.default);
|
|
30160
|
+
var def = types5.Type.def;
|
|
30161
|
+
var or = types5.Type.or;
|
|
30162
30162
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30163
30163
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
30164
30164
|
def("Literal"),
|
|
@@ -30216,9 +30216,9 @@ var require_type_annotations = __commonJS({
|
|
|
30216
30216
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
30217
30217
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30218
30218
|
function default_1(fork) {
|
|
30219
|
-
var
|
|
30220
|
-
var def =
|
|
30221
|
-
var or =
|
|
30219
|
+
var types5 = fork.use(types_1.default);
|
|
30220
|
+
var def = types5.Type.def;
|
|
30221
|
+
var or = types5.Type.or;
|
|
30222
30222
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30223
30223
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
30224
30224
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -30253,9 +30253,9 @@ var require_flow = __commonJS({
|
|
|
30253
30253
|
function default_1(fork) {
|
|
30254
30254
|
fork.use(es_proposals_1.default);
|
|
30255
30255
|
fork.use(type_annotations_1.default);
|
|
30256
|
-
var
|
|
30257
|
-
var def =
|
|
30258
|
-
var or =
|
|
30256
|
+
var types5 = fork.use(types_1.default);
|
|
30257
|
+
var def = types5.Type.def;
|
|
30258
|
+
var or = types5.Type.or;
|
|
30259
30259
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30260
30260
|
def("Flow").bases("Node");
|
|
30261
30261
|
def("FlowType").bases("Flow");
|
|
@@ -30369,10 +30369,10 @@ var require_esprima = __commonJS({
|
|
|
30369
30369
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
30370
30370
|
function default_1(fork) {
|
|
30371
30371
|
fork.use(es_proposals_1.default);
|
|
30372
|
-
var
|
|
30372
|
+
var types5 = fork.use(types_1.default);
|
|
30373
30373
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30374
|
-
var def =
|
|
30375
|
-
var or =
|
|
30374
|
+
var def = types5.Type.def;
|
|
30375
|
+
var or = types5.Type.or;
|
|
30376
30376
|
def("VariableDeclaration").field("declarations", [or(
|
|
30377
30377
|
def("VariableDeclarator"),
|
|
30378
30378
|
def("Identifier")
|
|
@@ -30417,11 +30417,11 @@ var require_babel_core = __commonJS({
|
|
|
30417
30417
|
function default_1(fork) {
|
|
30418
30418
|
var _a, _b, _c, _d, _e;
|
|
30419
30419
|
fork.use(es_proposals_1.default);
|
|
30420
|
-
var
|
|
30420
|
+
var types5 = fork.use(types_1.default);
|
|
30421
30421
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30422
|
-
var def =
|
|
30423
|
-
var or =
|
|
30424
|
-
var isUndefined =
|
|
30422
|
+
var def = types5.Type.def;
|
|
30423
|
+
var or = types5.Type.or;
|
|
30424
|
+
var isUndefined = types5.builtInTypes.undefined;
|
|
30425
30425
|
def("Noop").bases("Statement").build();
|
|
30426
30426
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
30427
30427
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -30446,7 +30446,7 @@ var require_babel_core = __commonJS({
|
|
|
30446
30446
|
raw: String
|
|
30447
30447
|
},
|
|
30448
30448
|
function getDefault() {
|
|
30449
|
-
var value =
|
|
30449
|
+
var value = types5.getFieldValue(this, "value");
|
|
30450
30450
|
return {
|
|
30451
30451
|
rawValue: value,
|
|
30452
30452
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -30549,8 +30549,8 @@ var require_babel = __commonJS({
|
|
|
30549
30549
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
30550
30550
|
var shared_1 = require_shared();
|
|
30551
30551
|
function default_1(fork) {
|
|
30552
|
-
var
|
|
30553
|
-
var def =
|
|
30552
|
+
var types5 = fork.use(types_1.default);
|
|
30553
|
+
var def = types5.Type.def;
|
|
30554
30554
|
fork.use(babel_core_1.default);
|
|
30555
30555
|
fork.use(flow_1.default);
|
|
30556
30556
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -30576,12 +30576,12 @@ var require_typescript = __commonJS({
|
|
|
30576
30576
|
function default_1(fork) {
|
|
30577
30577
|
fork.use(babel_core_1.default);
|
|
30578
30578
|
fork.use(type_annotations_1.default);
|
|
30579
|
-
var
|
|
30580
|
-
var n =
|
|
30581
|
-
var def =
|
|
30582
|
-
var or =
|
|
30579
|
+
var types5 = fork.use(types_1.default);
|
|
30580
|
+
var n = types5.namedTypes;
|
|
30581
|
+
var def = types5.Type.def;
|
|
30582
|
+
var or = types5.Type.or;
|
|
30583
30583
|
var defaults = fork.use(shared_1.default).defaults;
|
|
30584
|
-
var StringLiteral =
|
|
30584
|
+
var StringLiteral = types5.Type.from(function(value, deep) {
|
|
30585
30585
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
30586
30586
|
return true;
|
|
30587
30587
|
}
|
|
@@ -32557,8 +32557,8 @@ var require_util2 = __commonJS({
|
|
|
32557
32557
|
exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
|
|
32558
32558
|
var tslib_1 = require_tslib();
|
|
32559
32559
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
32560
|
-
var
|
|
32561
|
-
var n =
|
|
32560
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
32561
|
+
var n = types5.namedTypes;
|
|
32562
32562
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
32563
32563
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
32564
32564
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -39876,10 +39876,10 @@ var require_comments = __commonJS({
|
|
|
39876
39876
|
exports.printComments = exports.attach = void 0;
|
|
39877
39877
|
var tslib_1 = require_tslib();
|
|
39878
39878
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
39879
|
-
var
|
|
39880
|
-
var n =
|
|
39881
|
-
var isArray =
|
|
39882
|
-
var isObject2 =
|
|
39879
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
39880
|
+
var n = types5.namedTypes;
|
|
39881
|
+
var isArray = types5.builtInTypes.array;
|
|
39882
|
+
var isObject2 = types5.builtInTypes.object;
|
|
39883
39883
|
var lines_1 = require_lines();
|
|
39884
39884
|
var util_1 = require_util2();
|
|
39885
39885
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -39910,7 +39910,7 @@ var require_comments = __commonJS({
|
|
|
39910
39910
|
if (isArray.check(node)) {
|
|
39911
39911
|
names = Object.keys(node);
|
|
39912
39912
|
} else if (isObject2.check(node)) {
|
|
39913
|
-
names =
|
|
39913
|
+
names = types5.getFieldNames(node);
|
|
39914
39914
|
} else {
|
|
39915
39915
|
return resultArray;
|
|
39916
39916
|
}
|
|
@@ -40088,7 +40088,7 @@ var require_comments = __commonJS({
|
|
|
40088
40088
|
function printComments(path3, print6) {
|
|
40089
40089
|
var value = path3.getValue();
|
|
40090
40090
|
var innerLines = print6(path3);
|
|
40091
|
-
var comments = n.Node.check(value) &&
|
|
40091
|
+
var comments = n.Node.check(value) && types5.getFieldValue(value, "comments");
|
|
40092
40092
|
if (!comments || comments.length === 0) {
|
|
40093
40093
|
return innerLines;
|
|
40094
40094
|
}
|
|
@@ -40096,8 +40096,8 @@ var require_comments = __commonJS({
|
|
|
40096
40096
|
var trailingParts = [innerLines];
|
|
40097
40097
|
path3.each(function(commentPath) {
|
|
40098
40098
|
var comment = commentPath.getValue();
|
|
40099
|
-
var leading =
|
|
40100
|
-
var trailing =
|
|
40099
|
+
var leading = types5.getFieldValue(comment, "leading");
|
|
40100
|
+
var trailing = types5.getFieldValue(comment, "trailing");
|
|
40101
40101
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
40102
40102
|
leadingParts.push(printLeadingComment(commentPath, print6));
|
|
40103
40103
|
} else if (trailing) {
|
|
@@ -40119,10 +40119,10 @@ var require_parser = __commonJS({
|
|
|
40119
40119
|
exports.parse = void 0;
|
|
40120
40120
|
var tslib_1 = require_tslib();
|
|
40121
40121
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
40122
|
-
var
|
|
40123
|
-
var b =
|
|
40124
|
-
var isObject2 =
|
|
40125
|
-
var isArray =
|
|
40122
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40123
|
+
var b = types5.builders;
|
|
40124
|
+
var isObject2 = types5.builtInTypes.object;
|
|
40125
|
+
var isArray = types5.builtInTypes.array;
|
|
40126
40126
|
var options_1 = require_options();
|
|
40127
40127
|
var lines_1 = require_lines();
|
|
40128
40128
|
var comments_1 = require_comments();
|
|
@@ -40308,11 +40308,11 @@ var require_fast_path = __commonJS({
|
|
|
40308
40308
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40309
40309
|
var tslib_1 = require_tslib();
|
|
40310
40310
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
40311
|
-
var
|
|
40311
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40312
40312
|
var util = tslib_1.__importStar(require_util2());
|
|
40313
|
-
var n =
|
|
40314
|
-
var isArray =
|
|
40315
|
-
var isNumber =
|
|
40313
|
+
var n = types5.namedTypes;
|
|
40314
|
+
var isArray = types5.builtInTypes.array;
|
|
40315
|
+
var isNumber = types5.builtInTypes.number;
|
|
40316
40316
|
var PRECEDENCE = {};
|
|
40317
40317
|
[
|
|
40318
40318
|
["??"],
|
|
@@ -40341,7 +40341,7 @@ var require_fast_path = __commonJS({
|
|
|
40341
40341
|
if (obj instanceof FastPath) {
|
|
40342
40342
|
return obj.copy();
|
|
40343
40343
|
}
|
|
40344
|
-
if (obj instanceof
|
|
40344
|
+
if (obj instanceof types5.NodePath) {
|
|
40345
40345
|
var copy = Object.create(FastPath.prototype);
|
|
40346
40346
|
var stack = [obj.value];
|
|
40347
40347
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -40652,7 +40652,7 @@ var require_fast_path = __commonJS({
|
|
|
40652
40652
|
return node.some(containsCallExpression);
|
|
40653
40653
|
}
|
|
40654
40654
|
if (n.Node.check(node)) {
|
|
40655
|
-
return
|
|
40655
|
+
return types5.someField(node, function(_name, child) {
|
|
40656
40656
|
return containsCallExpression(child);
|
|
40657
40657
|
});
|
|
40658
40658
|
}
|
|
@@ -40742,16 +40742,16 @@ var require_patcher = __commonJS({
|
|
|
40742
40742
|
var tslib_1 = require_tslib();
|
|
40743
40743
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
40744
40744
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
40745
|
-
var
|
|
40746
|
-
var Printable =
|
|
40747
|
-
var Expression =
|
|
40748
|
-
var ReturnStatement =
|
|
40749
|
-
var SourceLocation =
|
|
40745
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
40746
|
+
var Printable = types5.namedTypes.Printable;
|
|
40747
|
+
var Expression = types5.namedTypes.Expression;
|
|
40748
|
+
var ReturnStatement = types5.namedTypes.ReturnStatement;
|
|
40749
|
+
var SourceLocation = types5.namedTypes.SourceLocation;
|
|
40750
40750
|
var util_1 = require_util2();
|
|
40751
40751
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
40752
|
-
var isObject2 =
|
|
40753
|
-
var isArray =
|
|
40754
|
-
var isString =
|
|
40752
|
+
var isObject2 = types5.builtInTypes.object;
|
|
40753
|
+
var isArray = types5.builtInTypes.array;
|
|
40754
|
+
var isString = types5.builtInTypes.string;
|
|
40755
40755
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
40756
40756
|
var Patcher = function Patcher2(lines) {
|
|
40757
40757
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -41021,8 +41021,8 @@ var require_patcher = __commonJS({
|
|
|
41021
41021
|
if (k.charAt(0) === "_") {
|
|
41022
41022
|
continue;
|
|
41023
41023
|
}
|
|
41024
|
-
newPath.stack.push(k,
|
|
41025
|
-
oldPath.stack.push(k,
|
|
41024
|
+
newPath.stack.push(k, types5.getFieldValue(newNode, k));
|
|
41025
|
+
oldPath.stack.push(k, types5.getFieldValue(oldNode, k));
|
|
41026
41026
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
41027
41027
|
newPath.stack.length -= 2;
|
|
41028
41028
|
oldPath.stack.length -= 2;
|
|
@@ -41046,16 +41046,16 @@ var require_printer = __commonJS({
|
|
|
41046
41046
|
exports.Printer = void 0;
|
|
41047
41047
|
var tslib_1 = require_tslib();
|
|
41048
41048
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
41049
|
-
var
|
|
41049
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
41050
41050
|
var comments_1 = require_comments();
|
|
41051
41051
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
41052
41052
|
var lines_1 = require_lines();
|
|
41053
41053
|
var options_1 = require_options();
|
|
41054
41054
|
var patcher_1 = require_patcher();
|
|
41055
41055
|
var util = tslib_1.__importStar(require_util2());
|
|
41056
|
-
var namedTypes =
|
|
41057
|
-
var isString =
|
|
41058
|
-
var isObject2 =
|
|
41056
|
+
var namedTypes = types5.namedTypes;
|
|
41057
|
+
var isString = types5.builtInTypes.string;
|
|
41058
|
+
var isObject2 = types5.builtInTypes.object;
|
|
41059
41059
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
41060
41060
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
41061
41061
|
isString.assert(code);
|
|
@@ -41217,7 +41217,7 @@ var require_printer = __commonJS({
|
|
|
41217
41217
|
case "OptionalMemberExpression": {
|
|
41218
41218
|
parts.push(path3.call(print6, "object"));
|
|
41219
41219
|
var property = path3.call(print6, "property");
|
|
41220
|
-
var optional =
|
|
41220
|
+
var optional = types5.getFieldValue(n, "optional");
|
|
41221
41221
|
if (n.computed) {
|
|
41222
41222
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
41223
41223
|
} else {
|
|
@@ -41488,7 +41488,7 @@ var require_printer = __commonJS({
|
|
|
41488
41488
|
if (n.typeArguments) {
|
|
41489
41489
|
parts.push(path3.call(print6, "typeArguments"));
|
|
41490
41490
|
}
|
|
41491
|
-
if (
|
|
41491
|
+
if (types5.getFieldValue(n, "optional")) {
|
|
41492
41492
|
parts.push("?.");
|
|
41493
41493
|
}
|
|
41494
41494
|
parts.push(printArgumentsList(path3, options, print6));
|
|
@@ -43167,8 +43167,8 @@ var require_printer = __commonJS({
|
|
|
43167
43167
|
});
|
|
43168
43168
|
}
|
|
43169
43169
|
function getPossibleRaw(node) {
|
|
43170
|
-
var value =
|
|
43171
|
-
var extra =
|
|
43170
|
+
var value = types5.getFieldValue(node, "value");
|
|
43171
|
+
var extra = types5.getFieldValue(node, "extra");
|
|
43172
43172
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
43173
43173
|
return extra.raw;
|
|
43174
43174
|
}
|
|
@@ -43216,8 +43216,8 @@ var require_main2 = __commonJS({
|
|
|
43216
43216
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
43217
43217
|
var tslib_1 = require_tslib();
|
|
43218
43218
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
43219
|
-
var
|
|
43220
|
-
exports.types =
|
|
43219
|
+
var types5 = tslib_1.__importStar(require_main());
|
|
43220
|
+
exports.types = types5;
|
|
43221
43221
|
var parser_1 = require_parser();
|
|
43222
43222
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
43223
43223
|
return parser_1.parse;
|
|
@@ -47645,30 +47645,30 @@ var require_utils3 = __commonJS({
|
|
|
47645
47645
|
validate2.oneOf = values;
|
|
47646
47646
|
return validate2;
|
|
47647
47647
|
}
|
|
47648
|
-
function assertNodeType(...
|
|
47648
|
+
function assertNodeType(...types5) {
|
|
47649
47649
|
function validate2(node, key, val) {
|
|
47650
|
-
for (const type of
|
|
47650
|
+
for (const type of types5) {
|
|
47651
47651
|
if ((0, _is.default)(type, val)) {
|
|
47652
47652
|
(0, _validate.validateChild)(node, key, val);
|
|
47653
47653
|
return;
|
|
47654
47654
|
}
|
|
47655
47655
|
}
|
|
47656
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
47656
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
47657
47657
|
}
|
|
47658
|
-
validate2.oneOfNodeTypes =
|
|
47658
|
+
validate2.oneOfNodeTypes = types5;
|
|
47659
47659
|
return validate2;
|
|
47660
47660
|
}
|
|
47661
|
-
function assertNodeOrValueType(...
|
|
47661
|
+
function assertNodeOrValueType(...types5) {
|
|
47662
47662
|
function validate2(node, key, val) {
|
|
47663
|
-
for (const type of
|
|
47663
|
+
for (const type of types5) {
|
|
47664
47664
|
if (getType(val) === type || (0, _is.default)(type, val)) {
|
|
47665
47665
|
(0, _validate.validateChild)(node, key, val);
|
|
47666
47666
|
return;
|
|
47667
47667
|
}
|
|
47668
47668
|
}
|
|
47669
|
-
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(
|
|
47669
|
+
throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types5)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`);
|
|
47670
47670
|
}
|
|
47671
|
-
validate2.oneOfNodeOrValueTypes =
|
|
47671
|
+
validate2.oneOfNodeOrValueTypes = types5;
|
|
47672
47672
|
return validate2;
|
|
47673
47673
|
}
|
|
47674
47674
|
function assertValueType(type) {
|
|
@@ -51270,7 +51270,7 @@ var require_generated2 = __commonJS({
|
|
|
51270
51270
|
exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation;
|
|
51271
51271
|
exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate;
|
|
51272
51272
|
exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery;
|
|
51273
|
-
exports.tSTypeReference = exports.tsTypeReference =
|
|
51273
|
+
exports.tSTypeReference = exports.tsTypeReference = tsTypeReference2;
|
|
51274
51274
|
exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword;
|
|
51275
51275
|
exports.tSUnionType = exports.tsUnionType = tsUnionType;
|
|
51276
51276
|
exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword;
|
|
@@ -52096,10 +52096,10 @@ var require_generated2 = __commonJS({
|
|
|
52096
52096
|
body
|
|
52097
52097
|
});
|
|
52098
52098
|
}
|
|
52099
|
-
function intersectionTypeAnnotation(
|
|
52099
|
+
function intersectionTypeAnnotation(types5) {
|
|
52100
52100
|
return (0, _validateNode.default)({
|
|
52101
52101
|
type: "IntersectionTypeAnnotation",
|
|
52102
|
-
types:
|
|
52102
|
+
types: types5
|
|
52103
52103
|
});
|
|
52104
52104
|
}
|
|
52105
52105
|
function mixedTypeAnnotation() {
|
|
@@ -52222,10 +52222,10 @@ var require_generated2 = __commonJS({
|
|
|
52222
52222
|
type: "ThisTypeAnnotation"
|
|
52223
52223
|
};
|
|
52224
52224
|
}
|
|
52225
|
-
function tupleTypeAnnotation(
|
|
52225
|
+
function tupleTypeAnnotation(types5) {
|
|
52226
52226
|
return (0, _validateNode.default)({
|
|
52227
52227
|
type: "TupleTypeAnnotation",
|
|
52228
|
-
types:
|
|
52228
|
+
types: types5
|
|
52229
52229
|
});
|
|
52230
52230
|
}
|
|
52231
52231
|
function typeofTypeAnnotation(argument) {
|
|
@@ -52276,10 +52276,10 @@ var require_generated2 = __commonJS({
|
|
|
52276
52276
|
params
|
|
52277
52277
|
});
|
|
52278
52278
|
}
|
|
52279
|
-
function unionTypeAnnotation(
|
|
52279
|
+
function unionTypeAnnotation(types5) {
|
|
52280
52280
|
return (0, _validateNode.default)({
|
|
52281
52281
|
type: "UnionTypeAnnotation",
|
|
52282
|
-
types:
|
|
52282
|
+
types: types5
|
|
52283
52283
|
});
|
|
52284
52284
|
}
|
|
52285
52285
|
function variance(kind) {
|
|
@@ -52732,7 +52732,7 @@ var require_generated2 = __commonJS({
|
|
|
52732
52732
|
typeAnnotation: typeAnnotation2
|
|
52733
52733
|
});
|
|
52734
52734
|
}
|
|
52735
|
-
function
|
|
52735
|
+
function tsTypeReference2(typeName, typeParameters = null) {
|
|
52736
52736
|
return (0, _validateNode.default)({
|
|
52737
52737
|
type: "TSTypeReference",
|
|
52738
52738
|
typeName,
|
|
@@ -52792,16 +52792,16 @@ var require_generated2 = __commonJS({
|
|
|
52792
52792
|
optional
|
|
52793
52793
|
});
|
|
52794
52794
|
}
|
|
52795
|
-
function tsUnionType(
|
|
52795
|
+
function tsUnionType(types5) {
|
|
52796
52796
|
return (0, _validateNode.default)({
|
|
52797
52797
|
type: "TSUnionType",
|
|
52798
|
-
types:
|
|
52798
|
+
types: types5
|
|
52799
52799
|
});
|
|
52800
52800
|
}
|
|
52801
|
-
function tsIntersectionType(
|
|
52801
|
+
function tsIntersectionType(types5) {
|
|
52802
52802
|
return (0, _validateNode.default)({
|
|
52803
52803
|
type: "TSIntersectionType",
|
|
52804
|
-
types:
|
|
52804
|
+
types: types5
|
|
52805
52805
|
});
|
|
52806
52806
|
}
|
|
52807
52807
|
function tsConditionalType(checkType, extendsType, trueType, falseType) {
|
|
@@ -54416,12 +54416,12 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
54416
54416
|
const generics = /* @__PURE__ */ new Map();
|
|
54417
54417
|
const bases = /* @__PURE__ */ new Map();
|
|
54418
54418
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
54419
|
-
const
|
|
54419
|
+
const types5 = [];
|
|
54420
54420
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
54421
54421
|
const node = nodes[i2];
|
|
54422
54422
|
if (!node)
|
|
54423
54423
|
continue;
|
|
54424
|
-
if (
|
|
54424
|
+
if (types5.indexOf(node) >= 0) {
|
|
54425
54425
|
continue;
|
|
54426
54426
|
}
|
|
54427
54427
|
if ((0, _generated.isAnyTypeAnnotation)(node)) {
|
|
@@ -54455,15 +54455,15 @@ var require_removeTypeDuplicates = __commonJS({
|
|
|
54455
54455
|
}
|
|
54456
54456
|
continue;
|
|
54457
54457
|
}
|
|
54458
|
-
|
|
54458
|
+
types5.push(node);
|
|
54459
54459
|
}
|
|
54460
54460
|
for (const [, baseType] of bases) {
|
|
54461
|
-
|
|
54461
|
+
types5.push(baseType);
|
|
54462
54462
|
}
|
|
54463
54463
|
for (const [, genericName] of generics) {
|
|
54464
|
-
|
|
54464
|
+
types5.push(genericName);
|
|
54465
54465
|
}
|
|
54466
|
-
return
|
|
54466
|
+
return types5;
|
|
54467
54467
|
}
|
|
54468
54468
|
}
|
|
54469
54469
|
});
|
|
@@ -54478,8 +54478,8 @@ var require_createFlowUnionType = __commonJS({
|
|
|
54478
54478
|
exports.default = createFlowUnionType;
|
|
54479
54479
|
var _generated = require_generated2();
|
|
54480
54480
|
var _removeTypeDuplicates = require_removeTypeDuplicates();
|
|
54481
|
-
function createFlowUnionType(
|
|
54482
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
54481
|
+
function createFlowUnionType(types5) {
|
|
54482
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
54483
54483
|
if (flattened.length === 1) {
|
|
54484
54484
|
return flattened[0];
|
|
54485
54485
|
} else {
|
|
@@ -54506,12 +54506,12 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
54506
54506
|
const generics = /* @__PURE__ */ new Map();
|
|
54507
54507
|
const bases = /* @__PURE__ */ new Map();
|
|
54508
54508
|
const typeGroups = /* @__PURE__ */ new Set();
|
|
54509
|
-
const
|
|
54509
|
+
const types5 = [];
|
|
54510
54510
|
for (let i2 = 0; i2 < nodes.length; i2++) {
|
|
54511
54511
|
const node = nodes[i2];
|
|
54512
54512
|
if (!node)
|
|
54513
54513
|
continue;
|
|
54514
|
-
if (
|
|
54514
|
+
if (types5.indexOf(node) >= 0) {
|
|
54515
54515
|
continue;
|
|
54516
54516
|
}
|
|
54517
54517
|
if ((0, _generated.isTSAnyKeyword)(node)) {
|
|
@@ -54545,15 +54545,15 @@ var require_removeTypeDuplicates2 = __commonJS({
|
|
|
54545
54545
|
}
|
|
54546
54546
|
continue;
|
|
54547
54547
|
}
|
|
54548
|
-
|
|
54548
|
+
types5.push(node);
|
|
54549
54549
|
}
|
|
54550
54550
|
for (const [, baseType] of bases) {
|
|
54551
|
-
|
|
54551
|
+
types5.push(baseType);
|
|
54552
54552
|
}
|
|
54553
54553
|
for (const [, genericName] of generics) {
|
|
54554
|
-
|
|
54554
|
+
types5.push(genericName);
|
|
54555
54555
|
}
|
|
54556
|
-
return
|
|
54556
|
+
return types5;
|
|
54557
54557
|
}
|
|
54558
54558
|
}
|
|
54559
54559
|
});
|
|
@@ -54570,10 +54570,10 @@ var require_createTSUnionType = __commonJS({
|
|
|
54570
54570
|
var _removeTypeDuplicates = require_removeTypeDuplicates2();
|
|
54571
54571
|
var _index = require_generated();
|
|
54572
54572
|
function createTSUnionType(typeAnnotations) {
|
|
54573
|
-
const
|
|
54573
|
+
const types5 = typeAnnotations.map((type) => {
|
|
54574
54574
|
return (0, _index.isTSTypeAnnotation)(type) ? type.typeAnnotation : type;
|
|
54575
54575
|
});
|
|
54576
|
-
const flattened = (0, _removeTypeDuplicates.default)(
|
|
54576
|
+
const flattened = (0, _removeTypeDuplicates.default)(types5);
|
|
54577
54577
|
if (flattened.length === 1) {
|
|
54578
54578
|
return flattened[0];
|
|
54579
54579
|
} else {
|
|
@@ -58200,6 +58200,7 @@ __export(lib_exports, {
|
|
|
58200
58200
|
detectTools: () => detectTools,
|
|
58201
58201
|
ensureArtifactImport: () => ensureArtifactImport,
|
|
58202
58202
|
ensureImports: () => ensureImports,
|
|
58203
|
+
enumReference: () => enumReference,
|
|
58203
58204
|
exec: () => exec,
|
|
58204
58205
|
extractHeaders: () => extractHeaders,
|
|
58205
58206
|
extractHeadersStr: () => extractHeadersStr,
|
|
@@ -58229,6 +58230,7 @@ __export(lib_exports, {
|
|
|
58229
58230
|
localApiEndpoint: () => localApiEndpoint,
|
|
58230
58231
|
localApiSessionKeys: () => localApiSessionKeys,
|
|
58231
58232
|
mutation: () => mutation,
|
|
58233
|
+
nullableField: () => nullableField,
|
|
58232
58234
|
operation_requires_variables: () => operation_requires_variables,
|
|
58233
58235
|
orderedPlugins: () => orderedPlugins,
|
|
58234
58236
|
parentField: () => parentField,
|
|
@@ -58243,12 +58245,16 @@ __export(lib_exports, {
|
|
|
58243
58245
|
pullSchema: () => pullSchema,
|
|
58244
58246
|
query: () => query,
|
|
58245
58247
|
readConfigFile: () => readConfigFile,
|
|
58248
|
+
readonlyProperty: () => readonlyProperty,
|
|
58246
58249
|
routerConventions: () => conventions_exports,
|
|
58247
58250
|
runPipeline: () => runPipeline,
|
|
58251
|
+
scalarPropertyValue: () => scalarPropertyValue,
|
|
58248
58252
|
setMockConfig: () => setMockConfig,
|
|
58249
58253
|
siteURL: () => siteURL,
|
|
58250
58254
|
subscription: () => subscription,
|
|
58255
|
+
tsTypeReference: () => tsTypeReference,
|
|
58251
58256
|
unwrapType: () => unwrapType,
|
|
58257
|
+
unwrappedTsTypeReference: () => unwrappedTsTypeReference,
|
|
58252
58258
|
wrapType: () => wrapType
|
|
58253
58259
|
});
|
|
58254
58260
|
module.exports = __toCommonJS(lib_exports);
|
|
@@ -59127,7 +59133,7 @@ var printDocASTReducer = {
|
|
|
59127
59133
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
59128
59134
|
},
|
|
59129
59135
|
UnionTypeDefinition: {
|
|
59130
|
-
leave: ({ name, directives, types:
|
|
59136
|
+
leave: ({ name, directives, types: types5 }) => join(["union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
59131
59137
|
},
|
|
59132
59138
|
EnumTypeDefinition: {
|
|
59133
59139
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -59154,7 +59160,7 @@ var printDocASTReducer = {
|
|
|
59154
59160
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
59155
59161
|
},
|
|
59156
59162
|
UnionTypeExtension: {
|
|
59157
|
-
leave: ({ name, directives, types:
|
|
59163
|
+
leave: ({ name, directives, types: types5 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types5, " | "))], " ")
|
|
59158
59164
|
},
|
|
59159
59165
|
EnumTypeExtension: {
|
|
59160
59166
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -60034,8 +60040,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
60034
60040
|
}
|
|
60035
60041
|
}
|
|
60036
60042
|
function healUnderlyingTypes(type) {
|
|
60037
|
-
const
|
|
60038
|
-
|
|
60043
|
+
const types5 = type.getTypes();
|
|
60044
|
+
types5.push(...types5.splice(0).map((t3) => healType(t3)).filter(Boolean));
|
|
60039
60045
|
}
|
|
60040
60046
|
function healType(type) {
|
|
60041
60047
|
if ((0, import_graphql12.isListType)(type)) {
|
|
@@ -60819,11 +60825,11 @@ function mergeEnum(e1, e2, config) {
|
|
|
60819
60825
|
|
|
60820
60826
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
60821
60827
|
var import_graphql21 = require("graphql");
|
|
60822
|
-
function isStringTypes(
|
|
60823
|
-
return typeof
|
|
60828
|
+
function isStringTypes(types5) {
|
|
60829
|
+
return typeof types5 === "string";
|
|
60824
60830
|
}
|
|
60825
|
-
function isSourceTypes(
|
|
60826
|
-
return
|
|
60831
|
+
function isSourceTypes(types5) {
|
|
60832
|
+
return types5 instanceof import_graphql21.Source;
|
|
60827
60833
|
}
|
|
60828
60834
|
function extractType(type) {
|
|
60829
60835
|
let visitedType = type;
|
|
@@ -61518,6 +61524,44 @@ function deepMerge(...objects) {
|
|
|
61518
61524
|
return mergedObj;
|
|
61519
61525
|
}
|
|
61520
61526
|
|
|
61527
|
+
// src/runtime/lib/types.ts
|
|
61528
|
+
var CachePolicy = {
|
|
61529
|
+
CacheOrNetwork: "CacheOrNetwork",
|
|
61530
|
+
CacheOnly: "CacheOnly",
|
|
61531
|
+
NetworkOnly: "NetworkOnly",
|
|
61532
|
+
CacheAndNetwork: "CacheAndNetwork",
|
|
61533
|
+
NoCache: "NoCache"
|
|
61534
|
+
};
|
|
61535
|
+
var PaginateMode = {
|
|
61536
|
+
Infinite: "Infinite",
|
|
61537
|
+
SinglePage: "SinglePage"
|
|
61538
|
+
};
|
|
61539
|
+
var ArtifactKind = {
|
|
61540
|
+
Query: "HoudiniQuery",
|
|
61541
|
+
Subscription: "HoudiniSubscription",
|
|
61542
|
+
Mutation: "HoudiniMutation",
|
|
61543
|
+
Fragment: "HoudiniFragment"
|
|
61544
|
+
};
|
|
61545
|
+
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
61546
|
+
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
61547
|
+
var CompiledQueryKind = ArtifactKind.Query;
|
|
61548
|
+
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
61549
|
+
var RefetchUpdateMode = {
|
|
61550
|
+
append: "append",
|
|
61551
|
+
prepend: "prepend",
|
|
61552
|
+
replace: "replace"
|
|
61553
|
+
};
|
|
61554
|
+
var DataSource = {
|
|
61555
|
+
Cache: "cache",
|
|
61556
|
+
Network: "network",
|
|
61557
|
+
Ssr: "ssr"
|
|
61558
|
+
};
|
|
61559
|
+
var fragmentKey = " $fragments";
|
|
61560
|
+
var PendingValue = Symbol("houdini_loading");
|
|
61561
|
+
function isPending(value) {
|
|
61562
|
+
return typeof value === "symbol";
|
|
61563
|
+
}
|
|
61564
|
+
|
|
61521
61565
|
// src/runtime/lib/scalars.ts
|
|
61522
61566
|
async function marshalSelection({
|
|
61523
61567
|
selection,
|
|
@@ -61534,6 +61578,9 @@ async function marshalSelection({
|
|
|
61534
61578
|
return Object.fromEntries(
|
|
61535
61579
|
await Promise.all(
|
|
61536
61580
|
Object.entries(data).map(async ([fieldName, value]) => {
|
|
61581
|
+
if (fieldName === fragmentKey) {
|
|
61582
|
+
return [fieldName, value];
|
|
61583
|
+
}
|
|
61537
61584
|
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
61538
61585
|
if (!type) {
|
|
61539
61586
|
return [fieldName, value];
|
|
@@ -61598,44 +61645,6 @@ function isScalar(config, type) {
|
|
|
61598
61645
|
return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(config.scalars || {})).includes(type);
|
|
61599
61646
|
}
|
|
61600
61647
|
|
|
61601
|
-
// src/runtime/lib/types.ts
|
|
61602
|
-
var CachePolicy = {
|
|
61603
|
-
CacheOrNetwork: "CacheOrNetwork",
|
|
61604
|
-
CacheOnly: "CacheOnly",
|
|
61605
|
-
NetworkOnly: "NetworkOnly",
|
|
61606
|
-
CacheAndNetwork: "CacheAndNetwork",
|
|
61607
|
-
NoCache: "NoCache"
|
|
61608
|
-
};
|
|
61609
|
-
var PaginateMode = {
|
|
61610
|
-
Infinite: "Infinite",
|
|
61611
|
-
SinglePage: "SinglePage"
|
|
61612
|
-
};
|
|
61613
|
-
var ArtifactKind = {
|
|
61614
|
-
Query: "HoudiniQuery",
|
|
61615
|
-
Subscription: "HoudiniSubscription",
|
|
61616
|
-
Mutation: "HoudiniMutation",
|
|
61617
|
-
Fragment: "HoudiniFragment"
|
|
61618
|
-
};
|
|
61619
|
-
var CompiledFragmentKind = ArtifactKind.Fragment;
|
|
61620
|
-
var CompiledMutationKind = ArtifactKind.Mutation;
|
|
61621
|
-
var CompiledQueryKind = ArtifactKind.Query;
|
|
61622
|
-
var CompiledSubscriptionKind = ArtifactKind.Subscription;
|
|
61623
|
-
var RefetchUpdateMode = {
|
|
61624
|
-
append: "append",
|
|
61625
|
-
prepend: "prepend",
|
|
61626
|
-
replace: "replace"
|
|
61627
|
-
};
|
|
61628
|
-
var DataSource = {
|
|
61629
|
-
Cache: "cache",
|
|
61630
|
-
Network: "network",
|
|
61631
|
-
Ssr: "ssr"
|
|
61632
|
-
};
|
|
61633
|
-
var fragmentKey = " $fragments";
|
|
61634
|
-
var PendingValue = Symbol("houdini_loading");
|
|
61635
|
-
function isPending(value) {
|
|
61636
|
-
return typeof value === "symbol";
|
|
61637
|
-
}
|
|
61638
|
-
|
|
61639
61648
|
// src/runtime/lib/store.ts
|
|
61640
61649
|
var subscriber_queue = [];
|
|
61641
61650
|
var noop = () => {
|
|
@@ -63438,167 +63447,6 @@ function flatten(source) {
|
|
|
63438
63447
|
}, []);
|
|
63439
63448
|
}
|
|
63440
63449
|
|
|
63441
|
-
// src/runtime/client/plugins/fetch.ts
|
|
63442
|
-
var fetch2 = (target) => {
|
|
63443
|
-
return () => {
|
|
63444
|
-
return {
|
|
63445
|
-
async network(ctx, { client: client2, initialValue, resolve: resolve2, marshalVariables: marshalVariables2 }) {
|
|
63446
|
-
if (ctx.artifact.kind === ArtifactKind.Fragment) {
|
|
63447
|
-
return resolve2(ctx, initialValue);
|
|
63448
|
-
}
|
|
63449
|
-
const fetch3 = ctx.fetch ?? globalThis.fetch;
|
|
63450
|
-
const fetchParams2 = {
|
|
63451
|
-
name: ctx.name,
|
|
63452
|
-
text: ctx.text,
|
|
63453
|
-
hash: ctx.hash,
|
|
63454
|
-
variables: marshalVariables2(ctx)
|
|
63455
|
-
};
|
|
63456
|
-
let fetchFn = defaultFetch(client2.url, ctx.fetchParams);
|
|
63457
|
-
if (target) {
|
|
63458
|
-
if (typeof target === "string") {
|
|
63459
|
-
fetchFn = defaultFetch(target, ctx.fetchParams);
|
|
63460
|
-
} else {
|
|
63461
|
-
fetchFn = target;
|
|
63462
|
-
}
|
|
63463
|
-
}
|
|
63464
|
-
const result = await fetchFn({
|
|
63465
|
-
fetch: (url, args) => {
|
|
63466
|
-
const newArgs = handleMultipart(fetchParams2, args) ?? args;
|
|
63467
|
-
return fetch3(url, newArgs);
|
|
63468
|
-
},
|
|
63469
|
-
metadata: ctx.metadata,
|
|
63470
|
-
session: ctx.session || {},
|
|
63471
|
-
...fetchParams2
|
|
63472
|
-
});
|
|
63473
|
-
resolve2(ctx, {
|
|
63474
|
-
fetching: false,
|
|
63475
|
-
variables: ctx.variables ?? {},
|
|
63476
|
-
data: result.data,
|
|
63477
|
-
errors: !result.errors || result.errors.length === 0 ? null : result.errors,
|
|
63478
|
-
partial: false,
|
|
63479
|
-
stale: false,
|
|
63480
|
-
source: DataSource.Network
|
|
63481
|
-
});
|
|
63482
|
-
}
|
|
63483
|
-
};
|
|
63484
|
-
};
|
|
63485
|
-
};
|
|
63486
|
-
var defaultFetch = (url, params) => {
|
|
63487
|
-
if (!url) {
|
|
63488
|
-
throw new Error(
|
|
63489
|
-
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
63490
|
-
);
|
|
63491
|
-
}
|
|
63492
|
-
return async ({ fetch: fetch3, name, text, variables }) => {
|
|
63493
|
-
const result = await fetch3(url, {
|
|
63494
|
-
method: "POST",
|
|
63495
|
-
body: JSON.stringify({ operationName: name, query: text, variables }),
|
|
63496
|
-
...params,
|
|
63497
|
-
headers: {
|
|
63498
|
-
Accept: "application/graphql+json, application/json",
|
|
63499
|
-
"Content-Type": "application/json",
|
|
63500
|
-
...params?.headers
|
|
63501
|
-
}
|
|
63502
|
-
});
|
|
63503
|
-
return await result.json();
|
|
63504
|
-
};
|
|
63505
|
-
};
|
|
63506
|
-
function handleMultipart(params, args) {
|
|
63507
|
-
const { files } = extractFiles({
|
|
63508
|
-
variables: params.variables
|
|
63509
|
-
});
|
|
63510
|
-
if (files.size) {
|
|
63511
|
-
const req = args;
|
|
63512
|
-
let headers = {};
|
|
63513
|
-
if (req?.headers) {
|
|
63514
|
-
const filtered = Object.entries(req?.headers).filter(([key, value]) => {
|
|
63515
|
-
return !(key.toLowerCase() == "content-type" && value.toLowerCase() == "application/json");
|
|
63516
|
-
});
|
|
63517
|
-
headers = Object.fromEntries(filtered);
|
|
63518
|
-
}
|
|
63519
|
-
const form = new FormData();
|
|
63520
|
-
if (args && args?.body) {
|
|
63521
|
-
form.set("operations", args?.body);
|
|
63522
|
-
} else {
|
|
63523
|
-
form.set(
|
|
63524
|
-
"operations",
|
|
63525
|
-
JSON.stringify({
|
|
63526
|
-
operationName: params.name,
|
|
63527
|
-
query: params.text,
|
|
63528
|
-
variables: params.variables
|
|
63529
|
-
})
|
|
63530
|
-
);
|
|
63531
|
-
}
|
|
63532
|
-
const map = {};
|
|
63533
|
-
let i2 = 0;
|
|
63534
|
-
files.forEach((paths) => {
|
|
63535
|
-
map[++i2] = paths;
|
|
63536
|
-
});
|
|
63537
|
-
form.set("map", JSON.stringify(map));
|
|
63538
|
-
i2 = 0;
|
|
63539
|
-
files.forEach((paths, file) => {
|
|
63540
|
-
form.set(`${++i2}`, file, file.name);
|
|
63541
|
-
});
|
|
63542
|
-
return { ...req, headers, body: form };
|
|
63543
|
-
}
|
|
63544
|
-
}
|
|
63545
|
-
function isExtractableFile(value) {
|
|
63546
|
-
return typeof File !== "undefined" && value instanceof File || typeof Blob !== "undefined" && value instanceof Blob;
|
|
63547
|
-
}
|
|
63548
|
-
function extractFiles(value) {
|
|
63549
|
-
if (!arguments.length)
|
|
63550
|
-
throw new TypeError("Argument 1 `value` is required.");
|
|
63551
|
-
const clones = /* @__PURE__ */ new Map();
|
|
63552
|
-
const files = /* @__PURE__ */ new Map();
|
|
63553
|
-
function recurse(value2, path3, recursed) {
|
|
63554
|
-
if (isExtractableFile(value2)) {
|
|
63555
|
-
const filePaths = files.get(value2);
|
|
63556
|
-
filePaths ? filePaths.push(path3) : files.set(value2, [path3]);
|
|
63557
|
-
return null;
|
|
63558
|
-
}
|
|
63559
|
-
const valueIsList = Array.isArray(value2) || typeof FileList !== "undefined" && value2 instanceof FileList;
|
|
63560
|
-
const valueIsPlainObject = isPlainObject(value2);
|
|
63561
|
-
if (valueIsList || valueIsPlainObject) {
|
|
63562
|
-
let clone2 = clones.get(value2);
|
|
63563
|
-
const uncloned = !clone2;
|
|
63564
|
-
if (uncloned) {
|
|
63565
|
-
clone2 = valueIsList ? [] : value2 instanceof Object ? {} : /* @__PURE__ */ Object.create(null);
|
|
63566
|
-
clones.set(value2, clone2);
|
|
63567
|
-
}
|
|
63568
|
-
if (!recursed.has(value2)) {
|
|
63569
|
-
const pathPrefix = path3 ? `${path3}.` : "";
|
|
63570
|
-
const recursedDeeper = new Set(recursed).add(value2);
|
|
63571
|
-
if (valueIsList) {
|
|
63572
|
-
let index = 0;
|
|
63573
|
-
for (const item of value2) {
|
|
63574
|
-
const itemClone = recurse(item, pathPrefix + index++, recursedDeeper);
|
|
63575
|
-
if (uncloned)
|
|
63576
|
-
clone2.push(itemClone);
|
|
63577
|
-
}
|
|
63578
|
-
} else
|
|
63579
|
-
for (const key in value2) {
|
|
63580
|
-
const propertyClone = recurse(value2[key], pathPrefix + key, recursedDeeper);
|
|
63581
|
-
if (uncloned)
|
|
63582
|
-
clone2[key] = propertyClone;
|
|
63583
|
-
}
|
|
63584
|
-
}
|
|
63585
|
-
return clone2;
|
|
63586
|
-
}
|
|
63587
|
-
return value2;
|
|
63588
|
-
}
|
|
63589
|
-
return {
|
|
63590
|
-
clone: recurse(value, "", /* @__PURE__ */ new Set()),
|
|
63591
|
-
files
|
|
63592
|
-
};
|
|
63593
|
-
}
|
|
63594
|
-
function isPlainObject(value) {
|
|
63595
|
-
if (typeof value !== "object" || value === null) {
|
|
63596
|
-
return false;
|
|
63597
|
-
}
|
|
63598
|
-
const prototype = Object.getPrototypeOf(value);
|
|
63599
|
-
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
63600
|
-
}
|
|
63601
|
-
|
|
63602
63450
|
// src/runtime/cache/gc.ts
|
|
63603
63451
|
var GarbageCollector = class {
|
|
63604
63452
|
cache;
|
|
@@ -65748,6 +65596,167 @@ function defaultComponentField({
|
|
|
65748
65596
|
// src/runtime/cache/index.ts
|
|
65749
65597
|
var cache_default = new Cache();
|
|
65750
65598
|
|
|
65599
|
+
// src/runtime/client/plugins/fetch.ts
|
|
65600
|
+
var fetch2 = (target) => {
|
|
65601
|
+
return () => {
|
|
65602
|
+
return {
|
|
65603
|
+
async network(ctx, { client: client2, initialValue, resolve: resolve2, marshalVariables: marshalVariables2 }) {
|
|
65604
|
+
if (ctx.artifact.kind === ArtifactKind.Fragment) {
|
|
65605
|
+
return resolve2(ctx, initialValue);
|
|
65606
|
+
}
|
|
65607
|
+
const fetch3 = ctx.fetch ?? globalThis.fetch;
|
|
65608
|
+
const fetchParams2 = {
|
|
65609
|
+
name: ctx.name,
|
|
65610
|
+
text: ctx.text,
|
|
65611
|
+
hash: ctx.hash,
|
|
65612
|
+
variables: marshalVariables2(ctx)
|
|
65613
|
+
};
|
|
65614
|
+
let fetchFn = defaultFetch(client2.url, ctx.fetchParams);
|
|
65615
|
+
if (target) {
|
|
65616
|
+
if (typeof target === "string") {
|
|
65617
|
+
fetchFn = defaultFetch(target, ctx.fetchParams);
|
|
65618
|
+
} else {
|
|
65619
|
+
fetchFn = target;
|
|
65620
|
+
}
|
|
65621
|
+
}
|
|
65622
|
+
const result = await fetchFn({
|
|
65623
|
+
fetch: (url, args) => {
|
|
65624
|
+
const newArgs = handleMultipart(fetchParams2, args) ?? args;
|
|
65625
|
+
return fetch3(url, newArgs);
|
|
65626
|
+
},
|
|
65627
|
+
metadata: ctx.metadata,
|
|
65628
|
+
session: ctx.session || {},
|
|
65629
|
+
...fetchParams2
|
|
65630
|
+
});
|
|
65631
|
+
resolve2(ctx, {
|
|
65632
|
+
fetching: false,
|
|
65633
|
+
variables: ctx.variables ?? {},
|
|
65634
|
+
data: result.data,
|
|
65635
|
+
errors: !result.errors || result.errors.length === 0 ? null : result.errors,
|
|
65636
|
+
partial: false,
|
|
65637
|
+
stale: false,
|
|
65638
|
+
source: DataSource.Network
|
|
65639
|
+
});
|
|
65640
|
+
}
|
|
65641
|
+
};
|
|
65642
|
+
};
|
|
65643
|
+
};
|
|
65644
|
+
var defaultFetch = (url, params) => {
|
|
65645
|
+
if (!url) {
|
|
65646
|
+
throw new Error(
|
|
65647
|
+
"Could not find configured client url. Please specify one in your HoudiniClient constructor."
|
|
65648
|
+
);
|
|
65649
|
+
}
|
|
65650
|
+
return async ({ fetch: fetch3, name, text, variables }) => {
|
|
65651
|
+
const result = await fetch3(url, {
|
|
65652
|
+
method: "POST",
|
|
65653
|
+
body: JSON.stringify({ operationName: name, query: text, variables }),
|
|
65654
|
+
...params,
|
|
65655
|
+
headers: {
|
|
65656
|
+
Accept: "application/graphql+json, application/json",
|
|
65657
|
+
"Content-Type": "application/json",
|
|
65658
|
+
...params?.headers
|
|
65659
|
+
}
|
|
65660
|
+
});
|
|
65661
|
+
return await result.json();
|
|
65662
|
+
};
|
|
65663
|
+
};
|
|
65664
|
+
function handleMultipart(params, args) {
|
|
65665
|
+
const { files } = extractFiles({
|
|
65666
|
+
variables: params.variables
|
|
65667
|
+
});
|
|
65668
|
+
if (files.size) {
|
|
65669
|
+
const req = args;
|
|
65670
|
+
let headers = {};
|
|
65671
|
+
if (req?.headers) {
|
|
65672
|
+
const filtered = Object.entries(req?.headers).filter(([key, value]) => {
|
|
65673
|
+
return !(key.toLowerCase() == "content-type" && value.toLowerCase() == "application/json");
|
|
65674
|
+
});
|
|
65675
|
+
headers = Object.fromEntries(filtered);
|
|
65676
|
+
}
|
|
65677
|
+
const form = new FormData();
|
|
65678
|
+
if (args && args?.body) {
|
|
65679
|
+
form.set("operations", args?.body);
|
|
65680
|
+
} else {
|
|
65681
|
+
form.set(
|
|
65682
|
+
"operations",
|
|
65683
|
+
JSON.stringify({
|
|
65684
|
+
operationName: params.name,
|
|
65685
|
+
query: params.text,
|
|
65686
|
+
variables: params.variables
|
|
65687
|
+
})
|
|
65688
|
+
);
|
|
65689
|
+
}
|
|
65690
|
+
const map = {};
|
|
65691
|
+
let i2 = 0;
|
|
65692
|
+
files.forEach((paths) => {
|
|
65693
|
+
map[++i2] = paths;
|
|
65694
|
+
});
|
|
65695
|
+
form.set("map", JSON.stringify(map));
|
|
65696
|
+
i2 = 0;
|
|
65697
|
+
files.forEach((paths, file) => {
|
|
65698
|
+
form.set(`${++i2}`, file, file.name);
|
|
65699
|
+
});
|
|
65700
|
+
return { ...req, headers, body: form };
|
|
65701
|
+
}
|
|
65702
|
+
}
|
|
65703
|
+
function isExtractableFile(value) {
|
|
65704
|
+
return typeof File !== "undefined" && value instanceof File || typeof Blob !== "undefined" && value instanceof Blob;
|
|
65705
|
+
}
|
|
65706
|
+
function extractFiles(value) {
|
|
65707
|
+
if (!arguments.length)
|
|
65708
|
+
throw new TypeError("Argument 1 `value` is required.");
|
|
65709
|
+
const clones = /* @__PURE__ */ new Map();
|
|
65710
|
+
const files = /* @__PURE__ */ new Map();
|
|
65711
|
+
function recurse(value2, path3, recursed) {
|
|
65712
|
+
if (isExtractableFile(value2)) {
|
|
65713
|
+
const filePaths = files.get(value2);
|
|
65714
|
+
filePaths ? filePaths.push(path3) : files.set(value2, [path3]);
|
|
65715
|
+
return null;
|
|
65716
|
+
}
|
|
65717
|
+
const valueIsList = Array.isArray(value2) || typeof FileList !== "undefined" && value2 instanceof FileList;
|
|
65718
|
+
const valueIsPlainObject = isPlainObject(value2);
|
|
65719
|
+
if (valueIsList || valueIsPlainObject) {
|
|
65720
|
+
let clone2 = clones.get(value2);
|
|
65721
|
+
const uncloned = !clone2;
|
|
65722
|
+
if (uncloned) {
|
|
65723
|
+
clone2 = valueIsList ? [] : value2 instanceof Object ? {} : /* @__PURE__ */ Object.create(null);
|
|
65724
|
+
clones.set(value2, clone2);
|
|
65725
|
+
}
|
|
65726
|
+
if (!recursed.has(value2)) {
|
|
65727
|
+
const pathPrefix = path3 ? `${path3}.` : "";
|
|
65728
|
+
const recursedDeeper = new Set(recursed).add(value2);
|
|
65729
|
+
if (valueIsList) {
|
|
65730
|
+
let index = 0;
|
|
65731
|
+
for (const item of value2) {
|
|
65732
|
+
const itemClone = recurse(item, pathPrefix + index++, recursedDeeper);
|
|
65733
|
+
if (uncloned)
|
|
65734
|
+
clone2.push(itemClone);
|
|
65735
|
+
}
|
|
65736
|
+
} else
|
|
65737
|
+
for (const key in value2) {
|
|
65738
|
+
const propertyClone = recurse(value2[key], pathPrefix + key, recursedDeeper);
|
|
65739
|
+
if (uncloned)
|
|
65740
|
+
clone2[key] = propertyClone;
|
|
65741
|
+
}
|
|
65742
|
+
}
|
|
65743
|
+
return clone2;
|
|
65744
|
+
}
|
|
65745
|
+
return value2;
|
|
65746
|
+
}
|
|
65747
|
+
return {
|
|
65748
|
+
clone: recurse(value, "", /* @__PURE__ */ new Set()),
|
|
65749
|
+
files
|
|
65750
|
+
};
|
|
65751
|
+
}
|
|
65752
|
+
function isPlainObject(value) {
|
|
65753
|
+
if (typeof value !== "object" || value === null) {
|
|
65754
|
+
return false;
|
|
65755
|
+
}
|
|
65756
|
+
const prototype = Object.getPrototypeOf(value);
|
|
65757
|
+
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);
|
|
65758
|
+
}
|
|
65759
|
+
|
|
65751
65760
|
// src/runtime/client/plugins/cache.ts
|
|
65752
65761
|
var serverSide = typeof globalThis.window === "undefined";
|
|
65753
65762
|
var cachePolicy = ({
|
|
@@ -65878,7 +65887,7 @@ var documentPlugin = (kind, source) => {
|
|
|
65878
65887
|
};
|
|
65879
65888
|
|
|
65880
65889
|
// src/runtime/client/plugins/query.ts
|
|
65881
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
65890
|
+
var query = (cache) => documentPlugin(ArtifactKind.Query, function() {
|
|
65882
65891
|
let subscriptionSpec = null;
|
|
65883
65892
|
let lastVariables = null;
|
|
65884
65893
|
return {
|
|
@@ -65906,7 +65915,7 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65906
65915
|
end(ctx, { resolve: resolve2, marshalVariables: marshalVariables2, variablesChanged: variablesChanged2 }) {
|
|
65907
65916
|
if (variablesChanged2(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
65908
65917
|
if (subscriptionSpec) {
|
|
65909
|
-
|
|
65918
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
65910
65919
|
}
|
|
65911
65920
|
lastVariables = { ...marshalVariables2(ctx) };
|
|
65912
65921
|
const variables = lastVariables;
|
|
@@ -65926,13 +65935,13 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65926
65935
|
});
|
|
65927
65936
|
}
|
|
65928
65937
|
};
|
|
65929
|
-
|
|
65938
|
+
cache.subscribe(subscriptionSpec, lastVariables);
|
|
65930
65939
|
}
|
|
65931
65940
|
resolve2(ctx);
|
|
65932
65941
|
},
|
|
65933
65942
|
cleanup() {
|
|
65934
65943
|
if (subscriptionSpec) {
|
|
65935
|
-
|
|
65944
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
65936
65945
|
lastVariables = null;
|
|
65937
65946
|
}
|
|
65938
65947
|
}
|
|
@@ -65940,7 +65949,7 @@ var query = documentPlugin(ArtifactKind.Query, function() {
|
|
|
65940
65949
|
});
|
|
65941
65950
|
|
|
65942
65951
|
// src/runtime/client/plugins/fragment.ts
|
|
65943
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
65952
|
+
var fragment = (cache) => documentPlugin(ArtifactKind.Fragment, function() {
|
|
65944
65953
|
let subscriptionSpec = null;
|
|
65945
65954
|
let lastReference = null;
|
|
65946
65955
|
return {
|
|
@@ -65954,7 +65963,7 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
65954
65963
|
};
|
|
65955
65964
|
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged2(ctx))) {
|
|
65956
65965
|
if (subscriptionSpec) {
|
|
65957
|
-
|
|
65966
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
65958
65967
|
}
|
|
65959
65968
|
const variables = marshalVariables2(ctx);
|
|
65960
65969
|
subscriptionSpec = {
|
|
@@ -65974,28 +65983,28 @@ var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
|
65974
65983
|
});
|
|
65975
65984
|
}
|
|
65976
65985
|
};
|
|
65977
|
-
|
|
65986
|
+
cache.subscribe(subscriptionSpec, variables);
|
|
65978
65987
|
lastReference = currentReference;
|
|
65979
65988
|
}
|
|
65980
65989
|
next(ctx);
|
|
65981
65990
|
},
|
|
65982
65991
|
cleanup() {
|
|
65983
65992
|
if (subscriptionSpec) {
|
|
65984
|
-
|
|
65993
|
+
cache.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
65985
65994
|
}
|
|
65986
65995
|
}
|
|
65987
65996
|
};
|
|
65988
65997
|
});
|
|
65989
65998
|
|
|
65990
65999
|
// src/runtime/client/plugins/mutation.ts
|
|
65991
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
66000
|
+
var mutation = (cache) => documentPlugin(ArtifactKind.Mutation, () => {
|
|
65992
66001
|
return {
|
|
65993
66002
|
async start(ctx, { next, marshalVariables: marshalVariables2 }) {
|
|
65994
|
-
const layerOptimistic =
|
|
66003
|
+
const layerOptimistic = cache._internal_unstable.storage.createLayer(true);
|
|
65995
66004
|
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
65996
66005
|
let toNotify = [];
|
|
65997
66006
|
if (optimisticResponse) {
|
|
65998
|
-
toNotify =
|
|
66007
|
+
toNotify = cache.write({
|
|
65999
66008
|
selection: ctx.artifact.selection,
|
|
66000
66009
|
data: await marshalSelection({
|
|
66001
66010
|
selection: ctx.artifact.selection,
|
|
@@ -66015,7 +66024,7 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
66015
66024
|
},
|
|
66016
66025
|
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
66017
66026
|
if (ctx.cacheParams?.layer) {
|
|
66018
|
-
|
|
66027
|
+
cache.clearLayer(ctx.cacheParams.layer.id);
|
|
66019
66028
|
}
|
|
66020
66029
|
resolve2(ctx);
|
|
66021
66030
|
},
|
|
@@ -66023,19 +66032,19 @@ var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
|
66023
66032
|
const hasErrors = value.errors && value.errors.length > 0;
|
|
66024
66033
|
if (hasErrors) {
|
|
66025
66034
|
if (ctx.cacheParams?.layer) {
|
|
66026
|
-
|
|
66035
|
+
cache.clearLayer(ctx.cacheParams.layer.id);
|
|
66027
66036
|
}
|
|
66028
66037
|
}
|
|
66029
66038
|
if (ctx.cacheParams?.layer) {
|
|
66030
|
-
|
|
66039
|
+
cache._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
66031
66040
|
}
|
|
66032
66041
|
resolve2(ctx);
|
|
66033
66042
|
},
|
|
66034
66043
|
catch(ctx, { error }) {
|
|
66035
66044
|
if (ctx.cacheParams?.layer) {
|
|
66036
66045
|
const { layer } = ctx.cacheParams;
|
|
66037
|
-
|
|
66038
|
-
|
|
66046
|
+
cache.clearLayer(layer.id);
|
|
66047
|
+
cache._internal_unstable.storage.resolveLayer(layer.id);
|
|
66039
66048
|
}
|
|
66040
66049
|
throw error;
|
|
66041
66050
|
}
|
|
@@ -66561,10 +66570,17 @@ var injectedPlugins_default = plugins;
|
|
|
66561
66570
|
// src/runtime/client/index.ts
|
|
66562
66571
|
var HoudiniClient = class {
|
|
66563
66572
|
url;
|
|
66564
|
-
plugins;
|
|
66565
66573
|
throwOnError_operations;
|
|
66574
|
+
cache = null;
|
|
66575
|
+
throwOnError;
|
|
66576
|
+
fetchParams;
|
|
66577
|
+
pipeline;
|
|
66578
|
+
extraPlugins;
|
|
66566
66579
|
proxies = {};
|
|
66567
66580
|
componentCache = {};
|
|
66581
|
+
setCache(cache) {
|
|
66582
|
+
this.cache = cache;
|
|
66583
|
+
}
|
|
66568
66584
|
constructor({
|
|
66569
66585
|
url,
|
|
66570
66586
|
fetchParams: fetchParams2,
|
|
@@ -66578,23 +66594,29 @@ var HoudiniClient = class {
|
|
|
66578
66594
|
);
|
|
66579
66595
|
}
|
|
66580
66596
|
this.throwOnError_operations = throwOnError2?.operations ?? [];
|
|
66581
|
-
|
|
66597
|
+
let serverPort = globalThis.process?.env?.HOUDINI_PORT ?? "5173";
|
|
66598
|
+
this.url = url ?? (globalThis.window ? "" : `https://localhost:${serverPort}`) + localApiEndpoint(getCurrentConfig());
|
|
66599
|
+
this.throwOnError = throwOnError2;
|
|
66600
|
+
this.fetchParams = fetchParams2;
|
|
66601
|
+
this.pipeline = pipeline2;
|
|
66602
|
+
this.extraPlugins = plugins2;
|
|
66603
|
+
}
|
|
66604
|
+
get plugins() {
|
|
66605
|
+
return flatten(
|
|
66582
66606
|
[].concat(
|
|
66583
|
-
|
|
66584
|
-
fetchParams(
|
|
66585
|
-
|
|
66586
|
-
query,
|
|
66587
|
-
mutation,
|
|
66588
|
-
fragment
|
|
66607
|
+
this.throwOnError ? [throwOnError(this.throwOnError)] : [],
|
|
66608
|
+
fetchParams(this.fetchParams),
|
|
66609
|
+
this.pipeline ?? [
|
|
66610
|
+
query(this.cache ?? cache_default),
|
|
66611
|
+
mutation(this.cache ?? cache_default),
|
|
66612
|
+
fragment(this.cache ?? cache_default)
|
|
66589
66613
|
].concat(
|
|
66590
|
-
|
|
66614
|
+
this.extraPlugins ?? [],
|
|
66591
66615
|
injectedPlugins_default,
|
|
66592
66616
|
fetch2()
|
|
66593
66617
|
)
|
|
66594
66618
|
)
|
|
66595
66619
|
);
|
|
66596
|
-
let serverPort = globalThis.process?.env?.HOUDINI_PORT ?? "5173";
|
|
66597
|
-
this.url = url ?? (globalThis.window ? "" : `https://localhost:${serverPort}`) + localApiEndpoint(getCurrentConfig());
|
|
66598
66620
|
}
|
|
66599
66621
|
observe({
|
|
66600
66622
|
enableCache = true,
|
|
@@ -66606,6 +66628,7 @@ var HoudiniClient = class {
|
|
|
66606
66628
|
plugins: createPluginHooks(this.plugins),
|
|
66607
66629
|
fetching,
|
|
66608
66630
|
enableCache,
|
|
66631
|
+
cache: this.cache ?? void 0,
|
|
66609
66632
|
...rest
|
|
66610
66633
|
});
|
|
66611
66634
|
}
|
|
@@ -66706,7 +66729,7 @@ var Config = class {
|
|
|
66706
66729
|
defaultListTarget = null,
|
|
66707
66730
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
66708
66731
|
defaultKeys,
|
|
66709
|
-
types:
|
|
66732
|
+
types: types5 = {},
|
|
66710
66733
|
logLevel,
|
|
66711
66734
|
defaultFragmentMasking = "enable",
|
|
66712
66735
|
watchSchema,
|
|
@@ -66754,10 +66777,10 @@ var Config = class {
|
|
|
66754
66777
|
if (defaultKeys) {
|
|
66755
66778
|
this.defaultKeys = defaultKeys;
|
|
66756
66779
|
}
|
|
66757
|
-
if (
|
|
66780
|
+
if (types5) {
|
|
66758
66781
|
this.typeConfig = {
|
|
66759
66782
|
...this.typeConfig,
|
|
66760
|
-
...
|
|
66783
|
+
...types5
|
|
66761
66784
|
};
|
|
66762
66785
|
}
|
|
66763
66786
|
}
|
|
@@ -67691,7 +67714,7 @@ function operation_requires_variables(operation) {
|
|
|
67691
67714
|
)
|
|
67692
67715
|
);
|
|
67693
67716
|
}
|
|
67694
|
-
function unwrapType(config, type, wrappers = []) {
|
|
67717
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
67695
67718
|
if (type.kind === "NonNullType") {
|
|
67696
67719
|
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
67697
67720
|
}
|
|
@@ -67707,6 +67730,11 @@ function unwrapType(config, type, wrappers = []) {
|
|
|
67707
67730
|
if (type instanceof graphql3.GraphQLList) {
|
|
67708
67731
|
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
67709
67732
|
}
|
|
67733
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
67734
|
+
type = config.schema.getType(
|
|
67735
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
67736
|
+
);
|
|
67737
|
+
}
|
|
67710
67738
|
const namedType = config.schema.getType(type.name.value || type.name);
|
|
67711
67739
|
if (!namedType) {
|
|
67712
67740
|
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
@@ -68033,6 +68061,152 @@ function escape2(str) {
|
|
|
68033
68061
|
return str.normalize().replace(/[[\]]/g, "\\$&").replace(/%/g, "%25").replace(/\//g, "%2[Ff]").replace(/\?/g, "%3[Ff]").replace(/#/g, "%23").replace(/[.*+?^${}()|\\]/g, "\\$&");
|
|
68034
68062
|
}
|
|
68035
68063
|
|
|
68064
|
+
// src/lib/typescript.ts
|
|
68065
|
+
var graphql4 = __toESM(require("graphql"), 1);
|
|
68066
|
+
var recast2 = __toESM(require_main2(), 1);
|
|
68067
|
+
var AST2 = recast2.types.builders;
|
|
68068
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
68069
|
+
type,
|
|
68070
|
+
wrappers
|
|
68071
|
+
}, body) {
|
|
68072
|
+
let result;
|
|
68073
|
+
if (graphql4.isScalarType(type)) {
|
|
68074
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
68075
|
+
} else if (graphql4.isEnumType(type)) {
|
|
68076
|
+
result = enumReference(config, body, type.name);
|
|
68077
|
+
} else {
|
|
68078
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
68079
|
+
}
|
|
68080
|
+
for (const toWrap of wrappers) {
|
|
68081
|
+
if (toWrap === "NonNull" /* NonNull */) {
|
|
68082
|
+
continue;
|
|
68083
|
+
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
68084
|
+
result = nullableField(result, true);
|
|
68085
|
+
} else if (toWrap === "List" /* List */) {
|
|
68086
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
68087
|
+
}
|
|
68088
|
+
}
|
|
68089
|
+
return result;
|
|
68090
|
+
}
|
|
68091
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
68092
|
+
const { type, wrappers } = unwrapType(config, definition.type);
|
|
68093
|
+
return unwrappedTsTypeReference(
|
|
68094
|
+
config,
|
|
68095
|
+
filepath,
|
|
68096
|
+
missingScalars,
|
|
68097
|
+
{ type, wrappers },
|
|
68098
|
+
body
|
|
68099
|
+
);
|
|
68100
|
+
}
|
|
68101
|
+
function enumReference(config, body, name) {
|
|
68102
|
+
ensureImports({
|
|
68103
|
+
config,
|
|
68104
|
+
body,
|
|
68105
|
+
import: ["ValueOf"],
|
|
68106
|
+
importKind: "type",
|
|
68107
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
68108
|
+
});
|
|
68109
|
+
return AST2.tsTypeReference(
|
|
68110
|
+
AST2.identifier("ValueOf"),
|
|
68111
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
68112
|
+
);
|
|
68113
|
+
}
|
|
68114
|
+
function readonlyProperty(prop, enable = true) {
|
|
68115
|
+
if (enable) {
|
|
68116
|
+
prop.readonly = true;
|
|
68117
|
+
}
|
|
68118
|
+
return prop;
|
|
68119
|
+
}
|
|
68120
|
+
function nullableField(inner, input = false) {
|
|
68121
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
68122
|
+
if (input) {
|
|
68123
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
68124
|
+
}
|
|
68125
|
+
return AST2.tsUnionType(members);
|
|
68126
|
+
}
|
|
68127
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
68128
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
68129
|
+
if (!field) {
|
|
68130
|
+
return AST2.tsNeverKeyword();
|
|
68131
|
+
}
|
|
68132
|
+
const component = config.componentFields[field.parent][field.field];
|
|
68133
|
+
const sourcePathRelative = path_exports.relative(
|
|
68134
|
+
path_exports.join(config.projectRoot, "src"),
|
|
68135
|
+
component.filepath
|
|
68136
|
+
);
|
|
68137
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
68138
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
68139
|
+
const localImport = ensureImports({
|
|
68140
|
+
config,
|
|
68141
|
+
body,
|
|
68142
|
+
import: "__component__" + component.fragment,
|
|
68143
|
+
sourceModule: path_exports.join(
|
|
68144
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
68145
|
+
"src",
|
|
68146
|
+
sourcePath
|
|
68147
|
+
)
|
|
68148
|
+
}) ?? "__component__" + component.fragment;
|
|
68149
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
68150
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68151
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68152
|
+
]);
|
|
68153
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
68154
|
+
parameters,
|
|
68155
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
68156
|
+
);
|
|
68157
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
68158
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68159
|
+
indexed,
|
|
68160
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
68161
|
+
]);
|
|
68162
|
+
const arg = AST2.identifier("props");
|
|
68163
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
68164
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
68165
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68166
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68167
|
+
]);
|
|
68168
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
68169
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
68170
|
+
return fnType;
|
|
68171
|
+
}
|
|
68172
|
+
switch (target.name) {
|
|
68173
|
+
case "String": {
|
|
68174
|
+
return AST2.tsStringKeyword();
|
|
68175
|
+
}
|
|
68176
|
+
case "Int": {
|
|
68177
|
+
return AST2.tsNumberKeyword();
|
|
68178
|
+
}
|
|
68179
|
+
case "Float": {
|
|
68180
|
+
return AST2.tsNumberKeyword();
|
|
68181
|
+
}
|
|
68182
|
+
case "Boolean": {
|
|
68183
|
+
return AST2.tsBooleanKeyword();
|
|
68184
|
+
}
|
|
68185
|
+
case "ID": {
|
|
68186
|
+
return AST2.tsStringKeyword();
|
|
68187
|
+
}
|
|
68188
|
+
default: {
|
|
68189
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
68190
|
+
return scalarPropertyValue(
|
|
68191
|
+
config,
|
|
68192
|
+
filepath,
|
|
68193
|
+
missingScalars,
|
|
68194
|
+
target.ofType,
|
|
68195
|
+
body,
|
|
68196
|
+
field
|
|
68197
|
+
);
|
|
68198
|
+
}
|
|
68199
|
+
if (config.scalars?.[target.name]) {
|
|
68200
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
68201
|
+
}
|
|
68202
|
+
if (target.name !== config.componentScalar) {
|
|
68203
|
+
missingScalars.add(target.name);
|
|
68204
|
+
}
|
|
68205
|
+
return AST2.tsAnyKeyword();
|
|
68206
|
+
}
|
|
68207
|
+
}
|
|
68208
|
+
}
|
|
68209
|
+
|
|
68036
68210
|
// ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
68037
68211
|
var WalkerBase = class {
|
|
68038
68212
|
constructor() {
|
|
@@ -68146,7 +68320,7 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
68146
68320
|
}
|
|
68147
68321
|
|
|
68148
68322
|
// src/lib/walk.ts
|
|
68149
|
-
var
|
|
68323
|
+
var graphql5 = __toESM(require("graphql"), 1);
|
|
68150
68324
|
async function find_graphql(config, parsedScript, walker) {
|
|
68151
68325
|
await asyncWalk(parsedScript, {
|
|
68152
68326
|
async enter(node, parent) {
|
|
@@ -68201,7 +68375,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
68201
68375
|
} else if (!documentString) {
|
|
68202
68376
|
return;
|
|
68203
68377
|
}
|
|
68204
|
-
const parsedTag =
|
|
68378
|
+
const parsedTag = graphql5.parse(documentString);
|
|
68205
68379
|
if (walker.where && !walker.where(parsedTag, { node, parent })) {
|
|
68206
68380
|
return;
|
|
68207
68381
|
}
|
|
@@ -68333,7 +68507,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
68333
68507
|
};
|
|
68334
68508
|
return defs.concat([
|
|
68335
68509
|
{
|
|
68336
|
-
raw:
|
|
68510
|
+
raw: graphql5.print(parsed),
|
|
68337
68511
|
parsed
|
|
68338
68512
|
}
|
|
68339
68513
|
]);
|
|
@@ -68474,7 +68648,7 @@ function serialized_manifest_path(config, base = base_dir(config)) {
|
|
|
68474
68648
|
|
|
68475
68649
|
// src/lib/router/manifest.ts
|
|
68476
68650
|
var t2 = __toESM(require_lib6(), 1);
|
|
68477
|
-
var
|
|
68651
|
+
var graphql6 = __toESM(require("graphql"), 1);
|
|
68478
68652
|
async function load_manifest(args) {
|
|
68479
68653
|
const manifest = await walk_routes({
|
|
68480
68654
|
config: args.config,
|
|
@@ -68491,7 +68665,8 @@ async function load_manifest(args) {
|
|
|
68491
68665
|
local_yoga: false
|
|
68492
68666
|
},
|
|
68493
68667
|
queries: [],
|
|
68494
|
-
layouts: []
|
|
68668
|
+
layouts: [],
|
|
68669
|
+
variables: {}
|
|
68495
68670
|
});
|
|
68496
68671
|
if (args.includeArtifacts) {
|
|
68497
68672
|
try {
|
|
@@ -68522,6 +68697,7 @@ async function walk_routes(args) {
|
|
|
68522
68697
|
const directory_contents = await fs_exports.readdir(args.filepath, {
|
|
68523
68698
|
withFileTypes: true
|
|
68524
68699
|
});
|
|
68700
|
+
const variables = { ...args.variables };
|
|
68525
68701
|
let newLayouts = args.layouts;
|
|
68526
68702
|
let newLayoutQueries = args.queries;
|
|
68527
68703
|
let layout = null;
|
|
@@ -68545,7 +68721,8 @@ async function walk_routes(args) {
|
|
|
68545
68721
|
url: args.url,
|
|
68546
68722
|
project: args.project,
|
|
68547
68723
|
type: "layout",
|
|
68548
|
-
contents: layoutQueryContents
|
|
68724
|
+
contents: layoutQueryContents,
|
|
68725
|
+
variables
|
|
68549
68726
|
});
|
|
68550
68727
|
newLayoutQueries = [...args.queries, layoutQuery.name];
|
|
68551
68728
|
}
|
|
@@ -68558,7 +68735,8 @@ async function walk_routes(args) {
|
|
|
68558
68735
|
contents: layoutViewContents,
|
|
68559
68736
|
layouts: args.layouts,
|
|
68560
68737
|
queries: newLayoutQueries,
|
|
68561
|
-
config: args.config
|
|
68738
|
+
config: args.config,
|
|
68739
|
+
variables
|
|
68562
68740
|
});
|
|
68563
68741
|
newLayouts = [...args.layouts, page_id(layout.url)];
|
|
68564
68742
|
}
|
|
@@ -68569,7 +68747,8 @@ async function walk_routes(args) {
|
|
|
68569
68747
|
url: args.url,
|
|
68570
68748
|
project: args.project,
|
|
68571
68749
|
type: "page",
|
|
68572
|
-
contents: pageQueryContents
|
|
68750
|
+
contents: pageQueryContents,
|
|
68751
|
+
variables
|
|
68573
68752
|
});
|
|
68574
68753
|
}
|
|
68575
68754
|
if (pageViewContents) {
|
|
@@ -68581,7 +68760,8 @@ async function walk_routes(args) {
|
|
|
68581
68760
|
contents: pageViewContents,
|
|
68582
68761
|
layouts: newLayouts,
|
|
68583
68762
|
queries: pageQuery ? [...newLayoutQueries, pageQuery.name] : newLayoutQueries,
|
|
68584
|
-
config: args.config
|
|
68763
|
+
config: args.config,
|
|
68764
|
+
variables
|
|
68585
68765
|
});
|
|
68586
68766
|
}
|
|
68587
68767
|
await Promise.all(
|
|
@@ -68594,7 +68774,8 @@ async function walk_routes(args) {
|
|
|
68594
68774
|
filepath: path_exports.join(args.filepath, dir.name),
|
|
68595
68775
|
url: `${args.url}${dir.name}/`,
|
|
68596
68776
|
queries: newLayoutQueries,
|
|
68597
|
-
layouts: newLayouts
|
|
68777
|
+
layouts: newLayouts,
|
|
68778
|
+
variables
|
|
68598
68779
|
});
|
|
68599
68780
|
})
|
|
68600
68781
|
);
|
|
@@ -68616,12 +68797,18 @@ async function add_view(args) {
|
|
|
68616
68797
|
url: args.url,
|
|
68617
68798
|
layouts: args.layouts,
|
|
68618
68799
|
path: path_exports.relative(args.config.projectRoot, args.path),
|
|
68619
|
-
query_options: args.queries
|
|
68800
|
+
query_options: args.queries,
|
|
68801
|
+
params: Object.fromEntries(
|
|
68802
|
+
parse_page_pattern(args.url).params.map((param) => [
|
|
68803
|
+
param.name,
|
|
68804
|
+
args.variables[param.name] ?? null
|
|
68805
|
+
])
|
|
68806
|
+
)
|
|
68620
68807
|
};
|
|
68621
68808
|
return target[id];
|
|
68622
68809
|
}
|
|
68623
68810
|
async function add_query(args) {
|
|
68624
|
-
const parsed =
|
|
68811
|
+
const parsed = graphql6.parse(args.contents);
|
|
68625
68812
|
const query2 = parsed.definitions.find(
|
|
68626
68813
|
(def) => def.kind === "OperationDefinition" && def.operation === "query"
|
|
68627
68814
|
);
|
|
@@ -68629,20 +68816,30 @@ async function add_query(args) {
|
|
|
68629
68816
|
throw new Error("No query found");
|
|
68630
68817
|
}
|
|
68631
68818
|
let loading = false;
|
|
68632
|
-
await
|
|
68819
|
+
await graphql6.visit(parsed, {
|
|
68633
68820
|
Directive(node) {
|
|
68634
68821
|
if (node.name.value === args.config.loadingDirective) {
|
|
68635
68822
|
loading = true;
|
|
68636
68823
|
}
|
|
68637
68824
|
}
|
|
68638
68825
|
});
|
|
68826
|
+
const queryVariables = Object.fromEntries(
|
|
68827
|
+
query2.variableDefinitions?.map((variable) => {
|
|
68828
|
+
const { type, wrappers } = unwrapType(args.config, variable.type, [], true);
|
|
68829
|
+
return [
|
|
68830
|
+
variable.variable.name.value,
|
|
68831
|
+
{ wrappers, type: type.name }
|
|
68832
|
+
];
|
|
68833
|
+
}) ?? []
|
|
68834
|
+
);
|
|
68835
|
+
Object.assign(args.variables, queryVariables);
|
|
68639
68836
|
const target = args.type === "page" ? args.project.page_queries : args.project.layout_queries;
|
|
68640
68837
|
target[page_id(args.url)] = {
|
|
68641
68838
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
68642
68839
|
name: query2.name.value,
|
|
68643
68840
|
url: args.url,
|
|
68644
68841
|
loading,
|
|
68645
|
-
variables:
|
|
68842
|
+
variables: queryVariables
|
|
68646
68843
|
};
|
|
68647
68844
|
return target[page_id(args.url)];
|
|
68648
68845
|
}
|
|
@@ -69035,6 +69232,7 @@ async function get_session(req, secrets) {
|
|
|
69035
69232
|
detectTools,
|
|
69036
69233
|
ensureArtifactImport,
|
|
69037
69234
|
ensureImports,
|
|
69235
|
+
enumReference,
|
|
69038
69236
|
exec,
|
|
69039
69237
|
extractHeaders,
|
|
69040
69238
|
extractHeadersStr,
|
|
@@ -69064,6 +69262,7 @@ async function get_session(req, secrets) {
|
|
|
69064
69262
|
localApiEndpoint,
|
|
69065
69263
|
localApiSessionKeys,
|
|
69066
69264
|
mutation,
|
|
69265
|
+
nullableField,
|
|
69067
69266
|
operation_requires_variables,
|
|
69068
69267
|
orderedPlugins,
|
|
69069
69268
|
parentField,
|
|
@@ -69078,12 +69277,16 @@ async function get_session(req, secrets) {
|
|
|
69078
69277
|
pullSchema,
|
|
69079
69278
|
query,
|
|
69080
69279
|
readConfigFile,
|
|
69280
|
+
readonlyProperty,
|
|
69081
69281
|
routerConventions,
|
|
69082
69282
|
runPipeline,
|
|
69283
|
+
scalarPropertyValue,
|
|
69083
69284
|
setMockConfig,
|
|
69084
69285
|
siteURL,
|
|
69085
69286
|
subscription,
|
|
69287
|
+
tsTypeReference,
|
|
69086
69288
|
unwrapType,
|
|
69289
|
+
unwrappedTsTypeReference,
|
|
69087
69290
|
wrapType
|
|
69088
69291
|
});
|
|
69089
69292
|
/*!
|