houdini 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +613 -562
- package/build/cmd-esm/index.js +613 -562
- package/build/codegen/generators/artifacts/selection.d.ts +1 -3
- package/build/codegen-cjs/index.js +600 -549
- package/build/codegen-esm/index.js +600 -549
- package/build/lib-cjs/index.js +41 -10
- package/build/lib-esm/index.js +41 -10
- package/build/runtime/cache/cache.d.ts +2 -0
- package/build/runtime/cache/gc.d.ts +1 -0
- package/build/runtime/cache/lists.d.ts +1 -0
- package/build/runtime/cache/staleManager.d.ts +1 -0
- package/build/runtime/cache/storage.d.ts +1 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/public/cache.d.ts +4 -0
- package/build/runtime-cjs/cache/cache.d.ts +2 -0
- package/build/runtime-cjs/cache/cache.js +16 -10
- package/build/runtime-cjs/cache/gc.d.ts +1 -0
- package/build/runtime-cjs/cache/gc.js +3 -0
- package/build/runtime-cjs/cache/lists.d.ts +1 -0
- package/build/runtime-cjs/cache/lists.js +4 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +1 -0
- package/build/runtime-cjs/cache/staleManager.js +3 -0
- package/build/runtime-cjs/cache/storage.d.ts +1 -0
- package/build/runtime-cjs/cache/storage.js +3 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +13 -0
- package/build/runtime-cjs/public/cache.d.ts +4 -0
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-esm/cache/cache.d.ts +2 -0
- package/build/runtime-esm/cache/cache.js +16 -10
- package/build/runtime-esm/cache/gc.d.ts +1 -0
- package/build/runtime-esm/cache/gc.js +3 -0
- package/build/runtime-esm/cache/lists.d.ts +1 -0
- package/build/runtime-esm/cache/lists.js +4 -0
- package/build/runtime-esm/cache/staleManager.d.ts +1 -0
- package/build/runtime-esm/cache/staleManager.js +3 -0
- package/build/runtime-esm/cache/storage.d.ts +1 -0
- package/build/runtime-esm/cache/storage.js +3 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +13 -0
- package/build/runtime-esm/public/cache.d.ts +4 -0
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/test-cjs/index.js +603 -552
- package/build/test-esm/index.js +603 -552
- package/build/vite-cjs/index.js +618 -567
- package/build/vite-esm/index.js +618 -567
- package/package.json +1 -1
package/build/test-esm/index.js
CHANGED
|
@@ -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;
|
|
@@ -54678,6 +54678,9 @@ var GarbageCollector = class {
|
|
|
54678
54678
|
constructor(cache) {
|
|
54679
54679
|
this.cache = cache;
|
|
54680
54680
|
}
|
|
54681
|
+
reset() {
|
|
54682
|
+
this.lifetimes.clear();
|
|
54683
|
+
}
|
|
54681
54684
|
resetLifetime(id, field) {
|
|
54682
54685
|
if (!this.lifetimes.get(id)) {
|
|
54683
54686
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -54797,6 +54800,10 @@ var ListManager = class {
|
|
|
54797
54800
|
}
|
|
54798
54801
|
this.listsByField.get(parentID).delete(field);
|
|
54799
54802
|
}
|
|
54803
|
+
reset() {
|
|
54804
|
+
this.lists.clear();
|
|
54805
|
+
this.listsByField.clear();
|
|
54806
|
+
}
|
|
54800
54807
|
};
|
|
54801
54808
|
var List = class {
|
|
54802
54809
|
recordID;
|
|
@@ -55179,6 +55186,9 @@ var StaleManager = class {
|
|
|
55179
55186
|
}
|
|
55180
55187
|
}
|
|
55181
55188
|
}
|
|
55189
|
+
reset() {
|
|
55190
|
+
this.fieldsTime.clear();
|
|
55191
|
+
}
|
|
55182
55192
|
};
|
|
55183
55193
|
|
|
55184
55194
|
// src/runtime/cache/storage.ts
|
|
@@ -55359,6 +55369,9 @@ var InMemoryStorage = class {
|
|
|
55359
55369
|
layer.fields = fields;
|
|
55360
55370
|
layer.links = links;
|
|
55361
55371
|
}
|
|
55372
|
+
reset() {
|
|
55373
|
+
this.data = [];
|
|
55374
|
+
}
|
|
55362
55375
|
};
|
|
55363
55376
|
var Layer = class {
|
|
55364
55377
|
id;
|
|
@@ -55804,6 +55817,18 @@ var InMemorySubscriptions = class {
|
|
|
55804
55817
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
55805
55818
|
}
|
|
55806
55819
|
}
|
|
55820
|
+
reset() {
|
|
55821
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
55822
|
+
([id]) => !id.startsWith(rootID)
|
|
55823
|
+
);
|
|
55824
|
+
for (const [id, _fields] of subscribers) {
|
|
55825
|
+
delete this.subscribers[id];
|
|
55826
|
+
}
|
|
55827
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
55828
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
55829
|
+
);
|
|
55830
|
+
return subscriptionSpecs;
|
|
55831
|
+
}
|
|
55807
55832
|
removeSubscribers(id, fieldName, specs) {
|
|
55808
55833
|
let targets = [];
|
|
55809
55834
|
for (const spec of specs) {
|
|
@@ -55993,6 +56018,14 @@ var Cache = class {
|
|
|
55993
56018
|
}
|
|
55994
56019
|
this.#notifySubscribers(toNotify);
|
|
55995
56020
|
}
|
|
56021
|
+
reset() {
|
|
56022
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
56023
|
+
this._internal_unstable.staleManager.reset();
|
|
56024
|
+
this._internal_unstable.lifetimes.reset();
|
|
56025
|
+
this._internal_unstable.lists.reset();
|
|
56026
|
+
this._internal_unstable.storage.reset();
|
|
56027
|
+
this.#notifySubscribers(subSpecs);
|
|
56028
|
+
}
|
|
55996
56029
|
#notifySubscribers(subs) {
|
|
55997
56030
|
if (subs.length === 0) {
|
|
55998
56031
|
return;
|
|
@@ -56142,12 +56175,9 @@ var CacheInternal = class {
|
|
|
56142
56175
|
);
|
|
56143
56176
|
}
|
|
56144
56177
|
}
|
|
56145
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56146
|
-
(field2) => typeof value[field2] === "undefined"
|
|
56147
|
-
).length > 0;
|
|
56148
56178
|
let linkedID = null;
|
|
56149
56179
|
if (value !== null) {
|
|
56150
|
-
linkedID = !
|
|
56180
|
+
linkedID = !this.isEmbedded(linkedType, value) ? this.id(linkedType, value) : `${parent2}.${key}`;
|
|
56151
56181
|
}
|
|
56152
56182
|
let linkChange = linkedID !== previousValue;
|
|
56153
56183
|
layer.writeLink(parent2, key, linkedID);
|
|
@@ -56175,7 +56205,7 @@ var CacheInternal = class {
|
|
|
56175
56205
|
forceNotify
|
|
56176
56206
|
});
|
|
56177
56207
|
}
|
|
56178
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
56208
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
56179
56209
|
let oldIDs = [...previousValue || []];
|
|
56180
56210
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
56181
56211
|
if (!id) {
|
|
@@ -56248,7 +56278,7 @@ var CacheInternal = class {
|
|
|
56248
56278
|
} else {
|
|
56249
56279
|
linkedIDs = nestedIDs;
|
|
56250
56280
|
}
|
|
56251
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
56281
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
56252
56282
|
if (contentChanged || forceNotify) {
|
|
56253
56283
|
toNotify.push(...currentSubscribers);
|
|
56254
56284
|
}
|
|
@@ -56519,6 +56549,10 @@ var CacheInternal = class {
|
|
|
56519
56549
|
computeID(type, data) {
|
|
56520
56550
|
return computeID(this.config, type, data);
|
|
56521
56551
|
}
|
|
56552
|
+
isEmbedded(linkedType, value) {
|
|
56553
|
+
const idFields = this.idFields(linkedType);
|
|
56554
|
+
return idFields.length === 0 || idFields.filter((field) => typeof value[field] === "undefined").length > 0;
|
|
56555
|
+
}
|
|
56522
56556
|
hydrateNestedList({
|
|
56523
56557
|
fields,
|
|
56524
56558
|
variables,
|
|
@@ -56626,9 +56660,6 @@ var CacheInternal = class {
|
|
|
56626
56660
|
}
|
|
56627
56661
|
const entryObj = entry;
|
|
56628
56662
|
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
56629
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
56630
|
-
(field) => typeof entry[field] === "undefined"
|
|
56631
|
-
).length > 0;
|
|
56632
56663
|
let innerType = linkedType;
|
|
56633
56664
|
const typename = entryObj.__typename;
|
|
56634
56665
|
if (typename) {
|
|
@@ -56636,7 +56667,7 @@ var CacheInternal = class {
|
|
|
56636
56667
|
} else if (abstract) {
|
|
56637
56668
|
throw new Error("Encountered interface type without __typename in the payload");
|
|
56638
56669
|
}
|
|
56639
|
-
if (!
|
|
56670
|
+
if (!this.isEmbedded(linkedType, entry)) {
|
|
56640
56671
|
const id = this.id(innerType, entry);
|
|
56641
56672
|
if (id) {
|
|
56642
56673
|
linkedID = id;
|
|
@@ -56967,7 +56998,7 @@ var Config = class {
|
|
|
56967
56998
|
defaultListTarget = null,
|
|
56968
56999
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
56969
57000
|
defaultKeys,
|
|
56970
|
-
types:
|
|
57001
|
+
types: types15 = {},
|
|
56971
57002
|
logLevel,
|
|
56972
57003
|
defaultFragmentMasking = "enable",
|
|
56973
57004
|
watchSchema,
|
|
@@ -57011,10 +57042,10 @@ var Config = class {
|
|
|
57011
57042
|
if (defaultKeys) {
|
|
57012
57043
|
this.defaultKeys = defaultKeys;
|
|
57013
57044
|
}
|
|
57014
|
-
if (
|
|
57045
|
+
if (types15) {
|
|
57015
57046
|
this.typeConfig = {
|
|
57016
57047
|
...this.typeConfig,
|
|
57017
|
-
...
|
|
57048
|
+
...types15
|
|
57018
57049
|
};
|
|
57019
57050
|
}
|
|
57020
57051
|
}
|
|
@@ -57749,7 +57780,7 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
57749
57780
|
|
|
57750
57781
|
// src/codegen/generators/artifacts/index.ts
|
|
57751
57782
|
var graphql12 = __toESM(require_graphql2(), 1);
|
|
57752
|
-
var
|
|
57783
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
57753
57784
|
|
|
57754
57785
|
// src/codegen/utils/commonjs.ts
|
|
57755
57786
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -58936,7 +58967,6 @@ function ancestorKey(ancestors) {
|
|
|
58936
58967
|
|
|
58937
58968
|
// src/codegen/generators/artifacts/selection.ts
|
|
58938
58969
|
var graphql11 = __toESM(require_graphql2(), 1);
|
|
58939
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
58940
58970
|
|
|
58941
58971
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
58942
58972
|
var config = {
|
|
@@ -59883,15 +59913,12 @@ function fieldKey(config2, field) {
|
|
|
59883
59913
|
}
|
|
59884
59914
|
|
|
59885
59915
|
// src/codegen/generators/artifacts/selection.ts
|
|
59886
|
-
var AST5 = recast5.types.builders;
|
|
59887
59916
|
function selection_default(args) {
|
|
59888
|
-
const typeMap = {};
|
|
59889
|
-
const abstractTypes = [];
|
|
59890
59917
|
return mergeSelection({
|
|
59891
|
-
|
|
59892
|
-
|
|
59893
|
-
|
|
59894
|
-
|
|
59918
|
+
config: args.config,
|
|
59919
|
+
rootType: args.rootType,
|
|
59920
|
+
object: prepareSelection(args),
|
|
59921
|
+
filepath: args.filepath
|
|
59895
59922
|
});
|
|
59896
59923
|
}
|
|
59897
59924
|
function prepareSelection({
|
|
@@ -59903,8 +59930,6 @@ function prepareSelection({
|
|
|
59903
59930
|
path: path2 = [],
|
|
59904
59931
|
document,
|
|
59905
59932
|
inConnection,
|
|
59906
|
-
typeMap,
|
|
59907
|
-
abstractTypes,
|
|
59908
59933
|
globalLoading,
|
|
59909
59934
|
includeFragments
|
|
59910
59935
|
}) {
|
|
@@ -59924,8 +59949,6 @@ function prepareSelection({
|
|
|
59924
59949
|
selections: field.selectionSet.selections,
|
|
59925
59950
|
path: path2,
|
|
59926
59951
|
document,
|
|
59927
|
-
typeMap,
|
|
59928
|
-
abstractTypes,
|
|
59929
59952
|
globalLoading,
|
|
59930
59953
|
includeFragments
|
|
59931
59954
|
}).fields || {}
|
|
@@ -59937,32 +59960,7 @@ function prepareSelection({
|
|
|
59937
59960
|
typeMap: {}
|
|
59938
59961
|
};
|
|
59939
59962
|
}
|
|
59940
|
-
const parentType = config2.schema.getType(rootType);
|
|
59941
59963
|
const typeConditionName = field.typeCondition.name.value;
|
|
59942
|
-
const typeCondition = config2.schema.getType(typeConditionName);
|
|
59943
|
-
const possibleTypes = [];
|
|
59944
|
-
if (!graphql11.isAbstractType(typeCondition)) {
|
|
59945
|
-
} else if (graphql11.isAbstractType(parentType)) {
|
|
59946
|
-
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
59947
|
-
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
59948
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
59949
|
-
possibleTypes.push(possible.name);
|
|
59950
|
-
}
|
|
59951
|
-
}
|
|
59952
|
-
} else {
|
|
59953
|
-
possibleTypes.push(rootType);
|
|
59954
|
-
}
|
|
59955
|
-
if (possibleTypes.length > 0) {
|
|
59956
|
-
for (const type of possibleTypes) {
|
|
59957
|
-
const existing = typeMap[type];
|
|
59958
|
-
if (!existing || !existing.includes(type)) {
|
|
59959
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
59960
|
-
}
|
|
59961
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
59962
|
-
abstractTypes.push(typeConditionName);
|
|
59963
|
-
}
|
|
59964
|
-
}
|
|
59965
|
-
}
|
|
59966
59964
|
object.abstractFields.fields = {
|
|
59967
59965
|
...object.abstractFields.fields,
|
|
59968
59966
|
[typeConditionName]: prepareSelection({
|
|
@@ -59973,8 +59971,6 @@ function prepareSelection({
|
|
|
59973
59971
|
selections: field.selectionSet.selections,
|
|
59974
59972
|
path: path2,
|
|
59975
59973
|
document,
|
|
59976
|
-
typeMap,
|
|
59977
|
-
abstractTypes,
|
|
59978
59974
|
globalLoading,
|
|
59979
59975
|
includeFragments
|
|
59980
59976
|
}).fields
|
|
@@ -59986,19 +59982,38 @@ function prepareSelection({
|
|
|
59986
59982
|
} else if (field.kind === "Field") {
|
|
59987
59983
|
const type = config2.schema.getType(rootType);
|
|
59988
59984
|
if (!type) {
|
|
59989
|
-
throw new HoudiniError({
|
|
59985
|
+
throw new HoudiniError({
|
|
59986
|
+
filepath,
|
|
59987
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
59988
|
+
});
|
|
59990
59989
|
}
|
|
59991
59990
|
const attributeName = field.alias?.value || field.name.value;
|
|
59992
|
-
let fieldType;
|
|
59991
|
+
let fieldType = null;
|
|
59993
59992
|
let nullable = false;
|
|
59994
59993
|
if (field.name.value === "__typename") {
|
|
59995
59994
|
fieldType = config2.schema.getType("String");
|
|
59996
|
-
} else {
|
|
59995
|
+
} else if ("getFields" in type) {
|
|
59997
59996
|
let typeRef = type.getFields()[field.name.value].type;
|
|
59998
59997
|
fieldType = getRootType(typeRef);
|
|
59999
59998
|
nullable = !graphql11.isNonNullType(typeRef);
|
|
59999
|
+
} else if (graphql11.isAbstractType(type)) {
|
|
60000
|
+
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
60001
|
+
if (graphql11.isObjectType(possible)) {
|
|
60002
|
+
if (possible.getFields()[field.name.value]) {
|
|
60003
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
60004
|
+
nullable = !graphql11.isNonNullType(fieldType);
|
|
60005
|
+
break;
|
|
60006
|
+
}
|
|
60007
|
+
}
|
|
60008
|
+
}
|
|
60009
|
+
}
|
|
60010
|
+
if (!fieldType) {
|
|
60011
|
+
throw {
|
|
60012
|
+
message: "Could not identify field's type",
|
|
60013
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
60014
|
+
};
|
|
60000
60015
|
}
|
|
60001
|
-
const typeName = fieldType.
|
|
60016
|
+
const typeName = getRootType(fieldType).name;
|
|
60002
60017
|
const pathSoFar = path2.concat(attributeName);
|
|
60003
60018
|
const keys2 = config2.keyFieldsForType(rootType);
|
|
60004
60019
|
let fieldObj = {
|
|
@@ -60092,8 +60107,6 @@ function prepareSelection({
|
|
|
60092
60107
|
path: pathSoFar,
|
|
60093
60108
|
document,
|
|
60094
60109
|
inConnection: connectionState,
|
|
60095
|
-
typeMap,
|
|
60096
|
-
abstractTypes,
|
|
60097
60110
|
globalLoading: forceLoading,
|
|
60098
60111
|
includeFragments
|
|
60099
60112
|
});
|
|
@@ -60179,69 +60192,107 @@ function prepareSelection({
|
|
|
60179
60192
|
return object;
|
|
60180
60193
|
}
|
|
60181
60194
|
function mergeSelection({
|
|
60195
|
+
config: config2,
|
|
60182
60196
|
filepath,
|
|
60183
60197
|
object,
|
|
60184
|
-
|
|
60185
|
-
abstractTypes
|
|
60198
|
+
rootType
|
|
60186
60199
|
}) {
|
|
60187
60200
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
60188
|
-
|
|
60189
|
-
|
|
60201
|
+
const abstractSelection = {
|
|
60202
|
+
fields: {},
|
|
60203
|
+
typeMap: {}
|
|
60204
|
+
};
|
|
60205
|
+
const possibleSelectionTypes = {};
|
|
60206
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
60207
|
+
const gqlType = config2.schema.getType(typeName);
|
|
60208
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
60209
|
+
filepath,
|
|
60210
|
+
typeSelection,
|
|
60211
|
+
abstractSelection.fields[typeName] ?? {}
|
|
60212
|
+
);
|
|
60213
|
+
if (graphql11.isAbstractType(gqlType)) {
|
|
60214
|
+
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
60215
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
60216
|
+
possibleSelectionTypes[typeName] = [];
|
|
60217
|
+
}
|
|
60218
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
60219
|
+
}
|
|
60220
|
+
}
|
|
60221
|
+
}
|
|
60222
|
+
const concreteSelectionImplements = {};
|
|
60223
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60224
|
+
for (const possible of possibles) {
|
|
60225
|
+
if (!concreteSelectionImplements[possible]) {
|
|
60226
|
+
concreteSelectionImplements[possible] = [];
|
|
60227
|
+
}
|
|
60228
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
60229
|
+
}
|
|
60230
|
+
}
|
|
60231
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
60232
|
+
if (implementations.length > 1) {
|
|
60233
|
+
abstractSelection.fields[concrete] = {};
|
|
60234
|
+
}
|
|
60235
|
+
}
|
|
60236
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60190
60237
|
for (const possible of possibles) {
|
|
60191
|
-
if (
|
|
60192
|
-
|
|
60238
|
+
if (abstractSelection.fields[possible]) {
|
|
60239
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
60193
60240
|
filepath,
|
|
60194
|
-
|
|
60195
|
-
|
|
60241
|
+
abstractSelection.fields[typeName] ?? {},
|
|
60242
|
+
abstractSelection.fields[possible] ?? {}
|
|
60196
60243
|
);
|
|
60197
|
-
overlap = true;
|
|
60198
60244
|
}
|
|
60199
60245
|
}
|
|
60200
|
-
if (overlap) {
|
|
60201
|
-
delete typeMap[typeName];
|
|
60202
|
-
}
|
|
60203
60246
|
}
|
|
60204
|
-
|
|
60205
|
-
|
|
60206
|
-
|
|
60207
|
-
|
|
60208
|
-
|
|
60209
|
-
);
|
|
60210
|
-
delete typeMap[type];
|
|
60247
|
+
const parentType = config2.schema.getType(rootType);
|
|
60248
|
+
const possibleParents = graphql11.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t) => t.name) : [parentType.name];
|
|
60249
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
60250
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
60251
|
+
delete abstractSelection.typeMap[key];
|
|
60211
60252
|
}
|
|
60212
60253
|
}
|
|
60213
|
-
for (const [type, sel] of Object.entries(
|
|
60214
|
-
|
|
60254
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
60255
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
60215
60256
|
}
|
|
60216
|
-
for (const [
|
|
60217
|
-
|
|
60257
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
60258
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
60259
|
+
delete abstractSelection.fields[typename];
|
|
60260
|
+
}
|
|
60218
60261
|
}
|
|
60219
|
-
const
|
|
60220
|
-
|
|
60221
|
-
|
|
60222
|
-
|
|
60262
|
+
for (const possible of possibleParents) {
|
|
60263
|
+
if (abstractSelection.fields[possible]) {
|
|
60264
|
+
continue;
|
|
60265
|
+
}
|
|
60266
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
60267
|
+
possibleSelectionTypes
|
|
60268
|
+
)) {
|
|
60269
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
60270
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
60271
|
+
break;
|
|
60272
|
+
}
|
|
60223
60273
|
}
|
|
60224
60274
|
}
|
|
60275
|
+
object.abstractFields = abstractSelection;
|
|
60225
60276
|
}
|
|
60226
|
-
for (const
|
|
60277
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
60227
60278
|
const selection = value.selection;
|
|
60228
60279
|
if (selection) {
|
|
60229
60280
|
mergeSelection({
|
|
60281
|
+
config: config2,
|
|
60282
|
+
rootType: value.type,
|
|
60230
60283
|
filepath,
|
|
60231
|
-
typeMap,
|
|
60232
|
-
abstractTypes,
|
|
60233
60284
|
object: selection
|
|
60234
60285
|
});
|
|
60235
60286
|
}
|
|
60236
60287
|
}
|
|
60237
60288
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
60238
|
-
for (const
|
|
60289
|
+
for (const value of Object.values(selection ?? {})) {
|
|
60239
60290
|
const selection2 = value.selection;
|
|
60240
60291
|
if (selection2) {
|
|
60241
60292
|
mergeSelection({
|
|
60293
|
+
config: config2,
|
|
60294
|
+
rootType: value.type,
|
|
60242
60295
|
filepath,
|
|
60243
|
-
typeMap,
|
|
60244
|
-
abstractTypes,
|
|
60245
60296
|
object: selection2
|
|
60246
60297
|
});
|
|
60247
60298
|
}
|
|
@@ -60251,7 +60302,7 @@ function mergeSelection({
|
|
|
60251
60302
|
}
|
|
60252
60303
|
|
|
60253
60304
|
// src/codegen/generators/artifacts/index.ts
|
|
60254
|
-
var
|
|
60305
|
+
var AST5 = recast5.types.builders;
|
|
60255
60306
|
function artifactGenerator(stats) {
|
|
60256
60307
|
return async function(config2, docs) {
|
|
60257
60308
|
const filterTypes = {};
|
|
@@ -60519,10 +60570,10 @@ function artifactGenerator(stats) {
|
|
|
60519
60570
|
}
|
|
60520
60571
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
60521
60572
|
}
|
|
60522
|
-
const file =
|
|
60573
|
+
const file = AST5.program([
|
|
60523
60574
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
60524
|
-
|
|
60525
|
-
|
|
60575
|
+
AST5.expressionStatement(
|
|
60576
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
60526
60577
|
)
|
|
60527
60578
|
]);
|
|
60528
60579
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -60602,8 +60653,8 @@ function applyMask(config2, target, mask) {
|
|
|
60602
60653
|
}
|
|
60603
60654
|
|
|
60604
60655
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
60605
|
-
var
|
|
60606
|
-
var
|
|
60656
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
60657
|
+
var AST6 = recast6.types.builders;
|
|
60607
60658
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
60608
60659
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
60609
60660
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -60638,18 +60689,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
60638
60689
|
continue;
|
|
60639
60690
|
}
|
|
60640
60691
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
60641
|
-
const input =
|
|
60642
|
-
input.typeAnnotation =
|
|
60643
|
-
|
|
60692
|
+
const input = AST6.identifier("str");
|
|
60693
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
60694
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
60644
60695
|
);
|
|
60645
60696
|
script.body.splice(
|
|
60646
60697
|
i,
|
|
60647
60698
|
0,
|
|
60648
|
-
|
|
60649
|
-
|
|
60650
|
-
|
|
60699
|
+
AST6.exportNamedDeclaration(
|
|
60700
|
+
AST6.tsDeclareFunction(
|
|
60701
|
+
AST6.identifier("graphql"),
|
|
60651
60702
|
[input],
|
|
60652
|
-
|
|
60703
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
60653
60704
|
)
|
|
60654
60705
|
)
|
|
60655
60706
|
);
|
|
@@ -60812,20 +60863,20 @@ async function generatePluginRuntime({
|
|
|
60812
60863
|
}
|
|
60813
60864
|
|
|
60814
60865
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60815
|
-
var
|
|
60866
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
60816
60867
|
|
|
60817
60868
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60818
60869
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
60819
|
-
var
|
|
60870
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
60820
60871
|
|
|
60821
60872
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60822
60873
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
60823
|
-
var
|
|
60874
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
60824
60875
|
|
|
60825
60876
|
// src/codegen/generators/typescript/types.ts
|
|
60826
60877
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
60827
|
-
var
|
|
60828
|
-
var
|
|
60878
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
60879
|
+
var AST7 = recast7.types.builders;
|
|
60829
60880
|
function readonlyProperty(prop, enable = true) {
|
|
60830
60881
|
if (enable) {
|
|
60831
60882
|
prop.readonly = true;
|
|
@@ -60833,28 +60884,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
60833
60884
|
return prop;
|
|
60834
60885
|
}
|
|
60835
60886
|
function nullableField(inner, input = false) {
|
|
60836
|
-
const members = [inner,
|
|
60887
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
60837
60888
|
if (input) {
|
|
60838
|
-
members.push(
|
|
60889
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
60839
60890
|
}
|
|
60840
|
-
return
|
|
60891
|
+
return AST7.tsUnionType(members);
|
|
60841
60892
|
}
|
|
60842
60893
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
60843
60894
|
switch (target.name) {
|
|
60844
60895
|
case "String": {
|
|
60845
|
-
return
|
|
60896
|
+
return AST7.tsStringKeyword();
|
|
60846
60897
|
}
|
|
60847
60898
|
case "Int": {
|
|
60848
|
-
return
|
|
60899
|
+
return AST7.tsNumberKeyword();
|
|
60849
60900
|
}
|
|
60850
60901
|
case "Float": {
|
|
60851
|
-
return
|
|
60902
|
+
return AST7.tsNumberKeyword();
|
|
60852
60903
|
}
|
|
60853
60904
|
case "Boolean": {
|
|
60854
|
-
return
|
|
60905
|
+
return AST7.tsBooleanKeyword();
|
|
60855
60906
|
}
|
|
60856
60907
|
case "ID": {
|
|
60857
|
-
return
|
|
60908
|
+
return AST7.tsStringKeyword();
|
|
60858
60909
|
}
|
|
60859
60910
|
default: {
|
|
60860
60911
|
if (graphql13.isNonNullType(target) && "ofType" in target) {
|
|
@@ -60865,16 +60916,16 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
60865
60916
|
);
|
|
60866
60917
|
}
|
|
60867
60918
|
if (config2.scalars?.[target.name]) {
|
|
60868
|
-
return
|
|
60919
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
60869
60920
|
}
|
|
60870
60921
|
missingScalars.add(target.name);
|
|
60871
|
-
return
|
|
60922
|
+
return AST7.tsAnyKeyword();
|
|
60872
60923
|
}
|
|
60873
60924
|
}
|
|
60874
60925
|
}
|
|
60875
60926
|
|
|
60876
60927
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60877
|
-
var
|
|
60928
|
+
var AST8 = recast8.types.builders;
|
|
60878
60929
|
function tsTypeReference(config2, missingScalars, definition, body) {
|
|
60879
60930
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
60880
60931
|
let result;
|
|
@@ -60883,7 +60934,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60883
60934
|
} else if (graphql14.isEnumType(type)) {
|
|
60884
60935
|
result = enumReference(config2, body, type.name);
|
|
60885
60936
|
} else {
|
|
60886
|
-
result =
|
|
60937
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
60887
60938
|
}
|
|
60888
60939
|
for (const toWrap of wrappers) {
|
|
60889
60940
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -60891,7 +60942,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60891
60942
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
60892
60943
|
result = nullableField(result, true);
|
|
60893
60944
|
} else if (toWrap === "List" /* List */) {
|
|
60894
|
-
result =
|
|
60945
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
60895
60946
|
}
|
|
60896
60947
|
}
|
|
60897
60948
|
return result;
|
|
@@ -60904,14 +60955,14 @@ function enumReference(config2, body, name) {
|
|
|
60904
60955
|
importKind: "type",
|
|
60905
60956
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60906
60957
|
});
|
|
60907
|
-
return
|
|
60908
|
-
|
|
60909
|
-
|
|
60958
|
+
return AST8.tsTypeReference(
|
|
60959
|
+
AST8.identifier("ValueOf"),
|
|
60960
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
60910
60961
|
);
|
|
60911
60962
|
}
|
|
60912
60963
|
|
|
60913
60964
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60914
|
-
var
|
|
60965
|
+
var AST9 = recast9.types.builders;
|
|
60915
60966
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
60916
60967
|
const { type } = unwrapType(config2, rootType);
|
|
60917
60968
|
if (graphql15.isScalarType(type)) {
|
|
@@ -60938,20 +60989,20 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
60938
60989
|
for (const field of Object.values(type.getFields())) {
|
|
60939
60990
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
60940
60991
|
members.push(
|
|
60941
|
-
|
|
60942
|
-
|
|
60943
|
-
|
|
60992
|
+
AST9.tsPropertySignature(
|
|
60993
|
+
AST9.identifier(field.name),
|
|
60994
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field, body)),
|
|
60944
60995
|
graphql15.isNullableType(field.type)
|
|
60945
60996
|
)
|
|
60946
60997
|
);
|
|
60947
60998
|
}
|
|
60948
|
-
body.push(
|
|
60999
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
60949
61000
|
}
|
|
60950
61001
|
|
|
60951
61002
|
// src/codegen/generators/typescript/inlineType.ts
|
|
60952
61003
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
60953
|
-
var
|
|
60954
|
-
var
|
|
61004
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
61005
|
+
var AST10 = recast10.types.builders;
|
|
60955
61006
|
var fragmentKey2 = " $fragments";
|
|
60956
61007
|
function inlineType({
|
|
60957
61008
|
config: config2,
|
|
@@ -61049,7 +61100,7 @@ function inlineType({
|
|
|
61049
61100
|
{}
|
|
61050
61101
|
)
|
|
61051
61102
|
);
|
|
61052
|
-
result =
|
|
61103
|
+
result = AST10.tsTypeLiteral([
|
|
61053
61104
|
...fields.map((selection) => {
|
|
61054
61105
|
const { field } = selectionTypeInfo(config2.schema, filepath, rootObj, selection);
|
|
61055
61106
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -61077,12 +61128,12 @@ function inlineType({
|
|
|
61077
61128
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
61078
61129
|
).length > 0;
|
|
61079
61130
|
if (hasIncludeOrSkipDirective) {
|
|
61080
|
-
attributeType =
|
|
61131
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
61081
61132
|
}
|
|
61082
61133
|
const prop = readonlyProperty(
|
|
61083
|
-
|
|
61084
|
-
|
|
61085
|
-
|
|
61134
|
+
AST10.tsPropertySignature(
|
|
61135
|
+
AST10.identifier(attributeName),
|
|
61136
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
61086
61137
|
),
|
|
61087
61138
|
allowReadonly
|
|
61088
61139
|
);
|
|
@@ -61096,14 +61147,14 @@ function inlineType({
|
|
|
61096
61147
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
61097
61148
|
result.members.push(
|
|
61098
61149
|
readonlyProperty(
|
|
61099
|
-
|
|
61100
|
-
|
|
61101
|
-
|
|
61102
|
-
|
|
61150
|
+
AST10.tsPropertySignature(
|
|
61151
|
+
AST10.stringLiteral(fragmentKey2),
|
|
61152
|
+
AST10.tsTypeAnnotation(
|
|
61153
|
+
AST10.tsTypeLiteral(
|
|
61103
61154
|
(fragmentSpreads || []).map(
|
|
61104
|
-
(fragmentSpread) =>
|
|
61105
|
-
|
|
61106
|
-
|
|
61155
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
61156
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
61157
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
61107
61158
|
)
|
|
61108
61159
|
)
|
|
61109
61160
|
)
|
|
@@ -61148,9 +61199,9 @@ function inlineType({
|
|
|
61148
61199
|
}
|
|
61149
61200
|
objectType.members.push(
|
|
61150
61201
|
readonlyProperty(
|
|
61151
|
-
|
|
61152
|
-
|
|
61153
|
-
|
|
61202
|
+
AST10.tsPropertySignature(
|
|
61203
|
+
AST10.identifier("__typename"),
|
|
61204
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
61154
61205
|
),
|
|
61155
61206
|
allowReadonly
|
|
61156
61207
|
)
|
|
@@ -61190,8 +61241,8 @@ function inlineType({
|
|
|
61190
61241
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
61191
61242
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
61192
61243
|
([typeName, { type: type2, tsType }]) => {
|
|
61193
|
-
return
|
|
61194
|
-
|
|
61244
|
+
return AST10.tsParenthesizedType(
|
|
61245
|
+
AST10.tsIntersectionType(
|
|
61195
61246
|
[tsType].flatMap((type3) => {
|
|
61196
61247
|
if (type3.type === "TSUnionType") {
|
|
61197
61248
|
return type3.types.filter(
|
|
@@ -61217,14 +61268,14 @@ function inlineType({
|
|
|
61217
61268
|
);
|
|
61218
61269
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
61219
61270
|
selectionTypes.push(
|
|
61220
|
-
|
|
61221
|
-
|
|
61271
|
+
AST10.tsParenthesizedType(
|
|
61272
|
+
AST10.tsTypeLiteral([
|
|
61222
61273
|
readonlyProperty(
|
|
61223
|
-
|
|
61224
|
-
|
|
61225
|
-
|
|
61226
|
-
|
|
61227
|
-
|
|
61274
|
+
AST10.tsPropertySignature(
|
|
61275
|
+
AST10.identifier("__typename"),
|
|
61276
|
+
AST10.tsTypeAnnotation(
|
|
61277
|
+
AST10.tsLiteralType(
|
|
61278
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
61228
61279
|
)
|
|
61229
61280
|
)
|
|
61230
61281
|
),
|
|
@@ -61234,9 +61285,9 @@ function inlineType({
|
|
|
61234
61285
|
)
|
|
61235
61286
|
);
|
|
61236
61287
|
}
|
|
61237
|
-
result =
|
|
61288
|
+
result = AST10.tsIntersectionType([
|
|
61238
61289
|
result,
|
|
61239
|
-
|
|
61290
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
61240
61291
|
]);
|
|
61241
61292
|
}
|
|
61242
61293
|
} else {
|
|
@@ -61254,7 +61305,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
61254
61305
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
61255
61306
|
continue;
|
|
61256
61307
|
} else if (toWrap === "List" /* List */) {
|
|
61257
|
-
result =
|
|
61308
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
61258
61309
|
}
|
|
61259
61310
|
}
|
|
61260
61311
|
return result;
|
|
@@ -61299,13 +61350,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
61299
61350
|
}
|
|
61300
61351
|
|
|
61301
61352
|
// src/codegen/generators/typescript/loadingState.ts
|
|
61302
|
-
var
|
|
61303
|
-
var
|
|
61353
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
61354
|
+
var AST11 = recast11.types.builders;
|
|
61304
61355
|
function withLoadingState(args) {
|
|
61305
61356
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
61306
61357
|
return args.base;
|
|
61307
61358
|
}
|
|
61308
|
-
return
|
|
61359
|
+
return AST11.tsUnionType([
|
|
61309
61360
|
args.base,
|
|
61310
61361
|
loadingState({
|
|
61311
61362
|
parentType: args.document.artifact.rootType,
|
|
@@ -61324,7 +61375,7 @@ function loadingState(args) {
|
|
|
61324
61375
|
import: ["LoadingType"],
|
|
61325
61376
|
sourceModule: "$houdini/runtime/lib/types"
|
|
61326
61377
|
});
|
|
61327
|
-
const result =
|
|
61378
|
+
const result = AST11.tsTypeLiteral(
|
|
61328
61379
|
Object.entries(selection).reduce(
|
|
61329
61380
|
(rest, [attributeName, value]) => {
|
|
61330
61381
|
if (!value.loading) {
|
|
@@ -61332,7 +61383,7 @@ function loadingState(args) {
|
|
|
61332
61383
|
}
|
|
61333
61384
|
let keyType = null;
|
|
61334
61385
|
if (value.loading.kind === "value") {
|
|
61335
|
-
keyType =
|
|
61386
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
61336
61387
|
}
|
|
61337
61388
|
if (value.loading.kind === "continue" && value.selection) {
|
|
61338
61389
|
keyType = loadingState({
|
|
@@ -61348,15 +61399,15 @@ function loadingState(args) {
|
|
|
61348
61399
|
}
|
|
61349
61400
|
if (value.loading.list) {
|
|
61350
61401
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
61351
|
-
keyType =
|
|
61402
|
+
keyType = AST11.tsArrayType(keyType);
|
|
61352
61403
|
}
|
|
61353
61404
|
}
|
|
61354
61405
|
return [
|
|
61355
61406
|
...rest,
|
|
61356
61407
|
readonlyProperty(
|
|
61357
|
-
|
|
61358
|
-
|
|
61359
|
-
|
|
61408
|
+
AST11.tsPropertySignature(
|
|
61409
|
+
AST11.identifier(attributeName),
|
|
61410
|
+
AST11.tsTypeAnnotation(keyType)
|
|
61360
61411
|
)
|
|
61361
61412
|
)
|
|
61362
61413
|
];
|
|
@@ -61367,14 +61418,14 @@ function loadingState(args) {
|
|
|
61367
61418
|
if (args.selection.fragments) {
|
|
61368
61419
|
result.members.push(
|
|
61369
61420
|
readonlyProperty(
|
|
61370
|
-
|
|
61371
|
-
|
|
61372
|
-
|
|
61373
|
-
|
|
61421
|
+
AST11.tsPropertySignature(
|
|
61422
|
+
AST11.stringLiteral(fragmentKey),
|
|
61423
|
+
AST11.tsTypeAnnotation(
|
|
61424
|
+
AST11.tsTypeLiteral(
|
|
61374
61425
|
Object.keys(args.selection.fragments).map((name) => {
|
|
61375
|
-
return
|
|
61376
|
-
|
|
61377
|
-
|
|
61426
|
+
return AST11.tsPropertySignature(
|
|
61427
|
+
AST11.identifier(name),
|
|
61428
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
61378
61429
|
);
|
|
61379
61430
|
})
|
|
61380
61431
|
)
|
|
@@ -61387,7 +61438,7 @@ function loadingState(args) {
|
|
|
61387
61438
|
}
|
|
61388
61439
|
|
|
61389
61440
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
61390
|
-
var
|
|
61441
|
+
var AST12 = recast12.types.builders;
|
|
61391
61442
|
async function generateDocumentTypes(config2, docs) {
|
|
61392
61443
|
const typePaths = [];
|
|
61393
61444
|
const fragmentDefinitions = {};
|
|
@@ -61412,7 +61463,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61412
61463
|
return;
|
|
61413
61464
|
}
|
|
61414
61465
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
61415
|
-
const program =
|
|
61466
|
+
const program = AST12.program([]);
|
|
61416
61467
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61417
61468
|
let definition = originalDocument.definitions.find(
|
|
61418
61469
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -61448,9 +61499,9 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61448
61499
|
);
|
|
61449
61500
|
}
|
|
61450
61501
|
program.body.push(
|
|
61451
|
-
|
|
61452
|
-
|
|
61453
|
-
|
|
61502
|
+
AST12.exportNamedDeclaration(
|
|
61503
|
+
AST12.tsTypeAliasDeclaration(
|
|
61504
|
+
AST12.identifier(`${name}$artifact`),
|
|
61454
61505
|
convertToTs(serializeValue(artifact))
|
|
61455
61506
|
)
|
|
61456
61507
|
)
|
|
@@ -61460,17 +61511,17 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61460
61511
|
typePaths.push(typeDefPath);
|
|
61461
61512
|
})
|
|
61462
61513
|
);
|
|
61463
|
-
const typeIndex =
|
|
61514
|
+
const typeIndex = AST12.program(
|
|
61464
61515
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
61465
|
-
return
|
|
61466
|
-
|
|
61516
|
+
return AST12.exportAllDeclaration(
|
|
61517
|
+
AST12.literal(
|
|
61467
61518
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
61468
61519
|
),
|
|
61469
61520
|
null
|
|
61470
61521
|
);
|
|
61471
61522
|
}).concat([
|
|
61472
|
-
|
|
61473
|
-
|
|
61523
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
61524
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
61474
61525
|
])
|
|
61475
61526
|
);
|
|
61476
61527
|
const exportDefaultAs = ({ module, as }) => `
|
|
@@ -61525,7 +61576,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
61525
61576
|
}
|
|
61526
61577
|
function convertToTs(source) {
|
|
61527
61578
|
if (source.type === "ObjectExpression") {
|
|
61528
|
-
return
|
|
61579
|
+
return AST12.tsTypeLiteral(
|
|
61529
61580
|
source.properties.reduce(
|
|
61530
61581
|
(props, prop) => {
|
|
61531
61582
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -61533,9 +61584,9 @@ function convertToTs(source) {
|
|
|
61533
61584
|
}
|
|
61534
61585
|
return [
|
|
61535
61586
|
...props,
|
|
61536
|
-
|
|
61587
|
+
AST12.tsPropertySignature(
|
|
61537
61588
|
prop.key,
|
|
61538
|
-
|
|
61589
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
61539
61590
|
)
|
|
61540
61591
|
];
|
|
61541
61592
|
},
|
|
@@ -61544,20 +61595,20 @@ function convertToTs(source) {
|
|
|
61544
61595
|
);
|
|
61545
61596
|
}
|
|
61546
61597
|
if (source.type === "ArrayExpression") {
|
|
61547
|
-
return
|
|
61598
|
+
return AST12.tsTupleType(
|
|
61548
61599
|
source.elements.map((element) => convertToTs(element))
|
|
61549
61600
|
);
|
|
61550
61601
|
}
|
|
61551
61602
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
61552
|
-
return
|
|
61603
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
61553
61604
|
}
|
|
61554
61605
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
61555
|
-
return
|
|
61606
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
61556
61607
|
}
|
|
61557
61608
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
61558
|
-
return
|
|
61609
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
61559
61610
|
}
|
|
61560
|
-
return
|
|
61611
|
+
return AST12.tsLiteralType(source);
|
|
61561
61612
|
}
|
|
61562
61613
|
async function generateOperationTypeDefs(config2, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
61563
61614
|
let parentType = null;
|
|
@@ -61596,23 +61647,23 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61596
61647
|
});
|
|
61597
61648
|
}
|
|
61598
61649
|
body.push(
|
|
61599
|
-
|
|
61600
|
-
|
|
61601
|
-
|
|
61602
|
-
|
|
61650
|
+
AST12.exportNamedDeclaration(
|
|
61651
|
+
AST12.tsTypeAliasDeclaration(
|
|
61652
|
+
AST12.identifier(definition.name.value),
|
|
61653
|
+
AST12.tsTypeLiteral([
|
|
61603
61654
|
readonlyProperty(
|
|
61604
|
-
|
|
61605
|
-
|
|
61606
|
-
|
|
61655
|
+
AST12.tsPropertySignature(
|
|
61656
|
+
AST12.stringLiteral("input"),
|
|
61657
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
61607
61658
|
)
|
|
61608
61659
|
),
|
|
61609
61660
|
readonlyProperty(
|
|
61610
|
-
|
|
61611
|
-
|
|
61612
|
-
|
|
61613
|
-
definition.operation === "mutation" ?
|
|
61614
|
-
|
|
61615
|
-
|
|
61661
|
+
AST12.tsPropertySignature(
|
|
61662
|
+
AST12.stringLiteral("result"),
|
|
61663
|
+
AST12.tsTypeAnnotation(
|
|
61664
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
61665
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
61666
|
+
AST12.tsUndefinedKeyword()
|
|
61616
61667
|
])
|
|
61617
61668
|
)
|
|
61618
61669
|
)
|
|
@@ -61620,8 +61671,8 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61620
61671
|
])
|
|
61621
61672
|
)
|
|
61622
61673
|
),
|
|
61623
|
-
|
|
61624
|
-
|
|
61674
|
+
AST12.exportNamedDeclaration(
|
|
61675
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
61625
61676
|
)
|
|
61626
61677
|
);
|
|
61627
61678
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -61636,15 +61687,15 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61636
61687
|
);
|
|
61637
61688
|
}
|
|
61638
61689
|
body.push(
|
|
61639
|
-
|
|
61640
|
-
|
|
61641
|
-
|
|
61642
|
-
|
|
61690
|
+
AST12.exportNamedDeclaration(
|
|
61691
|
+
AST12.tsTypeAliasDeclaration(
|
|
61692
|
+
AST12.identifier(inputTypeName),
|
|
61693
|
+
AST12.tsTypeLiteral(
|
|
61643
61694
|
(definition.variableDefinitions || []).map(
|
|
61644
61695
|
(definition2) => {
|
|
61645
|
-
return
|
|
61646
|
-
|
|
61647
|
-
|
|
61696
|
+
return AST12.tsPropertySignature(
|
|
61697
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61698
|
+
AST12.tsTypeAnnotation(
|
|
61648
61699
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61649
61700
|
),
|
|
61650
61701
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61657,16 +61708,16 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61657
61708
|
);
|
|
61658
61709
|
} else {
|
|
61659
61710
|
body.push(
|
|
61660
|
-
|
|
61661
|
-
|
|
61711
|
+
AST12.exportNamedDeclaration(
|
|
61712
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
61662
61713
|
)
|
|
61663
61714
|
);
|
|
61664
61715
|
}
|
|
61665
61716
|
if (definition.operation === "mutation") {
|
|
61666
61717
|
body.push(
|
|
61667
|
-
|
|
61668
|
-
|
|
61669
|
-
|
|
61718
|
+
AST12.exportNamedDeclaration(
|
|
61719
|
+
AST12.tsTypeAliasDeclaration(
|
|
61720
|
+
AST12.identifier(optimisticTypeName),
|
|
61670
61721
|
inlineType({
|
|
61671
61722
|
config: config2,
|
|
61672
61723
|
filepath,
|
|
@@ -61700,12 +61751,12 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61700
61751
|
let directive = definition.directives?.find(
|
|
61701
61752
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61702
61753
|
);
|
|
61703
|
-
let inputValue = !directive ?
|
|
61754
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
61704
61755
|
(fragmentArgumentsDefinitions(config2, filepath, definition) || []).map(
|
|
61705
61756
|
(definition2) => {
|
|
61706
|
-
return
|
|
61707
|
-
|
|
61708
|
-
|
|
61757
|
+
return AST12.tsPropertySignature(
|
|
61758
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61759
|
+
AST12.tsTypeAnnotation(
|
|
61709
61760
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61710
61761
|
),
|
|
61711
61762
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61714,30 +61765,30 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61714
61765
|
)
|
|
61715
61766
|
);
|
|
61716
61767
|
body.push(
|
|
61717
|
-
|
|
61718
|
-
|
|
61768
|
+
AST12.exportNamedDeclaration(
|
|
61769
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
61719
61770
|
),
|
|
61720
|
-
|
|
61721
|
-
|
|
61722
|
-
|
|
61723
|
-
|
|
61771
|
+
AST12.exportNamedDeclaration(
|
|
61772
|
+
AST12.tsTypeAliasDeclaration(
|
|
61773
|
+
AST12.identifier(propTypeName),
|
|
61774
|
+
AST12.tsTypeLiteral([
|
|
61724
61775
|
readonlyProperty(
|
|
61725
|
-
|
|
61726
|
-
|
|
61727
|
-
|
|
61728
|
-
|
|
61776
|
+
AST12.tsPropertySignature(
|
|
61777
|
+
AST12.stringLiteral("shape"),
|
|
61778
|
+
AST12.tsTypeAnnotation(
|
|
61779
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
61729
61780
|
),
|
|
61730
61781
|
true
|
|
61731
61782
|
)
|
|
61732
61783
|
),
|
|
61733
61784
|
readonlyProperty(
|
|
61734
|
-
|
|
61735
|
-
|
|
61736
|
-
|
|
61737
|
-
|
|
61738
|
-
|
|
61739
|
-
|
|
61740
|
-
|
|
61785
|
+
AST12.tsPropertySignature(
|
|
61786
|
+
AST12.stringLiteral(fragmentKey2),
|
|
61787
|
+
AST12.tsTypeAnnotation(
|
|
61788
|
+
AST12.tsTypeLiteral([
|
|
61789
|
+
AST12.tsPropertySignature(
|
|
61790
|
+
AST12.stringLiteral(propTypeName),
|
|
61791
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
61741
61792
|
)
|
|
61742
61793
|
])
|
|
61743
61794
|
)
|
|
@@ -61746,9 +61797,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61746
61797
|
])
|
|
61747
61798
|
)
|
|
61748
61799
|
),
|
|
61749
|
-
|
|
61750
|
-
|
|
61751
|
-
|
|
61800
|
+
AST12.exportNamedDeclaration(
|
|
61801
|
+
AST12.tsTypeAliasDeclaration(
|
|
61802
|
+
AST12.identifier(shapeTypeName),
|
|
61752
61803
|
withLoadingState({
|
|
61753
61804
|
config: config2,
|
|
61754
61805
|
document,
|
|
@@ -61774,8 +61825,8 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61774
61825
|
|
|
61775
61826
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
61776
61827
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
61777
|
-
var
|
|
61778
|
-
var
|
|
61828
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
61829
|
+
var AST13 = recast13.types.builders;
|
|
61779
61830
|
async function imperativeCacheTypef(config2, docs) {
|
|
61780
61831
|
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
61781
61832
|
config: config2,
|
|
@@ -61791,87 +61842,87 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
61791
61842
|
}) ?? "any";
|
|
61792
61843
|
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
61793
61844
|
const body = [];
|
|
61794
|
-
const declaration =
|
|
61795
|
-
|
|
61796
|
-
|
|
61797
|
-
|
|
61798
|
-
|
|
61799
|
-
|
|
61845
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
61846
|
+
AST13.identifier(CacheTypeDefName),
|
|
61847
|
+
AST13.tsTypeLiteral([
|
|
61848
|
+
AST13.tsPropertySignature(
|
|
61849
|
+
AST13.identifier("types"),
|
|
61850
|
+
AST13.tsTypeAnnotation(typeDefinitions(config2, body, docs, returnType))
|
|
61800
61851
|
),
|
|
61801
|
-
|
|
61802
|
-
|
|
61803
|
-
|
|
61852
|
+
AST13.tsPropertySignature(
|
|
61853
|
+
AST13.identifier("lists"),
|
|
61854
|
+
AST13.tsTypeAnnotation(listDefinitions(config2, body, docs))
|
|
61804
61855
|
),
|
|
61805
|
-
|
|
61806
|
-
|
|
61807
|
-
|
|
61856
|
+
AST13.tsPropertySignature(
|
|
61857
|
+
AST13.identifier("queries"),
|
|
61858
|
+
AST13.tsTypeAnnotation(queryDefinitions(config2, body, docs, returnType))
|
|
61808
61859
|
)
|
|
61809
61860
|
])
|
|
61810
61861
|
);
|
|
61811
61862
|
declaration.declare = true;
|
|
61812
|
-
const importRecord =
|
|
61813
|
-
[
|
|
61814
|
-
|
|
61863
|
+
const importRecord = AST13.importDeclaration(
|
|
61864
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
61865
|
+
AST13.stringLiteral("./public/record")
|
|
61815
61866
|
);
|
|
61816
61867
|
importRecord.importKind = "type";
|
|
61817
61868
|
await fs_exports.writeFile(
|
|
61818
61869
|
target,
|
|
61819
|
-
|
|
61820
|
-
|
|
61870
|
+
recast13.prettyPrint(
|
|
61871
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
61821
61872
|
).code
|
|
61822
61873
|
);
|
|
61823
61874
|
}
|
|
61824
61875
|
function typeDefinitions(config2, body, docs, returnType) {
|
|
61825
61876
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
61826
61877
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61827
|
-
const
|
|
61878
|
+
const types15 = Object.values(config2.schema.getTypeMap()).filter(
|
|
61828
61879
|
(type) => !graphql17.isAbstractType(type) && !graphql17.isScalarType(type) && !graphql17.isEnumType(type) && !graphql17.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
61829
61880
|
);
|
|
61830
61881
|
const fragmentMap = fragmentListMap(
|
|
61831
61882
|
config2,
|
|
61832
|
-
|
|
61883
|
+
types15.map((type) => type.name),
|
|
61833
61884
|
body,
|
|
61834
61885
|
docs,
|
|
61835
61886
|
returnType
|
|
61836
61887
|
);
|
|
61837
|
-
return
|
|
61838
|
-
|
|
61888
|
+
return AST13.tsTypeLiteral(
|
|
61889
|
+
types15.map((type) => {
|
|
61839
61890
|
let typeName = type.name;
|
|
61840
61891
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
61841
61892
|
typeName = "__ROOT__";
|
|
61842
61893
|
}
|
|
61843
|
-
let idFields =
|
|
61894
|
+
let idFields = AST13.tsNeverKeyword();
|
|
61844
61895
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
61845
61896
|
if (graphql17.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
61846
|
-
idFields =
|
|
61897
|
+
idFields = AST13.tsTypeLiteral(
|
|
61847
61898
|
keys2.map((key) => {
|
|
61848
61899
|
const fieldType = type.getFields()[key];
|
|
61849
61900
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61850
|
-
return
|
|
61851
|
-
|
|
61852
|
-
|
|
61901
|
+
return AST13.tsPropertySignature(
|
|
61902
|
+
AST13.identifier(key),
|
|
61903
|
+
AST13.tsTypeAnnotation(
|
|
61853
61904
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61854
61905
|
)
|
|
61855
61906
|
);
|
|
61856
61907
|
})
|
|
61857
61908
|
);
|
|
61858
61909
|
} else if (typeName === "__ROOT__") {
|
|
61859
|
-
idFields =
|
|
61910
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
61860
61911
|
}
|
|
61861
|
-
let fields =
|
|
61912
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
61862
61913
|
if (graphql17.isObjectType(type)) {
|
|
61863
|
-
fields =
|
|
61914
|
+
fields = AST13.tsTypeLiteral(
|
|
61864
61915
|
Object.entries(type.getFields()).map(
|
|
61865
61916
|
([key, fieldType]) => {
|
|
61866
61917
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61867
|
-
let typeOptions =
|
|
61918
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
61868
61919
|
if (graphql17.isScalarType(unwrapped.type)) {
|
|
61869
61920
|
typeOptions.types.push(
|
|
61870
61921
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61871
61922
|
);
|
|
61872
61923
|
} else if (graphql17.isEnumType(unwrapped.type)) {
|
|
61873
61924
|
typeOptions.types.push(
|
|
61874
|
-
|
|
61925
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
61875
61926
|
);
|
|
61876
61927
|
} else if (!graphql17.isAbstractType(unwrapped.type)) {
|
|
61877
61928
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -61882,21 +61933,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61882
61933
|
}
|
|
61883
61934
|
for (const wrapper of unwrapped.wrappers) {
|
|
61884
61935
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
61885
|
-
typeOptions =
|
|
61886
|
-
|
|
61936
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
61937
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
61887
61938
|
);
|
|
61888
61939
|
} else if (wrapper === "List" /* List */) {
|
|
61889
|
-
typeOptions =
|
|
61890
|
-
|
|
61940
|
+
typeOptions = AST13.tsArrayType(
|
|
61941
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
61891
61942
|
);
|
|
61892
61943
|
}
|
|
61893
61944
|
}
|
|
61894
61945
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
61895
61946
|
typeOptions = typeOptions.typeAnnotation;
|
|
61896
61947
|
}
|
|
61897
|
-
let args =
|
|
61948
|
+
let args = AST13.tsNeverKeyword();
|
|
61898
61949
|
if (fieldType.args?.length > 0) {
|
|
61899
|
-
args =
|
|
61950
|
+
args = AST13.tsTypeLiteral(
|
|
61900
61951
|
fieldType.args.map((arg) => {
|
|
61901
61952
|
addReferencedInputTypes(
|
|
61902
61953
|
config2,
|
|
@@ -61906,9 +61957,9 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61906
61957
|
/* @__PURE__ */ new Set(),
|
|
61907
61958
|
arg.type
|
|
61908
61959
|
);
|
|
61909
|
-
const prop =
|
|
61910
|
-
|
|
61911
|
-
|
|
61960
|
+
const prop = AST13.tsPropertySignature(
|
|
61961
|
+
AST13.identifier(arg.name),
|
|
61962
|
+
AST13.tsTypeAnnotation(
|
|
61912
61963
|
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg, body)
|
|
61913
61964
|
)
|
|
61914
61965
|
);
|
|
@@ -61918,17 +61969,17 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61918
61969
|
})
|
|
61919
61970
|
);
|
|
61920
61971
|
}
|
|
61921
|
-
return
|
|
61922
|
-
|
|
61923
|
-
|
|
61924
|
-
|
|
61925
|
-
|
|
61926
|
-
|
|
61927
|
-
|
|
61972
|
+
return AST13.tsPropertySignature(
|
|
61973
|
+
AST13.identifier(key),
|
|
61974
|
+
AST13.tsTypeAnnotation(
|
|
61975
|
+
AST13.tsTypeLiteral([
|
|
61976
|
+
AST13.tsPropertySignature(
|
|
61977
|
+
AST13.identifier("type"),
|
|
61978
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
61928
61979
|
),
|
|
61929
|
-
|
|
61930
|
-
|
|
61931
|
-
|
|
61980
|
+
AST13.tsPropertySignature(
|
|
61981
|
+
AST13.identifier("args"),
|
|
61982
|
+
AST13.tsTypeAnnotation(args)
|
|
61932
61983
|
)
|
|
61933
61984
|
])
|
|
61934
61985
|
)
|
|
@@ -61937,21 +61988,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61937
61988
|
)
|
|
61938
61989
|
);
|
|
61939
61990
|
}
|
|
61940
|
-
return
|
|
61941
|
-
|
|
61942
|
-
|
|
61943
|
-
|
|
61944
|
-
|
|
61945
|
-
|
|
61946
|
-
|
|
61991
|
+
return AST13.tsPropertySignature(
|
|
61992
|
+
AST13.identifier(typeName),
|
|
61993
|
+
AST13.tsTypeAnnotation(
|
|
61994
|
+
AST13.tsTypeLiteral([
|
|
61995
|
+
AST13.tsPropertySignature(
|
|
61996
|
+
AST13.identifier("idFields"),
|
|
61997
|
+
AST13.tsTypeAnnotation(idFields)
|
|
61947
61998
|
),
|
|
61948
|
-
|
|
61949
|
-
|
|
61950
|
-
|
|
61999
|
+
AST13.tsPropertySignature(
|
|
62000
|
+
AST13.identifier("fields"),
|
|
62001
|
+
AST13.tsTypeAnnotation(fields)
|
|
61951
62002
|
),
|
|
61952
|
-
|
|
61953
|
-
|
|
61954
|
-
|
|
62003
|
+
AST13.tsPropertySignature(
|
|
62004
|
+
AST13.identifier("fragments"),
|
|
62005
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
61955
62006
|
)
|
|
61956
62007
|
])
|
|
61957
62008
|
)
|
|
@@ -61993,28 +62044,28 @@ function listDefinitions(config2, body, docs) {
|
|
|
61993
62044
|
possibleTypes.push(listType.name);
|
|
61994
62045
|
}
|
|
61995
62046
|
lists.push(
|
|
61996
|
-
|
|
61997
|
-
|
|
61998
|
-
|
|
61999
|
-
|
|
62000
|
-
|
|
62001
|
-
|
|
62002
|
-
|
|
62003
|
-
|
|
62047
|
+
AST13.tsPropertySignature(
|
|
62048
|
+
AST13.identifier(nameValue),
|
|
62049
|
+
AST13.tsTypeAnnotation(
|
|
62050
|
+
AST13.tsTypeLiteral([
|
|
62051
|
+
AST13.tsPropertySignature(
|
|
62052
|
+
AST13.identifier("types"),
|
|
62053
|
+
AST13.tsTypeAnnotation(
|
|
62054
|
+
AST13.tsUnionType(
|
|
62004
62055
|
possibleTypes.map(
|
|
62005
|
-
(possible) =>
|
|
62056
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
62006
62057
|
)
|
|
62007
62058
|
)
|
|
62008
62059
|
)
|
|
62009
62060
|
),
|
|
62010
|
-
|
|
62011
|
-
|
|
62012
|
-
|
|
62013
|
-
targetFieldDefinition.args.length === 0 ?
|
|
62061
|
+
AST13.tsPropertySignature(
|
|
62062
|
+
AST13.identifier("filters"),
|
|
62063
|
+
AST13.tsTypeAnnotation(
|
|
62064
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
62014
62065
|
targetFieldDefinition.args.map((arg) => {
|
|
62015
|
-
const argDef =
|
|
62016
|
-
|
|
62017
|
-
|
|
62066
|
+
const argDef = AST13.tsPropertySignature(
|
|
62067
|
+
AST13.identifier(arg.name),
|
|
62068
|
+
AST13.tsTypeAnnotation(
|
|
62018
62069
|
tsTypeReference(
|
|
62019
62070
|
config2,
|
|
62020
62071
|
/* @__PURE__ */ new Set(),
|
|
@@ -62036,10 +62087,10 @@ function listDefinitions(config2, body, docs) {
|
|
|
62036
62087
|
}
|
|
62037
62088
|
});
|
|
62038
62089
|
}
|
|
62039
|
-
return
|
|
62090
|
+
return AST13.tsTypeLiteral(lists);
|
|
62040
62091
|
}
|
|
62041
62092
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
62042
|
-
return
|
|
62093
|
+
return AST13.tsTupleType(
|
|
62043
62094
|
docs.reduce((prev, doc) => {
|
|
62044
62095
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
62045
62096
|
return prev;
|
|
@@ -62061,10 +62112,10 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
62061
62112
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
62062
62113
|
});
|
|
62063
62114
|
return prev.concat(
|
|
62064
|
-
|
|
62065
|
-
|
|
62066
|
-
|
|
62067
|
-
|
|
62115
|
+
AST13.tsTupleType([
|
|
62116
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
62117
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
62118
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
62068
62119
|
])
|
|
62069
62120
|
);
|
|
62070
62121
|
}, [])
|
|
@@ -62093,13 +62144,13 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62093
62144
|
),
|
|
62094
62145
|
import: [`${definition.name.value}$data`]
|
|
62095
62146
|
});
|
|
62096
|
-
let inputType =
|
|
62147
|
+
let inputType = AST13.tsNeverKeyword();
|
|
62097
62148
|
let directive = definition.directives?.find(
|
|
62098
62149
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
62099
62150
|
);
|
|
62100
62151
|
if (directive) {
|
|
62101
|
-
inputType =
|
|
62102
|
-
|
|
62152
|
+
inputType = AST13.tsTypeReference(
|
|
62153
|
+
AST13.identifier(
|
|
62103
62154
|
ensureImports({
|
|
62104
62155
|
config: config2,
|
|
62105
62156
|
body,
|
|
@@ -62114,11 +62165,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62114
62165
|
}
|
|
62115
62166
|
return {
|
|
62116
62167
|
...prev,
|
|
62117
|
-
[typeName]:
|
|
62168
|
+
[typeName]: AST13.tsTupleType(
|
|
62118
62169
|
previousValue.concat(
|
|
62119
|
-
|
|
62120
|
-
|
|
62121
|
-
|
|
62170
|
+
AST13.tsTupleType([
|
|
62171
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
62172
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
62122
62173
|
inputType
|
|
62123
62174
|
])
|
|
62124
62175
|
)
|
|
@@ -62128,11 +62179,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
62128
62179
|
}
|
|
62129
62180
|
var CacheTypeDefName = "CacheTypeDef";
|
|
62130
62181
|
function record(name) {
|
|
62131
|
-
return
|
|
62132
|
-
|
|
62133
|
-
|
|
62134
|
-
|
|
62135
|
-
|
|
62182
|
+
return AST13.tsTypeReference(
|
|
62183
|
+
AST13.identifier("Record"),
|
|
62184
|
+
AST13.tsTypeParameterInstantiation([
|
|
62185
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
62186
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
62136
62187
|
])
|
|
62137
62188
|
);
|
|
62138
62189
|
}
|
|
@@ -62185,25 +62236,25 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
62185
62236
|
|
|
62186
62237
|
// src/codegen/generators/definitions/enums.ts
|
|
62187
62238
|
var graphql19 = __toESM(require_graphql2(), 1);
|
|
62188
|
-
var
|
|
62189
|
-
var
|
|
62239
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
62240
|
+
var AST14 = recast14.types.builders;
|
|
62190
62241
|
async function definitionsGenerator(config2) {
|
|
62191
62242
|
const enums = graphql19.parse(graphql19.printSchema(config2.schema)).definitions.filter(
|
|
62192
62243
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
62193
62244
|
).filter((def) => !config2.isInternalEnum(def));
|
|
62194
62245
|
const { code: runtimeDefinitions } = await printJS(
|
|
62195
|
-
|
|
62246
|
+
AST14.program(
|
|
62196
62247
|
enums.map((defn) => {
|
|
62197
62248
|
const name = defn.name.value;
|
|
62198
62249
|
return moduleExport(
|
|
62199
62250
|
config2,
|
|
62200
62251
|
name,
|
|
62201
|
-
|
|
62252
|
+
AST14.objectExpression(
|
|
62202
62253
|
defn.values?.map((value) => {
|
|
62203
62254
|
const str = value.name.value;
|
|
62204
|
-
return
|
|
62205
|
-
|
|
62206
|
-
|
|
62255
|
+
return AST14.objectProperty(
|
|
62256
|
+
AST14.stringLiteral(str),
|
|
62257
|
+
AST14.stringLiteral(str)
|
|
62207
62258
|
);
|
|
62208
62259
|
}) || []
|
|
62209
62260
|
)
|