houdini 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +613 -562
- package/build/cmd-esm/index.js +613 -562
- package/build/codegen/generators/artifacts/selection.d.ts +1 -3
- package/build/codegen-cjs/index.js +600 -549
- package/build/codegen-esm/index.js +600 -549
- package/build/lib-cjs/index.js +41 -10
- package/build/lib-esm/index.js +41 -10
- package/build/runtime/cache/cache.d.ts +2 -0
- package/build/runtime/cache/gc.d.ts +1 -0
- package/build/runtime/cache/lists.d.ts +1 -0
- package/build/runtime/cache/staleManager.d.ts +1 -0
- package/build/runtime/cache/storage.d.ts +1 -0
- package/build/runtime/cache/subscription.d.ts +2 -1
- package/build/runtime/public/cache.d.ts +4 -0
- package/build/runtime-cjs/cache/cache.d.ts +2 -0
- package/build/runtime-cjs/cache/cache.js +16 -10
- package/build/runtime-cjs/cache/gc.d.ts +1 -0
- package/build/runtime-cjs/cache/gc.js +3 -0
- package/build/runtime-cjs/cache/lists.d.ts +1 -0
- package/build/runtime-cjs/cache/lists.js +4 -0
- package/build/runtime-cjs/cache/staleManager.d.ts +1 -0
- package/build/runtime-cjs/cache/staleManager.js +3 -0
- package/build/runtime-cjs/cache/storage.d.ts +1 -0
- package/build/runtime-cjs/cache/storage.js +3 -0
- package/build/runtime-cjs/cache/subscription.d.ts +2 -1
- package/build/runtime-cjs/cache/subscription.js +13 -0
- package/build/runtime-cjs/public/cache.d.ts +4 -0
- package/build/runtime-cjs/public/cache.js +3 -0
- package/build/runtime-esm/cache/cache.d.ts +2 -0
- package/build/runtime-esm/cache/cache.js +16 -10
- package/build/runtime-esm/cache/gc.d.ts +1 -0
- package/build/runtime-esm/cache/gc.js +3 -0
- package/build/runtime-esm/cache/lists.d.ts +1 -0
- package/build/runtime-esm/cache/lists.js +4 -0
- package/build/runtime-esm/cache/staleManager.d.ts +1 -0
- package/build/runtime-esm/cache/staleManager.js +3 -0
- package/build/runtime-esm/cache/storage.d.ts +1 -0
- package/build/runtime-esm/cache/storage.js +3 -0
- package/build/runtime-esm/cache/subscription.d.ts +2 -1
- package/build/runtime-esm/cache/subscription.js +13 -0
- package/build/runtime-esm/public/cache.d.ts +4 -0
- package/build/runtime-esm/public/cache.js +3 -0
- package/build/test-cjs/index.js +603 -552
- package/build/test-esm/index.js +603 -552
- package/build/vite-cjs/index.js +618 -567
- package/build/vite-esm/index.js +618 -567
- package/package.json +1 -1
package/build/vite-esm/index.js
CHANGED
|
@@ -6125,12 +6125,12 @@ var require_parser = __commonJS({
|
|
|
6125
6125
|
return [];
|
|
6126
6126
|
}
|
|
6127
6127
|
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
6128
|
-
var
|
|
6128
|
+
var types18 = [];
|
|
6129
6129
|
this.expectOptionalToken(_tokenKind.TokenKind.AMP);
|
|
6130
6130
|
do {
|
|
6131
|
-
|
|
6131
|
+
types18.push(this.parseNamedType());
|
|
6132
6132
|
} while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
|
|
6133
|
-
return
|
|
6133
|
+
return types18;
|
|
6134
6134
|
}
|
|
6135
6135
|
return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
|
|
6136
6136
|
};
|
|
@@ -6209,13 +6209,13 @@ var require_parser = __commonJS({
|
|
|
6209
6209
|
this.expectKeyword("union");
|
|
6210
6210
|
var name = this.parseName();
|
|
6211
6211
|
var directives = this.parseDirectives(true);
|
|
6212
|
-
var
|
|
6212
|
+
var types18 = this.parseUnionMemberTypes();
|
|
6213
6213
|
return {
|
|
6214
6214
|
kind: _kinds.Kind.UNION_TYPE_DEFINITION,
|
|
6215
6215
|
description,
|
|
6216
6216
|
name,
|
|
6217
6217
|
directives,
|
|
6218
|
-
types:
|
|
6218
|
+
types: types18,
|
|
6219
6219
|
loc: this.loc(start)
|
|
6220
6220
|
};
|
|
6221
6221
|
};
|
|
@@ -6373,15 +6373,15 @@ var require_parser = __commonJS({
|
|
|
6373
6373
|
this.expectKeyword("union");
|
|
6374
6374
|
var name = this.parseName();
|
|
6375
6375
|
var directives = this.parseDirectives(true);
|
|
6376
|
-
var
|
|
6377
|
-
if (directives.length === 0 &&
|
|
6376
|
+
var types18 = this.parseUnionMemberTypes();
|
|
6377
|
+
if (directives.length === 0 && types18.length === 0) {
|
|
6378
6378
|
throw this.unexpected();
|
|
6379
6379
|
}
|
|
6380
6380
|
return {
|
|
6381
6381
|
kind: _kinds.Kind.UNION_TYPE_EXTENSION,
|
|
6382
6382
|
name,
|
|
6383
6383
|
directives,
|
|
6384
|
-
types:
|
|
6384
|
+
types: types18,
|
|
6385
6385
|
loc: this.loc(start)
|
|
6386
6386
|
};
|
|
6387
6387
|
};
|
|
@@ -7359,8 +7359,8 @@ var require_printer = __commonJS({
|
|
|
7359
7359
|
return join3(["interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7360
7360
|
}),
|
|
7361
7361
|
UnionTypeDefinition: addDescription2(function(_ref27) {
|
|
7362
|
-
var name = _ref27.name, directives = _ref27.directives,
|
|
7363
|
-
return join3(["union", name, join3(directives, " "),
|
|
7362
|
+
var name = _ref27.name, directives = _ref27.directives, types18 = _ref27.types;
|
|
7363
|
+
return join3(["union", name, join3(directives, " "), types18 && types18.length !== 0 ? "= " + join3(types18, " | ") : ""], " ");
|
|
7364
7364
|
}),
|
|
7365
7365
|
EnumTypeDefinition: addDescription2(function(_ref28) {
|
|
7366
7366
|
var name = _ref28.name, directives = _ref28.directives, values = _ref28.values;
|
|
@@ -7395,8 +7395,8 @@ var require_printer = __commonJS({
|
|
|
7395
7395
|
return join3(["extend interface", name, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
|
|
7396
7396
|
},
|
|
7397
7397
|
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
7398
|
-
var name = _ref36.name, directives = _ref36.directives,
|
|
7399
|
-
return join3(["extend union", name, join3(directives, " "),
|
|
7398
|
+
var name = _ref36.name, directives = _ref36.directives, types18 = _ref36.types;
|
|
7399
|
+
return join3(["extend union", name, join3(directives, " "), types18 && types18.length !== 0 ? "= " + join3(types18, " | ") : ""], " ");
|
|
7400
7400
|
},
|
|
7401
7401
|
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
7402
7402
|
var name = _ref37.name, directives = _ref37.directives, values = _ref37.values;
|
|
@@ -8067,9 +8067,9 @@ var require_definition = __commonJS({
|
|
|
8067
8067
|
exports.GraphQLUnionType = GraphQLUnionType3;
|
|
8068
8068
|
(0, _defineInspect.default)(GraphQLUnionType3);
|
|
8069
8069
|
function defineTypes(config4) {
|
|
8070
|
-
var
|
|
8071
|
-
Array.isArray(
|
|
8072
|
-
return
|
|
8070
|
+
var types18 = resolveThunk(config4.types);
|
|
8071
|
+
Array.isArray(types18) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config4.name, "."));
|
|
8072
|
+
return types18;
|
|
8073
8073
|
}
|
|
8074
8074
|
var GraphQLEnumType4 = /* @__PURE__ */ function() {
|
|
8075
8075
|
function GraphQLEnumType5(config4) {
|
|
@@ -15706,7 +15706,7 @@ var require_buildClientSchema = __commonJS({
|
|
|
15706
15706
|
return new _definition.GraphQLUnionType({
|
|
15707
15707
|
name: unionIntrospection.name,
|
|
15708
15708
|
description: unionIntrospection.description,
|
|
15709
|
-
types: function
|
|
15709
|
+
types: function types18() {
|
|
15710
15710
|
return unionIntrospection.possibleTypes.map(getObjectType);
|
|
15711
15711
|
}
|
|
15712
15712
|
});
|
|
@@ -16051,7 +16051,7 @@ var require_extendSchema = __commonJS({
|
|
|
16051
16051
|
var config4 = type.toConfig();
|
|
16052
16052
|
var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config4.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
|
|
16053
16053
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config4), {}, {
|
|
16054
|
-
types: function
|
|
16054
|
+
types: function types18() {
|
|
16055
16055
|
return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
|
|
16056
16056
|
},
|
|
16057
16057
|
extensionASTNodes: config4.extensionASTNodes.concat(extensions)
|
|
@@ -16199,17 +16199,17 @@ var require_extendSchema = __commonJS({
|
|
|
16199
16199
|
return interfaces;
|
|
16200
16200
|
}
|
|
16201
16201
|
function buildUnionTypes(nodes) {
|
|
16202
|
-
var
|
|
16202
|
+
var types18 = [];
|
|
16203
16203
|
for (var _i32 = 0; _i32 < nodes.length; _i32++) {
|
|
16204
16204
|
var _node$types;
|
|
16205
16205
|
var node = nodes[_i32];
|
|
16206
16206
|
var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
|
|
16207
16207
|
for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
|
|
16208
16208
|
var type = typeNodes[_i34];
|
|
16209
|
-
|
|
16209
|
+
types18.push(getNamedType5(type));
|
|
16210
16210
|
}
|
|
16211
16211
|
}
|
|
16212
|
-
return
|
|
16212
|
+
return types18;
|
|
16213
16213
|
}
|
|
16214
16214
|
function buildType(astNode) {
|
|
16215
16215
|
var _typeExtensionsMap$na;
|
|
@@ -16266,7 +16266,7 @@ var require_extendSchema = __commonJS({
|
|
|
16266
16266
|
return new _definition.GraphQLUnionType({
|
|
16267
16267
|
name: name2,
|
|
16268
16268
|
description,
|
|
16269
|
-
types: function
|
|
16269
|
+
types: function types18() {
|
|
16270
16270
|
return buildUnionTypes(_allNodes3);
|
|
16271
16271
|
},
|
|
16272
16272
|
astNode,
|
|
@@ -16564,7 +16564,7 @@ var require_lexicographicSortSchema = __commonJS({
|
|
|
16564
16564
|
if ((0, _definition.isUnionType)(type)) {
|
|
16565
16565
|
var _config22 = type.toConfig();
|
|
16566
16566
|
return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
|
|
16567
|
-
types: function
|
|
16567
|
+
types: function types18() {
|
|
16568
16568
|
return sortTypes(_config22.types);
|
|
16569
16569
|
}
|
|
16570
16570
|
}));
|
|
@@ -16649,10 +16649,10 @@ var require_printSchema = __commonJS({
|
|
|
16649
16649
|
}
|
|
16650
16650
|
function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
|
|
16651
16651
|
var directives = schema.getDirectives().filter(directiveFilter);
|
|
16652
|
-
var
|
|
16652
|
+
var types18 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
|
|
16653
16653
|
return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
|
|
16654
16654
|
return printDirective(directive, options);
|
|
16655
|
-
}),
|
|
16655
|
+
}), types18.map(function(type) {
|
|
16656
16656
|
return printType(type, options);
|
|
16657
16657
|
})).filter(Boolean).join("\n\n") + "\n";
|
|
16658
16658
|
}
|
|
@@ -16727,8 +16727,8 @@ var require_printSchema = __commonJS({
|
|
|
16727
16727
|
return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
|
|
16728
16728
|
}
|
|
16729
16729
|
function printUnion(type, options) {
|
|
16730
|
-
var
|
|
16731
|
-
var possibleTypes =
|
|
16730
|
+
var types18 = type.getTypes();
|
|
16731
|
+
var possibleTypes = types18.length ? " = " + types18.join(" | ") : "";
|
|
16732
16732
|
return printDescription(options, type) + "union " + type.name + possibleTypes;
|
|
16733
16733
|
}
|
|
16734
16734
|
function printEnum(type, options) {
|
|
@@ -31644,14 +31644,14 @@ var require_lib3 = __commonJS({
|
|
|
31644
31644
|
this.preserveSpace = !!preserveSpace;
|
|
31645
31645
|
}
|
|
31646
31646
|
};
|
|
31647
|
-
var
|
|
31647
|
+
var types18 = {
|
|
31648
31648
|
brace: new TokContext("{"),
|
|
31649
31649
|
j_oTag: new TokContext("<tag"),
|
|
31650
31650
|
j_cTag: new TokContext("</tag"),
|
|
31651
31651
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
31652
31652
|
};
|
|
31653
31653
|
{
|
|
31654
|
-
|
|
31654
|
+
types18.template = new TokContext("`", true);
|
|
31655
31655
|
}
|
|
31656
31656
|
var beforeExpr = true;
|
|
31657
31657
|
var startsExpr = true;
|
|
@@ -32183,17 +32183,17 @@ var require_lib3 = __commonJS({
|
|
|
32183
32183
|
context.pop();
|
|
32184
32184
|
};
|
|
32185
32185
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
32186
|
-
context.push(
|
|
32186
|
+
context.push(types18.brace);
|
|
32187
32187
|
};
|
|
32188
32188
|
tokenTypes[22].updateContext = (context) => {
|
|
32189
|
-
if (context[context.length - 1] ===
|
|
32189
|
+
if (context[context.length - 1] === types18.template) {
|
|
32190
32190
|
context.pop();
|
|
32191
32191
|
} else {
|
|
32192
|
-
context.push(
|
|
32192
|
+
context.push(types18.template);
|
|
32193
32193
|
}
|
|
32194
32194
|
};
|
|
32195
32195
|
tokenTypes[140].updateContext = (context) => {
|
|
32196
|
-
context.push(
|
|
32196
|
+
context.push(types18.j_expr, types18.j_oTag);
|
|
32197
32197
|
};
|
|
32198
32198
|
}
|
|
32199
32199
|
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";
|
|
@@ -32834,7 +32834,7 @@ var require_lib3 = __commonJS({
|
|
|
32834
32834
|
this.lastTokEndLoc = null;
|
|
32835
32835
|
this.lastTokStartLoc = null;
|
|
32836
32836
|
this.lastTokStart = 0;
|
|
32837
|
-
this.context = [
|
|
32837
|
+
this.context = [types18.brace];
|
|
32838
32838
|
this.canStartJSXElement = true;
|
|
32839
32839
|
this.containsEsc = false;
|
|
32840
32840
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -36758,7 +36758,7 @@ var require_lib3 = __commonJS({
|
|
|
36758
36758
|
context
|
|
36759
36759
|
} = this.state;
|
|
36760
36760
|
const currentContext = context[context.length - 1];
|
|
36761
|
-
if (currentContext ===
|
|
36761
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
36762
36762
|
context.pop();
|
|
36763
36763
|
}
|
|
36764
36764
|
}
|
|
@@ -37818,9 +37818,9 @@ var require_lib3 = __commonJS({
|
|
|
37818
37818
|
switch (this.state.type) {
|
|
37819
37819
|
case 5:
|
|
37820
37820
|
node = this.startNode();
|
|
37821
|
-
this.setContext(
|
|
37821
|
+
this.setContext(types18.brace);
|
|
37822
37822
|
this.next();
|
|
37823
|
-
node = this.jsxParseExpressionContainer(node,
|
|
37823
|
+
node = this.jsxParseExpressionContainer(node, types18.j_oTag);
|
|
37824
37824
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
37825
37825
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
37826
37826
|
at: node
|
|
@@ -37843,7 +37843,7 @@ var require_lib3 = __commonJS({
|
|
|
37843
37843
|
jsxParseSpreadChild(node) {
|
|
37844
37844
|
this.next();
|
|
37845
37845
|
node.expression = this.parseExpression();
|
|
37846
|
-
this.setContext(
|
|
37846
|
+
this.setContext(types18.j_expr);
|
|
37847
37847
|
this.state.canStartJSXElement = true;
|
|
37848
37848
|
this.expect(8);
|
|
37849
37849
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -37863,11 +37863,11 @@ var require_lib3 = __commonJS({
|
|
|
37863
37863
|
jsxParseAttribute() {
|
|
37864
37864
|
const node = this.startNode();
|
|
37865
37865
|
if (this.match(5)) {
|
|
37866
|
-
this.setContext(
|
|
37866
|
+
this.setContext(types18.brace);
|
|
37867
37867
|
this.next();
|
|
37868
37868
|
this.expect(21);
|
|
37869
37869
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
37870
|
-
this.setContext(
|
|
37870
|
+
this.setContext(types18.j_oTag);
|
|
37871
37871
|
this.state.canStartJSXElement = true;
|
|
37872
37872
|
this.expect(8);
|
|
37873
37873
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -37926,12 +37926,12 @@ var require_lib3 = __commonJS({
|
|
|
37926
37926
|
break;
|
|
37927
37927
|
case 5: {
|
|
37928
37928
|
const node2 = this.startNode();
|
|
37929
|
-
this.setContext(
|
|
37929
|
+
this.setContext(types18.brace);
|
|
37930
37930
|
this.next();
|
|
37931
37931
|
if (this.match(21)) {
|
|
37932
37932
|
children.push(this.jsxParseSpreadChild(node2));
|
|
37933
37933
|
} else {
|
|
37934
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
37934
|
+
children.push(this.jsxParseExpressionContainer(node2, types18.j_expr));
|
|
37935
37935
|
}
|
|
37936
37936
|
break;
|
|
37937
37937
|
}
|
|
@@ -38002,10 +38002,10 @@ var require_lib3 = __commonJS({
|
|
|
38002
38002
|
}
|
|
38003
38003
|
getTokenFromCode(code) {
|
|
38004
38004
|
const context = this.curContext();
|
|
38005
|
-
if (context ===
|
|
38005
|
+
if (context === types18.j_expr) {
|
|
38006
38006
|
return this.jsxReadToken();
|
|
38007
38007
|
}
|
|
38008
|
-
if (context ===
|
|
38008
|
+
if (context === types18.j_oTag || context === types18.j_cTag) {
|
|
38009
38009
|
if (isIdentifierStart(code)) {
|
|
38010
38010
|
return this.jsxReadWord();
|
|
38011
38011
|
}
|
|
@@ -38013,7 +38013,7 @@ var require_lib3 = __commonJS({
|
|
|
38013
38013
|
++this.state.pos;
|
|
38014
38014
|
return this.finishToken(141);
|
|
38015
38015
|
}
|
|
38016
|
-
if ((code === 34 || code === 39) && context ===
|
|
38016
|
+
if ((code === 34 || code === 39) && context === types18.j_oTag) {
|
|
38017
38017
|
return this.jsxReadString(code);
|
|
38018
38018
|
}
|
|
38019
38019
|
}
|
|
@@ -38029,17 +38029,17 @@ var require_lib3 = __commonJS({
|
|
|
38029
38029
|
type
|
|
38030
38030
|
} = this.state;
|
|
38031
38031
|
if (type === 56 && prevType === 140) {
|
|
38032
|
-
context.splice(-2, 2,
|
|
38032
|
+
context.splice(-2, 2, types18.j_cTag);
|
|
38033
38033
|
this.state.canStartJSXElement = false;
|
|
38034
38034
|
} else if (type === 140) {
|
|
38035
|
-
context.push(
|
|
38035
|
+
context.push(types18.j_oTag);
|
|
38036
38036
|
} else if (type === 141) {
|
|
38037
38037
|
const out = context[context.length - 1];
|
|
38038
|
-
if (out ===
|
|
38038
|
+
if (out === types18.j_oTag && prevType === 56 || out === types18.j_cTag) {
|
|
38039
38039
|
context.pop();
|
|
38040
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
38040
|
+
this.state.canStartJSXElement = context[context.length - 1] === types18.j_expr;
|
|
38041
38041
|
} else {
|
|
38042
|
-
this.setContext(
|
|
38042
|
+
this.setContext(types18.j_expr);
|
|
38043
38043
|
this.state.canStartJSXElement = true;
|
|
38044
38044
|
}
|
|
38045
38045
|
} else {
|
|
@@ -39047,14 +39047,14 @@ var require_lib3 = __commonJS({
|
|
|
39047
39047
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
39048
39048
|
const node = this.startNode();
|
|
39049
39049
|
const hasLeadingOperator = this.eat(operator);
|
|
39050
|
-
const
|
|
39050
|
+
const types19 = [];
|
|
39051
39051
|
do {
|
|
39052
|
-
|
|
39052
|
+
types19.push(parseConstituentType());
|
|
39053
39053
|
} while (this.eat(operator));
|
|
39054
|
-
if (
|
|
39055
|
-
return
|
|
39054
|
+
if (types19.length === 1 && !hasLeadingOperator) {
|
|
39055
|
+
return types19[0];
|
|
39056
39056
|
}
|
|
39057
|
-
node.types =
|
|
39057
|
+
node.types = types19;
|
|
39058
39058
|
return this.finishNode(node, kind);
|
|
39059
39059
|
}
|
|
39060
39060
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -40283,7 +40283,7 @@ var require_lib3 = __commonJS({
|
|
|
40283
40283
|
context
|
|
40284
40284
|
} = this.state;
|
|
40285
40285
|
const currentContext = context[context.length - 1];
|
|
40286
|
-
if (currentContext ===
|
|
40286
|
+
if (currentContext === types18.j_oTag || currentContext === types18.j_expr) {
|
|
40287
40287
|
context.pop();
|
|
40288
40288
|
}
|
|
40289
40289
|
}
|
|
@@ -45922,9 +45922,9 @@ var require_shared = __commonJS({
|
|
|
45922
45922
|
var tslib_1 = require_tslib();
|
|
45923
45923
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
45924
45924
|
function default_1(fork) {
|
|
45925
|
-
var
|
|
45926
|
-
var Type =
|
|
45927
|
-
var builtin =
|
|
45925
|
+
var types18 = fork.use(types_1.default);
|
|
45926
|
+
var Type = types18.Type;
|
|
45927
|
+
var builtin = types18.builtInTypes;
|
|
45928
45928
|
var isNumber = builtin.number;
|
|
45929
45929
|
function geq(than) {
|
|
45930
45930
|
return Type.from(function(value) {
|
|
@@ -46074,9 +46074,9 @@ var require_types = __commonJS({
|
|
|
46074
46074
|
}(BaseType);
|
|
46075
46075
|
var OrType = function(_super) {
|
|
46076
46076
|
tslib_1.__extends(OrType2, _super);
|
|
46077
|
-
function OrType2(
|
|
46077
|
+
function OrType2(types18) {
|
|
46078
46078
|
var _this = _super.call(this) || this;
|
|
46079
|
-
_this.types =
|
|
46079
|
+
_this.types = types18;
|
|
46080
46080
|
_this.kind = "OrType";
|
|
46081
46081
|
return _this;
|
|
46082
46082
|
}
|
|
@@ -46217,11 +46217,11 @@ var require_types = __commonJS({
|
|
|
46217
46217
|
function typesPlugin(_fork) {
|
|
46218
46218
|
var Type = {
|
|
46219
46219
|
or: function() {
|
|
46220
|
-
var
|
|
46220
|
+
var types18 = [];
|
|
46221
46221
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
46222
|
-
|
|
46222
|
+
types18[_i] = arguments[_i];
|
|
46223
46223
|
}
|
|
46224
|
-
return new OrType(
|
|
46224
|
+
return new OrType(types18.map(function(type) {
|
|
46225
46225
|
return Type.from(type);
|
|
46226
46226
|
}));
|
|
46227
46227
|
},
|
|
@@ -46666,9 +46666,9 @@ var require_path2 = __commonJS({
|
|
|
46666
46666
|
var Op = Object.prototype;
|
|
46667
46667
|
var hasOwn = Op.hasOwnProperty;
|
|
46668
46668
|
function pathPlugin(fork) {
|
|
46669
|
-
var
|
|
46670
|
-
var isArray =
|
|
46671
|
-
var isNumber =
|
|
46669
|
+
var types18 = fork.use(types_1.default);
|
|
46670
|
+
var isArray = types18.builtInTypes.array;
|
|
46671
|
+
var isNumber = types18.builtInTypes.number;
|
|
46672
46672
|
var Path = function Path2(value, parentPath, name) {
|
|
46673
46673
|
if (!(this instanceof Path2)) {
|
|
46674
46674
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -46970,13 +46970,13 @@ var require_scope = __commonJS({
|
|
|
46970
46970
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
46971
46971
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
46972
46972
|
function scopePlugin(fork) {
|
|
46973
|
-
var
|
|
46974
|
-
var Type =
|
|
46975
|
-
var namedTypes =
|
|
46973
|
+
var types18 = fork.use(types_1.default);
|
|
46974
|
+
var Type = types18.Type;
|
|
46975
|
+
var namedTypes = types18.namedTypes;
|
|
46976
46976
|
var Node = namedTypes.Node;
|
|
46977
46977
|
var Expression = namedTypes.Expression;
|
|
46978
|
-
var isArray =
|
|
46979
|
-
var b =
|
|
46978
|
+
var isArray = types18.builtInTypes.array;
|
|
46979
|
+
var b = types18.builders;
|
|
46980
46980
|
var Scope = function Scope2(path2, parentScope) {
|
|
46981
46981
|
if (!(this instanceof Scope2)) {
|
|
46982
46982
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -47039,7 +47039,7 @@ var require_scope = __commonJS({
|
|
|
47039
47039
|
++index;
|
|
47040
47040
|
}
|
|
47041
47041
|
var name = prefix + index;
|
|
47042
|
-
return this.bindings[name] =
|
|
47042
|
+
return this.bindings[name] = types18.builders.identifier(name);
|
|
47043
47043
|
};
|
|
47044
47044
|
Sp.injectTemporary = function(identifier, init) {
|
|
47045
47045
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -47115,7 +47115,7 @@ var require_scope = __commonJS({
|
|
|
47115
47115
|
bindings
|
|
47116
47116
|
);
|
|
47117
47117
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
47118
|
-
|
|
47118
|
+
types18.eachField(node, function(name, child) {
|
|
47119
47119
|
var childPath = path2.get(name);
|
|
47120
47120
|
if (!pathHasValue(childPath, child)) {
|
|
47121
47121
|
throw new Error("");
|
|
@@ -47193,24 +47193,24 @@ var require_scope = __commonJS({
|
|
|
47193
47193
|
addPattern(patternPath.get("argument"), bindings);
|
|
47194
47194
|
}
|
|
47195
47195
|
}
|
|
47196
|
-
function addTypePattern(patternPath,
|
|
47196
|
+
function addTypePattern(patternPath, types19) {
|
|
47197
47197
|
var pattern = patternPath.value;
|
|
47198
47198
|
namedTypes.Pattern.assert(pattern);
|
|
47199
47199
|
if (namedTypes.Identifier.check(pattern)) {
|
|
47200
|
-
if (hasOwn.call(
|
|
47201
|
-
|
|
47200
|
+
if (hasOwn.call(types19, pattern.name)) {
|
|
47201
|
+
types19[pattern.name].push(patternPath);
|
|
47202
47202
|
} else {
|
|
47203
|
-
|
|
47203
|
+
types19[pattern.name] = [patternPath];
|
|
47204
47204
|
}
|
|
47205
47205
|
}
|
|
47206
47206
|
}
|
|
47207
|
-
function addTypeParameter(parameterPath,
|
|
47207
|
+
function addTypeParameter(parameterPath, types19) {
|
|
47208
47208
|
var parameter = parameterPath.value;
|
|
47209
47209
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
47210
|
-
if (hasOwn.call(
|
|
47211
|
-
|
|
47210
|
+
if (hasOwn.call(types19, parameter.name)) {
|
|
47211
|
+
types19[parameter.name].push(parameterPath);
|
|
47212
47212
|
} else {
|
|
47213
|
-
|
|
47213
|
+
types19[parameter.name] = [parameterPath];
|
|
47214
47214
|
}
|
|
47215
47215
|
}
|
|
47216
47216
|
Sp.lookup = function(name) {
|
|
@@ -47251,11 +47251,11 @@ var require_node_path = __commonJS({
|
|
|
47251
47251
|
var scope_1 = tslib_1.__importDefault(require_scope());
|
|
47252
47252
|
var shared_1 = require_shared();
|
|
47253
47253
|
function nodePathPlugin(fork) {
|
|
47254
|
-
var
|
|
47255
|
-
var n =
|
|
47256
|
-
var b =
|
|
47257
|
-
var isNumber =
|
|
47258
|
-
var isArray =
|
|
47254
|
+
var types18 = fork.use(types_1.default);
|
|
47255
|
+
var n = types18.namedTypes;
|
|
47256
|
+
var b = types18.builders;
|
|
47257
|
+
var isNumber = types18.builtInTypes.number;
|
|
47258
|
+
var isArray = types18.builtInTypes.array;
|
|
47259
47259
|
var Path = fork.use(path_1.default);
|
|
47260
47260
|
var Scope = fork.use(scope_1.default);
|
|
47261
47261
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -47346,7 +47346,7 @@ var require_node_path = __commonJS({
|
|
|
47346
47346
|
return scope || null;
|
|
47347
47347
|
};
|
|
47348
47348
|
NPp.getValueProperty = function(name) {
|
|
47349
|
-
return
|
|
47349
|
+
return types18.getFieldValue(this.value, name);
|
|
47350
47350
|
};
|
|
47351
47351
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
47352
47352
|
var pp = this.parentPath;
|
|
@@ -47488,7 +47488,7 @@ var require_node_path = __commonJS({
|
|
|
47488
47488
|
return node.some(containsCallExpression);
|
|
47489
47489
|
}
|
|
47490
47490
|
if (n.Node.check(node)) {
|
|
47491
|
-
return
|
|
47491
|
+
return types18.someField(node, function(_name, child) {
|
|
47492
47492
|
return containsCallExpression(child);
|
|
47493
47493
|
});
|
|
47494
47494
|
}
|
|
@@ -47609,11 +47609,11 @@ var require_path_visitor = __commonJS({
|
|
|
47609
47609
|
var shared_1 = require_shared();
|
|
47610
47610
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
47611
47611
|
function pathVisitorPlugin(fork) {
|
|
47612
|
-
var
|
|
47612
|
+
var types18 = fork.use(types_1.default);
|
|
47613
47613
|
var NodePath = fork.use(node_path_1.default);
|
|
47614
|
-
var isArray =
|
|
47615
|
-
var isObject2 =
|
|
47616
|
-
var isFunction =
|
|
47614
|
+
var isArray = types18.builtInTypes.array;
|
|
47615
|
+
var isObject2 = types18.builtInTypes.object;
|
|
47616
|
+
var isFunction = types18.builtInTypes.function;
|
|
47617
47617
|
var undefined2;
|
|
47618
47618
|
var PathVisitor = function PathVisitor2() {
|
|
47619
47619
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -47633,7 +47633,7 @@ var require_path_visitor = __commonJS({
|
|
|
47633
47633
|
typeNames[methodName.slice("visit".length)] = true;
|
|
47634
47634
|
}
|
|
47635
47635
|
}
|
|
47636
|
-
var supertypeTable =
|
|
47636
|
+
var supertypeTable = types18.computeSupertypeLookupTable(typeNames);
|
|
47637
47637
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
47638
47638
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
47639
47639
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -47752,7 +47752,7 @@ var require_path_visitor = __commonJS({
|
|
|
47752
47752
|
path2.each(visitor.visitWithoutReset, visitor);
|
|
47753
47753
|
} else if (!isObject2.check(value)) {
|
|
47754
47754
|
} else {
|
|
47755
|
-
var childNames =
|
|
47755
|
+
var childNames = types18.getFieldNames(value);
|
|
47756
47756
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
47757
47757
|
childNames.push("comments");
|
|
47758
47758
|
}
|
|
@@ -47761,7 +47761,7 @@ var require_path_visitor = __commonJS({
|
|
|
47761
47761
|
for (var i2 = 0; i2 < childCount; ++i2) {
|
|
47762
47762
|
var childName = childNames[i2];
|
|
47763
47763
|
if (!hasOwn.call(value, childName)) {
|
|
47764
|
-
value[childName] =
|
|
47764
|
+
value[childName] = types18.getFieldValue(value, childName);
|
|
47765
47765
|
}
|
|
47766
47766
|
childPaths.push(path2.get(childName));
|
|
47767
47767
|
}
|
|
@@ -47904,13 +47904,13 @@ var require_equiv = __commonJS({
|
|
|
47904
47904
|
var shared_1 = require_shared();
|
|
47905
47905
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
47906
47906
|
function default_1(fork) {
|
|
47907
|
-
var
|
|
47908
|
-
var getFieldNames =
|
|
47909
|
-
var getFieldValue =
|
|
47910
|
-
var isArray =
|
|
47911
|
-
var isObject2 =
|
|
47912
|
-
var isDate =
|
|
47913
|
-
var isRegExp =
|
|
47907
|
+
var types18 = fork.use(types_1.default);
|
|
47908
|
+
var getFieldNames = types18.getFieldNames;
|
|
47909
|
+
var getFieldValue = types18.getFieldValue;
|
|
47910
|
+
var isArray = types18.builtInTypes.array;
|
|
47911
|
+
var isObject2 = types18.builtInTypes.object;
|
|
47912
|
+
var isDate = types18.builtInTypes.Date;
|
|
47913
|
+
var isRegExp = types18.builtInTypes.RegExp;
|
|
47914
47914
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
47915
47915
|
function astNodesAreEquivalent(a, b, problemPath) {
|
|
47916
47916
|
if (isArray.check(problemPath)) {
|
|
@@ -48063,24 +48063,24 @@ var require_fork = __commonJS({
|
|
|
48063
48063
|
var shared_1 = require_shared();
|
|
48064
48064
|
function default_1(plugins) {
|
|
48065
48065
|
var fork = createFork();
|
|
48066
|
-
var
|
|
48066
|
+
var types18 = fork.use(types_1.default);
|
|
48067
48067
|
plugins.forEach(fork.use);
|
|
48068
|
-
|
|
48068
|
+
types18.finalize();
|
|
48069
48069
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
48070
48070
|
return {
|
|
48071
|
-
Type:
|
|
48072
|
-
builtInTypes:
|
|
48073
|
-
namedTypes:
|
|
48074
|
-
builders:
|
|
48075
|
-
defineMethod:
|
|
48076
|
-
getFieldNames:
|
|
48077
|
-
getFieldValue:
|
|
48078
|
-
eachField:
|
|
48079
|
-
someField:
|
|
48080
|
-
getSupertypeNames:
|
|
48081
|
-
getBuilderName:
|
|
48071
|
+
Type: types18.Type,
|
|
48072
|
+
builtInTypes: types18.builtInTypes,
|
|
48073
|
+
namedTypes: types18.namedTypes,
|
|
48074
|
+
builders: types18.builders,
|
|
48075
|
+
defineMethod: types18.defineMethod,
|
|
48076
|
+
getFieldNames: types18.getFieldNames,
|
|
48077
|
+
getFieldValue: types18.getFieldValue,
|
|
48078
|
+
eachField: types18.eachField,
|
|
48079
|
+
someField: types18.someField,
|
|
48080
|
+
getSupertypeNames: types18.getSupertypeNames,
|
|
48081
|
+
getBuilderName: types18.getBuilderName,
|
|
48082
48082
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
48083
|
-
finalize:
|
|
48083
|
+
finalize: types18.finalize,
|
|
48084
48084
|
Path: fork.use(path_1.default),
|
|
48085
48085
|
NodePath: fork.use(node_path_1.default),
|
|
48086
48086
|
PathVisitor,
|
|
@@ -48250,8 +48250,8 @@ var require_core2 = __commonJS({
|
|
|
48250
48250
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
48251
48251
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48252
48252
|
function default_1(fork) {
|
|
48253
|
-
var
|
|
48254
|
-
var Type =
|
|
48253
|
+
var types18 = fork.use(types_1.default);
|
|
48254
|
+
var Type = types18.Type;
|
|
48255
48255
|
var def = Type.def;
|
|
48256
48256
|
var or = Type.or;
|
|
48257
48257
|
var shared = fork.use(shared_1.default);
|
|
@@ -48343,9 +48343,9 @@ var require_es6 = __commonJS({
|
|
|
48343
48343
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48344
48344
|
function default_1(fork) {
|
|
48345
48345
|
fork.use(core_1.default);
|
|
48346
|
-
var
|
|
48347
|
-
var def =
|
|
48348
|
-
var or =
|
|
48346
|
+
var types18 = fork.use(types_1.default);
|
|
48347
|
+
var def = types18.Type.def;
|
|
48348
|
+
var or = types18.Type.or;
|
|
48349
48349
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48350
48350
|
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"]);
|
|
48351
48351
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -48435,8 +48435,8 @@ var require_es2017 = __commonJS({
|
|
|
48435
48435
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48436
48436
|
function default_1(fork) {
|
|
48437
48437
|
fork.use(es2016_1.default);
|
|
48438
|
-
var
|
|
48439
|
-
var def =
|
|
48438
|
+
var types18 = fork.use(types_1.default);
|
|
48439
|
+
var def = types18.Type.def;
|
|
48440
48440
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48441
48441
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
48442
48442
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -48459,9 +48459,9 @@ var require_es2018 = __commonJS({
|
|
|
48459
48459
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48460
48460
|
function default_1(fork) {
|
|
48461
48461
|
fork.use(es2017_1.default);
|
|
48462
|
-
var
|
|
48463
|
-
var def =
|
|
48464
|
-
var or =
|
|
48462
|
+
var types18 = fork.use(types_1.default);
|
|
48463
|
+
var def = types18.Type.def;
|
|
48464
|
+
var or = types18.Type.or;
|
|
48465
48465
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48466
48466
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
48467
48467
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -48492,9 +48492,9 @@ var require_es2019 = __commonJS({
|
|
|
48492
48492
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48493
48493
|
function default_1(fork) {
|
|
48494
48494
|
fork.use(es2018_1.default);
|
|
48495
|
-
var
|
|
48496
|
-
var def =
|
|
48497
|
-
var or =
|
|
48495
|
+
var types18 = fork.use(types_1.default);
|
|
48496
|
+
var def = types18.Type.def;
|
|
48497
|
+
var or = types18.Type.or;
|
|
48498
48498
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48499
48499
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
48500
48500
|
}
|
|
@@ -48518,9 +48518,9 @@ var require_es20202 = __commonJS({
|
|
|
48518
48518
|
function default_1(fork) {
|
|
48519
48519
|
fork.use(es2020_1.default);
|
|
48520
48520
|
fork.use(es2019_1.default);
|
|
48521
|
-
var
|
|
48522
|
-
var def =
|
|
48523
|
-
var or =
|
|
48521
|
+
var types18 = fork.use(types_1.default);
|
|
48522
|
+
var def = types18.Type.def;
|
|
48523
|
+
var or = types18.Type.or;
|
|
48524
48524
|
var shared = fork.use(shared_1.default);
|
|
48525
48525
|
var defaults = shared.defaults;
|
|
48526
48526
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -48570,8 +48570,8 @@ var require_es2022 = __commonJS({
|
|
|
48570
48570
|
var shared_1 = require_shared();
|
|
48571
48571
|
function default_1(fork) {
|
|
48572
48572
|
fork.use(es2021_1.default);
|
|
48573
|
-
var
|
|
48574
|
-
var def =
|
|
48573
|
+
var types18 = fork.use(types_1.default);
|
|
48574
|
+
var def = types18.Type.def;
|
|
48575
48575
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
48576
48576
|
}
|
|
48577
48577
|
exports.default = default_1;
|
|
@@ -48592,9 +48592,9 @@ var require_es_proposals = __commonJS({
|
|
|
48592
48592
|
var es2022_1 = tslib_1.__importDefault(require_es2022());
|
|
48593
48593
|
function default_1(fork) {
|
|
48594
48594
|
fork.use(es2022_1.default);
|
|
48595
|
-
var
|
|
48596
|
-
var Type =
|
|
48597
|
-
var def =
|
|
48595
|
+
var types18 = fork.use(types_1.default);
|
|
48596
|
+
var Type = types18.Type;
|
|
48597
|
+
var def = types18.Type.def;
|
|
48598
48598
|
var or = Type.or;
|
|
48599
48599
|
var shared = fork.use(shared_1.default);
|
|
48600
48600
|
var defaults = shared.defaults;
|
|
@@ -48634,9 +48634,9 @@ var require_jsx = __commonJS({
|
|
|
48634
48634
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48635
48635
|
function default_1(fork) {
|
|
48636
48636
|
fork.use(es_proposals_1.default);
|
|
48637
|
-
var
|
|
48638
|
-
var def =
|
|
48639
|
-
var or =
|
|
48637
|
+
var types18 = fork.use(types_1.default);
|
|
48638
|
+
var def = types18.Type.def;
|
|
48639
|
+
var or = types18.Type.or;
|
|
48640
48640
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48641
48641
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
48642
48642
|
def("Literal"),
|
|
@@ -48694,9 +48694,9 @@ var require_type_annotations = __commonJS({
|
|
|
48694
48694
|
var types_1 = tslib_1.__importDefault(require_types());
|
|
48695
48695
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48696
48696
|
function default_1(fork) {
|
|
48697
|
-
var
|
|
48698
|
-
var def =
|
|
48699
|
-
var or =
|
|
48697
|
+
var types18 = fork.use(types_1.default);
|
|
48698
|
+
var def = types18.Type.def;
|
|
48699
|
+
var or = types18.Type.or;
|
|
48700
48700
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48701
48701
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
48702
48702
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -48731,9 +48731,9 @@ var require_flow = __commonJS({
|
|
|
48731
48731
|
function default_1(fork) {
|
|
48732
48732
|
fork.use(es_proposals_1.default);
|
|
48733
48733
|
fork.use(type_annotations_1.default);
|
|
48734
|
-
var
|
|
48735
|
-
var def =
|
|
48736
|
-
var or =
|
|
48734
|
+
var types18 = fork.use(types_1.default);
|
|
48735
|
+
var def = types18.Type.def;
|
|
48736
|
+
var or = types18.Type.or;
|
|
48737
48737
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48738
48738
|
def("Flow").bases("Node");
|
|
48739
48739
|
def("FlowType").bases("Flow");
|
|
@@ -48847,10 +48847,10 @@ var require_esprima = __commonJS({
|
|
|
48847
48847
|
var shared_1 = tslib_1.__importStar(require_shared());
|
|
48848
48848
|
function default_1(fork) {
|
|
48849
48849
|
fork.use(es_proposals_1.default);
|
|
48850
|
-
var
|
|
48850
|
+
var types18 = fork.use(types_1.default);
|
|
48851
48851
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48852
|
-
var def =
|
|
48853
|
-
var or =
|
|
48852
|
+
var def = types18.Type.def;
|
|
48853
|
+
var or = types18.Type.or;
|
|
48854
48854
|
def("VariableDeclaration").field("declarations", [or(
|
|
48855
48855
|
def("VariableDeclarator"),
|
|
48856
48856
|
def("Identifier")
|
|
@@ -48895,11 +48895,11 @@ var require_babel_core = __commonJS({
|
|
|
48895
48895
|
function default_1(fork) {
|
|
48896
48896
|
var _a, _b, _c, _d, _e;
|
|
48897
48897
|
fork.use(es_proposals_1.default);
|
|
48898
|
-
var
|
|
48898
|
+
var types18 = fork.use(types_1.default);
|
|
48899
48899
|
var defaults = fork.use(shared_1.default).defaults;
|
|
48900
|
-
var def =
|
|
48901
|
-
var or =
|
|
48902
|
-
var isUndefined =
|
|
48900
|
+
var def = types18.Type.def;
|
|
48901
|
+
var or = types18.Type.or;
|
|
48902
|
+
var isUndefined = types18.builtInTypes.undefined;
|
|
48903
48903
|
def("Noop").bases("Statement").build();
|
|
48904
48904
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
48905
48905
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -48924,7 +48924,7 @@ var require_babel_core = __commonJS({
|
|
|
48924
48924
|
raw: String
|
|
48925
48925
|
},
|
|
48926
48926
|
function getDefault() {
|
|
48927
|
-
var value =
|
|
48927
|
+
var value = types18.getFieldValue(this, "value");
|
|
48928
48928
|
return {
|
|
48929
48929
|
rawValue: value,
|
|
48930
48930
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -49027,8 +49027,8 @@ var require_babel = __commonJS({
|
|
|
49027
49027
|
var flow_1 = tslib_1.__importDefault(require_flow());
|
|
49028
49028
|
var shared_1 = require_shared();
|
|
49029
49029
|
function default_1(fork) {
|
|
49030
|
-
var
|
|
49031
|
-
var def =
|
|
49030
|
+
var types18 = fork.use(types_1.default);
|
|
49031
|
+
var def = types18.Type.def;
|
|
49032
49032
|
fork.use(babel_core_1.default);
|
|
49033
49033
|
fork.use(flow_1.default);
|
|
49034
49034
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -49054,12 +49054,12 @@ var require_typescript = __commonJS({
|
|
|
49054
49054
|
function default_1(fork) {
|
|
49055
49055
|
fork.use(babel_core_1.default);
|
|
49056
49056
|
fork.use(type_annotations_1.default);
|
|
49057
|
-
var
|
|
49058
|
-
var n =
|
|
49059
|
-
var def =
|
|
49060
|
-
var or =
|
|
49057
|
+
var types18 = fork.use(types_1.default);
|
|
49058
|
+
var n = types18.namedTypes;
|
|
49059
|
+
var def = types18.Type.def;
|
|
49060
|
+
var or = types18.Type.or;
|
|
49061
49061
|
var defaults = fork.use(shared_1.default).defaults;
|
|
49062
|
-
var StringLiteral =
|
|
49062
|
+
var StringLiteral = types18.Type.from(function(value, deep) {
|
|
49063
49063
|
if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
|
|
49064
49064
|
return true;
|
|
49065
49065
|
}
|
|
@@ -51035,8 +51035,8 @@ var require_util2 = __commonJS({
|
|
|
51035
51035
|
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;
|
|
51036
51036
|
var tslib_1 = require_tslib();
|
|
51037
51037
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
51038
|
-
var
|
|
51039
|
-
var n =
|
|
51038
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
51039
|
+
var n = types18.namedTypes;
|
|
51040
51040
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
51041
51041
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
51042
51042
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -58354,10 +58354,10 @@ var require_comments = __commonJS({
|
|
|
58354
58354
|
exports.printComments = exports.attach = void 0;
|
|
58355
58355
|
var tslib_1 = require_tslib();
|
|
58356
58356
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
58357
|
-
var
|
|
58358
|
-
var n =
|
|
58359
|
-
var isArray =
|
|
58360
|
-
var isObject2 =
|
|
58357
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58358
|
+
var n = types18.namedTypes;
|
|
58359
|
+
var isArray = types18.builtInTypes.array;
|
|
58360
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58361
58361
|
var lines_1 = require_lines();
|
|
58362
58362
|
var util_1 = require_util2();
|
|
58363
58363
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -58388,7 +58388,7 @@ var require_comments = __commonJS({
|
|
|
58388
58388
|
if (isArray.check(node)) {
|
|
58389
58389
|
names = Object.keys(node);
|
|
58390
58390
|
} else if (isObject2.check(node)) {
|
|
58391
|
-
names =
|
|
58391
|
+
names = types18.getFieldNames(node);
|
|
58392
58392
|
} else {
|
|
58393
58393
|
return resultArray;
|
|
58394
58394
|
}
|
|
@@ -58566,7 +58566,7 @@ var require_comments = __commonJS({
|
|
|
58566
58566
|
function printComments(path2, print9) {
|
|
58567
58567
|
var value = path2.getValue();
|
|
58568
58568
|
var innerLines = print9(path2);
|
|
58569
|
-
var comments = n.Node.check(value) &&
|
|
58569
|
+
var comments = n.Node.check(value) && types18.getFieldValue(value, "comments");
|
|
58570
58570
|
if (!comments || comments.length === 0) {
|
|
58571
58571
|
return innerLines;
|
|
58572
58572
|
}
|
|
@@ -58574,8 +58574,8 @@ var require_comments = __commonJS({
|
|
|
58574
58574
|
var trailingParts = [innerLines];
|
|
58575
58575
|
path2.each(function(commentPath) {
|
|
58576
58576
|
var comment = commentPath.getValue();
|
|
58577
|
-
var leading =
|
|
58578
|
-
var trailing =
|
|
58577
|
+
var leading = types18.getFieldValue(comment, "leading");
|
|
58578
|
+
var trailing = types18.getFieldValue(comment, "trailing");
|
|
58579
58579
|
if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
58580
58580
|
leadingParts.push(printLeadingComment(commentPath, print9));
|
|
58581
58581
|
} else if (trailing) {
|
|
@@ -58597,10 +58597,10 @@ var require_parser2 = __commonJS({
|
|
|
58597
58597
|
exports.parse = void 0;
|
|
58598
58598
|
var tslib_1 = require_tslib();
|
|
58599
58599
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
58600
|
-
var
|
|
58601
|
-
var b =
|
|
58602
|
-
var isObject2 =
|
|
58603
|
-
var isArray =
|
|
58600
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58601
|
+
var b = types18.builders;
|
|
58602
|
+
var isObject2 = types18.builtInTypes.object;
|
|
58603
|
+
var isArray = types18.builtInTypes.array;
|
|
58604
58604
|
var options_1 = require_options();
|
|
58605
58605
|
var lines_1 = require_lines();
|
|
58606
58606
|
var comments_1 = require_comments();
|
|
@@ -58786,11 +58786,11 @@ var require_fast_path = __commonJS({
|
|
|
58786
58786
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58787
58787
|
var tslib_1 = require_tslib();
|
|
58788
58788
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
58789
|
-
var
|
|
58789
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
58790
58790
|
var util = tslib_1.__importStar(require_util2());
|
|
58791
|
-
var n =
|
|
58792
|
-
var isArray =
|
|
58793
|
-
var isNumber =
|
|
58791
|
+
var n = types18.namedTypes;
|
|
58792
|
+
var isArray = types18.builtInTypes.array;
|
|
58793
|
+
var isNumber = types18.builtInTypes.number;
|
|
58794
58794
|
var PRECEDENCE = {};
|
|
58795
58795
|
[
|
|
58796
58796
|
["??"],
|
|
@@ -58819,7 +58819,7 @@ var require_fast_path = __commonJS({
|
|
|
58819
58819
|
if (obj instanceof FastPath) {
|
|
58820
58820
|
return obj.copy();
|
|
58821
58821
|
}
|
|
58822
|
-
if (obj instanceof
|
|
58822
|
+
if (obj instanceof types18.NodePath) {
|
|
58823
58823
|
var copy = Object.create(FastPath.prototype);
|
|
58824
58824
|
var stack = [obj.value];
|
|
58825
58825
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -59130,7 +59130,7 @@ var require_fast_path = __commonJS({
|
|
|
59130
59130
|
return node.some(containsCallExpression);
|
|
59131
59131
|
}
|
|
59132
59132
|
if (n.Node.check(node)) {
|
|
59133
|
-
return
|
|
59133
|
+
return types18.someField(node, function(_name, child) {
|
|
59134
59134
|
return containsCallExpression(child);
|
|
59135
59135
|
});
|
|
59136
59136
|
}
|
|
@@ -59220,16 +59220,16 @@ var require_patcher = __commonJS({
|
|
|
59220
59220
|
var tslib_1 = require_tslib();
|
|
59221
59221
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
59222
59222
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
59223
|
-
var
|
|
59224
|
-
var Printable =
|
|
59225
|
-
var Expression =
|
|
59226
|
-
var ReturnStatement =
|
|
59227
|
-
var SourceLocation =
|
|
59223
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
59224
|
+
var Printable = types18.namedTypes.Printable;
|
|
59225
|
+
var Expression = types18.namedTypes.Expression;
|
|
59226
|
+
var ReturnStatement = types18.namedTypes.ReturnStatement;
|
|
59227
|
+
var SourceLocation = types18.namedTypes.SourceLocation;
|
|
59228
59228
|
var util_1 = require_util2();
|
|
59229
59229
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
59230
|
-
var isObject2 =
|
|
59231
|
-
var isArray =
|
|
59232
|
-
var isString =
|
|
59230
|
+
var isObject2 = types18.builtInTypes.object;
|
|
59231
|
+
var isArray = types18.builtInTypes.array;
|
|
59232
|
+
var isString = types18.builtInTypes.string;
|
|
59233
59233
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
59234
59234
|
var Patcher = function Patcher2(lines) {
|
|
59235
59235
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -59499,8 +59499,8 @@ var require_patcher = __commonJS({
|
|
|
59499
59499
|
if (k.charAt(0) === "_") {
|
|
59500
59500
|
continue;
|
|
59501
59501
|
}
|
|
59502
|
-
newPath.stack.push(k,
|
|
59503
|
-
oldPath.stack.push(k,
|
|
59502
|
+
newPath.stack.push(k, types18.getFieldValue(newNode, k));
|
|
59503
|
+
oldPath.stack.push(k, types18.getFieldValue(oldNode, k));
|
|
59504
59504
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
59505
59505
|
newPath.stack.length -= 2;
|
|
59506
59506
|
oldPath.stack.length -= 2;
|
|
@@ -59524,16 +59524,16 @@ var require_printer2 = __commonJS({
|
|
|
59524
59524
|
exports.Printer = void 0;
|
|
59525
59525
|
var tslib_1 = require_tslib();
|
|
59526
59526
|
var assert_1 = tslib_1.__importDefault(__require("assert"));
|
|
59527
|
-
var
|
|
59527
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
59528
59528
|
var comments_1 = require_comments();
|
|
59529
59529
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
59530
59530
|
var lines_1 = require_lines();
|
|
59531
59531
|
var options_1 = require_options();
|
|
59532
59532
|
var patcher_1 = require_patcher();
|
|
59533
59533
|
var util = tslib_1.__importStar(require_util2());
|
|
59534
|
-
var namedTypes =
|
|
59535
|
-
var isString =
|
|
59536
|
-
var isObject2 =
|
|
59534
|
+
var namedTypes = types18.namedTypes;
|
|
59535
|
+
var isString = types18.builtInTypes.string;
|
|
59536
|
+
var isObject2 = types18.builtInTypes.object;
|
|
59537
59537
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
59538
59538
|
assert_1.default.ok(this instanceof PrintResult2);
|
|
59539
59539
|
isString.assert(code);
|
|
@@ -59695,7 +59695,7 @@ var require_printer2 = __commonJS({
|
|
|
59695
59695
|
case "OptionalMemberExpression": {
|
|
59696
59696
|
parts.push(path2.call(print9, "object"));
|
|
59697
59697
|
var property = path2.call(print9, "property");
|
|
59698
|
-
var optional =
|
|
59698
|
+
var optional = types18.getFieldValue(n, "optional");
|
|
59699
59699
|
if (n.computed) {
|
|
59700
59700
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
59701
59701
|
} else {
|
|
@@ -59966,7 +59966,7 @@ var require_printer2 = __commonJS({
|
|
|
59966
59966
|
if (n.typeArguments) {
|
|
59967
59967
|
parts.push(path2.call(print9, "typeArguments"));
|
|
59968
59968
|
}
|
|
59969
|
-
if (
|
|
59969
|
+
if (types18.getFieldValue(n, "optional")) {
|
|
59970
59970
|
parts.push("?.");
|
|
59971
59971
|
}
|
|
59972
59972
|
parts.push(printArgumentsList(path2, options, print9));
|
|
@@ -61645,8 +61645,8 @@ var require_printer2 = __commonJS({
|
|
|
61645
61645
|
});
|
|
61646
61646
|
}
|
|
61647
61647
|
function getPossibleRaw(node) {
|
|
61648
|
-
var value =
|
|
61649
|
-
var extra =
|
|
61648
|
+
var value = types18.getFieldValue(node, "value");
|
|
61649
|
+
var extra = types18.getFieldValue(node, "extra");
|
|
61650
61650
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
61651
61651
|
return extra.raw;
|
|
61652
61652
|
}
|
|
@@ -61694,8 +61694,8 @@ var require_main2 = __commonJS({
|
|
|
61694
61694
|
exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
|
|
61695
61695
|
var tslib_1 = require_tslib();
|
|
61696
61696
|
var fs_1 = tslib_1.__importDefault(__require("fs"));
|
|
61697
|
-
var
|
|
61698
|
-
exports.types =
|
|
61697
|
+
var types18 = tslib_1.__importStar(require_main());
|
|
61698
|
+
exports.types = types18;
|
|
61699
61699
|
var parser_1 = require_parser2();
|
|
61700
61700
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
|
|
61701
61701
|
return parser_1.parse;
|
|
@@ -62994,7 +62994,7 @@ var printDocASTReducer = {
|
|
|
62994
62994
|
leave: ({ name, interfaces, directives, fields }) => join(["interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
62995
62995
|
},
|
|
62996
62996
|
UnionTypeDefinition: {
|
|
62997
|
-
leave: ({ name, directives, types:
|
|
62997
|
+
leave: ({ name, directives, types: types18 }) => join(["union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
62998
62998
|
},
|
|
62999
62999
|
EnumTypeDefinition: {
|
|
63000
63000
|
leave: ({ name, directives, values }) => join(["enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -63021,7 +63021,7 @@ var printDocASTReducer = {
|
|
|
63021
63021
|
leave: ({ name, interfaces, directives, fields }) => join(["extend interface", name, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
|
|
63022
63022
|
},
|
|
63023
63023
|
UnionTypeExtension: {
|
|
63024
|
-
leave: ({ name, directives, types:
|
|
63024
|
+
leave: ({ name, directives, types: types18 }) => join(["extend union", name, join(directives, " "), wrap("= ", join(types18, " | "))], " ")
|
|
63025
63025
|
},
|
|
63026
63026
|
EnumTypeExtension: {
|
|
63027
63027
|
leave: ({ name, directives, values }) => join(["extend enum", name, join(directives, " "), block(values)], " ")
|
|
@@ -63901,8 +63901,8 @@ function healTypes(originalTypeMap, directives) {
|
|
|
63901
63901
|
}
|
|
63902
63902
|
}
|
|
63903
63903
|
function healUnderlyingTypes(type) {
|
|
63904
|
-
const
|
|
63905
|
-
|
|
63904
|
+
const types18 = type.getTypes();
|
|
63905
|
+
types18.push(...types18.splice(0).map((t2) => healType(t2)).filter(Boolean));
|
|
63906
63906
|
}
|
|
63907
63907
|
function healType(type) {
|
|
63908
63908
|
if ((0, import_graphql11.isListType)(type)) {
|
|
@@ -64686,11 +64686,11 @@ function mergeEnum(e1, e2, config4) {
|
|
|
64686
64686
|
|
|
64687
64687
|
// ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.8.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
64688
64688
|
var import_graphql20 = __toESM(require_graphql2(), 1);
|
|
64689
|
-
function isStringTypes(
|
|
64690
|
-
return typeof
|
|
64689
|
+
function isStringTypes(types18) {
|
|
64690
|
+
return typeof types18 === "string";
|
|
64691
64691
|
}
|
|
64692
|
-
function isSourceTypes(
|
|
64693
|
-
return
|
|
64692
|
+
function isSourceTypes(types18) {
|
|
64693
|
+
return types18 instanceof import_graphql20.Source;
|
|
64694
64694
|
}
|
|
64695
64695
|
function extractType(type) {
|
|
64696
64696
|
let visitedType = type;
|
|
@@ -67060,6 +67060,9 @@ var GarbageCollector = class {
|
|
|
67060
67060
|
constructor(cache) {
|
|
67061
67061
|
this.cache = cache;
|
|
67062
67062
|
}
|
|
67063
|
+
reset() {
|
|
67064
|
+
this.lifetimes.clear();
|
|
67065
|
+
}
|
|
67063
67066
|
resetLifetime(id, field) {
|
|
67064
67067
|
if (!this.lifetimes.get(id)) {
|
|
67065
67068
|
this.lifetimes.set(id, /* @__PURE__ */ new Map());
|
|
@@ -67179,6 +67182,10 @@ var ListManager = class {
|
|
|
67179
67182
|
}
|
|
67180
67183
|
this.listsByField.get(parentID).delete(field);
|
|
67181
67184
|
}
|
|
67185
|
+
reset() {
|
|
67186
|
+
this.lists.clear();
|
|
67187
|
+
this.listsByField.clear();
|
|
67188
|
+
}
|
|
67182
67189
|
};
|
|
67183
67190
|
var List = class {
|
|
67184
67191
|
recordID;
|
|
@@ -67561,6 +67568,9 @@ var StaleManager = class {
|
|
|
67561
67568
|
}
|
|
67562
67569
|
}
|
|
67563
67570
|
}
|
|
67571
|
+
reset() {
|
|
67572
|
+
this.fieldsTime.clear();
|
|
67573
|
+
}
|
|
67564
67574
|
};
|
|
67565
67575
|
|
|
67566
67576
|
// src/runtime/cache/storage.ts
|
|
@@ -67741,6 +67751,9 @@ var InMemoryStorage = class {
|
|
|
67741
67751
|
layer.fields = fields;
|
|
67742
67752
|
layer.links = links;
|
|
67743
67753
|
}
|
|
67754
|
+
reset() {
|
|
67755
|
+
this.data = [];
|
|
67756
|
+
}
|
|
67744
67757
|
};
|
|
67745
67758
|
var Layer = class {
|
|
67746
67759
|
id;
|
|
@@ -68186,6 +68199,18 @@ var InMemorySubscriptions = class {
|
|
|
68186
68199
|
this.remove(linkedRecordID, linkFields, targets, visited);
|
|
68187
68200
|
}
|
|
68188
68201
|
}
|
|
68202
|
+
reset() {
|
|
68203
|
+
const subscribers = Object.entries(this.subscribers).filter(
|
|
68204
|
+
([id]) => !id.startsWith(rootID)
|
|
68205
|
+
);
|
|
68206
|
+
for (const [id, _fields] of subscribers) {
|
|
68207
|
+
delete this.subscribers[id];
|
|
68208
|
+
}
|
|
68209
|
+
const subscriptionSpecs = subscribers.flatMap(
|
|
68210
|
+
([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
|
|
68211
|
+
);
|
|
68212
|
+
return subscriptionSpecs;
|
|
68213
|
+
}
|
|
68189
68214
|
removeSubscribers(id, fieldName, specs) {
|
|
68190
68215
|
let targets = [];
|
|
68191
68216
|
for (const spec of specs) {
|
|
@@ -68375,6 +68400,14 @@ var Cache = class {
|
|
|
68375
68400
|
}
|
|
68376
68401
|
this.#notifySubscribers(toNotify);
|
|
68377
68402
|
}
|
|
68403
|
+
reset() {
|
|
68404
|
+
const subSpecs = this._internal_unstable.subscriptions.reset();
|
|
68405
|
+
this._internal_unstable.staleManager.reset();
|
|
68406
|
+
this._internal_unstable.lifetimes.reset();
|
|
68407
|
+
this._internal_unstable.lists.reset();
|
|
68408
|
+
this._internal_unstable.storage.reset();
|
|
68409
|
+
this.#notifySubscribers(subSpecs);
|
|
68410
|
+
}
|
|
68378
68411
|
#notifySubscribers(subs) {
|
|
68379
68412
|
if (subs.length === 0) {
|
|
68380
68413
|
return;
|
|
@@ -68524,12 +68557,9 @@ var CacheInternal = class {
|
|
|
68524
68557
|
);
|
|
68525
68558
|
}
|
|
68526
68559
|
}
|
|
68527
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
68528
|
-
(field2) => typeof value[field2] === "undefined"
|
|
68529
|
-
).length > 0;
|
|
68530
68560
|
let linkedID = null;
|
|
68531
68561
|
if (value !== null) {
|
|
68532
|
-
linkedID = !
|
|
68562
|
+
linkedID = !this.isEmbedded(linkedType, value) ? this.id(linkedType, value) : `${parent2}.${key}`;
|
|
68533
68563
|
}
|
|
68534
68564
|
let linkChange = linkedID !== previousValue;
|
|
68535
68565
|
layer.writeLink(parent2, key, linkedID);
|
|
@@ -68557,7 +68587,7 @@ var CacheInternal = class {
|
|
|
68557
68587
|
forceNotify
|
|
68558
68588
|
});
|
|
68559
68589
|
}
|
|
68560
|
-
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
|
|
68590
|
+
} else if (Array.isArray(value) && (typeof previousValue === "undefined" || previousValue === null || Array.isArray(previousValue))) {
|
|
68561
68591
|
let oldIDs = [...previousValue || []];
|
|
68562
68592
|
const emptyEdges = !updates ? [] : oldIDs.map((id) => {
|
|
68563
68593
|
if (!id) {
|
|
@@ -68630,7 +68660,7 @@ var CacheInternal = class {
|
|
|
68630
68660
|
} else {
|
|
68631
68661
|
linkedIDs = nestedIDs;
|
|
68632
68662
|
}
|
|
68633
|
-
const contentChanged = !deepEquals(linkedIDs, oldIDs);
|
|
68663
|
+
const contentChanged = !deepEquals(linkedIDs, oldIDs) || previousValue === null;
|
|
68634
68664
|
if (contentChanged || forceNotify) {
|
|
68635
68665
|
toNotify.push(...currentSubscribers);
|
|
68636
68666
|
}
|
|
@@ -68901,6 +68931,10 @@ var CacheInternal = class {
|
|
|
68901
68931
|
computeID(type, data) {
|
|
68902
68932
|
return computeID(this.config, type, data);
|
|
68903
68933
|
}
|
|
68934
|
+
isEmbedded(linkedType, value) {
|
|
68935
|
+
const idFields = this.idFields(linkedType);
|
|
68936
|
+
return idFields.length === 0 || idFields.filter((field) => typeof value[field] === "undefined").length > 0;
|
|
68937
|
+
}
|
|
68904
68938
|
hydrateNestedList({
|
|
68905
68939
|
fields,
|
|
68906
68940
|
variables,
|
|
@@ -69008,9 +69042,6 @@ var CacheInternal = class {
|
|
|
69008
69042
|
}
|
|
69009
69043
|
const entryObj = entry;
|
|
69010
69044
|
let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
|
|
69011
|
-
const embedded = this.idFields(linkedType)?.filter(
|
|
69012
|
-
(field) => typeof entry[field] === "undefined"
|
|
69013
|
-
).length > 0;
|
|
69014
69045
|
let innerType = linkedType;
|
|
69015
69046
|
const typename = entryObj.__typename;
|
|
69016
69047
|
if (typename) {
|
|
@@ -69018,7 +69049,7 @@ var CacheInternal = class {
|
|
|
69018
69049
|
} else if (abstract) {
|
|
69019
69050
|
throw new Error("Encountered interface type without __typename in the payload");
|
|
69020
69051
|
}
|
|
69021
|
-
if (!
|
|
69052
|
+
if (!this.isEmbedded(linkedType, entry)) {
|
|
69022
69053
|
const id = this.id(innerType, entry);
|
|
69023
69054
|
if (id) {
|
|
69024
69055
|
linkedID = id;
|
|
@@ -69349,7 +69380,7 @@ var Config = class {
|
|
|
69349
69380
|
defaultListTarget = null,
|
|
69350
69381
|
defaultPaginateMode = PaginateMode.Infinite,
|
|
69351
69382
|
defaultKeys,
|
|
69352
|
-
types:
|
|
69383
|
+
types: types18 = {},
|
|
69353
69384
|
logLevel,
|
|
69354
69385
|
defaultFragmentMasking = "enable",
|
|
69355
69386
|
watchSchema,
|
|
@@ -69393,10 +69424,10 @@ var Config = class {
|
|
|
69393
69424
|
if (defaultKeys) {
|
|
69394
69425
|
this.defaultKeys = defaultKeys;
|
|
69395
69426
|
}
|
|
69396
|
-
if (
|
|
69427
|
+
if (types18) {
|
|
69397
69428
|
this.typeConfig = {
|
|
69398
69429
|
...this.typeConfig,
|
|
69399
|
-
...
|
|
69430
|
+
...types18
|
|
69400
69431
|
};
|
|
69401
69432
|
}
|
|
69402
69433
|
}
|
|
@@ -70537,7 +70568,7 @@ async function find_graphql(config4, parsedScript, walker) {
|
|
|
70537
70568
|
|
|
70538
70569
|
// src/codegen/generators/artifacts/index.ts
|
|
70539
70570
|
var graphql14 = __toESM(require_graphql2(), 1);
|
|
70540
|
-
var
|
|
70571
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
70541
70572
|
|
|
70542
70573
|
// src/codegen/utils/commonjs.ts
|
|
70543
70574
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -71724,7 +71755,6 @@ function ancestorKey(ancestors) {
|
|
|
71724
71755
|
|
|
71725
71756
|
// src/codegen/generators/artifacts/selection.ts
|
|
71726
71757
|
var graphql13 = __toESM(require_graphql2(), 1);
|
|
71727
|
-
var recast5 = __toESM(require_main2(), 1);
|
|
71728
71758
|
|
|
71729
71759
|
// ../../node_modules/.pnpm/@kitql+helper@0.5.0/node_modules/@kitql/helper/index.mjs
|
|
71730
71760
|
var config2 = {
|
|
@@ -72677,15 +72707,12 @@ function fieldKey(config4, field) {
|
|
|
72677
72707
|
}
|
|
72678
72708
|
|
|
72679
72709
|
// src/codegen/generators/artifacts/selection.ts
|
|
72680
|
-
var AST5 = recast5.types.builders;
|
|
72681
72710
|
function selection_default(args) {
|
|
72682
|
-
const typeMap = {};
|
|
72683
|
-
const abstractTypes = [];
|
|
72684
72711
|
return mergeSelection({
|
|
72685
|
-
|
|
72686
|
-
|
|
72687
|
-
|
|
72688
|
-
|
|
72712
|
+
config: args.config,
|
|
72713
|
+
rootType: args.rootType,
|
|
72714
|
+
object: prepareSelection(args),
|
|
72715
|
+
filepath: args.filepath
|
|
72689
72716
|
});
|
|
72690
72717
|
}
|
|
72691
72718
|
function prepareSelection({
|
|
@@ -72697,8 +72724,6 @@ function prepareSelection({
|
|
|
72697
72724
|
path: path2 = [],
|
|
72698
72725
|
document,
|
|
72699
72726
|
inConnection,
|
|
72700
|
-
typeMap,
|
|
72701
|
-
abstractTypes,
|
|
72702
72727
|
globalLoading,
|
|
72703
72728
|
includeFragments
|
|
72704
72729
|
}) {
|
|
@@ -72718,8 +72743,6 @@ function prepareSelection({
|
|
|
72718
72743
|
selections: field.selectionSet.selections,
|
|
72719
72744
|
path: path2,
|
|
72720
72745
|
document,
|
|
72721
|
-
typeMap,
|
|
72722
|
-
abstractTypes,
|
|
72723
72746
|
globalLoading,
|
|
72724
72747
|
includeFragments
|
|
72725
72748
|
}).fields || {}
|
|
@@ -72731,32 +72754,7 @@ function prepareSelection({
|
|
|
72731
72754
|
typeMap: {}
|
|
72732
72755
|
};
|
|
72733
72756
|
}
|
|
72734
|
-
const parentType = config4.schema.getType(rootType);
|
|
72735
72757
|
const typeConditionName = field.typeCondition.name.value;
|
|
72736
|
-
const typeCondition = config4.schema.getType(typeConditionName);
|
|
72737
|
-
const possibleTypes = [];
|
|
72738
|
-
if (!graphql13.isAbstractType(typeCondition)) {
|
|
72739
|
-
} else if (graphql13.isAbstractType(parentType)) {
|
|
72740
|
-
const possibleParentTypes = config4.schema.getPossibleTypes(parentType).map((type) => type.name);
|
|
72741
|
-
for (const possible of config4.schema.getPossibleTypes(typeCondition)) {
|
|
72742
|
-
if (possibleParentTypes.includes(possible.name)) {
|
|
72743
|
-
possibleTypes.push(possible.name);
|
|
72744
|
-
}
|
|
72745
|
-
}
|
|
72746
|
-
} else {
|
|
72747
|
-
possibleTypes.push(rootType);
|
|
72748
|
-
}
|
|
72749
|
-
if (possibleTypes.length > 0) {
|
|
72750
|
-
for (const type of possibleTypes) {
|
|
72751
|
-
const existing = typeMap[type];
|
|
72752
|
-
if (!existing || !existing.includes(type)) {
|
|
72753
|
-
typeMap[type] = [typeConditionName].concat(existing || []);
|
|
72754
|
-
}
|
|
72755
|
-
if (!abstractTypes.includes(typeConditionName)) {
|
|
72756
|
-
abstractTypes.push(typeConditionName);
|
|
72757
|
-
}
|
|
72758
|
-
}
|
|
72759
|
-
}
|
|
72760
72758
|
object.abstractFields.fields = {
|
|
72761
72759
|
...object.abstractFields.fields,
|
|
72762
72760
|
[typeConditionName]: prepareSelection({
|
|
@@ -72767,8 +72765,6 @@ function prepareSelection({
|
|
|
72767
72765
|
selections: field.selectionSet.selections,
|
|
72768
72766
|
path: path2,
|
|
72769
72767
|
document,
|
|
72770
|
-
typeMap,
|
|
72771
|
-
abstractTypes,
|
|
72772
72768
|
globalLoading,
|
|
72773
72769
|
includeFragments
|
|
72774
72770
|
}).fields
|
|
@@ -72780,19 +72776,38 @@ function prepareSelection({
|
|
|
72780
72776
|
} else if (field.kind === "Field") {
|
|
72781
72777
|
const type = config4.schema.getType(rootType);
|
|
72782
72778
|
if (!type) {
|
|
72783
|
-
throw new HoudiniError({
|
|
72779
|
+
throw new HoudiniError({
|
|
72780
|
+
filepath,
|
|
72781
|
+
message: "Could not find type. Looking for " + JSON.stringify(rootType)
|
|
72782
|
+
});
|
|
72784
72783
|
}
|
|
72785
72784
|
const attributeName = field.alias?.value || field.name.value;
|
|
72786
|
-
let fieldType;
|
|
72785
|
+
let fieldType = null;
|
|
72787
72786
|
let nullable = false;
|
|
72788
72787
|
if (field.name.value === "__typename") {
|
|
72789
72788
|
fieldType = config4.schema.getType("String");
|
|
72790
|
-
} else {
|
|
72789
|
+
} else if ("getFields" in type) {
|
|
72791
72790
|
let typeRef = type.getFields()[field.name.value].type;
|
|
72792
72791
|
fieldType = getRootType(typeRef);
|
|
72793
72792
|
nullable = !graphql13.isNonNullType(typeRef);
|
|
72793
|
+
} else if (graphql13.isAbstractType(type)) {
|
|
72794
|
+
for (const possible of config4.schema.getPossibleTypes(type)) {
|
|
72795
|
+
if (graphql13.isObjectType(possible)) {
|
|
72796
|
+
if (possible.getFields()[field.name.value]) {
|
|
72797
|
+
fieldType = possible.getFields()[field.name.value].type;
|
|
72798
|
+
nullable = !graphql13.isNonNullType(fieldType);
|
|
72799
|
+
break;
|
|
72800
|
+
}
|
|
72801
|
+
}
|
|
72802
|
+
}
|
|
72794
72803
|
}
|
|
72795
|
-
|
|
72804
|
+
if (!fieldType) {
|
|
72805
|
+
throw {
|
|
72806
|
+
message: "Could not identify field's type",
|
|
72807
|
+
description: `Missing definition for ${field.name.value} in ${type.name}`
|
|
72808
|
+
};
|
|
72809
|
+
}
|
|
72810
|
+
const typeName = getRootType(fieldType).name;
|
|
72796
72811
|
const pathSoFar = path2.concat(attributeName);
|
|
72797
72812
|
const keys2 = config4.keyFieldsForType(rootType);
|
|
72798
72813
|
let fieldObj = {
|
|
@@ -72886,8 +72901,6 @@ function prepareSelection({
|
|
|
72886
72901
|
path: pathSoFar,
|
|
72887
72902
|
document,
|
|
72888
72903
|
inConnection: connectionState,
|
|
72889
|
-
typeMap,
|
|
72890
|
-
abstractTypes,
|
|
72891
72904
|
globalLoading: forceLoading,
|
|
72892
72905
|
includeFragments
|
|
72893
72906
|
});
|
|
@@ -72973,69 +72986,107 @@ function prepareSelection({
|
|
|
72973
72986
|
return object;
|
|
72974
72987
|
}
|
|
72975
72988
|
function mergeSelection({
|
|
72989
|
+
config: config4,
|
|
72976
72990
|
filepath,
|
|
72977
72991
|
object,
|
|
72978
|
-
|
|
72979
|
-
abstractTypes
|
|
72992
|
+
rootType
|
|
72980
72993
|
}) {
|
|
72981
72994
|
if (Object.keys(object.fields || {}).length > 0 && object.abstractFields && Object.keys(object.abstractFields.fields).length > 0) {
|
|
72982
|
-
|
|
72983
|
-
|
|
72995
|
+
const abstractSelection = {
|
|
72996
|
+
fields: {},
|
|
72997
|
+
typeMap: {}
|
|
72998
|
+
};
|
|
72999
|
+
const possibleSelectionTypes = {};
|
|
73000
|
+
for (const [typeName, typeSelection] of Object.entries(object.abstractFields.fields)) {
|
|
73001
|
+
const gqlType = config4.schema.getType(typeName);
|
|
73002
|
+
abstractSelection.fields[typeName] = deepMerge2(
|
|
73003
|
+
filepath,
|
|
73004
|
+
typeSelection,
|
|
73005
|
+
abstractSelection.fields[typeName] ?? {}
|
|
73006
|
+
);
|
|
73007
|
+
if (graphql13.isAbstractType(gqlType)) {
|
|
73008
|
+
for (const possible of config4.schema.getPossibleTypes(gqlType)) {
|
|
73009
|
+
if (!possibleSelectionTypes[typeName]) {
|
|
73010
|
+
possibleSelectionTypes[typeName] = [];
|
|
73011
|
+
}
|
|
73012
|
+
possibleSelectionTypes[typeName].push(possible.name);
|
|
73013
|
+
}
|
|
73014
|
+
}
|
|
73015
|
+
}
|
|
73016
|
+
const concreteSelectionImplements = {};
|
|
73017
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
72984
73018
|
for (const possible of possibles) {
|
|
72985
|
-
if (
|
|
72986
|
-
|
|
73019
|
+
if (!concreteSelectionImplements[possible]) {
|
|
73020
|
+
concreteSelectionImplements[possible] = [];
|
|
73021
|
+
}
|
|
73022
|
+
concreteSelectionImplements[possible].push(typeName);
|
|
73023
|
+
}
|
|
73024
|
+
}
|
|
73025
|
+
for (const [concrete, implementations] of Object.entries(concreteSelectionImplements)) {
|
|
73026
|
+
if (implementations.length > 1) {
|
|
73027
|
+
abstractSelection.fields[concrete] = {};
|
|
73028
|
+
}
|
|
73029
|
+
}
|
|
73030
|
+
for (const [typeName, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
73031
|
+
for (const possible of possibles) {
|
|
73032
|
+
if (abstractSelection.fields[possible]) {
|
|
73033
|
+
abstractSelection.fields[possible] = deepMerge2(
|
|
72987
73034
|
filepath,
|
|
72988
|
-
|
|
72989
|
-
|
|
73035
|
+
abstractSelection.fields[typeName] ?? {},
|
|
73036
|
+
abstractSelection.fields[possible] ?? {}
|
|
72990
73037
|
);
|
|
72991
|
-
overlap = true;
|
|
72992
73038
|
}
|
|
72993
73039
|
}
|
|
72994
|
-
if (overlap) {
|
|
72995
|
-
delete typeMap[typeName];
|
|
72996
|
-
}
|
|
72997
73040
|
}
|
|
72998
|
-
|
|
72999
|
-
|
|
73000
|
-
|
|
73001
|
-
|
|
73002
|
-
|
|
73003
|
-
);
|
|
73004
|
-
delete typeMap[type];
|
|
73041
|
+
const parentType = config4.schema.getType(rootType);
|
|
73042
|
+
const possibleParents = graphql13.isAbstractType(parentType) ? config4.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
|
|
73043
|
+
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
73044
|
+
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
73045
|
+
delete abstractSelection.typeMap[key];
|
|
73005
73046
|
}
|
|
73006
73047
|
}
|
|
73007
|
-
for (const [type, sel] of Object.entries(
|
|
73008
|
-
|
|
73048
|
+
for (const [type, sel] of Object.entries(abstractSelection.fields || {})) {
|
|
73049
|
+
abstractSelection.fields[type] = deepMerge2(filepath, sel || {}, object.fields);
|
|
73009
73050
|
}
|
|
73010
|
-
for (const [
|
|
73011
|
-
|
|
73051
|
+
for (const [typename, possibles] of Object.entries(possibleSelectionTypes)) {
|
|
73052
|
+
if (possibles.every((p) => abstractSelection.fields[p])) {
|
|
73053
|
+
delete abstractSelection.fields[typename];
|
|
73054
|
+
}
|
|
73012
73055
|
}
|
|
73013
|
-
const
|
|
73014
|
-
|
|
73015
|
-
|
|
73016
|
-
|
|
73056
|
+
for (const possible of possibleParents) {
|
|
73057
|
+
if (abstractSelection.fields[possible]) {
|
|
73058
|
+
continue;
|
|
73059
|
+
}
|
|
73060
|
+
for (const [abstractType, abstractTypeMembers] of Object.entries(
|
|
73061
|
+
possibleSelectionTypes
|
|
73062
|
+
)) {
|
|
73063
|
+
if (abstractTypeMembers.includes(possible)) {
|
|
73064
|
+
abstractSelection.typeMap[possible] = abstractType;
|
|
73065
|
+
break;
|
|
73066
|
+
}
|
|
73017
73067
|
}
|
|
73018
73068
|
}
|
|
73069
|
+
object.abstractFields = abstractSelection;
|
|
73019
73070
|
}
|
|
73020
|
-
for (const
|
|
73071
|
+
for (const value of Object.values(object.fields ?? {})) {
|
|
73021
73072
|
const selection = value.selection;
|
|
73022
73073
|
if (selection) {
|
|
73023
73074
|
mergeSelection({
|
|
73075
|
+
config: config4,
|
|
73076
|
+
rootType: value.type,
|
|
73024
73077
|
filepath,
|
|
73025
|
-
typeMap,
|
|
73026
|
-
abstractTypes,
|
|
73027
73078
|
object: selection
|
|
73028
73079
|
});
|
|
73029
73080
|
}
|
|
73030
73081
|
}
|
|
73031
73082
|
for (const [type, selection] of Object.entries(object.abstractFields?.fields ?? {})) {
|
|
73032
|
-
for (const
|
|
73083
|
+
for (const value of Object.values(selection ?? {})) {
|
|
73033
73084
|
const selection2 = value.selection;
|
|
73034
73085
|
if (selection2) {
|
|
73035
73086
|
mergeSelection({
|
|
73087
|
+
config: config4,
|
|
73088
|
+
rootType: value.type,
|
|
73036
73089
|
filepath,
|
|
73037
|
-
typeMap,
|
|
73038
|
-
abstractTypes,
|
|
73039
73090
|
object: selection2
|
|
73040
73091
|
});
|
|
73041
73092
|
}
|
|
@@ -73045,7 +73096,7 @@ function mergeSelection({
|
|
|
73045
73096
|
}
|
|
73046
73097
|
|
|
73047
73098
|
// src/codegen/generators/artifacts/index.ts
|
|
73048
|
-
var
|
|
73099
|
+
var AST5 = recast5.types.builders;
|
|
73049
73100
|
function artifactGenerator(stats) {
|
|
73050
73101
|
return async function(config4, docs) {
|
|
73051
73102
|
const filterTypes = {};
|
|
@@ -73313,10 +73364,10 @@ function artifactGenerator(stats) {
|
|
|
73313
73364
|
}
|
|
73314
73365
|
plugin2.artifactEnd({ config: config4, document: doc });
|
|
73315
73366
|
}
|
|
73316
|
-
const file =
|
|
73367
|
+
const file = AST5.program([
|
|
73317
73368
|
moduleExport(config4, "default", serializeValue(artifact)),
|
|
73318
|
-
|
|
73319
|
-
|
|
73369
|
+
AST5.expressionStatement(
|
|
73370
|
+
AST5.stringLiteral(`HoudiniHash=${hash({ config: config4, document: doc })}`)
|
|
73320
73371
|
)
|
|
73321
73372
|
]);
|
|
73322
73373
|
const artifactPath = config4.artifactPath(document);
|
|
@@ -73396,8 +73447,8 @@ function applyMask(config4, target, mask) {
|
|
|
73396
73447
|
}
|
|
73397
73448
|
|
|
73398
73449
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
73399
|
-
var
|
|
73400
|
-
var
|
|
73450
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
73451
|
+
var AST6 = recast6.types.builders;
|
|
73401
73452
|
async function generateGraphqlReturnTypes(config4, docs) {
|
|
73402
73453
|
const indexPath = path_exports.join(config4.runtimeDirectory, "index.d.ts");
|
|
73403
73454
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -73432,18 +73483,18 @@ async function generateGraphqlReturnTypes(config4, docs) {
|
|
|
73432
73483
|
continue;
|
|
73433
73484
|
}
|
|
73434
73485
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
73435
|
-
const input =
|
|
73436
|
-
input.typeAnnotation =
|
|
73437
|
-
|
|
73486
|
+
const input = AST6.identifier("str");
|
|
73487
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
73488
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
73438
73489
|
);
|
|
73439
73490
|
script.body.splice(
|
|
73440
73491
|
i2,
|
|
73441
73492
|
0,
|
|
73442
|
-
|
|
73443
|
-
|
|
73444
|
-
|
|
73493
|
+
AST6.exportNamedDeclaration(
|
|
73494
|
+
AST6.tsDeclareFunction(
|
|
73495
|
+
AST6.identifier("graphql"),
|
|
73445
73496
|
[input],
|
|
73446
|
-
|
|
73497
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
73447
73498
|
)
|
|
73448
73499
|
)
|
|
73449
73500
|
);
|
|
@@ -73606,20 +73657,20 @@ async function generatePluginRuntime({
|
|
|
73606
73657
|
}
|
|
73607
73658
|
|
|
73608
73659
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
73609
|
-
var
|
|
73660
|
+
var recast12 = __toESM(require_main2(), 1);
|
|
73610
73661
|
|
|
73611
73662
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73612
73663
|
var graphql17 = __toESM(require_graphql2(), 1);
|
|
73613
|
-
var
|
|
73664
|
+
var recast9 = __toESM(require_main2(), 1);
|
|
73614
73665
|
|
|
73615
73666
|
// src/codegen/generators/typescript/typeReference.ts
|
|
73616
73667
|
var graphql16 = __toESM(require_graphql2(), 1);
|
|
73617
|
-
var
|
|
73668
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
73618
73669
|
|
|
73619
73670
|
// src/codegen/generators/typescript/types.ts
|
|
73620
73671
|
var graphql15 = __toESM(require_graphql2(), 1);
|
|
73621
|
-
var
|
|
73622
|
-
var
|
|
73672
|
+
var recast7 = __toESM(require_main2(), 1);
|
|
73673
|
+
var AST7 = recast7.types.builders;
|
|
73623
73674
|
function readonlyProperty(prop, enable = true) {
|
|
73624
73675
|
if (enable) {
|
|
73625
73676
|
prop.readonly = true;
|
|
@@ -73627,28 +73678,28 @@ function readonlyProperty(prop, enable = true) {
|
|
|
73627
73678
|
return prop;
|
|
73628
73679
|
}
|
|
73629
73680
|
function nullableField(inner, input = false) {
|
|
73630
|
-
const members = [inner,
|
|
73681
|
+
const members = [inner, AST7.tsNullKeyword()];
|
|
73631
73682
|
if (input) {
|
|
73632
|
-
members.push(
|
|
73683
|
+
members.push(AST7.tsUndefinedKeyword());
|
|
73633
73684
|
}
|
|
73634
|
-
return
|
|
73685
|
+
return AST7.tsUnionType(members);
|
|
73635
73686
|
}
|
|
73636
73687
|
function scalarPropertyValue(config4, missingScalars, target) {
|
|
73637
73688
|
switch (target.name) {
|
|
73638
73689
|
case "String": {
|
|
73639
|
-
return
|
|
73690
|
+
return AST7.tsStringKeyword();
|
|
73640
73691
|
}
|
|
73641
73692
|
case "Int": {
|
|
73642
|
-
return
|
|
73693
|
+
return AST7.tsNumberKeyword();
|
|
73643
73694
|
}
|
|
73644
73695
|
case "Float": {
|
|
73645
|
-
return
|
|
73696
|
+
return AST7.tsNumberKeyword();
|
|
73646
73697
|
}
|
|
73647
73698
|
case "Boolean": {
|
|
73648
|
-
return
|
|
73699
|
+
return AST7.tsBooleanKeyword();
|
|
73649
73700
|
}
|
|
73650
73701
|
case "ID": {
|
|
73651
|
-
return
|
|
73702
|
+
return AST7.tsStringKeyword();
|
|
73652
73703
|
}
|
|
73653
73704
|
default: {
|
|
73654
73705
|
if (graphql15.isNonNullType(target) && "ofType" in target) {
|
|
@@ -73659,16 +73710,16 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
73659
73710
|
);
|
|
73660
73711
|
}
|
|
73661
73712
|
if (config4.scalars?.[target.name]) {
|
|
73662
|
-
return
|
|
73713
|
+
return AST7.tsTypeReference(AST7.identifier(config4.scalars?.[target.name].type));
|
|
73663
73714
|
}
|
|
73664
73715
|
missingScalars.add(target.name);
|
|
73665
|
-
return
|
|
73716
|
+
return AST7.tsAnyKeyword();
|
|
73666
73717
|
}
|
|
73667
73718
|
}
|
|
73668
73719
|
}
|
|
73669
73720
|
|
|
73670
73721
|
// src/codegen/generators/typescript/typeReference.ts
|
|
73671
|
-
var
|
|
73722
|
+
var AST8 = recast8.types.builders;
|
|
73672
73723
|
function tsTypeReference(config4, missingScalars, definition, body) {
|
|
73673
73724
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
73674
73725
|
let result;
|
|
@@ -73677,7 +73728,7 @@ function tsTypeReference(config4, missingScalars, definition, body) {
|
|
|
73677
73728
|
} else if (graphql16.isEnumType(type)) {
|
|
73678
73729
|
result = enumReference(config4, body, type.name);
|
|
73679
73730
|
} else {
|
|
73680
|
-
result =
|
|
73731
|
+
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
73681
73732
|
}
|
|
73682
73733
|
for (const toWrap of wrappers) {
|
|
73683
73734
|
if (toWrap === "NonNull" /* NonNull */) {
|
|
@@ -73685,7 +73736,7 @@ function tsTypeReference(config4, missingScalars, definition, body) {
|
|
|
73685
73736
|
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
73686
73737
|
result = nullableField(result, true);
|
|
73687
73738
|
} else if (toWrap === "List" /* List */) {
|
|
73688
|
-
result =
|
|
73739
|
+
result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
|
|
73689
73740
|
}
|
|
73690
73741
|
}
|
|
73691
73742
|
return result;
|
|
@@ -73698,14 +73749,14 @@ function enumReference(config4, body, name) {
|
|
|
73698
73749
|
importKind: "type",
|
|
73699
73750
|
sourceModule: "$houdini/runtime/lib/types"
|
|
73700
73751
|
});
|
|
73701
|
-
return
|
|
73702
|
-
|
|
73703
|
-
|
|
73752
|
+
return AST8.tsTypeReference(
|
|
73753
|
+
AST8.identifier("ValueOf"),
|
|
73754
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
73704
73755
|
);
|
|
73705
73756
|
}
|
|
73706
73757
|
|
|
73707
73758
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73708
|
-
var
|
|
73759
|
+
var AST9 = recast9.types.builders;
|
|
73709
73760
|
function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
73710
73761
|
const { type } = unwrapType(config4, rootType);
|
|
73711
73762
|
if (graphql17.isScalarType(type)) {
|
|
@@ -73732,20 +73783,20 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
73732
73783
|
for (const field of Object.values(type.getFields())) {
|
|
73733
73784
|
addReferencedInputTypes(config4, filepath, body, visitedTypes, missingScalars, field.type);
|
|
73734
73785
|
members.push(
|
|
73735
|
-
|
|
73736
|
-
|
|
73737
|
-
|
|
73786
|
+
AST9.tsPropertySignature(
|
|
73787
|
+
AST9.identifier(field.name),
|
|
73788
|
+
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field, body)),
|
|
73738
73789
|
graphql17.isNullableType(field.type)
|
|
73739
73790
|
)
|
|
73740
73791
|
);
|
|
73741
73792
|
}
|
|
73742
|
-
body.push(
|
|
73793
|
+
body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
|
|
73743
73794
|
}
|
|
73744
73795
|
|
|
73745
73796
|
// src/codegen/generators/typescript/inlineType.ts
|
|
73746
73797
|
var graphql18 = __toESM(require_graphql2(), 1);
|
|
73747
|
-
var
|
|
73748
|
-
var
|
|
73798
|
+
var recast10 = __toESM(require_main2(), 1);
|
|
73799
|
+
var AST10 = recast10.types.builders;
|
|
73749
73800
|
var fragmentKey2 = " $fragments";
|
|
73750
73801
|
function inlineType({
|
|
73751
73802
|
config: config4,
|
|
@@ -73843,7 +73894,7 @@ function inlineType({
|
|
|
73843
73894
|
{}
|
|
73844
73895
|
)
|
|
73845
73896
|
);
|
|
73846
|
-
result =
|
|
73897
|
+
result = AST10.tsTypeLiteral([
|
|
73847
73898
|
...fields.map((selection) => {
|
|
73848
73899
|
const { field } = selectionTypeInfo(config4.schema, filepath, rootObj, selection);
|
|
73849
73900
|
const attributeName = selection.alias?.value || selection.name.value;
|
|
@@ -73871,12 +73922,12 @@ function inlineType({
|
|
|
73871
73922
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
73872
73923
|
).length > 0;
|
|
73873
73924
|
if (hasIncludeOrSkipDirective) {
|
|
73874
|
-
attributeType =
|
|
73925
|
+
attributeType = AST10.tsUnionType([attributeType, AST10.tsUndefinedKeyword()]);
|
|
73875
73926
|
}
|
|
73876
73927
|
const prop = readonlyProperty(
|
|
73877
|
-
|
|
73878
|
-
|
|
73879
|
-
|
|
73928
|
+
AST10.tsPropertySignature(
|
|
73929
|
+
AST10.identifier(attributeName),
|
|
73930
|
+
AST10.tsTypeAnnotation(attributeType)
|
|
73880
73931
|
),
|
|
73881
73932
|
allowReadonly
|
|
73882
73933
|
);
|
|
@@ -73890,14 +73941,14 @@ function inlineType({
|
|
|
73890
73941
|
if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
|
|
73891
73942
|
result.members.push(
|
|
73892
73943
|
readonlyProperty(
|
|
73893
|
-
|
|
73894
|
-
|
|
73895
|
-
|
|
73896
|
-
|
|
73944
|
+
AST10.tsPropertySignature(
|
|
73945
|
+
AST10.stringLiteral(fragmentKey2),
|
|
73946
|
+
AST10.tsTypeAnnotation(
|
|
73947
|
+
AST10.tsTypeLiteral(
|
|
73897
73948
|
(fragmentSpreads || []).map(
|
|
73898
|
-
(fragmentSpread) =>
|
|
73899
|
-
|
|
73900
|
-
|
|
73949
|
+
(fragmentSpread) => AST10.tsPropertySignature(
|
|
73950
|
+
AST10.identifier(fragmentSpread.name.value),
|
|
73951
|
+
AST10.tsTypeAnnotation(AST10.tsTypeLiteral([]))
|
|
73901
73952
|
)
|
|
73902
73953
|
)
|
|
73903
73954
|
)
|
|
@@ -73942,9 +73993,9 @@ function inlineType({
|
|
|
73942
73993
|
}
|
|
73943
73994
|
objectType.members.push(
|
|
73944
73995
|
readonlyProperty(
|
|
73945
|
-
|
|
73946
|
-
|
|
73947
|
-
|
|
73996
|
+
AST10.tsPropertySignature(
|
|
73997
|
+
AST10.identifier("__typename"),
|
|
73998
|
+
AST10.tsTypeAnnotation(AST10.tsLiteralType(AST10.stringLiteral(typeName)))
|
|
73948
73999
|
),
|
|
73949
74000
|
allowReadonly
|
|
73950
74001
|
)
|
|
@@ -73984,8 +74035,8 @@ function inlineType({
|
|
|
73984
74035
|
if (Object.keys(inlineFragmentSelections).length > 0) {
|
|
73985
74036
|
let selectionTypes = Object.entries(inlineFragmentSelections).map(
|
|
73986
74037
|
([typeName, { type: type2, tsType }]) => {
|
|
73987
|
-
return
|
|
73988
|
-
|
|
74038
|
+
return AST10.tsParenthesizedType(
|
|
74039
|
+
AST10.tsIntersectionType(
|
|
73989
74040
|
[tsType].flatMap((type3) => {
|
|
73990
74041
|
if (type3.type === "TSUnionType") {
|
|
73991
74042
|
return type3.types.filter(
|
|
@@ -74011,14 +74062,14 @@ function inlineType({
|
|
|
74011
74062
|
);
|
|
74012
74063
|
if (!areAllTypenamesCovered || anySelectionHasRequiredField) {
|
|
74013
74064
|
selectionTypes.push(
|
|
74014
|
-
|
|
74015
|
-
|
|
74065
|
+
AST10.tsParenthesizedType(
|
|
74066
|
+
AST10.tsTypeLiteral([
|
|
74016
74067
|
readonlyProperty(
|
|
74017
|
-
|
|
74018
|
-
|
|
74019
|
-
|
|
74020
|
-
|
|
74021
|
-
|
|
74068
|
+
AST10.tsPropertySignature(
|
|
74069
|
+
AST10.identifier("__typename"),
|
|
74070
|
+
AST10.tsTypeAnnotation(
|
|
74071
|
+
AST10.tsLiteralType(
|
|
74072
|
+
AST10.stringLiteral("non-exhaustive; don't match this")
|
|
74022
74073
|
)
|
|
74023
74074
|
)
|
|
74024
74075
|
),
|
|
@@ -74028,9 +74079,9 @@ function inlineType({
|
|
|
74028
74079
|
)
|
|
74029
74080
|
);
|
|
74030
74081
|
}
|
|
74031
|
-
result =
|
|
74082
|
+
result = AST10.tsIntersectionType([
|
|
74032
74083
|
result,
|
|
74033
|
-
|
|
74084
|
+
AST10.tsParenthesizedType(AST10.tsUnionType(selectionTypes))
|
|
74034
74085
|
]);
|
|
74035
74086
|
}
|
|
74036
74087
|
} else {
|
|
@@ -74048,7 +74099,7 @@ function wrapType2(wrappers, result, root, forceNullable, forceNonNull) {
|
|
|
74048
74099
|
} else if (toWrap === "NonNull" /* NonNull */) {
|
|
74049
74100
|
continue;
|
|
74050
74101
|
} else if (toWrap === "List" /* List */) {
|
|
74051
|
-
result =
|
|
74102
|
+
result = AST10.tsArrayType(AST10.tsParenthesizedType(result));
|
|
74052
74103
|
}
|
|
74053
74104
|
}
|
|
74054
74105
|
return result;
|
|
@@ -74093,13 +74144,13 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
74093
74144
|
}
|
|
74094
74145
|
|
|
74095
74146
|
// src/codegen/generators/typescript/loadingState.ts
|
|
74096
|
-
var
|
|
74097
|
-
var
|
|
74147
|
+
var recast11 = __toESM(require_main2(), 1);
|
|
74148
|
+
var AST11 = recast11.types.builders;
|
|
74098
74149
|
function withLoadingState(args) {
|
|
74099
74150
|
if (!("enableLoadingState" in args.document.artifact) || !args.document.artifact.enableLoadingState) {
|
|
74100
74151
|
return args.base;
|
|
74101
74152
|
}
|
|
74102
|
-
return
|
|
74153
|
+
return AST11.tsUnionType([
|
|
74103
74154
|
args.base,
|
|
74104
74155
|
loadingState({
|
|
74105
74156
|
parentType: args.document.artifact.rootType,
|
|
@@ -74118,7 +74169,7 @@ function loadingState(args) {
|
|
|
74118
74169
|
import: ["LoadingType"],
|
|
74119
74170
|
sourceModule: "$houdini/runtime/lib/types"
|
|
74120
74171
|
});
|
|
74121
|
-
const result =
|
|
74172
|
+
const result = AST11.tsTypeLiteral(
|
|
74122
74173
|
Object.entries(selection).reduce(
|
|
74123
74174
|
(rest, [attributeName, value]) => {
|
|
74124
74175
|
if (!value.loading) {
|
|
@@ -74126,7 +74177,7 @@ function loadingState(args) {
|
|
|
74126
74177
|
}
|
|
74127
74178
|
let keyType = null;
|
|
74128
74179
|
if (value.loading.kind === "value") {
|
|
74129
|
-
keyType =
|
|
74180
|
+
keyType = AST11.tsTypeReference(AST11.identifier("LoadingType"));
|
|
74130
74181
|
}
|
|
74131
74182
|
if (value.loading.kind === "continue" && value.selection) {
|
|
74132
74183
|
keyType = loadingState({
|
|
@@ -74142,15 +74193,15 @@ function loadingState(args) {
|
|
|
74142
74193
|
}
|
|
74143
74194
|
if (value.loading.list) {
|
|
74144
74195
|
for (const _ of Array.from({ length: value.loading.list.depth })) {
|
|
74145
|
-
keyType =
|
|
74196
|
+
keyType = AST11.tsArrayType(keyType);
|
|
74146
74197
|
}
|
|
74147
74198
|
}
|
|
74148
74199
|
return [
|
|
74149
74200
|
...rest,
|
|
74150
74201
|
readonlyProperty(
|
|
74151
|
-
|
|
74152
|
-
|
|
74153
|
-
|
|
74202
|
+
AST11.tsPropertySignature(
|
|
74203
|
+
AST11.identifier(attributeName),
|
|
74204
|
+
AST11.tsTypeAnnotation(keyType)
|
|
74154
74205
|
)
|
|
74155
74206
|
)
|
|
74156
74207
|
];
|
|
@@ -74161,14 +74212,14 @@ function loadingState(args) {
|
|
|
74161
74212
|
if (args.selection.fragments) {
|
|
74162
74213
|
result.members.push(
|
|
74163
74214
|
readonlyProperty(
|
|
74164
|
-
|
|
74165
|
-
|
|
74166
|
-
|
|
74167
|
-
|
|
74215
|
+
AST11.tsPropertySignature(
|
|
74216
|
+
AST11.stringLiteral(fragmentKey),
|
|
74217
|
+
AST11.tsTypeAnnotation(
|
|
74218
|
+
AST11.tsTypeLiteral(
|
|
74168
74219
|
Object.keys(args.selection.fragments).map((name) => {
|
|
74169
|
-
return
|
|
74170
|
-
|
|
74171
|
-
|
|
74220
|
+
return AST11.tsPropertySignature(
|
|
74221
|
+
AST11.identifier(name),
|
|
74222
|
+
AST11.tsTypeAnnotation(AST11.tsTypeLiteral([]))
|
|
74172
74223
|
);
|
|
74173
74224
|
})
|
|
74174
74225
|
)
|
|
@@ -74181,7 +74232,7 @@ function loadingState(args) {
|
|
|
74181
74232
|
}
|
|
74182
74233
|
|
|
74183
74234
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
74184
|
-
var
|
|
74235
|
+
var AST12 = recast12.types.builders;
|
|
74185
74236
|
async function generateDocumentTypes(config4, docs) {
|
|
74186
74237
|
const typePaths = [];
|
|
74187
74238
|
const fragmentDefinitions = {};
|
|
@@ -74206,7 +74257,7 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74206
74257
|
return;
|
|
74207
74258
|
}
|
|
74208
74259
|
const typeDefPath = config4.artifactTypePath(originalDocument);
|
|
74209
|
-
const program =
|
|
74260
|
+
const program = AST12.program([]);
|
|
74210
74261
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74211
74262
|
let definition = originalDocument.definitions.find(
|
|
74212
74263
|
(def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name
|
|
@@ -74242,9 +74293,9 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74242
74293
|
);
|
|
74243
74294
|
}
|
|
74244
74295
|
program.body.push(
|
|
74245
|
-
|
|
74246
|
-
|
|
74247
|
-
|
|
74296
|
+
AST12.exportNamedDeclaration(
|
|
74297
|
+
AST12.tsTypeAliasDeclaration(
|
|
74298
|
+
AST12.identifier(`${name}$artifact`),
|
|
74248
74299
|
convertToTs(serializeValue(artifact))
|
|
74249
74300
|
)
|
|
74250
74301
|
)
|
|
@@ -74254,17 +74305,17 @@ async function generateDocumentTypes(config4, docs) {
|
|
|
74254
74305
|
typePaths.push(typeDefPath);
|
|
74255
74306
|
})
|
|
74256
74307
|
);
|
|
74257
|
-
const typeIndex =
|
|
74308
|
+
const typeIndex = AST12.program(
|
|
74258
74309
|
typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
|
|
74259
|
-
return
|
|
74260
|
-
|
|
74310
|
+
return AST12.exportAllDeclaration(
|
|
74311
|
+
AST12.literal(
|
|
74261
74312
|
"./" + path_exports.relative(path_exports.resolve(config4.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
|
|
74262
74313
|
),
|
|
74263
74314
|
null
|
|
74264
74315
|
);
|
|
74265
74316
|
}).concat([
|
|
74266
|
-
|
|
74267
|
-
|
|
74317
|
+
AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
|
|
74318
|
+
AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
|
|
74268
74319
|
])
|
|
74269
74320
|
);
|
|
74270
74321
|
const exportDefaultAs = ({ module, as }) => `
|
|
@@ -74319,7 +74370,7 @@ For more information, please visit this link: ${siteURL}/api/config#custom-scala
|
|
|
74319
74370
|
}
|
|
74320
74371
|
function convertToTs(source) {
|
|
74321
74372
|
if (source.type === "ObjectExpression") {
|
|
74322
|
-
return
|
|
74373
|
+
return AST12.tsTypeLiteral(
|
|
74323
74374
|
source.properties.reduce(
|
|
74324
74375
|
(props, prop) => {
|
|
74325
74376
|
if (prop.type !== "ObjectProperty" || prop.key.type !== "StringLiteral" && prop.key.type === "Identifier") {
|
|
@@ -74327,9 +74378,9 @@ function convertToTs(source) {
|
|
|
74327
74378
|
}
|
|
74328
74379
|
return [
|
|
74329
74380
|
...props,
|
|
74330
|
-
|
|
74381
|
+
AST12.tsPropertySignature(
|
|
74331
74382
|
prop.key,
|
|
74332
|
-
|
|
74383
|
+
AST12.tsTypeAnnotation(convertToTs(prop.value))
|
|
74333
74384
|
)
|
|
74334
74385
|
];
|
|
74335
74386
|
},
|
|
@@ -74338,20 +74389,20 @@ function convertToTs(source) {
|
|
|
74338
74389
|
);
|
|
74339
74390
|
}
|
|
74340
74391
|
if (source.type === "ArrayExpression") {
|
|
74341
|
-
return
|
|
74392
|
+
return AST12.tsTupleType(
|
|
74342
74393
|
source.elements.map((element) => convertToTs(element))
|
|
74343
74394
|
);
|
|
74344
74395
|
}
|
|
74345
74396
|
if (source.type === "Literal" && typeof source.value === "boolean") {
|
|
74346
|
-
return
|
|
74397
|
+
return AST12.tsLiteralType(AST12.booleanLiteral(source.value));
|
|
74347
74398
|
}
|
|
74348
74399
|
if (source.type === "Literal" && typeof source.value === "number") {
|
|
74349
|
-
return
|
|
74400
|
+
return AST12.tsLiteralType(AST12.numericLiteral(source.value));
|
|
74350
74401
|
}
|
|
74351
74402
|
if (source.type === "Literal" && typeof source.value === "string") {
|
|
74352
|
-
return
|
|
74403
|
+
return AST12.tsLiteralType(AST12.stringLiteral(source.value));
|
|
74353
74404
|
}
|
|
74354
|
-
return
|
|
74405
|
+
return AST12.tsLiteralType(source);
|
|
74355
74406
|
}
|
|
74356
74407
|
async function generateOperationTypeDefs(config4, filepath, document, body, definition, selections, visitedTypes, missingScalars, artifact) {
|
|
74357
74408
|
let parentType = null;
|
|
@@ -74390,23 +74441,23 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74390
74441
|
});
|
|
74391
74442
|
}
|
|
74392
74443
|
body.push(
|
|
74393
|
-
|
|
74394
|
-
|
|
74395
|
-
|
|
74396
|
-
|
|
74444
|
+
AST12.exportNamedDeclaration(
|
|
74445
|
+
AST12.tsTypeAliasDeclaration(
|
|
74446
|
+
AST12.identifier(definition.name.value),
|
|
74447
|
+
AST12.tsTypeLiteral([
|
|
74397
74448
|
readonlyProperty(
|
|
74398
|
-
|
|
74399
|
-
|
|
74400
|
-
|
|
74449
|
+
AST12.tsPropertySignature(
|
|
74450
|
+
AST12.stringLiteral("input"),
|
|
74451
|
+
AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
|
|
74401
74452
|
)
|
|
74402
74453
|
),
|
|
74403
74454
|
readonlyProperty(
|
|
74404
|
-
|
|
74405
|
-
|
|
74406
|
-
|
|
74407
|
-
definition.operation === "mutation" ?
|
|
74408
|
-
|
|
74409
|
-
|
|
74455
|
+
AST12.tsPropertySignature(
|
|
74456
|
+
AST12.stringLiteral("result"),
|
|
74457
|
+
AST12.tsTypeAnnotation(
|
|
74458
|
+
definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
|
|
74459
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
|
|
74460
|
+
AST12.tsUndefinedKeyword()
|
|
74410
74461
|
])
|
|
74411
74462
|
)
|
|
74412
74463
|
)
|
|
@@ -74414,8 +74465,8 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74414
74465
|
])
|
|
74415
74466
|
)
|
|
74416
74467
|
),
|
|
74417
|
-
|
|
74418
|
-
|
|
74468
|
+
AST12.exportNamedDeclaration(
|
|
74469
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(shapeTypeName), resultType)
|
|
74419
74470
|
)
|
|
74420
74471
|
);
|
|
74421
74472
|
if (hasInputs && definition.variableDefinitions && definition.variableDefinitions.length > 0) {
|
|
@@ -74430,15 +74481,15 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74430
74481
|
);
|
|
74431
74482
|
}
|
|
74432
74483
|
body.push(
|
|
74433
|
-
|
|
74434
|
-
|
|
74435
|
-
|
|
74436
|
-
|
|
74484
|
+
AST12.exportNamedDeclaration(
|
|
74485
|
+
AST12.tsTypeAliasDeclaration(
|
|
74486
|
+
AST12.identifier(inputTypeName),
|
|
74487
|
+
AST12.tsTypeLiteral(
|
|
74437
74488
|
(definition.variableDefinitions || []).map(
|
|
74438
74489
|
(definition2) => {
|
|
74439
|
-
return
|
|
74440
|
-
|
|
74441
|
-
|
|
74490
|
+
return AST12.tsPropertySignature(
|
|
74491
|
+
AST12.identifier(definition2.variable.name.value),
|
|
74492
|
+
AST12.tsTypeAnnotation(
|
|
74442
74493
|
tsTypeReference(config4, missingScalars, definition2, body)
|
|
74443
74494
|
),
|
|
74444
74495
|
definition2.type.kind !== "NonNullType"
|
|
@@ -74451,16 +74502,16 @@ async function generateOperationTypeDefs(config4, filepath, document, body, defi
|
|
|
74451
74502
|
);
|
|
74452
74503
|
} else {
|
|
74453
74504
|
body.push(
|
|
74454
|
-
|
|
74455
|
-
|
|
74505
|
+
AST12.exportNamedDeclaration(
|
|
74506
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
|
|
74456
74507
|
)
|
|
74457
74508
|
);
|
|
74458
74509
|
}
|
|
74459
74510
|
if (definition.operation === "mutation") {
|
|
74460
74511
|
body.push(
|
|
74461
|
-
|
|
74462
|
-
|
|
74463
|
-
|
|
74512
|
+
AST12.exportNamedDeclaration(
|
|
74513
|
+
AST12.tsTypeAliasDeclaration(
|
|
74514
|
+
AST12.identifier(optimisticTypeName),
|
|
74464
74515
|
inlineType({
|
|
74465
74516
|
config: config4,
|
|
74466
74517
|
filepath,
|
|
@@ -74494,12 +74545,12 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74494
74545
|
let directive = definition.directives?.find(
|
|
74495
74546
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
74496
74547
|
);
|
|
74497
|
-
let inputValue = !directive ?
|
|
74548
|
+
let inputValue = !directive ? AST12.tsTypeLiteral([]) : AST12.tsTypeLiteral(
|
|
74498
74549
|
(fragmentArgumentsDefinitions(config4, filepath, definition) || []).map(
|
|
74499
74550
|
(definition2) => {
|
|
74500
|
-
return
|
|
74501
|
-
|
|
74502
|
-
|
|
74551
|
+
return AST12.tsPropertySignature(
|
|
74552
|
+
AST12.identifier(definition2.variable.name.value),
|
|
74553
|
+
AST12.tsTypeAnnotation(
|
|
74503
74554
|
tsTypeReference(config4, missingScalars, definition2, body)
|
|
74504
74555
|
),
|
|
74505
74556
|
definition2.type.kind !== "NonNullType"
|
|
@@ -74508,30 +74559,30 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74508
74559
|
)
|
|
74509
74560
|
);
|
|
74510
74561
|
body.push(
|
|
74511
|
-
|
|
74512
|
-
|
|
74562
|
+
AST12.exportNamedDeclaration(
|
|
74563
|
+
AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), inputValue)
|
|
74513
74564
|
),
|
|
74514
|
-
|
|
74515
|
-
|
|
74516
|
-
|
|
74517
|
-
|
|
74565
|
+
AST12.exportNamedDeclaration(
|
|
74566
|
+
AST12.tsTypeAliasDeclaration(
|
|
74567
|
+
AST12.identifier(propTypeName),
|
|
74568
|
+
AST12.tsTypeLiteral([
|
|
74518
74569
|
readonlyProperty(
|
|
74519
|
-
|
|
74520
|
-
|
|
74521
|
-
|
|
74522
|
-
|
|
74570
|
+
AST12.tsPropertySignature(
|
|
74571
|
+
AST12.stringLiteral("shape"),
|
|
74572
|
+
AST12.tsTypeAnnotation(
|
|
74573
|
+
AST12.tsTypeReference(AST12.identifier(shapeTypeName))
|
|
74523
74574
|
),
|
|
74524
74575
|
true
|
|
74525
74576
|
)
|
|
74526
74577
|
),
|
|
74527
74578
|
readonlyProperty(
|
|
74528
|
-
|
|
74529
|
-
|
|
74530
|
-
|
|
74531
|
-
|
|
74532
|
-
|
|
74533
|
-
|
|
74534
|
-
|
|
74579
|
+
AST12.tsPropertySignature(
|
|
74580
|
+
AST12.stringLiteral(fragmentKey2),
|
|
74581
|
+
AST12.tsTypeAnnotation(
|
|
74582
|
+
AST12.tsTypeLiteral([
|
|
74583
|
+
AST12.tsPropertySignature(
|
|
74584
|
+
AST12.stringLiteral(propTypeName),
|
|
74585
|
+
AST12.tsTypeAnnotation(AST12.tsAnyKeyword())
|
|
74535
74586
|
)
|
|
74536
74587
|
])
|
|
74537
74588
|
)
|
|
@@ -74540,9 +74591,9 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74540
74591
|
])
|
|
74541
74592
|
)
|
|
74542
74593
|
),
|
|
74543
|
-
|
|
74544
|
-
|
|
74545
|
-
|
|
74594
|
+
AST12.exportNamedDeclaration(
|
|
74595
|
+
AST12.tsTypeAliasDeclaration(
|
|
74596
|
+
AST12.identifier(shapeTypeName),
|
|
74546
74597
|
withLoadingState({
|
|
74547
74598
|
config: config4,
|
|
74548
74599
|
document,
|
|
@@ -74568,8 +74619,8 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
74568
74619
|
|
|
74569
74620
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
74570
74621
|
var graphql19 = __toESM(require_graphql2(), 1);
|
|
74571
|
-
var
|
|
74572
|
-
var
|
|
74622
|
+
var recast13 = __toESM(require_main2(), 1);
|
|
74623
|
+
var AST13 = recast13.types.builders;
|
|
74573
74624
|
async function imperativeCacheTypef(config4, docs) {
|
|
74574
74625
|
const returnType = (doc) => config4.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
74575
74626
|
config: config4,
|
|
@@ -74585,87 +74636,87 @@ async function imperativeCacheTypef(config4, docs) {
|
|
|
74585
74636
|
}) ?? "any";
|
|
74586
74637
|
const target = path_exports.join(config4.runtimeDirectory, "generated.d.ts");
|
|
74587
74638
|
const body = [];
|
|
74588
|
-
const declaration =
|
|
74589
|
-
|
|
74590
|
-
|
|
74591
|
-
|
|
74592
|
-
|
|
74593
|
-
|
|
74639
|
+
const declaration = AST13.tsTypeAliasDeclaration(
|
|
74640
|
+
AST13.identifier(CacheTypeDefName),
|
|
74641
|
+
AST13.tsTypeLiteral([
|
|
74642
|
+
AST13.tsPropertySignature(
|
|
74643
|
+
AST13.identifier("types"),
|
|
74644
|
+
AST13.tsTypeAnnotation(typeDefinitions(config4, body, docs, returnType))
|
|
74594
74645
|
),
|
|
74595
|
-
|
|
74596
|
-
|
|
74597
|
-
|
|
74646
|
+
AST13.tsPropertySignature(
|
|
74647
|
+
AST13.identifier("lists"),
|
|
74648
|
+
AST13.tsTypeAnnotation(listDefinitions(config4, body, docs))
|
|
74598
74649
|
),
|
|
74599
|
-
|
|
74600
|
-
|
|
74601
|
-
|
|
74650
|
+
AST13.tsPropertySignature(
|
|
74651
|
+
AST13.identifier("queries"),
|
|
74652
|
+
AST13.tsTypeAnnotation(queryDefinitions(config4, body, docs, returnType))
|
|
74602
74653
|
)
|
|
74603
74654
|
])
|
|
74604
74655
|
);
|
|
74605
74656
|
declaration.declare = true;
|
|
74606
|
-
const importRecord =
|
|
74607
|
-
[
|
|
74608
|
-
|
|
74657
|
+
const importRecord = AST13.importDeclaration(
|
|
74658
|
+
[AST13.importSpecifier(AST13.identifier("Record"))],
|
|
74659
|
+
AST13.stringLiteral("./public/record")
|
|
74609
74660
|
);
|
|
74610
74661
|
importRecord.importKind = "type";
|
|
74611
74662
|
await fs_exports.writeFile(
|
|
74612
74663
|
target,
|
|
74613
|
-
|
|
74614
|
-
|
|
74664
|
+
recast13.prettyPrint(
|
|
74665
|
+
AST13.program([importRecord, ...body, AST13.exportNamedDeclaration(declaration)])
|
|
74615
74666
|
).code
|
|
74616
74667
|
);
|
|
74617
74668
|
}
|
|
74618
74669
|
function typeDefinitions(config4, body, docs, returnType) {
|
|
74619
74670
|
const operationTypes = [config4.schema.getMutationType(), config4.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
74620
74671
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74621
|
-
const
|
|
74672
|
+
const types18 = Object.values(config4.schema.getTypeMap()).filter(
|
|
74622
74673
|
(type) => !graphql19.isAbstractType(type) && !graphql19.isScalarType(type) && !graphql19.isEnumType(type) && !graphql19.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
74623
74674
|
);
|
|
74624
74675
|
const fragmentMap = fragmentListMap(
|
|
74625
74676
|
config4,
|
|
74626
|
-
|
|
74677
|
+
types18.map((type) => type.name),
|
|
74627
74678
|
body,
|
|
74628
74679
|
docs,
|
|
74629
74680
|
returnType
|
|
74630
74681
|
);
|
|
74631
|
-
return
|
|
74632
|
-
|
|
74682
|
+
return AST13.tsTypeLiteral(
|
|
74683
|
+
types18.map((type) => {
|
|
74633
74684
|
let typeName = type.name;
|
|
74634
74685
|
if (config4.schema.getQueryType() && config4.schema.getQueryType()?.name === type.name) {
|
|
74635
74686
|
typeName = "__ROOT__";
|
|
74636
74687
|
}
|
|
74637
|
-
let idFields =
|
|
74688
|
+
let idFields = AST13.tsNeverKeyword();
|
|
74638
74689
|
const keys2 = keyFieldsForType(config4.configFile, type.name);
|
|
74639
74690
|
if (graphql19.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
74640
|
-
idFields =
|
|
74691
|
+
idFields = AST13.tsTypeLiteral(
|
|
74641
74692
|
keys2.map((key) => {
|
|
74642
74693
|
const fieldType = type.getFields()[key];
|
|
74643
74694
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
74644
|
-
return
|
|
74645
|
-
|
|
74646
|
-
|
|
74695
|
+
return AST13.tsPropertySignature(
|
|
74696
|
+
AST13.identifier(key),
|
|
74697
|
+
AST13.tsTypeAnnotation(
|
|
74647
74698
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74648
74699
|
)
|
|
74649
74700
|
);
|
|
74650
74701
|
})
|
|
74651
74702
|
);
|
|
74652
74703
|
} else if (typeName === "__ROOT__") {
|
|
74653
|
-
idFields =
|
|
74704
|
+
idFields = AST13.tsTypeLiteral([]);
|
|
74654
74705
|
}
|
|
74655
|
-
let fields =
|
|
74706
|
+
let fields = AST13.tsTypeLiteral([]);
|
|
74656
74707
|
if (graphql19.isObjectType(type)) {
|
|
74657
|
-
fields =
|
|
74708
|
+
fields = AST13.tsTypeLiteral(
|
|
74658
74709
|
Object.entries(type.getFields()).map(
|
|
74659
74710
|
([key, fieldType]) => {
|
|
74660
74711
|
const unwrapped = unwrapType(config4, fieldType.type);
|
|
74661
|
-
let typeOptions =
|
|
74712
|
+
let typeOptions = AST13.tsUnionType([]);
|
|
74662
74713
|
if (graphql19.isScalarType(unwrapped.type)) {
|
|
74663
74714
|
typeOptions.types.push(
|
|
74664
74715
|
scalarPropertyValue(config4, /* @__PURE__ */ new Set(), unwrapped.type)
|
|
74665
74716
|
);
|
|
74666
74717
|
} else if (graphql19.isEnumType(unwrapped.type)) {
|
|
74667
74718
|
typeOptions.types.push(
|
|
74668
|
-
|
|
74719
|
+
AST13.tsTypeReference(AST13.identifier(unwrapped.type.name))
|
|
74669
74720
|
);
|
|
74670
74721
|
} else if (!graphql19.isAbstractType(unwrapped.type)) {
|
|
74671
74722
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
@@ -74676,21 +74727,21 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74676
74727
|
}
|
|
74677
74728
|
for (const wrapper of unwrapped.wrappers) {
|
|
74678
74729
|
if (wrapper === "Nullable" /* Nullable */) {
|
|
74679
|
-
typeOptions =
|
|
74680
|
-
|
|
74730
|
+
typeOptions = AST13.tsParenthesizedType(
|
|
74731
|
+
AST13.tsUnionType([typeOptions, AST13.tsNullKeyword()])
|
|
74681
74732
|
);
|
|
74682
74733
|
} else if (wrapper === "List" /* List */) {
|
|
74683
|
-
typeOptions =
|
|
74684
|
-
|
|
74734
|
+
typeOptions = AST13.tsArrayType(
|
|
74735
|
+
AST13.tsParenthesizedType(typeOptions)
|
|
74685
74736
|
);
|
|
74686
74737
|
}
|
|
74687
74738
|
}
|
|
74688
74739
|
if (typeOptions.type === "TSParenthesizedType") {
|
|
74689
74740
|
typeOptions = typeOptions.typeAnnotation;
|
|
74690
74741
|
}
|
|
74691
|
-
let args =
|
|
74742
|
+
let args = AST13.tsNeverKeyword();
|
|
74692
74743
|
if (fieldType.args?.length > 0) {
|
|
74693
|
-
args =
|
|
74744
|
+
args = AST13.tsTypeLiteral(
|
|
74694
74745
|
fieldType.args.map((arg) => {
|
|
74695
74746
|
addReferencedInputTypes(
|
|
74696
74747
|
config4,
|
|
@@ -74700,9 +74751,9 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74700
74751
|
/* @__PURE__ */ new Set(),
|
|
74701
74752
|
arg.type
|
|
74702
74753
|
);
|
|
74703
|
-
const prop =
|
|
74704
|
-
|
|
74705
|
-
|
|
74754
|
+
const prop = AST13.tsPropertySignature(
|
|
74755
|
+
AST13.identifier(arg.name),
|
|
74756
|
+
AST13.tsTypeAnnotation(
|
|
74706
74757
|
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg, body)
|
|
74707
74758
|
)
|
|
74708
74759
|
);
|
|
@@ -74712,17 +74763,17 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74712
74763
|
})
|
|
74713
74764
|
);
|
|
74714
74765
|
}
|
|
74715
|
-
return
|
|
74716
|
-
|
|
74717
|
-
|
|
74718
|
-
|
|
74719
|
-
|
|
74720
|
-
|
|
74721
|
-
|
|
74766
|
+
return AST13.tsPropertySignature(
|
|
74767
|
+
AST13.identifier(key),
|
|
74768
|
+
AST13.tsTypeAnnotation(
|
|
74769
|
+
AST13.tsTypeLiteral([
|
|
74770
|
+
AST13.tsPropertySignature(
|
|
74771
|
+
AST13.identifier("type"),
|
|
74772
|
+
AST13.tsTypeAnnotation(typeOptions)
|
|
74722
74773
|
),
|
|
74723
|
-
|
|
74724
|
-
|
|
74725
|
-
|
|
74774
|
+
AST13.tsPropertySignature(
|
|
74775
|
+
AST13.identifier("args"),
|
|
74776
|
+
AST13.tsTypeAnnotation(args)
|
|
74726
74777
|
)
|
|
74727
74778
|
])
|
|
74728
74779
|
)
|
|
@@ -74731,21 +74782,21 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
74731
74782
|
)
|
|
74732
74783
|
);
|
|
74733
74784
|
}
|
|
74734
|
-
return
|
|
74735
|
-
|
|
74736
|
-
|
|
74737
|
-
|
|
74738
|
-
|
|
74739
|
-
|
|
74740
|
-
|
|
74785
|
+
return AST13.tsPropertySignature(
|
|
74786
|
+
AST13.identifier(typeName),
|
|
74787
|
+
AST13.tsTypeAnnotation(
|
|
74788
|
+
AST13.tsTypeLiteral([
|
|
74789
|
+
AST13.tsPropertySignature(
|
|
74790
|
+
AST13.identifier("idFields"),
|
|
74791
|
+
AST13.tsTypeAnnotation(idFields)
|
|
74741
74792
|
),
|
|
74742
|
-
|
|
74743
|
-
|
|
74744
|
-
|
|
74793
|
+
AST13.tsPropertySignature(
|
|
74794
|
+
AST13.identifier("fields"),
|
|
74795
|
+
AST13.tsTypeAnnotation(fields)
|
|
74745
74796
|
),
|
|
74746
|
-
|
|
74747
|
-
|
|
74748
|
-
|
|
74797
|
+
AST13.tsPropertySignature(
|
|
74798
|
+
AST13.identifier("fragments"),
|
|
74799
|
+
AST13.tsTypeAnnotation(fragmentMap[typeName] ?? AST13.tsTupleType([]))
|
|
74749
74800
|
)
|
|
74750
74801
|
])
|
|
74751
74802
|
)
|
|
@@ -74787,28 +74838,28 @@ function listDefinitions(config4, body, docs) {
|
|
|
74787
74838
|
possibleTypes.push(listType.name);
|
|
74788
74839
|
}
|
|
74789
74840
|
lists.push(
|
|
74790
|
-
|
|
74791
|
-
|
|
74792
|
-
|
|
74793
|
-
|
|
74794
|
-
|
|
74795
|
-
|
|
74796
|
-
|
|
74797
|
-
|
|
74841
|
+
AST13.tsPropertySignature(
|
|
74842
|
+
AST13.identifier(nameValue),
|
|
74843
|
+
AST13.tsTypeAnnotation(
|
|
74844
|
+
AST13.tsTypeLiteral([
|
|
74845
|
+
AST13.tsPropertySignature(
|
|
74846
|
+
AST13.identifier("types"),
|
|
74847
|
+
AST13.tsTypeAnnotation(
|
|
74848
|
+
AST13.tsUnionType(
|
|
74798
74849
|
possibleTypes.map(
|
|
74799
|
-
(possible) =>
|
|
74850
|
+
(possible) => AST13.tsLiteralType(AST13.stringLiteral(possible))
|
|
74800
74851
|
)
|
|
74801
74852
|
)
|
|
74802
74853
|
)
|
|
74803
74854
|
),
|
|
74804
|
-
|
|
74805
|
-
|
|
74806
|
-
|
|
74807
|
-
targetFieldDefinition.args.length === 0 ?
|
|
74855
|
+
AST13.tsPropertySignature(
|
|
74856
|
+
AST13.identifier("filters"),
|
|
74857
|
+
AST13.tsTypeAnnotation(
|
|
74858
|
+
targetFieldDefinition.args.length === 0 ? AST13.tsNeverKeyword() : AST13.tsTypeLiteral(
|
|
74808
74859
|
targetFieldDefinition.args.map((arg) => {
|
|
74809
|
-
const argDef =
|
|
74810
|
-
|
|
74811
|
-
|
|
74860
|
+
const argDef = AST13.tsPropertySignature(
|
|
74861
|
+
AST13.identifier(arg.name),
|
|
74862
|
+
AST13.tsTypeAnnotation(
|
|
74812
74863
|
tsTypeReference(
|
|
74813
74864
|
config4,
|
|
74814
74865
|
/* @__PURE__ */ new Set(),
|
|
@@ -74830,10 +74881,10 @@ function listDefinitions(config4, body, docs) {
|
|
|
74830
74881
|
}
|
|
74831
74882
|
});
|
|
74832
74883
|
}
|
|
74833
|
-
return
|
|
74884
|
+
return AST13.tsTypeLiteral(lists);
|
|
74834
74885
|
}
|
|
74835
74886
|
function queryDefinitions(config4, body, docs, returnType) {
|
|
74836
|
-
return
|
|
74887
|
+
return AST13.tsTupleType(
|
|
74837
74888
|
docs.reduce((prev, doc) => {
|
|
74838
74889
|
if (doc.kind !== ArtifactKind.Query || !doc.generateStore) {
|
|
74839
74890
|
return prev;
|
|
@@ -74855,10 +74906,10 @@ function queryDefinitions(config4, body, docs, returnType) {
|
|
|
74855
74906
|
import: [`${doc.name}$result`, `${doc.name}$input`]
|
|
74856
74907
|
});
|
|
74857
74908
|
return prev.concat(
|
|
74858
|
-
|
|
74859
|
-
|
|
74860
|
-
|
|
74861
|
-
|
|
74909
|
+
AST13.tsTupleType([
|
|
74910
|
+
AST13.tsTypeReference(AST13.identifier(runtimeType)),
|
|
74911
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
74912
|
+
AST13.tsTypeReference(AST13.identifier(inputType))
|
|
74862
74913
|
])
|
|
74863
74914
|
);
|
|
74864
74915
|
}, [])
|
|
@@ -74887,13 +74938,13 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74887
74938
|
),
|
|
74888
74939
|
import: [`${definition.name.value}$data`]
|
|
74889
74940
|
});
|
|
74890
|
-
let inputType =
|
|
74941
|
+
let inputType = AST13.tsNeverKeyword();
|
|
74891
74942
|
let directive = definition.directives?.find(
|
|
74892
74943
|
(directive2) => directive2.name.value === config4.argumentsDirective
|
|
74893
74944
|
);
|
|
74894
74945
|
if (directive) {
|
|
74895
|
-
inputType =
|
|
74896
|
-
|
|
74946
|
+
inputType = AST13.tsTypeReference(
|
|
74947
|
+
AST13.identifier(
|
|
74897
74948
|
ensureImports({
|
|
74898
74949
|
config: config4,
|
|
74899
74950
|
body,
|
|
@@ -74908,11 +74959,11 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74908
74959
|
}
|
|
74909
74960
|
return {
|
|
74910
74961
|
...prev,
|
|
74911
|
-
[typeName]:
|
|
74962
|
+
[typeName]: AST13.tsTupleType(
|
|
74912
74963
|
previousValue.concat(
|
|
74913
|
-
|
|
74914
|
-
|
|
74915
|
-
|
|
74964
|
+
AST13.tsTupleType([
|
|
74965
|
+
AST13.tsTypeReference(AST13.identifier(tagResult)),
|
|
74966
|
+
AST13.tsTypeReference(AST13.identifier(shapeType)),
|
|
74916
74967
|
inputType
|
|
74917
74968
|
])
|
|
74918
74969
|
)
|
|
@@ -74922,11 +74973,11 @@ function fragmentListMap(config4, concreteTypes, body, docs, return_type) {
|
|
|
74922
74973
|
}
|
|
74923
74974
|
var CacheTypeDefName = "CacheTypeDef";
|
|
74924
74975
|
function record(name) {
|
|
74925
|
-
return
|
|
74926
|
-
|
|
74927
|
-
|
|
74928
|
-
|
|
74929
|
-
|
|
74976
|
+
return AST13.tsTypeReference(
|
|
74977
|
+
AST13.identifier("Record"),
|
|
74978
|
+
AST13.tsTypeParameterInstantiation([
|
|
74979
|
+
AST13.tsTypeReference(AST13.identifier(CacheTypeDefName)),
|
|
74980
|
+
AST13.tsLiteralType(AST13.stringLiteral(name))
|
|
74930
74981
|
])
|
|
74931
74982
|
);
|
|
74932
74983
|
}
|
|
@@ -74979,25 +75030,25 @@ async function persistOutputGenerator(config4, docs) {
|
|
|
74979
75030
|
|
|
74980
75031
|
// src/codegen/generators/definitions/enums.ts
|
|
74981
75032
|
var graphql21 = __toESM(require_graphql2(), 1);
|
|
74982
|
-
var
|
|
74983
|
-
var
|
|
75033
|
+
var recast14 = __toESM(require_main2(), 1);
|
|
75034
|
+
var AST14 = recast14.types.builders;
|
|
74984
75035
|
async function definitionsGenerator(config4) {
|
|
74985
75036
|
const enums = graphql21.parse(graphql21.printSchema(config4.schema)).definitions.filter(
|
|
74986
75037
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
74987
75038
|
).filter((def) => !config4.isInternalEnum(def));
|
|
74988
75039
|
const { code: runtimeDefinitions } = await printJS(
|
|
74989
|
-
|
|
75040
|
+
AST14.program(
|
|
74990
75041
|
enums.map((defn) => {
|
|
74991
75042
|
const name = defn.name.value;
|
|
74992
75043
|
return moduleExport(
|
|
74993
75044
|
config4,
|
|
74994
75045
|
name,
|
|
74995
|
-
|
|
75046
|
+
AST14.objectExpression(
|
|
74996
75047
|
defn.values?.map((value) => {
|
|
74997
75048
|
const str = value.name.value;
|
|
74998
|
-
return
|
|
74999
|
-
|
|
75000
|
-
|
|
75049
|
+
return AST14.objectProperty(
|
|
75050
|
+
AST14.stringLiteral(str),
|
|
75051
|
+
AST14.stringLiteral(str)
|
|
75001
75052
|
);
|
|
75002
75053
|
}) || []
|
|
75003
75054
|
)
|
|
@@ -76761,8 +76812,8 @@ function find_exported_id(program, name) {
|
|
|
76761
76812
|
}
|
|
76762
76813
|
|
|
76763
76814
|
// src/vite/imports.ts
|
|
76764
|
-
var
|
|
76765
|
-
var
|
|
76815
|
+
var recast15 = __toESM(require_main2(), 1);
|
|
76816
|
+
var AST15 = recast15.types.builders;
|
|
76766
76817
|
function ensure_imports({
|
|
76767
76818
|
config: config4,
|
|
76768
76819
|
script,
|
|
@@ -76778,13 +76829,13 @@ function ensure_imports({
|
|
|
76778
76829
|
if (!has_import) {
|
|
76779
76830
|
script.body.unshift({
|
|
76780
76831
|
type: "ImportDeclaration",
|
|
76781
|
-
source:
|
|
76832
|
+
source: AST15.stringLiteral(sourceModule),
|
|
76782
76833
|
importKind
|
|
76783
76834
|
});
|
|
76784
76835
|
}
|
|
76785
76836
|
return { ids: [], added: has_import ? 0 : 1 };
|
|
76786
76837
|
}
|
|
76787
|
-
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) =>
|
|
76838
|
+
const idList = (Array.isArray(importID) ? importID : [importID]).map((id) => AST15.identifier(id));
|
|
76788
76839
|
const toImport = idList.filter(
|
|
76789
76840
|
(identifier) => !script.body.find(
|
|
76790
76841
|
(statement) => statement.type === "ImportDeclaration" && statement.specifiers?.find(
|
|
@@ -76795,16 +76846,16 @@ function ensure_imports({
|
|
|
76795
76846
|
if (toImport.length > 0) {
|
|
76796
76847
|
script.body.unshift({
|
|
76797
76848
|
type: "ImportDeclaration",
|
|
76798
|
-
source:
|
|
76849
|
+
source: AST15.stringLiteral(sourceModule),
|
|
76799
76850
|
specifiers: toImport.map(
|
|
76800
|
-
(identifier, i2) => !Array.isArray(importID) ?
|
|
76851
|
+
(identifier, i2) => !Array.isArray(importID) ? AST15.importDefaultSpecifier(identifier) : AST15.importSpecifier(identifier, as?.[i2] ? AST15.identifier(as[i2]) : identifier)
|
|
76801
76852
|
),
|
|
76802
76853
|
importKind
|
|
76803
76854
|
});
|
|
76804
76855
|
}
|
|
76805
76856
|
for (const [i2, target] of (as ?? []).entries()) {
|
|
76806
76857
|
if (target) {
|
|
76807
|
-
idList[i2] =
|
|
76858
|
+
idList[i2] = AST15.identifier(target);
|
|
76808
76859
|
}
|
|
76809
76860
|
}
|
|
76810
76861
|
return {
|