houdini 1.2.5 → 1.2.6
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 +613 -562
- package/build/cmd-esm/index.js +613 -562
- package/build/codegen/generators/artifacts/selection.d.ts +1 -3
- package/build/codegen-cjs/index.js +600 -549
- package/build/codegen-esm/index.js +600 -549
- package/build/lib-cjs/index.js +41 -10
- package/build/lib-esm/index.js +41 -10
- package/build/runtime/cache/cache.d.ts +2 -0
- package/build/runtime/cache/gc.d.ts +1 -0
- package/build/runtime/cache/lists.d.ts +1 -0
- package/build/runtime/cache/staleManager.d.ts +1 -0
- package/build/runtime/cache/storage.d.ts +1 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/public/cache.d.ts +4 -0
- package/build/runtime-cjs/cache/cache.d.ts +2 -0
- package/build/runtime-cjs/cache/cache.js +16 -10
- package/build/runtime-cjs/cache/gc.d.ts +1 -0
- package/build/runtime-cjs/cache/gc.js +3 -0
- package/build/runtime-cjs/cache/lists.d.ts +1 -0
- package/build/runtime-cjs/cache/lists.js +4 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +1 -0
- package/build/runtime-cjs/cache/staleManager.js +3 -0
- package/build/runtime-cjs/cache/storage.d.ts +1 -0
- package/build/runtime-cjs/cache/storage.js +3 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +13 -0
- package/build/runtime-cjs/public/cache.d.ts +4 -0
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-esm/cache/cache.d.ts +2 -0
- package/build/runtime-esm/cache/cache.js +16 -10
- package/build/runtime-esm/cache/gc.d.ts +1 -0
- package/build/runtime-esm/cache/gc.js +3 -0
- package/build/runtime-esm/cache/lists.d.ts +1 -0
- package/build/runtime-esm/cache/lists.js +4 -0
- package/build/runtime-esm/cache/staleManager.d.ts +1 -0
- package/build/runtime-esm/cache/staleManager.js +3 -0
- package/build/runtime-esm/cache/storage.d.ts +1 -0
- package/build/runtime-esm/cache/storage.js +3 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +13 -0
- package/build/runtime-esm/public/cache.d.ts +4 -0
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/test-cjs/index.js +603 -552
- package/build/test-esm/index.js +603 -552
- package/build/vite-cjs/index.js +618 -567
- package/build/vite-esm/index.js +618 -567
- package/package.json +1 -1
package/build/test-cjs/index.js
CHANGED
|
@@ -1972,12 +1972,12 @@ var require_parser = __commonJS({
|
|
|
1972
1972
|
return [];
|
|
1973
1973
|
}
|
|
1974
1974
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
1975
|
-
var
|
|
1975
|
+
var types15 = [];
|
|
1976
1976
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
1977
1977
|
do {
|
|
1978
|
-
|
|
1978
|
+
types15.push(this.parseNamedType());
|
|
1979
1979
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
1980
|
-
return
|
|
1980
|
+
return types15;
|
|
1981
1981
|
}
|
|
1982
1982
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
1983
1983
|
};
|
|
@@ -2056,13 +2056,13 @@ var require_parser = __commonJS({
|
|
|
2056
2056
|
this.expectKeyword("union");
|
|
2057
2057
|
var name = this.parseName();
|
|
2058
2058
|
var directives = this.parseDirectives(true);
|
|
2059
|
-
var
|
|
2059
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2060
2060
|
return {
|
|
2061
2061
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2062
2062
|
description,
|
|
2063
2063
|
name,
|
|
2064
2064
|
directives,
|
|
2065
|
-
types:
|
|
2065
|
+
types: types15,
|
|
2066
2066
|
loc: this.loc(start)
|
|
2067
2067
|
};
|
|
2068
2068
|
};
|
|
@@ -2220,15 +2220,15 @@ var require_parser = __commonJS({
|
|
|
2220
2220
|
this.expectKeyword("union");
|
|
2221
2221
|
var name = this.parseName();
|
|
2222
2222
|
var directives = this.parseDirectives(true);
|
|
2223
|
-
var
|
|
2224
|
-
if (directives.length === 0 &&
|
|
2223
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2224
|
+
if (directives.length === 0 && types15.length === 0) {
|
|
2225
2225
|
throw this.unexpected();
|
|
2226
2226
|
}
|
|
2227
2227
|
return {
|
|
2228
2228
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2229
2229
|
name,
|
|
2230
2230
|
directives,
|
|
2231
|
-
types:
|
|
2231
|
+
types: types15,
|
|
2232
2232
|
loc: this.loc(start)
|
|
2233
2233
|
};
|
|
2234
2234
|
};
|
|
@@ -3206,8 +3206,8 @@ var require_printer = __commonJS({
|
|
|
3206
3206
|
return join2(["interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3207
3207
|
}),
|
|
3208
3208
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3209
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
3210
|
-
return join2(["union", name, join2(directives, " "),
|
|
3209
|
+
var name = _ref27.name, directives = _ref27.directives, types15 = _ref27.types;
|
|
3210
|
+
return join2(["union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3211
3211
|
}),
|
|
3212
3212
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3213
3213
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -3242,8 +3242,8 @@ var require_printer = __commonJS({
|
|
|
3242
3242
|
return join2(["extend interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3243
3243
|
},
|
|
3244
3244
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3245
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
3246
|
-
return join2(["extend union", name, join2(directives, " "),
|
|
3245
|
+
var name = _ref36.name, directives = _ref36.directives, types15 = _ref36.types;
|
|
3246
|
+
return join2(["extend union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3247
3247
|
},
|
|
3248
3248
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3249
3249
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -3914,9 +3914,9 @@ var require_definition = __commonJS({
|
|
|
3914
3914
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
3915
3915
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
3916
3916
|
function defineTypes(config2) {
|
|
3917
|
-
var
|
|
3918
|
-
Array.isArray(
|
|
3919
|
-
return
|
|
3917
|
+
var types15 = resolveThunk(config2.types);
|
|
3918
|
+
Array.isArray(types15) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
|
|
3919
|
+
return types15;
|
|
3920
3920
|
}
|
|
3921
3921
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
3922
3922
|
function GraphQLEnumType2(config2) {
|
|
@@ -11553,7 +11553,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
11553
11553
|
return new _definition.GraphQLUnionType({
|
|
11554
11554
|
name: unionIntrospection.name,
|
|
11555
11555
|
description: unionIntrospection.description,
|
|
11556
|
-
types: function
|
|
11556
|
+
types: function types15() {
|
|
11557
11557
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
11558
11558
|
}
|
|
11559
11559
|
});
|
|
@@ -11898,7 +11898,7 @@ var require_extendSchema = __commonJS({
|
|
|
11898
11898
|
var config2 = type.toConfig();
|
|
11899
11899
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
11900
11900
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
11901
|
-
types: function
|
|
11901
|
+
types: function types15() {
|
|
11902
11902
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
11903
11903
|
},
|
|
11904
11904
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -12046,17 +12046,17 @@ var require_extendSchema = __commonJS({
|
|
|
12046
12046
|
return interfaces;
|
|
12047
12047
|
}
|
|
12048
12048
|
function buildUnionTypes(nodes) {
|
|
12049
|
-
var
|
|
12049
|
+
var types15 = [];
|
|
12050
12050
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
12051
12051
|
var _node$types;
|
|
12052
12052
|
var node = nodes[_i32];
|
|
12053
12053
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
12054
12054
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
12055
12055
|
var type = typeNodes[_i34];
|
|
12056
|
-
|
|
12056
|
+
types15.push(getNamedType2(type));
|
|
12057
12057
|
}
|
|
12058
12058
|
}
|
|
12059
|
-
return
|
|
12059
|
+
return types15;
|
|
12060
12060
|
}
|
|
12061
12061
|
function buildType(astNode) {
|
|
12062
12062
|
var _typeExtensionsMap$na;
|
|
@@ -12113,7 +12113,7 @@ var require_extendSchema = __commonJS({
|
|
|
12113
12113
|
return new _definition.GraphQLUnionType({
|
|
12114
12114
|
name: name2,
|
|
12115
12115
|
description,
|
|
12116
|
-
types: function
|
|
12116
|
+
types: function types15() {
|
|
12117
12117
|
return buildUnionTypes(_allNodes3);
|
|
12118
12118
|
},
|
|
12119
12119
|
astNode,
|
|
@@ -12411,7 +12411,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
12411
12411
|
if ((0, _definition.isUnionType)(type)) {
|
|
12412
12412
|
var _config2 = type.toConfig();
|
|
12413
12413
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, {
|
|
12414
|
-
types: function
|
|
12414
|
+
types: function types15() {
|
|
12415
12415
|
return sortTypes(_config2.types);
|
|
12416
12416
|
}
|
|
12417
12417
|
}));
|
|
@@ -12496,10 +12496,10 @@ var require_printSchema = __commonJS({
|
|
|
12496
12496
|
}
|
|
12497
12497
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
12498
12498
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
12499
|
-
var
|
|
12499
|
+
var types15 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
12500
12500
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
12501
12501
|
return printDirective(directive, options);
|
|
12502
|
-
}),
|
|
12502
|
+
}), types15.map(function(type) {
|
|
12503
12503
|
return printType(type, options);
|
|
12504
12504
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
12505
12505
|
}
|
|
@@ -12574,8 +12574,8 @@ var require_printSchema = __commonJS({
|
|
|
12574
12574
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
12575
12575
|
}
|
|
12576
12576
|
function printUnion(type, options) {
|
|
12577
|
-
var
|
|
12578
|
-
var possibleTypes =
|
|
12577
|
+
var types15 = type.getTypes();
|
|
12578
|
+
var possibleTypes = types15.length ? " = " + types15.join(" | ") : "";
|
|
12579
12579
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
12580
12580
|
}
|
|
12581
12581
|
function printEnum(type, options) {
|
|
@@ -23905,14 +23905,14 @@ var require_lib3 = __commonJS({
|
|
|
23905
23905
|
this.preserveSpace = !!preserveSpace;
|
|
23906
23906
|
}
|
|
23907
23907
|
};
|
|
23908
|
-
var
|
|
23908
|
+
var types15 = {
|
|
23909
23909
|
brace: new TokContext("{"),
|
|
23910
23910
|
j_oTag: new TokContext("<tag"),
|
|
23911
23911
|
j_cTag: new TokContext("</tag"),
|
|
23912
23912
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
23913
23913
|
};
|
|
23914
23914
|
{
|
|
23915
|
-
|
|
23915
|
+
types15.template = new TokContext("`", true);
|
|
23916
23916
|
}
|
|
23917
23917
|
var beforeExpr = true;
|
|
23918
23918
|
var startsExpr = true;
|
|
@@ -24444,17 +24444,17 @@ var require_lib3 = __commonJS({
|
|
|
24444
24444
|
context.pop();
|
|
24445
24445
|
};
|
|
24446
24446
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
24447
|
-
context.push(
|
|
24447
|
+
context.push(types15.brace);
|
|
24448
24448
|
};
|
|
24449
24449
|
tokenTypes[22].updateContext = (context) => {
|
|
24450
|
-
if (context[context.length - 1] ===
|
|
24450
|
+
if (context[context.length - 1] === types15.template) {
|
|
24451
24451
|
context.pop();
|
|
24452
24452
|
} else {
|
|
24453
|
-
context.push(
|
|
24453
|
+
context.push(types15.template);
|
|
24454
24454
|
}
|
|
24455
24455
|
};
|
|
24456
24456
|
tokenTypes[140].updateContext = (context) => {
|
|
24457
|
-
context.push(
|
|
24457
|
+
context.push(types15.j_expr, types15.j_oTag);
|
|
24458
24458
|
};
|
|
24459
24459
|
}
|
|
24460
24460
|
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";
|
|
@@ -25095,7 +25095,7 @@ var require_lib3 = __commonJS({
|
|
|
25095
25095
|
this.lastTokEndLoc = null;
|
|
25096
25096
|
this.lastTokStartLoc = null;
|
|
25097
25097
|
this.lastTokStart = 0;
|
|
25098
|
-
this.context = [
|
|
25098
|
+
this.context = [types15.brace];
|
|
25099
25099
|
this.canStartJSXElement = true;
|
|
25100
25100
|
this.containsEsc = false;
|
|
25101
25101
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -29019,7 +29019,7 @@ var require_lib3 = __commonJS({
|
|
|
29019
29019
|
context
|
|
29020
29020
|
} = this.state;
|
|
29021
29021
|
const currentContext = context[context.length - 1];
|
|
29022
|
-
if (currentContext ===
|
|
29022
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
29023
29023
|
context.pop();
|
|
29024
29024
|
}
|
|
29025
29025
|
}
|
|
@@ -30079,9 +30079,9 @@ var require_lib3 = __commonJS({
|
|
|
30079
30079
|
switch (this.state.type) {
|
|
30080
30080
|
case 5:
|
|
30081
30081
|
node = this.startNode();
|
|
30082
|
-
this.setContext(
|
|
30082
|
+
this.setContext(types15.brace);
|
|
30083
30083
|
this.next();
|
|
30084
|
-
node = this.jsxParseExpressionContainer(node,
|
|
30084
|
+
node = this.jsxParseExpressionContainer(node, types15.j_oTag);
|
|
30085
30085
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
30086
30086
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
30087
30087
|
at: node
|
|
@@ -30104,7 +30104,7 @@ var require_lib3 = __commonJS({
|
|
|
30104
30104
|
jsxParseSpreadChild(node) {
|
|
30105
30105
|
this.next();
|
|
30106
30106
|
node.expression = this.parseExpression();
|
|
30107
|
-
this.setContext(
|
|
30107
|
+
this.setContext(types15.j_expr);
|
|
30108
30108
|
this.state.canStartJSXElement = true;
|
|
30109
30109
|
this.expect(8);
|
|
30110
30110
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -30124,11 +30124,11 @@ var require_lib3 = __commonJS({
|
|
|
30124
30124
|
jsxParseAttribute() {
|
|
30125
30125
|
const node = this.startNode();
|
|
30126
30126
|
if (this.match(5)) {
|
|
30127
|
-
this.setContext(
|
|
30127
|
+
this.setContext(types15.brace);
|
|
30128
30128
|
this.next();
|
|
30129
30129
|
this.expect(21);
|
|
30130
30130
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
30131
|
-
this.setContext(
|
|
30131
|
+
this.setContext(types15.j_oTag);
|
|
30132
30132
|
this.state.canStartJSXElement = true;
|
|
30133
30133
|
this.expect(8);
|
|
30134
30134
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -30187,12 +30187,12 @@ var require_lib3 = __commonJS({
|
|
|
30187
30187
|
break;
|
|
30188
30188
|
case 5: {
|
|
30189
30189
|
const node2 = this.startNode();
|
|
30190
|
-
this.setContext(
|
|
30190
|
+
this.setContext(types15.brace);
|
|
30191
30191
|
this.next();
|
|
30192
30192
|
if (this.match(21)) {
|
|
30193
30193
|
children.push(this.jsxParseSpreadChild(node2));
|
|
30194
30194
|
} else {
|
|
30195
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
30195
|
+
children.push(this.jsxParseExpressionContainer(node2, types15.j_expr));
|
|
30196
30196
|
}
|
|
30197
30197
|
break;
|
|
30198
30198
|
}
|
|
@@ -30263,10 +30263,10 @@ var require_lib3 = __commonJS({
|
|
|
30263
30263
|
}
|
|
30264
30264
|
getTokenFromCode(code) {
|
|
30265
30265
|
const context = this.curContext();
|
|
30266
|
-
if (context ===
|
|
30266
|
+
if (context === types15.j_expr) {
|
|
30267
30267
|
return this.jsxReadToken();
|
|
30268
30268
|
}
|
|
30269
|
-
if (context ===
|
|
30269
|
+
if (context === types15.j_oTag || context === types15.j_cTag) {
|
|
30270
30270
|
if (isIdentifierStart(code)) {
|
|
30271
30271
|
return this.jsxReadWord();
|
|
30272
30272
|
}
|
|
@@ -30274,7 +30274,7 @@ var require_lib3 = __commonJS({
|
|
|
30274
30274
|
++this.state.pos;
|
|
30275
30275
|
return this.finishToken(141);
|
|
30276
30276
|
}
|
|
30277
|
-
if ((code === 34 || code === 39) && context ===
|
|
30277
|
+
if ((code === 34 || code === 39) && context === types15.j_oTag) {
|
|
30278
30278
|
return this.jsxReadString(code);
|
|
30279
30279
|
}
|
|
30280
30280
|
}
|
|
@@ -30290,17 +30290,17 @@ var require_lib3 = __commonJS({
|
|
|
30290
30290
|
type
|
|
30291
30291
|
} = this.state;
|
|
30292
30292
|
if (type === 56 && prevType === 140) {
|
|
30293
|
-
context.splice(-2, 2,
|
|
30293
|
+
context.splice(-2, 2, types15.j_cTag);
|
|
30294
30294
|
this.state.canStartJSXElement = false;
|
|
30295
30295
|
} else if (type === 140) {
|
|
30296
|
-
context.push(
|
|
30296
|
+
context.push(types15.j_oTag);
|
|
30297
30297
|
} else if (type === 141) {
|
|
30298
30298
|
const out = context[context.length - 1];
|
|
30299
|
-
if (out ===
|
|
30299
|
+
if (out === types15.j_oTag && prevType === 56 || out === types15.j_cTag) {
|
|
30300
30300
|
context.pop();
|
|
30301
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
30301
|
+
this.state.canStartJSXElement = context[context.length - 1] === types15.j_expr;
|
|
30302
30302
|
} else {
|
|
30303
|
-
this.setContext(
|
|
30303
|
+
this.setContext(types15.j_expr);
|
|
30304
30304
|
this.state.canStartJSXElement = true;
|
|
30305
30305
|
}
|
|
30306
30306
|
} else {
|
|
@@ -31308,14 +31308,14 @@ var require_lib3 = __commonJS({
|
|
|
31308
31308
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
31309
31309
|
const node = this.startNode();
|
|
31310
31310
|
const hasLeadingOperator = this.eat(operator);
|
|
31311
|
-
const
|
|
31311
|
+
const types16 = [];
|
|
31312
31312
|
do {
|
|
31313
|
-
|
|
31313
|
+
types16.push(parseConstituentType());
|
|
31314
31314
|
} while (this.eat(operator));
|
|
31315
|
-
if (
|
|
31316
|
-
return
|
|
31315
|
+
if (types16.length === 1 && !hasLeadingOperator) {
|
|
31316
|
+
return types16[0];
|
|
31317
31317
|
}
|
|
31318
|
-
node.types =
|
|
31318
|
+
node.types = types16;
|
|
31319
31319
|
return this.finishNode(node, kind);
|
|
31320
31320
|
}
|
|
31321
31321
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -32544,7 +32544,7 @@ var require_lib3 = __commonJS({
|
|
|
32544
32544
|
context
|
|
32545
32545
|
} = this.state;
|
|
32546
32546
|
const currentContext = context[context.length - 1];
|
|
32547
|
-
if (currentContext ===
|
|
32547
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
32548
32548
|
context.pop();
|
|
32549
32549
|
}
|
|
32550
32550
|
}
|
|
@@ -38183,9 +38183,9 @@ var require_shared = __commonJS({
|
|
|
38183
38183
|
var tslib_1 = require_tslib();
|
|
38184
38184
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
38185
38185
|
function default_1(fork) {
|
|
38186
|
-
var
|
|
38187
|
-
var Type =
|
|
38188
|
-
var builtin =
|
|
38186
|
+
var types15 = fork.use(types_1.default);
|
|
38187
|
+
var Type = types15.Type;
|
|
38188
|
+
var builtin = types15.builtInTypes;
|
|
38189
38189
|
var isNumber = builtin.number;
|
|
38190
38190
|
function geq(than) {
|
|
38191
38191
|
return Type.from(function(value) {
|
|
@@ -38335,9 +38335,9 @@ var require_types = __commonJS({
|
|
|
38335
38335
|
}(BaseType);
|
|
38336
38336
|
var OrType = function(_super) {
|
|
38337
38337
|
tslib_1.__extends(OrType2, _super);
|
|
38338
|
-
function OrType2(
|
|
38338
|
+
function OrType2(types15) {
|
|
38339
38339
|
var _this = _super.call(this) || this;
|
|
38340
|
-
_this.types =
|
|
38340
|
+
_this.types = types15;
|
|
38341
38341
|
_this.kind = "OrType";
|
|
38342
38342
|
return _this;
|
|
38343
38343
|
}
|
|
@@ -38478,11 +38478,11 @@ var require_types = __commonJS({
|
|
|
38478
38478
|
function typesPlugin(_fork) {
|
|
38479
38479
|
var Type = {
|
|
38480
38480
|
or: function() {
|
|
38481
|
-
var
|
|
38481
|
+
var types15 = [];
|
|
38482
38482
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38483
|
-
|
|
38483
|
+
types15[_i] = arguments[_i];
|
|
38484
38484
|
}
|
|
38485
|
-
return new OrType(
|
|
38485
|
+
return new OrType(types15.map(function(type) {
|
|
38486
38486
|
return Type.from(type);
|
|
38487
38487
|
}));
|
|
38488
38488
|
},
|
|
@@ -38927,9 +38927,9 @@ var require_path2 = __commonJS({
|
|
|
38927
38927
|
var Op = Object.prototype;
|
|
38928
38928
|
var hasOwn = Op.hasOwnProperty;
|
|
38929
38929
|
function pathPlugin(fork) {
|
|
38930
|
-
var
|
|
38931
|
-
var isArray =
|
|
38932
|
-
var isNumber =
|
|
38930
|
+
var types15 = fork.use(types_1.default);
|
|
38931
|
+
var isArray = types15.builtInTypes.array;
|
|
38932
|
+
var isNumber = types15.builtInTypes.number;
|
|
38933
38933
|
var Path = function Path2(value, parentPath, name) {
|
|
38934
38934
|
if (!(this instanceof Path2)) {
|
|
38935
38935
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -39231,13 +39231,13 @@ var require_scope = __commonJS({
|
|
|
39231
39231
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
39232
39232
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39233
39233
|
function scopePlugin(fork) {
|
|
39234
|
-
var
|
|
39235
|
-
var Type =
|
|
39236
|
-
var namedTypes =
|
|
39234
|
+
var types15 = fork.use(types_1.default);
|
|
39235
|
+
var Type = types15.Type;
|
|
39236
|
+
var namedTypes = types15.namedTypes;
|
|
39237
39237
|
var Node = namedTypes.Node;
|
|
39238
39238
|
var Expression = namedTypes.Expression;
|
|
39239
|
-
var isArray =
|
|
39240
|
-
var b =
|
|
39239
|
+
var isArray = types15.builtInTypes.array;
|
|
39240
|
+
var b = types15.builders;
|
|
39241
39241
|
var Scope = function Scope2(path2, parentScope) {
|
|
39242
39242
|
if (!(this instanceof Scope2)) {
|
|
39243
39243
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -39300,7 +39300,7 @@ var require_scope = __commonJS({
|
|
|
39300
39300
|
++index;
|
|
39301
39301
|
}
|
|
39302
39302
|
var name = prefix + index;
|
|
39303
|
-
return this.bindings[name] =
|
|
39303
|
+
return this.bindings[name] = types15.builders.identifier(name);
|
|
39304
39304
|
};
|
|
39305
39305
|
Sp.injectTemporary = function(identifier, init) {
|
|
39306
39306
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39376,7 +39376,7 @@ var require_scope = __commonJS({
|
|
|
39376
39376
|
bindings
|
|
39377
39377
|
);
|
|
39378
39378
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39379
|
-
|
|
39379
|
+
types15.eachField(node, function(name, child) {
|
|
39380
39380
|
var childPath = path2.get(name);
|
|
39381
39381
|
if (!pathHasValue(childPath, child)) {
|
|
39382
39382
|
throw new Error("");
|
|
@@ -39454,24 +39454,24 @@ var require_scope = __commonJS({
|
|
|
39454
39454
|
addPattern(patternPath.get("argument"), bindings);
|
|
39455
39455
|
}
|
|
39456
39456
|
}
|
|
39457
|
-
function addTypePattern(patternPath,
|
|
39457
|
+
function addTypePattern(patternPath, types16) {
|
|
39458
39458
|
var pattern = patternPath.value;
|
|
39459
39459
|
namedTypes.Pattern.assert(pattern);
|
|
39460
39460
|
if (namedTypes.Identifier.check(pattern)) {
|
|
39461
|
-
if (hasOwn.call(
|
|
39462
|
-
|
|
39461
|
+
if (hasOwn.call(types16, pattern.name)) {
|
|
39462
|
+
types16[pattern.name].push(patternPath);
|
|
39463
39463
|
} else {
|
|
39464
|
-
|
|
39464
|
+
types16[pattern.name] = [patternPath];
|
|
39465
39465
|
}
|
|
39466
39466
|
}
|
|
39467
39467
|
}
|
|
39468
|
-
function addTypeParameter(parameterPath,
|
|
39468
|
+
function addTypeParameter(parameterPath, types16) {
|
|
39469
39469
|
var parameter = parameterPath.value;
|
|
39470
39470
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
39471
|
-
if (hasOwn.call(
|
|
39472
|
-
|
|
39471
|
+
if (hasOwn.call(types16, parameter.name)) {
|
|
39472
|
+
types16[parameter.name].push(parameterPath);
|
|
39473
39473
|
} else {
|
|
39474
|
-
|
|
39474
|
+
types16[parameter.name] = [parameterPath];
|
|
39475
39475
|
}
|
|
39476
39476
|
}
|
|
39477
39477
|
Sp.lookup = function(name) {
|
|
@@ -39512,11 +39512,11 @@ var require_node_path = __commonJS({
|
|
|
39512
39512
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
39513
39513
|
var shared_1 = require_shared();
|
|
39514
39514
|
function nodePathPlugin(fork) {
|
|
39515
|
-
var
|
|
39516
|
-
var n =
|
|
39517
|
-
var b =
|
|
39518
|
-
var isNumber =
|
|
39519
|
-
var isArray =
|
|
39515
|
+
var types15 = fork.use(types_1.default);
|
|
39516
|
+
var n = types15.namedTypes;
|
|
39517
|
+
var b = types15.builders;
|
|
39518
|
+
var isNumber = types15.builtInTypes.number;
|
|
39519
|
+
var isArray = types15.builtInTypes.array;
|
|
39520
39520
|
var Path = fork.use(path_1.default);
|
|
39521
39521
|
var Scope = fork.use(scope_1.default);
|
|
39522
39522
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -39607,7 +39607,7 @@ var require_node_path = __commonJS({
|
|
|
39607
39607
|
return scope || null;
|
|
39608
39608
|
};
|
|
39609
39609
|
NPp.getValueProperty = function(name) {
|
|
39610
|
-
return
|
|
39610
|
+
return types15.getFieldValue(this.value, name);
|
|
39611
39611
|
};
|
|
39612
39612
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39613
39613
|
var pp = this.parentPath;
|
|
@@ -39749,7 +39749,7 @@ var require_node_path = __commonJS({
|
|
|
39749
39749
|
return node.some(containsCallExpression);
|
|
39750
39750
|
}
|
|
39751
39751
|
if (n.Node.check(node)) {
|
|
39752
|
-
return
|
|
39752
|
+
return types15.someField(node, function(_name, child) {
|
|
39753
39753
|
return containsCallExpression(child);
|
|
39754
39754
|
});
|
|
39755
39755
|
}
|
|
@@ -39870,11 +39870,11 @@ var require_path_visitor = __commonJS({
|
|
|
39870
39870
|
var shared_1 = require_shared();
|
|
39871
39871
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39872
39872
|
function pathVisitorPlugin(fork) {
|
|
39873
|
-
var
|
|
39873
|
+
var types15 = fork.use(types_1.default);
|
|
39874
39874
|
var NodePath = fork.use(node_path_1.default);
|
|
39875
|
-
var isArray =
|
|
39876
|
-
var isObject =
|
|
39877
|
-
var isFunction =
|
|
39875
|
+
var isArray = types15.builtInTypes.array;
|
|
39876
|
+
var isObject = types15.builtInTypes.object;
|
|
39877
|
+
var isFunction = types15.builtInTypes.function;
|
|
39878
39878
|
var undefined2;
|
|
39879
39879
|
var PathVisitor = function PathVisitor2() {
|
|
39880
39880
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -39894,7 +39894,7 @@ var require_path_visitor = __commonJS({
|
|
|
39894
39894
|
typeNames[methodName.slice("visit".length)] = true;
|
|
39895
39895
|
}
|
|
39896
39896
|
}
|
|
39897
|
-
var supertypeTable =
|
|
39897
|
+
var supertypeTable = types15.computeSupertypeLookupTable(typeNames);
|
|
39898
39898
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
39899
39899
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
39900
39900
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -40013,7 +40013,7 @@ var require_path_visitor = __commonJS({
|
|
|
40013
40013
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
40014
40014
|
} else if (!isObject.check(value)) {
|
|
40015
40015
|
} else {
|
|
40016
|
-
var childNames =
|
|
40016
|
+
var childNames = types15.getFieldNames(value);
|
|
40017
40017
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
40018
40018
|
childNames.push("comments");
|
|
40019
40019
|
}
|
|
@@ -40022,7 +40022,7 @@ var require_path_visitor = __commonJS({
|
|
|
40022
40022
|
for (var i = 0; i < childCount; ++i) {
|
|
40023
40023
|
var childName = childNames[i];
|
|
40024
40024
|
if (!hasOwn.call(value, childName)) {
|
|
40025
|
-
value[childName] =
|
|
40025
|
+
value[childName] = types15.getFieldValue(value, childName);
|
|
40026
40026
|
}
|
|
40027
40027
|
childPaths.push(path2.get(childName));
|
|
40028
40028
|
}
|
|
@@ -40165,13 +40165,13 @@ var require_equiv = __commonJS({
|
|
|
40165
40165
|
var shared_1 = require_shared();
|
|
40166
40166
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40167
40167
|
function default_1(fork) {
|
|
40168
|
-
var
|
|
40169
|
-
var getFieldNames =
|
|
40170
|
-
var getFieldValue =
|
|
40171
|
-
var isArray =
|
|
40172
|
-
var isObject =
|
|
40173
|
-
var isDate =
|
|
40174
|
-
var isRegExp =
|
|
40168
|
+
var types15 = fork.use(types_1.default);
|
|
40169
|
+
var getFieldNames = types15.getFieldNames;
|
|
40170
|
+
var getFieldValue = types15.getFieldValue;
|
|
40171
|
+
var isArray = types15.builtInTypes.array;
|
|
40172
|
+
var isObject = types15.builtInTypes.object;
|
|
40173
|
+
var isDate = types15.builtInTypes.Date;
|
|
40174
|
+
var isRegExp = types15.builtInTypes.RegExp;
|
|
40175
40175
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
40176
40176
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
40177
40177
|
if (isArray.check(problemPath)) {
|
|
@@ -40324,24 +40324,24 @@ var require_fork = __commonJS({
|
|
|
40324
40324
|
var shared_1 = require_shared();
|
|
40325
40325
|
function default_1(plugins) {
|
|
40326
40326
|
var fork = createFork();
|
|
40327
|
-
var
|
|
40327
|
+
var types15 = fork.use(types_1.default);
|
|
40328
40328
|
plugins.forEach(fork.use);
|
|
40329
|
-
|
|
40329
|
+
types15.finalize();
|
|
40330
40330
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
40331
40331
|
return {
|
|
40332
|
-
Type:
|
|
40333
|
-
builtInTypes:
|
|
40334
|
-
namedTypes:
|
|
40335
|
-
builders:
|
|
40336
|
-
defineMethod:
|
|
40337
|
-
getFieldNames:
|
|
40338
|
-
getFieldValue:
|
|
40339
|
-
eachField:
|
|
40340
|
-
someField:
|
|
40341
|
-
getSupertypeNames:
|
|
40342
|
-
getBuilderName:
|
|
40332
|
+
Type: types15.Type,
|
|
40333
|
+
builtInTypes: types15.builtInTypes,
|
|
40334
|
+
namedTypes: types15.namedTypes,
|
|
40335
|
+
builders: types15.builders,
|
|
40336
|
+
defineMethod: types15.defineMethod,
|
|
40337
|
+
getFieldNames: types15.getFieldNames,
|
|
40338
|
+
getFieldValue: types15.getFieldValue,
|
|
40339
|
+
eachField: types15.eachField,
|
|
40340
|
+
someField: types15.someField,
|
|
40341
|
+
getSupertypeNames: types15.getSupertypeNames,
|
|
40342
|
+
getBuilderName: types15.getBuilderName,
|
|
40343
40343
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
40344
|
-
finalize:
|
|
40344
|
+
finalize: types15.finalize,
|
|
40345
40345
|
Path: fork.use(path_1.default),
|
|
40346
40346
|
NodePath: fork.use(node_path_1.default),
|
|
40347
40347
|
PathVisitor,
|
|
@@ -40511,8 +40511,8 @@ var require_core2 = __commonJS({
|
|
|
40511
40511
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40512
40512
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40513
40513
|
function default_1(fork) {
|
|
40514
|
-
var
|
|
40515
|
-
var Type =
|
|
40514
|
+
var types15 = fork.use(types_1.default);
|
|
40515
|
+
var Type = types15.Type;
|
|
40516
40516
|
var def = Type.def;
|
|
40517
40517
|
var or = Type.or;
|
|
40518
40518
|
var shared = fork.use(shared_1.default);
|
|
@@ -40604,9 +40604,9 @@ var require_es6 = __commonJS({
|
|
|
40604
40604
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40605
40605
|
function default_1(fork) {
|
|
40606
40606
|
fork.use(core_1.default);
|
|
40607
|
-
var
|
|
40608
|
-
var def =
|
|
40609
|
-
var or =
|
|
40607
|
+
var types15 = fork.use(types_1.default);
|
|
40608
|
+
var def = types15.Type.def;
|
|
40609
|
+
var or = types15.Type.or;
|
|
40610
40610
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40611
40611
|
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"]);
|
|
40612
40612
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -40696,8 +40696,8 @@ var require_es2017 = __commonJS({
|
|
|
40696
40696
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40697
40697
|
function default_1(fork) {
|
|
40698
40698
|
fork.use(es2016_1.default);
|
|
40699
|
-
var
|
|
40700
|
-
var def =
|
|
40699
|
+
var types15 = fork.use(types_1.default);
|
|
40700
|
+
var def = types15.Type.def;
|
|
40701
40701
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40702
40702
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
40703
40703
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -40720,9 +40720,9 @@ var require_es2018 = __commonJS({
|
|
|
40720
40720
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40721
40721
|
function default_1(fork) {
|
|
40722
40722
|
fork.use(es2017_1.default);
|
|
40723
|
-
var
|
|
40724
|
-
var def =
|
|
40725
|
-
var or =
|
|
40723
|
+
var types15 = fork.use(types_1.default);
|
|
40724
|
+
var def = types15.Type.def;
|
|
40725
|
+
var or = types15.Type.or;
|
|
40726
40726
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40727
40727
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
40728
40728
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -40753,9 +40753,9 @@ var require_es2019 = __commonJS({
|
|
|
40753
40753
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40754
40754
|
function default_1(fork) {
|
|
40755
40755
|
fork.use(es2018_1.default);
|
|
40756
|
-
var
|
|
40757
|
-
var def =
|
|
40758
|
-
var or =
|
|
40756
|
+
var types15 = fork.use(types_1.default);
|
|
40757
|
+
var def = types15.Type.def;
|
|
40758
|
+
var or = types15.Type.or;
|
|
40759
40759
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40760
40760
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
40761
40761
|
}
|
|
@@ -40779,9 +40779,9 @@ var require_es20202 = __commonJS({
|
|
|
40779
40779
|
function default_1(fork) {
|
|
40780
40780
|
fork.use(es2020_1.default);
|
|
40781
40781
|
fork.use(es2019_1.default);
|
|
40782
|
-
var
|
|
40783
|
-
var def =
|
|
40784
|
-
var or =
|
|
40782
|
+
var types15 = fork.use(types_1.default);
|
|
40783
|
+
var def = types15.Type.def;
|
|
40784
|
+
var or = types15.Type.or;
|
|
40785
40785
|
var shared = fork.use(shared_1.default);
|
|
40786
40786
|
var defaults = shared.defaults;
|
|
40787
40787
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -40831,8 +40831,8 @@ var require_es2022 = __commonJS({
|
|
|
40831
40831
|
var shared_1 = require_shared();
|
|
40832
40832
|
function default_1(fork) {
|
|
40833
40833
|
fork.use(es2021_1.default);
|
|
40834
|
-
var
|
|
40835
|
-
var def =
|
|
40834
|
+
var types15 = fork.use(types_1.default);
|
|
40835
|
+
var def = types15.Type.def;
|
|
40836
40836
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
40837
40837
|
}
|
|
40838
40838
|
exports.default = default_1;
|
|
@@ -40853,9 +40853,9 @@ var require_es_proposals = __commonJS({
|
|
|
40853
40853
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
40854
40854
|
function default_1(fork) {
|
|
40855
40855
|
fork.use(es2022_1.default);
|
|
40856
|
-
var
|
|
40857
|
-
var Type =
|
|
40858
|
-
var def =
|
|
40856
|
+
var types15 = fork.use(types_1.default);
|
|
40857
|
+
var Type = types15.Type;
|
|
40858
|
+
var def = types15.Type.def;
|
|
40859
40859
|
var or = Type.or;
|
|
40860
40860
|
var shared = fork.use(shared_1.default);
|
|
40861
40861
|
var defaults = shared.defaults;
|
|
@@ -40895,9 +40895,9 @@ var require_jsx = __commonJS({
|
|
|
40895
40895
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40896
40896
|
function default_1(fork) {
|
|
40897
40897
|
fork.use(es_proposals_1.default);
|
|
40898
|
-
var
|
|
40899
|
-
var def =
|
|
40900
|
-
var or =
|
|
40898
|
+
var types15 = fork.use(types_1.default);
|
|
40899
|
+
var def = types15.Type.def;
|
|
40900
|
+
var or = types15.Type.or;
|
|
40901
40901
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40902
40902
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
40903
40903
|
def("Literal"),
|
|
@@ -40955,9 +40955,9 @@ var require_type_annotations = __commonJS({
|
|
|
40955
40955
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40956
40956
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40957
40957
|
function default_1(fork) {
|
|
40958
|
-
var
|
|
40959
|
-
var def =
|
|
40960
|
-
var or =
|
|
40958
|
+
var types15 = fork.use(types_1.default);
|
|
40959
|
+
var def = types15.Type.def;
|
|
40960
|
+
var or = types15.Type.or;
|
|
40961
40961
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40962
40962
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
40963
40963
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -40992,9 +40992,9 @@ var require_flow = __commonJS({
|
|
|
40992
40992
|
function default_1(fork) {
|
|
40993
40993
|
fork.use(es_proposals_1.default);
|
|
40994
40994
|
fork.use(type_annotations_1.default);
|
|
40995
|
-
var
|
|
40996
|
-
var def =
|
|
40997
|
-
var or =
|
|
40995
|
+
var types15 = fork.use(types_1.default);
|
|
40996
|
+
var def = types15.Type.def;
|
|
40997
|
+
var or = types15.Type.or;
|
|
40998
40998
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40999
40999
|
def("Flow").bases("Node");
|
|
41000
41000
|
def("FlowType").bases("Flow");
|
|
@@ -41108,10 +41108,10 @@ var require_esprima = __commonJS({
|
|
|
41108
41108
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
41109
41109
|
function default_1(fork) {
|
|
41110
41110
|
fork.use(es_proposals_1.default);
|
|
41111
|
-
var
|
|
41111
|
+
var types15 = fork.use(types_1.default);
|
|
41112
41112
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41113
|
-
var def =
|
|
41114
|
-
var or =
|
|
41113
|
+
var def = types15.Type.def;
|
|
41114
|
+
var or = types15.Type.or;
|
|
41115
41115
|
def("VariableDeclaration").field("declarations", [or(
|
|
41116
41116
|
def("VariableDeclarator"),
|
|
41117
41117
|
def("Identifier")
|
|
@@ -41156,11 +41156,11 @@ var require_babel_core = __commonJS({
|
|
|
41156
41156
|
function default_1(fork) {
|
|
41157
41157
|
var _a, _b, _c, _d, _e;
|
|
41158
41158
|
fork.use(es_proposals_1.default);
|
|
41159
|
-
var
|
|
41159
|
+
var types15 = fork.use(types_1.default);
|
|
41160
41160
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41161
|
-
var def =
|
|
41162
|
-
var or =
|
|
41163
|
-
var isUndefined =
|
|
41161
|
+
var def = types15.Type.def;
|
|
41162
|
+
var or = types15.Type.or;
|
|
41163
|
+
var isUndefined = types15.builtInTypes.undefined;
|
|
41164
41164
|
def("Noop").bases("Statement").build();
|
|
41165
41165
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
41166
41166
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -41185,7 +41185,7 @@ var require_babel_core = __commonJS({
|
|
|
41185
41185
|
raw: String
|
|
41186
41186
|
},
|
|
41187
41187
|
function getDefault() {
|
|
41188
|
-
var value =
|
|
41188
|
+
var value = types15.getFieldValue(this, "value");
|
|
41189
41189
|
return {
|
|
41190
41190
|
rawValue: value,
|
|
41191
41191
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -41288,8 +41288,8 @@ var require_babel = __commonJS({
|
|
|
41288
41288
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
41289
41289
|
var shared_1 = require_shared();
|
|
41290
41290
|
function default_1(fork) {
|
|
41291
|
-
var
|
|
41292
|
-
var def =
|
|
41291
|
+
var types15 = fork.use(types_1.default);
|
|
41292
|
+
var def = types15.Type.def;
|
|
41293
41293
|
fork.use(babel_core_1.default);
|
|
41294
41294
|
fork.use(flow_1.default);
|
|
41295
41295
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -41315,12 +41315,12 @@ var require_typescript = __commonJS({
|
|
|
41315
41315
|
function default_1(fork) {
|
|
41316
41316
|
fork.use(babel_core_1.default);
|
|
41317
41317
|
fork.use(type_annotations_1.default);
|
|
41318
|
-
var
|
|
41319
|
-
var n =
|
|
41320
|
-
var def =
|
|
41321
|
-
var or =
|
|
41318
|
+
var types15 = fork.use(types_1.default);
|
|
41319
|
+
var n = types15.namedTypes;
|
|
41320
|
+
var def = types15.Type.def;
|
|
41321
|
+
var or = types15.Type.or;
|
|
41322
41322
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41323
|
-
var StringLiteral =
|
|
41323
|
+
var StringLiteral = types15.Type.from(function(value, deep) {
|
|
41324
41324
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
41325
41325
|
return true;
|
|
41326
41326
|
}
|
|
@@ -43296,8 +43296,8 @@ var require_util2 = __commonJS({
|
|
|
43296
43296
|
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;
|
|
43297
43297
|
var tslib_1 = require_tslib();
|
|
43298
43298
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
43299
|
-
var
|
|
43300
|
-
var n =
|
|
43299
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
43300
|
+
var n = types15.namedTypes;
|
|
43301
43301
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
43302
43302
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
43303
43303
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -50615,10 +50615,10 @@ var require_comments = __commonJS({
|
|
|
50615
50615
|
exports.printComments = exports.attach = void 0;
|
|
50616
50616
|
var tslib_1 = require_tslib();
|
|
50617
50617
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
50618
|
-
var
|
|
50619
|
-
var n =
|
|
50620
|
-
var isArray =
|
|
50621
|
-
var isObject =
|
|
50618
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50619
|
+
var n = types15.namedTypes;
|
|
50620
|
+
var isArray = types15.builtInTypes.array;
|
|
50621
|
+
var isObject = types15.builtInTypes.object;
|
|
50622
50622
|
var lines_1 = require_lines();
|
|
50623
50623
|
var util_1 = require_util2();
|
|
50624
50624
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -50649,7 +50649,7 @@ var require_comments = __commonJS({
|
|
|
50649
50649
|
if (isArray.check(node)) {
|
|
50650
50650
|
names = Object.keys(node);
|
|
50651
50651
|
} else if (isObject.check(node)) {
|
|
50652
|
-
names =
|
|
50652
|
+
names = types15.getFieldNames(node);
|
|
50653
50653
|
} else {
|
|
50654
50654
|
return resultArray;
|
|
50655
50655
|
}
|
|
@@ -50827,7 +50827,7 @@ var require_comments = __commonJS({
|
|
|
50827
50827
|
function printComments(path2, print7) {
|
|
50828
50828
|
var value = path2.getValue();
|
|
50829
50829
|
var innerLines = print7(path2);
|
|
50830
|
-
var comments = n.Node.check(value) &&
|
|
50830
|
+
var comments = n.Node.check(value) && types15.getFieldValue(value, "comments");
|
|
50831
50831
|
if (!comments || comments.length === 0) {
|
|
50832
50832
|
return innerLines;
|
|
50833
50833
|
}
|
|
@@ -50835,8 +50835,8 @@ var require_comments = __commonJS({
|
|
|
50835
50835
|
var trailingParts = [innerLines];
|
|
50836
50836
|
path2.each(function(commentPath) {
|
|
50837
50837
|
var comment = commentPath.getValue();
|
|
50838
|
-
var leading =
|
|
50839
|
-
var trailing =
|
|
50838
|
+
var leading = types15.getFieldValue(comment, "leading");
|
|
50839
|
+
var trailing = types15.getFieldValue(comment, "trailing");
|
|
50840
50840
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50841
50841
|
leadingParts.push(printLeadingComment(commentPath, print7));
|
|
50842
50842
|
} else if (trailing) {
|
|
@@ -50858,10 +50858,10 @@ var require_parser2 = __commonJS({
|
|
|
50858
50858
|
exports.parse = void 0;
|
|
50859
50859
|
var tslib_1 = require_tslib();
|
|
50860
50860
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
50861
|
-
var
|
|
50862
|
-
var b =
|
|
50863
|
-
var isObject =
|
|
50864
|
-
var isArray =
|
|
50861
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50862
|
+
var b = types15.builders;
|
|
50863
|
+
var isObject = types15.builtInTypes.object;
|
|
50864
|
+
var isArray = types15.builtInTypes.array;
|
|
50865
50865
|
var options_1 = require_options();
|
|
50866
50866
|
var lines_1 = require_lines();
|
|
50867
50867
|
var comments_1 = require_comments();
|
|
@@ -51047,11 +51047,11 @@ var require_fast_path = __commonJS({
|
|
|
51047
51047
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51048
51048
|
var tslib_1 = require_tslib();
|
|
51049
51049
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51050
|
-
var
|
|
51050
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51051
51051
|
var util = tslib_1.__importStar(require_util2());
|
|
51052
|
-
var n =
|
|
51053
|
-
var isArray =
|
|
51054
|
-
var isNumber =
|
|
51052
|
+
var n = types15.namedTypes;
|
|
51053
|
+
var isArray = types15.builtInTypes.array;
|
|
51054
|
+
var isNumber = types15.builtInTypes.number;
|
|
51055
51055
|
var PRECEDENCE = {};
|
|
51056
51056
|
[
|
|
51057
51057
|
["??"],
|
|
@@ -51080,7 +51080,7 @@ var require_fast_path = __commonJS({
|
|
|
51080
51080
|
if (obj instanceof FastPath) {
|
|
51081
51081
|
return obj.copy();
|
|
51082
51082
|
}
|
|
51083
|
-
if (obj instanceof
|
|
51083
|
+
if (obj instanceof types15.NodePath) {
|
|
51084
51084
|
var copy = Object.create(FastPath.prototype);
|
|
51085
51085
|
var stack = [obj.value];
|
|
51086
51086
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -51391,7 +51391,7 @@ var require_fast_path = __commonJS({
|
|
|
51391
51391
|
return node.some(containsCallExpression);
|
|
51392
51392
|
}
|
|
51393
51393
|
if (n.Node.check(node)) {
|
|
51394
|
-
return
|
|
51394
|
+
return types15.someField(node, function(_name, child) {
|
|
51395
51395
|
return containsCallExpression(child);
|
|
51396
51396
|
});
|
|
51397
51397
|
}
|
|
@@ -51481,16 +51481,16 @@ var require_patcher = __commonJS({
|
|
|
51481
51481
|
var tslib_1 = require_tslib();
|
|
51482
51482
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51483
51483
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
51484
|
-
var
|
|
51485
|
-
var Printable =
|
|
51486
|
-
var Expression =
|
|
51487
|
-
var ReturnStatement =
|
|
51488
|
-
var SourceLocation =
|
|
51484
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51485
|
+
var Printable = types15.namedTypes.Printable;
|
|
51486
|
+
var Expression = types15.namedTypes.Expression;
|
|
51487
|
+
var ReturnStatement = types15.namedTypes.ReturnStatement;
|
|
51488
|
+
var SourceLocation = types15.namedTypes.SourceLocation;
|
|
51489
51489
|
var util_1 = require_util2();
|
|
51490
51490
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51491
|
-
var isObject =
|
|
51492
|
-
var isArray =
|
|
51493
|
-
var isString =
|
|
51491
|
+
var isObject = types15.builtInTypes.object;
|
|
51492
|
+
var isArray = types15.builtInTypes.array;
|
|
51493
|
+
var isString = types15.builtInTypes.string;
|
|
51494
51494
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
51495
51495
|
var Patcher = function Patcher2(lines) {
|
|
51496
51496
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -51760,8 +51760,8 @@ var require_patcher = __commonJS({
|
|
|
51760
51760
|
if (k.charAt(0) === "_") {
|
|
51761
51761
|
continue;
|
|
51762
51762
|
}
|
|
51763
|
-
newPath.stack.push(k,
|
|
51764
|
-
oldPath.stack.push(k,
|
|
51763
|
+
newPath.stack.push(k, types15.getFieldValue(newNode, k));
|
|
51764
|
+
oldPath.stack.push(k, types15.getFieldValue(oldNode, k));
|
|
51765
51765
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
51766
51766
|
newPath.stack.length -= 2;
|
|
51767
51767
|
oldPath.stack.length -= 2;
|
|
@@ -51785,16 +51785,16 @@ var require_printer2 = __commonJS({
|
|
|
51785
51785
|
exports.Printer = void 0;
|
|
51786
51786
|
var tslib_1 = require_tslib();
|
|
51787
51787
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51788
|
-
var
|
|
51788
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51789
51789
|
var comments_1 = require_comments();
|
|
51790
51790
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51791
51791
|
var lines_1 = require_lines();
|
|
51792
51792
|
var options_1 = require_options();
|
|
51793
51793
|
var patcher_1 = require_patcher();
|
|
51794
51794
|
var util = tslib_1.__importStar(require_util2());
|
|
51795
|
-
var namedTypes =
|
|
51796
|
-
var isString =
|
|
51797
|
-
var isObject =
|
|
51795
|
+
var namedTypes = types15.namedTypes;
|
|
51796
|
+
var isString = types15.builtInTypes.string;
|
|
51797
|
+
var isObject = types15.builtInTypes.object;
|
|
51798
51798
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
51799
51799
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
51800
51800
|
isString.assert(code);
|
|
@@ -51956,7 +51956,7 @@ var require_printer2 = __commonJS({
|
|
|
51956
51956
|
case "OptionalMemberExpression": {
|
|
51957
51957
|
parts.push(path2.call(print7, "object"));
|
|
51958
51958
|
var property = path2.call(print7, "property");
|
|
51959
|
-
var optional =
|
|
51959
|
+
var optional = types15.getFieldValue(n, "optional");
|
|
51960
51960
|
if (n.computed) {
|
|
51961
51961
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
51962
51962
|
} else {
|
|
@@ -52227,7 +52227,7 @@ var require_printer2 = __commonJS({
|
|
|
52227
52227
|
if (n.typeArguments) {
|
|
52228
52228
|
parts.push(path2.call(print7, "typeArguments"));
|
|
52229
52229
|
}
|
|
52230
|
-
if (
|
|
52230
|
+
if (types15.getFieldValue(n, "optional")) {
|
|
52231
52231
|
parts.push("?.");
|
|
52232
52232
|
}
|
|
52233
52233
|
parts.push(printArgumentsList(path2, options, print7));
|
|
@@ -53906,8 +53906,8 @@ var require_printer2 = __commonJS({
|
|
|
53906
53906
|
});
|
|
53907
53907
|
}
|
|
53908
53908
|
function getPossibleRaw(node) {
|
|
53909
|
-
var value =
|
|
53910
|
-
var extra =
|
|
53909
|
+
var value = types15.getFieldValue(node, "value");
|
|
53910
|
+
var extra = types15.getFieldValue(node, "extra");
|
|
53911
53911
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
53912
53912
|
return extra.raw;
|
|
53913
53913
|
}
|
|
@@ -53955,8 +53955,8 @@ var require_main2 = __commonJS({
|
|
|
53955
53955
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
53956
53956
|
var tslib_1 = require_tslib();
|
|
53957
53957
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
53958
|
-
var
|
|
53959
|
-
exports.types =
|
|
53958
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
53959
|
+
exports.types = types15;
|
|
53960
53960
|
var parser_1 = require_parser2();
|
|
53961
53961
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
53962
53962
|
return parser_1.parse;
|
|
@@ -54682,6 +54682,9 @@ var GarbageCollector = class {
|
|
|
54682
54682
|
constructor(cache) {
|
|
54683
54683
|
this.cache = cache;
|
|
54684
54684
|
}
|
|
54685
|
+
reset() {
|
|
54686
|
+
this.lifetimes.clear();
|
|
54687
|
+
}
|
|
54685
54688
|
resetLifetime(id, field) {
|
|
54686
54689
|
if (!this.lifetimes.get(id)) {
|
|
54687
54690
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -54801,6 +54804,10 @@ var ListManager = class {
|
|
|
54801
54804
|
}
|
|
54802
54805
|
this.listsByField.get(parentID).delete(field);
|
|
54803
54806
|
}
|
|
54807
|
+
reset() {
|
|
54808
|
+
this.lists.clear();
|
|
54809
|
+
this.listsByField.clear();
|
|
54810
|
+
}
|
|
54804
54811
|
};
|
|
54805
54812
|
var List = class {
|
|
54806
54813
|
recordID;
|
|
@@ -55183,6 +55190,9 @@ var StaleManager = class {
|
|
|
55183
55190
|
}
|
|
55184
55191
|
}
|
|
55185
55192
|
}
|
|
55193
|
+
reset() {
|
|
55194
|
+
this.fieldsTime.clear();
|
|
55195
|
+
}
|
|
55186
55196
|
};
|
|
55187
55197
|
|
|
55188
55198
|
// src/runtime/cache/storage.ts
|
|
@@ -55363,6 +55373,9 @@ var InMemoryStorage = class {
|
|
|
55363
55373
|
layer.fields = fields;
|
|
55364
55374
|
layer.links = links;
|
|
55365
55375
|
}
|
|
55376
|
+
reset() {
|
|
55377
|
+
this.data = [];
|
|
55378
|
+
}
|
|
55366
55379
|
};
|
|
55367
55380
|
var Layer = class {
|
|
55368
55381
|
id;
|
|
@@ -55808,6 +55821,18 @@ var InMemorySubscriptions = class {
|
|
|
55808
55821
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
55809
55822
|
}
|
|
55810
55823
|
}
|
|
55824
|
+
reset() {
|
|
55825
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
55826
|
+
([id]) => !id.startsWith(rootID)
|
|
55827
|
+
);
|
|
55828
|
+
for (const [id, _fields] of subscribers) {
|
|
55829
|
+
delete this.subscribers[id];
|
|
55830
|
+
}
|
|
55831
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
55832
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
55833
|
+
);
|
|
55834
|
+
return subscriptionSpecs;
|
|
55835
|
+
}
|
|
55811
55836
|
removeSubscribers(id, fieldName, specs) {
|
|
55812
55837
|
let targets = [];
|
|
55813
55838
|
for (const spec of specs) {
|
|
@@ -55997,6 +56022,14 @@ var Cache = class {
|
|
|
55997
56022
|
}
|
|
55998
56023
|
this.#notifySubscribers(toNotify);
|
|
55999
56024
|
}
|
|
56025
|
+
reset() {
|
|
56026
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
56027
|
+
this._internal_unstable.staleManager.reset();
|
|
56028
|
+
this._internal_unstable.lifetimes.reset();
|
|
56029
|
+
this._internal_unstable.lists.reset();
|
|
56030
|
+
this._internal_unstable.storage.reset();
|
|
56031
|
+
this.#notifySubscribers(subSpecs);
|
|
56032
|
+
}
|
|
56000
56033
|
#notifySubscribers(subs) {
|
|
56001
56034
|
if (subs.length === 0) {
|
|
56002
56035
|
return;
|
|
@@ -56146,12 +56179,9 @@ var CacheInternal = class {
|
|
|
56146
56179
|
);
|
|
56147
56180
|
}
|
|
56148
56181
|
}
|
|
56149
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56150
|
-
(field2) => typeof value[field2] === "undefined"
|
|
56151
|
-
).length > 0;
|
|
56152
56182
|
let linkedID = null;
|
|
56153
56183
|
if (value !== null) {
|
|
56154
|
-
linkedID = !
|
|
56184
|
+
linkedID = !this.isEmbedded(linkedType, value) ? this.id(linkedType, value) : `${parent2}.${key}`;
|
|
56155
56185
|
}
|
|
56156
56186
|
let linkChange = linkedID !== previousValue;
|
|
56157
56187
|
layer.writeLink(parent2, key, linkedID);
|
|
@@ -56179,7 +56209,7 @@ var CacheInternal = class {
|
|
|
56179
56209
|
forceNotify
|
|
56180
56210
|
});
|
|
56181
56211
|
}
|
|
56182
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
56212
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
56183
56213
|
let oldIDs = [...previousValue || []];
|
|
56184
56214
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
56185
56215
|
if (!id) {
|
|
@@ -56252,7 +56282,7 @@ var CacheInternal = class {
|
|
|
56252
56282
|
} else {
|
|
56253
56283
|
linkedIDs = nestedIDs;
|
|
56254
56284
|
}
|
|
56255
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
56285
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
56256
56286
|
if (contentChanged || forceNotify) {
|
|
56257
56287
|
toNotify.push(...currentSubscribers);
|
|
56258
56288
|
}
|
|
@@ -56523,6 +56553,10 @@ var CacheInternal = class {
|
|
|
56523
56553
|
computeID(type, data) {
|
|
56524
56554
|
return computeID(this.config, type, data);
|
|
56525
56555
|
}
|
|
56556
|
+
isEmbedded(linkedType, value) {
|
|
56557
|
+
const idFields = this.idFields(linkedType);
|
|
56558
|
+
return idFields.length === 0 || idFields.filter((field) => typeof value[field] === "undefined").length > 0;
|
|
56559
|
+
}
|
|
56526
56560
|
hydrateNestedList({
|
|
56527
56561
|
fields,
|
|
56528
56562
|
variables,
|
|
@@ -56630,9 +56664,6 @@ var CacheInternal = class {
|
|
|
56630
56664
|
}
|
|
56631
56665
|
const entryObj = entry;
|
|
56632
56666
|
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
56633
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56634
|
-
(field) => typeof entry[field] === "undefined"
|
|
56635
|
-
).length > 0;
|
|
56636
56667
|
let innerType = linkedType;
|
|
56637
56668
|
const typename = entryObj.__typename;
|
|
56638
56669
|
if (typename) {
|
|
@@ -56640,7 +56671,7 @@ var CacheInternal = class {
|
|
|
56640
56671
|
} else if (abstract) {
|
|
56641
56672
|
throw new Error("Encountered interface type without __typename in the payload");
|
|
56642
56673
|
}
|
|
56643
|
-
if (!
|
|
56674
|
+
if (!this.isEmbedded(linkedType, entry)) {
|
|
56644
56675
|
const id = this.id(innerType, entry);
|
|
56645
56676
|
if (id) {
|
|
56646
56677
|
linkedID = id;
|
|
@@ -56972,7 +57003,7 @@ var Config = class {
|
|
|
56972
57003
|
defaultListTarget = null,
|
|
56973
57004
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
56974
57005
|
defaultKeys,
|
|
56975
|
-
types:
|
|
57006
|
+
types: types15 = {},
|
|
56976
57007
|
logLevel,
|
|
56977
57008
|
defaultFragmentMasking = "enable",
|
|
56978
57009
|
watchSchema,
|
|
@@ -57016,10 +57047,10 @@ var Config = class {
|
|
|
57016
57047
|
if (defaultKeys) {
|
|
57017
57048
|
this.defaultKeys = defaultKeys;
|
|
57018
57049
|
}
|
|
57019
|
-
if (
|
|
57050
|
+
if (types15) {
|
|
57020
57051
|
this.typeConfig = {
|
|
57021
57052
|
...this.typeConfig,
|
|
57022
|
-
...
|
|
57053
|
+
...types15
|
|
57023
57054
|
};
|
|
57024
57055
|
}
|
|
57025
57056
|
}
|
|
@@ -57754,7 +57785,7 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
57754
57785
|
|
|
57755
57786
|
// src/codegen/generators/artifacts/index.ts
|
|
57756
57787
|
var graphql12 = __toESM(require_graphql2(), 1);
|
|
57757
|
-
var
|
|
57788
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
57758
57789
|
|
|
57759
57790
|
// src/codegen/utils/commonjs.ts
|
|
57760
57791
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -58941,7 +58972,6 @@ function ancestorKey(ancestors) {
|
|
|
58941
58972
|
|
|
58942
58973
|
// src/codegen/generators/artifacts/selection.ts
|
|
58943
58974
|
var graphql11 = __toESM(require_graphql2(), 1);
|
|
58944
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
58945
58975
|
|
|
58946
58976
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
58947
58977
|
var config = {
|
|
@@ -59888,15 +59918,12 @@ function fieldKey(config2, field) {
|
|
|
59888
59918
|
}
|
|
59889
59919
|
|
|
59890
59920
|
// src/codegen/generators/artifacts/selection.ts
|
|
59891
|
-
var AST5 = recast5.types.builders;
|
|
59892
59921
|
function selection_default(args) {
|
|
59893
|
-
const typeMap = {};
|
|
59894
|
-
const abstractTypes = [];
|
|
59895
59922
|
return mergeSelection({
|
|
59896
|
-
|
|
59897
|
-
|
|
59898
|
-
|
|
59899
|
-
|
|
59923
|
+
config: args.config,
|
|
59924
|
+
rootType: args.rootType,
|
|
59925
|
+
object: prepareSelection(args),
|
|
59926
|
+
filepath: args.filepath
|
|
59900
59927
|
});
|
|
59901
59928
|
}
|
|
59902
59929
|
function prepareSelection({
|
|
@@ -59908,8 +59935,6 @@ function prepareSelection({
|
|
|
59908
59935
|
path: path2 = [],
|
|
59909
59936
|
document,
|
|
59910
59937
|
inConnection,
|
|
59911
|
-
typeMap,
|
|
59912
|
-
abstractTypes,
|
|
59913
59938
|
globalLoading,
|
|
59914
59939
|
includeFragments
|
|
59915
59940
|
}) {
|
|
@@ -59929,8 +59954,6 @@ function prepareSelection({
|
|
|
59929
59954
|
selections: field.selectionSet.selections,
|
|
59930
59955
|
path: path2,
|
|
59931
59956
|
document,
|
|
59932
|
-
typeMap,
|
|
59933
|
-
abstractTypes,
|
|
59934
59957
|
globalLoading,
|
|
59935
59958
|
includeFragments
|
|
59936
59959
|
}).fields || {}
|
|
@@ -59942,32 +59965,7 @@ function prepareSelection({
|
|
|
59942
59965
|
typeMap: {}
|
|
59943
59966
|
};
|
|
59944
59967
|
}
|
|
59945
|
-
const parentType = config2.schema.getType(rootType);
|
|
59946
59968
|
const typeConditionName = field.typeCondition.name.value;
|
|
59947
|
-
const typeCondition = config2.schema.getType(typeConditionName);
|
|
59948
|
-
const possibleTypes = [];
|
|
59949
|
-
if (!graphql11.isAbstractType(typeCondition)) {
|
|
59950
|
-
} else if (graphql11.isAbstractType(parentType)) {
|
|
59951
|
-
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
59952
|
-
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
59953
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
59954
|
-
possibleTypes.push(possible.name);
|
|
59955
|
-
}
|
|
59956
|
-
}
|
|
59957
|
-
} else {
|
|
59958
|
-
possibleTypes.push(rootType);
|
|
59959
|
-
}
|
|
59960
|
-
if (possibleTypes.length > 0) {
|
|
59961
|
-
for (const type of possibleTypes) {
|
|
59962
|
-
const existing = typeMap[type];
|
|
59963
|
-
if (!existing || !existing.includes(type)) {
|
|
59964
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
59965
|
-
}
|
|
59966
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
59967
|
-
abstractTypes.push(typeConditionName);
|
|
59968
|
-
}
|
|
59969
|
-
}
|
|
59970
|
-
}
|
|
59971
59969
|
object.abstractFields.fields = {
|
|
59972
59970
|
...object.abstractFields.fields,
|
|
59973
59971
|
[typeConditionName]: prepareSelection({
|
|
@@ -59978,8 +59976,6 @@ function prepareSelection({
|
|
|
59978
59976
|
selections: field.selectionSet.selections,
|
|
59979
59977
|
path: path2,
|
|
59980
59978
|
document,
|
|
59981
|
-
typeMap,
|
|
59982
|
-
abstractTypes,
|
|
59983
59979
|
globalLoading,
|
|
59984
59980
|
includeFragments
|
|
59985
59981
|
}).fields
|
|
@@ -59991,19 +59987,38 @@ function prepareSelection({
|
|
|
59991
59987
|
} else if (field.kind === "Field") {
|
|
59992
59988
|
const type = config2.schema.getType(rootType);
|
|
59993
59989
|
if (!type) {
|
|
59994
|
-
throw new HoudiniError({
|
|
59990
|
+
throw new HoudiniError({
|
|
59991
|
+
filepath,
|
|
59992
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
59993
|
+
});
|
|
59995
59994
|
}
|
|
59996
59995
|
const attributeName = field.alias?.value || field.name.value;
|
|
59997
|
-
let fieldType;
|
|
59996
|
+
let fieldType = null;
|
|
59998
59997
|
let nullable = false;
|
|
59999
59998
|
if (field.name.value === "__typename") {
|
|
60000
59999
|
fieldType = config2.schema.getType("String");
|
|
60001
|
-
} else {
|
|
60000
|
+
} else if ("getFields" in type) {
|
|
60002
60001
|
let typeRef = type.getFields()[field.name.value].type;
|
|
60003
60002
|
fieldType = getRootType(typeRef);
|
|
60004
60003
|
nullable = !graphql11.isNonNullType(typeRef);
|
|
60004
|
+
} else if (graphql11.isAbstractType(type)) {
|
|
60005
|
+
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
60006
|
+
if (graphql11.isObjectType(possible)) {
|
|
60007
|
+
if (possible.getFields()[field.name.value]) {
|
|
60008
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
60009
|
+
nullable = !graphql11.isNonNullType(fieldType);
|
|
60010
|
+
break;
|
|
60011
|
+
}
|
|
60012
|
+
}
|
|
60013
|
+
}
|
|
60014
|
+
}
|
|
60015
|
+
if (!fieldType) {
|
|
60016
|
+
throw {
|
|
60017
|
+
message: "Could not identify field's type",
|
|
60018
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
60019
|
+
};
|
|
60005
60020
|
}
|
|
60006
|
-
const typeName = fieldType.
|
|
60021
|
+
const typeName = getRootType(fieldType).name;
|
|
60007
60022
|
const pathSoFar = path2.concat(attributeName);
|
|
60008
60023
|
const keys2 = config2.keyFieldsForType(rootType);
|
|
60009
60024
|
let fieldObj = {
|
|
@@ -60097,8 +60112,6 @@ function prepareSelection({
|
|
|
60097
60112
|
path: pathSoFar,
|
|
60098
60113
|
document,
|
|
60099
60114
|
inConnection: connectionState,
|
|
60100
|
-
typeMap,
|
|
60101
|
-
abstractTypes,
|
|
60102
60115
|
globalLoading: forceLoading,
|
|
60103
60116
|
includeFragments
|
|
60104
60117
|
});
|
|
@@ -60184,69 +60197,107 @@ function prepareSelection({
|
|
|
60184
60197
|
return object;
|
|
60185
60198
|
}
|
|
60186
60199
|
function mergeSelection({
|
|
60200
|
+
config: config2,
|
|
60187
60201
|
filepath,
|
|
60188
60202
|
object,
|
|
60189
|
-
|
|
60190
|
-
abstractTypes
|
|
60203
|
+
rootType
|
|
60191
60204
|
}) {
|
|
60192
60205
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
60193
|
-
|
|
60194
|
-
|
|
60206
|
+
const abstractSelection = {
|
|
60207
|
+
fields: {},
|
|
60208
|
+
typeMap: {}
|
|
60209
|
+
};
|
|
60210
|
+
const possibleSelectionTypes = {};
|
|
60211
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
60212
|
+
const gqlType = config2.schema.getType(typeName);
|
|
60213
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
60214
|
+
filepath,
|
|
60215
|
+
typeSelection,
|
|
60216
|
+
abstractSelection.fields[typeName] ?? {}
|
|
60217
|
+
);
|
|
60218
|
+
if (graphql11.isAbstractType(gqlType)) {
|
|
60219
|
+
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
60220
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
60221
|
+
possibleSelectionTypes[typeName] = [];
|
|
60222
|
+
}
|
|
60223
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
60224
|
+
}
|
|
60225
|
+
}
|
|
60226
|
+
}
|
|
60227
|
+
const concreteSelectionImplements = {};
|
|
60228
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60229
|
+
for (const possible of possibles) {
|
|
60230
|
+
if (!concreteSelectionImplements[possible]) {
|
|
60231
|
+
concreteSelectionImplements[possible] = [];
|
|
60232
|
+
}
|
|
60233
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
60234
|
+
}
|
|
60235
|
+
}
|
|
60236
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
60237
|
+
if (implementations.length > 1) {
|
|
60238
|
+
abstractSelection.fields[concrete] = {};
|
|
60239
|
+
}
|
|
60240
|
+
}
|
|
60241
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60195
60242
|
for (const possible of possibles) {
|
|
60196
|
-
if (
|
|
60197
|
-
|
|
60243
|
+
if (abstractSelection.fields[possible]) {
|
|
60244
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
60198
60245
|
filepath,
|
|
60199
|
-
|
|
60200
|
-
|
|
60246
|
+
abstractSelection.fields[typeName] ?? {},
|
|
60247
|
+
abstractSelection.fields[possible] ?? {}
|
|
60201
60248
|
);
|
|
60202
|
-
overlap = true;
|
|
60203
60249
|
}
|
|
60204
60250
|
}
|
|
60205
|
-
if (overlap) {
|
|
60206
|
-
delete typeMap[typeName];
|
|
60207
|
-
}
|
|
60208
60251
|
}
|
|
60209
|
-
|
|
60210
|
-
|
|
60211
|
-
|
|
60212
|
-
|
|
60213
|
-
|
|
60214
|
-
);
|
|
60215
|
-
delete typeMap[type];
|
|
60252
|
+
const parentType = config2.schema.getType(rootType);
|
|
60253
|
+
const possibleParents = graphql11.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t) => t.name) : [parentType.name];
|
|
60254
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
60255
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
60256
|
+
delete abstractSelection.typeMap[key];
|
|
60216
60257
|
}
|
|
60217
60258
|
}
|
|
60218
|
-
for (const [type, sel] of Object.entries(
|
|
60219
|
-
|
|
60259
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
60260
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
60220
60261
|
}
|
|
60221
|
-
for (const [
|
|
60222
|
-
|
|
60262
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60263
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
60264
|
+
delete abstractSelection.fields[typename];
|
|
60265
|
+
}
|
|
60223
60266
|
}
|
|
60224
|
-
const
|
|
60225
|
-
|
|
60226
|
-
|
|
60227
|
-
|
|
60267
|
+
for (const possible of possibleParents) {
|
|
60268
|
+
if (abstractSelection.fields[possible]) {
|
|
60269
|
+
continue;
|
|
60270
|
+
}
|
|
60271
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
60272
|
+
possibleSelectionTypes
|
|
60273
|
+
)) {
|
|
60274
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
60275
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
60276
|
+
break;
|
|
60277
|
+
}
|
|
60228
60278
|
}
|
|
60229
60279
|
}
|
|
60280
|
+
object.abstractFields = abstractSelection;
|
|
60230
60281
|
}
|
|
60231
|
-
for (const
|
|
60282
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
60232
60283
|
const selection = value.selection;
|
|
60233
60284
|
if (selection) {
|
|
60234
60285
|
mergeSelection({
|
|
60286
|
+
config: config2,
|
|
60287
|
+
rootType: value.type,
|
|
60235
60288
|
filepath,
|
|
60236
|
-
typeMap,
|
|
60237
|
-
abstractTypes,
|
|
60238
60289
|
object: selection
|
|
60239
60290
|
});
|
|
60240
60291
|
}
|
|
60241
60292
|
}
|
|
60242
60293
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
60243
|
-
for (const
|
|
60294
|
+
for (const value of Object.values(selection ?? {})) {
|
|
60244
60295
|
const selection2 = value.selection;
|
|
60245
60296
|
if (selection2) {
|
|
60246
60297
|
mergeSelection({
|
|
60298
|
+
config: config2,
|
|
60299
|
+
rootType: value.type,
|
|
60247
60300
|
filepath,
|
|
60248
|
-
typeMap,
|
|
60249
|
-
abstractTypes,
|
|
60250
60301
|
object: selection2
|
|
60251
60302
|
});
|
|
60252
60303
|
}
|
|
@@ -60256,7 +60307,7 @@ function mergeSelection({
|
|
|
60256
60307
|
}
|
|
60257
60308
|
|
|
60258
60309
|
// src/codegen/generators/artifacts/index.ts
|
|
60259
|
-
var
|
|
60310
|
+
var AST5 = recast5.types.builders;
|
|
60260
60311
|
function artifactGenerator(stats) {
|
|
60261
60312
|
return async function(config2, docs) {
|
|
60262
60313
|
const filterTypes = {};
|
|
@@ -60524,10 +60575,10 @@ function artifactGenerator(stats) {
|
|
|
60524
60575
|
}
|
|
60525
60576
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
60526
60577
|
}
|
|
60527
|
-
const file =
|
|
60578
|
+
const file = AST5.program([
|
|
60528
60579
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
60529
|
-
|
|
60530
|
-
|
|
60580
|
+
AST5.expressionStatement(
|
|
60581
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
60531
60582
|
)
|
|
60532
60583
|
]);
|
|
60533
60584
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -60607,8 +60658,8 @@ function applyMask(config2, target, mask) {
|
|
|
60607
60658
|
}
|
|
60608
60659
|
|
|
60609
60660
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
60610
|
-
var
|
|
60611
|
-
var
|
|
60661
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
60662
|
+
var AST6 = recast6.types.builders;
|
|
60612
60663
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
60613
60664
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
60614
60665
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -60643,18 +60694,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
60643
60694
|
continue;
|
|
60644
60695
|
}
|
|
60645
60696
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
60646
|
-
const input =
|
|
60647
|
-
input.typeAnnotation =
|
|
60648
|
-
|
|
60697
|
+
const input = AST6.identifier("str");
|
|
60698
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
60699
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
60649
60700
|
);
|
|
60650
60701
|
script.body.splice(
|
|
60651
60702
|
i,
|
|
60652
60703
|
0,
|
|
60653
|
-
|
|
60654
|
-
|
|
60655
|
-
|
|
60704
|
+
AST6.exportNamedDeclaration(
|
|
60705
|
+
AST6.tsDeclareFunction(
|
|
60706
|
+
AST6.identifier("graphql"),
|
|
60656
60707
|
[input],
|
|
60657
|
-
|
|
60708
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
60658
60709
|
)
|
|
60659
60710
|
)
|
|
60660
60711
|
);
|
|
@@ -60817,20 +60868,20 @@ async function generatePluginRuntime({
|
|
|
60817
60868
|
}
|
|
60818
60869
|
|
|
60819
60870
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60820
|
-
var
|
|
60871
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
60821
60872
|
|
|
60822
60873
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60823
60874
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
60824
|
-
var
|
|
60875
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
60825
60876
|
|
|
60826
60877
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60827
60878
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
60828
|
-
var
|
|
60879
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
60829
60880
|
|
|
60830
60881
|
// src/codegen/generators/typescript/types.ts
|
|
60831
60882
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
60832
|
-
var
|
|
60833
|
-
var
|
|
60883
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
60884
|
+
var AST7 = recast7.types.builders;
|
|
60834
60885
|
function readonlyProperty(prop, enable = true) {
|
|
60835
60886
|
if (enable) {
|
|
60836
60887
|
prop.readonly = true;
|
|
@@ -60838,28 +60889,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
60838
60889
|
return prop;
|
|
60839
60890
|
}
|
|
60840
60891
|
function nullableField(inner, input = false) {
|
|
60841
|
-
const members = [inner,
|
|
60892
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
60842
60893
|
if (input) {
|
|
60843
|
-
members.push(
|
|
60894
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
60844
60895
|
}
|
|
60845
|
-
return
|
|
60896
|
+
return AST7.tsUnionType(members);
|
|
60846
60897
|
}
|
|
60847
60898
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
60848
60899
|
switch (target.name) {
|
|
60849
60900
|
case "String": {
|
|
60850
|
-
return
|
|
60901
|
+
return AST7.tsStringKeyword();
|
|
60851
60902
|
}
|
|
60852
60903
|
case "Int": {
|
|
60853
|
-
return
|
|
60904
|
+
return AST7.tsNumberKeyword();
|
|
60854
60905
|
}
|
|
60855
60906
|
case "Float": {
|
|
60856
|
-
return
|
|
60907
|
+
return AST7.tsNumberKeyword();
|
|
60857
60908
|
}
|
|
60858
60909
|
case "Boolean": {
|
|
60859
|
-
return
|
|
60910
|
+
return AST7.tsBooleanKeyword();
|
|
60860
60911
|
}
|
|
60861
60912
|
case "ID": {
|
|
60862
|
-
return
|
|
60913
|
+
return AST7.tsStringKeyword();
|
|
60863
60914
|
}
|
|
60864
60915
|
default: {
|
|
60865
60916
|
if (graphql13.isNonNullType(target) && "ofType" in target) {
|
|
@@ -60870,16 +60921,16 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
60870
60921
|
);
|
|
60871
60922
|
}
|
|
60872
60923
|
if (config2.scalars?.[target.name]) {
|
|
60873
|
-
return
|
|
60924
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
60874
60925
|
}
|
|
60875
60926
|
missingScalars.add(target.name);
|
|
60876
|
-
return
|
|
60927
|
+
return AST7.tsAnyKeyword();
|
|
60877
60928
|
}
|
|
60878
60929
|
}
|
|
60879
60930
|
}
|
|
60880
60931
|
|
|
60881
60932
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60882
|
-
var
|
|
60933
|
+
var AST8 = recast8.types.builders;
|
|
60883
60934
|
function tsTypeReference(config2, missingScalars, definition, body) {
|
|
60884
60935
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
60885
60936
|
let result;
|
|
@@ -60888,7 +60939,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60888
60939
|
} else if (graphql14.isEnumType(type)) {
|
|
60889
60940
|
result = enumReference(config2, body, type.name);
|
|
60890
60941
|
} else {
|
|
60891
|
-
result =
|
|
60942
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
60892
60943
|
}
|
|
60893
60944
|
for (const toWrap of wrappers) {
|
|
60894
60945
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -60896,7 +60947,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60896
60947
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
60897
60948
|
result = nullableField(result, true);
|
|
60898
60949
|
} else if (toWrap === "List" /* List */) {
|
|
60899
|
-
result =
|
|
60950
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
60900
60951
|
}
|
|
60901
60952
|
}
|
|
60902
60953
|
return result;
|
|
@@ -60909,14 +60960,14 @@ function enumReference(config2, body, name) {
|
|
|
60909
60960
|
importKind: "type",
|
|
60910
60961
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60911
60962
|
});
|
|
60912
|
-
return
|
|
60913
|
-
|
|
60914
|
-
|
|
60963
|
+
return AST8.tsTypeReference(
|
|
60964
|
+
AST8.identifier("ValueOf"),
|
|
60965
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
60915
60966
|
);
|
|
60916
60967
|
}
|
|
60917
60968
|
|
|
60918
60969
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60919
|
-
var
|
|
60970
|
+
var AST9 = recast9.types.builders;
|
|
60920
60971
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
60921
60972
|
const { type } = unwrapType(config2, rootType);
|
|
60922
60973
|
if (graphql15.isScalarType(type)) {
|
|
@@ -60943,20 +60994,20 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
60943
60994
|
for (const field of Object.values(type.getFields())) {
|
|
60944
60995
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
60945
60996
|
members.push(
|
|
60946
|
-
|
|
60947
|
-
|
|
60948
|
-
|
|
60997
|
+
AST9.tsPropertySignature(
|
|
60998
|
+
AST9.identifier(field.name),
|
|
60999
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field, body)),
|
|
60949
61000
|
graphql15.isNullableType(field.type)
|
|
60950
61001
|
)
|
|
60951
61002
|
);
|
|
60952
61003
|
}
|
|
60953
|
-
body.push(
|
|
61004
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
60954
61005
|
}
|
|
60955
61006
|
|
|
60956
61007
|
// src/codegen/generators/typescript/inlineType.ts
|
|
60957
61008
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
60958
|
-
var
|
|
60959
|
-
var
|
|
61009
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
61010
|
+
var AST10 = recast10.types.builders;
|
|
60960
61011
|
var fragmentKey2 = " $fragments";
|
|
60961
61012
|
function inlineType({
|
|
60962
61013
|
config: config2,
|
|
@@ -61054,7 +61105,7 @@ function inlineType({
|
|
|
61054
61105
|
{}
|
|
61055
61106
|
)
|
|
61056
61107
|
);
|
|
61057
|
-
result =
|
|
61108
|
+
result = AST10.tsTypeLiteral([
|
|
61058
61109
|
...fields.map((selection) => {
|
|
61059
61110
|
const { field } = selectionTypeInfo(config2.schema, filepath, rootObj, selection);
|
|
61060
61111
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -61082,12 +61133,12 @@ function inlineType({
|
|
|
61082
61133
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
61083
61134
|
).length > 0;
|
|
61084
61135
|
if (hasIncludeOrSkipDirective) {
|
|
61085
|
-
attributeType =
|
|
61136
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
61086
61137
|
}
|
|
61087
61138
|
const prop = readonlyProperty(
|
|
61088
|
-
|
|
61089
|
-
|
|
61090
|
-
|
|
61139
|
+
AST10.tsPropertySignature(
|
|
61140
|
+
AST10.identifier(attributeName),
|
|
61141
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
61091
61142
|
),
|
|
61092
61143
|
allowReadonly
|
|
61093
61144
|
);
|
|
@@ -61101,14 +61152,14 @@ function inlineType({
|
|
|
61101
61152
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
61102
61153
|
result.members.push(
|
|
61103
61154
|
readonlyProperty(
|
|
61104
|
-
|
|
61105
|
-
|
|
61106
|
-
|
|
61107
|
-
|
|
61155
|
+
AST10.tsPropertySignature(
|
|
61156
|
+
AST10.stringLiteral(fragmentKey2),
|
|
61157
|
+
AST10.tsTypeAnnotation(
|
|
61158
|
+
AST10.tsTypeLiteral(
|
|
61108
61159
|
(fragmentSpreads || []).map(
|
|
61109
|
-
(fragmentSpread) =>
|
|
61110
|
-
|
|
61111
|
-
|
|
61160
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
61161
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
61162
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
61112
61163
|
)
|
|
61113
61164
|
)
|
|
61114
61165
|
)
|
|
@@ -61153,9 +61204,9 @@ function inlineType({
|
|
|
61153
61204
|
}
|
|
61154
61205
|
objectType.members.push(
|
|
61155
61206
|
readonlyProperty(
|
|
61156
|
-
|
|
61157
|
-
|
|
61158
|
-
|
|
61207
|
+
AST10.tsPropertySignature(
|
|
61208
|
+
AST10.identifier("__typename"),
|
|
61209
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
61159
61210
|
),
|
|
61160
61211
|
allowReadonly
|
|
61161
61212
|
)
|
|
@@ -61195,8 +61246,8 @@ function inlineType({
|
|
|
61195
61246
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
61196
61247
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
61197
61248
|
([typeName, { type: type2, tsType }]) => {
|
|
61198
|
-
return
|
|
61199
|
-
|
|
61249
|
+
return AST10.tsParenthesizedType(
|
|
61250
|
+
AST10.tsIntersectionType(
|
|
61200
61251
|
[tsType].flatMap((type3) => {
|
|
61201
61252
|
if (type3.type === "TSUnionType") {
|
|
61202
61253
|
return type3.types.filter(
|
|
@@ -61222,14 +61273,14 @@ function inlineType({
|
|
|
61222
61273
|
);
|
|
61223
61274
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
61224
61275
|
selectionTypes.push(
|
|
61225
|
-
|
|
61226
|
-
|
|
61276
|
+
AST10.tsParenthesizedType(
|
|
61277
|
+
AST10.tsTypeLiteral([
|
|
61227
61278
|
readonlyProperty(
|
|
61228
|
-
|
|
61229
|
-
|
|
61230
|
-
|
|
61231
|
-
|
|
61232
|
-
|
|
61279
|
+
AST10.tsPropertySignature(
|
|
61280
|
+
AST10.identifier("__typename"),
|
|
61281
|
+
AST10.tsTypeAnnotation(
|
|
61282
|
+
AST10.tsLiteralType(
|
|
61283
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
61233
61284
|
)
|
|
61234
61285
|
)
|
|
61235
61286
|
),
|
|
@@ -61239,9 +61290,9 @@ function inlineType({
|
|
|
61239
61290
|
)
|
|
61240
61291
|
);
|
|
61241
61292
|
}
|
|
61242
|
-
result =
|
|
61293
|
+
result = AST10.tsIntersectionType([
|
|
61243
61294
|
result,
|
|
61244
|
-
|
|
61295
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
61245
61296
|
]);
|
|
61246
61297
|
}
|
|
61247
61298
|
} else {
|
|
@@ -61259,7 +61310,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
61259
61310
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
61260
61311
|
continue;
|
|
61261
61312
|
} else if (toWrap === "List" /* List */) {
|
|
61262
|
-
result =
|
|
61313
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
61263
61314
|
}
|
|
61264
61315
|
}
|
|
61265
61316
|
return result;
|
|
@@ -61304,13 +61355,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
61304
61355
|
}
|
|
61305
61356
|
|
|
61306
61357
|
// src/codegen/generators/typescript/loadingState.ts
|
|
61307
|
-
var
|
|
61308
|
-
var
|
|
61358
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
61359
|
+
var AST11 = recast11.types.builders;
|
|
61309
61360
|
function withLoadingState(args) {
|
|
61310
61361
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
61311
61362
|
return args.base;
|
|
61312
61363
|
}
|
|
61313
|
-
return
|
|
61364
|
+
return AST11.tsUnionType([
|
|
61314
61365
|
args.base,
|
|
61315
61366
|
loadingState({
|
|
61316
61367
|
parentType: args.document.artifact.rootType,
|
|
@@ -61329,7 +61380,7 @@ function loadingState(args) {
|
|
|
61329
61380
|
import: ["LoadingType"],
|
|
61330
61381
|
sourceModule: "$houdini/runtime/lib/types"
|
|
61331
61382
|
});
|
|
61332
|
-
const result =
|
|
61383
|
+
const result = AST11.tsTypeLiteral(
|
|
61333
61384
|
Object.entries(selection).reduce(
|
|
61334
61385
|
(rest, [attributeName, value]) => {
|
|
61335
61386
|
if (!value.loading) {
|
|
@@ -61337,7 +61388,7 @@ function loadingState(args) {
|
|
|
61337
61388
|
}
|
|
61338
61389
|
let keyType = null;
|
|
61339
61390
|
if (value.loading.kind === "value") {
|
|
61340
|
-
keyType =
|
|
61391
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
61341
61392
|
}
|
|
61342
61393
|
if (value.loading.kind === "continue" && value.selection) {
|
|
61343
61394
|
keyType = loadingState({
|
|
@@ -61353,15 +61404,15 @@ function loadingState(args) {
|
|
|
61353
61404
|
}
|
|
61354
61405
|
if (value.loading.list) {
|
|
61355
61406
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
61356
|
-
keyType =
|
|
61407
|
+
keyType = AST11.tsArrayType(keyType);
|
|
61357
61408
|
}
|
|
61358
61409
|
}
|
|
61359
61410
|
return [
|
|
61360
61411
|
...rest,
|
|
61361
61412
|
readonlyProperty(
|
|
61362
|
-
|
|
61363
|
-
|
|
61364
|
-
|
|
61413
|
+
AST11.tsPropertySignature(
|
|
61414
|
+
AST11.identifier(attributeName),
|
|
61415
|
+
AST11.tsTypeAnnotation(keyType)
|
|
61365
61416
|
)
|
|
61366
61417
|
)
|
|
61367
61418
|
];
|
|
@@ -61372,14 +61423,14 @@ function loadingState(args) {
|
|
|
61372
61423
|
if (args.selection.fragments) {
|
|
61373
61424
|
result.members.push(
|
|
61374
61425
|
readonlyProperty(
|
|
61375
|
-
|
|
61376
|
-
|
|
61377
|
-
|
|
61378
|
-
|
|
61426
|
+
AST11.tsPropertySignature(
|
|
61427
|
+
AST11.stringLiteral(fragmentKey),
|
|
61428
|
+
AST11.tsTypeAnnotation(
|
|
61429
|
+
AST11.tsTypeLiteral(
|
|
61379
61430
|
Object.keys(args.selection.fragments).map((name) => {
|
|
61380
|
-
return
|
|
61381
|
-
|
|
61382
|
-
|
|
61431
|
+
return AST11.tsPropertySignature(
|
|
61432
|
+
AST11.identifier(name),
|
|
61433
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
61383
61434
|
);
|
|
61384
61435
|
})
|
|
61385
61436
|
)
|
|
@@ -61392,7 +61443,7 @@ function loadingState(args) {
|
|
|
61392
61443
|
}
|
|
61393
61444
|
|
|
61394
61445
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
61395
|
-
var
|
|
61446
|
+
var AST12 = recast12.types.builders;
|
|
61396
61447
|
async function generateDocumentTypes(config2, docs) {
|
|
61397
61448
|
const typePaths = [];
|
|
61398
61449
|
const fragmentDefinitions = {};
|
|
@@ -61417,7 +61468,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61417
61468
|
return;
|
|
61418
61469
|
}
|
|
61419
61470
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
61420
|
-
const program =
|
|
61471
|
+
const program = AST12.program([]);
|
|
61421
61472
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61422
61473
|
let definition = originalDocument.definitions.find(
|
|
61423
61474
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -61453,9 +61504,9 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61453
61504
|
);
|
|
61454
61505
|
}
|
|
61455
61506
|
program.body.push(
|
|
61456
|
-
|
|
61457
|
-
|
|
61458
|
-
|
|
61507
|
+
AST12.exportNamedDeclaration(
|
|
61508
|
+
AST12.tsTypeAliasDeclaration(
|
|
61509
|
+
AST12.identifier(`${name}$artifact`),
|
|
61459
61510
|
convertToTs(serializeValue(artifact))
|
|
61460
61511
|
)
|
|
61461
61512
|
)
|
|
@@ -61465,17 +61516,17 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61465
61516
|
typePaths.push(typeDefPath);
|
|
61466
61517
|
})
|
|
61467
61518
|
);
|
|
61468
|
-
const typeIndex =
|
|
61519
|
+
const typeIndex = AST12.program(
|
|
61469
61520
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
61470
|
-
return
|
|
61471
|
-
|
|
61521
|
+
return AST12.exportAllDeclaration(
|
|
61522
|
+
AST12.literal(
|
|
61472
61523
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
61473
61524
|
),
|
|
61474
61525
|
null
|
|
61475
61526
|
);
|
|
61476
61527
|
}).concat([
|
|
61477
|
-
|
|
61478
|
-
|
|
61528
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
61529
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
61479
61530
|
])
|
|
61480
61531
|
);
|
|
61481
61532
|
const exportDefaultAs = ({ module: module2, as }) => `
|
|
@@ -61530,7 +61581,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
61530
61581
|
}
|
|
61531
61582
|
function convertToTs(source) {
|
|
61532
61583
|
if (source.type === "ObjectExpression") {
|
|
61533
|
-
return
|
|
61584
|
+
return AST12.tsTypeLiteral(
|
|
61534
61585
|
source.properties.reduce(
|
|
61535
61586
|
(props, prop) => {
|
|
61536
61587
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -61538,9 +61589,9 @@ function convertToTs(source) {
|
|
|
61538
61589
|
}
|
|
61539
61590
|
return [
|
|
61540
61591
|
...props,
|
|
61541
|
-
|
|
61592
|
+
AST12.tsPropertySignature(
|
|
61542
61593
|
prop.key,
|
|
61543
|
-
|
|
61594
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
61544
61595
|
)
|
|
61545
61596
|
];
|
|
61546
61597
|
},
|
|
@@ -61549,20 +61600,20 @@ function convertToTs(source) {
|
|
|
61549
61600
|
);
|
|
61550
61601
|
}
|
|
61551
61602
|
if (source.type === "ArrayExpression") {
|
|
61552
|
-
return
|
|
61603
|
+
return AST12.tsTupleType(
|
|
61553
61604
|
source.elements.map((element) => convertToTs(element))
|
|
61554
61605
|
);
|
|
61555
61606
|
}
|
|
61556
61607
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
61557
|
-
return
|
|
61608
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
61558
61609
|
}
|
|
61559
61610
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
61560
|
-
return
|
|
61611
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
61561
61612
|
}
|
|
61562
61613
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
61563
|
-
return
|
|
61614
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
61564
61615
|
}
|
|
61565
|
-
return
|
|
61616
|
+
return AST12.tsLiteralType(source);
|
|
61566
61617
|
}
|
|
61567
61618
|
async function generateOperationTypeDefs(config2, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
61568
61619
|
let parentType = null;
|
|
@@ -61601,23 +61652,23 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61601
61652
|
});
|
|
61602
61653
|
}
|
|
61603
61654
|
body.push(
|
|
61604
|
-
|
|
61605
|
-
|
|
61606
|
-
|
|
61607
|
-
|
|
61655
|
+
AST12.exportNamedDeclaration(
|
|
61656
|
+
AST12.tsTypeAliasDeclaration(
|
|
61657
|
+
AST12.identifier(definition.name.value),
|
|
61658
|
+
AST12.tsTypeLiteral([
|
|
61608
61659
|
readonlyProperty(
|
|
61609
|
-
|
|
61610
|
-
|
|
61611
|
-
|
|
61660
|
+
AST12.tsPropertySignature(
|
|
61661
|
+
AST12.stringLiteral("input"),
|
|
61662
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
61612
61663
|
)
|
|
61613
61664
|
),
|
|
61614
61665
|
readonlyProperty(
|
|
61615
|
-
|
|
61616
|
-
|
|
61617
|
-
|
|
61618
|
-
definition.operation === "mutation" ?
|
|
61619
|
-
|
|
61620
|
-
|
|
61666
|
+
AST12.tsPropertySignature(
|
|
61667
|
+
AST12.stringLiteral("result"),
|
|
61668
|
+
AST12.tsTypeAnnotation(
|
|
61669
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
61670
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
61671
|
+
AST12.tsUndefinedKeyword()
|
|
61621
61672
|
])
|
|
61622
61673
|
)
|
|
61623
61674
|
)
|
|
@@ -61625,8 +61676,8 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61625
61676
|
])
|
|
61626
61677
|
)
|
|
61627
61678
|
),
|
|
61628
|
-
|
|
61629
|
-
|
|
61679
|
+
AST12.exportNamedDeclaration(
|
|
61680
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
61630
61681
|
)
|
|
61631
61682
|
);
|
|
61632
61683
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -61641,15 +61692,15 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61641
61692
|
);
|
|
61642
61693
|
}
|
|
61643
61694
|
body.push(
|
|
61644
|
-
|
|
61645
|
-
|
|
61646
|
-
|
|
61647
|
-
|
|
61695
|
+
AST12.exportNamedDeclaration(
|
|
61696
|
+
AST12.tsTypeAliasDeclaration(
|
|
61697
|
+
AST12.identifier(inputTypeName),
|
|
61698
|
+
AST12.tsTypeLiteral(
|
|
61648
61699
|
(definition.variableDefinitions || []).map(
|
|
61649
61700
|
(definition2) => {
|
|
61650
|
-
return
|
|
61651
|
-
|
|
61652
|
-
|
|
61701
|
+
return AST12.tsPropertySignature(
|
|
61702
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61703
|
+
AST12.tsTypeAnnotation(
|
|
61653
61704
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61654
61705
|
),
|
|
61655
61706
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61662,16 +61713,16 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61662
61713
|
);
|
|
61663
61714
|
} else {
|
|
61664
61715
|
body.push(
|
|
61665
|
-
|
|
61666
|
-
|
|
61716
|
+
AST12.exportNamedDeclaration(
|
|
61717
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
61667
61718
|
)
|
|
61668
61719
|
);
|
|
61669
61720
|
}
|
|
61670
61721
|
if (definition.operation === "mutation") {
|
|
61671
61722
|
body.push(
|
|
61672
|
-
|
|
61673
|
-
|
|
61674
|
-
|
|
61723
|
+
AST12.exportNamedDeclaration(
|
|
61724
|
+
AST12.tsTypeAliasDeclaration(
|
|
61725
|
+
AST12.identifier(optimisticTypeName),
|
|
61675
61726
|
inlineType({
|
|
61676
61727
|
config: config2,
|
|
61677
61728
|
filepath,
|
|
@@ -61705,12 +61756,12 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61705
61756
|
let directive = definition.directives?.find(
|
|
61706
61757
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61707
61758
|
);
|
|
61708
|
-
let inputValue = !directive ?
|
|
61759
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
61709
61760
|
(fragmentArgumentsDefinitions(config2, filepath, definition) || []).map(
|
|
61710
61761
|
(definition2) => {
|
|
61711
|
-
return
|
|
61712
|
-
|
|
61713
|
-
|
|
61762
|
+
return AST12.tsPropertySignature(
|
|
61763
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61764
|
+
AST12.tsTypeAnnotation(
|
|
61714
61765
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61715
61766
|
),
|
|
61716
61767
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61719,30 +61770,30 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61719
61770
|
)
|
|
61720
61771
|
);
|
|
61721
61772
|
body.push(
|
|
61722
|
-
|
|
61723
|
-
|
|
61773
|
+
AST12.exportNamedDeclaration(
|
|
61774
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
61724
61775
|
),
|
|
61725
|
-
|
|
61726
|
-
|
|
61727
|
-
|
|
61728
|
-
|
|
61776
|
+
AST12.exportNamedDeclaration(
|
|
61777
|
+
AST12.tsTypeAliasDeclaration(
|
|
61778
|
+
AST12.identifier(propTypeName),
|
|
61779
|
+
AST12.tsTypeLiteral([
|
|
61729
61780
|
readonlyProperty(
|
|
61730
|
-
|
|
61731
|
-
|
|
61732
|
-
|
|
61733
|
-
|
|
61781
|
+
AST12.tsPropertySignature(
|
|
61782
|
+
AST12.stringLiteral("shape"),
|
|
61783
|
+
AST12.tsTypeAnnotation(
|
|
61784
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
61734
61785
|
),
|
|
61735
61786
|
true
|
|
61736
61787
|
)
|
|
61737
61788
|
),
|
|
61738
61789
|
readonlyProperty(
|
|
61739
|
-
|
|
61740
|
-
|
|
61741
|
-
|
|
61742
|
-
|
|
61743
|
-
|
|
61744
|
-
|
|
61745
|
-
|
|
61790
|
+
AST12.tsPropertySignature(
|
|
61791
|
+
AST12.stringLiteral(fragmentKey2),
|
|
61792
|
+
AST12.tsTypeAnnotation(
|
|
61793
|
+
AST12.tsTypeLiteral([
|
|
61794
|
+
AST12.tsPropertySignature(
|
|
61795
|
+
AST12.stringLiteral(propTypeName),
|
|
61796
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
61746
61797
|
)
|
|
61747
61798
|
])
|
|
61748
61799
|
)
|
|
@@ -61751,9 +61802,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61751
61802
|
])
|
|
61752
61803
|
)
|
|
61753
61804
|
),
|
|
61754
|
-
|
|
61755
|
-
|
|
61756
|
-
|
|
61805
|
+
AST12.exportNamedDeclaration(
|
|
61806
|
+
AST12.tsTypeAliasDeclaration(
|
|
61807
|
+
AST12.identifier(shapeTypeName),
|
|
61757
61808
|
withLoadingState({
|
|
61758
61809
|
config: config2,
|
|
61759
61810
|
document,
|
|
@@ -61779,8 +61830,8 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61779
61830
|
|
|
61780
61831
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
61781
61832
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
61782
|
-
var
|
|
61783
|
-
var
|
|
61833
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
61834
|
+
var AST13 = recast13.types.builders;
|
|
61784
61835
|
async function imperativeCacheTypef(config2, docs) {
|
|
61785
61836
|
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
61786
61837
|
config: config2,
|
|
@@ -61796,87 +61847,87 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
61796
61847
|
}) ?? "any";
|
|
61797
61848
|
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
61798
61849
|
const body = [];
|
|
61799
|
-
const declaration =
|
|
61800
|
-
|
|
61801
|
-
|
|
61802
|
-
|
|
61803
|
-
|
|
61804
|
-
|
|
61850
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
61851
|
+
AST13.identifier(CacheTypeDefName),
|
|
61852
|
+
AST13.tsTypeLiteral([
|
|
61853
|
+
AST13.tsPropertySignature(
|
|
61854
|
+
AST13.identifier("types"),
|
|
61855
|
+
AST13.tsTypeAnnotation(typeDefinitions(config2, body, docs, returnType))
|
|
61805
61856
|
),
|
|
61806
|
-
|
|
61807
|
-
|
|
61808
|
-
|
|
61857
|
+
AST13.tsPropertySignature(
|
|
61858
|
+
AST13.identifier("lists"),
|
|
61859
|
+
AST13.tsTypeAnnotation(listDefinitions(config2, body, docs))
|
|
61809
61860
|
),
|
|
61810
|
-
|
|
61811
|
-
|
|
61812
|
-
|
|
61861
|
+
AST13.tsPropertySignature(
|
|
61862
|
+
AST13.identifier("queries"),
|
|
61863
|
+
AST13.tsTypeAnnotation(queryDefinitions(config2, body, docs, returnType))
|
|
61813
61864
|
)
|
|
61814
61865
|
])
|
|
61815
61866
|
);
|
|
61816
61867
|
declaration.declare = true;
|
|
61817
|
-
const importRecord =
|
|
61818
|
-
[
|
|
61819
|
-
|
|
61868
|
+
const importRecord = AST13.importDeclaration(
|
|
61869
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
61870
|
+
AST13.stringLiteral("./public/record")
|
|
61820
61871
|
);
|
|
61821
61872
|
importRecord.importKind = "type";
|
|
61822
61873
|
await fs_exports.writeFile(
|
|
61823
61874
|
target,
|
|
61824
|
-
|
|
61825
|
-
|
|
61875
|
+
recast13.prettyPrint(
|
|
61876
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
61826
61877
|
).code
|
|
61827
61878
|
);
|
|
61828
61879
|
}
|
|
61829
61880
|
function typeDefinitions(config2, body, docs, returnType) {
|
|
61830
61881
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
61831
61882
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61832
|
-
const
|
|
61883
|
+
const types15 = Object.values(config2.schema.getTypeMap()).filter(
|
|
61833
61884
|
(type) => !graphql17.isAbstractType(type) && !graphql17.isScalarType(type) && !graphql17.isEnumType(type) && !graphql17.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
61834
61885
|
);
|
|
61835
61886
|
const fragmentMap = fragmentListMap(
|
|
61836
61887
|
config2,
|
|
61837
|
-
|
|
61888
|
+
types15.map((type) => type.name),
|
|
61838
61889
|
body,
|
|
61839
61890
|
docs,
|
|
61840
61891
|
returnType
|
|
61841
61892
|
);
|
|
61842
|
-
return
|
|
61843
|
-
|
|
61893
|
+
return AST13.tsTypeLiteral(
|
|
61894
|
+
types15.map((type) => {
|
|
61844
61895
|
let typeName = type.name;
|
|
61845
61896
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
61846
61897
|
typeName = "__ROOT__";
|
|
61847
61898
|
}
|
|
61848
|
-
let idFields =
|
|
61899
|
+
let idFields = AST13.tsNeverKeyword();
|
|
61849
61900
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
61850
61901
|
if (graphql17.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
61851
|
-
idFields =
|
|
61902
|
+
idFields = AST13.tsTypeLiteral(
|
|
61852
61903
|
keys2.map((key) => {
|
|
61853
61904
|
const fieldType = type.getFields()[key];
|
|
61854
61905
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61855
|
-
return
|
|
61856
|
-
|
|
61857
|
-
|
|
61906
|
+
return AST13.tsPropertySignature(
|
|
61907
|
+
AST13.identifier(key),
|
|
61908
|
+
AST13.tsTypeAnnotation(
|
|
61858
61909
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61859
61910
|
)
|
|
61860
61911
|
);
|
|
61861
61912
|
})
|
|
61862
61913
|
);
|
|
61863
61914
|
} else if (typeName === "__ROOT__") {
|
|
61864
|
-
idFields =
|
|
61915
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
61865
61916
|
}
|
|
61866
|
-
let fields =
|
|
61917
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
61867
61918
|
if (graphql17.isObjectType(type)) {
|
|
61868
|
-
fields =
|
|
61919
|
+
fields = AST13.tsTypeLiteral(
|
|
61869
61920
|
Object.entries(type.getFields()).map(
|
|
61870
61921
|
([key, fieldType]) => {
|
|
61871
61922
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61872
|
-
let typeOptions =
|
|
61923
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
61873
61924
|
if (graphql17.isScalarType(unwrapped.type)) {
|
|
61874
61925
|
typeOptions.types.push(
|
|
61875
61926
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61876
61927
|
);
|
|
61877
61928
|
} else if (graphql17.isEnumType(unwrapped.type)) {
|
|
61878
61929
|
typeOptions.types.push(
|
|
61879
|
-
|
|
61930
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
61880
61931
|
);
|
|
61881
61932
|
} else if (!graphql17.isAbstractType(unwrapped.type)) {
|
|
61882
61933
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -61887,21 +61938,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61887
61938
|
}
|
|
61888
61939
|
for (const wrapper of unwrapped.wrappers) {
|
|
61889
61940
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
61890
|
-
typeOptions =
|
|
61891
|
-
|
|
61941
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
61942
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
61892
61943
|
);
|
|
61893
61944
|
} else if (wrapper === "List" /* List */) {
|
|
61894
|
-
typeOptions =
|
|
61895
|
-
|
|
61945
|
+
typeOptions = AST13.tsArrayType(
|
|
61946
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
61896
61947
|
);
|
|
61897
61948
|
}
|
|
61898
61949
|
}
|
|
61899
61950
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
61900
61951
|
typeOptions = typeOptions.typeAnnotation;
|
|
61901
61952
|
}
|
|
61902
|
-
let args =
|
|
61953
|
+
let args = AST13.tsNeverKeyword();
|
|
61903
61954
|
if (fieldType.args?.length > 0) {
|
|
61904
|
-
args =
|
|
61955
|
+
args = AST13.tsTypeLiteral(
|
|
61905
61956
|
fieldType.args.map((arg) => {
|
|
61906
61957
|
addReferencedInputTypes(
|
|
61907
61958
|
config2,
|
|
@@ -61911,9 +61962,9 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61911
61962
|
/* @__PURE__ */ new Set(),
|
|
61912
61963
|
arg.type
|
|
61913
61964
|
);
|
|
61914
|
-
const prop =
|
|
61915
|
-
|
|
61916
|
-
|
|
61965
|
+
const prop = AST13.tsPropertySignature(
|
|
61966
|
+
AST13.identifier(arg.name),
|
|
61967
|
+
AST13.tsTypeAnnotation(
|
|
61917
61968
|
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg, body)
|
|
61918
61969
|
)
|
|
61919
61970
|
);
|
|
@@ -61923,17 +61974,17 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61923
61974
|
})
|
|
61924
61975
|
);
|
|
61925
61976
|
}
|
|
61926
|
-
return
|
|
61927
|
-
|
|
61928
|
-
|
|
61929
|
-
|
|
61930
|
-
|
|
61931
|
-
|
|
61932
|
-
|
|
61977
|
+
return AST13.tsPropertySignature(
|
|
61978
|
+
AST13.identifier(key),
|
|
61979
|
+
AST13.tsTypeAnnotation(
|
|
61980
|
+
AST13.tsTypeLiteral([
|
|
61981
|
+
AST13.tsPropertySignature(
|
|
61982
|
+
AST13.identifier("type"),
|
|
61983
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
61933
61984
|
),
|
|
61934
|
-
|
|
61935
|
-
|
|
61936
|
-
|
|
61985
|
+
AST13.tsPropertySignature(
|
|
61986
|
+
AST13.identifier("args"),
|
|
61987
|
+
AST13.tsTypeAnnotation(args)
|
|
61937
61988
|
)
|
|
61938
61989
|
])
|
|
61939
61990
|
)
|
|
@@ -61942,21 +61993,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61942
61993
|
)
|
|
61943
61994
|
);
|
|
61944
61995
|
}
|
|
61945
|
-
return
|
|
61946
|
-
|
|
61947
|
-
|
|
61948
|
-
|
|
61949
|
-
|
|
61950
|
-
|
|
61951
|
-
|
|
61996
|
+
return AST13.tsPropertySignature(
|
|
61997
|
+
AST13.identifier(typeName),
|
|
61998
|
+
AST13.tsTypeAnnotation(
|
|
61999
|
+
AST13.tsTypeLiteral([
|
|
62000
|
+
AST13.tsPropertySignature(
|
|
62001
|
+
AST13.identifier("idFields"),
|
|
62002
|
+
AST13.tsTypeAnnotation(idFields)
|
|
61952
62003
|
),
|
|
61953
|
-
|
|
61954
|
-
|
|
61955
|
-
|
|
62004
|
+
AST13.tsPropertySignature(
|
|
62005
|
+
AST13.identifier("fields"),
|
|
62006
|
+
AST13.tsTypeAnnotation(fields)
|
|
61956
62007
|
),
|
|
61957
|
-
|
|
61958
|
-
|
|
61959
|
-
|
|
62008
|
+
AST13.tsPropertySignature(
|
|
62009
|
+
AST13.identifier("fragments"),
|
|
62010
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
61960
62011
|
)
|
|
61961
62012
|
])
|
|
61962
62013
|
)
|
|
@@ -61998,28 +62049,28 @@ function listDefinitions(config2, body, docs) {
|
|
|
61998
62049
|
possibleTypes.push(listType.name);
|
|
61999
62050
|
}
|
|
62000
62051
|
lists.push(
|
|
62001
|
-
|
|
62002
|
-
|
|
62003
|
-
|
|
62004
|
-
|
|
62005
|
-
|
|
62006
|
-
|
|
62007
|
-
|
|
62008
|
-
|
|
62052
|
+
AST13.tsPropertySignature(
|
|
62053
|
+
AST13.identifier(nameValue),
|
|
62054
|
+
AST13.tsTypeAnnotation(
|
|
62055
|
+
AST13.tsTypeLiteral([
|
|
62056
|
+
AST13.tsPropertySignature(
|
|
62057
|
+
AST13.identifier("types"),
|
|
62058
|
+
AST13.tsTypeAnnotation(
|
|
62059
|
+
AST13.tsUnionType(
|
|
62009
62060
|
possibleTypes.map(
|
|
62010
|
-
(possible) =>
|
|
62061
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
62011
62062
|
)
|
|
62012
62063
|
)
|
|
62013
62064
|
)
|
|
62014
62065
|
),
|
|
62015
|
-
|
|
62016
|
-
|
|
62017
|
-
|
|
62018
|
-
targetFieldDefinition.args.length === 0 ?
|
|
62066
|
+
AST13.tsPropertySignature(
|
|
62067
|
+
AST13.identifier("filters"),
|
|
62068
|
+
AST13.tsTypeAnnotation(
|
|
62069
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
62019
62070
|
targetFieldDefinition.args.map((arg) => {
|
|
62020
|
-
const argDef =
|
|
62021
|
-
|
|
62022
|
-
|
|
62071
|
+
const argDef = AST13.tsPropertySignature(
|
|
62072
|
+
AST13.identifier(arg.name),
|
|
62073
|
+
AST13.tsTypeAnnotation(
|
|
62023
62074
|
tsTypeReference(
|
|
62024
62075
|
config2,
|
|
62025
62076
|
/* @__PURE__ */ new Set(),
|
|
@@ -62041,10 +62092,10 @@ function listDefinitions(config2, body, docs) {
|
|
|
62041
62092
|
}
|
|
62042
62093
|
});
|
|
62043
62094
|
}
|
|
62044
|
-
return
|
|
62095
|
+
return AST13.tsTypeLiteral(lists);
|
|
62045
62096
|
}
|
|
62046
62097
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
62047
|
-
return
|
|
62098
|
+
return AST13.tsTupleType(
|
|
62048
62099
|
docs.reduce((prev, doc) => {
|
|
62049
62100
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
62050
62101
|
return prev;
|
|
@@ -62066,10 +62117,10 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
62066
62117
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
62067
62118
|
});
|
|
62068
62119
|
return prev.concat(
|
|
62069
|
-
|
|
62070
|
-
|
|
62071
|
-
|
|
62072
|
-
|
|
62120
|
+
AST13.tsTupleType([
|
|
62121
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
62122
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
62123
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
62073
62124
|
])
|
|
62074
62125
|
);
|
|
62075
62126
|
}, [])
|
|
@@ -62098,13 +62149,13 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62098
62149
|
),
|
|
62099
62150
|
import: [`${definition.name.value}$data`]
|
|
62100
62151
|
});
|
|
62101
|
-
let inputType =
|
|
62152
|
+
let inputType = AST13.tsNeverKeyword();
|
|
62102
62153
|
let directive = definition.directives?.find(
|
|
62103
62154
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
62104
62155
|
);
|
|
62105
62156
|
if (directive) {
|
|
62106
|
-
inputType =
|
|
62107
|
-
|
|
62157
|
+
inputType = AST13.tsTypeReference(
|
|
62158
|
+
AST13.identifier(
|
|
62108
62159
|
ensureImports({
|
|
62109
62160
|
config: config2,
|
|
62110
62161
|
body,
|
|
@@ -62119,11 +62170,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62119
62170
|
}
|
|
62120
62171
|
return {
|
|
62121
62172
|
...prev,
|
|
62122
|
-
[typeName]:
|
|
62173
|
+
[typeName]: AST13.tsTupleType(
|
|
62123
62174
|
previousValue.concat(
|
|
62124
|
-
|
|
62125
|
-
|
|
62126
|
-
|
|
62175
|
+
AST13.tsTupleType([
|
|
62176
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
62177
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
62127
62178
|
inputType
|
|
62128
62179
|
])
|
|
62129
62180
|
)
|
|
@@ -62133,11 +62184,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62133
62184
|
}
|
|
62134
62185
|
var CacheTypeDefName = "CacheTypeDef";
|
|
62135
62186
|
function record(name) {
|
|
62136
|
-
return
|
|
62137
|
-
|
|
62138
|
-
|
|
62139
|
-
|
|
62140
|
-
|
|
62187
|
+
return AST13.tsTypeReference(
|
|
62188
|
+
AST13.identifier("Record"),
|
|
62189
|
+
AST13.tsTypeParameterInstantiation([
|
|
62190
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
62191
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
62141
62192
|
])
|
|
62142
62193
|
);
|
|
62143
62194
|
}
|
|
@@ -62190,25 +62241,25 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
62190
62241
|
|
|
62191
62242
|
// src/codegen/generators/definitions/enums.ts
|
|
62192
62243
|
var graphql19 = __toESM(require_graphql2(), 1);
|
|
62193
|
-
var
|
|
62194
|
-
var
|
|
62244
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
62245
|
+
var AST14 = recast14.types.builders;
|
|
62195
62246
|
async function definitionsGenerator(config2) {
|
|
62196
62247
|
const enums = graphql19.parse(graphql19.printSchema(config2.schema)).definitions.filter(
|
|
62197
62248
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
62198
62249
|
).filter((def) => !config2.isInternalEnum(def));
|
|
62199
62250
|
const { code: runtimeDefinitions } = await printJS(
|
|
62200
|
-
|
|
62251
|
+
AST14.program(
|
|
62201
62252
|
enums.map((defn) => {
|
|
62202
62253
|
const name = defn.name.value;
|
|
62203
62254
|
return moduleExport(
|
|
62204
62255
|
config2,
|
|
62205
62256
|
name,
|
|
62206
|
-
|
|
62257
|
+
AST14.objectExpression(
|
|
62207
62258
|
defn.values?.map((value) => {
|
|
62208
62259
|
const str = value.name.value;
|
|
62209
|
-
return
|
|
62210
|
-
|
|
62211
|
-
|
|
62260
|
+
return AST14.objectProperty(
|
|
62261
|
+
AST14.stringLiteral(str),
|
|
62262
|
+
AST14.stringLiteral(str)
|
|
62212
62263
|
);
|
|
62213
62264
|
}) || []
|
|
62214
62265
|
)
|