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
|
@@ -1972,12 +1972,12 @@ var require_parser = __commonJS({
|
|
|
1972
1972
|
return [];
|
|
1973
1973
|
}
|
|
1974
1974
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
1975
|
-
var
|
|
1975
|
+
var types15 = [];
|
|
1976
1976
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
1977
1977
|
do {
|
|
1978
|
-
|
|
1978
|
+
types15.push(this.parseNamedType());
|
|
1979
1979
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
1980
|
-
return
|
|
1980
|
+
return types15;
|
|
1981
1981
|
}
|
|
1982
1982
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
1983
1983
|
};
|
|
@@ -2056,13 +2056,13 @@ var require_parser = __commonJS({
|
|
|
2056
2056
|
this.expectKeyword("union");
|
|
2057
2057
|
var name = this.parseName();
|
|
2058
2058
|
var directives = this.parseDirectives(true);
|
|
2059
|
-
var
|
|
2059
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2060
2060
|
return {
|
|
2061
2061
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
2062
2062
|
description,
|
|
2063
2063
|
name,
|
|
2064
2064
|
directives,
|
|
2065
|
-
types:
|
|
2065
|
+
types: types15,
|
|
2066
2066
|
loc: this.loc(start)
|
|
2067
2067
|
};
|
|
2068
2068
|
};
|
|
@@ -2220,15 +2220,15 @@ var require_parser = __commonJS({
|
|
|
2220
2220
|
this.expectKeyword("union");
|
|
2221
2221
|
var name = this.parseName();
|
|
2222
2222
|
var directives = this.parseDirectives(true);
|
|
2223
|
-
var
|
|
2224
|
-
if (directives.length === 0 &&
|
|
2223
|
+
var types15 = this.parseUnionMemberTypes();
|
|
2224
|
+
if (directives.length === 0 && types15.length === 0) {
|
|
2225
2225
|
throw this.unexpected();
|
|
2226
2226
|
}
|
|
2227
2227
|
return {
|
|
2228
2228
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
2229
2229
|
name,
|
|
2230
2230
|
directives,
|
|
2231
|
-
types:
|
|
2231
|
+
types: types15,
|
|
2232
2232
|
loc: this.loc(start)
|
|
2233
2233
|
};
|
|
2234
2234
|
};
|
|
@@ -3206,8 +3206,8 @@ var require_printer = __commonJS({
|
|
|
3206
3206
|
return join2(["interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3207
3207
|
}),
|
|
3208
3208
|
UnionTypeDefinition: addDescription(function(_ref27) {
|
|
3209
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
3210
|
-
return join2(["union", name, join2(directives, " "),
|
|
3209
|
+
var name = _ref27.name, directives = _ref27.directives, types15 = _ref27.types;
|
|
3210
|
+
return join2(["union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3211
3211
|
}),
|
|
3212
3212
|
EnumTypeDefinition: addDescription(function(_ref28) {
|
|
3213
3213
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -3242,8 +3242,8 @@ var require_printer = __commonJS({
|
|
|
3242
3242
|
return join2(["extend interface", name, wrap("implements ", join2(interfaces, " & ")), join2(directives, " "), block(fields)], " ");
|
|
3243
3243
|
},
|
|
3244
3244
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
3245
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
3246
|
-
return join2(["extend union", name, join2(directives, " "),
|
|
3245
|
+
var name = _ref36.name, directives = _ref36.directives, types15 = _ref36.types;
|
|
3246
|
+
return join2(["extend union", name, join2(directives, " "), types15 && types15.length !== 0 ? "= " + join2(types15, " | ") : ""], " ");
|
|
3247
3247
|
},
|
|
3248
3248
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
3249
3249
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -3914,9 +3914,9 @@ var require_definition = __commonJS({
|
|
|
3914
3914
|
exports.GraphQLUnionType = GraphQLUnionType;
|
|
3915
3915
|
(0, _defineInspect.default)(GraphQLUnionType);
|
|
3916
3916
|
function defineTypes(config2) {
|
|
3917
|
-
var
|
|
3918
|
-
Array.isArray(
|
|
3919
|
-
return
|
|
3917
|
+
var types15 = resolveThunk(config2.types);
|
|
3918
|
+
Array.isArray(types15) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
|
|
3919
|
+
return types15;
|
|
3920
3920
|
}
|
|
3921
3921
|
var GraphQLEnumType = /* @__PURE__ */ function() {
|
|
3922
3922
|
function GraphQLEnumType2(config2) {
|
|
@@ -11553,7 +11553,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
11553
11553
|
return new _definition.GraphQLUnionType({
|
|
11554
11554
|
name: unionIntrospection.name,
|
|
11555
11555
|
description: unionIntrospection.description,
|
|
11556
|
-
types: function
|
|
11556
|
+
types: function types15() {
|
|
11557
11557
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
11558
11558
|
}
|
|
11559
11559
|
});
|
|
@@ -11898,7 +11898,7 @@ var require_extendSchema = __commonJS({
|
|
|
11898
11898
|
var config2 = type.toConfig();
|
|
11899
11899
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
11900
11900
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
|
|
11901
|
-
types: function
|
|
11901
|
+
types: function types15() {
|
|
11902
11902
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
11903
11903
|
},
|
|
11904
11904
|
extensionASTNodes: config2.extensionASTNodes.concat(extensions)
|
|
@@ -12046,17 +12046,17 @@ var require_extendSchema = __commonJS({
|
|
|
12046
12046
|
return interfaces;
|
|
12047
12047
|
}
|
|
12048
12048
|
function buildUnionTypes(nodes) {
|
|
12049
|
-
var
|
|
12049
|
+
var types15 = [];
|
|
12050
12050
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
12051
12051
|
var _node$types;
|
|
12052
12052
|
var node = nodes[_i32];
|
|
12053
12053
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
12054
12054
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
12055
12055
|
var type = typeNodes[_i34];
|
|
12056
|
-
|
|
12056
|
+
types15.push(getNamedType2(type));
|
|
12057
12057
|
}
|
|
12058
12058
|
}
|
|
12059
|
-
return
|
|
12059
|
+
return types15;
|
|
12060
12060
|
}
|
|
12061
12061
|
function buildType(astNode) {
|
|
12062
12062
|
var _typeExtensionsMap$na;
|
|
@@ -12113,7 +12113,7 @@ var require_extendSchema = __commonJS({
|
|
|
12113
12113
|
return new _definition.GraphQLUnionType({
|
|
12114
12114
|
name: name2,
|
|
12115
12115
|
description,
|
|
12116
|
-
types: function
|
|
12116
|
+
types: function types15() {
|
|
12117
12117
|
return buildUnionTypes(_allNodes3);
|
|
12118
12118
|
},
|
|
12119
12119
|
astNode,
|
|
@@ -12411,7 +12411,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
12411
12411
|
if ((0, _definition.isUnionType)(type)) {
|
|
12412
12412
|
var _config2 = type.toConfig();
|
|
12413
12413
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, {
|
|
12414
|
-
types: function
|
|
12414
|
+
types: function types15() {
|
|
12415
12415
|
return sortTypes(_config2.types);
|
|
12416
12416
|
}
|
|
12417
12417
|
}));
|
|
@@ -12496,10 +12496,10 @@ var require_printSchema = __commonJS({
|
|
|
12496
12496
|
}
|
|
12497
12497
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
12498
12498
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
12499
|
-
var
|
|
12499
|
+
var types15 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
12500
12500
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
12501
12501
|
return printDirective(directive, options);
|
|
12502
|
-
}),
|
|
12502
|
+
}), types15.map(function(type) {
|
|
12503
12503
|
return printType(type, options);
|
|
12504
12504
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
12505
12505
|
}
|
|
@@ -12574,8 +12574,8 @@ var require_printSchema = __commonJS({
|
|
|
12574
12574
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
12575
12575
|
}
|
|
12576
12576
|
function printUnion(type, options) {
|
|
12577
|
-
var
|
|
12578
|
-
var possibleTypes =
|
|
12577
|
+
var types15 = type.getTypes();
|
|
12578
|
+
var possibleTypes = types15.length ? " = " + types15.join(" | ") : "";
|
|
12579
12579
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
12580
12580
|
}
|
|
12581
12581
|
function printEnum(type, options) {
|
|
@@ -23905,14 +23905,14 @@ var require_lib3 = __commonJS({
|
|
|
23905
23905
|
this.preserveSpace = !!preserveSpace;
|
|
23906
23906
|
}
|
|
23907
23907
|
};
|
|
23908
|
-
var
|
|
23908
|
+
var types15 = {
|
|
23909
23909
|
brace: new TokContext("{"),
|
|
23910
23910
|
j_oTag: new TokContext("<tag"),
|
|
23911
23911
|
j_cTag: new TokContext("</tag"),
|
|
23912
23912
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
23913
23913
|
};
|
|
23914
23914
|
{
|
|
23915
|
-
|
|
23915
|
+
types15.template = new TokContext("`", true);
|
|
23916
23916
|
}
|
|
23917
23917
|
var beforeExpr = true;
|
|
23918
23918
|
var startsExpr = true;
|
|
@@ -24444,17 +24444,17 @@ var require_lib3 = __commonJS({
|
|
|
24444
24444
|
context.pop();
|
|
24445
24445
|
};
|
|
24446
24446
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
24447
|
-
context.push(
|
|
24447
|
+
context.push(types15.brace);
|
|
24448
24448
|
};
|
|
24449
24449
|
tokenTypes[22].updateContext = (context) => {
|
|
24450
|
-
if (context[context.length - 1] ===
|
|
24450
|
+
if (context[context.length - 1] === types15.template) {
|
|
24451
24451
|
context.pop();
|
|
24452
24452
|
} else {
|
|
24453
|
-
context.push(
|
|
24453
|
+
context.push(types15.template);
|
|
24454
24454
|
}
|
|
24455
24455
|
};
|
|
24456
24456
|
tokenTypes[140].updateContext = (context) => {
|
|
24457
|
-
context.push(
|
|
24457
|
+
context.push(types15.j_expr, types15.j_oTag);
|
|
24458
24458
|
};
|
|
24459
24459
|
}
|
|
24460
24460
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -25095,7 +25095,7 @@ var require_lib3 = __commonJS({
|
|
|
25095
25095
|
this.lastTokEndLoc = null;
|
|
25096
25096
|
this.lastTokStartLoc = null;
|
|
25097
25097
|
this.lastTokStart = 0;
|
|
25098
|
-
this.context = [
|
|
25098
|
+
this.context = [types15.brace];
|
|
25099
25099
|
this.canStartJSXElement = true;
|
|
25100
25100
|
this.containsEsc = false;
|
|
25101
25101
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -29019,7 +29019,7 @@ var require_lib3 = __commonJS({
|
|
|
29019
29019
|
context
|
|
29020
29020
|
} = this.state;
|
|
29021
29021
|
const currentContext = context[context.length - 1];
|
|
29022
|
-
if (currentContext ===
|
|
29022
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
29023
29023
|
context.pop();
|
|
29024
29024
|
}
|
|
29025
29025
|
}
|
|
@@ -30079,9 +30079,9 @@ var require_lib3 = __commonJS({
|
|
|
30079
30079
|
switch (this.state.type) {
|
|
30080
30080
|
case 5:
|
|
30081
30081
|
node = this.startNode();
|
|
30082
|
-
this.setContext(
|
|
30082
|
+
this.setContext(types15.brace);
|
|
30083
30083
|
this.next();
|
|
30084
|
-
node = this.jsxParseExpressionContainer(node,
|
|
30084
|
+
node = this.jsxParseExpressionContainer(node, types15.j_oTag);
|
|
30085
30085
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
30086
30086
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
30087
30087
|
at: node
|
|
@@ -30104,7 +30104,7 @@ var require_lib3 = __commonJS({
|
|
|
30104
30104
|
jsxParseSpreadChild(node) {
|
|
30105
30105
|
this.next();
|
|
30106
30106
|
node.expression = this.parseExpression();
|
|
30107
|
-
this.setContext(
|
|
30107
|
+
this.setContext(types15.j_expr);
|
|
30108
30108
|
this.state.canStartJSXElement = true;
|
|
30109
30109
|
this.expect(8);
|
|
30110
30110
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -30124,11 +30124,11 @@ var require_lib3 = __commonJS({
|
|
|
30124
30124
|
jsxParseAttribute() {
|
|
30125
30125
|
const node = this.startNode();
|
|
30126
30126
|
if (this.match(5)) {
|
|
30127
|
-
this.setContext(
|
|
30127
|
+
this.setContext(types15.brace);
|
|
30128
30128
|
this.next();
|
|
30129
30129
|
this.expect(21);
|
|
30130
30130
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
30131
|
-
this.setContext(
|
|
30131
|
+
this.setContext(types15.j_oTag);
|
|
30132
30132
|
this.state.canStartJSXElement = true;
|
|
30133
30133
|
this.expect(8);
|
|
30134
30134
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -30187,12 +30187,12 @@ var require_lib3 = __commonJS({
|
|
|
30187
30187
|
break;
|
|
30188
30188
|
case 5: {
|
|
30189
30189
|
const node2 = this.startNode();
|
|
30190
|
-
this.setContext(
|
|
30190
|
+
this.setContext(types15.brace);
|
|
30191
30191
|
this.next();
|
|
30192
30192
|
if (this.match(21)) {
|
|
30193
30193
|
children.push(this.jsxParseSpreadChild(node2));
|
|
30194
30194
|
} else {
|
|
30195
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
30195
|
+
children.push(this.jsxParseExpressionContainer(node2, types15.j_expr));
|
|
30196
30196
|
}
|
|
30197
30197
|
break;
|
|
30198
30198
|
}
|
|
@@ -30263,10 +30263,10 @@ var require_lib3 = __commonJS({
|
|
|
30263
30263
|
}
|
|
30264
30264
|
getTokenFromCode(code) {
|
|
30265
30265
|
const context = this.curContext();
|
|
30266
|
-
if (context ===
|
|
30266
|
+
if (context === types15.j_expr) {
|
|
30267
30267
|
return this.jsxReadToken();
|
|
30268
30268
|
}
|
|
30269
|
-
if (context ===
|
|
30269
|
+
if (context === types15.j_oTag || context === types15.j_cTag) {
|
|
30270
30270
|
if (isIdentifierStart(code)) {
|
|
30271
30271
|
return this.jsxReadWord();
|
|
30272
30272
|
}
|
|
@@ -30274,7 +30274,7 @@ var require_lib3 = __commonJS({
|
|
|
30274
30274
|
++this.state.pos;
|
|
30275
30275
|
return this.finishToken(141);
|
|
30276
30276
|
}
|
|
30277
|
-
if ((code === 34 || code === 39) && context ===
|
|
30277
|
+
if ((code === 34 || code === 39) && context === types15.j_oTag) {
|
|
30278
30278
|
return this.jsxReadString(code);
|
|
30279
30279
|
}
|
|
30280
30280
|
}
|
|
@@ -30290,17 +30290,17 @@ var require_lib3 = __commonJS({
|
|
|
30290
30290
|
type
|
|
30291
30291
|
} = this.state;
|
|
30292
30292
|
if (type === 56 && prevType === 140) {
|
|
30293
|
-
context.splice(-2, 2,
|
|
30293
|
+
context.splice(-2, 2, types15.j_cTag);
|
|
30294
30294
|
this.state.canStartJSXElement = false;
|
|
30295
30295
|
} else if (type === 140) {
|
|
30296
|
-
context.push(
|
|
30296
|
+
context.push(types15.j_oTag);
|
|
30297
30297
|
} else if (type === 141) {
|
|
30298
30298
|
const out = context[context.length - 1];
|
|
30299
|
-
if (out ===
|
|
30299
|
+
if (out === types15.j_oTag && prevType === 56 || out === types15.j_cTag) {
|
|
30300
30300
|
context.pop();
|
|
30301
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
30301
|
+
this.state.canStartJSXElement = context[context.length - 1] === types15.j_expr;
|
|
30302
30302
|
} else {
|
|
30303
|
-
this.setContext(
|
|
30303
|
+
this.setContext(types15.j_expr);
|
|
30304
30304
|
this.state.canStartJSXElement = true;
|
|
30305
30305
|
}
|
|
30306
30306
|
} else {
|
|
@@ -31308,14 +31308,14 @@ var require_lib3 = __commonJS({
|
|
|
31308
31308
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
31309
31309
|
const node = this.startNode();
|
|
31310
31310
|
const hasLeadingOperator = this.eat(operator);
|
|
31311
|
-
const
|
|
31311
|
+
const types16 = [];
|
|
31312
31312
|
do {
|
|
31313
|
-
|
|
31313
|
+
types16.push(parseConstituentType());
|
|
31314
31314
|
} while (this.eat(operator));
|
|
31315
|
-
if (
|
|
31316
|
-
return
|
|
31315
|
+
if (types16.length === 1 && !hasLeadingOperator) {
|
|
31316
|
+
return types16[0];
|
|
31317
31317
|
}
|
|
31318
|
-
node.types =
|
|
31318
|
+
node.types = types16;
|
|
31319
31319
|
return this.finishNode(node, kind);
|
|
31320
31320
|
}
|
|
31321
31321
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -32544,7 +32544,7 @@ var require_lib3 = __commonJS({
|
|
|
32544
32544
|
context
|
|
32545
32545
|
} = this.state;
|
|
32546
32546
|
const currentContext = context[context.length - 1];
|
|
32547
|
-
if (currentContext ===
|
|
32547
|
+
if (currentContext === types15.j_oTag || currentContext === types15.j_expr) {
|
|
32548
32548
|
context.pop();
|
|
32549
32549
|
}
|
|
32550
32550
|
}
|
|
@@ -38183,9 +38183,9 @@ var require_shared = __commonJS({
|
|
|
38183
38183
|
var tslib_1 = require_tslib();
|
|
38184
38184
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
38185
38185
|
function default_1(fork) {
|
|
38186
|
-
var
|
|
38187
|
-
var Type =
|
|
38188
|
-
var builtin =
|
|
38186
|
+
var types15 = fork.use(types_1.default);
|
|
38187
|
+
var Type = types15.Type;
|
|
38188
|
+
var builtin = types15.builtInTypes;
|
|
38189
38189
|
var isNumber = builtin.number;
|
|
38190
38190
|
function geq(than) {
|
|
38191
38191
|
return Type.from(function(value) {
|
|
@@ -38335,9 +38335,9 @@ var require_types = __commonJS({
|
|
|
38335
38335
|
}(BaseType);
|
|
38336
38336
|
var OrType = function(_super) {
|
|
38337
38337
|
tslib_1.__extends(OrType2, _super);
|
|
38338
|
-
function OrType2(
|
|
38338
|
+
function OrType2(types15) {
|
|
38339
38339
|
var _this = _super.call(this) || this;
|
|
38340
|
-
_this.types =
|
|
38340
|
+
_this.types = types15;
|
|
38341
38341
|
_this.kind = "OrType";
|
|
38342
38342
|
return _this;
|
|
38343
38343
|
}
|
|
@@ -38478,11 +38478,11 @@ var require_types = __commonJS({
|
|
|
38478
38478
|
function typesPlugin(_fork) {
|
|
38479
38479
|
var Type = {
|
|
38480
38480
|
or: function() {
|
|
38481
|
-
var
|
|
38481
|
+
var types15 = [];
|
|
38482
38482
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38483
|
-
|
|
38483
|
+
types15[_i] = arguments[_i];
|
|
38484
38484
|
}
|
|
38485
|
-
return new OrType(
|
|
38485
|
+
return new OrType(types15.map(function(type) {
|
|
38486
38486
|
return Type.from(type);
|
|
38487
38487
|
}));
|
|
38488
38488
|
},
|
|
@@ -38927,9 +38927,9 @@ var require_path2 = __commonJS({
|
|
|
38927
38927
|
var Op = Object.prototype;
|
|
38928
38928
|
var hasOwn = Op.hasOwnProperty;
|
|
38929
38929
|
function pathPlugin(fork) {
|
|
38930
|
-
var
|
|
38931
|
-
var isArray =
|
|
38932
|
-
var isNumber =
|
|
38930
|
+
var types15 = fork.use(types_1.default);
|
|
38931
|
+
var isArray = types15.builtInTypes.array;
|
|
38932
|
+
var isNumber = types15.builtInTypes.number;
|
|
38933
38933
|
var Path = function Path2(value, parentPath, name) {
|
|
38934
38934
|
if (!(this instanceof Path2)) {
|
|
38935
38935
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -39231,13 +39231,13 @@ var require_scope = __commonJS({
|
|
|
39231
39231
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
39232
39232
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39233
39233
|
function scopePlugin(fork) {
|
|
39234
|
-
var
|
|
39235
|
-
var Type =
|
|
39236
|
-
var namedTypes =
|
|
39234
|
+
var types15 = fork.use(types_1.default);
|
|
39235
|
+
var Type = types15.Type;
|
|
39236
|
+
var namedTypes = types15.namedTypes;
|
|
39237
39237
|
var Node = namedTypes.Node;
|
|
39238
39238
|
var Expression = namedTypes.Expression;
|
|
39239
|
-
var isArray =
|
|
39240
|
-
var b =
|
|
39239
|
+
var isArray = types15.builtInTypes.array;
|
|
39240
|
+
var b = types15.builders;
|
|
39241
39241
|
var Scope = function Scope2(path2, parentScope) {
|
|
39242
39242
|
if (!(this instanceof Scope2)) {
|
|
39243
39243
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -39300,7 +39300,7 @@ var require_scope = __commonJS({
|
|
|
39300
39300
|
++index;
|
|
39301
39301
|
}
|
|
39302
39302
|
var name = prefix + index;
|
|
39303
|
-
return this.bindings[name] =
|
|
39303
|
+
return this.bindings[name] = types15.builders.identifier(name);
|
|
39304
39304
|
};
|
|
39305
39305
|
Sp.injectTemporary = function(identifier, init) {
|
|
39306
39306
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -39376,7 +39376,7 @@ var require_scope = __commonJS({
|
|
|
39376
39376
|
bindings
|
|
39377
39377
|
);
|
|
39378
39378
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
39379
|
-
|
|
39379
|
+
types15.eachField(node, function(name, child) {
|
|
39380
39380
|
var childPath = path2.get(name);
|
|
39381
39381
|
if (!pathHasValue(childPath, child)) {
|
|
39382
39382
|
throw new Error("");
|
|
@@ -39454,24 +39454,24 @@ var require_scope = __commonJS({
|
|
|
39454
39454
|
addPattern(patternPath.get("argument"), bindings);
|
|
39455
39455
|
}
|
|
39456
39456
|
}
|
|
39457
|
-
function addTypePattern(patternPath,
|
|
39457
|
+
function addTypePattern(patternPath, types16) {
|
|
39458
39458
|
var pattern = patternPath.value;
|
|
39459
39459
|
namedTypes.Pattern.assert(pattern);
|
|
39460
39460
|
if (namedTypes.Identifier.check(pattern)) {
|
|
39461
|
-
if (hasOwn.call(
|
|
39462
|
-
|
|
39461
|
+
if (hasOwn.call(types16, pattern.name)) {
|
|
39462
|
+
types16[pattern.name].push(patternPath);
|
|
39463
39463
|
} else {
|
|
39464
|
-
|
|
39464
|
+
types16[pattern.name] = [patternPath];
|
|
39465
39465
|
}
|
|
39466
39466
|
}
|
|
39467
39467
|
}
|
|
39468
|
-
function addTypeParameter(parameterPath,
|
|
39468
|
+
function addTypeParameter(parameterPath, types16) {
|
|
39469
39469
|
var parameter = parameterPath.value;
|
|
39470
39470
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
39471
|
-
if (hasOwn.call(
|
|
39472
|
-
|
|
39471
|
+
if (hasOwn.call(types16, parameter.name)) {
|
|
39472
|
+
types16[parameter.name].push(parameterPath);
|
|
39473
39473
|
} else {
|
|
39474
|
-
|
|
39474
|
+
types16[parameter.name] = [parameterPath];
|
|
39475
39475
|
}
|
|
39476
39476
|
}
|
|
39477
39477
|
Sp.lookup = function(name) {
|
|
@@ -39512,11 +39512,11 @@ var require_node_path = __commonJS({
|
|
|
39512
39512
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
39513
39513
|
var shared_1 = require_shared();
|
|
39514
39514
|
function nodePathPlugin(fork) {
|
|
39515
|
-
var
|
|
39516
|
-
var n =
|
|
39517
|
-
var b =
|
|
39518
|
-
var isNumber =
|
|
39519
|
-
var isArray =
|
|
39515
|
+
var types15 = fork.use(types_1.default);
|
|
39516
|
+
var n = types15.namedTypes;
|
|
39517
|
+
var b = types15.builders;
|
|
39518
|
+
var isNumber = types15.builtInTypes.number;
|
|
39519
|
+
var isArray = types15.builtInTypes.array;
|
|
39520
39520
|
var Path = fork.use(path_1.default);
|
|
39521
39521
|
var Scope = fork.use(scope_1.default);
|
|
39522
39522
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -39607,7 +39607,7 @@ var require_node_path = __commonJS({
|
|
|
39607
39607
|
return scope || null;
|
|
39608
39608
|
};
|
|
39609
39609
|
NPp.getValueProperty = function(name) {
|
|
39610
|
-
return
|
|
39610
|
+
return types15.getFieldValue(this.value, name);
|
|
39611
39611
|
};
|
|
39612
39612
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
39613
39613
|
var pp = this.parentPath;
|
|
@@ -39749,7 +39749,7 @@ var require_node_path = __commonJS({
|
|
|
39749
39749
|
return node.some(containsCallExpression);
|
|
39750
39750
|
}
|
|
39751
39751
|
if (n.Node.check(node)) {
|
|
39752
|
-
return
|
|
39752
|
+
return types15.someField(node, function(_name, child) {
|
|
39753
39753
|
return containsCallExpression(child);
|
|
39754
39754
|
});
|
|
39755
39755
|
}
|
|
@@ -39870,11 +39870,11 @@ var require_path_visitor = __commonJS({
|
|
|
39870
39870
|
var shared_1 = require_shared();
|
|
39871
39871
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
39872
39872
|
function pathVisitorPlugin(fork) {
|
|
39873
|
-
var
|
|
39873
|
+
var types15 = fork.use(types_1.default);
|
|
39874
39874
|
var NodePath = fork.use(node_path_1.default);
|
|
39875
|
-
var isArray =
|
|
39876
|
-
var isObject =
|
|
39877
|
-
var isFunction =
|
|
39875
|
+
var isArray = types15.builtInTypes.array;
|
|
39876
|
+
var isObject = types15.builtInTypes.object;
|
|
39877
|
+
var isFunction = types15.builtInTypes.function;
|
|
39878
39878
|
var undefined2;
|
|
39879
39879
|
var PathVisitor = function PathVisitor2() {
|
|
39880
39880
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -39894,7 +39894,7 @@ var require_path_visitor = __commonJS({
|
|
|
39894
39894
|
typeNames[methodName.slice("visit".length)] = true;
|
|
39895
39895
|
}
|
|
39896
39896
|
}
|
|
39897
|
-
var supertypeTable =
|
|
39897
|
+
var supertypeTable = types15.computeSupertypeLookupTable(typeNames);
|
|
39898
39898
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
39899
39899
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
39900
39900
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -40013,7 +40013,7 @@ var require_path_visitor = __commonJS({
|
|
|
40013
40013
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
40014
40014
|
} else if (!isObject.check(value)) {
|
|
40015
40015
|
} else {
|
|
40016
|
-
var childNames =
|
|
40016
|
+
var childNames = types15.getFieldNames(value);
|
|
40017
40017
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
40018
40018
|
childNames.push("comments");
|
|
40019
40019
|
}
|
|
@@ -40022,7 +40022,7 @@ var require_path_visitor = __commonJS({
|
|
|
40022
40022
|
for (var i = 0; i < childCount; ++i) {
|
|
40023
40023
|
var childName = childNames[i];
|
|
40024
40024
|
if (!hasOwn.call(value, childName)) {
|
|
40025
|
-
value[childName] =
|
|
40025
|
+
value[childName] = types15.getFieldValue(value, childName);
|
|
40026
40026
|
}
|
|
40027
40027
|
childPaths.push(path2.get(childName));
|
|
40028
40028
|
}
|
|
@@ -40165,13 +40165,13 @@ var require_equiv = __commonJS({
|
|
|
40165
40165
|
var shared_1 = require_shared();
|
|
40166
40166
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40167
40167
|
function default_1(fork) {
|
|
40168
|
-
var
|
|
40169
|
-
var getFieldNames =
|
|
40170
|
-
var getFieldValue =
|
|
40171
|
-
var isArray =
|
|
40172
|
-
var isObject =
|
|
40173
|
-
var isDate =
|
|
40174
|
-
var isRegExp =
|
|
40168
|
+
var types15 = fork.use(types_1.default);
|
|
40169
|
+
var getFieldNames = types15.getFieldNames;
|
|
40170
|
+
var getFieldValue = types15.getFieldValue;
|
|
40171
|
+
var isArray = types15.builtInTypes.array;
|
|
40172
|
+
var isObject = types15.builtInTypes.object;
|
|
40173
|
+
var isDate = types15.builtInTypes.Date;
|
|
40174
|
+
var isRegExp = types15.builtInTypes.RegExp;
|
|
40175
40175
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
40176
40176
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
40177
40177
|
if (isArray.check(problemPath)) {
|
|
@@ -40324,24 +40324,24 @@ var require_fork = __commonJS({
|
|
|
40324
40324
|
var shared_1 = require_shared();
|
|
40325
40325
|
function default_1(plugins) {
|
|
40326
40326
|
var fork = createFork();
|
|
40327
|
-
var
|
|
40327
|
+
var types15 = fork.use(types_1.default);
|
|
40328
40328
|
plugins.forEach(fork.use);
|
|
40329
|
-
|
|
40329
|
+
types15.finalize();
|
|
40330
40330
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
40331
40331
|
return {
|
|
40332
|
-
Type:
|
|
40333
|
-
builtInTypes:
|
|
40334
|
-
namedTypes:
|
|
40335
|
-
builders:
|
|
40336
|
-
defineMethod:
|
|
40337
|
-
getFieldNames:
|
|
40338
|
-
getFieldValue:
|
|
40339
|
-
eachField:
|
|
40340
|
-
someField:
|
|
40341
|
-
getSupertypeNames:
|
|
40342
|
-
getBuilderName:
|
|
40332
|
+
Type: types15.Type,
|
|
40333
|
+
builtInTypes: types15.builtInTypes,
|
|
40334
|
+
namedTypes: types15.namedTypes,
|
|
40335
|
+
builders: types15.builders,
|
|
40336
|
+
defineMethod: types15.defineMethod,
|
|
40337
|
+
getFieldNames: types15.getFieldNames,
|
|
40338
|
+
getFieldValue: types15.getFieldValue,
|
|
40339
|
+
eachField: types15.eachField,
|
|
40340
|
+
someField: types15.someField,
|
|
40341
|
+
getSupertypeNames: types15.getSupertypeNames,
|
|
40342
|
+
getBuilderName: types15.getBuilderName,
|
|
40343
40343
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
40344
|
-
finalize:
|
|
40344
|
+
finalize: types15.finalize,
|
|
40345
40345
|
Path: fork.use(path_1.default),
|
|
40346
40346
|
NodePath: fork.use(node_path_1.default),
|
|
40347
40347
|
PathVisitor,
|
|
@@ -40511,8 +40511,8 @@ var require_core2 = __commonJS({
|
|
|
40511
40511
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40512
40512
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40513
40513
|
function default_1(fork) {
|
|
40514
|
-
var
|
|
40515
|
-
var Type =
|
|
40514
|
+
var types15 = fork.use(types_1.default);
|
|
40515
|
+
var Type = types15.Type;
|
|
40516
40516
|
var def = Type.def;
|
|
40517
40517
|
var or = Type.or;
|
|
40518
40518
|
var shared = fork.use(shared_1.default);
|
|
@@ -40604,9 +40604,9 @@ var require_es6 = __commonJS({
|
|
|
40604
40604
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40605
40605
|
function default_1(fork) {
|
|
40606
40606
|
fork.use(core_1.default);
|
|
40607
|
-
var
|
|
40608
|
-
var def =
|
|
40609
|
-
var or =
|
|
40607
|
+
var types15 = fork.use(types_1.default);
|
|
40608
|
+
var def = types15.Type.def;
|
|
40609
|
+
var or = types15.Type.or;
|
|
40610
40610
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40611
40611
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
40612
40612
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -40696,8 +40696,8 @@ var require_es2017 = __commonJS({
|
|
|
40696
40696
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40697
40697
|
function default_1(fork) {
|
|
40698
40698
|
fork.use(es2016_1.default);
|
|
40699
|
-
var
|
|
40700
|
-
var def =
|
|
40699
|
+
var types15 = fork.use(types_1.default);
|
|
40700
|
+
var def = types15.Type.def;
|
|
40701
40701
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40702
40702
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
40703
40703
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -40720,9 +40720,9 @@ var require_es2018 = __commonJS({
|
|
|
40720
40720
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40721
40721
|
function default_1(fork) {
|
|
40722
40722
|
fork.use(es2017_1.default);
|
|
40723
|
-
var
|
|
40724
|
-
var def =
|
|
40725
|
-
var or =
|
|
40723
|
+
var types15 = fork.use(types_1.default);
|
|
40724
|
+
var def = types15.Type.def;
|
|
40725
|
+
var or = types15.Type.or;
|
|
40726
40726
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40727
40727
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
40728
40728
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -40753,9 +40753,9 @@ var require_es2019 = __commonJS({
|
|
|
40753
40753
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40754
40754
|
function default_1(fork) {
|
|
40755
40755
|
fork.use(es2018_1.default);
|
|
40756
|
-
var
|
|
40757
|
-
var def =
|
|
40758
|
-
var or =
|
|
40756
|
+
var types15 = fork.use(types_1.default);
|
|
40757
|
+
var def = types15.Type.def;
|
|
40758
|
+
var or = types15.Type.or;
|
|
40759
40759
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40760
40760
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
40761
40761
|
}
|
|
@@ -40779,9 +40779,9 @@ var require_es20202 = __commonJS({
|
|
|
40779
40779
|
function default_1(fork) {
|
|
40780
40780
|
fork.use(es2020_1.default);
|
|
40781
40781
|
fork.use(es2019_1.default);
|
|
40782
|
-
var
|
|
40783
|
-
var def =
|
|
40784
|
-
var or =
|
|
40782
|
+
var types15 = fork.use(types_1.default);
|
|
40783
|
+
var def = types15.Type.def;
|
|
40784
|
+
var or = types15.Type.or;
|
|
40785
40785
|
var shared = fork.use(shared_1.default);
|
|
40786
40786
|
var defaults = shared.defaults;
|
|
40787
40787
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -40831,8 +40831,8 @@ var require_es2022 = __commonJS({
|
|
|
40831
40831
|
var shared_1 = require_shared();
|
|
40832
40832
|
function default_1(fork) {
|
|
40833
40833
|
fork.use(es2021_1.default);
|
|
40834
|
-
var
|
|
40835
|
-
var def =
|
|
40834
|
+
var types15 = fork.use(types_1.default);
|
|
40835
|
+
var def = types15.Type.def;
|
|
40836
40836
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
40837
40837
|
}
|
|
40838
40838
|
exports.default = default_1;
|
|
@@ -40853,9 +40853,9 @@ var require_es_proposals = __commonJS({
|
|
|
40853
40853
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
40854
40854
|
function default_1(fork) {
|
|
40855
40855
|
fork.use(es2022_1.default);
|
|
40856
|
-
var
|
|
40857
|
-
var Type =
|
|
40858
|
-
var def =
|
|
40856
|
+
var types15 = fork.use(types_1.default);
|
|
40857
|
+
var Type = types15.Type;
|
|
40858
|
+
var def = types15.Type.def;
|
|
40859
40859
|
var or = Type.or;
|
|
40860
40860
|
var shared = fork.use(shared_1.default);
|
|
40861
40861
|
var defaults = shared.defaults;
|
|
@@ -40895,9 +40895,9 @@ var require_jsx = __commonJS({
|
|
|
40895
40895
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40896
40896
|
function default_1(fork) {
|
|
40897
40897
|
fork.use(es_proposals_1.default);
|
|
40898
|
-
var
|
|
40899
|
-
var def =
|
|
40900
|
-
var or =
|
|
40898
|
+
var types15 = fork.use(types_1.default);
|
|
40899
|
+
var def = types15.Type.def;
|
|
40900
|
+
var or = types15.Type.or;
|
|
40901
40901
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40902
40902
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
40903
40903
|
def("Literal"),
|
|
@@ -40955,9 +40955,9 @@ var require_type_annotations = __commonJS({
|
|
|
40955
40955
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
40956
40956
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
40957
40957
|
function default_1(fork) {
|
|
40958
|
-
var
|
|
40959
|
-
var def =
|
|
40960
|
-
var or =
|
|
40958
|
+
var types15 = fork.use(types_1.default);
|
|
40959
|
+
var def = types15.Type.def;
|
|
40960
|
+
var or = types15.Type.or;
|
|
40961
40961
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40962
40962
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
40963
40963
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -40992,9 +40992,9 @@ var require_flow = __commonJS({
|
|
|
40992
40992
|
function default_1(fork) {
|
|
40993
40993
|
fork.use(es_proposals_1.default);
|
|
40994
40994
|
fork.use(type_annotations_1.default);
|
|
40995
|
-
var
|
|
40996
|
-
var def =
|
|
40997
|
-
var or =
|
|
40995
|
+
var types15 = fork.use(types_1.default);
|
|
40996
|
+
var def = types15.Type.def;
|
|
40997
|
+
var or = types15.Type.or;
|
|
40998
40998
|
var defaults = fork.use(shared_1.default).defaults;
|
|
40999
40999
|
def("Flow").bases("Node");
|
|
41000
41000
|
def("FlowType").bases("Flow");
|
|
@@ -41108,10 +41108,10 @@ var require_esprima = __commonJS({
|
|
|
41108
41108
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
41109
41109
|
function default_1(fork) {
|
|
41110
41110
|
fork.use(es_proposals_1.default);
|
|
41111
|
-
var
|
|
41111
|
+
var types15 = fork.use(types_1.default);
|
|
41112
41112
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41113
|
-
var def =
|
|
41114
|
-
var or =
|
|
41113
|
+
var def = types15.Type.def;
|
|
41114
|
+
var or = types15.Type.or;
|
|
41115
41115
|
def("VariableDeclaration").field("declarations", [or(
|
|
41116
41116
|
def("VariableDeclarator"),
|
|
41117
41117
|
def("Identifier")
|
|
@@ -41156,11 +41156,11 @@ var require_babel_core = __commonJS({
|
|
|
41156
41156
|
function default_1(fork) {
|
|
41157
41157
|
var _a, _b, _c, _d, _e;
|
|
41158
41158
|
fork.use(es_proposals_1.default);
|
|
41159
|
-
var
|
|
41159
|
+
var types15 = fork.use(types_1.default);
|
|
41160
41160
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41161
|
-
var def =
|
|
41162
|
-
var or =
|
|
41163
|
-
var isUndefined =
|
|
41161
|
+
var def = types15.Type.def;
|
|
41162
|
+
var or = types15.Type.or;
|
|
41163
|
+
var isUndefined = types15.builtInTypes.undefined;
|
|
41164
41164
|
def("Noop").bases("Statement").build();
|
|
41165
41165
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
41166
41166
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -41185,7 +41185,7 @@ var require_babel_core = __commonJS({
|
|
|
41185
41185
|
raw: String
|
|
41186
41186
|
},
|
|
41187
41187
|
function getDefault() {
|
|
41188
|
-
var value =
|
|
41188
|
+
var value = types15.getFieldValue(this, "value");
|
|
41189
41189
|
return {
|
|
41190
41190
|
rawValue: value,
|
|
41191
41191
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -41288,8 +41288,8 @@ var require_babel = __commonJS({
|
|
|
41288
41288
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
41289
41289
|
var shared_1 = require_shared();
|
|
41290
41290
|
function default_1(fork) {
|
|
41291
|
-
var
|
|
41292
|
-
var def =
|
|
41291
|
+
var types15 = fork.use(types_1.default);
|
|
41292
|
+
var def = types15.Type.def;
|
|
41293
41293
|
fork.use(babel_core_1.default);
|
|
41294
41294
|
fork.use(flow_1.default);
|
|
41295
41295
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -41315,12 +41315,12 @@ var require_typescript = __commonJS({
|
|
|
41315
41315
|
function default_1(fork) {
|
|
41316
41316
|
fork.use(babel_core_1.default);
|
|
41317
41317
|
fork.use(type_annotations_1.default);
|
|
41318
|
-
var
|
|
41319
|
-
var n =
|
|
41320
|
-
var def =
|
|
41321
|
-
var or =
|
|
41318
|
+
var types15 = fork.use(types_1.default);
|
|
41319
|
+
var n = types15.namedTypes;
|
|
41320
|
+
var def = types15.Type.def;
|
|
41321
|
+
var or = types15.Type.or;
|
|
41322
41322
|
var defaults = fork.use(shared_1.default).defaults;
|
|
41323
|
-
var StringLiteral =
|
|
41323
|
+
var StringLiteral = types15.Type.from(function(value, deep) {
|
|
41324
41324
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
41325
41325
|
return true;
|
|
41326
41326
|
}
|
|
@@ -43296,8 +43296,8 @@ var require_util2 = __commonJS({
|
|
|
43296
43296
|
exports.isTrailingCommaEnabled = exports.getParentExportDeclaration = exports.isExportDeclaration = exports.fixFaultyLocations = exports.getTrueLoc = exports.composeSourceMaps = exports.copyPos = exports.comparePos = exports.getUnionOfKeys = exports.getOption = exports.isBrowser = exports.getLineTerminator = void 0;
|
|
43297
43297
|
var tslib_1 = require_tslib();
|
|
43298
43298
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
43299
|
-
var
|
|
43300
|
-
var n =
|
|
43299
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
43300
|
+
var n = types15.namedTypes;
|
|
43301
43301
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
43302
43302
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
43303
43303
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -50615,10 +50615,10 @@ var require_comments = __commonJS({
|
|
|
50615
50615
|
exports.printComments = exports.attach = void 0;
|
|
50616
50616
|
var tslib_1 = require_tslib();
|
|
50617
50617
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
50618
|
-
var
|
|
50619
|
-
var n =
|
|
50620
|
-
var isArray =
|
|
50621
|
-
var isObject =
|
|
50618
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50619
|
+
var n = types15.namedTypes;
|
|
50620
|
+
var isArray = types15.builtInTypes.array;
|
|
50621
|
+
var isObject = types15.builtInTypes.object;
|
|
50622
50622
|
var lines_1 = require_lines();
|
|
50623
50623
|
var util_1 = require_util2();
|
|
50624
50624
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -50649,7 +50649,7 @@ var require_comments = __commonJS({
|
|
|
50649
50649
|
if (isArray.check(node)) {
|
|
50650
50650
|
names = Object.keys(node);
|
|
50651
50651
|
} else if (isObject.check(node)) {
|
|
50652
|
-
names =
|
|
50652
|
+
names = types15.getFieldNames(node);
|
|
50653
50653
|
} else {
|
|
50654
50654
|
return resultArray;
|
|
50655
50655
|
}
|
|
@@ -50827,7 +50827,7 @@ var require_comments = __commonJS({
|
|
|
50827
50827
|
function printComments(path2, print7) {
|
|
50828
50828
|
var value = path2.getValue();
|
|
50829
50829
|
var innerLines = print7(path2);
|
|
50830
|
-
var comments = n.Node.check(value) &&
|
|
50830
|
+
var comments = n.Node.check(value) && types15.getFieldValue(value, "comments");
|
|
50831
50831
|
if (!comments || comments.length === 0) {
|
|
50832
50832
|
return innerLines;
|
|
50833
50833
|
}
|
|
@@ -50835,8 +50835,8 @@ var require_comments = __commonJS({
|
|
|
50835
50835
|
var trailingParts = [innerLines];
|
|
50836
50836
|
path2.each(function(commentPath) {
|
|
50837
50837
|
var comment = commentPath.getValue();
|
|
50838
|
-
var leading =
|
|
50839
|
-
var trailing =
|
|
50838
|
+
var leading = types15.getFieldValue(comment, "leading");
|
|
50839
|
+
var trailing = types15.getFieldValue(comment, "trailing");
|
|
50840
50840
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
50841
50841
|
leadingParts.push(printLeadingComment(commentPath, print7));
|
|
50842
50842
|
} else if (trailing) {
|
|
@@ -50858,10 +50858,10 @@ var require_parser2 = __commonJS({
|
|
|
50858
50858
|
exports.parse = void 0;
|
|
50859
50859
|
var tslib_1 = require_tslib();
|
|
50860
50860
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
50861
|
-
var
|
|
50862
|
-
var b =
|
|
50863
|
-
var isObject =
|
|
50864
|
-
var isArray =
|
|
50861
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
50862
|
+
var b = types15.builders;
|
|
50863
|
+
var isObject = types15.builtInTypes.object;
|
|
50864
|
+
var isArray = types15.builtInTypes.array;
|
|
50865
50865
|
var options_1 = require_options();
|
|
50866
50866
|
var lines_1 = require_lines();
|
|
50867
50867
|
var comments_1 = require_comments();
|
|
@@ -51047,11 +51047,11 @@ var require_fast_path = __commonJS({
|
|
|
51047
51047
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51048
51048
|
var tslib_1 = require_tslib();
|
|
51049
51049
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51050
|
-
var
|
|
51050
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51051
51051
|
var util = tslib_1.__importStar(require_util2());
|
|
51052
|
-
var n =
|
|
51053
|
-
var isArray =
|
|
51054
|
-
var isNumber =
|
|
51052
|
+
var n = types15.namedTypes;
|
|
51053
|
+
var isArray = types15.builtInTypes.array;
|
|
51054
|
+
var isNumber = types15.builtInTypes.number;
|
|
51055
51055
|
var PRECEDENCE = {};
|
|
51056
51056
|
[
|
|
51057
51057
|
["??"],
|
|
@@ -51080,7 +51080,7 @@ var require_fast_path = __commonJS({
|
|
|
51080
51080
|
if (obj instanceof FastPath) {
|
|
51081
51081
|
return obj.copy();
|
|
51082
51082
|
}
|
|
51083
|
-
if (obj instanceof
|
|
51083
|
+
if (obj instanceof types15.NodePath) {
|
|
51084
51084
|
var copy = Object.create(FastPath.prototype);
|
|
51085
51085
|
var stack = [obj.value];
|
|
51086
51086
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -51391,7 +51391,7 @@ var require_fast_path = __commonJS({
|
|
|
51391
51391
|
return node.some(containsCallExpression);
|
|
51392
51392
|
}
|
|
51393
51393
|
if (n.Node.check(node)) {
|
|
51394
|
-
return
|
|
51394
|
+
return types15.someField(node, function(_name, child) {
|
|
51395
51395
|
return containsCallExpression(child);
|
|
51396
51396
|
});
|
|
51397
51397
|
}
|
|
@@ -51481,16 +51481,16 @@ var require_patcher = __commonJS({
|
|
|
51481
51481
|
var tslib_1 = require_tslib();
|
|
51482
51482
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51483
51483
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
51484
|
-
var
|
|
51485
|
-
var Printable =
|
|
51486
|
-
var Expression =
|
|
51487
|
-
var ReturnStatement =
|
|
51488
|
-
var SourceLocation =
|
|
51484
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51485
|
+
var Printable = types15.namedTypes.Printable;
|
|
51486
|
+
var Expression = types15.namedTypes.Expression;
|
|
51487
|
+
var ReturnStatement = types15.namedTypes.ReturnStatement;
|
|
51488
|
+
var SourceLocation = types15.namedTypes.SourceLocation;
|
|
51489
51489
|
var util_1 = require_util2();
|
|
51490
51490
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51491
|
-
var isObject =
|
|
51492
|
-
var isArray =
|
|
51493
|
-
var isString =
|
|
51491
|
+
var isObject = types15.builtInTypes.object;
|
|
51492
|
+
var isArray = types15.builtInTypes.array;
|
|
51493
|
+
var isString = types15.builtInTypes.string;
|
|
51494
51494
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
51495
51495
|
var Patcher = function Patcher2(lines) {
|
|
51496
51496
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -51760,8 +51760,8 @@ var require_patcher = __commonJS({
|
|
|
51760
51760
|
if (k.charAt(0) === "_") {
|
|
51761
51761
|
continue;
|
|
51762
51762
|
}
|
|
51763
|
-
newPath.stack.push(k,
|
|
51764
|
-
oldPath.stack.push(k,
|
|
51763
|
+
newPath.stack.push(k, types15.getFieldValue(newNode, k));
|
|
51764
|
+
oldPath.stack.push(k, types15.getFieldValue(oldNode, k));
|
|
51765
51765
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
51766
51766
|
newPath.stack.length -= 2;
|
|
51767
51767
|
oldPath.stack.length -= 2;
|
|
@@ -51785,16 +51785,16 @@ var require_printer2 = __commonJS({
|
|
|
51785
51785
|
exports.Printer = void 0;
|
|
51786
51786
|
var tslib_1 = require_tslib();
|
|
51787
51787
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
51788
|
-
var
|
|
51788
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
51789
51789
|
var comments_1 = require_comments();
|
|
51790
51790
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
51791
51791
|
var lines_1 = require_lines();
|
|
51792
51792
|
var options_1 = require_options();
|
|
51793
51793
|
var patcher_1 = require_patcher();
|
|
51794
51794
|
var util = tslib_1.__importStar(require_util2());
|
|
51795
|
-
var namedTypes =
|
|
51796
|
-
var isString =
|
|
51797
|
-
var isObject =
|
|
51795
|
+
var namedTypes = types15.namedTypes;
|
|
51796
|
+
var isString = types15.builtInTypes.string;
|
|
51797
|
+
var isObject = types15.builtInTypes.object;
|
|
51798
51798
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
51799
51799
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
51800
51800
|
isString.assert(code);
|
|
@@ -51956,7 +51956,7 @@ var require_printer2 = __commonJS({
|
|
|
51956
51956
|
case "OptionalMemberExpression": {
|
|
51957
51957
|
parts.push(path2.call(print7, "object"));
|
|
51958
51958
|
var property = path2.call(print7, "property");
|
|
51959
|
-
var optional =
|
|
51959
|
+
var optional = types15.getFieldValue(n, "optional");
|
|
51960
51960
|
if (n.computed) {
|
|
51961
51961
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
51962
51962
|
} else {
|
|
@@ -52227,7 +52227,7 @@ var require_printer2 = __commonJS({
|
|
|
52227
52227
|
if (n.typeArguments) {
|
|
52228
52228
|
parts.push(path2.call(print7, "typeArguments"));
|
|
52229
52229
|
}
|
|
52230
|
-
if (
|
|
52230
|
+
if (types15.getFieldValue(n, "optional")) {
|
|
52231
52231
|
parts.push("?.");
|
|
52232
52232
|
}
|
|
52233
52233
|
parts.push(printArgumentsList(path2, options, print7));
|
|
@@ -53906,8 +53906,8 @@ var require_printer2 = __commonJS({
|
|
|
53906
53906
|
});
|
|
53907
53907
|
}
|
|
53908
53908
|
function getPossibleRaw(node) {
|
|
53909
|
-
var value =
|
|
53910
|
-
var extra =
|
|
53909
|
+
var value = types15.getFieldValue(node, "value");
|
|
53910
|
+
var extra = types15.getFieldValue(node, "extra");
|
|
53911
53911
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
53912
53912
|
return extra.raw;
|
|
53913
53913
|
}
|
|
@@ -53955,8 +53955,8 @@ var require_main2 = __commonJS({
|
|
|
53955
53955
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
53956
53956
|
var tslib_1 = require_tslib();
|
|
53957
53957
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
53958
|
-
var
|
|
53959
|
-
exports.types =
|
|
53958
|
+
var types15 = tslib_1.__importStar(require_main());
|
|
53959
|
+
exports.types = types15;
|
|
53960
53960
|
var parser_1 = require_parser2();
|
|
53961
53961
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
53962
53962
|
return parser_1.parse;
|
|
@@ -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;
|
|
@@ -57345,7 +57376,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
57345
57376
|
|
|
57346
57377
|
// src/codegen/generators/artifacts/index.ts
|
|
57347
57378
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
57348
|
-
var
|
|
57379
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
57349
57380
|
|
|
57350
57381
|
// src/codegen/utils/commonjs.ts
|
|
57351
57382
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -58532,7 +58563,6 @@ function ancestorKey(ancestors) {
|
|
|
58532
58563
|
|
|
58533
58564
|
// src/codegen/generators/artifacts/selection.ts
|
|
58534
58565
|
var graphql12 = __toESM(require_graphql2(), 1);
|
|
58535
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
58536
58566
|
|
|
58537
58567
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
58538
58568
|
var config = {
|
|
@@ -59479,15 +59509,12 @@ function fieldKey(config2, field) {
|
|
|
59479
59509
|
}
|
|
59480
59510
|
|
|
59481
59511
|
// src/codegen/generators/artifacts/selection.ts
|
|
59482
|
-
var AST5 = recast5.types.builders;
|
|
59483
59512
|
function selection_default(args) {
|
|
59484
|
-
const typeMap = {};
|
|
59485
|
-
const abstractTypes = [];
|
|
59486
59513
|
return mergeSelection({
|
|
59487
|
-
|
|
59488
|
-
|
|
59489
|
-
|
|
59490
|
-
|
|
59514
|
+
config: args.config,
|
|
59515
|
+
rootType: args.rootType,
|
|
59516
|
+
object: prepareSelection(args),
|
|
59517
|
+
filepath: args.filepath
|
|
59491
59518
|
});
|
|
59492
59519
|
}
|
|
59493
59520
|
function prepareSelection({
|
|
@@ -59499,8 +59526,6 @@ function prepareSelection({
|
|
|
59499
59526
|
path: path2 = [],
|
|
59500
59527
|
document,
|
|
59501
59528
|
inConnection,
|
|
59502
|
-
typeMap,
|
|
59503
|
-
abstractTypes,
|
|
59504
59529
|
globalLoading,
|
|
59505
59530
|
includeFragments
|
|
59506
59531
|
}) {
|
|
@@ -59520,8 +59545,6 @@ function prepareSelection({
|
|
|
59520
59545
|
selections: field.selectionSet.selections,
|
|
59521
59546
|
path: path2,
|
|
59522
59547
|
document,
|
|
59523
|
-
typeMap,
|
|
59524
|
-
abstractTypes,
|
|
59525
59548
|
globalLoading,
|
|
59526
59549
|
includeFragments
|
|
59527
59550
|
}).fields || {}
|
|
@@ -59533,32 +59556,7 @@ function prepareSelection({
|
|
|
59533
59556
|
typeMap: {}
|
|
59534
59557
|
};
|
|
59535
59558
|
}
|
|
59536
|
-
const parentType = config2.schema.getType(rootType);
|
|
59537
59559
|
const typeConditionName = field.typeCondition.name.value;
|
|
59538
|
-
const typeCondition = config2.schema.getType(typeConditionName);
|
|
59539
|
-
const possibleTypes = [];
|
|
59540
|
-
if (!graphql12.isAbstractType(typeCondition)) {
|
|
59541
|
-
} else if (graphql12.isAbstractType(parentType)) {
|
|
59542
|
-
const possibleParentTypes = config2.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
59543
|
-
for (const possible of config2.schema.getPossibleTypes(typeCondition)) {
|
|
59544
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
59545
|
-
possibleTypes.push(possible.name);
|
|
59546
|
-
}
|
|
59547
|
-
}
|
|
59548
|
-
} else {
|
|
59549
|
-
possibleTypes.push(rootType);
|
|
59550
|
-
}
|
|
59551
|
-
if (possibleTypes.length > 0) {
|
|
59552
|
-
for (const type of possibleTypes) {
|
|
59553
|
-
const existing = typeMap[type];
|
|
59554
|
-
if (!existing || !existing.includes(type)) {
|
|
59555
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
59556
|
-
}
|
|
59557
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
59558
|
-
abstractTypes.push(typeConditionName);
|
|
59559
|
-
}
|
|
59560
|
-
}
|
|
59561
|
-
}
|
|
59562
59560
|
object.abstractFields.fields = {
|
|
59563
59561
|
...object.abstractFields.fields,
|
|
59564
59562
|
[typeConditionName]: prepareSelection({
|
|
@@ -59569,8 +59567,6 @@ function prepareSelection({
|
|
|
59569
59567
|
selections: field.selectionSet.selections,
|
|
59570
59568
|
path: path2,
|
|
59571
59569
|
document,
|
|
59572
|
-
typeMap,
|
|
59573
|
-
abstractTypes,
|
|
59574
59570
|
globalLoading,
|
|
59575
59571
|
includeFragments
|
|
59576
59572
|
}).fields
|
|
@@ -59582,19 +59578,38 @@ function prepareSelection({
|
|
|
59582
59578
|
} else if (field.kind === "Field") {
|
|
59583
59579
|
const type = config2.schema.getType(rootType);
|
|
59584
59580
|
if (!type) {
|
|
59585
|
-
throw new HoudiniError({
|
|
59581
|
+
throw new HoudiniError({
|
|
59582
|
+
filepath,
|
|
59583
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
59584
|
+
});
|
|
59586
59585
|
}
|
|
59587
59586
|
const attributeName = field.alias?.value || field.name.value;
|
|
59588
|
-
let fieldType;
|
|
59587
|
+
let fieldType = null;
|
|
59589
59588
|
let nullable = false;
|
|
59590
59589
|
if (field.name.value === "__typename") {
|
|
59591
59590
|
fieldType = config2.schema.getType("String");
|
|
59592
|
-
} else {
|
|
59591
|
+
} else if ("getFields" in type) {
|
|
59593
59592
|
let typeRef = type.getFields()[field.name.value].type;
|
|
59594
59593
|
fieldType = getRootType(typeRef);
|
|
59595
59594
|
nullable = !graphql12.isNonNullType(typeRef);
|
|
59595
|
+
} else if (graphql12.isAbstractType(type)) {
|
|
59596
|
+
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
59597
|
+
if (graphql12.isObjectType(possible)) {
|
|
59598
|
+
if (possible.getFields()[field.name.value]) {
|
|
59599
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
59600
|
+
nullable = !graphql12.isNonNullType(fieldType);
|
|
59601
|
+
break;
|
|
59602
|
+
}
|
|
59603
|
+
}
|
|
59604
|
+
}
|
|
59605
|
+
}
|
|
59606
|
+
if (!fieldType) {
|
|
59607
|
+
throw {
|
|
59608
|
+
message: "Could not identify field's type",
|
|
59609
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
59610
|
+
};
|
|
59596
59611
|
}
|
|
59597
|
-
const typeName = fieldType.
|
|
59612
|
+
const typeName = getRootType(fieldType).name;
|
|
59598
59613
|
const pathSoFar = path2.concat(attributeName);
|
|
59599
59614
|
const keys2 = config2.keyFieldsForType(rootType);
|
|
59600
59615
|
let fieldObj = {
|
|
@@ -59688,8 +59703,6 @@ function prepareSelection({
|
|
|
59688
59703
|
path: pathSoFar,
|
|
59689
59704
|
document,
|
|
59690
59705
|
inConnection: connectionState,
|
|
59691
|
-
typeMap,
|
|
59692
|
-
abstractTypes,
|
|
59693
59706
|
globalLoading: forceLoading,
|
|
59694
59707
|
includeFragments
|
|
59695
59708
|
});
|
|
@@ -59775,69 +59788,107 @@ function prepareSelection({
|
|
|
59775
59788
|
return object;
|
|
59776
59789
|
}
|
|
59777
59790
|
function mergeSelection({
|
|
59791
|
+
config: config2,
|
|
59778
59792
|
filepath,
|
|
59779
59793
|
object,
|
|
59780
|
-
|
|
59781
|
-
abstractTypes
|
|
59794
|
+
rootType
|
|
59782
59795
|
}) {
|
|
59783
59796
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
59784
|
-
|
|
59785
|
-
|
|
59797
|
+
const abstractSelection = {
|
|
59798
|
+
fields: {},
|
|
59799
|
+
typeMap: {}
|
|
59800
|
+
};
|
|
59801
|
+
const possibleSelectionTypes = {};
|
|
59802
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
59803
|
+
const gqlType = config2.schema.getType(typeName);
|
|
59804
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
59805
|
+
filepath,
|
|
59806
|
+
typeSelection,
|
|
59807
|
+
abstractSelection.fields[typeName] ?? {}
|
|
59808
|
+
);
|
|
59809
|
+
if (graphql12.isAbstractType(gqlType)) {
|
|
59810
|
+
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
59811
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
59812
|
+
possibleSelectionTypes[typeName] = [];
|
|
59813
|
+
}
|
|
59814
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
59815
|
+
}
|
|
59816
|
+
}
|
|
59817
|
+
}
|
|
59818
|
+
const concreteSelectionImplements = {};
|
|
59819
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59820
|
+
for (const possible of possibles) {
|
|
59821
|
+
if (!concreteSelectionImplements[possible]) {
|
|
59822
|
+
concreteSelectionImplements[possible] = [];
|
|
59823
|
+
}
|
|
59824
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
59825
|
+
}
|
|
59826
|
+
}
|
|
59827
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
59828
|
+
if (implementations.length > 1) {
|
|
59829
|
+
abstractSelection.fields[concrete] = {};
|
|
59830
|
+
}
|
|
59831
|
+
}
|
|
59832
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59786
59833
|
for (const possible of possibles) {
|
|
59787
|
-
if (
|
|
59788
|
-
|
|
59834
|
+
if (abstractSelection.fields[possible]) {
|
|
59835
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
59789
59836
|
filepath,
|
|
59790
|
-
|
|
59791
|
-
|
|
59837
|
+
abstractSelection.fields[typeName] ?? {},
|
|
59838
|
+
abstractSelection.fields[possible] ?? {}
|
|
59792
59839
|
);
|
|
59793
|
-
overlap = true;
|
|
59794
59840
|
}
|
|
59795
59841
|
}
|
|
59796
|
-
if (overlap) {
|
|
59797
|
-
delete typeMap[typeName];
|
|
59798
|
-
}
|
|
59799
59842
|
}
|
|
59800
|
-
|
|
59801
|
-
|
|
59802
|
-
|
|
59803
|
-
|
|
59804
|
-
|
|
59805
|
-
);
|
|
59806
|
-
delete typeMap[type];
|
|
59843
|
+
const parentType = config2.schema.getType(rootType);
|
|
59844
|
+
const possibleParents = graphql12.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t) => t.name) : [parentType.name];
|
|
59845
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
59846
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
59847
|
+
delete abstractSelection.typeMap[key];
|
|
59807
59848
|
}
|
|
59808
59849
|
}
|
|
59809
|
-
for (const [type, sel] of Object.entries(
|
|
59810
|
-
|
|
59850
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
59851
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
59811
59852
|
}
|
|
59812
|
-
for (const [
|
|
59813
|
-
|
|
59853
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
59854
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
59855
|
+
delete abstractSelection.fields[typename];
|
|
59856
|
+
}
|
|
59814
59857
|
}
|
|
59815
|
-
const
|
|
59816
|
-
|
|
59817
|
-
|
|
59818
|
-
|
|
59858
|
+
for (const possible of possibleParents) {
|
|
59859
|
+
if (abstractSelection.fields[possible]) {
|
|
59860
|
+
continue;
|
|
59861
|
+
}
|
|
59862
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
59863
|
+
possibleSelectionTypes
|
|
59864
|
+
)) {
|
|
59865
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
59866
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
59867
|
+
break;
|
|
59868
|
+
}
|
|
59819
59869
|
}
|
|
59820
59870
|
}
|
|
59871
|
+
object.abstractFields = abstractSelection;
|
|
59821
59872
|
}
|
|
59822
|
-
for (const
|
|
59873
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
59823
59874
|
const selection = value.selection;
|
|
59824
59875
|
if (selection) {
|
|
59825
59876
|
mergeSelection({
|
|
59877
|
+
config: config2,
|
|
59878
|
+
rootType: value.type,
|
|
59826
59879
|
filepath,
|
|
59827
|
-
typeMap,
|
|
59828
|
-
abstractTypes,
|
|
59829
59880
|
object: selection
|
|
59830
59881
|
});
|
|
59831
59882
|
}
|
|
59832
59883
|
}
|
|
59833
59884
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
59834
|
-
for (const
|
|
59885
|
+
for (const value of Object.values(selection ?? {})) {
|
|
59835
59886
|
const selection2 = value.selection;
|
|
59836
59887
|
if (selection2) {
|
|
59837
59888
|
mergeSelection({
|
|
59889
|
+
config: config2,
|
|
59890
|
+
rootType: value.type,
|
|
59838
59891
|
filepath,
|
|
59839
|
-
typeMap,
|
|
59840
|
-
abstractTypes,
|
|
59841
59892
|
object: selection2
|
|
59842
59893
|
});
|
|
59843
59894
|
}
|
|
@@ -59847,7 +59898,7 @@ function mergeSelection({
|
|
|
59847
59898
|
}
|
|
59848
59899
|
|
|
59849
59900
|
// src/codegen/generators/artifacts/index.ts
|
|
59850
|
-
var
|
|
59901
|
+
var AST5 = recast5.types.builders;
|
|
59851
59902
|
function artifactGenerator(stats) {
|
|
59852
59903
|
return async function(config2, docs) {
|
|
59853
59904
|
const filterTypes = {};
|
|
@@ -60115,10 +60166,10 @@ function artifactGenerator(stats) {
|
|
|
60115
60166
|
}
|
|
60116
60167
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
60117
60168
|
}
|
|
60118
|
-
const file =
|
|
60169
|
+
const file = AST5.program([
|
|
60119
60170
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
60120
|
-
|
|
60121
|
-
|
|
60171
|
+
AST5.expressionStatement(
|
|
60172
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config2, document: doc })}`)
|
|
60122
60173
|
)
|
|
60123
60174
|
]);
|
|
60124
60175
|
const artifactPath = config2.artifactPath(document);
|
|
@@ -60198,8 +60249,8 @@ function applyMask(config2, target, mask) {
|
|
|
60198
60249
|
}
|
|
60199
60250
|
|
|
60200
60251
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
60201
|
-
var
|
|
60202
|
-
var
|
|
60252
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
60253
|
+
var AST6 = recast6.types.builders;
|
|
60203
60254
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
60204
60255
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
60205
60256
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -60234,18 +60285,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
60234
60285
|
continue;
|
|
60235
60286
|
}
|
|
60236
60287
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
60237
|
-
const input =
|
|
60238
|
-
input.typeAnnotation =
|
|
60239
|
-
|
|
60288
|
+
const input = AST6.identifier("str");
|
|
60289
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
60290
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
60240
60291
|
);
|
|
60241
60292
|
script.body.splice(
|
|
60242
60293
|
i,
|
|
60243
60294
|
0,
|
|
60244
|
-
|
|
60245
|
-
|
|
60246
|
-
|
|
60295
|
+
AST6.exportNamedDeclaration(
|
|
60296
|
+
AST6.tsDeclareFunction(
|
|
60297
|
+
AST6.identifier("graphql"),
|
|
60247
60298
|
[input],
|
|
60248
|
-
|
|
60299
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
60249
60300
|
)
|
|
60250
60301
|
)
|
|
60251
60302
|
);
|
|
@@ -60408,20 +60459,20 @@ async function generatePluginRuntime({
|
|
|
60408
60459
|
}
|
|
60409
60460
|
|
|
60410
60461
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60411
|
-
var
|
|
60462
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
60412
60463
|
|
|
60413
60464
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60414
60465
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
60415
|
-
var
|
|
60466
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
60416
60467
|
|
|
60417
60468
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60418
60469
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
60419
|
-
var
|
|
60470
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
60420
60471
|
|
|
60421
60472
|
// src/codegen/generators/typescript/types.ts
|
|
60422
60473
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
60423
|
-
var
|
|
60424
|
-
var
|
|
60474
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
60475
|
+
var AST7 = recast7.types.builders;
|
|
60425
60476
|
function readonlyProperty(prop, enable = true) {
|
|
60426
60477
|
if (enable) {
|
|
60427
60478
|
prop.readonly = true;
|
|
@@ -60429,28 +60480,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
60429
60480
|
return prop;
|
|
60430
60481
|
}
|
|
60431
60482
|
function nullableField(inner, input = false) {
|
|
60432
|
-
const members = [inner,
|
|
60483
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
60433
60484
|
if (input) {
|
|
60434
|
-
members.push(
|
|
60485
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
60435
60486
|
}
|
|
60436
|
-
return
|
|
60487
|
+
return AST7.tsUnionType(members);
|
|
60437
60488
|
}
|
|
60438
60489
|
function scalarPropertyValue(config2, missingScalars, target) {
|
|
60439
60490
|
switch (target.name) {
|
|
60440
60491
|
case "String": {
|
|
60441
|
-
return
|
|
60492
|
+
return AST7.tsStringKeyword();
|
|
60442
60493
|
}
|
|
60443
60494
|
case "Int": {
|
|
60444
|
-
return
|
|
60495
|
+
return AST7.tsNumberKeyword();
|
|
60445
60496
|
}
|
|
60446
60497
|
case "Float": {
|
|
60447
|
-
return
|
|
60498
|
+
return AST7.tsNumberKeyword();
|
|
60448
60499
|
}
|
|
60449
60500
|
case "Boolean": {
|
|
60450
|
-
return
|
|
60501
|
+
return AST7.tsBooleanKeyword();
|
|
60451
60502
|
}
|
|
60452
60503
|
case "ID": {
|
|
60453
|
-
return
|
|
60504
|
+
return AST7.tsStringKeyword();
|
|
60454
60505
|
}
|
|
60455
60506
|
default: {
|
|
60456
60507
|
if (graphql14.isNonNullType(target) && "ofType" in target) {
|
|
@@ -60461,16 +60512,16 @@ function scalarPropertyValue(config2, missingScalars, target) {
|
|
|
60461
60512
|
);
|
|
60462
60513
|
}
|
|
60463
60514
|
if (config2.scalars?.[target.name]) {
|
|
60464
|
-
return
|
|
60515
|
+
return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
|
|
60465
60516
|
}
|
|
60466
60517
|
missingScalars.add(target.name);
|
|
60467
|
-
return
|
|
60518
|
+
return AST7.tsAnyKeyword();
|
|
60468
60519
|
}
|
|
60469
60520
|
}
|
|
60470
60521
|
}
|
|
60471
60522
|
|
|
60472
60523
|
// src/codegen/generators/typescript/typeReference.ts
|
|
60473
|
-
var
|
|
60524
|
+
var AST8 = recast8.types.builders;
|
|
60474
60525
|
function tsTypeReference(config2, missingScalars, definition, body) {
|
|
60475
60526
|
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
60476
60527
|
let result;
|
|
@@ -60479,7 +60530,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60479
60530
|
} else if (graphql15.isEnumType(type)) {
|
|
60480
60531
|
result = enumReference(config2, body, type.name);
|
|
60481
60532
|
} else {
|
|
60482
|
-
result =
|
|
60533
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
60483
60534
|
}
|
|
60484
60535
|
for (const toWrap of wrappers) {
|
|
60485
60536
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -60487,7 +60538,7 @@ function tsTypeReference(config2, missingScalars, definition, body) {
|
|
|
60487
60538
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
60488
60539
|
result = nullableField(result, true);
|
|
60489
60540
|
} else if (toWrap === "List" /* List */) {
|
|
60490
|
-
result =
|
|
60541
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
60491
60542
|
}
|
|
60492
60543
|
}
|
|
60493
60544
|
return result;
|
|
@@ -60500,14 +60551,14 @@ function enumReference(config2, body, name) {
|
|
|
60500
60551
|
importKind: "type",
|
|
60501
60552
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60502
60553
|
});
|
|
60503
|
-
return
|
|
60504
|
-
|
|
60505
|
-
|
|
60554
|
+
return AST8.tsTypeReference(
|
|
60555
|
+
AST8.identifier("ValueOf"),
|
|
60556
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
60506
60557
|
);
|
|
60507
60558
|
}
|
|
60508
60559
|
|
|
60509
60560
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60510
|
-
var
|
|
60561
|
+
var AST9 = recast9.types.builders;
|
|
60511
60562
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
60512
60563
|
const { type } = unwrapType(config2, rootType);
|
|
60513
60564
|
if (graphql16.isScalarType(type)) {
|
|
@@ -60534,20 +60585,20 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
60534
60585
|
for (const field of Object.values(type.getFields())) {
|
|
60535
60586
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
60536
60587
|
members.push(
|
|
60537
|
-
|
|
60538
|
-
|
|
60539
|
-
|
|
60588
|
+
AST9.tsPropertySignature(
|
|
60589
|
+
AST9.identifier(field.name),
|
|
60590
|
+
AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field, body)),
|
|
60540
60591
|
graphql16.isNullableType(field.type)
|
|
60541
60592
|
)
|
|
60542
60593
|
);
|
|
60543
60594
|
}
|
|
60544
|
-
body.push(
|
|
60595
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
60545
60596
|
}
|
|
60546
60597
|
|
|
60547
60598
|
// src/codegen/generators/typescript/inlineType.ts
|
|
60548
60599
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
60549
|
-
var
|
|
60550
|
-
var
|
|
60600
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
60601
|
+
var AST10 = recast10.types.builders;
|
|
60551
60602
|
var fragmentKey2 = " $fragments";
|
|
60552
60603
|
function inlineType({
|
|
60553
60604
|
config: config2,
|
|
@@ -60645,7 +60696,7 @@ function inlineType({
|
|
|
60645
60696
|
{}
|
|
60646
60697
|
)
|
|
60647
60698
|
);
|
|
60648
|
-
result =
|
|
60699
|
+
result = AST10.tsTypeLiteral([
|
|
60649
60700
|
...fields.map((selection) => {
|
|
60650
60701
|
const { field } = selectionTypeInfo(config2.schema, filepath, rootObj, selection);
|
|
60651
60702
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -60673,12 +60724,12 @@ function inlineType({
|
|
|
60673
60724
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
60674
60725
|
).length > 0;
|
|
60675
60726
|
if (hasIncludeOrSkipDirective) {
|
|
60676
|
-
attributeType =
|
|
60727
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
60677
60728
|
}
|
|
60678
60729
|
const prop = readonlyProperty(
|
|
60679
|
-
|
|
60680
|
-
|
|
60681
|
-
|
|
60730
|
+
AST10.tsPropertySignature(
|
|
60731
|
+
AST10.identifier(attributeName),
|
|
60732
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
60682
60733
|
),
|
|
60683
60734
|
allowReadonly
|
|
60684
60735
|
);
|
|
@@ -60692,14 +60743,14 @@ function inlineType({
|
|
|
60692
60743
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
60693
60744
|
result.members.push(
|
|
60694
60745
|
readonlyProperty(
|
|
60695
|
-
|
|
60696
|
-
|
|
60697
|
-
|
|
60698
|
-
|
|
60746
|
+
AST10.tsPropertySignature(
|
|
60747
|
+
AST10.stringLiteral(fragmentKey2),
|
|
60748
|
+
AST10.tsTypeAnnotation(
|
|
60749
|
+
AST10.tsTypeLiteral(
|
|
60699
60750
|
(fragmentSpreads || []).map(
|
|
60700
|
-
(fragmentSpread) =>
|
|
60701
|
-
|
|
60702
|
-
|
|
60751
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
60752
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
60753
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
60703
60754
|
)
|
|
60704
60755
|
)
|
|
60705
60756
|
)
|
|
@@ -60744,9 +60795,9 @@ function inlineType({
|
|
|
60744
60795
|
}
|
|
60745
60796
|
objectType.members.push(
|
|
60746
60797
|
readonlyProperty(
|
|
60747
|
-
|
|
60748
|
-
|
|
60749
|
-
|
|
60798
|
+
AST10.tsPropertySignature(
|
|
60799
|
+
AST10.identifier("__typename"),
|
|
60800
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
60750
60801
|
),
|
|
60751
60802
|
allowReadonly
|
|
60752
60803
|
)
|
|
@@ -60786,8 +60837,8 @@ function inlineType({
|
|
|
60786
60837
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
60787
60838
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
60788
60839
|
([typeName, { type: type2, tsType }]) => {
|
|
60789
|
-
return
|
|
60790
|
-
|
|
60840
|
+
return AST10.tsParenthesizedType(
|
|
60841
|
+
AST10.tsIntersectionType(
|
|
60791
60842
|
[tsType].flatMap((type3) => {
|
|
60792
60843
|
if (type3.type === "TSUnionType") {
|
|
60793
60844
|
return type3.types.filter(
|
|
@@ -60813,14 +60864,14 @@ function inlineType({
|
|
|
60813
60864
|
);
|
|
60814
60865
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
60815
60866
|
selectionTypes.push(
|
|
60816
|
-
|
|
60817
|
-
|
|
60867
|
+
AST10.tsParenthesizedType(
|
|
60868
|
+
AST10.tsTypeLiteral([
|
|
60818
60869
|
readonlyProperty(
|
|
60819
|
-
|
|
60820
|
-
|
|
60821
|
-
|
|
60822
|
-
|
|
60823
|
-
|
|
60870
|
+
AST10.tsPropertySignature(
|
|
60871
|
+
AST10.identifier("__typename"),
|
|
60872
|
+
AST10.tsTypeAnnotation(
|
|
60873
|
+
AST10.tsLiteralType(
|
|
60874
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
60824
60875
|
)
|
|
60825
60876
|
)
|
|
60826
60877
|
),
|
|
@@ -60830,9 +60881,9 @@ function inlineType({
|
|
|
60830
60881
|
)
|
|
60831
60882
|
);
|
|
60832
60883
|
}
|
|
60833
|
-
result =
|
|
60884
|
+
result = AST10.tsIntersectionType([
|
|
60834
60885
|
result,
|
|
60835
|
-
|
|
60886
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
60836
60887
|
]);
|
|
60837
60888
|
}
|
|
60838
60889
|
} else {
|
|
@@ -60850,7 +60901,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
60850
60901
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
60851
60902
|
continue;
|
|
60852
60903
|
} else if (toWrap === "List" /* List */) {
|
|
60853
|
-
result =
|
|
60904
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
60854
60905
|
}
|
|
60855
60906
|
}
|
|
60856
60907
|
return result;
|
|
@@ -60895,13 +60946,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
60895
60946
|
}
|
|
60896
60947
|
|
|
60897
60948
|
// src/codegen/generators/typescript/loadingState.ts
|
|
60898
|
-
var
|
|
60899
|
-
var
|
|
60949
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
60950
|
+
var AST11 = recast11.types.builders;
|
|
60900
60951
|
function withLoadingState(args) {
|
|
60901
60952
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
60902
60953
|
return args.base;
|
|
60903
60954
|
}
|
|
60904
|
-
return
|
|
60955
|
+
return AST11.tsUnionType([
|
|
60905
60956
|
args.base,
|
|
60906
60957
|
loadingState({
|
|
60907
60958
|
parentType: args.document.artifact.rootType,
|
|
@@ -60920,7 +60971,7 @@ function loadingState(args) {
|
|
|
60920
60971
|
import: ["LoadingType"],
|
|
60921
60972
|
sourceModule: "$houdini/runtime/lib/types"
|
|
60922
60973
|
});
|
|
60923
|
-
const result =
|
|
60974
|
+
const result = AST11.tsTypeLiteral(
|
|
60924
60975
|
Object.entries(selection).reduce(
|
|
60925
60976
|
(rest, [attributeName, value]) => {
|
|
60926
60977
|
if (!value.loading) {
|
|
@@ -60928,7 +60979,7 @@ function loadingState(args) {
|
|
|
60928
60979
|
}
|
|
60929
60980
|
let keyType = null;
|
|
60930
60981
|
if (value.loading.kind === "value") {
|
|
60931
|
-
keyType =
|
|
60982
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
60932
60983
|
}
|
|
60933
60984
|
if (value.loading.kind === "continue" && value.selection) {
|
|
60934
60985
|
keyType = loadingState({
|
|
@@ -60944,15 +60995,15 @@ function loadingState(args) {
|
|
|
60944
60995
|
}
|
|
60945
60996
|
if (value.loading.list) {
|
|
60946
60997
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
60947
|
-
keyType =
|
|
60998
|
+
keyType = AST11.tsArrayType(keyType);
|
|
60948
60999
|
}
|
|
60949
61000
|
}
|
|
60950
61001
|
return [
|
|
60951
61002
|
...rest,
|
|
60952
61003
|
readonlyProperty(
|
|
60953
|
-
|
|
60954
|
-
|
|
60955
|
-
|
|
61004
|
+
AST11.tsPropertySignature(
|
|
61005
|
+
AST11.identifier(attributeName),
|
|
61006
|
+
AST11.tsTypeAnnotation(keyType)
|
|
60956
61007
|
)
|
|
60957
61008
|
)
|
|
60958
61009
|
];
|
|
@@ -60963,14 +61014,14 @@ function loadingState(args) {
|
|
|
60963
61014
|
if (args.selection.fragments) {
|
|
60964
61015
|
result.members.push(
|
|
60965
61016
|
readonlyProperty(
|
|
60966
|
-
|
|
60967
|
-
|
|
60968
|
-
|
|
60969
|
-
|
|
61017
|
+
AST11.tsPropertySignature(
|
|
61018
|
+
AST11.stringLiteral(fragmentKey),
|
|
61019
|
+
AST11.tsTypeAnnotation(
|
|
61020
|
+
AST11.tsTypeLiteral(
|
|
60970
61021
|
Object.keys(args.selection.fragments).map((name) => {
|
|
60971
|
-
return
|
|
60972
|
-
|
|
60973
|
-
|
|
61022
|
+
return AST11.tsPropertySignature(
|
|
61023
|
+
AST11.identifier(name),
|
|
61024
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
60974
61025
|
);
|
|
60975
61026
|
})
|
|
60976
61027
|
)
|
|
@@ -60983,7 +61034,7 @@ function loadingState(args) {
|
|
|
60983
61034
|
}
|
|
60984
61035
|
|
|
60985
61036
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
60986
|
-
var
|
|
61037
|
+
var AST12 = recast12.types.builders;
|
|
60987
61038
|
async function generateDocumentTypes(config2, docs) {
|
|
60988
61039
|
const typePaths = [];
|
|
60989
61040
|
const fragmentDefinitions = {};
|
|
@@ -61008,7 +61059,7 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61008
61059
|
return;
|
|
61009
61060
|
}
|
|
61010
61061
|
const typeDefPath = config2.artifactTypePath(originalDocument);
|
|
61011
|
-
const program =
|
|
61062
|
+
const program = AST12.program([]);
|
|
61012
61063
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61013
61064
|
let definition = originalDocument.definitions.find(
|
|
61014
61065
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -61044,9 +61095,9 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61044
61095
|
);
|
|
61045
61096
|
}
|
|
61046
61097
|
program.body.push(
|
|
61047
|
-
|
|
61048
|
-
|
|
61049
|
-
|
|
61098
|
+
AST12.exportNamedDeclaration(
|
|
61099
|
+
AST12.tsTypeAliasDeclaration(
|
|
61100
|
+
AST12.identifier(`${name}$artifact`),
|
|
61050
61101
|
convertToTs(serializeValue(artifact))
|
|
61051
61102
|
)
|
|
61052
61103
|
)
|
|
@@ -61056,17 +61107,17 @@ async function generateDocumentTypes(config2, docs) {
|
|
|
61056
61107
|
typePaths.push(typeDefPath);
|
|
61057
61108
|
})
|
|
61058
61109
|
);
|
|
61059
|
-
const typeIndex =
|
|
61110
|
+
const typeIndex = AST12.program(
|
|
61060
61111
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
61061
|
-
return
|
|
61062
|
-
|
|
61112
|
+
return AST12.exportAllDeclaration(
|
|
61113
|
+
AST12.literal(
|
|
61063
61114
|
"./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
61064
61115
|
),
|
|
61065
61116
|
null
|
|
61066
61117
|
);
|
|
61067
61118
|
}).concat([
|
|
61068
|
-
|
|
61069
|
-
|
|
61119
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
61120
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
61070
61121
|
])
|
|
61071
61122
|
);
|
|
61072
61123
|
const exportDefaultAs = ({ module: module2, as }) => `
|
|
@@ -61121,7 +61172,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
61121
61172
|
}
|
|
61122
61173
|
function convertToTs(source) {
|
|
61123
61174
|
if (source.type === "ObjectExpression") {
|
|
61124
|
-
return
|
|
61175
|
+
return AST12.tsTypeLiteral(
|
|
61125
61176
|
source.properties.reduce(
|
|
61126
61177
|
(props, prop) => {
|
|
61127
61178
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -61129,9 +61180,9 @@ function convertToTs(source) {
|
|
|
61129
61180
|
}
|
|
61130
61181
|
return [
|
|
61131
61182
|
...props,
|
|
61132
|
-
|
|
61183
|
+
AST12.tsPropertySignature(
|
|
61133
61184
|
prop.key,
|
|
61134
|
-
|
|
61185
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
61135
61186
|
)
|
|
61136
61187
|
];
|
|
61137
61188
|
},
|
|
@@ -61140,20 +61191,20 @@ function convertToTs(source) {
|
|
|
61140
61191
|
);
|
|
61141
61192
|
}
|
|
61142
61193
|
if (source.type === "ArrayExpression") {
|
|
61143
|
-
return
|
|
61194
|
+
return AST12.tsTupleType(
|
|
61144
61195
|
source.elements.map((element) => convertToTs(element))
|
|
61145
61196
|
);
|
|
61146
61197
|
}
|
|
61147
61198
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
61148
|
-
return
|
|
61199
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
61149
61200
|
}
|
|
61150
61201
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
61151
|
-
return
|
|
61202
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
61152
61203
|
}
|
|
61153
61204
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
61154
|
-
return
|
|
61205
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
61155
61206
|
}
|
|
61156
|
-
return
|
|
61207
|
+
return AST12.tsLiteralType(source);
|
|
61157
61208
|
}
|
|
61158
61209
|
async function generateOperationTypeDefs(config2, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
61159
61210
|
let parentType = null;
|
|
@@ -61192,23 +61243,23 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61192
61243
|
});
|
|
61193
61244
|
}
|
|
61194
61245
|
body.push(
|
|
61195
|
-
|
|
61196
|
-
|
|
61197
|
-
|
|
61198
|
-
|
|
61246
|
+
AST12.exportNamedDeclaration(
|
|
61247
|
+
AST12.tsTypeAliasDeclaration(
|
|
61248
|
+
AST12.identifier(definition.name.value),
|
|
61249
|
+
AST12.tsTypeLiteral([
|
|
61199
61250
|
readonlyProperty(
|
|
61200
|
-
|
|
61201
|
-
|
|
61202
|
-
|
|
61251
|
+
AST12.tsPropertySignature(
|
|
61252
|
+
AST12.stringLiteral("input"),
|
|
61253
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
61203
61254
|
)
|
|
61204
61255
|
),
|
|
61205
61256
|
readonlyProperty(
|
|
61206
|
-
|
|
61207
|
-
|
|
61208
|
-
|
|
61209
|
-
definition.operation === "mutation" ?
|
|
61210
|
-
|
|
61211
|
-
|
|
61257
|
+
AST12.tsPropertySignature(
|
|
61258
|
+
AST12.stringLiteral("result"),
|
|
61259
|
+
AST12.tsTypeAnnotation(
|
|
61260
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
61261
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
61262
|
+
AST12.tsUndefinedKeyword()
|
|
61212
61263
|
])
|
|
61213
61264
|
)
|
|
61214
61265
|
)
|
|
@@ -61216,8 +61267,8 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61216
61267
|
])
|
|
61217
61268
|
)
|
|
61218
61269
|
),
|
|
61219
|
-
|
|
61220
|
-
|
|
61270
|
+
AST12.exportNamedDeclaration(
|
|
61271
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
61221
61272
|
)
|
|
61222
61273
|
);
|
|
61223
61274
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -61232,15 +61283,15 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61232
61283
|
);
|
|
61233
61284
|
}
|
|
61234
61285
|
body.push(
|
|
61235
|
-
|
|
61236
|
-
|
|
61237
|
-
|
|
61238
|
-
|
|
61286
|
+
AST12.exportNamedDeclaration(
|
|
61287
|
+
AST12.tsTypeAliasDeclaration(
|
|
61288
|
+
AST12.identifier(inputTypeName),
|
|
61289
|
+
AST12.tsTypeLiteral(
|
|
61239
61290
|
(definition.variableDefinitions || []).map(
|
|
61240
61291
|
(definition2) => {
|
|
61241
|
-
return
|
|
61242
|
-
|
|
61243
|
-
|
|
61292
|
+
return AST12.tsPropertySignature(
|
|
61293
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61294
|
+
AST12.tsTypeAnnotation(
|
|
61244
61295
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61245
61296
|
),
|
|
61246
61297
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61253,16 +61304,16 @@ async function generateOperationTypeDefs(config2, filepath, document, body, defi
|
|
|
61253
61304
|
);
|
|
61254
61305
|
} else {
|
|
61255
61306
|
body.push(
|
|
61256
|
-
|
|
61257
|
-
|
|
61307
|
+
AST12.exportNamedDeclaration(
|
|
61308
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
61258
61309
|
)
|
|
61259
61310
|
);
|
|
61260
61311
|
}
|
|
61261
61312
|
if (definition.operation === "mutation") {
|
|
61262
61313
|
body.push(
|
|
61263
|
-
|
|
61264
|
-
|
|
61265
|
-
|
|
61314
|
+
AST12.exportNamedDeclaration(
|
|
61315
|
+
AST12.tsTypeAliasDeclaration(
|
|
61316
|
+
AST12.identifier(optimisticTypeName),
|
|
61266
61317
|
inlineType({
|
|
61267
61318
|
config: config2,
|
|
61268
61319
|
filepath,
|
|
@@ -61296,12 +61347,12 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61296
61347
|
let directive = definition.directives?.find(
|
|
61297
61348
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61298
61349
|
);
|
|
61299
|
-
let inputValue = !directive ?
|
|
61350
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
61300
61351
|
(fragmentArgumentsDefinitions(config2, filepath, definition) || []).map(
|
|
61301
61352
|
(definition2) => {
|
|
61302
|
-
return
|
|
61303
|
-
|
|
61304
|
-
|
|
61353
|
+
return AST12.tsPropertySignature(
|
|
61354
|
+
AST12.identifier(definition2.variable.name.value),
|
|
61355
|
+
AST12.tsTypeAnnotation(
|
|
61305
61356
|
tsTypeReference(config2, missingScalars, definition2, body)
|
|
61306
61357
|
),
|
|
61307
61358
|
definition2.type.kind !== "NonNullType"
|
|
@@ -61310,30 +61361,30 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61310
61361
|
)
|
|
61311
61362
|
);
|
|
61312
61363
|
body.push(
|
|
61313
|
-
|
|
61314
|
-
|
|
61364
|
+
AST12.exportNamedDeclaration(
|
|
61365
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
61315
61366
|
),
|
|
61316
|
-
|
|
61317
|
-
|
|
61318
|
-
|
|
61319
|
-
|
|
61367
|
+
AST12.exportNamedDeclaration(
|
|
61368
|
+
AST12.tsTypeAliasDeclaration(
|
|
61369
|
+
AST12.identifier(propTypeName),
|
|
61370
|
+
AST12.tsTypeLiteral([
|
|
61320
61371
|
readonlyProperty(
|
|
61321
|
-
|
|
61322
|
-
|
|
61323
|
-
|
|
61324
|
-
|
|
61372
|
+
AST12.tsPropertySignature(
|
|
61373
|
+
AST12.stringLiteral("shape"),
|
|
61374
|
+
AST12.tsTypeAnnotation(
|
|
61375
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
61325
61376
|
),
|
|
61326
61377
|
true
|
|
61327
61378
|
)
|
|
61328
61379
|
),
|
|
61329
61380
|
readonlyProperty(
|
|
61330
|
-
|
|
61331
|
-
|
|
61332
|
-
|
|
61333
|
-
|
|
61334
|
-
|
|
61335
|
-
|
|
61336
|
-
|
|
61381
|
+
AST12.tsPropertySignature(
|
|
61382
|
+
AST12.stringLiteral(fragmentKey2),
|
|
61383
|
+
AST12.tsTypeAnnotation(
|
|
61384
|
+
AST12.tsTypeLiteral([
|
|
61385
|
+
AST12.tsPropertySignature(
|
|
61386
|
+
AST12.stringLiteral(propTypeName),
|
|
61387
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
61337
61388
|
)
|
|
61338
61389
|
])
|
|
61339
61390
|
)
|
|
@@ -61342,9 +61393,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61342
61393
|
])
|
|
61343
61394
|
)
|
|
61344
61395
|
),
|
|
61345
|
-
|
|
61346
|
-
|
|
61347
|
-
|
|
61396
|
+
AST12.exportNamedDeclaration(
|
|
61397
|
+
AST12.tsTypeAliasDeclaration(
|
|
61398
|
+
AST12.identifier(shapeTypeName),
|
|
61348
61399
|
withLoadingState({
|
|
61349
61400
|
config: config2,
|
|
61350
61401
|
document,
|
|
@@ -61370,8 +61421,8 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
61370
61421
|
|
|
61371
61422
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
61372
61423
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
61373
|
-
var
|
|
61374
|
-
var
|
|
61424
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
61425
|
+
var AST13 = recast13.types.builders;
|
|
61375
61426
|
async function imperativeCacheTypef(config2, docs) {
|
|
61376
61427
|
const returnType = (doc) => config2.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
61377
61428
|
config: config2,
|
|
@@ -61387,87 +61438,87 @@ async function imperativeCacheTypef(config2, docs) {
|
|
|
61387
61438
|
}) ?? "any";
|
|
61388
61439
|
const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
|
|
61389
61440
|
const body = [];
|
|
61390
|
-
const declaration =
|
|
61391
|
-
|
|
61392
|
-
|
|
61393
|
-
|
|
61394
|
-
|
|
61395
|
-
|
|
61441
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
61442
|
+
AST13.identifier(CacheTypeDefName),
|
|
61443
|
+
AST13.tsTypeLiteral([
|
|
61444
|
+
AST13.tsPropertySignature(
|
|
61445
|
+
AST13.identifier("types"),
|
|
61446
|
+
AST13.tsTypeAnnotation(typeDefinitions(config2, body, docs, returnType))
|
|
61396
61447
|
),
|
|
61397
|
-
|
|
61398
|
-
|
|
61399
|
-
|
|
61448
|
+
AST13.tsPropertySignature(
|
|
61449
|
+
AST13.identifier("lists"),
|
|
61450
|
+
AST13.tsTypeAnnotation(listDefinitions(config2, body, docs))
|
|
61400
61451
|
),
|
|
61401
|
-
|
|
61402
|
-
|
|
61403
|
-
|
|
61452
|
+
AST13.tsPropertySignature(
|
|
61453
|
+
AST13.identifier("queries"),
|
|
61454
|
+
AST13.tsTypeAnnotation(queryDefinitions(config2, body, docs, returnType))
|
|
61404
61455
|
)
|
|
61405
61456
|
])
|
|
61406
61457
|
);
|
|
61407
61458
|
declaration.declare = true;
|
|
61408
|
-
const importRecord =
|
|
61409
|
-
[
|
|
61410
|
-
|
|
61459
|
+
const importRecord = AST13.importDeclaration(
|
|
61460
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
61461
|
+
AST13.stringLiteral("./public/record")
|
|
61411
61462
|
);
|
|
61412
61463
|
importRecord.importKind = "type";
|
|
61413
61464
|
await fs_exports.writeFile(
|
|
61414
61465
|
target,
|
|
61415
|
-
|
|
61416
|
-
|
|
61466
|
+
recast13.prettyPrint(
|
|
61467
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
61417
61468
|
).code
|
|
61418
61469
|
);
|
|
61419
61470
|
}
|
|
61420
61471
|
function typeDefinitions(config2, body, docs, returnType) {
|
|
61421
61472
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
61422
61473
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
61423
|
-
const
|
|
61474
|
+
const types15 = Object.values(config2.schema.getTypeMap()).filter(
|
|
61424
61475
|
(type) => !graphql18.isAbstractType(type) && !graphql18.isScalarType(type) && !graphql18.isEnumType(type) && !graphql18.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
61425
61476
|
);
|
|
61426
61477
|
const fragmentMap = fragmentListMap(
|
|
61427
61478
|
config2,
|
|
61428
|
-
|
|
61479
|
+
types15.map((type) => type.name),
|
|
61429
61480
|
body,
|
|
61430
61481
|
docs,
|
|
61431
61482
|
returnType
|
|
61432
61483
|
);
|
|
61433
|
-
return
|
|
61434
|
-
|
|
61484
|
+
return AST13.tsTypeLiteral(
|
|
61485
|
+
types15.map((type) => {
|
|
61435
61486
|
let typeName = type.name;
|
|
61436
61487
|
if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
|
|
61437
61488
|
typeName = "__ROOT__";
|
|
61438
61489
|
}
|
|
61439
|
-
let idFields =
|
|
61490
|
+
let idFields = AST13.tsNeverKeyword();
|
|
61440
61491
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
61441
61492
|
if (graphql18.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
61442
|
-
idFields =
|
|
61493
|
+
idFields = AST13.tsTypeLiteral(
|
|
61443
61494
|
keys2.map((key) => {
|
|
61444
61495
|
const fieldType = type.getFields()[key];
|
|
61445
61496
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61446
|
-
return
|
|
61447
|
-
|
|
61448
|
-
|
|
61497
|
+
return AST13.tsPropertySignature(
|
|
61498
|
+
AST13.identifier(key),
|
|
61499
|
+
AST13.tsTypeAnnotation(
|
|
61449
61500
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61450
61501
|
)
|
|
61451
61502
|
);
|
|
61452
61503
|
})
|
|
61453
61504
|
);
|
|
61454
61505
|
} else if (typeName === "__ROOT__") {
|
|
61455
|
-
idFields =
|
|
61506
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
61456
61507
|
}
|
|
61457
|
-
let fields =
|
|
61508
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
61458
61509
|
if (graphql18.isObjectType(type)) {
|
|
61459
|
-
fields =
|
|
61510
|
+
fields = AST13.tsTypeLiteral(
|
|
61460
61511
|
Object.entries(type.getFields()).map(
|
|
61461
61512
|
([key, fieldType]) => {
|
|
61462
61513
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
61463
|
-
let typeOptions =
|
|
61514
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
61464
61515
|
if (graphql18.isScalarType(unwrapped.type)) {
|
|
61465
61516
|
typeOptions.types.push(
|
|
61466
61517
|
scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
61467
61518
|
);
|
|
61468
61519
|
} else if (graphql18.isEnumType(unwrapped.type)) {
|
|
61469
61520
|
typeOptions.types.push(
|
|
61470
|
-
|
|
61521
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
61471
61522
|
);
|
|
61472
61523
|
} else if (!graphql18.isAbstractType(unwrapped.type)) {
|
|
61473
61524
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -61478,21 +61529,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61478
61529
|
}
|
|
61479
61530
|
for (const wrapper of unwrapped.wrappers) {
|
|
61480
61531
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
61481
|
-
typeOptions =
|
|
61482
|
-
|
|
61532
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
61533
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
61483
61534
|
);
|
|
61484
61535
|
} else if (wrapper === "List" /* List */) {
|
|
61485
|
-
typeOptions =
|
|
61486
|
-
|
|
61536
|
+
typeOptions = AST13.tsArrayType(
|
|
61537
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
61487
61538
|
);
|
|
61488
61539
|
}
|
|
61489
61540
|
}
|
|
61490
61541
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
61491
61542
|
typeOptions = typeOptions.typeAnnotation;
|
|
61492
61543
|
}
|
|
61493
|
-
let args =
|
|
61544
|
+
let args = AST13.tsNeverKeyword();
|
|
61494
61545
|
if (fieldType.args?.length > 0) {
|
|
61495
|
-
args =
|
|
61546
|
+
args = AST13.tsTypeLiteral(
|
|
61496
61547
|
fieldType.args.map((arg) => {
|
|
61497
61548
|
addReferencedInputTypes(
|
|
61498
61549
|
config2,
|
|
@@ -61502,9 +61553,9 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61502
61553
|
/* @__PURE__ */ new Set(),
|
|
61503
61554
|
arg.type
|
|
61504
61555
|
);
|
|
61505
|
-
const prop =
|
|
61506
|
-
|
|
61507
|
-
|
|
61556
|
+
const prop = AST13.tsPropertySignature(
|
|
61557
|
+
AST13.identifier(arg.name),
|
|
61558
|
+
AST13.tsTypeAnnotation(
|
|
61508
61559
|
tsTypeReference(config2, /* @__PURE__ */ new Set(), arg, body)
|
|
61509
61560
|
)
|
|
61510
61561
|
);
|
|
@@ -61514,17 +61565,17 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61514
61565
|
})
|
|
61515
61566
|
);
|
|
61516
61567
|
}
|
|
61517
|
-
return
|
|
61518
|
-
|
|
61519
|
-
|
|
61520
|
-
|
|
61521
|
-
|
|
61522
|
-
|
|
61523
|
-
|
|
61568
|
+
return AST13.tsPropertySignature(
|
|
61569
|
+
AST13.identifier(key),
|
|
61570
|
+
AST13.tsTypeAnnotation(
|
|
61571
|
+
AST13.tsTypeLiteral([
|
|
61572
|
+
AST13.tsPropertySignature(
|
|
61573
|
+
AST13.identifier("type"),
|
|
61574
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
61524
61575
|
),
|
|
61525
|
-
|
|
61526
|
-
|
|
61527
|
-
|
|
61576
|
+
AST13.tsPropertySignature(
|
|
61577
|
+
AST13.identifier("args"),
|
|
61578
|
+
AST13.tsTypeAnnotation(args)
|
|
61528
61579
|
)
|
|
61529
61580
|
])
|
|
61530
61581
|
)
|
|
@@ -61533,21 +61584,21 @@ function typeDefinitions(config2, body, docs, returnType) {
|
|
|
61533
61584
|
)
|
|
61534
61585
|
);
|
|
61535
61586
|
}
|
|
61536
|
-
return
|
|
61537
|
-
|
|
61538
|
-
|
|
61539
|
-
|
|
61540
|
-
|
|
61541
|
-
|
|
61542
|
-
|
|
61587
|
+
return AST13.tsPropertySignature(
|
|
61588
|
+
AST13.identifier(typeName),
|
|
61589
|
+
AST13.tsTypeAnnotation(
|
|
61590
|
+
AST13.tsTypeLiteral([
|
|
61591
|
+
AST13.tsPropertySignature(
|
|
61592
|
+
AST13.identifier("idFields"),
|
|
61593
|
+
AST13.tsTypeAnnotation(idFields)
|
|
61543
61594
|
),
|
|
61544
|
-
|
|
61545
|
-
|
|
61546
|
-
|
|
61595
|
+
AST13.tsPropertySignature(
|
|
61596
|
+
AST13.identifier("fields"),
|
|
61597
|
+
AST13.tsTypeAnnotation(fields)
|
|
61547
61598
|
),
|
|
61548
|
-
|
|
61549
|
-
|
|
61550
|
-
|
|
61599
|
+
AST13.tsPropertySignature(
|
|
61600
|
+
AST13.identifier("fragments"),
|
|
61601
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
61551
61602
|
)
|
|
61552
61603
|
])
|
|
61553
61604
|
)
|
|
@@ -61589,28 +61640,28 @@ function listDefinitions(config2, body, docs) {
|
|
|
61589
61640
|
possibleTypes.push(listType.name);
|
|
61590
61641
|
}
|
|
61591
61642
|
lists.push(
|
|
61592
|
-
|
|
61593
|
-
|
|
61594
|
-
|
|
61595
|
-
|
|
61596
|
-
|
|
61597
|
-
|
|
61598
|
-
|
|
61599
|
-
|
|
61643
|
+
AST13.tsPropertySignature(
|
|
61644
|
+
AST13.identifier(nameValue),
|
|
61645
|
+
AST13.tsTypeAnnotation(
|
|
61646
|
+
AST13.tsTypeLiteral([
|
|
61647
|
+
AST13.tsPropertySignature(
|
|
61648
|
+
AST13.identifier("types"),
|
|
61649
|
+
AST13.tsTypeAnnotation(
|
|
61650
|
+
AST13.tsUnionType(
|
|
61600
61651
|
possibleTypes.map(
|
|
61601
|
-
(possible) =>
|
|
61652
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
61602
61653
|
)
|
|
61603
61654
|
)
|
|
61604
61655
|
)
|
|
61605
61656
|
),
|
|
61606
|
-
|
|
61607
|
-
|
|
61608
|
-
|
|
61609
|
-
targetFieldDefinition.args.length === 0 ?
|
|
61657
|
+
AST13.tsPropertySignature(
|
|
61658
|
+
AST13.identifier("filters"),
|
|
61659
|
+
AST13.tsTypeAnnotation(
|
|
61660
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
61610
61661
|
targetFieldDefinition.args.map((arg) => {
|
|
61611
|
-
const argDef =
|
|
61612
|
-
|
|
61613
|
-
|
|
61662
|
+
const argDef = AST13.tsPropertySignature(
|
|
61663
|
+
AST13.identifier(arg.name),
|
|
61664
|
+
AST13.tsTypeAnnotation(
|
|
61614
61665
|
tsTypeReference(
|
|
61615
61666
|
config2,
|
|
61616
61667
|
/* @__PURE__ */ new Set(),
|
|
@@ -61632,10 +61683,10 @@ function listDefinitions(config2, body, docs) {
|
|
|
61632
61683
|
}
|
|
61633
61684
|
});
|
|
61634
61685
|
}
|
|
61635
|
-
return
|
|
61686
|
+
return AST13.tsTypeLiteral(lists);
|
|
61636
61687
|
}
|
|
61637
61688
|
function queryDefinitions(config2, body, docs, returnType) {
|
|
61638
|
-
return
|
|
61689
|
+
return AST13.tsTupleType(
|
|
61639
61690
|
docs.reduce((prev, doc) => {
|
|
61640
61691
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
61641
61692
|
return prev;
|
|
@@ -61657,10 +61708,10 @@ function queryDefinitions(config2, body, docs, returnType) {
|
|
|
61657
61708
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
61658
61709
|
});
|
|
61659
61710
|
return prev.concat(
|
|
61660
|
-
|
|
61661
|
-
|
|
61662
|
-
|
|
61663
|
-
|
|
61711
|
+
AST13.tsTupleType([
|
|
61712
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
61713
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
61714
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
61664
61715
|
])
|
|
61665
61716
|
);
|
|
61666
61717
|
}, [])
|
|
@@ -61689,13 +61740,13 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61689
61740
|
),
|
|
61690
61741
|
import: [`${definition.name.value}$data`]
|
|
61691
61742
|
});
|
|
61692
|
-
let inputType =
|
|
61743
|
+
let inputType = AST13.tsNeverKeyword();
|
|
61693
61744
|
let directive = definition.directives?.find(
|
|
61694
61745
|
(directive2) => directive2.name.value === config2.argumentsDirective
|
|
61695
61746
|
);
|
|
61696
61747
|
if (directive) {
|
|
61697
|
-
inputType =
|
|
61698
|
-
|
|
61748
|
+
inputType = AST13.tsTypeReference(
|
|
61749
|
+
AST13.identifier(
|
|
61699
61750
|
ensureImports({
|
|
61700
61751
|
config: config2,
|
|
61701
61752
|
body,
|
|
@@ -61710,11 +61761,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61710
61761
|
}
|
|
61711
61762
|
return {
|
|
61712
61763
|
...prev,
|
|
61713
|
-
[typeName]:
|
|
61764
|
+
[typeName]: AST13.tsTupleType(
|
|
61714
61765
|
previousValue.concat(
|
|
61715
|
-
|
|
61716
|
-
|
|
61717
|
-
|
|
61766
|
+
AST13.tsTupleType([
|
|
61767
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
61768
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
61718
61769
|
inputType
|
|
61719
61770
|
])
|
|
61720
61771
|
)
|
|
@@ -61724,11 +61775,11 @@ function fragmentListMap(config2, concreteTypes, body, docs, return_type) {
|
|
|
61724
61775
|
}
|
|
61725
61776
|
var CacheTypeDefName = "CacheTypeDef";
|
|
61726
61777
|
function record(name) {
|
|
61727
|
-
return
|
|
61728
|
-
|
|
61729
|
-
|
|
61730
|
-
|
|
61731
|
-
|
|
61778
|
+
return AST13.tsTypeReference(
|
|
61779
|
+
AST13.identifier("Record"),
|
|
61780
|
+
AST13.tsTypeParameterInstantiation([
|
|
61781
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
61782
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
61732
61783
|
])
|
|
61733
61784
|
);
|
|
61734
61785
|
}
|
|
@@ -61781,25 +61832,25 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
61781
61832
|
|
|
61782
61833
|
// src/codegen/generators/definitions/enums.ts
|
|
61783
61834
|
var graphql20 = __toESM(require_graphql2(), 1);
|
|
61784
|
-
var
|
|
61785
|
-
var
|
|
61835
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
61836
|
+
var AST14 = recast14.types.builders;
|
|
61786
61837
|
async function definitionsGenerator(config2) {
|
|
61787
61838
|
const enums = graphql20.parse(graphql20.printSchema(config2.schema)).definitions.filter(
|
|
61788
61839
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
61789
61840
|
).filter((def) => !config2.isInternalEnum(def));
|
|
61790
61841
|
const { code: runtimeDefinitions } = await printJS(
|
|
61791
|
-
|
|
61842
|
+
AST14.program(
|
|
61792
61843
|
enums.map((defn) => {
|
|
61793
61844
|
const name = defn.name.value;
|
|
61794
61845
|
return moduleExport(
|
|
61795
61846
|
config2,
|
|
61796
61847
|
name,
|
|
61797
|
-
|
|
61848
|
+
AST14.objectExpression(
|
|
61798
61849
|
defn.values?.map((value) => {
|
|
61799
61850
|
const str = value.name.value;
|
|
61800
|
-
return
|
|
61801
|
-
|
|
61802
|
-
|
|
61851
|
+
return AST14.objectProperty(
|
|
61852
|
+
AST14.stringLiteral(str),
|
|
61853
|
+
AST14.stringLiteral(str)
|
|
61803
61854
|
);
|
|
61804
61855
|
}) || []
|
|
61805
61856
|
)
|