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
|
@@ -1977,12 +1977,12 @@ var require_parser = __commonJS({
|
|
|
1977
1977
|
return [];
|
|
1978
1978
|
}
|
|
1979
1979
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
1980
|
-
var
|
|
1980
|
+
var types15 = [];
|
|
1981
1981
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
1982
1982
|
do {
|
|
1983
|
-
|
|
1983
|
+
types15.push(this.parseNamedType());
|
|
1984
1984
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
1985
|
-
return
|
|
1985
|
+
return types15;
|
|
1986
1986
|
}
|
|
1987
1987
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
1988
1988
|
};
|
|
@@ -2061,13 +2061,13 @@ var require_parser = __commonJS({
|
|
|
2061
2061
|
this.expectKeyword("union");
|
|
2062
2062
|
var name = this.parseName();
|
|
2063
2063
|
var directives = this.parseDirectives(true);
|
|
2064
|
-
var
|
|
2064
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2065
2065
|
return {
|
|
2066
2066
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2067
2067
|
description,
|
|
2068
2068
|
name,
|
|
2069
2069
|
directives,
|
|
2070
|
-
types:
|
|
2070
|
+
types: types15,
|
|
2071
2071
|
loc: this.loc(start)
|
|
2072
2072
|
};
|
|
2073
2073
|
};
|
|
@@ -2225,15 +2225,15 @@ var require_parser = __commonJS({
|
|
|
2225
2225
|
this.expectKeyword("union");
|
|
2226
2226
|
var name = this.parseName();
|
|
2227
2227
|
var directives = this.parseDirectives(true);
|
|
2228
|
-
var
|
|
2229
|
-
if (directives.length === 0 &&
|
|
2228
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2229
|
+
if (directives.length === 0 && types15.length === 0) {
|
|
2230
2230
|
throw this.unexpected();
|
|
2231
2231
|
}
|
|
2232
2232
|
return {
|
|
2233
2233
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2234
2234
|
name,
|
|
2235
2235
|
directives,
|
|
2236
|
-
types:
|
|
2236
|
+
types: types15,
|
|
2237
2237
|
loc: this.loc(start)
|
|
2238
2238
|
};
|
|
2239
2239
|
};
|
|
@@ -3211,8 +3211,8 @@ var require_printer = __commonJS({
|
|
|
3211
3211
|
return join2(["interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3212
3212
|
}),
|
|
3213
3213
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3214
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
3215
|
-
return join2(["union", name, join2(directives, " "),
|
|
3214
|
+
var name = _ref27.name, directives = _ref27.directives, types15 = _ref27.types;
|
|
3215
|
+
return join2(["union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3216
3216
|
}),
|
|
3217
3217
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3218
3218
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -3247,8 +3247,8 @@ var require_printer = __commonJS({
|
|
|
3247
3247
|
return join2(["extend interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3248
3248
|
},
|
|
3249
3249
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3250
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
3251
|
-
return join2(["extend union", name, join2(directives, " "),
|
|
3250
|
+
var name = _ref36.name, directives = _ref36.directives, types15 = _ref36.types;
|
|
3251
|
+
return join2(["extend union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3252
3252
|
},
|
|
3253
3253
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3254
3254
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -3919,9 +3919,9 @@ var require_definition = __commonJS({
|
|
|
3919
3919
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
3920
3920
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
3921
3921
|
function defineTypes(config2) {
|
|
3922
|
-
var
|
|
3923
|
-
Array.isArray(
|
|
3924
|
-
return
|
|
3922
|
+
var types15 = resolveThunk(config2.types);
|
|
3923
|
+
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, "."));
|
|
3924
|
+
return types15;
|
|
3925
3925
|
}
|
|
3926
3926
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
3927
3927
|
function GraphQLEnumType2(config2) {
|
|
@@ -11558,7 +11558,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
11558
11558
|
return new _definition.GraphQLUnionType({
|
|
11559
11559
|
name: unionIntrospection.name,
|
|
11560
11560
|
description: unionIntrospection.description,
|
|
11561
|
-
types: function
|
|
11561
|
+
types: function types15() {
|
|
11562
11562
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
11563
11563
|
}
|
|
11564
11564
|
});
|
|
@@ -11903,7 +11903,7 @@ var require_extendSchema = __commonJS({
|
|
|
11903
11903
|
var config2 = type.toConfig();
|
|
11904
11904
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
11905
11905
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
11906
|
-
types: function
|
|
11906
|
+
types: function types15() {
|
|
11907
11907
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
11908
11908
|
},
|
|
11909
11909
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -12051,17 +12051,17 @@ var require_extendSchema = __commonJS({
|
|
|
12051
12051
|
return interfaces;
|
|
12052
12052
|
}
|
|
12053
12053
|
function buildUnionTypes(nodes) {
|
|
12054
|
-
var
|
|
12054
|
+
var types15 = [];
|
|
12055
12055
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
12056
12056
|
var _node$types;
|
|
12057
12057
|
var node = nodes[_i32];
|
|
12058
12058
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
12059
12059
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
12060
12060
|
var type = typeNodes[_i34];
|
|
12061
|
-
|
|
12061
|
+
types15.push(getNamedType2(type));
|
|
12062
12062
|
}
|
|
12063
12063
|
}
|
|
12064
|
-
return
|
|
12064
|
+
return types15;
|
|
12065
12065
|
}
|
|
12066
12066
|
function buildType(astNode) {
|
|
12067
12067
|
var _typeExtensionsMap$na;
|
|
@@ -12118,7 +12118,7 @@ var require_extendSchema = __commonJS({
|
|
|
12118
12118
|
return new _definition.GraphQLUnionType({
|
|
12119
12119
|
name: name2,
|
|
12120
12120
|
description,
|
|
12121
|
-
types: function
|
|
12121
|
+
types: function types15() {
|
|
12122
12122
|
return buildUnionTypes(_allNodes3);
|
|
12123
12123
|
},
|
|
12124
12124
|
astNode,
|
|
@@ -12416,7 +12416,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
12416
12416
|
if ((0, _definition.isUnionType)(type)) {
|
|
12417
12417
|
var _config2 = type.toConfig();
|
|
12418
12418
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, {
|
|
12419
|
-
types: function
|
|
12419
|
+
types: function types15() {
|
|
12420
12420
|
return sortTypes(_config2.types);
|
|
12421
12421
|
}
|
|
12422
12422
|
}));
|
|
@@ -12501,10 +12501,10 @@ var require_printSchema = __commonJS({
|
|
|
12501
12501
|
}
|
|
12502
12502
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
12503
12503
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
12504
|
-
var
|
|
12504
|
+
var types15 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
12505
12505
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
12506
12506
|
return printDirective(directive, options);
|
|
12507
|
-
}),
|
|
12507
|
+
}), types15.map(function(type) {
|
|
12508
12508
|
return printType(type, options);
|
|
12509
12509
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
12510
12510
|
}
|
|
@@ -12579,8 +12579,8 @@ var require_printSchema = __commonJS({
|
|
|
12579
12579
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
12580
12580
|
}
|
|
12581
12581
|
function printUnion(type, options) {
|
|
12582
|
-
var
|
|
12583
|
-
var possibleTypes =
|
|
12582
|
+
var types15 = type.getTypes();
|
|
12583
|
+
var possibleTypes = types15.length ? " = " + types15.join(" | ") : "";
|
|
12584
12584
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
12585
12585
|
}
|
|
12586
12586
|
function printEnum(type, options) {
|
|
@@ -23910,14 +23910,14 @@ var require_lib3 = __commonJS({
|
|
|
23910
23910
|
this.preserveSpace = !!preserveSpace;
|
|
23911
23911
|
}
|
|
23912
23912
|
};
|
|
23913
|
-
var
|
|
23913
|
+
var types15 = {
|
|
23914
23914
|
brace: new TokContext("{"),
|
|
23915
23915
|
j_oTag: new TokContext("<tag"),
|
|
23916
23916
|
j_cTag: new TokContext("</tag"),
|
|
23917
23917
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
23918
23918
|
};
|
|
23919
23919
|
{
|
|
23920
|
-
|
|
23920
|
+
types15.template = new TokContext("`", true);
|
|
23921
23921
|
}
|
|
23922
23922
|
var beforeExpr = true;
|
|
23923
23923
|
var startsExpr = true;
|
|
@@ -24449,17 +24449,17 @@ var require_lib3 = __commonJS({
|
|
|
24449
24449
|
context.pop();
|
|
24450
24450
|
};
|
|
24451
24451
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
24452
|
-
context.push(
|
|
24452
|
+
context.push(types15.brace);
|
|
24453
24453
|
};
|
|
24454
24454
|
tokenTypes[22].updateContext = (context) => {
|
|
24455
|
-
if (context[context.length - 1] ===
|
|
24455
|
+
if (context[context.length - 1] === types15.template) {
|
|
24456
24456
|
context.pop();
|
|
24457
24457
|
} else {
|
|
24458
|
-
context.push(
|
|
24458
|
+
context.push(types15.template);
|
|
24459
24459
|
}
|
|
24460
24460
|
};
|
|
24461
24461
|
tokenTypes[140].updateContext = (context) => {
|
|
24462
|
-
context.push(
|
|
24462
|
+
context.push(types15.j_expr, types15.j_oTag);
|
|
24463
24463
|
};
|
|
24464
24464
|
}
|
|
24465
24465
|
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";
|
|
@@ -25100,7 +25100,7 @@ var require_lib3 = __commonJS({
|
|
|
25100
25100
|
this.lastTokEndLoc = null;
|
|
25101
25101
|
this.lastTokStartLoc = null;
|
|
25102
25102
|
this.lastTokStart = 0;
|
|
25103
|
-
this.context = [
|
|
25103
|
+
this.context = [types15.brace];
|
|
25104
25104
|
this.canStartJSXElement = true;
|
|
25105
25105
|
this.containsEsc = false;
|
|
25106
25106
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -29024,7 +29024,7 @@ var require_lib3 = __commonJS({
|
|
|
29024
29024
|
context
|
|
29025
29025
|
} = this.state;
|
|
29026
29026
|
const currentContext = context[context.length - 1];
|
|
29027
|
-
if (currentContext ===
|
|
29027
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
29028
29028
|
context.pop();
|
|
29029
29029
|
}
|
|
29030
29030
|
}
|
|
@@ -30084,9 +30084,9 @@ var require_lib3 = __commonJS({
|
|
|
30084
30084
|
switch (this.state.type) {
|
|
30085
30085
|
case 5:
|
|
30086
30086
|
node = this.startNode();
|
|
30087
|
-
this.setContext(
|
|
30087
|
+
this.setContext(types15.brace);
|
|
30088
30088
|
this.next();
|
|
30089
|
-
node = this.jsxParseExpressionContainer(node,
|
|
30089
|
+
node = this.jsxParseExpressionContainer(node, types15.j_oTag);
|
|
30090
30090
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
30091
30091
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
30092
30092
|
at: node
|
|
@@ -30109,7 +30109,7 @@ var require_lib3 = __commonJS({
|
|
|
30109
30109
|
jsxParseSpreadChild(node) {
|
|
30110
30110
|
this.next();
|
|
30111
30111
|
node.expression = this.parseExpression();
|
|
30112
|
-
this.setContext(
|
|
30112
|
+
this.setContext(types15.j_expr);
|
|
30113
30113
|
this.state.canStartJSXElement = true;
|
|
30114
30114
|
this.expect(8);
|
|
30115
30115
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -30129,11 +30129,11 @@ var require_lib3 = __commonJS({
|
|
|
30129
30129
|
jsxParseAttribute() {
|
|
30130
30130
|
const node = this.startNode();
|
|
30131
30131
|
if (this.match(5)) {
|
|
30132
|
-
this.setContext(
|
|
30132
|
+
this.setContext(types15.brace);
|
|
30133
30133
|
this.next();
|
|
30134
30134
|
this.expect(21);
|
|
30135
30135
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
30136
|
-
this.setContext(
|
|
30136
|
+
this.setContext(types15.j_oTag);
|
|
30137
30137
|
this.state.canStartJSXElement = true;
|
|
30138
30138
|
this.expect(8);
|
|
30139
30139
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -30192,12 +30192,12 @@ var require_lib3 = __commonJS({
|
|
|
30192
30192
|
break;
|
|
30193
30193
|
case 5: {
|
|
30194
30194
|
const node2 = this.startNode();
|
|
30195
|
-
this.setContext(
|
|
30195
|
+
this.setContext(types15.brace);
|
|
30196
30196
|
this.next();
|
|
30197
30197
|
if (this.match(21)) {
|
|
30198
30198
|
children.push(this.jsxParseSpreadChild(node2));
|
|
30199
30199
|
} else {
|
|
30200
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
30200
|
+
children.push(this.jsxParseExpressionContainer(node2, types15.j_expr));
|
|
30201
30201
|
}
|
|
30202
30202
|
break;
|
|
30203
30203
|
}
|
|
@@ -30268,10 +30268,10 @@ var require_lib3 = __commonJS({
|
|
|
30268
30268
|
}
|
|
30269
30269
|
getTokenFromCode(code) {
|
|
30270
30270
|
const context = this.curContext();
|
|
30271
|
-
if (context ===
|
|
30271
|
+
if (context === types15.j_expr) {
|
|
30272
30272
|
return this.jsxReadToken();
|
|
30273
30273
|
}
|
|
30274
|
-
if (context ===
|
|
30274
|
+
if (context === types15.j_oTag || context === types15.j_cTag) {
|
|
30275
30275
|
if (isIdentifierStart(code)) {
|
|
30276
30276
|
return this.jsxReadWord();
|
|
30277
30277
|
}
|
|
@@ -30279,7 +30279,7 @@ var require_lib3 = __commonJS({
|
|
|
30279
30279
|
++this.state.pos;
|
|
30280
30280
|
return this.finishToken(141);
|
|
30281
30281
|
}
|
|
30282
|
-
if ((code === 34 || code === 39) && context ===
|
|
30282
|
+
if ((code === 34 || code === 39) && context === types15.j_oTag) {
|
|
30283
30283
|
return this.jsxReadString(code);
|
|
30284
30284
|
}
|
|
30285
30285
|
}
|
|
@@ -30295,17 +30295,17 @@ var require_lib3 = __commonJS({
|
|
|
30295
30295
|
type
|
|
30296
30296
|
} = this.state;
|
|
30297
30297
|
if (type === 56 && prevType === 140) {
|
|
30298
|
-
context.splice(-2, 2,
|
|
30298
|
+
context.splice(-2, 2, types15.j_cTag);
|
|
30299
30299
|
this.state.canStartJSXElement = false;
|
|
30300
30300
|
} else if (type === 140) {
|
|
30301
|
-
context.push(
|
|
30301
|
+
context.push(types15.j_oTag);
|
|
30302
30302
|
} else if (type === 141) {
|
|
30303
30303
|
const out = context[context.length - 1];
|
|
30304
|
-
if (out ===
|
|
30304
|
+
if (out === types15.j_oTag && prevType === 56 || out === types15.j_cTag) {
|
|
30305
30305
|
context.pop();
|
|
30306
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
30306
|
+
this.state.canStartJSXElement = context[context.length - 1] === types15.j_expr;
|
|
30307
30307
|
} else {
|
|
30308
|
-
this.setContext(
|
|
30308
|
+
this.setContext(types15.j_expr);
|
|
30309
30309
|
this.state.canStartJSXElement = true;
|
|
30310
30310
|
}
|
|
30311
30311
|
} else {
|
|
@@ -31313,14 +31313,14 @@ var require_lib3 = __commonJS({
|
|
|
31313
31313
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
31314
31314
|
const node = this.startNode();
|
|
31315
31315
|
const hasLeadingOperator = this.eat(operator);
|
|
31316
|
-
const
|
|
31316
|
+
const types16 = [];
|
|
31317
31317
|
do {
|
|
31318
|
-
|
|
31318
|
+
types16.push(parseConstituentType());
|
|
31319
31319
|
} while (this.eat(operator));
|
|
31320
|
-
if (
|
|
31321
|
-
return
|
|
31320
|
+
if (types16.length === 1 && !hasLeadingOperator) {
|
|
31321
|
+
return types16[0];
|
|
31322
31322
|
}
|
|
31323
|
-
node.types =
|
|
31323
|
+
node.types = types16;
|
|
31324
31324
|
return this.finishNode(node, kind);
|
|
31325
31325
|
}
|
|
31326
31326
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -32549,7 +32549,7 @@ var require_lib3 = __commonJS({
|
|
|
32549
32549
|
context
|
|
32550
32550
|
} = this.state;
|
|
32551
32551
|
const currentContext = context[context.length - 1];
|
|
32552
|
-
if (currentContext ===
|
|
32552
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
32553
32553
|
context.pop();
|
|
32554
32554
|
}
|
|
32555
32555
|
}
|
|
@@ -38188,9 +38188,9 @@ var require_shared = __commonJS({
|
|
|
38188
38188
|
var tslib_1 = require_tslib();
|
|
38189
38189
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
38190
38190
|
function default_1(fork) {
|
|
38191
|
-
var
|
|
38192
|
-
var Type =
|
|
38193
|
-
var builtin =
|
|
38191
|
+
var types15 = fork.use(types_1.default);
|
|
38192
|
+
var Type = types15.Type;
|
|
38193
|
+
var builtin = types15.builtInTypes;
|
|
38194
38194
|
var isNumber = builtin.number;
|
|
38195
38195
|
function geq(than) {
|
|
38196
38196
|
return Type.from(function(value) {
|
|
@@ -38340,9 +38340,9 @@ var require_types = __commonJS({
|
|
|
38340
38340
|
}(BaseType);
|
|
38341
38341
|
var OrType = function(_super) {
|
|
38342
38342
|
tslib_1.__extends(OrType2, _super);
|
|
38343
|
-
function OrType2(
|
|
38343
|
+
function OrType2(types15) {
|
|
38344
38344
|
var _this = _super.call(this) || this;
|
|
38345
|
-
_this.types =
|
|
38345
|
+
_this.types = types15;
|
|
38346
38346
|
_this.kind = "OrType";
|
|
38347
38347
|
return _this;
|
|
38348
38348
|
}
|
|
@@ -38483,11 +38483,11 @@ var require_types = __commonJS({
|
|
|
38483
38483
|
function typesPlugin(_fork) {
|
|
38484
38484
|
var Type = {
|
|
38485
38485
|
or: function() {
|
|
38486
|
-
var
|
|
38486
|
+
var types15 = [];
|
|
38487
38487
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38488
|
-
|
|
38488
|
+
types15[_i] = arguments[_i];
|
|
38489
38489
|
}
|
|
38490
|
-
return new OrType(
|
|
38490
|
+
return new OrType(types15.map(function(type) {
|
|
38491
38491
|
return Type.from(type);
|
|
38492
38492
|
}));
|
|
38493
38493
|
},
|
|
@@ -38932,9 +38932,9 @@ var require_path2 = __commonJS({
|
|
|
38932
38932
|
var Op = Object.prototype;
|
|
38933
38933
|
var hasOwn = Op.hasOwnProperty;
|
|
38934
38934
|
function pathPlugin(fork) {
|
|
38935
|
-
var
|
|
38936
|
-
var isArray =
|
|
38937
|
-
var isNumber =
|
|
38935
|
+
var types15 = fork.use(types_1.default);
|
|
38936
|
+
var isArray = types15.builtInTypes.array;
|
|
38937
|
+
var isNumber = types15.builtInTypes.number;
|
|
38938
38938
|
var Path = function Path2(value, parentPath, name) {
|
|
38939
38939
|
if (!(this instanceof Path2)) {
|
|
38940
38940
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -39236,13 +39236,13 @@ var require_scope = __commonJS({
|
|
|
39236
39236
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
39237
39237
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39238
39238
|
function scopePlugin(fork) {
|
|
39239
|
-
var
|
|
39240
|
-
var Type =
|
|
39241
|
-
var namedTypes =
|
|
39239
|
+
var types15 = fork.use(types_1.default);
|
|
39240
|
+
var Type = types15.Type;
|
|
39241
|
+
var namedTypes = types15.namedTypes;
|
|
39242
39242
|
var Node = namedTypes.Node;
|
|
39243
39243
|
var Expression = namedTypes.Expression;
|
|
39244
|
-
var isArray =
|
|
39245
|
-
var b =
|
|
39244
|
+
var isArray = types15.builtInTypes.array;
|
|
39245
|
+
var b = types15.builders;
|
|
39246
39246
|
var Scope = function Scope2(path2, parentScope) {
|
|
39247
39247
|
if (!(this instanceof Scope2)) {
|
|
39248
39248
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -39305,7 +39305,7 @@ var require_scope = __commonJS({
|
|
|
39305
39305
|
++index;
|
|
39306
39306
|
}
|
|
39307
39307
|
var name = prefix + index;
|
|
39308
|
-
return this.bindings[name] =
|
|
39308
|
+
return this.bindings[name] = types15.builders.identifier(name);
|
|
39309
39309
|
};
|
|
39310
39310
|
Sp.injectTemporary = function(identifier, init) {
|
|
39311
39311
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39381,7 +39381,7 @@ var require_scope = __commonJS({
|
|
|
39381
39381
|
bindings
|
|
39382
39382
|
);
|
|
39383
39383
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39384
|
-
|
|
39384
|
+
types15.eachField(node, function(name, child) {
|
|
39385
39385
|
var childPath = path2.get(name);
|
|
39386
39386
|
if (!pathHasValue(childPath, child)) {
|
|
39387
39387
|
throw new Error("");
|
|
@@ -39459,24 +39459,24 @@ var require_scope = __commonJS({
|
|
|
39459
39459
|
addPattern(patternPath.get("argument"), bindings);
|
|
39460
39460
|
}
|
|
39461
39461
|
}
|
|
39462
|
-
function addTypePattern(patternPath,
|
|
39462
|
+
function addTypePattern(patternPath, types16) {
|
|
39463
39463
|
var pattern = patternPath.value;
|
|
39464
39464
|
namedTypes.Pattern.assert(pattern);
|
|
39465
39465
|
if (namedTypes.Identifier.check(pattern)) {
|
|
39466
|
-
if (hasOwn.call(
|
|
39467
|
-
|
|
39466
|
+
if (hasOwn.call(types16, pattern.name)) {
|
|
39467
|
+
types16[pattern.name].push(patternPath);
|
|
39468
39468
|
} else {
|
|
39469
|
-
|
|
39469
|
+
types16[pattern.name] = [patternPath];
|
|
39470
39470
|
}
|
|
39471
39471
|
}
|
|
39472
39472
|
}
|
|
39473
|
-
function addTypeParameter(parameterPath,
|
|
39473
|
+
function addTypeParameter(parameterPath, types16) {
|
|
39474
39474
|
var parameter = parameterPath.value;
|
|
39475
39475
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
39476
|
-
if (hasOwn.call(
|
|
39477
|
-
|
|
39476
|
+
if (hasOwn.call(types16, parameter.name)) {
|
|
39477
|
+
types16[parameter.name].push(parameterPath);
|
|
39478
39478
|
} else {
|
|
39479
|
-
|
|
39479
|
+
types16[parameter.name] = [parameterPath];
|
|
39480
39480
|
}
|
|
39481
39481
|
}
|
|
39482
39482
|
Sp.lookup = function(name) {
|
|
@@ -39517,11 +39517,11 @@ var require_node_path = __commonJS({
|
|
|
39517
39517
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
39518
39518
|
var shared_1 = require_shared();
|
|
39519
39519
|
function nodePathPlugin(fork) {
|
|
39520
|
-
var
|
|
39521
|
-
var n =
|
|
39522
|
-
var b =
|
|
39523
|
-
var isNumber =
|
|
39524
|
-
var isArray =
|
|
39520
|
+
var types15 = fork.use(types_1.default);
|
|
39521
|
+
var n = types15.namedTypes;
|
|
39522
|
+
var b = types15.builders;
|
|
39523
|
+
var isNumber = types15.builtInTypes.number;
|
|
39524
|
+
var isArray = types15.builtInTypes.array;
|
|
39525
39525
|
var Path = fork.use(path_1.default);
|
|
39526
39526
|
var Scope = fork.use(scope_1.default);
|
|
39527
39527
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -39612,7 +39612,7 @@ var require_node_path = __commonJS({
|
|
|
39612
39612
|
return scope || null;
|
|
39613
39613
|
};
|
|
39614
39614
|
NPp.getValueProperty = function(name) {
|
|
39615
|
-
return
|
|
39615
|
+
return types15.getFieldValue(this.value, name);
|
|
39616
39616
|
};
|
|
39617
39617
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39618
39618
|
var pp = this.parentPath;
|
|
@@ -39754,7 +39754,7 @@ var require_node_path = __commonJS({
|
|
|
39754
39754
|
return node.some(containsCallExpression);
|
|
39755
39755
|
}
|
|
39756
39756
|
if (n.Node.check(node)) {
|
|
39757
|
-
return
|
|
39757
|
+
return types15.someField(node, function(_name, child) {
|
|
39758
39758
|
return containsCallExpression(child);
|
|
39759
39759
|
});
|
|
39760
39760
|
}
|
|
@@ -39875,11 +39875,11 @@ var require_path_visitor = __commonJS({
|
|
|
39875
39875
|
var shared_1 = require_shared();
|
|
39876
39876
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39877
39877
|
function pathVisitorPlugin(fork) {
|
|
39878
|
-
var
|
|
39878
|
+
var types15 = fork.use(types_1.default);
|
|
39879
39879
|
var NodePath = fork.use(node_path_1.default);
|
|
39880
|
-
var isArray =
|
|
39881
|
-
var isObject =
|
|
39882
|
-
var isFunction =
|
|
39880
|
+
var isArray = types15.builtInTypes.array;
|
|
39881
|
+
var isObject = types15.builtInTypes.object;
|
|
39882
|
+
var isFunction = types15.builtInTypes.function;
|
|
39883
39883
|
var undefined2;
|
|
39884
39884
|
var PathVisitor = function PathVisitor2() {
|
|
39885
39885
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -39899,7 +39899,7 @@ var require_path_visitor = __commonJS({
|
|
|
39899
39899
|
typeNames[methodName.slice("visit".length)] = true;
|
|
39900
39900
|
}
|
|
39901
39901
|
}
|
|
39902
|
-
var supertypeTable =
|
|
39902
|
+
var supertypeTable = types15.computeSupertypeLookupTable(typeNames);
|
|
39903
39903
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
39904
39904
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
39905
39905
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -40018,7 +40018,7 @@ var require_path_visitor = __commonJS({
|
|
|
40018
40018
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
40019
40019
|
} else if (!isObject.check(value)) {
|
|
40020
40020
|
} else {
|
|
40021
|
-
var childNames =
|
|
40021
|
+
var childNames = types15.getFieldNames(value);
|
|
40022
40022
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
40023
40023
|
childNames.push("comments");
|
|
40024
40024
|
}
|
|
@@ -40027,7 +40027,7 @@ var require_path_visitor = __commonJS({
|
|
|
40027
40027
|
for (var i = 0; i < childCount; ++i) {
|
|
40028
40028
|
var childName = childNames[i];
|
|
40029
40029
|
if (!hasOwn.call(value, childName)) {
|
|
40030
|
-
value[childName] =
|
|
40030
|
+
value[childName] = types15.getFieldValue(value, childName);
|
|
40031
40031
|
}
|
|
40032
40032
|
childPaths.push(path2.get(childName));
|
|
40033
40033
|
}
|
|
@@ -40170,13 +40170,13 @@ var require_equiv = __commonJS({
|
|
|
40170
40170
|
var shared_1 = require_shared();
|
|
40171
40171
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40172
40172
|
function default_1(fork) {
|
|
40173
|
-
var
|
|
40174
|
-
var getFieldNames =
|
|
40175
|
-
var getFieldValue =
|
|
40176
|
-
var isArray =
|
|
40177
|
-
var isObject =
|
|
40178
|
-
var isDate =
|
|
40179
|
-
var isRegExp =
|
|
40173
|
+
var types15 = fork.use(types_1.default);
|
|
40174
|
+
var getFieldNames = types15.getFieldNames;
|
|
40175
|
+
var getFieldValue = types15.getFieldValue;
|
|
40176
|
+
var isArray = types15.builtInTypes.array;
|
|
40177
|
+
var isObject = types15.builtInTypes.object;
|
|
40178
|
+
var isDate = types15.builtInTypes.Date;
|
|
40179
|
+
var isRegExp = types15.builtInTypes.RegExp;
|
|
40180
40180
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
40181
40181
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
40182
40182
|
if (isArray.check(problemPath)) {
|
|
@@ -40329,24 +40329,24 @@ var require_fork = __commonJS({
|
|
|
40329
40329
|
var shared_1 = require_shared();
|
|
40330
40330
|
function default_1(plugins) {
|
|
40331
40331
|
var fork = createFork();
|
|
40332
|
-
var
|
|
40332
|
+
var types15 = fork.use(types_1.default);
|
|
40333
40333
|
plugins.forEach(fork.use);
|
|
40334
|
-
|
|
40334
|
+
types15.finalize();
|
|
40335
40335
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
40336
40336
|
return {
|
|
40337
|
-
Type:
|
|
40338
|
-
builtInTypes:
|
|
40339
|
-
namedTypes:
|
|
40340
|
-
builders:
|
|
40341
|
-
defineMethod:
|
|
40342
|
-
getFieldNames:
|
|
40343
|
-
getFieldValue:
|
|
40344
|
-
eachField:
|
|
40345
|
-
someField:
|
|
40346
|
-
getSupertypeNames:
|
|
40347
|
-
getBuilderName:
|
|
40337
|
+
Type: types15.Type,
|
|
40338
|
+
builtInTypes: types15.builtInTypes,
|
|
40339
|
+
namedTypes: types15.namedTypes,
|
|
40340
|
+
builders: types15.builders,
|
|
40341
|
+
defineMethod: types15.defineMethod,
|
|
40342
|
+
getFieldNames: types15.getFieldNames,
|
|
40343
|
+
getFieldValue: types15.getFieldValue,
|
|
40344
|
+
eachField: types15.eachField,
|
|
40345
|
+
someField: types15.someField,
|
|
40346
|
+
getSupertypeNames: types15.getSupertypeNames,
|
|
40347
|
+
getBuilderName: types15.getBuilderName,
|
|
40348
40348
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
40349
|
-
finalize:
|
|
40349
|
+
finalize: types15.finalize,
|
|
40350
40350
|
Path: fork.use(path_1.default),
|
|
40351
40351
|
NodePath: fork.use(node_path_1.default),
|
|
40352
40352
|
PathVisitor,
|
|
@@ -40516,8 +40516,8 @@ var require_core2 = __commonJS({
|
|
|
40516
40516
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40517
40517
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40518
40518
|
function default_1(fork) {
|
|
40519
|
-
var
|
|
40520
|
-
var Type =
|
|
40519
|
+
var types15 = fork.use(types_1.default);
|
|
40520
|
+
var Type = types15.Type;
|
|
40521
40521
|
var def = Type.def;
|
|
40522
40522
|
var or = Type.or;
|
|
40523
40523
|
var shared = fork.use(shared_1.default);
|
|
@@ -40609,9 +40609,9 @@ var require_es6 = __commonJS({
|
|
|
40609
40609
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40610
40610
|
function default_1(fork) {
|
|
40611
40611
|
fork.use(core_1.default);
|
|
40612
|
-
var
|
|
40613
|
-
var def =
|
|
40614
|
-
var or =
|
|
40612
|
+
var types15 = fork.use(types_1.default);
|
|
40613
|
+
var def = types15.Type.def;
|
|
40614
|
+
var or = types15.Type.or;
|
|
40615
40615
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40616
40616
|
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"]);
|
|
40617
40617
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -40701,8 +40701,8 @@ var require_es2017 = __commonJS({
|
|
|
40701
40701
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40702
40702
|
function default_1(fork) {
|
|
40703
40703
|
fork.use(es2016_1.default);
|
|
40704
|
-
var
|
|
40705
|
-
var def =
|
|
40704
|
+
var types15 = fork.use(types_1.default);
|
|
40705
|
+
var def = types15.Type.def;
|
|
40706
40706
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40707
40707
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
40708
40708
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -40725,9 +40725,9 @@ var require_es2018 = __commonJS({
|
|
|
40725
40725
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40726
40726
|
function default_1(fork) {
|
|
40727
40727
|
fork.use(es2017_1.default);
|
|
40728
|
-
var
|
|
40729
|
-
var def =
|
|
40730
|
-
var or =
|
|
40728
|
+
var types15 = fork.use(types_1.default);
|
|
40729
|
+
var def = types15.Type.def;
|
|
40730
|
+
var or = types15.Type.or;
|
|
40731
40731
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40732
40732
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
40733
40733
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -40758,9 +40758,9 @@ var require_es2019 = __commonJS({
|
|
|
40758
40758
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40759
40759
|
function default_1(fork) {
|
|
40760
40760
|
fork.use(es2018_1.default);
|
|
40761
|
-
var
|
|
40762
|
-
var def =
|
|
40763
|
-
var or =
|
|
40761
|
+
var types15 = fork.use(types_1.default);
|
|
40762
|
+
var def = types15.Type.def;
|
|
40763
|
+
var or = types15.Type.or;
|
|
40764
40764
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40765
40765
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
40766
40766
|
}
|
|
@@ -40784,9 +40784,9 @@ var require_es20202 = __commonJS({
|
|
|
40784
40784
|
function default_1(fork) {
|
|
40785
40785
|
fork.use(es2020_1.default);
|
|
40786
40786
|
fork.use(es2019_1.default);
|
|
40787
|
-
var
|
|
40788
|
-
var def =
|
|
40789
|
-
var or =
|
|
40787
|
+
var types15 = fork.use(types_1.default);
|
|
40788
|
+
var def = types15.Type.def;
|
|
40789
|
+
var or = types15.Type.or;
|
|
40790
40790
|
var shared = fork.use(shared_1.default);
|
|
40791
40791
|
var defaults = shared.defaults;
|
|
40792
40792
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -40836,8 +40836,8 @@ var require_es2022 = __commonJS({
|
|
|
40836
40836
|
var shared_1 = require_shared();
|
|
40837
40837
|
function default_1(fork) {
|
|
40838
40838
|
fork.use(es2021_1.default);
|
|
40839
|
-
var
|
|
40840
|
-
var def =
|
|
40839
|
+
var types15 = fork.use(types_1.default);
|
|
40840
|
+
var def = types15.Type.def;
|
|
40841
40841
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
40842
40842
|
}
|
|
40843
40843
|
exports.default = default_1;
|
|
@@ -40858,9 +40858,9 @@ var require_es_proposals = __commonJS({
|
|
|
40858
40858
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
40859
40859
|
function default_1(fork) {
|
|
40860
40860
|
fork.use(es2022_1.default);
|
|
40861
|
-
var
|
|
40862
|
-
var Type =
|
|
40863
|
-
var def =
|
|
40861
|
+
var types15 = fork.use(types_1.default);
|
|
40862
|
+
var Type = types15.Type;
|
|
40863
|
+
var def = types15.Type.def;
|
|
40864
40864
|
var or = Type.or;
|
|
40865
40865
|
var shared = fork.use(shared_1.default);
|
|
40866
40866
|
var defaults = shared.defaults;
|
|
@@ -40900,9 +40900,9 @@ var require_jsx = __commonJS({
|
|
|
40900
40900
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40901
40901
|
function default_1(fork) {
|
|
40902
40902
|
fork.use(es_proposals_1.default);
|
|
40903
|
-
var
|
|
40904
|
-
var def =
|
|
40905
|
-
var or =
|
|
40903
|
+
var types15 = fork.use(types_1.default);
|
|
40904
|
+
var def = types15.Type.def;
|
|
40905
|
+
var or = types15.Type.or;
|
|
40906
40906
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40907
40907
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
40908
40908
|
def("Literal"),
|
|
@@ -40960,9 +40960,9 @@ var require_type_annotations = __commonJS({
|
|
|
40960
40960
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40961
40961
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40962
40962
|
function default_1(fork) {
|
|
40963
|
-
var
|
|
40964
|
-
var def =
|
|
40965
|
-
var or =
|
|
40963
|
+
var types15 = fork.use(types_1.default);
|
|
40964
|
+
var def = types15.Type.def;
|
|
40965
|
+
var or = types15.Type.or;
|
|
40966
40966
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40967
40967
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
40968
40968
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -40997,9 +40997,9 @@ var require_flow = __commonJS({
|
|
|
40997
40997
|
function default_1(fork) {
|
|
40998
40998
|
fork.use(es_proposals_1.default);
|
|
40999
40999
|
fork.use(type_annotations_1.default);
|
|
41000
|
-
var
|
|
41001
|
-
var def =
|
|
41002
|
-
var or =
|
|
41000
|
+
var types15 = fork.use(types_1.default);
|
|
41001
|
+
var def = types15.Type.def;
|
|
41002
|
+
var or = types15.Type.or;
|
|
41003
41003
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41004
41004
|
def("Flow").bases("Node");
|
|
41005
41005
|
def("FlowType").bases("Flow");
|
|
@@ -41113,10 +41113,10 @@ var require_esprima = __commonJS({
|
|
|
41113
41113
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
41114
41114
|
function default_1(fork) {
|
|
41115
41115
|
fork.use(es_proposals_1.default);
|
|
41116
|
-
var
|
|
41116
|
+
var types15 = fork.use(types_1.default);
|
|
41117
41117
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41118
|
-
var def =
|
|
41119
|
-
var or =
|
|
41118
|
+
var def = types15.Type.def;
|
|
41119
|
+
var or = types15.Type.or;
|
|
41120
41120
|
def("VariableDeclaration").field("declarations", [or(
|
|
41121
41121
|
def("VariableDeclarator"),
|
|
41122
41122
|
def("Identifier")
|
|
@@ -41161,11 +41161,11 @@ var require_babel_core = __commonJS({
|
|
|
41161
41161
|
function default_1(fork) {
|
|
41162
41162
|
var _a, _b, _c, _d, _e;
|
|
41163
41163
|
fork.use(es_proposals_1.default);
|
|
41164
|
-
var
|
|
41164
|
+
var types15 = fork.use(types_1.default);
|
|
41165
41165
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41166
|
-
var def =
|
|
41167
|
-
var or =
|
|
41168
|
-
var isUndefined =
|
|
41166
|
+
var def = types15.Type.def;
|
|
41167
|
+
var or = types15.Type.or;
|
|
41168
|
+
var isUndefined = types15.builtInTypes.undefined;
|
|
41169
41169
|
def("Noop").bases("Statement").build();
|
|
41170
41170
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
41171
41171
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -41190,7 +41190,7 @@ var require_babel_core = __commonJS({
|
|
|
41190
41190
|
raw: String
|
|
41191
41191
|
},
|
|
41192
41192
|
function getDefault() {
|
|
41193
|
-
var value =
|
|
41193
|
+
var value = types15.getFieldValue(this, "value");
|
|
41194
41194
|
return {
|
|
41195
41195
|
rawValue: value,
|
|
41196
41196
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -41293,8 +41293,8 @@ var require_babel = __commonJS({
|
|
|
41293
41293
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
41294
41294
|
var shared_1 = require_shared();
|
|
41295
41295
|
function default_1(fork) {
|
|
41296
|
-
var
|
|
41297
|
-
var def =
|
|
41296
|
+
var types15 = fork.use(types_1.default);
|
|
41297
|
+
var def = types15.Type.def;
|
|
41298
41298
|
fork.use(babel_core_1.default);
|
|
41299
41299
|
fork.use(flow_1.default);
|
|
41300
41300
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -41320,12 +41320,12 @@ var require_typescript = __commonJS({
|
|
|
41320
41320
|
function default_1(fork) {
|
|
41321
41321
|
fork.use(babel_core_1.default);
|
|
41322
41322
|
fork.use(type_annotations_1.default);
|
|
41323
|
-
var
|
|
41324
|
-
var n =
|
|
41325
|
-
var def =
|
|
41326
|
-
var or =
|
|
41323
|
+
var types15 = fork.use(types_1.default);
|
|
41324
|
+
var n = types15.namedTypes;
|
|
41325
|
+
var def = types15.Type.def;
|
|
41326
|
+
var or = types15.Type.or;
|
|
41327
41327
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41328
|
-
var StringLiteral =
|
|
41328
|
+
var StringLiteral = types15.Type.from(function(value, deep) {
|
|
41329
41329
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
41330
41330
|
return true;
|
|
41331
41331
|
}
|
|
@@ -43301,8 +43301,8 @@ var require_util2 = __commonJS({
|
|
|
43301
43301
|
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;
|
|
43302
43302
|
var tslib_1 = require_tslib();
|
|
43303
43303
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
43304
|
-
var
|
|
43305
|
-
var n =
|
|
43304
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
43305
|
+
var n = types15.namedTypes;
|
|
43306
43306
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
43307
43307
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
43308
43308
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -50620,10 +50620,10 @@ var require_comments = __commonJS({
|
|
|
50620
50620
|
exports.printComments = exports.attach = void 0;
|
|
50621
50621
|
var tslib_1 = require_tslib();
|
|
50622
50622
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
50623
|
-
var
|
|
50624
|
-
var n =
|
|
50625
|
-
var isArray =
|
|
50626
|
-
var isObject =
|
|
50623
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50624
|
+
var n = types15.namedTypes;
|
|
50625
|
+
var isArray = types15.builtInTypes.array;
|
|
50626
|
+
var isObject = types15.builtInTypes.object;
|
|
50627
50627
|
var lines_1 = require_lines();
|
|
50628
50628
|
var util_1 = require_util2();
|
|
50629
50629
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -50654,7 +50654,7 @@ var require_comments = __commonJS({
|
|
|
50654
50654
|
if (isArray.check(node)) {
|
|
50655
50655
|
names = Object.keys(node);
|
|
50656
50656
|
} else if (isObject.check(node)) {
|
|
50657
|
-
names =
|
|
50657
|
+
names = types15.getFieldNames(node);
|
|
50658
50658
|
} else {
|
|
50659
50659
|
return resultArray;
|
|
50660
50660
|
}
|
|
@@ -50832,7 +50832,7 @@ var require_comments = __commonJS({
|
|
|
50832
50832
|
function printComments(path2, print7) {
|
|
50833
50833
|
var value = path2.getValue();
|
|
50834
50834
|
var innerLines = print7(path2);
|
|
50835
|
-
var comments = n.Node.check(value) &&
|
|
50835
|
+
var comments = n.Node.check(value) && types15.getFieldValue(value, "comments");
|
|
50836
50836
|
if (!comments || comments.length === 0) {
|
|
50837
50837
|
return innerLines;
|
|
50838
50838
|
}
|
|
@@ -50840,8 +50840,8 @@ var require_comments = __commonJS({
|
|
|
50840
50840
|
var trailingParts = [innerLines];
|
|
50841
50841
|
path2.each(function(commentPath) {
|
|
50842
50842
|
var comment = commentPath.getValue();
|
|
50843
|
-
var leading =
|
|
50844
|
-
var trailing =
|
|
50843
|
+
var leading = types15.getFieldValue(comment, "leading");
|
|
50844
|
+
var trailing = types15.getFieldValue(comment, "trailing");
|
|
50845
50845
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50846
50846
|
leadingParts.push(printLeadingComment(commentPath, print7));
|
|
50847
50847
|
} else if (trailing) {
|
|
@@ -50863,10 +50863,10 @@ var require_parser2 = __commonJS({
|
|
|
50863
50863
|
exports.parse = void 0;
|
|
50864
50864
|
var tslib_1 = require_tslib();
|
|
50865
50865
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
50866
|
-
var
|
|
50867
|
-
var b =
|
|
50868
|
-
var isObject =
|
|
50869
|
-
var isArray =
|
|
50866
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50867
|
+
var b = types15.builders;
|
|
50868
|
+
var isObject = types15.builtInTypes.object;
|
|
50869
|
+
var isArray = types15.builtInTypes.array;
|
|
50870
50870
|
var options_1 = require_options();
|
|
50871
50871
|
var lines_1 = require_lines();
|
|
50872
50872
|
var comments_1 = require_comments();
|
|
@@ -51052,11 +51052,11 @@ var require_fast_path = __commonJS({
|
|
|
51052
51052
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51053
51053
|
var tslib_1 = require_tslib();
|
|
51054
51054
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51055
|
-
var
|
|
51055
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51056
51056
|
var util = tslib_1.__importStar(require_util2());
|
|
51057
|
-
var n =
|
|
51058
|
-
var isArray =
|
|
51059
|
-
var isNumber =
|
|
51057
|
+
var n = types15.namedTypes;
|
|
51058
|
+
var isArray = types15.builtInTypes.array;
|
|
51059
|
+
var isNumber = types15.builtInTypes.number;
|
|
51060
51060
|
var PRECEDENCE = {};
|
|
51061
51061
|
[
|
|
51062
51062
|
["??"],
|
|
@@ -51085,7 +51085,7 @@ var require_fast_path = __commonJS({
|
|
|
51085
51085
|
if (obj instanceof FastPath) {
|
|
51086
51086
|
return obj.copy();
|
|
51087
51087
|
}
|
|
51088
|
-
if (obj instanceof
|
|
51088
|
+
if (obj instanceof types15.NodePath) {
|
|
51089
51089
|
var copy = Object.create(FastPath.prototype);
|
|
51090
51090
|
var stack = [obj.value];
|
|
51091
51091
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -51396,7 +51396,7 @@ var require_fast_path = __commonJS({
|
|
|
51396
51396
|
return node.some(containsCallExpression);
|
|
51397
51397
|
}
|
|
51398
51398
|
if (n.Node.check(node)) {
|
|
51399
|
-
return
|
|
51399
|
+
return types15.someField(node, function(_name, child) {
|
|
51400
51400
|
return containsCallExpression(child);
|
|
51401
51401
|
});
|
|
51402
51402
|
}
|
|
@@ -51486,16 +51486,16 @@ var require_patcher = __commonJS({
|
|
|
51486
51486
|
var tslib_1 = require_tslib();
|
|
51487
51487
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51488
51488
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
51489
|
-
var
|
|
51490
|
-
var Printable =
|
|
51491
|
-
var Expression =
|
|
51492
|
-
var ReturnStatement =
|
|
51493
|
-
var SourceLocation =
|
|
51489
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51490
|
+
var Printable = types15.namedTypes.Printable;
|
|
51491
|
+
var Expression = types15.namedTypes.Expression;
|
|
51492
|
+
var ReturnStatement = types15.namedTypes.ReturnStatement;
|
|
51493
|
+
var SourceLocation = types15.namedTypes.SourceLocation;
|
|
51494
51494
|
var util_1 = require_util2();
|
|
51495
51495
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51496
|
-
var isObject =
|
|
51497
|
-
var isArray =
|
|
51498
|
-
var isString =
|
|
51496
|
+
var isObject = types15.builtInTypes.object;
|
|
51497
|
+
var isArray = types15.builtInTypes.array;
|
|
51498
|
+
var isString = types15.builtInTypes.string;
|
|
51499
51499
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
51500
51500
|
var Patcher = function Patcher2(lines) {
|
|
51501
51501
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -51765,8 +51765,8 @@ var require_patcher = __commonJS({
|
|
|
51765
51765
|
if (k.charAt(0) === "_") {
|
|
51766
51766
|
continue;
|
|
51767
51767
|
}
|
|
51768
|
-
newPath.stack.push(k,
|
|
51769
|
-
oldPath.stack.push(k,
|
|
51768
|
+
newPath.stack.push(k, types15.getFieldValue(newNode, k));
|
|
51769
|
+
oldPath.stack.push(k, types15.getFieldValue(oldNode, k));
|
|
51770
51770
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
51771
51771
|
newPath.stack.length -= 2;
|
|
51772
51772
|
oldPath.stack.length -= 2;
|
|
@@ -51790,16 +51790,16 @@ var require_printer2 = __commonJS({
|
|
|
51790
51790
|
exports.Printer = void 0;
|
|
51791
51791
|
var tslib_1 = require_tslib();
|
|
51792
51792
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51793
|
-
var
|
|
51793
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51794
51794
|
var comments_1 = require_comments();
|
|
51795
51795
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51796
51796
|
var lines_1 = require_lines();
|
|
51797
51797
|
var options_1 = require_options();
|
|
51798
51798
|
var patcher_1 = require_patcher();
|
|
51799
51799
|
var util = tslib_1.__importStar(require_util2());
|
|
51800
|
-
var namedTypes =
|
|
51801
|
-
var isString =
|
|
51802
|
-
var isObject =
|
|
51800
|
+
var namedTypes = types15.namedTypes;
|
|
51801
|
+
var isString = types15.builtInTypes.string;
|
|
51802
|
+
var isObject = types15.builtInTypes.object;
|
|
51803
51803
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
51804
51804
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
51805
51805
|
isString.assert(code);
|
|
@@ -51961,7 +51961,7 @@ var require_printer2 = __commonJS({
|
|
|
51961
51961
|
case "OptionalMemberExpression": {
|
|
51962
51962
|
parts.push(path2.call(print7, "object"));
|
|
51963
51963
|
var property = path2.call(print7, "property");
|
|
51964
|
-
var optional =
|
|
51964
|
+
var optional = types15.getFieldValue(n, "optional");
|
|
51965
51965
|
if (n.computed) {
|
|
51966
51966
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
51967
51967
|
} else {
|
|
@@ -52232,7 +52232,7 @@ var require_printer2 = __commonJS({
|
|
|
52232
52232
|
if (n.typeArguments) {
|
|
52233
52233
|
parts.push(path2.call(print7, "typeArguments"));
|
|
52234
52234
|
}
|
|
52235
|
-
if (
|
|
52235
|
+
if (types15.getFieldValue(n, "optional")) {
|
|
52236
52236
|
parts.push("?.");
|
|
52237
52237
|
}
|
|
52238
52238
|
parts.push(printArgumentsList(path2, options, print7));
|
|
@@ -53911,8 +53911,8 @@ var require_printer2 = __commonJS({
|
|
|
53911
53911
|
});
|
|
53912
53912
|
}
|
|
53913
53913
|
function getPossibleRaw(node) {
|
|
53914
|
-
var value =
|
|
53915
|
-
var extra =
|
|
53914
|
+
var value = types15.getFieldValue(node, "value");
|
|
53915
|
+
var extra = types15.getFieldValue(node, "extra");
|
|
53916
53916
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
53917
53917
|
return extra.raw;
|
|
53918
53918
|
}
|
|
@@ -53960,8 +53960,8 @@ var require_main2 = __commonJS({
|
|
|
53960
53960
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
53961
53961
|
var tslib_1 = require_tslib();
|
|
53962
53962
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
53963
|
-
var
|
|
53964
|
-
exports.types =
|
|
53963
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
53964
|
+
exports.types = types15;
|
|
53965
53965
|
var parser_1 = require_parser2();
|
|
53966
53966
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
53967
53967
|
return parser_1.parse;
|
|
@@ -54677,6 +54677,9 @@ var GarbageCollector = class {
|
|
|
54677
54677
|
constructor(cache) {
|
|
54678
54678
|
this.cache = cache;
|
|
54679
54679
|
}
|
|
54680
|
+
reset() {
|
|
54681
|
+
this.lifetimes.clear();
|
|
54682
|
+
}
|
|
54680
54683
|
resetLifetime(id, field) {
|
|
54681
54684
|
if (!this.lifetimes.get(id)) {
|
|
54682
54685
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -54796,6 +54799,10 @@ var ListManager = class {
|
|
|
54796
54799
|
}
|
|
54797
54800
|
this.listsByField.get(parentID).delete(field);
|
|
54798
54801
|
}
|
|
54802
|
+
reset() {
|
|
54803
|
+
this.lists.clear();
|
|
54804
|
+
this.listsByField.clear();
|
|
54805
|
+
}
|
|
54799
54806
|
};
|
|
54800
54807
|
var List = class {
|
|
54801
54808
|
recordID;
|
|
@@ -55178,6 +55185,9 @@ var StaleManager = class {
|
|
|
55178
55185
|
}
|
|
55179
55186
|
}
|
|
55180
55187
|
}
|
|
55188
|
+
reset() {
|
|
55189
|
+
this.fieldsTime.clear();
|
|
55190
|
+
}
|
|
55181
55191
|
};
|
|
55182
55192
|
|
|
55183
55193
|
// src/runtime/cache/storage.ts
|
|
@@ -55358,6 +55368,9 @@ var InMemoryStorage = class {
|
|
|
55358
55368
|
layer.fields = fields;
|
|
55359
55369
|
layer.links = links;
|
|
55360
55370
|
}
|
|
55371
|
+
reset() {
|
|
55372
|
+
this.data = [];
|
|
55373
|
+
}
|
|
55361
55374
|
};
|
|
55362
55375
|
var Layer = class {
|
|
55363
55376
|
id;
|
|
@@ -55803,6 +55816,18 @@ var InMemorySubscriptions = class {
|
|
|
55803
55816
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
55804
55817
|
}
|
|
55805
55818
|
}
|
|
55819
|
+
reset() {
|
|
55820
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
55821
|
+
([id]) => !id.startsWith(rootID)
|
|
55822
|
+
);
|
|
55823
|
+
for (const [id, _fields] of subscribers) {
|
|
55824
|
+
delete this.subscribers[id];
|
|
55825
|
+
}
|
|
55826
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
55827
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
55828
|
+
);
|
|
55829
|
+
return subscriptionSpecs;
|
|
55830
|
+
}
|
|
55806
55831
|
removeSubscribers(id, fieldName, specs) {
|
|
55807
55832
|
let targets = [];
|
|
55808
55833
|
for (const spec of specs) {
|
|
@@ -55992,6 +56017,14 @@ var Cache = class {
|
|
|
55992
56017
|
}
|
|
55993
56018
|
this.#notifySubscribers(toNotify);
|
|
55994
56019
|
}
|
|
56020
|
+
reset() {
|
|
56021
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
56022
|
+
this._internal_unstable.staleManager.reset();
|
|
56023
|
+
this._internal_unstable.lifetimes.reset();
|
|
56024
|
+
this._internal_unstable.lists.reset();
|
|
56025
|
+
this._internal_unstable.storage.reset();
|
|
56026
|
+
this.#notifySubscribers(subSpecs);
|
|
56027
|
+
}
|
|
55995
56028
|
#notifySubscribers(subs) {
|
|
55996
56029
|
if (subs.length === 0) {
|
|
55997
56030
|
return;
|
|
@@ -56141,12 +56174,9 @@ var CacheInternal = class {
|
|
|
56141
56174
|
);
|
|
56142
56175
|
}
|
|
56143
56176
|
}
|
|
56144
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56145
|
-
(field2) => typeof value[field2] === "undefined"
|
|
56146
|
-
).length > 0;
|
|
56147
56177
|
let linkedID = null;
|
|
56148
56178
|
if (value !== null) {
|
|
56149
|
-
linkedID = !
|
|
56179
|
+
linkedID = !this.isEmbedded(linkedType, value) ? this.id(linkedType, value) : `${parent2}.${key}`;
|
|
56150
56180
|
}
|
|
56151
56181
|
let linkChange = linkedID !== previousValue;
|
|
56152
56182
|
layer.writeLink(parent2, key, linkedID);
|
|
@@ -56174,7 +56204,7 @@ var CacheInternal = class {
|
|
|
56174
56204
|
forceNotify
|
|
56175
56205
|
});
|
|
56176
56206
|
}
|
|
56177
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
56207
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
56178
56208
|
let oldIDs = [...previousValue || []];
|
|
56179
56209
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
56180
56210
|
if (!id) {
|
|
@@ -56247,7 +56277,7 @@ var CacheInternal = class {
|
|
|
56247
56277
|
} else {
|
|
56248
56278
|
linkedIDs = nestedIDs;
|
|
56249
56279
|
}
|
|
56250
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
56280
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
56251
56281
|
if (contentChanged || forceNotify) {
|
|
56252
56282
|
toNotify.push(...currentSubscribers);
|
|
56253
56283
|
}
|
|
@@ -56518,6 +56548,10 @@ var CacheInternal = class {
|
|
|
56518
56548
|
computeID(type, data) {
|
|
56519
56549
|
return computeID(this.config, type, data);
|
|
56520
56550
|
}
|
|
56551
|
+
isEmbedded(linkedType, value) {
|
|
56552
|
+
const idFields = this.idFields(linkedType);
|
|
56553
|
+
return idFields.length === 0 || idFields.filter((field) => typeof value[field] === "undefined").length > 0;
|
|
56554
|
+
}
|
|
56521
56555
|
hydrateNestedList({
|
|
56522
56556
|
fields,
|
|
56523
56557
|
variables,
|
|
@@ -56625,9 +56659,6 @@ var CacheInternal = class {
|
|
|
56625
56659
|
}
|
|
56626
56660
|
const entryObj = entry;
|
|
56627
56661
|
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
56628
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56629
|
-
(field) => typeof entry[field] === "undefined"
|
|
56630
|
-
).length > 0;
|
|
56631
56662
|
let innerType = linkedType;
|
|
56632
56663
|
const typename = entryObj.__typename;
|
|
56633
56664
|
if (typename) {
|
|
@@ -56635,7 +56666,7 @@ var CacheInternal = class {
|
|
|
56635
56666
|
} else if (abstract) {
|
|
56636
56667
|
throw new Error("Encountered interface type without __typename in the payload");
|
|
56637
56668
|
}
|
|
56638
|
-
if (!
|
|
56669
|
+
if (!this.isEmbedded(linkedType, entry)) {
|
|
56639
56670
|
const id = this.id(innerType, entry);
|
|
56640
56671
|
if (id) {
|
|
56641
56672
|
linkedID = id;
|
|
@@ -57343,7 +57374,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
57343
57374
|
|
|
57344
57375
|
// src/codegen/generators/artifacts/index.ts
|
|
57345
57376
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
57346
|
-
var
|
|
57377
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
57347
57378
|
|
|
57348
57379
|
// src/codegen/utils/commonjs.ts
|
|
57349
57380
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -58530,7 +58561,6 @@ function ancestorKey(ancestors) {
|
|
|
58530
58561
|
|
|
58531
58562
|
// src/codegen/generators/artifacts/selection.ts
|
|
58532
58563
|
var graphql12 = __toESM(require_graphql2(), 1);
|
|
58533
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
58534
58564
|
|
|
58535
58565
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
58536
58566
|
var config = {
|
|
@@ -59477,15 +59507,12 @@ function fieldKey(config2, field) {
|
|
|
59477
59507
|
}
|
|
59478
59508
|
|
|
59479
59509
|
// src/codegen/generators/artifacts/selection.ts
|
|
59480
|
-
var AST5 = recast5.types.builders;
|
|
59481
59510
|
function selection_default(args) {
|
|
59482
|
-
const typeMap = {};
|
|
59483
|
-
const abstractTypes = [];
|
|
59484
59511
|
return mergeSelection({
|
|
59485
|
-
|
|
59486
|
-
|
|
59487
|
-
|
|
59488
|
-
|
|
59512
|
+
config: args.config,
|
|
59513
|
+
rootType: args.rootType,
|
|
59514
|
+
object: prepareSelection(args),
|
|
59515
|
+
filepath: args.filepath
|
|
59489
59516
|
});
|
|
59490
59517
|
}
|
|
59491
59518
|
function prepareSelection({
|
|
@@ -59497,8 +59524,6 @@ function prepareSelection({
|
|
|
59497
59524
|
path: path2 = [],
|
|
59498
59525
|
document,
|
|
59499
59526
|
inConnection,
|
|
59500
|
-
typeMap,
|
|
59501
|
-
abstractTypes,
|
|
59502
59527
|
globalLoading,
|
|
59503
59528
|
includeFragments
|
|
59504
59529
|
}) {
|
|
@@ -59518,8 +59543,6 @@ function prepareSelection({
|
|
|
59518
59543
|
selections: field.selectionSet.selections,
|
|
59519
59544
|
path: path2,
|
|
59520
59545
|
document,
|
|
59521
|
-
typeMap,
|
|
59522
|
-
abstractTypes,
|
|
59523
59546
|
globalLoading,
|
|
59524
59547
|
includeFragments
|
|
59525
59548
|
}).fields || {}
|
|
@@ -59531,32 +59554,7 @@ function prepareSelection({
|
|
|
59531
59554
|
typeMap: {}
|
|
59532
59555
|
};
|
|
59533
59556
|
}
|
|
59534
|
-
const parentType = config2.schema.getType(rootType);
|
|
59535
59557
|
const typeConditionName = field.typeCondition.name.value;
|
|
59536
|
-
const typeCondition = config2.schema.getType(typeConditionName);
|
|
59537
|
-
const possibleTypes = [];
|
|
59538
|
-
if (!graphql12.isAbstractType(typeCondition)) {
|
|
59539
|
-
} else if (graphql12.isAbstractType(parentType)) {
|
|
59540
|
-
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
59541
|
-
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
59542
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
59543
|
-
possibleTypes.push(possible.name);
|
|
59544
|
-
}
|
|
59545
|
-
}
|
|
59546
|
-
} else {
|
|
59547
|
-
possibleTypes.push(rootType);
|
|
59548
|
-
}
|
|
59549
|
-
if (possibleTypes.length > 0) {
|
|
59550
|
-
for (const type of possibleTypes) {
|
|
59551
|
-
const existing = typeMap[type];
|
|
59552
|
-
if (!existing || !existing.includes(type)) {
|
|
59553
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
59554
|
-
}
|
|
59555
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
59556
|
-
abstractTypes.push(typeConditionName);
|
|
59557
|
-
}
|
|
59558
|
-
}
|
|
59559
|
-
}
|
|
59560
59558
|
object.abstractFields.fields = {
|
|
59561
59559
|
...object.abstractFields.fields,
|
|
59562
59560
|
[typeConditionName]: prepareSelection({
|
|
@@ -59567,8 +59565,6 @@ function prepareSelection({
|
|
|
59567
59565
|
selections: field.selectionSet.selections,
|
|
59568
59566
|
path: path2,
|
|
59569
59567
|
document,
|
|
59570
|
-
typeMap,
|
|
59571
|
-
abstractTypes,
|
|
59572
59568
|
globalLoading,
|
|
59573
59569
|
includeFragments
|
|
59574
59570
|
}).fields
|
|
@@ -59580,19 +59576,38 @@ function prepareSelection({
|
|
|
59580
59576
|
} else if (field.kind === "Field") {
|
|
59581
59577
|
const type = config2.schema.getType(rootType);
|
|
59582
59578
|
if (!type) {
|
|
59583
|
-
throw new HoudiniError({
|
|
59579
|
+
throw new HoudiniError({
|
|
59580
|
+
filepath,
|
|
59581
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
59582
|
+
});
|
|
59584
59583
|
}
|
|
59585
59584
|
const attributeName = field.alias?.value || field.name.value;
|
|
59586
|
-
let fieldType;
|
|
59585
|
+
let fieldType = null;
|
|
59587
59586
|
let nullable = false;
|
|
59588
59587
|
if (field.name.value === "__typename") {
|
|
59589
59588
|
fieldType = config2.schema.getType("String");
|
|
59590
|
-
} else {
|
|
59589
|
+
} else if ("getFields" in type) {
|
|
59591
59590
|
let typeRef = type.getFields()[field.name.value].type;
|
|
59592
59591
|
fieldType = getRootType(typeRef);
|
|
59593
59592
|
nullable = !graphql12.isNonNullType(typeRef);
|
|
59593
|
+
} else if (graphql12.isAbstractType(type)) {
|
|
59594
|
+
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
59595
|
+
if (graphql12.isObjectType(possible)) {
|
|
59596
|
+
if (possible.getFields()[field.name.value]) {
|
|
59597
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
59598
|
+
nullable = !graphql12.isNonNullType(fieldType);
|
|
59599
|
+
break;
|
|
59600
|
+
}
|
|
59601
|
+
}
|
|
59602
|
+
}
|
|
59603
|
+
}
|
|
59604
|
+
if (!fieldType) {
|
|
59605
|
+
throw {
|
|
59606
|
+
message: "Could not identify field's type",
|
|
59607
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
59608
|
+
};
|
|
59594
59609
|
}
|
|
59595
|
-
const typeName = fieldType.
|
|
59610
|
+
const typeName = getRootType(fieldType).name;
|
|
59596
59611
|
const pathSoFar = path2.concat(attributeName);
|
|
59597
59612
|
const keys2 = config2.keyFieldsForType(rootType);
|
|
59598
59613
|
let fieldObj = {
|
|
@@ -59686,8 +59701,6 @@ function prepareSelection({
|
|
|
59686
59701
|
path: pathSoFar,
|
|
59687
59702
|
document,
|
|
59688
59703
|
inConnection: connectionState,
|
|
59689
|
-
typeMap,
|
|
59690
|
-
abstractTypes,
|
|
59691
59704
|
globalLoading: forceLoading,
|
|
59692
59705
|
includeFragments
|
|
59693
59706
|
});
|
|
@@ -59773,69 +59786,107 @@ function prepareSelection({
|
|
|
59773
59786
|
return object;
|
|
59774
59787
|
}
|
|
59775
59788
|
function mergeSelection({
|
|
59789
|
+
config: config2,
|
|
59776
59790
|
filepath,
|
|
59777
59791
|
object,
|
|
59778
|
-
|
|
59779
|
-
abstractTypes
|
|
59792
|
+
rootType
|
|
59780
59793
|
}) {
|
|
59781
59794
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
59782
|
-
|
|
59783
|
-
|
|
59795
|
+
const abstractSelection = {
|
|
59796
|
+
fields: {},
|
|
59797
|
+
typeMap: {}
|
|
59798
|
+
};
|
|
59799
|
+
const possibleSelectionTypes = {};
|
|
59800
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
59801
|
+
const gqlType = config2.schema.getType(typeName);
|
|
59802
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
59803
|
+
filepath,
|
|
59804
|
+
typeSelection,
|
|
59805
|
+
abstractSelection.fields[typeName] ?? {}
|
|
59806
|
+
);
|
|
59807
|
+
if (graphql12.isAbstractType(gqlType)) {
|
|
59808
|
+
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
59809
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
59810
|
+
possibleSelectionTypes[typeName] = [];
|
|
59811
|
+
}
|
|
59812
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
59813
|
+
}
|
|
59814
|
+
}
|
|
59815
|
+
}
|
|
59816
|
+
const concreteSelectionImplements = {};
|
|
59817
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59818
|
+
for (const possible of possibles) {
|
|
59819
|
+
if (!concreteSelectionImplements[possible]) {
|
|
59820
|
+
concreteSelectionImplements[possible] = [];
|
|
59821
|
+
}
|
|
59822
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
59823
|
+
}
|
|
59824
|
+
}
|
|
59825
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
59826
|
+
if (implementations.length > 1) {
|
|
59827
|
+
abstractSelection.fields[concrete] = {};
|
|
59828
|
+
}
|
|
59829
|
+
}
|
|
59830
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59784
59831
|
for (const possible of possibles) {
|
|
59785
|
-
if (
|
|
59786
|
-
|
|
59832
|
+
if (abstractSelection.fields[possible]) {
|
|
59833
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
59787
59834
|
filepath,
|
|
59788
|
-
|
|
59789
|
-
|
|
59835
|
+
abstractSelection.fields[typeName] ?? {},
|
|
59836
|
+
abstractSelection.fields[possible] ?? {}
|
|
59790
59837
|
);
|
|
59791
|
-
overlap = true;
|
|
59792
59838
|
}
|
|
59793
59839
|
}
|
|
59794
|
-
if (overlap) {
|
|
59795
|
-
delete typeMap[typeName];
|
|
59796
|
-
}
|
|
59797
59840
|
}
|
|
59798
|
-
|
|
59799
|
-
|
|
59800
|
-
|
|
59801
|
-
|
|
59802
|
-
|
|
59803
|
-
);
|
|
59804
|
-
delete typeMap[type];
|
|
59841
|
+
const parentType = config2.schema.getType(rootType);
|
|
59842
|
+
const possibleParents = graphql12.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t) => t.name) : [parentType.name];
|
|
59843
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
59844
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
59845
|
+
delete abstractSelection.typeMap[key];
|
|
59805
59846
|
}
|
|
59806
59847
|
}
|
|
59807
|
-
for (const [type, sel] of Object.entries(
|
|
59808
|
-
|
|
59848
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
59849
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
59809
59850
|
}
|
|
59810
|
-
for (const [
|
|
59811
|
-
|
|
59851
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59852
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
59853
|
+
delete abstractSelection.fields[typename];
|
|
59854
|
+
}
|
|
59812
59855
|
}
|
|
59813
|
-
const
|
|
59814
|
-
|
|
59815
|
-
|
|
59816
|
-
|
|
59856
|
+
for (const possible of possibleParents) {
|
|
59857
|
+
if (abstractSelection.fields[possible]) {
|
|
59858
|
+
continue;
|
|
59859
|
+
}
|
|
59860
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
59861
|
+
possibleSelectionTypes
|
|
59862
|
+
)) {
|
|
59863
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
59864
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
59865
|
+
break;
|
|
59866
|
+
}
|
|
59817
59867
|
}
|
|
59818
59868
|
}
|
|
59869
|
+
object.abstractFields = abstractSelection;
|
|
59819
59870
|
}
|
|
59820
|
-
for (const
|
|
59871
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
59821
59872
|
const selection = value.selection;
|
|
59822
59873
|
if (selection) {
|
|
59823
59874
|
mergeSelection({
|
|
59875
|
+
config: config2,
|
|
59876
|
+
rootType: value.type,
|
|
59824
59877
|
filepath,
|
|
59825
|
-
typeMap,
|
|
59826
|
-
abstractTypes,
|
|
59827
59878
|
object: selection
|
|
59828
59879
|
});
|
|
59829
59880
|
}
|
|
59830
59881
|
}
|
|
59831
59882
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
59832
|
-
for (const
|
|
59883
|
+
for (const value of Object.values(selection ?? {})) {
|
|
59833
59884
|
const selection2 = value.selection;
|
|
59834
59885
|
if (selection2) {
|
|
59835
59886
|
mergeSelection({
|
|
59887
|
+
config: config2,
|
|
59888
|
+
rootType: value.type,
|
|
59836
59889
|
filepath,
|
|
59837
|
-
typeMap,
|
|
59838
|
-
abstractTypes,
|
|
59839
59890
|
object: selection2
|
|
59840
59891
|
});
|
|
59841
59892
|
}
|
|
@@ -59845,7 +59896,7 @@ function mergeSelection({
|
|
|
59845
59896
|
}
|
|
59846
59897
|
|
|
59847
59898
|
// src/codegen/generators/artifacts/index.ts
|
|
59848
|
-
var
|
|
59899
|
+
var AST5 = recast5.types.builders;
|
|
59849
59900
|
function artifactGenerator(stats) {
|
|
59850
59901
|
return async function(config2, docs) {
|
|
59851
59902
|
const filterTypes = {};
|
|
@@ -60113,10 +60164,10 @@ function artifactGenerator(stats) {
|
|
|
60113
60164
|
}
|
|
60114
60165
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
60115
60166
|
}
|
|
60116
|
-
const file =
|
|
60167
|
+
const file = AST5.program([
|
|
60117
60168
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
60118
|
-
|
|
60119
|
-
|
|
60169
|
+
AST5.expressionStatement(
|
|
60170
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
60120
60171
|
)
|
|
60121
60172
|
]);
|
|
60122
60173
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -60196,8 +60247,8 @@ function applyMask(config2, target, mask) {
|
|
|
60196
60247
|
}
|
|
60197
60248
|
|
|
60198
60249
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
60199
|
-
var
|
|
60200
|
-
var
|
|
60250
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
60251
|
+
var AST6 = recast6.types.builders;
|
|
60201
60252
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
60202
60253
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
60203
60254
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -60232,18 +60283,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
60232
60283
|
continue;
|
|
60233
60284
|
}
|
|
60234
60285
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
60235
|
-
const input =
|
|
60236
|
-
input.typeAnnotation =
|
|
60237
|
-
|
|
60286
|
+
const input = AST6.identifier("str");
|
|
60287
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
60288
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
60238
60289
|
);
|
|
60239
60290
|
script.body.splice(
|
|
60240
60291
|
i,
|
|
60241
60292
|
0,
|
|
60242
|
-
|
|
60243
|
-
|
|
60244
|
-
|
|
60293
|
+
AST6.exportNamedDeclaration(
|
|
60294
|
+
AST6.tsDeclareFunction(
|
|
60295
|
+
AST6.identifier("graphql"),
|
|
60245
60296
|
[input],
|
|
60246
|
-
|
|
60297
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
60247
60298
|
)
|
|
60248
60299
|
)
|
|
60249
60300
|
);
|
|
@@ -60406,20 +60457,20 @@ async function generatePluginRuntime({
|
|
|
60406
60457
|
}
|
|
60407
60458
|
|
|
60408
60459
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60409
|
-
var
|
|
60460
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
60410
60461
|
|
|
60411
60462
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60412
60463
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
60413
|
-
var
|
|
60464
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
60414
60465
|
|
|
60415
60466
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60416
60467
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
60417
|
-
var
|
|
60468
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
60418
60469
|
|
|
60419
60470
|
// src/codegen/generators/typescript/types.ts
|
|
60420
60471
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
60421
|
-
var
|
|
60422
|
-
var
|
|
60472
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
60473
|
+
var AST7 = recast7.types.builders;
|
|
60423
60474
|
function readonlyProperty(prop, enable = true) {
|
|
60424
60475
|
if (enable) {
|
|
60425
60476
|
prop.readonly = true;
|
|
@@ -60427,28 +60478,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
60427
60478
|
return prop;
|
|
60428
60479
|
}
|
|
60429
60480
|
function nullableField(inner, input = false) {
|
|
60430
|
-
const members = [inner,
|
|
60481
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
60431
60482
|
if (input) {
|
|
60432
|
-
members.push(
|
|
60483
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
60433
60484
|
}
|
|
60434
|
-
return
|
|
60485
|
+
return AST7.tsUnionType(members);
|
|
60435
60486
|
}
|
|
60436
60487
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
60437
60488
|
switch (target.name) {
|
|
60438
60489
|
case "String": {
|
|
60439
|
-
return
|
|
60490
|
+
return AST7.tsStringKeyword();
|
|
60440
60491
|
}
|
|
60441
60492
|
case "Int": {
|
|
60442
|
-
return
|
|
60493
|
+
return AST7.tsNumberKeyword();
|
|
60443
60494
|
}
|
|
60444
60495
|
case "Float": {
|
|
60445
|
-
return
|
|
60496
|
+
return AST7.tsNumberKeyword();
|
|
60446
60497
|
}
|
|
60447
60498
|
case "Boolean": {
|
|
60448
|
-
return
|
|
60499
|
+
return AST7.tsBooleanKeyword();
|
|
60449
60500
|
}
|
|
60450
60501
|
case "ID": {
|
|
60451
|
-
return
|
|
60502
|
+
return AST7.tsStringKeyword();
|
|
60452
60503
|
}
|
|
60453
60504
|
default: {
|
|
60454
60505
|
if (graphql14.isNonNullType(target) && "ofType" in target) {
|
|
@@ -60459,16 +60510,16 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
60459
60510
|
);
|
|
60460
60511
|
}
|
|
60461
60512
|
if (config2.scalars?.[target.name]) {
|
|
60462
|
-
return
|
|
60513
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
60463
60514
|
}
|
|
60464
60515
|
missingScalars.add(target.name);
|
|
60465
|
-
return
|
|
60516
|
+
return AST7.tsAnyKeyword();
|
|
60466
60517
|
}
|
|
60467
60518
|
}
|
|
60468
60519
|
}
|
|
60469
60520
|
|
|
60470
60521
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60471
|
-
var
|
|
60522
|
+
var AST8 = recast8.types.builders;
|
|
60472
60523
|
function tsTypeReference(config2, missingScalars, definition, body) {
|
|
60473
60524
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
60474
60525
|
let result;
|
|
@@ -60477,7 +60528,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60477
60528
|
} else if (graphql15.isEnumType(type)) {
|
|
60478
60529
|
result = enumReference(config2, body, type.name);
|
|
60479
60530
|
} else {
|
|
60480
|
-
result =
|
|
60531
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
60481
60532
|
}
|
|
60482
60533
|
for (const toWrap of wrappers) {
|
|
60483
60534
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -60485,7 +60536,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60485
60536
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
60486
60537
|
result = nullableField(result, true);
|
|
60487
60538
|
} else if (toWrap === "List" /* List */) {
|
|
60488
|
-
result =
|
|
60539
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
60489
60540
|
}
|
|
60490
60541
|
}
|
|
60491
60542
|
return result;
|
|
@@ -60498,14 +60549,14 @@ function enumReference(config2, body, name) {
|
|
|
60498
60549
|
importKind: "type",
|
|
60499
60550
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60500
60551
|
});
|
|
60501
|
-
return
|
|
60502
|
-
|
|
60503
|
-
|
|
60552
|
+
return AST8.tsTypeReference(
|
|
60553
|
+
AST8.identifier("ValueOf"),
|
|
60554
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
60504
60555
|
);
|
|
60505
60556
|
}
|
|
60506
60557
|
|
|
60507
60558
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60508
|
-
var
|
|
60559
|
+
var AST9 = recast9.types.builders;
|
|
60509
60560
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
60510
60561
|
const { type } = unwrapType(config2, rootType);
|
|
60511
60562
|
if (graphql16.isScalarType(type)) {
|
|
@@ -60532,20 +60583,20 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
60532
60583
|
for (const field of Object.values(type.getFields())) {
|
|
60533
60584
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
60534
60585
|
members.push(
|
|
60535
|
-
|
|
60536
|
-
|
|
60537
|
-
|
|
60586
|
+
AST9.tsPropertySignature(
|
|
60587
|
+
AST9.identifier(field.name),
|
|
60588
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field, body)),
|
|
60538
60589
|
graphql16.isNullableType(field.type)
|
|
60539
60590
|
)
|
|
60540
60591
|
);
|
|
60541
60592
|
}
|
|
60542
|
-
body.push(
|
|
60593
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
60543
60594
|
}
|
|
60544
60595
|
|
|
60545
60596
|
// src/codegen/generators/typescript/inlineType.ts
|
|
60546
60597
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
60547
|
-
var
|
|
60548
|
-
var
|
|
60598
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
60599
|
+
var AST10 = recast10.types.builders;
|
|
60549
60600
|
var fragmentKey2 = " $fragments";
|
|
60550
60601
|
function inlineType({
|
|
60551
60602
|
config: config2,
|
|
@@ -60643,7 +60694,7 @@ function inlineType({
|
|
|
60643
60694
|
{}
|
|
60644
60695
|
)
|
|
60645
60696
|
);
|
|
60646
|
-
result =
|
|
60697
|
+
result = AST10.tsTypeLiteral([
|
|
60647
60698
|
...fields.map((selection) => {
|
|
60648
60699
|
const { field } = selectionTypeInfo(config2.schema, filepath, rootObj, selection);
|
|
60649
60700
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -60671,12 +60722,12 @@ function inlineType({
|
|
|
60671
60722
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
60672
60723
|
).length > 0;
|
|
60673
60724
|
if (hasIncludeOrSkipDirective) {
|
|
60674
|
-
attributeType =
|
|
60725
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
60675
60726
|
}
|
|
60676
60727
|
const prop = readonlyProperty(
|
|
60677
|
-
|
|
60678
|
-
|
|
60679
|
-
|
|
60728
|
+
AST10.tsPropertySignature(
|
|
60729
|
+
AST10.identifier(attributeName),
|
|
60730
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
60680
60731
|
),
|
|
60681
60732
|
allowReadonly
|
|
60682
60733
|
);
|
|
@@ -60690,14 +60741,14 @@ function inlineType({
|
|
|
60690
60741
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
60691
60742
|
result.members.push(
|
|
60692
60743
|
readonlyProperty(
|
|
60693
|
-
|
|
60694
|
-
|
|
60695
|
-
|
|
60696
|
-
|
|
60744
|
+
AST10.tsPropertySignature(
|
|
60745
|
+
AST10.stringLiteral(fragmentKey2),
|
|
60746
|
+
AST10.tsTypeAnnotation(
|
|
60747
|
+
AST10.tsTypeLiteral(
|
|
60697
60748
|
(fragmentSpreads || []).map(
|
|
60698
|
-
(fragmentSpread) =>
|
|
60699
|
-
|
|
60700
|
-
|
|
60749
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
60750
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
60751
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
60701
60752
|
)
|
|
60702
60753
|
)
|
|
60703
60754
|
)
|
|
@@ -60742,9 +60793,9 @@ function inlineType({
|
|
|
60742
60793
|
}
|
|
60743
60794
|
objectType.members.push(
|
|
60744
60795
|
readonlyProperty(
|
|
60745
|
-
|
|
60746
|
-
|
|
60747
|
-
|
|
60796
|
+
AST10.tsPropertySignature(
|
|
60797
|
+
AST10.identifier("__typename"),
|
|
60798
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
60748
60799
|
),
|
|
60749
60800
|
allowReadonly
|
|
60750
60801
|
)
|
|
@@ -60784,8 +60835,8 @@ function inlineType({
|
|
|
60784
60835
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
60785
60836
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
60786
60837
|
([typeName, { type: type2, tsType }]) => {
|
|
60787
|
-
return
|
|
60788
|
-
|
|
60838
|
+
return AST10.tsParenthesizedType(
|
|
60839
|
+
AST10.tsIntersectionType(
|
|
60789
60840
|
[tsType].flatMap((type3) => {
|
|
60790
60841
|
if (type3.type === "TSUnionType") {
|
|
60791
60842
|
return type3.types.filter(
|
|
@@ -60811,14 +60862,14 @@ function inlineType({
|
|
|
60811
60862
|
);
|
|
60812
60863
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
60813
60864
|
selectionTypes.push(
|
|
60814
|
-
|
|
60815
|
-
|
|
60865
|
+
AST10.tsParenthesizedType(
|
|
60866
|
+
AST10.tsTypeLiteral([
|
|
60816
60867
|
readonlyProperty(
|
|
60817
|
-
|
|
60818
|
-
|
|
60819
|
-
|
|
60820
|
-
|
|
60821
|
-
|
|
60868
|
+
AST10.tsPropertySignature(
|
|
60869
|
+
AST10.identifier("__typename"),
|
|
60870
|
+
AST10.tsTypeAnnotation(
|
|
60871
|
+
AST10.tsLiteralType(
|
|
60872
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
60822
60873
|
)
|
|
60823
60874
|
)
|
|
60824
60875
|
),
|
|
@@ -60828,9 +60879,9 @@ function inlineType({
|
|
|
60828
60879
|
)
|
|
60829
60880
|
);
|
|
60830
60881
|
}
|
|
60831
|
-
result =
|
|
60882
|
+
result = AST10.tsIntersectionType([
|
|
60832
60883
|
result,
|
|
60833
|
-
|
|
60884
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
60834
60885
|
]);
|
|
60835
60886
|
}
|
|
60836
60887
|
} else {
|
|
@@ -60848,7 +60899,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
60848
60899
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
60849
60900
|
continue;
|
|
60850
60901
|
} else if (toWrap === "List" /* List */) {
|
|
60851
|
-
result =
|
|
60902
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
60852
60903
|
}
|
|
60853
60904
|
}
|
|
60854
60905
|
return result;
|
|
@@ -60893,13 +60944,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
60893
60944
|
}
|
|
60894
60945
|
|
|
60895
60946
|
// src/codegen/generators/typescript/loadingState.ts
|
|
60896
|
-
var
|
|
60897
|
-
var
|
|
60947
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
60948
|
+
var AST11 = recast11.types.builders;
|
|
60898
60949
|
function withLoadingState(args) {
|
|
60899
60950
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
60900
60951
|
return args.base;
|
|
60901
60952
|
}
|
|
60902
|
-
return
|
|
60953
|
+
return AST11.tsUnionType([
|
|
60903
60954
|
args.base,
|
|
60904
60955
|
loadingState({
|
|
60905
60956
|
parentType: args.document.artifact.rootType,
|
|
@@ -60918,7 +60969,7 @@ function loadingState(args) {
|
|
|
60918
60969
|
import: ["LoadingType"],
|
|
60919
60970
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60920
60971
|
});
|
|
60921
|
-
const result =
|
|
60972
|
+
const result = AST11.tsTypeLiteral(
|
|
60922
60973
|
Object.entries(selection).reduce(
|
|
60923
60974
|
(rest, [attributeName, value]) => {
|
|
60924
60975
|
if (!value.loading) {
|
|
@@ -60926,7 +60977,7 @@ function loadingState(args) {
|
|
|
60926
60977
|
}
|
|
60927
60978
|
let keyType = null;
|
|
60928
60979
|
if (value.loading.kind === "value") {
|
|
60929
|
-
keyType =
|
|
60980
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
60930
60981
|
}
|
|
60931
60982
|
if (value.loading.kind === "continue" && value.selection) {
|
|
60932
60983
|
keyType = loadingState({
|
|
@@ -60942,15 +60993,15 @@ function loadingState(args) {
|
|
|
60942
60993
|
}
|
|
60943
60994
|
if (value.loading.list) {
|
|
60944
60995
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
60945
|
-
keyType =
|
|
60996
|
+
keyType = AST11.tsArrayType(keyType);
|
|
60946
60997
|
}
|
|
60947
60998
|
}
|
|
60948
60999
|
return [
|
|
60949
61000
|
...rest,
|
|
60950
61001
|
readonlyProperty(
|
|
60951
|
-
|
|
60952
|
-
|
|
60953
|
-
|
|
61002
|
+
AST11.tsPropertySignature(
|
|
61003
|
+
AST11.identifier(attributeName),
|
|
61004
|
+
AST11.tsTypeAnnotation(keyType)
|
|
60954
61005
|
)
|
|
60955
61006
|
)
|
|
60956
61007
|
];
|
|
@@ -60961,14 +61012,14 @@ function loadingState(args) {
|
|
|
60961
61012
|
if (args.selection.fragments) {
|
|
60962
61013
|
result.members.push(
|
|
60963
61014
|
readonlyProperty(
|
|
60964
|
-
|
|
60965
|
-
|
|
60966
|
-
|
|
60967
|
-
|
|
61015
|
+
AST11.tsPropertySignature(
|
|
61016
|
+
AST11.stringLiteral(fragmentKey),
|
|
61017
|
+
AST11.tsTypeAnnotation(
|
|
61018
|
+
AST11.tsTypeLiteral(
|
|
60968
61019
|
Object.keys(args.selection.fragments).map((name) => {
|
|
60969
|
-
return
|
|
60970
|
-
|
|
60971
|
-
|
|
61020
|
+
return AST11.tsPropertySignature(
|
|
61021
|
+
AST11.identifier(name),
|
|
61022
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
60972
61023
|
);
|
|
60973
61024
|
})
|
|
60974
61025
|
)
|
|
@@ -60981,7 +61032,7 @@ function loadingState(args) {
|
|
|
60981
61032
|
}
|
|
60982
61033
|
|
|
60983
61034
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60984
|
-
var
|
|
61035
|
+
var AST12 = recast12.types.builders;
|
|
60985
61036
|
async function generateDocumentTypes(config2, docs) {
|
|
60986
61037
|
const typePaths = [];
|
|
60987
61038
|
const fragmentDefinitions = {};
|
|
@@ -61006,7 +61057,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61006
61057
|
return;
|
|
61007
61058
|
}
|
|
61008
61059
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
61009
|
-
const program =
|
|
61060
|
+
const program = AST12.program([]);
|
|
61010
61061
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61011
61062
|
let definition = originalDocument.definitions.find(
|
|
61012
61063
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -61042,9 +61093,9 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61042
61093
|
);
|
|
61043
61094
|
}
|
|
61044
61095
|
program.body.push(
|
|
61045
|
-
|
|
61046
|
-
|
|
61047
|
-
|
|
61096
|
+
AST12.exportNamedDeclaration(
|
|
61097
|
+
AST12.tsTypeAliasDeclaration(
|
|
61098
|
+
AST12.identifier(`${name}$artifact`),
|
|
61048
61099
|
convertToTs(serializeValue(artifact))
|
|
61049
61100
|
)
|
|
61050
61101
|
)
|
|
@@ -61054,17 +61105,17 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61054
61105
|
typePaths.push(typeDefPath);
|
|
61055
61106
|
})
|
|
61056
61107
|
);
|
|
61057
|
-
const typeIndex =
|
|
61108
|
+
const typeIndex = AST12.program(
|
|
61058
61109
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
61059
|
-
return
|
|
61060
|
-
|
|
61110
|
+
return AST12.exportAllDeclaration(
|
|
61111
|
+
AST12.literal(
|
|
61061
61112
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
61062
61113
|
),
|
|
61063
61114
|
null
|
|
61064
61115
|
);
|
|
61065
61116
|
}).concat([
|
|
61066
|
-
|
|
61067
|
-
|
|
61117
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
61118
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
61068
61119
|
])
|
|
61069
61120
|
);
|
|
61070
61121
|
const exportDefaultAs = ({ module, as }) => `
|
|
@@ -61119,7 +61170,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
61119
61170
|
}
|
|
61120
61171
|
function convertToTs(source) {
|
|
61121
61172
|
if (source.type === "ObjectExpression") {
|
|
61122
|
-
return
|
|
61173
|
+
return AST12.tsTypeLiteral(
|
|
61123
61174
|
source.properties.reduce(
|
|
61124
61175
|
(props, prop) => {
|
|
61125
61176
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -61127,9 +61178,9 @@ function convertToTs(source) {
|
|
|
61127
61178
|
}
|
|
61128
61179
|
return [
|
|
61129
61180
|
...props,
|
|
61130
|
-
|
|
61181
|
+
AST12.tsPropertySignature(
|
|
61131
61182
|
prop.key,
|
|
61132
|
-
|
|
61183
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
61133
61184
|
)
|
|
61134
61185
|
];
|
|
61135
61186
|
},
|
|
@@ -61138,20 +61189,20 @@ function convertToTs(source) {
|
|
|
61138
61189
|
);
|
|
61139
61190
|
}
|
|
61140
61191
|
if (source.type === "ArrayExpression") {
|
|
61141
|
-
return
|
|
61192
|
+
return AST12.tsTupleType(
|
|
61142
61193
|
source.elements.map((element) => convertToTs(element))
|
|
61143
61194
|
);
|
|
61144
61195
|
}
|
|
61145
61196
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
61146
|
-
return
|
|
61197
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
61147
61198
|
}
|
|
61148
61199
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
61149
|
-
return
|
|
61200
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
61150
61201
|
}
|
|
61151
61202
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
61152
|
-
return
|
|
61203
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
61153
61204
|
}
|
|
61154
|
-
return
|
|
61205
|
+
return AST12.tsLiteralType(source);
|
|
61155
61206
|
}
|
|
61156
61207
|
async function generateOperationTypeDefs(config2, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
61157
61208
|
let parentType = null;
|
|
@@ -61190,23 +61241,23 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61190
61241
|
});
|
|
61191
61242
|
}
|
|
61192
61243
|
body.push(
|
|
61193
|
-
|
|
61194
|
-
|
|
61195
|
-
|
|
61196
|
-
|
|
61244
|
+
AST12.exportNamedDeclaration(
|
|
61245
|
+
AST12.tsTypeAliasDeclaration(
|
|
61246
|
+
AST12.identifier(definition.name.value),
|
|
61247
|
+
AST12.tsTypeLiteral([
|
|
61197
61248
|
readonlyProperty(
|
|
61198
|
-
|
|
61199
|
-
|
|
61200
|
-
|
|
61249
|
+
AST12.tsPropertySignature(
|
|
61250
|
+
AST12.stringLiteral("input"),
|
|
61251
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
61201
61252
|
)
|
|
61202
61253
|
),
|
|
61203
61254
|
readonlyProperty(
|
|
61204
|
-
|
|
61205
|
-
|
|
61206
|
-
|
|
61207
|
-
definition.operation === "mutation" ?
|
|
61208
|
-
|
|
61209
|
-
|
|
61255
|
+
AST12.tsPropertySignature(
|
|
61256
|
+
AST12.stringLiteral("result"),
|
|
61257
|
+
AST12.tsTypeAnnotation(
|
|
61258
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
61259
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
61260
|
+
AST12.tsUndefinedKeyword()
|
|
61210
61261
|
])
|
|
61211
61262
|
)
|
|
61212
61263
|
)
|
|
@@ -61214,8 +61265,8 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61214
61265
|
])
|
|
61215
61266
|
)
|
|
61216
61267
|
),
|
|
61217
|
-
|
|
61218
|
-
|
|
61268
|
+
AST12.exportNamedDeclaration(
|
|
61269
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
61219
61270
|
)
|
|
61220
61271
|
);
|
|
61221
61272
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -61230,15 +61281,15 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61230
61281
|
);
|
|
61231
61282
|
}
|
|
61232
61283
|
body.push(
|
|
61233
|
-
|
|
61234
|
-
|
|
61235
|
-
|
|
61236
|
-
|
|
61284
|
+
AST12.exportNamedDeclaration(
|
|
61285
|
+
AST12.tsTypeAliasDeclaration(
|
|
61286
|
+
AST12.identifier(inputTypeName),
|
|
61287
|
+
AST12.tsTypeLiteral(
|
|
61237
61288
|
(definition.variableDefinitions || []).map(
|
|
61238
61289
|
(definition2) => {
|
|
61239
|
-
return
|
|
61240
|
-
|
|
61241
|
-
|
|
61290
|
+
return AST12.tsPropertySignature(
|
|
61291
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61292
|
+
AST12.tsTypeAnnotation(
|
|
61242
61293
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61243
61294
|
),
|
|
61244
61295
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61251,16 +61302,16 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61251
61302
|
);
|
|
61252
61303
|
} else {
|
|
61253
61304
|
body.push(
|
|
61254
|
-
|
|
61255
|
-
|
|
61305
|
+
AST12.exportNamedDeclaration(
|
|
61306
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
61256
61307
|
)
|
|
61257
61308
|
);
|
|
61258
61309
|
}
|
|
61259
61310
|
if (definition.operation === "mutation") {
|
|
61260
61311
|
body.push(
|
|
61261
|
-
|
|
61262
|
-
|
|
61263
|
-
|
|
61312
|
+
AST12.exportNamedDeclaration(
|
|
61313
|
+
AST12.tsTypeAliasDeclaration(
|
|
61314
|
+
AST12.identifier(optimisticTypeName),
|
|
61264
61315
|
inlineType({
|
|
61265
61316
|
config: config2,
|
|
61266
61317
|
filepath,
|
|
@@ -61294,12 +61345,12 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61294
61345
|
let directive = definition.directives?.find(
|
|
61295
61346
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61296
61347
|
);
|
|
61297
|
-
let inputValue = !directive ?
|
|
61348
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
61298
61349
|
(fragmentArgumentsDefinitions(config2, filepath, definition) || []).map(
|
|
61299
61350
|
(definition2) => {
|
|
61300
|
-
return
|
|
61301
|
-
|
|
61302
|
-
|
|
61351
|
+
return AST12.tsPropertySignature(
|
|
61352
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61353
|
+
AST12.tsTypeAnnotation(
|
|
61303
61354
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61304
61355
|
),
|
|
61305
61356
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61308,30 +61359,30 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61308
61359
|
)
|
|
61309
61360
|
);
|
|
61310
61361
|
body.push(
|
|
61311
|
-
|
|
61312
|
-
|
|
61362
|
+
AST12.exportNamedDeclaration(
|
|
61363
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
61313
61364
|
),
|
|
61314
|
-
|
|
61315
|
-
|
|
61316
|
-
|
|
61317
|
-
|
|
61365
|
+
AST12.exportNamedDeclaration(
|
|
61366
|
+
AST12.tsTypeAliasDeclaration(
|
|
61367
|
+
AST12.identifier(propTypeName),
|
|
61368
|
+
AST12.tsTypeLiteral([
|
|
61318
61369
|
readonlyProperty(
|
|
61319
|
-
|
|
61320
|
-
|
|
61321
|
-
|
|
61322
|
-
|
|
61370
|
+
AST12.tsPropertySignature(
|
|
61371
|
+
AST12.stringLiteral("shape"),
|
|
61372
|
+
AST12.tsTypeAnnotation(
|
|
61373
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
61323
61374
|
),
|
|
61324
61375
|
true
|
|
61325
61376
|
)
|
|
61326
61377
|
),
|
|
61327
61378
|
readonlyProperty(
|
|
61328
|
-
|
|
61329
|
-
|
|
61330
|
-
|
|
61331
|
-
|
|
61332
|
-
|
|
61333
|
-
|
|
61334
|
-
|
|
61379
|
+
AST12.tsPropertySignature(
|
|
61380
|
+
AST12.stringLiteral(fragmentKey2),
|
|
61381
|
+
AST12.tsTypeAnnotation(
|
|
61382
|
+
AST12.tsTypeLiteral([
|
|
61383
|
+
AST12.tsPropertySignature(
|
|
61384
|
+
AST12.stringLiteral(propTypeName),
|
|
61385
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
61335
61386
|
)
|
|
61336
61387
|
])
|
|
61337
61388
|
)
|
|
@@ -61340,9 +61391,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61340
61391
|
])
|
|
61341
61392
|
)
|
|
61342
61393
|
),
|
|
61343
|
-
|
|
61344
|
-
|
|
61345
|
-
|
|
61394
|
+
AST12.exportNamedDeclaration(
|
|
61395
|
+
AST12.tsTypeAliasDeclaration(
|
|
61396
|
+
AST12.identifier(shapeTypeName),
|
|
61346
61397
|
withLoadingState({
|
|
61347
61398
|
config: config2,
|
|
61348
61399
|
document,
|
|
@@ -61368,8 +61419,8 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61368
61419
|
|
|
61369
61420
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
61370
61421
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
61371
|
-
var
|
|
61372
|
-
var
|
|
61422
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
61423
|
+
var AST13 = recast13.types.builders;
|
|
61373
61424
|
async function imperativeCacheTypef(config2, docs) {
|
|
61374
61425
|
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
61375
61426
|
config: config2,
|
|
@@ -61385,87 +61436,87 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
61385
61436
|
}) ?? "any";
|
|
61386
61437
|
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
61387
61438
|
const body = [];
|
|
61388
|
-
const declaration =
|
|
61389
|
-
|
|
61390
|
-
|
|
61391
|
-
|
|
61392
|
-
|
|
61393
|
-
|
|
61439
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
61440
|
+
AST13.identifier(CacheTypeDefName),
|
|
61441
|
+
AST13.tsTypeLiteral([
|
|
61442
|
+
AST13.tsPropertySignature(
|
|
61443
|
+
AST13.identifier("types"),
|
|
61444
|
+
AST13.tsTypeAnnotation(typeDefinitions(config2, body, docs, returnType))
|
|
61394
61445
|
),
|
|
61395
|
-
|
|
61396
|
-
|
|
61397
|
-
|
|
61446
|
+
AST13.tsPropertySignature(
|
|
61447
|
+
AST13.identifier("lists"),
|
|
61448
|
+
AST13.tsTypeAnnotation(listDefinitions(config2, body, docs))
|
|
61398
61449
|
),
|
|
61399
|
-
|
|
61400
|
-
|
|
61401
|
-
|
|
61450
|
+
AST13.tsPropertySignature(
|
|
61451
|
+
AST13.identifier("queries"),
|
|
61452
|
+
AST13.tsTypeAnnotation(queryDefinitions(config2, body, docs, returnType))
|
|
61402
61453
|
)
|
|
61403
61454
|
])
|
|
61404
61455
|
);
|
|
61405
61456
|
declaration.declare = true;
|
|
61406
|
-
const importRecord =
|
|
61407
|
-
[
|
|
61408
|
-
|
|
61457
|
+
const importRecord = AST13.importDeclaration(
|
|
61458
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
61459
|
+
AST13.stringLiteral("./public/record")
|
|
61409
61460
|
);
|
|
61410
61461
|
importRecord.importKind = "type";
|
|
61411
61462
|
await fs_exports.writeFile(
|
|
61412
61463
|
target,
|
|
61413
|
-
|
|
61414
|
-
|
|
61464
|
+
recast13.prettyPrint(
|
|
61465
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
61415
61466
|
).code
|
|
61416
61467
|
);
|
|
61417
61468
|
}
|
|
61418
61469
|
function typeDefinitions(config2, body, docs, returnType) {
|
|
61419
61470
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
61420
61471
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61421
|
-
const
|
|
61472
|
+
const types15 = Object.values(config2.schema.getTypeMap()).filter(
|
|
61422
61473
|
(type) => !graphql18.isAbstractType(type) && !graphql18.isScalarType(type) && !graphql18.isEnumType(type) && !graphql18.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
61423
61474
|
);
|
|
61424
61475
|
const fragmentMap = fragmentListMap(
|
|
61425
61476
|
config2,
|
|
61426
|
-
|
|
61477
|
+
types15.map((type) => type.name),
|
|
61427
61478
|
body,
|
|
61428
61479
|
docs,
|
|
61429
61480
|
returnType
|
|
61430
61481
|
);
|
|
61431
|
-
return
|
|
61432
|
-
|
|
61482
|
+
return AST13.tsTypeLiteral(
|
|
61483
|
+
types15.map((type) => {
|
|
61433
61484
|
let typeName = type.name;
|
|
61434
61485
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
61435
61486
|
typeName = "__ROOT__";
|
|
61436
61487
|
}
|
|
61437
|
-
let idFields =
|
|
61488
|
+
let idFields = AST13.tsNeverKeyword();
|
|
61438
61489
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
61439
61490
|
if (graphql18.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
61440
|
-
idFields =
|
|
61491
|
+
idFields = AST13.tsTypeLiteral(
|
|
61441
61492
|
keys2.map((key) => {
|
|
61442
61493
|
const fieldType = type.getFields()[key];
|
|
61443
61494
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61444
|
-
return
|
|
61445
|
-
|
|
61446
|
-
|
|
61495
|
+
return AST13.tsPropertySignature(
|
|
61496
|
+
AST13.identifier(key),
|
|
61497
|
+
AST13.tsTypeAnnotation(
|
|
61447
61498
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61448
61499
|
)
|
|
61449
61500
|
);
|
|
61450
61501
|
})
|
|
61451
61502
|
);
|
|
61452
61503
|
} else if (typeName === "__ROOT__") {
|
|
61453
|
-
idFields =
|
|
61504
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
61454
61505
|
}
|
|
61455
|
-
let fields =
|
|
61506
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
61456
61507
|
if (graphql18.isObjectType(type)) {
|
|
61457
|
-
fields =
|
|
61508
|
+
fields = AST13.tsTypeLiteral(
|
|
61458
61509
|
Object.entries(type.getFields()).map(
|
|
61459
61510
|
([key, fieldType]) => {
|
|
61460
61511
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61461
|
-
let typeOptions =
|
|
61512
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
61462
61513
|
if (graphql18.isScalarType(unwrapped.type)) {
|
|
61463
61514
|
typeOptions.types.push(
|
|
61464
61515
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61465
61516
|
);
|
|
61466
61517
|
} else if (graphql18.isEnumType(unwrapped.type)) {
|
|
61467
61518
|
typeOptions.types.push(
|
|
61468
|
-
|
|
61519
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
61469
61520
|
);
|
|
61470
61521
|
} else if (!graphql18.isAbstractType(unwrapped.type)) {
|
|
61471
61522
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -61476,21 +61527,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61476
61527
|
}
|
|
61477
61528
|
for (const wrapper of unwrapped.wrappers) {
|
|
61478
61529
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
61479
|
-
typeOptions =
|
|
61480
|
-
|
|
61530
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
61531
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
61481
61532
|
);
|
|
61482
61533
|
} else if (wrapper === "List" /* List */) {
|
|
61483
|
-
typeOptions =
|
|
61484
|
-
|
|
61534
|
+
typeOptions = AST13.tsArrayType(
|
|
61535
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
61485
61536
|
);
|
|
61486
61537
|
}
|
|
61487
61538
|
}
|
|
61488
61539
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
61489
61540
|
typeOptions = typeOptions.typeAnnotation;
|
|
61490
61541
|
}
|
|
61491
|
-
let args =
|
|
61542
|
+
let args = AST13.tsNeverKeyword();
|
|
61492
61543
|
if (fieldType.args?.length > 0) {
|
|
61493
|
-
args =
|
|
61544
|
+
args = AST13.tsTypeLiteral(
|
|
61494
61545
|
fieldType.args.map((arg) => {
|
|
61495
61546
|
addReferencedInputTypes(
|
|
61496
61547
|
config2,
|
|
@@ -61500,9 +61551,9 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61500
61551
|
/* @__PURE__ */ new Set(),
|
|
61501
61552
|
arg.type
|
|
61502
61553
|
);
|
|
61503
|
-
const prop =
|
|
61504
|
-
|
|
61505
|
-
|
|
61554
|
+
const prop = AST13.tsPropertySignature(
|
|
61555
|
+
AST13.identifier(arg.name),
|
|
61556
|
+
AST13.tsTypeAnnotation(
|
|
61506
61557
|
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg, body)
|
|
61507
61558
|
)
|
|
61508
61559
|
);
|
|
@@ -61512,17 +61563,17 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61512
61563
|
})
|
|
61513
61564
|
);
|
|
61514
61565
|
}
|
|
61515
|
-
return
|
|
61516
|
-
|
|
61517
|
-
|
|
61518
|
-
|
|
61519
|
-
|
|
61520
|
-
|
|
61521
|
-
|
|
61566
|
+
return AST13.tsPropertySignature(
|
|
61567
|
+
AST13.identifier(key),
|
|
61568
|
+
AST13.tsTypeAnnotation(
|
|
61569
|
+
AST13.tsTypeLiteral([
|
|
61570
|
+
AST13.tsPropertySignature(
|
|
61571
|
+
AST13.identifier("type"),
|
|
61572
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
61522
61573
|
),
|
|
61523
|
-
|
|
61524
|
-
|
|
61525
|
-
|
|
61574
|
+
AST13.tsPropertySignature(
|
|
61575
|
+
AST13.identifier("args"),
|
|
61576
|
+
AST13.tsTypeAnnotation(args)
|
|
61526
61577
|
)
|
|
61527
61578
|
])
|
|
61528
61579
|
)
|
|
@@ -61531,21 +61582,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61531
61582
|
)
|
|
61532
61583
|
);
|
|
61533
61584
|
}
|
|
61534
|
-
return
|
|
61535
|
-
|
|
61536
|
-
|
|
61537
|
-
|
|
61538
|
-
|
|
61539
|
-
|
|
61540
|
-
|
|
61585
|
+
return AST13.tsPropertySignature(
|
|
61586
|
+
AST13.identifier(typeName),
|
|
61587
|
+
AST13.tsTypeAnnotation(
|
|
61588
|
+
AST13.tsTypeLiteral([
|
|
61589
|
+
AST13.tsPropertySignature(
|
|
61590
|
+
AST13.identifier("idFields"),
|
|
61591
|
+
AST13.tsTypeAnnotation(idFields)
|
|
61541
61592
|
),
|
|
61542
|
-
|
|
61543
|
-
|
|
61544
|
-
|
|
61593
|
+
AST13.tsPropertySignature(
|
|
61594
|
+
AST13.identifier("fields"),
|
|
61595
|
+
AST13.tsTypeAnnotation(fields)
|
|
61545
61596
|
),
|
|
61546
|
-
|
|
61547
|
-
|
|
61548
|
-
|
|
61597
|
+
AST13.tsPropertySignature(
|
|
61598
|
+
AST13.identifier("fragments"),
|
|
61599
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
61549
61600
|
)
|
|
61550
61601
|
])
|
|
61551
61602
|
)
|
|
@@ -61587,28 +61638,28 @@ function listDefinitions(config2, body, docs) {
|
|
|
61587
61638
|
possibleTypes.push(listType.name);
|
|
61588
61639
|
}
|
|
61589
61640
|
lists.push(
|
|
61590
|
-
|
|
61591
|
-
|
|
61592
|
-
|
|
61593
|
-
|
|
61594
|
-
|
|
61595
|
-
|
|
61596
|
-
|
|
61597
|
-
|
|
61641
|
+
AST13.tsPropertySignature(
|
|
61642
|
+
AST13.identifier(nameValue),
|
|
61643
|
+
AST13.tsTypeAnnotation(
|
|
61644
|
+
AST13.tsTypeLiteral([
|
|
61645
|
+
AST13.tsPropertySignature(
|
|
61646
|
+
AST13.identifier("types"),
|
|
61647
|
+
AST13.tsTypeAnnotation(
|
|
61648
|
+
AST13.tsUnionType(
|
|
61598
61649
|
possibleTypes.map(
|
|
61599
|
-
(possible) =>
|
|
61650
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
61600
61651
|
)
|
|
61601
61652
|
)
|
|
61602
61653
|
)
|
|
61603
61654
|
),
|
|
61604
|
-
|
|
61605
|
-
|
|
61606
|
-
|
|
61607
|
-
targetFieldDefinition.args.length === 0 ?
|
|
61655
|
+
AST13.tsPropertySignature(
|
|
61656
|
+
AST13.identifier("filters"),
|
|
61657
|
+
AST13.tsTypeAnnotation(
|
|
61658
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
61608
61659
|
targetFieldDefinition.args.map((arg) => {
|
|
61609
|
-
const argDef =
|
|
61610
|
-
|
|
61611
|
-
|
|
61660
|
+
const argDef = AST13.tsPropertySignature(
|
|
61661
|
+
AST13.identifier(arg.name),
|
|
61662
|
+
AST13.tsTypeAnnotation(
|
|
61612
61663
|
tsTypeReference(
|
|
61613
61664
|
config2,
|
|
61614
61665
|
/* @__PURE__ */ new Set(),
|
|
@@ -61630,10 +61681,10 @@ function listDefinitions(config2, body, docs) {
|
|
|
61630
61681
|
}
|
|
61631
61682
|
});
|
|
61632
61683
|
}
|
|
61633
|
-
return
|
|
61684
|
+
return AST13.tsTypeLiteral(lists);
|
|
61634
61685
|
}
|
|
61635
61686
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
61636
|
-
return
|
|
61687
|
+
return AST13.tsTupleType(
|
|
61637
61688
|
docs.reduce((prev, doc) => {
|
|
61638
61689
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
61639
61690
|
return prev;
|
|
@@ -61655,10 +61706,10 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
61655
61706
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
61656
61707
|
});
|
|
61657
61708
|
return prev.concat(
|
|
61658
|
-
|
|
61659
|
-
|
|
61660
|
-
|
|
61661
|
-
|
|
61709
|
+
AST13.tsTupleType([
|
|
61710
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
61711
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
61712
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
61662
61713
|
])
|
|
61663
61714
|
);
|
|
61664
61715
|
}, [])
|
|
@@ -61687,13 +61738,13 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61687
61738
|
),
|
|
61688
61739
|
import: [`${definition.name.value}$data`]
|
|
61689
61740
|
});
|
|
61690
|
-
let inputType =
|
|
61741
|
+
let inputType = AST13.tsNeverKeyword();
|
|
61691
61742
|
let directive = definition.directives?.find(
|
|
61692
61743
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61693
61744
|
);
|
|
61694
61745
|
if (directive) {
|
|
61695
|
-
inputType =
|
|
61696
|
-
|
|
61746
|
+
inputType = AST13.tsTypeReference(
|
|
61747
|
+
AST13.identifier(
|
|
61697
61748
|
ensureImports({
|
|
61698
61749
|
config: config2,
|
|
61699
61750
|
body,
|
|
@@ -61708,11 +61759,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61708
61759
|
}
|
|
61709
61760
|
return {
|
|
61710
61761
|
...prev,
|
|
61711
|
-
[typeName]:
|
|
61762
|
+
[typeName]: AST13.tsTupleType(
|
|
61712
61763
|
previousValue.concat(
|
|
61713
|
-
|
|
61714
|
-
|
|
61715
|
-
|
|
61764
|
+
AST13.tsTupleType([
|
|
61765
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
61766
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
61716
61767
|
inputType
|
|
61717
61768
|
])
|
|
61718
61769
|
)
|
|
@@ -61722,11 +61773,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61722
61773
|
}
|
|
61723
61774
|
var CacheTypeDefName = "CacheTypeDef";
|
|
61724
61775
|
function record(name) {
|
|
61725
|
-
return
|
|
61726
|
-
|
|
61727
|
-
|
|
61728
|
-
|
|
61729
|
-
|
|
61776
|
+
return AST13.tsTypeReference(
|
|
61777
|
+
AST13.identifier("Record"),
|
|
61778
|
+
AST13.tsTypeParameterInstantiation([
|
|
61779
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
61780
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
61730
61781
|
])
|
|
61731
61782
|
);
|
|
61732
61783
|
}
|
|
@@ -61779,25 +61830,25 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
61779
61830
|
|
|
61780
61831
|
// src/codegen/generators/definitions/enums.ts
|
|
61781
61832
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
61782
|
-
var
|
|
61783
|
-
var
|
|
61833
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
61834
|
+
var AST14 = recast14.types.builders;
|
|
61784
61835
|
async function definitionsGenerator(config2) {
|
|
61785
61836
|
const enums = graphql20.parse(graphql20.printSchema(config2.schema)).definitions.filter(
|
|
61786
61837
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
61787
61838
|
).filter((def) => !config2.isInternalEnum(def));
|
|
61788
61839
|
const { code: runtimeDefinitions } = await printJS(
|
|
61789
|
-
|
|
61840
|
+
AST14.program(
|
|
61790
61841
|
enums.map((defn) => {
|
|
61791
61842
|
const name = defn.name.value;
|
|
61792
61843
|
return moduleExport(
|
|
61793
61844
|
config2,
|
|
61794
61845
|
name,
|
|
61795
|
-
|
|
61846
|
+
AST14.objectExpression(
|
|
61796
61847
|
defn.values?.map((value) => {
|
|
61797
61848
|
const str = value.name.value;
|
|
61798
|
-
return
|
|
61799
|
-
|
|
61800
|
-
|
|
61849
|
+
return AST14.objectProperty(
|
|
61850
|
+
AST14.stringLiteral(str),
|
|
61851
|
+
AST14.stringLiteral(str)
|
|
61801
61852
|
);
|
|
61802
61853
|
}) || []
|
|
61803
61854
|
)
|