houdini 0.18.3 → 0.19.1

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.
Files changed (78) hide show
  1. package/build/cmd-cjs/index.js +961 -534
  2. package/build/cmd-esm/index.js +961 -534
  3. package/build/codegen/generators/artifacts/utils.d.ts +2 -1
  4. package/build/codegen/generators/runtime/index.d.ts +2 -2
  5. package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
  6. package/build/codegen/generators/typescript/imperativeCache.d.ts +2 -0
  7. package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
  8. package/build/codegen-cjs/index.js +861 -483
  9. package/build/codegen-esm/index.js +861 -483
  10. package/build/lib/config.d.ts +27 -10
  11. package/build/lib-cjs/index.js +172 -64
  12. package/build/lib-esm/index.js +171 -64
  13. package/build/runtime/cache/cache.d.ts +5 -2
  14. package/build/runtime/cache/schema.d.ts +21 -0
  15. package/build/runtime/generated.d.ts +4 -0
  16. package/build/runtime/index.d.ts +6 -3
  17. package/build/runtime/lib/config.d.ts +7 -3
  18. package/build/runtime/lib/network.d.ts +2 -2
  19. package/build/runtime/lib/types.d.ts +2 -2
  20. package/build/runtime/public/cache.d.ts +19 -0
  21. package/build/runtime/public/index.d.ts +1 -0
  22. package/build/runtime/public/list.d.ts +18 -0
  23. package/build/runtime/public/record.d.ts +31 -0
  24. package/build/runtime/public/tests/test.d.ts +114 -0
  25. package/build/runtime/public/types.d.ts +36 -0
  26. package/build/runtime-cjs/cache/cache.d.ts +5 -2
  27. package/build/runtime-cjs/cache/cache.js +16 -5
  28. package/build/runtime-cjs/cache/schema.d.ts +21 -0
  29. package/build/runtime-cjs/cache/schema.js +66 -0
  30. package/build/runtime-cjs/generated.d.ts +4 -0
  31. package/build/runtime-cjs/generated.js +16 -0
  32. package/build/runtime-cjs/index.d.ts +6 -3
  33. package/build/runtime-cjs/index.js +4 -0
  34. package/build/runtime-cjs/lib/config.d.ts +7 -3
  35. package/build/runtime-cjs/lib/network.d.ts +2 -2
  36. package/build/runtime-cjs/lib/network.js +2 -2
  37. package/build/runtime-cjs/lib/types.d.ts +2 -2
  38. package/build/runtime-cjs/public/cache.d.ts +19 -0
  39. package/build/runtime-cjs/public/cache.js +97 -0
  40. package/build/runtime-cjs/public/index.d.ts +1 -0
  41. package/build/runtime-cjs/public/index.js +28 -0
  42. package/build/runtime-cjs/public/list.d.ts +18 -0
  43. package/build/runtime-cjs/public/list.js +163 -0
  44. package/build/runtime-cjs/public/record.d.ts +31 -0
  45. package/build/runtime-cjs/public/record.js +249 -0
  46. package/build/runtime-cjs/public/tests/test.d.ts +114 -0
  47. package/build/runtime-cjs/public/tests/test.js +31 -0
  48. package/build/runtime-cjs/public/types.d.ts +36 -0
  49. package/build/runtime-cjs/public/types.js +16 -0
  50. package/build/runtime-esm/cache/cache.d.ts +5 -2
  51. package/build/runtime-esm/cache/cache.js +16 -5
  52. package/build/runtime-esm/cache/schema.d.ts +21 -0
  53. package/build/runtime-esm/cache/schema.js +42 -0
  54. package/build/runtime-esm/generated.d.ts +4 -0
  55. package/build/runtime-esm/generated.js +0 -0
  56. package/build/runtime-esm/index.d.ts +6 -3
  57. package/build/runtime-esm/index.js +5 -2
  58. package/build/runtime-esm/lib/config.d.ts +7 -3
  59. package/build/runtime-esm/lib/network.d.ts +2 -2
  60. package/build/runtime-esm/lib/network.js +2 -2
  61. package/build/runtime-esm/lib/types.d.ts +2 -2
  62. package/build/runtime-esm/public/cache.d.ts +19 -0
  63. package/build/runtime-esm/public/cache.js +72 -0
  64. package/build/runtime-esm/public/index.d.ts +1 -0
  65. package/build/runtime-esm/public/index.js +4 -0
  66. package/build/runtime-esm/public/list.d.ts +18 -0
  67. package/build/runtime-esm/public/list.js +139 -0
  68. package/build/runtime-esm/public/record.d.ts +31 -0
  69. package/build/runtime-esm/public/record.js +222 -0
  70. package/build/runtime-esm/public/tests/test.d.ts +114 -0
  71. package/build/runtime-esm/public/tests/test.js +7 -0
  72. package/build/runtime-esm/public/types.d.ts +36 -0
  73. package/build/runtime-esm/public/types.js +0 -0
  74. package/build/test-cjs/index.js +857 -466
  75. package/build/test-esm/index.js +857 -466
  76. package/build/vite-cjs/index.js +939 -527
  77. package/build/vite-esm/index.js +939 -527
  78. package/package.json +2 -2
@@ -3725,12 +3725,12 @@ var require_parser = __commonJS({
3725
3725
  return [];
3726
3726
  }
3727
3727
  if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
3728
- var types14 = [];
3728
+ var types16 = [];
3729
3729
  this.expectOptionalToken(_tokenKind.TokenKind.AMP);
3730
3730
  do {
3731
- types14.push(this.parseNamedType());
3731
+ types16.push(this.parseNamedType());
3732
3732
  } while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME));
3733
- return types14;
3733
+ return types16;
3734
3734
  }
3735
3735
  return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType);
3736
3736
  };
@@ -3809,13 +3809,13 @@ var require_parser = __commonJS({
3809
3809
  this.expectKeyword("union");
3810
3810
  var name2 = this.parseName();
3811
3811
  var directives = this.parseDirectives(true);
3812
- var types14 = this.parseUnionMemberTypes();
3812
+ var types16 = this.parseUnionMemberTypes();
3813
3813
  return {
3814
3814
  kind: _kinds.Kind.UNION_TYPE_DEFINITION,
3815
3815
  description,
3816
3816
  name: name2,
3817
3817
  directives,
3818
- types: types14,
3818
+ types: types16,
3819
3819
  loc: this.loc(start)
3820
3820
  };
3821
3821
  };
@@ -3973,15 +3973,15 @@ var require_parser = __commonJS({
3973
3973
  this.expectKeyword("union");
3974
3974
  var name2 = this.parseName();
3975
3975
  var directives = this.parseDirectives(true);
3976
- var types14 = this.parseUnionMemberTypes();
3977
- if (directives.length === 0 && types14.length === 0) {
3976
+ var types16 = this.parseUnionMemberTypes();
3977
+ if (directives.length === 0 && types16.length === 0) {
3978
3978
  throw this.unexpected();
3979
3979
  }
3980
3980
  return {
3981
3981
  kind: _kinds.Kind.UNION_TYPE_EXTENSION,
3982
3982
  name: name2,
3983
3983
  directives,
3984
- types: types14,
3984
+ types: types16,
3985
3985
  loc: this.loc(start)
3986
3986
  };
3987
3987
  };
@@ -4151,7 +4151,7 @@ var require_visitor = __commonJS({
4151
4151
  Object.defineProperty(exports, "__esModule", {
4152
4152
  value: true
4153
4153
  });
4154
- exports.visit = visit12;
4154
+ exports.visit = visit13;
4155
4155
  exports.visitInParallel = visitInParallel;
4156
4156
  exports.getVisitFn = getVisitFn;
4157
4157
  exports.BREAK = exports.QueryDocumentKeys = void 0;
@@ -4214,7 +4214,7 @@ var require_visitor = __commonJS({
4214
4214
  exports.QueryDocumentKeys = QueryDocumentKeys;
4215
4215
  var BREAK = Object.freeze({});
4216
4216
  exports.BREAK = BREAK;
4217
- function visit12(root, visitor) {
4217
+ function visit13(root, visitor) {
4218
4218
  var visitorKeys = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : QueryDocumentKeys;
4219
4219
  var stack = void 0;
4220
4220
  var inArray = Array.isArray(root);
@@ -4959,8 +4959,8 @@ var require_printer = __commonJS({
4959
4959
  return join3(["interface", name2, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
4960
4960
  }),
4961
4961
  UnionTypeDefinition: addDescription2(function(_ref27) {
4962
- var name2 = _ref27.name, directives = _ref27.directives, types14 = _ref27.types;
4963
- return join3(["union", name2, join3(directives, " "), types14 && types14.length !== 0 ? "= " + join3(types14, " | ") : ""], " ");
4962
+ var name2 = _ref27.name, directives = _ref27.directives, types16 = _ref27.types;
4963
+ return join3(["union", name2, join3(directives, " "), types16 && types16.length !== 0 ? "= " + join3(types16, " | ") : ""], " ");
4964
4964
  }),
4965
4965
  EnumTypeDefinition: addDescription2(function(_ref28) {
4966
4966
  var name2 = _ref28.name, directives = _ref28.directives, values = _ref28.values;
@@ -4995,8 +4995,8 @@ var require_printer = __commonJS({
4995
4995
  return join3(["extend interface", name2, wrap2("implements ", join3(interfaces, " & ")), join3(directives, " "), block2(fields)], " ");
4996
4996
  },
4997
4997
  UnionTypeExtension: function UnionTypeExtension(_ref36) {
4998
- var name2 = _ref36.name, directives = _ref36.directives, types14 = _ref36.types;
4999
- return join3(["extend union", name2, join3(directives, " "), types14 && types14.length !== 0 ? "= " + join3(types14, " | ") : ""], " ");
4998
+ var name2 = _ref36.name, directives = _ref36.directives, types16 = _ref36.types;
4999
+ return join3(["extend union", name2, join3(directives, " "), types16 && types16.length !== 0 ? "= " + join3(types16, " | ") : ""], " ");
5000
5000
  },
5001
5001
  EnumTypeExtension: function EnumTypeExtension(_ref37) {
5002
5002
  var name2 = _ref37.name, directives = _ref37.directives, values = _ref37.values;
@@ -5092,17 +5092,17 @@ var require_definition = __commonJS({
5092
5092
  });
5093
5093
  exports.isType = isType;
5094
5094
  exports.assertType = assertType;
5095
- exports.isScalarType = isScalarType12;
5095
+ exports.isScalarType = isScalarType13;
5096
5096
  exports.assertScalarType = assertScalarType;
5097
- exports.isObjectType = isObjectType11;
5097
+ exports.isObjectType = isObjectType12;
5098
5098
  exports.assertObjectType = assertObjectType;
5099
5099
  exports.isInterfaceType = isInterfaceType12;
5100
5100
  exports.assertInterfaceType = assertInterfaceType;
5101
5101
  exports.isUnionType = isUnionType13;
5102
5102
  exports.assertUnionType = assertUnionType;
5103
- exports.isEnumType = isEnumType9;
5103
+ exports.isEnumType = isEnumType10;
5104
5104
  exports.assertEnumType = assertEnumType;
5105
- exports.isInputObjectType = isInputObjectType7;
5105
+ exports.isInputObjectType = isInputObjectType8;
5106
5106
  exports.assertInputObjectType = assertInputObjectType;
5107
5107
  exports.isListType = isListType8;
5108
5108
  exports.assertListType = assertListType;
@@ -5116,7 +5116,7 @@ var require_definition = __commonJS({
5116
5116
  exports.assertLeafType = assertLeafType;
5117
5117
  exports.isCompositeType = isCompositeType;
5118
5118
  exports.assertCompositeType = assertCompositeType;
5119
- exports.isAbstractType = isAbstractType2;
5119
+ exports.isAbstractType = isAbstractType3;
5120
5120
  exports.assertAbstractType = assertAbstractType;
5121
5121
  exports.GraphQLList = GraphQLList6;
5122
5122
  exports.GraphQLNonNull = GraphQLNonNull6;
@@ -5171,7 +5171,7 @@ var require_definition = __commonJS({
5171
5171
  return Constructor;
5172
5172
  }
5173
5173
  function isType(type) {
5174
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type) || isListType8(type) || isNonNullType10(type);
5174
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
5175
5175
  }
5176
5176
  function assertType(type) {
5177
5177
  if (!isType(type)) {
@@ -5179,20 +5179,20 @@ var require_definition = __commonJS({
5179
5179
  }
5180
5180
  return type;
5181
5181
  }
5182
- function isScalarType12(type) {
5182
+ function isScalarType13(type) {
5183
5183
  return (0, _instanceOf.default)(type, GraphQLScalarType4);
5184
5184
  }
5185
5185
  function assertScalarType(type) {
5186
- if (!isScalarType12(type)) {
5186
+ if (!isScalarType13(type)) {
5187
5187
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type."));
5188
5188
  }
5189
5189
  return type;
5190
5190
  }
5191
- function isObjectType11(type) {
5191
+ function isObjectType12(type) {
5192
5192
  return (0, _instanceOf.default)(type, GraphQLObjectType6);
5193
5193
  }
5194
5194
  function assertObjectType(type) {
5195
- if (!isObjectType11(type)) {
5195
+ if (!isObjectType12(type)) {
5196
5196
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type."));
5197
5197
  }
5198
5198
  return type;
@@ -5215,20 +5215,20 @@ var require_definition = __commonJS({
5215
5215
  }
5216
5216
  return type;
5217
5217
  }
5218
- function isEnumType9(type) {
5218
+ function isEnumType10(type) {
5219
5219
  return (0, _instanceOf.default)(type, GraphQLEnumType4);
5220
5220
  }
5221
5221
  function assertEnumType(type) {
5222
- if (!isEnumType9(type)) {
5222
+ if (!isEnumType10(type)) {
5223
5223
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
5224
5224
  }
5225
5225
  return type;
5226
5226
  }
5227
- function isInputObjectType7(type) {
5227
+ function isInputObjectType8(type) {
5228
5228
  return (0, _instanceOf.default)(type, GraphQLInputObjectType4);
5229
5229
  }
5230
5230
  function assertInputObjectType(type) {
5231
- if (!isInputObjectType7(type)) {
5231
+ if (!isInputObjectType8(type)) {
5232
5232
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type."));
5233
5233
  }
5234
5234
  return type;
@@ -5252,7 +5252,7 @@ var require_definition = __commonJS({
5252
5252
  return type;
5253
5253
  }
5254
5254
  function isInputType(type) {
5255
- return isScalarType12(type) || isEnumType9(type) || isInputObjectType7(type) || isWrappingType(type) && isInputType(type.ofType);
5255
+ return isScalarType13(type) || isEnumType10(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
5256
5256
  }
5257
5257
  function assertInputType(type) {
5258
5258
  if (!isInputType(type)) {
@@ -5261,7 +5261,7 @@ var require_definition = __commonJS({
5261
5261
  return type;
5262
5262
  }
5263
5263
  function isOutputType(type) {
5264
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isWrappingType(type) && isOutputType(type.ofType);
5264
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isWrappingType(type) && isOutputType(type.ofType);
5265
5265
  }
5266
5266
  function assertOutputType(type) {
5267
5267
  if (!isOutputType(type)) {
@@ -5270,7 +5270,7 @@ var require_definition = __commonJS({
5270
5270
  return type;
5271
5271
  }
5272
5272
  function isLeafType4(type) {
5273
- return isScalarType12(type) || isEnumType9(type);
5273
+ return isScalarType13(type) || isEnumType10(type);
5274
5274
  }
5275
5275
  function assertLeafType(type) {
5276
5276
  if (!isLeafType4(type)) {
@@ -5279,7 +5279,7 @@ var require_definition = __commonJS({
5279
5279
  return type;
5280
5280
  }
5281
5281
  function isCompositeType(type) {
5282
- return isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type);
5282
+ return isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type);
5283
5283
  }
5284
5284
  function assertCompositeType(type) {
5285
5285
  if (!isCompositeType(type)) {
@@ -5287,11 +5287,11 @@ var require_definition = __commonJS({
5287
5287
  }
5288
5288
  return type;
5289
5289
  }
5290
- function isAbstractType2(type) {
5290
+ function isAbstractType3(type) {
5291
5291
  return isInterfaceType12(type) || isUnionType13(type);
5292
5292
  }
5293
5293
  function assertAbstractType(type) {
5294
- if (!isAbstractType2(type)) {
5294
+ if (!isAbstractType3(type)) {
5295
5295
  throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL abstract type."));
5296
5296
  }
5297
5297
  return type;
@@ -5358,7 +5358,7 @@ var require_definition = __commonJS({
5358
5358
  }
5359
5359
  }
5360
5360
  function isNamedType4(type) {
5361
- return isScalarType12(type) || isObjectType11(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType9(type) || isInputObjectType7(type);
5361
+ return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType10(type) || isInputObjectType8(type);
5362
5362
  }
5363
5363
  function assertNamedType(type) {
5364
5364
  if (!isNamedType4(type)) {
@@ -5667,9 +5667,9 @@ var require_definition = __commonJS({
5667
5667
  exports.GraphQLUnionType = GraphQLUnionType3;
5668
5668
  (0, _defineInspect.default)(GraphQLUnionType3);
5669
5669
  function defineTypes(config2) {
5670
- var types14 = resolveThunk(config2.types);
5671
- Array.isArray(types14) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
5672
- return types14;
5670
+ var types16 = resolveThunk(config2.types);
5671
+ Array.isArray(types16) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config2.name, "."));
5672
+ return types16;
5673
5673
  }
5674
5674
  var GraphQLEnumType4 = /* @__PURE__ */ function() {
5675
5675
  function GraphQLEnumType5(config2) {
@@ -11507,7 +11507,7 @@ var require_graphql = __commonJS({
11507
11507
  Object.defineProperty(exports, "__esModule", {
11508
11508
  value: true
11509
11509
  });
11510
- exports.graphql = graphql29;
11510
+ exports.graphql = graphql30;
11511
11511
  exports.graphqlSync = graphqlSync;
11512
11512
  var _isPromise = _interopRequireDefault(require_isPromise());
11513
11513
  var _parser = require_parser();
@@ -11517,7 +11517,7 @@ var require_graphql = __commonJS({
11517
11517
  function _interopRequireDefault(obj) {
11518
11518
  return obj && obj.__esModule ? obj : { default: obj };
11519
11519
  }
11520
- function graphql29(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
11520
+ function graphql30(argsOrSchema, source, rootValue, contextValue, variableValues, operationName, fieldResolver, typeResolver) {
11521
11521
  var _arguments = arguments;
11522
11522
  return new Promise(function(resolve2) {
11523
11523
  return resolve2(
@@ -13306,7 +13306,7 @@ var require_buildClientSchema = __commonJS({
13306
13306
  return new _definition.GraphQLUnionType({
13307
13307
  name: unionIntrospection.name,
13308
13308
  description: unionIntrospection.description,
13309
- types: function types14() {
13309
+ types: function types16() {
13310
13310
  return unionIntrospection.possibleTypes.map(getObjectType);
13311
13311
  }
13312
13312
  });
@@ -13651,7 +13651,7 @@ var require_extendSchema = __commonJS({
13651
13651
  var config2 = type.toConfig();
13652
13652
  var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config2.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : [];
13653
13653
  return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config2), {}, {
13654
- types: function types14() {
13654
+ types: function types16() {
13655
13655
  return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions));
13656
13656
  },
13657
13657
  extensionASTNodes: config2.extensionASTNodes.concat(extensions)
@@ -13799,17 +13799,17 @@ var require_extendSchema = __commonJS({
13799
13799
  return interfaces;
13800
13800
  }
13801
13801
  function buildUnionTypes(nodes) {
13802
- var types14 = [];
13802
+ var types16 = [];
13803
13803
  for (var _i32 = 0; _i32 < nodes.length; _i32++) {
13804
13804
  var _node$types;
13805
13805
  var node = nodes[_i32];
13806
13806
  var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : [];
13807
13807
  for (var _i34 = 0; _i34 < typeNodes.length; _i34++) {
13808
13808
  var type = typeNodes[_i34];
13809
- types14.push(getNamedType5(type));
13809
+ types16.push(getNamedType5(type));
13810
13810
  }
13811
13811
  }
13812
- return types14;
13812
+ return types16;
13813
13813
  }
13814
13814
  function buildType(astNode) {
13815
13815
  var _typeExtensionsMap$na;
@@ -13866,7 +13866,7 @@ var require_extendSchema = __commonJS({
13866
13866
  return new _definition.GraphQLUnionType({
13867
13867
  name: name3,
13868
13868
  description,
13869
- types: function types14() {
13869
+ types: function types16() {
13870
13870
  return buildUnionTypes(_allNodes3);
13871
13871
  },
13872
13872
  astNode,
@@ -14164,7 +14164,7 @@ var require_lexicographicSortSchema = __commonJS({
14164
14164
  if ((0, _definition.isUnionType)(type)) {
14165
14165
  var _config22 = type.toConfig();
14166
14166
  return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config22), {}, {
14167
- types: function types14() {
14167
+ types: function types16() {
14168
14168
  return sortTypes(_config22.types);
14169
14169
  }
14170
14170
  }));
@@ -14249,10 +14249,10 @@ var require_printSchema = __commonJS({
14249
14249
  }
14250
14250
  function printFilteredSchema(schema, directiveFilter, typeFilter, options) {
14251
14251
  var directives = schema.getDirectives().filter(directiveFilter);
14252
- var types14 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
14252
+ var types16 = (0, _objectValues.default)(schema.getTypeMap()).filter(typeFilter);
14253
14253
  return [printSchemaDefinition(schema)].concat(directives.map(function(directive) {
14254
14254
  return printDirective(directive, options);
14255
- }), types14.map(function(type) {
14255
+ }), types16.map(function(type) {
14256
14256
  return printType(type, options);
14257
14257
  })).filter(Boolean).join("\n\n") + "\n";
14258
14258
  }
@@ -14327,8 +14327,8 @@ var require_printSchema = __commonJS({
14327
14327
  return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type);
14328
14328
  }
14329
14329
  function printUnion(type, options) {
14330
- var types14 = type.getTypes();
14331
- var possibleTypes = types14.length ? " = " + types14.join(" | ") : "";
14330
+ var types16 = type.getTypes();
14331
+ var possibleTypes = types16.length ? " = " + types16.join(" | ") : "";
14332
14332
  return printDescription(options, type) + "union " + type.name + possibleTypes;
14333
14333
  }
14334
14334
  function printEnum(type, options) {
@@ -30005,14 +30005,14 @@ var require_lib3 = __commonJS({
30005
30005
  this.preserveSpace = !!preserveSpace;
30006
30006
  }
30007
30007
  };
30008
- var types14 = {
30008
+ var types16 = {
30009
30009
  brace: new TokContext("{"),
30010
30010
  j_oTag: new TokContext("<tag"),
30011
30011
  j_cTag: new TokContext("</tag"),
30012
30012
  j_expr: new TokContext("<tag>...</tag>", true)
30013
30013
  };
30014
30014
  {
30015
- types14.template = new TokContext("`", true);
30015
+ types16.template = new TokContext("`", true);
30016
30016
  }
30017
30017
  var beforeExpr = true;
30018
30018
  var startsExpr = true;
@@ -30544,17 +30544,17 @@ var require_lib3 = __commonJS({
30544
30544
  context.pop();
30545
30545
  };
30546
30546
  tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
30547
- context.push(types14.brace);
30547
+ context.push(types16.brace);
30548
30548
  };
30549
30549
  tokenTypes[22].updateContext = (context) => {
30550
- if (context[context.length - 1] === types14.template) {
30550
+ if (context[context.length - 1] === types16.template) {
30551
30551
  context.pop();
30552
30552
  } else {
30553
- context.push(types14.template);
30553
+ context.push(types16.template);
30554
30554
  }
30555
30555
  };
30556
30556
  tokenTypes[140].updateContext = (context) => {
30557
- context.push(types14.j_expr, types14.j_oTag);
30557
+ context.push(types16.j_expr, types16.j_oTag);
30558
30558
  };
30559
30559
  }
30560
30560
  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";
@@ -31195,7 +31195,7 @@ var require_lib3 = __commonJS({
31195
31195
  this.lastTokEndLoc = null;
31196
31196
  this.lastTokStartLoc = null;
31197
31197
  this.lastTokStart = 0;
31198
- this.context = [types14.brace];
31198
+ this.context = [types16.brace];
31199
31199
  this.canStartJSXElement = true;
31200
31200
  this.containsEsc = false;
31201
31201
  this.firstInvalidTemplateEscapePos = null;
@@ -35119,7 +35119,7 @@ var require_lib3 = __commonJS({
35119
35119
  context
35120
35120
  } = this.state;
35121
35121
  const currentContext = context[context.length - 1];
35122
- if (currentContext === types14.j_oTag || currentContext === types14.j_expr) {
35122
+ if (currentContext === types16.j_oTag || currentContext === types16.j_expr) {
35123
35123
  context.pop();
35124
35124
  }
35125
35125
  }
@@ -36179,9 +36179,9 @@ var require_lib3 = __commonJS({
36179
36179
  switch (this.state.type) {
36180
36180
  case 5:
36181
36181
  node = this.startNode();
36182
- this.setContext(types14.brace);
36182
+ this.setContext(types16.brace);
36183
36183
  this.next();
36184
- node = this.jsxParseExpressionContainer(node, types14.j_oTag);
36184
+ node = this.jsxParseExpressionContainer(node, types16.j_oTag);
36185
36185
  if (node.expression.type === "JSXEmptyExpression") {
36186
36186
  this.raise(JsxErrors.AttributeIsEmpty, {
36187
36187
  at: node
@@ -36204,7 +36204,7 @@ var require_lib3 = __commonJS({
36204
36204
  jsxParseSpreadChild(node) {
36205
36205
  this.next();
36206
36206
  node.expression = this.parseExpression();
36207
- this.setContext(types14.j_expr);
36207
+ this.setContext(types16.j_expr);
36208
36208
  this.state.canStartJSXElement = true;
36209
36209
  this.expect(8);
36210
36210
  return this.finishNode(node, "JSXSpreadChild");
@@ -36224,11 +36224,11 @@ var require_lib3 = __commonJS({
36224
36224
  jsxParseAttribute() {
36225
36225
  const node = this.startNode();
36226
36226
  if (this.match(5)) {
36227
- this.setContext(types14.brace);
36227
+ this.setContext(types16.brace);
36228
36228
  this.next();
36229
36229
  this.expect(21);
36230
36230
  node.argument = this.parseMaybeAssignAllowIn();
36231
- this.setContext(types14.j_oTag);
36231
+ this.setContext(types16.j_oTag);
36232
36232
  this.state.canStartJSXElement = true;
36233
36233
  this.expect(8);
36234
36234
  return this.finishNode(node, "JSXSpreadAttribute");
@@ -36287,12 +36287,12 @@ var require_lib3 = __commonJS({
36287
36287
  break;
36288
36288
  case 5: {
36289
36289
  const node2 = this.startNode();
36290
- this.setContext(types14.brace);
36290
+ this.setContext(types16.brace);
36291
36291
  this.next();
36292
36292
  if (this.match(21)) {
36293
36293
  children.push(this.jsxParseSpreadChild(node2));
36294
36294
  } else {
36295
- children.push(this.jsxParseExpressionContainer(node2, types14.j_expr));
36295
+ children.push(this.jsxParseExpressionContainer(node2, types16.j_expr));
36296
36296
  }
36297
36297
  break;
36298
36298
  }
@@ -36363,10 +36363,10 @@ var require_lib3 = __commonJS({
36363
36363
  }
36364
36364
  getTokenFromCode(code) {
36365
36365
  const context = this.curContext();
36366
- if (context === types14.j_expr) {
36366
+ if (context === types16.j_expr) {
36367
36367
  return this.jsxReadToken();
36368
36368
  }
36369
- if (context === types14.j_oTag || context === types14.j_cTag) {
36369
+ if (context === types16.j_oTag || context === types16.j_cTag) {
36370
36370
  if (isIdentifierStart(code)) {
36371
36371
  return this.jsxReadWord();
36372
36372
  }
@@ -36374,7 +36374,7 @@ var require_lib3 = __commonJS({
36374
36374
  ++this.state.pos;
36375
36375
  return this.finishToken(141);
36376
36376
  }
36377
- if ((code === 34 || code === 39) && context === types14.j_oTag) {
36377
+ if ((code === 34 || code === 39) && context === types16.j_oTag) {
36378
36378
  return this.jsxReadString(code);
36379
36379
  }
36380
36380
  }
@@ -36390,17 +36390,17 @@ var require_lib3 = __commonJS({
36390
36390
  type
36391
36391
  } = this.state;
36392
36392
  if (type === 56 && prevType === 140) {
36393
- context.splice(-2, 2, types14.j_cTag);
36393
+ context.splice(-2, 2, types16.j_cTag);
36394
36394
  this.state.canStartJSXElement = false;
36395
36395
  } else if (type === 140) {
36396
- context.push(types14.j_oTag);
36396
+ context.push(types16.j_oTag);
36397
36397
  } else if (type === 141) {
36398
36398
  const out = context[context.length - 1];
36399
- if (out === types14.j_oTag && prevType === 56 || out === types14.j_cTag) {
36399
+ if (out === types16.j_oTag && prevType === 56 || out === types16.j_cTag) {
36400
36400
  context.pop();
36401
- this.state.canStartJSXElement = context[context.length - 1] === types14.j_expr;
36401
+ this.state.canStartJSXElement = context[context.length - 1] === types16.j_expr;
36402
36402
  } else {
36403
- this.setContext(types14.j_expr);
36403
+ this.setContext(types16.j_expr);
36404
36404
  this.state.canStartJSXElement = true;
36405
36405
  }
36406
36406
  } else {
@@ -37407,14 +37407,14 @@ var require_lib3 = __commonJS({
37407
37407
  tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
37408
37408
  const node = this.startNode();
37409
37409
  const hasLeadingOperator = this.eat(operator);
37410
- const types15 = [];
37410
+ const types17 = [];
37411
37411
  do {
37412
- types15.push(parseConstituentType());
37412
+ types17.push(parseConstituentType());
37413
37413
  } while (this.eat(operator));
37414
- if (types15.length === 1 && !hasLeadingOperator) {
37415
- return types15[0];
37414
+ if (types17.length === 1 && !hasLeadingOperator) {
37415
+ return types17[0];
37416
37416
  }
37417
- node.types = types15;
37417
+ node.types = types17;
37418
37418
  return this.finishNode(node, kind);
37419
37419
  }
37420
37420
  tsParseIntersectionTypeOrHigher() {
@@ -38630,7 +38630,7 @@ var require_lib3 = __commonJS({
38630
38630
  context
38631
38631
  } = this.state;
38632
38632
  const currentContext = context[context.length - 1];
38633
- if (currentContext === types14.j_oTag || currentContext === types14.j_expr) {
38633
+ if (currentContext === types16.j_oTag || currentContext === types16.j_expr) {
38634
38634
  context.pop();
38635
38635
  }
38636
38636
  }
@@ -44202,9 +44202,9 @@ var require_shared = __commonJS({
44202
44202
  var tslib_1 = require_tslib();
44203
44203
  var types_1 = tslib_1.__importDefault(require_types());
44204
44204
  function default_1(fork) {
44205
- var types14 = fork.use(types_1.default);
44206
- var Type = types14.Type;
44207
- var builtin = types14.builtInTypes;
44205
+ var types16 = fork.use(types_1.default);
44206
+ var Type = types16.Type;
44207
+ var builtin = types16.builtInTypes;
44208
44208
  var isNumber = builtin.number;
44209
44209
  function geq(than) {
44210
44210
  return Type.from(function(value) {
@@ -44354,9 +44354,9 @@ var require_types = __commonJS({
44354
44354
  }(BaseType);
44355
44355
  var OrType = function(_super) {
44356
44356
  tslib_1.__extends(OrType2, _super);
44357
- function OrType2(types14) {
44357
+ function OrType2(types16) {
44358
44358
  var _this = _super.call(this) || this;
44359
- _this.types = types14;
44359
+ _this.types = types16;
44360
44360
  _this.kind = "OrType";
44361
44361
  return _this;
44362
44362
  }
@@ -44497,11 +44497,11 @@ var require_types = __commonJS({
44497
44497
  function typesPlugin(_fork) {
44498
44498
  var Type = {
44499
44499
  or: function() {
44500
- var types14 = [];
44500
+ var types16 = [];
44501
44501
  for (var _i = 0; _i < arguments.length; _i++) {
44502
- types14[_i] = arguments[_i];
44502
+ types16[_i] = arguments[_i];
44503
44503
  }
44504
- return new OrType(types14.map(function(type) {
44504
+ return new OrType(types16.map(function(type) {
44505
44505
  return Type.from(type);
44506
44506
  }));
44507
44507
  },
@@ -44946,9 +44946,9 @@ var require_path2 = __commonJS({
44946
44946
  var Op = Object.prototype;
44947
44947
  var hasOwn = Op.hasOwnProperty;
44948
44948
  function pathPlugin(fork) {
44949
- var types14 = fork.use(types_1.default);
44950
- var isArray = types14.builtInTypes.array;
44951
- var isNumber = types14.builtInTypes.number;
44949
+ var types16 = fork.use(types_1.default);
44950
+ var isArray = types16.builtInTypes.array;
44951
+ var isNumber = types16.builtInTypes.number;
44952
44952
  var Path = function Path2(value, parentPath, name2) {
44953
44953
  if (!(this instanceof Path2)) {
44954
44954
  throw new Error("Path constructor cannot be invoked without 'new'");
@@ -45250,13 +45250,13 @@ var require_scope = __commonJS({
45250
45250
  var types_1 = tslib_1.__importDefault(require_types());
45251
45251
  var hasOwn = Object.prototype.hasOwnProperty;
45252
45252
  function scopePlugin(fork) {
45253
- var types14 = fork.use(types_1.default);
45254
- var Type = types14.Type;
45255
- var namedTypes = types14.namedTypes;
45253
+ var types16 = fork.use(types_1.default);
45254
+ var Type = types16.Type;
45255
+ var namedTypes = types16.namedTypes;
45256
45256
  var Node = namedTypes.Node;
45257
45257
  var Expression = namedTypes.Expression;
45258
- var isArray = types14.builtInTypes.array;
45259
- var b = types14.builders;
45258
+ var isArray = types16.builtInTypes.array;
45259
+ var b = types16.builders;
45260
45260
  var Scope = function Scope2(path2, parentScope) {
45261
45261
  if (!(this instanceof Scope2)) {
45262
45262
  throw new Error("Scope constructor cannot be invoked without 'new'");
@@ -45319,7 +45319,7 @@ var require_scope = __commonJS({
45319
45319
  ++index;
45320
45320
  }
45321
45321
  var name2 = prefix + index;
45322
- return this.bindings[name2] = types14.builders.identifier(name2);
45322
+ return this.bindings[name2] = types16.builders.identifier(name2);
45323
45323
  };
45324
45324
  Sp.injectTemporary = function(identifier, init2) {
45325
45325
  identifier || (identifier = this.declareTemporary());
@@ -45395,7 +45395,7 @@ var require_scope = __commonJS({
45395
45395
  bindings
45396
45396
  );
45397
45397
  } else if (Node.check(node) && !Expression.check(node)) {
45398
- types14.eachField(node, function(name2, child) {
45398
+ types16.eachField(node, function(name2, child) {
45399
45399
  var childPath = path2.get(name2);
45400
45400
  if (!pathHasValue(childPath, child)) {
45401
45401
  throw new Error("");
@@ -45473,24 +45473,24 @@ var require_scope = __commonJS({
45473
45473
  addPattern(patternPath.get("argument"), bindings);
45474
45474
  }
45475
45475
  }
45476
- function addTypePattern(patternPath, types15) {
45476
+ function addTypePattern(patternPath, types17) {
45477
45477
  var pattern = patternPath.value;
45478
45478
  namedTypes.Pattern.assert(pattern);
45479
45479
  if (namedTypes.Identifier.check(pattern)) {
45480
- if (hasOwn.call(types15, pattern.name)) {
45481
- types15[pattern.name].push(patternPath);
45480
+ if (hasOwn.call(types17, pattern.name)) {
45481
+ types17[pattern.name].push(patternPath);
45482
45482
  } else {
45483
- types15[pattern.name] = [patternPath];
45483
+ types17[pattern.name] = [patternPath];
45484
45484
  }
45485
45485
  }
45486
45486
  }
45487
- function addTypeParameter(parameterPath, types15) {
45487
+ function addTypeParameter(parameterPath, types17) {
45488
45488
  var parameter = parameterPath.value;
45489
45489
  FlowOrTSTypeParameterType.assert(parameter);
45490
- if (hasOwn.call(types15, parameter.name)) {
45491
- types15[parameter.name].push(parameterPath);
45490
+ if (hasOwn.call(types17, parameter.name)) {
45491
+ types17[parameter.name].push(parameterPath);
45492
45492
  } else {
45493
- types15[parameter.name] = [parameterPath];
45493
+ types17[parameter.name] = [parameterPath];
45494
45494
  }
45495
45495
  }
45496
45496
  Sp.lookup = function(name2) {
@@ -45531,11 +45531,11 @@ var require_node_path = __commonJS({
45531
45531
  var scope_1 = tslib_1.__importDefault(require_scope());
45532
45532
  var shared_1 = require_shared();
45533
45533
  function nodePathPlugin(fork) {
45534
- var types14 = fork.use(types_1.default);
45535
- var n = types14.namedTypes;
45536
- var b = types14.builders;
45537
- var isNumber = types14.builtInTypes.number;
45538
- var isArray = types14.builtInTypes.array;
45534
+ var types16 = fork.use(types_1.default);
45535
+ var n = types16.namedTypes;
45536
+ var b = types16.builders;
45537
+ var isNumber = types16.builtInTypes.number;
45538
+ var isArray = types16.builtInTypes.array;
45539
45539
  var Path = fork.use(path_1.default);
45540
45540
  var Scope = fork.use(scope_1.default);
45541
45541
  var NodePath = function NodePath2(value, parentPath, name2) {
@@ -45626,7 +45626,7 @@ var require_node_path = __commonJS({
45626
45626
  return scope || null;
45627
45627
  };
45628
45628
  NPp.getValueProperty = function(name2) {
45629
- return types14.getFieldValue(this.value, name2);
45629
+ return types16.getFieldValue(this.value, name2);
45630
45630
  };
45631
45631
  NPp.needsParens = function(assumeExpressionContext) {
45632
45632
  var pp = this.parentPath;
@@ -45768,7 +45768,7 @@ var require_node_path = __commonJS({
45768
45768
  return node.some(containsCallExpression);
45769
45769
  }
45770
45770
  if (n.Node.check(node)) {
45771
- return types14.someField(node, function(_name, child) {
45771
+ return types16.someField(node, function(_name, child) {
45772
45772
  return containsCallExpression(child);
45773
45773
  });
45774
45774
  }
@@ -45889,11 +45889,11 @@ var require_path_visitor = __commonJS({
45889
45889
  var shared_1 = require_shared();
45890
45890
  var hasOwn = Object.prototype.hasOwnProperty;
45891
45891
  function pathVisitorPlugin(fork) {
45892
- var types14 = fork.use(types_1.default);
45892
+ var types16 = fork.use(types_1.default);
45893
45893
  var NodePath = fork.use(node_path_1.default);
45894
- var isArray = types14.builtInTypes.array;
45895
- var isObject2 = types14.builtInTypes.object;
45896
- var isFunction = types14.builtInTypes.function;
45894
+ var isArray = types16.builtInTypes.array;
45895
+ var isObject2 = types16.builtInTypes.object;
45896
+ var isFunction = types16.builtInTypes.function;
45897
45897
  var undefined2;
45898
45898
  var PathVisitor = function PathVisitor2() {
45899
45899
  if (!(this instanceof PathVisitor2)) {
@@ -45913,7 +45913,7 @@ var require_path_visitor = __commonJS({
45913
45913
  typeNames[methodName.slice("visit".length)] = true;
45914
45914
  }
45915
45915
  }
45916
- var supertypeTable = types14.computeSupertypeLookupTable(typeNames);
45916
+ var supertypeTable = types16.computeSupertypeLookupTable(typeNames);
45917
45917
  var methodNameTable = /* @__PURE__ */ Object.create(null);
45918
45918
  var typeNameKeys = Object.keys(supertypeTable);
45919
45919
  var typeNameCount = typeNameKeys.length;
@@ -45955,7 +45955,7 @@ var require_path_visitor = __commonJS({
45955
45955
  }
45956
45956
  return target;
45957
45957
  }
45958
- PathVisitor.visit = function visit12(node, methods) {
45958
+ PathVisitor.visit = function visit13(node, methods) {
45959
45959
  return PathVisitor.fromMethodsObject(methods).visit(node);
45960
45960
  };
45961
45961
  var PVp = PathVisitor.prototype;
@@ -46032,7 +46032,7 @@ var require_path_visitor = __commonJS({
46032
46032
  path2.each(visitor.visitWithoutReset, visitor);
46033
46033
  } else if (!isObject2.check(value)) {
46034
46034
  } else {
46035
- var childNames = types14.getFieldNames(value);
46035
+ var childNames = types16.getFieldNames(value);
46036
46036
  if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
46037
46037
  childNames.push("comments");
46038
46038
  }
@@ -46041,7 +46041,7 @@ var require_path_visitor = __commonJS({
46041
46041
  for (var i2 = 0; i2 < childCount; ++i2) {
46042
46042
  var childName = childNames[i2];
46043
46043
  if (!hasOwn.call(value, childName)) {
46044
- value[childName] = types14.getFieldValue(value, childName);
46044
+ value[childName] = types16.getFieldValue(value, childName);
46045
46045
  }
46046
46046
  childPaths.push(path2.get(childName));
46047
46047
  }
@@ -46146,7 +46146,7 @@ var require_path_visitor = __commonJS({
46146
46146
  this.needToCallTraverse = false;
46147
46147
  return visitChildren(path2, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
46148
46148
  };
46149
- sharedContextProtoMethods.visit = function visit12(path2, newVisitor) {
46149
+ sharedContextProtoMethods.visit = function visit13(path2, newVisitor) {
46150
46150
  if (!(this instanceof this.Context)) {
46151
46151
  throw new Error("");
46152
46152
  }
@@ -46184,13 +46184,13 @@ var require_equiv = __commonJS({
46184
46184
  var shared_1 = require_shared();
46185
46185
  var types_1 = tslib_1.__importDefault(require_types());
46186
46186
  function default_1(fork) {
46187
- var types14 = fork.use(types_1.default);
46188
- var getFieldNames = types14.getFieldNames;
46189
- var getFieldValue = types14.getFieldValue;
46190
- var isArray = types14.builtInTypes.array;
46191
- var isObject2 = types14.builtInTypes.object;
46192
- var isDate = types14.builtInTypes.Date;
46193
- var isRegExp = types14.builtInTypes.RegExp;
46187
+ var types16 = fork.use(types_1.default);
46188
+ var getFieldNames = types16.getFieldNames;
46189
+ var getFieldValue = types16.getFieldValue;
46190
+ var isArray = types16.builtInTypes.array;
46191
+ var isObject2 = types16.builtInTypes.object;
46192
+ var isDate = types16.builtInTypes.Date;
46193
+ var isRegExp = types16.builtInTypes.RegExp;
46194
46194
  var hasOwn = Object.prototype.hasOwnProperty;
46195
46195
  function astNodesAreEquivalent(a, b, problemPath) {
46196
46196
  if (isArray.check(problemPath)) {
@@ -46343,24 +46343,24 @@ var require_fork = __commonJS({
46343
46343
  var shared_1 = require_shared();
46344
46344
  function default_1(plugins) {
46345
46345
  var fork = createFork();
46346
- var types14 = fork.use(types_1.default);
46346
+ var types16 = fork.use(types_1.default);
46347
46347
  plugins.forEach(fork.use);
46348
- types14.finalize();
46348
+ types16.finalize();
46349
46349
  var PathVisitor = fork.use(path_visitor_1.default);
46350
46350
  return {
46351
- Type: types14.Type,
46352
- builtInTypes: types14.builtInTypes,
46353
- namedTypes: types14.namedTypes,
46354
- builders: types14.builders,
46355
- defineMethod: types14.defineMethod,
46356
- getFieldNames: types14.getFieldNames,
46357
- getFieldValue: types14.getFieldValue,
46358
- eachField: types14.eachField,
46359
- someField: types14.someField,
46360
- getSupertypeNames: types14.getSupertypeNames,
46361
- getBuilderName: types14.getBuilderName,
46351
+ Type: types16.Type,
46352
+ builtInTypes: types16.builtInTypes,
46353
+ namedTypes: types16.namedTypes,
46354
+ builders: types16.builders,
46355
+ defineMethod: types16.defineMethod,
46356
+ getFieldNames: types16.getFieldNames,
46357
+ getFieldValue: types16.getFieldValue,
46358
+ eachField: types16.eachField,
46359
+ someField: types16.someField,
46360
+ getSupertypeNames: types16.getSupertypeNames,
46361
+ getBuilderName: types16.getBuilderName,
46362
46362
  astNodesAreEquivalent: fork.use(equiv_1.default),
46363
- finalize: types14.finalize,
46363
+ finalize: types16.finalize,
46364
46364
  Path: fork.use(path_1.default),
46365
46365
  NodePath: fork.use(node_path_1.default),
46366
46366
  PathVisitor,
@@ -46530,8 +46530,8 @@ var require_core2 = __commonJS({
46530
46530
  var types_1 = tslib_1.__importDefault(require_types());
46531
46531
  var shared_1 = tslib_1.__importStar(require_shared());
46532
46532
  function default_1(fork) {
46533
- var types14 = fork.use(types_1.default);
46534
- var Type = types14.Type;
46533
+ var types16 = fork.use(types_1.default);
46534
+ var Type = types16.Type;
46535
46535
  var def = Type.def;
46536
46536
  var or = Type.or;
46537
46537
  var shared = fork.use(shared_1.default);
@@ -46623,9 +46623,9 @@ var require_es6 = __commonJS({
46623
46623
  var shared_1 = tslib_1.__importStar(require_shared());
46624
46624
  function default_1(fork) {
46625
46625
  fork.use(core_1.default);
46626
- var types14 = fork.use(types_1.default);
46627
- var def = types14.Type.def;
46628
- var or = types14.Type.or;
46626
+ var types16 = fork.use(types_1.default);
46627
+ var def = types16.Type.def;
46628
+ var or = types16.Type.or;
46629
46629
  var defaults = fork.use(shared_1.default).defaults;
46630
46630
  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"]);
46631
46631
  def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
@@ -46715,8 +46715,8 @@ var require_es2017 = __commonJS({
46715
46715
  var shared_1 = tslib_1.__importStar(require_shared());
46716
46716
  function default_1(fork) {
46717
46717
  fork.use(es2016_1.default);
46718
- var types14 = fork.use(types_1.default);
46719
- var def = types14.Type.def;
46718
+ var types16 = fork.use(types_1.default);
46719
+ var def = types16.Type.def;
46720
46720
  var defaults = fork.use(shared_1.default).defaults;
46721
46721
  def("Function").field("async", Boolean, defaults["false"]);
46722
46722
  def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
@@ -46739,9 +46739,9 @@ var require_es2018 = __commonJS({
46739
46739
  var shared_1 = tslib_1.__importStar(require_shared());
46740
46740
  function default_1(fork) {
46741
46741
  fork.use(es2017_1.default);
46742
- var types14 = fork.use(types_1.default);
46743
- var def = types14.Type.def;
46744
- var or = types14.Type.or;
46742
+ var types16 = fork.use(types_1.default);
46743
+ var def = types16.Type.def;
46744
+ var or = types16.Type.or;
46745
46745
  var defaults = fork.use(shared_1.default).defaults;
46746
46746
  def("ForOfStatement").field("await", Boolean, defaults["false"]);
46747
46747
  def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
@@ -46772,9 +46772,9 @@ var require_es2019 = __commonJS({
46772
46772
  var shared_1 = tslib_1.__importStar(require_shared());
46773
46773
  function default_1(fork) {
46774
46774
  fork.use(es2018_1.default);
46775
- var types14 = fork.use(types_1.default);
46776
- var def = types14.Type.def;
46777
- var or = types14.Type.or;
46775
+ var types16 = fork.use(types_1.default);
46776
+ var def = types16.Type.def;
46777
+ var or = types16.Type.or;
46778
46778
  var defaults = fork.use(shared_1.default).defaults;
46779
46779
  def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
46780
46780
  }
@@ -46798,9 +46798,9 @@ var require_es20202 = __commonJS({
46798
46798
  function default_1(fork) {
46799
46799
  fork.use(es2020_1.default);
46800
46800
  fork.use(es2019_1.default);
46801
- var types14 = fork.use(types_1.default);
46802
- var def = types14.Type.def;
46803
- var or = types14.Type.or;
46801
+ var types16 = fork.use(types_1.default);
46802
+ var def = types16.Type.def;
46803
+ var or = types16.Type.or;
46804
46804
  var shared = fork.use(shared_1.default);
46805
46805
  var defaults = shared.defaults;
46806
46806
  def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
@@ -46850,8 +46850,8 @@ var require_es2022 = __commonJS({
46850
46850
  var shared_1 = require_shared();
46851
46851
  function default_1(fork) {
46852
46852
  fork.use(es2021_1.default);
46853
- var types14 = fork.use(types_1.default);
46854
- var def = types14.Type.def;
46853
+ var types16 = fork.use(types_1.default);
46854
+ var def = types16.Type.def;
46855
46855
  def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
46856
46856
  }
46857
46857
  exports.default = default_1;
@@ -46872,9 +46872,9 @@ var require_es_proposals = __commonJS({
46872
46872
  var es2022_1 = tslib_1.__importDefault(require_es2022());
46873
46873
  function default_1(fork) {
46874
46874
  fork.use(es2022_1.default);
46875
- var types14 = fork.use(types_1.default);
46876
- var Type = types14.Type;
46877
- var def = types14.Type.def;
46875
+ var types16 = fork.use(types_1.default);
46876
+ var Type = types16.Type;
46877
+ var def = types16.Type.def;
46878
46878
  var or = Type.or;
46879
46879
  var shared = fork.use(shared_1.default);
46880
46880
  var defaults = shared.defaults;
@@ -46914,9 +46914,9 @@ var require_jsx = __commonJS({
46914
46914
  var shared_1 = tslib_1.__importStar(require_shared());
46915
46915
  function default_1(fork) {
46916
46916
  fork.use(es_proposals_1.default);
46917
- var types14 = fork.use(types_1.default);
46918
- var def = types14.Type.def;
46919
- var or = types14.Type.or;
46917
+ var types16 = fork.use(types_1.default);
46918
+ var def = types16.Type.def;
46919
+ var or = types16.Type.or;
46920
46920
  var defaults = fork.use(shared_1.default).defaults;
46921
46921
  def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
46922
46922
  def("Literal"),
@@ -46974,9 +46974,9 @@ var require_type_annotations = __commonJS({
46974
46974
  var types_1 = tslib_1.__importDefault(require_types());
46975
46975
  var shared_1 = tslib_1.__importStar(require_shared());
46976
46976
  function default_1(fork) {
46977
- var types14 = fork.use(types_1.default);
46978
- var def = types14.Type.def;
46979
- var or = types14.Type.or;
46977
+ var types16 = fork.use(types_1.default);
46978
+ var def = types16.Type.def;
46979
+ var or = types16.Type.or;
46980
46980
  var defaults = fork.use(shared_1.default).defaults;
46981
46981
  var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
46982
46982
  var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
@@ -47011,9 +47011,9 @@ var require_flow = __commonJS({
47011
47011
  function default_1(fork) {
47012
47012
  fork.use(es_proposals_1.default);
47013
47013
  fork.use(type_annotations_1.default);
47014
- var types14 = fork.use(types_1.default);
47015
- var def = types14.Type.def;
47016
- var or = types14.Type.or;
47014
+ var types16 = fork.use(types_1.default);
47015
+ var def = types16.Type.def;
47016
+ var or = types16.Type.or;
47017
47017
  var defaults = fork.use(shared_1.default).defaults;
47018
47018
  def("Flow").bases("Node");
47019
47019
  def("FlowType").bases("Flow");
@@ -47127,10 +47127,10 @@ var require_esprima = __commonJS({
47127
47127
  var shared_1 = tslib_1.__importStar(require_shared());
47128
47128
  function default_1(fork) {
47129
47129
  fork.use(es_proposals_1.default);
47130
- var types14 = fork.use(types_1.default);
47130
+ var types16 = fork.use(types_1.default);
47131
47131
  var defaults = fork.use(shared_1.default).defaults;
47132
- var def = types14.Type.def;
47133
- var or = types14.Type.or;
47132
+ var def = types16.Type.def;
47133
+ var or = types16.Type.or;
47134
47134
  def("VariableDeclaration").field("declarations", [or(
47135
47135
  def("VariableDeclarator"),
47136
47136
  def("Identifier")
@@ -47175,11 +47175,11 @@ var require_babel_core = __commonJS({
47175
47175
  function default_1(fork) {
47176
47176
  var _a, _b, _c, _d, _e;
47177
47177
  fork.use(es_proposals_1.default);
47178
- var types14 = fork.use(types_1.default);
47178
+ var types16 = fork.use(types_1.default);
47179
47179
  var defaults = fork.use(shared_1.default).defaults;
47180
- var def = types14.Type.def;
47181
- var or = types14.Type.or;
47182
- var isUndefined = types14.builtInTypes.undefined;
47180
+ var def = types16.Type.def;
47181
+ var or = types16.Type.or;
47182
+ var isUndefined = types16.builtInTypes.undefined;
47183
47183
  def("Noop").bases("Statement").build();
47184
47184
  def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
47185
47185
  def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
@@ -47204,7 +47204,7 @@ var require_babel_core = __commonJS({
47204
47204
  raw: String
47205
47205
  },
47206
47206
  function getDefault() {
47207
- var value = types14.getFieldValue(this, "value");
47207
+ var value = types16.getFieldValue(this, "value");
47208
47208
  return {
47209
47209
  rawValue: value,
47210
47210
  raw: toRaw ? toRaw(value) : String(value)
@@ -47307,8 +47307,8 @@ var require_babel = __commonJS({
47307
47307
  var flow_1 = tslib_1.__importDefault(require_flow());
47308
47308
  var shared_1 = require_shared();
47309
47309
  function default_1(fork) {
47310
- var types14 = fork.use(types_1.default);
47311
- var def = types14.Type.def;
47310
+ var types16 = fork.use(types_1.default);
47311
+ var def = types16.Type.def;
47312
47312
  fork.use(babel_core_1.default);
47313
47313
  fork.use(flow_1.default);
47314
47314
  def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
@@ -47334,12 +47334,12 @@ var require_typescript = __commonJS({
47334
47334
  function default_1(fork) {
47335
47335
  fork.use(babel_core_1.default);
47336
47336
  fork.use(type_annotations_1.default);
47337
- var types14 = fork.use(types_1.default);
47338
- var n = types14.namedTypes;
47339
- var def = types14.Type.def;
47340
- var or = types14.Type.or;
47337
+ var types16 = fork.use(types_1.default);
47338
+ var n = types16.namedTypes;
47339
+ var def = types16.Type.def;
47340
+ var or = types16.Type.or;
47341
47341
  var defaults = fork.use(shared_1.default).defaults;
47342
- var StringLiteral = types14.Type.from(function(value, deep) {
47342
+ var StringLiteral = types16.Type.from(function(value, deep) {
47343
47343
  if (n.StringLiteral && n.StringLiteral.check(value, deep)) {
47344
47344
  return true;
47345
47345
  }
@@ -47539,7 +47539,7 @@ var require_main = __commonJS({
47539
47539
  var someField = _a.someField;
47540
47540
  var Type = _a.Type;
47541
47541
  var use = _a.use;
47542
- var visit12 = _a.visit;
47542
+ var visit13 = _a.visit;
47543
47543
  exports.astNodesAreEquivalent = astNodesAreEquivalent;
47544
47544
  exports.builders = builders;
47545
47545
  exports.builtInTypes = builtInTypes;
@@ -47556,7 +47556,7 @@ var require_main = __commonJS({
47556
47556
  exports.someField = someField;
47557
47557
  exports.Type = Type;
47558
47558
  exports.use = use;
47559
- exports.visit = visit12;
47559
+ exports.visit = visit13;
47560
47560
  Object.assign(namedTypes_1.namedTypes, n);
47561
47561
  }
47562
47562
  });
@@ -49315,8 +49315,8 @@ var require_util2 = __commonJS({
49315
49315
  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;
49316
49316
  var tslib_1 = require_tslib();
49317
49317
  var assert_1 = tslib_1.__importDefault(require("assert"));
49318
- var types14 = tslib_1.__importStar(require_main());
49319
- var n = types14.namedTypes;
49318
+ var types16 = tslib_1.__importStar(require_main());
49319
+ var n = types16.namedTypes;
49320
49320
  var source_map_1 = tslib_1.__importDefault(require_source_map());
49321
49321
  var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
49322
49322
  var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
@@ -56634,10 +56634,10 @@ var require_comments = __commonJS({
56634
56634
  exports.printComments = exports.attach = void 0;
56635
56635
  var tslib_1 = require_tslib();
56636
56636
  var assert_1 = tslib_1.__importDefault(require("assert"));
56637
- var types14 = tslib_1.__importStar(require_main());
56638
- var n = types14.namedTypes;
56639
- var isArray = types14.builtInTypes.array;
56640
- var isObject2 = types14.builtInTypes.object;
56637
+ var types16 = tslib_1.__importStar(require_main());
56638
+ var n = types16.namedTypes;
56639
+ var isArray = types16.builtInTypes.array;
56640
+ var isObject2 = types16.builtInTypes.object;
56641
56641
  var lines_1 = require_lines();
56642
56642
  var util_1 = require_util2();
56643
56643
  var childNodesCache = /* @__PURE__ */ new WeakMap();
@@ -56668,7 +56668,7 @@ var require_comments = __commonJS({
56668
56668
  if (isArray.check(node)) {
56669
56669
  names = Object.keys(node);
56670
56670
  } else if (isObject2.check(node)) {
56671
- names = types14.getFieldNames(node);
56671
+ names = types16.getFieldNames(node);
56672
56672
  } else {
56673
56673
  return resultArray;
56674
56674
  }
@@ -56846,7 +56846,7 @@ var require_comments = __commonJS({
56846
56846
  function printComments(path2, print12) {
56847
56847
  var value = path2.getValue();
56848
56848
  var innerLines = print12(path2);
56849
- var comments = n.Node.check(value) && types14.getFieldValue(value, "comments");
56849
+ var comments = n.Node.check(value) && types16.getFieldValue(value, "comments");
56850
56850
  if (!comments || comments.length === 0) {
56851
56851
  return innerLines;
56852
56852
  }
@@ -56854,8 +56854,8 @@ var require_comments = __commonJS({
56854
56854
  var trailingParts = [innerLines];
56855
56855
  path2.each(function(commentPath) {
56856
56856
  var comment = commentPath.getValue();
56857
- var leading = types14.getFieldValue(comment, "leading");
56858
- var trailing = types14.getFieldValue(comment, "trailing");
56857
+ var leading = types16.getFieldValue(comment, "leading");
56858
+ var trailing = types16.getFieldValue(comment, "trailing");
56859
56859
  if (leading || trailing && !(n.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
56860
56860
  leadingParts.push(printLeadingComment(commentPath, print12));
56861
56861
  } else if (trailing) {
@@ -56877,10 +56877,10 @@ var require_parser2 = __commonJS({
56877
56877
  exports.parse = void 0;
56878
56878
  var tslib_1 = require_tslib();
56879
56879
  var assert_1 = tslib_1.__importDefault(require("assert"));
56880
- var types14 = tslib_1.__importStar(require_main());
56881
- var b = types14.builders;
56882
- var isObject2 = types14.builtInTypes.object;
56883
- var isArray = types14.builtInTypes.array;
56880
+ var types16 = tslib_1.__importStar(require_main());
56881
+ var b = types16.builders;
56882
+ var isObject2 = types16.builtInTypes.object;
56883
+ var isArray = types16.builtInTypes.array;
56884
56884
  var options_1 = require_options();
56885
56885
  var lines_1 = require_lines();
56886
56886
  var comments_1 = require_comments();
@@ -57066,11 +57066,11 @@ var require_fast_path = __commonJS({
57066
57066
  Object.defineProperty(exports, "__esModule", { value: true });
57067
57067
  var tslib_1 = require_tslib();
57068
57068
  var assert_1 = tslib_1.__importDefault(require("assert"));
57069
- var types14 = tslib_1.__importStar(require_main());
57069
+ var types16 = tslib_1.__importStar(require_main());
57070
57070
  var util = tslib_1.__importStar(require_util2());
57071
- var n = types14.namedTypes;
57072
- var isArray = types14.builtInTypes.array;
57073
- var isNumber = types14.builtInTypes.number;
57071
+ var n = types16.namedTypes;
57072
+ var isArray = types16.builtInTypes.array;
57073
+ var isNumber = types16.builtInTypes.number;
57074
57074
  var PRECEDENCE = {};
57075
57075
  [
57076
57076
  ["??"],
@@ -57099,7 +57099,7 @@ var require_fast_path = __commonJS({
57099
57099
  if (obj instanceof FastPath) {
57100
57100
  return obj.copy();
57101
57101
  }
57102
- if (obj instanceof types14.NodePath) {
57102
+ if (obj instanceof types16.NodePath) {
57103
57103
  var copy = Object.create(FastPath.prototype);
57104
57104
  var stack = [obj.value];
57105
57105
  for (var pp = void 0; pp = obj.parentPath; obj = pp)
@@ -57410,7 +57410,7 @@ var require_fast_path = __commonJS({
57410
57410
  return node.some(containsCallExpression);
57411
57411
  }
57412
57412
  if (n.Node.check(node)) {
57413
- return types14.someField(node, function(_name, child) {
57413
+ return types16.someField(node, function(_name, child) {
57414
57414
  return containsCallExpression(child);
57415
57415
  });
57416
57416
  }
@@ -57500,16 +57500,16 @@ var require_patcher = __commonJS({
57500
57500
  var tslib_1 = require_tslib();
57501
57501
  var assert_1 = tslib_1.__importDefault(require("assert"));
57502
57502
  var linesModule = tslib_1.__importStar(require_lines());
57503
- var types14 = tslib_1.__importStar(require_main());
57504
- var Printable = types14.namedTypes.Printable;
57505
- var Expression = types14.namedTypes.Expression;
57506
- var ReturnStatement = types14.namedTypes.ReturnStatement;
57507
- var SourceLocation = types14.namedTypes.SourceLocation;
57503
+ var types16 = tslib_1.__importStar(require_main());
57504
+ var Printable = types16.namedTypes.Printable;
57505
+ var Expression = types16.namedTypes.Expression;
57506
+ var ReturnStatement = types16.namedTypes.ReturnStatement;
57507
+ var SourceLocation = types16.namedTypes.SourceLocation;
57508
57508
  var util_1 = require_util2();
57509
57509
  var fast_path_1 = tslib_1.__importDefault(require_fast_path());
57510
- var isObject2 = types14.builtInTypes.object;
57511
- var isArray = types14.builtInTypes.array;
57512
- var isString = types14.builtInTypes.string;
57510
+ var isObject2 = types16.builtInTypes.object;
57511
+ var isArray = types16.builtInTypes.array;
57512
+ var isString = types16.builtInTypes.string;
57513
57513
  var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
57514
57514
  var Patcher = function Patcher2(lines) {
57515
57515
  assert_1.default.ok(this instanceof Patcher2);
@@ -57779,8 +57779,8 @@ var require_patcher = __commonJS({
57779
57779
  if (k.charAt(0) === "_") {
57780
57780
  continue;
57781
57781
  }
57782
- newPath.stack.push(k, types14.getFieldValue(newNode, k));
57783
- oldPath.stack.push(k, types14.getFieldValue(oldNode, k));
57782
+ newPath.stack.push(k, types16.getFieldValue(newNode, k));
57783
+ oldPath.stack.push(k, types16.getFieldValue(oldNode, k));
57784
57784
  var canReprint = findAnyReprints(newPath, oldPath, reprints);
57785
57785
  newPath.stack.length -= 2;
57786
57786
  oldPath.stack.length -= 2;
@@ -57804,16 +57804,16 @@ var require_printer2 = __commonJS({
57804
57804
  exports.Printer = void 0;
57805
57805
  var tslib_1 = require_tslib();
57806
57806
  var assert_1 = tslib_1.__importDefault(require("assert"));
57807
- var types14 = tslib_1.__importStar(require_main());
57807
+ var types16 = tslib_1.__importStar(require_main());
57808
57808
  var comments_1 = require_comments();
57809
57809
  var fast_path_1 = tslib_1.__importDefault(require_fast_path());
57810
57810
  var lines_1 = require_lines();
57811
57811
  var options_1 = require_options();
57812
57812
  var patcher_1 = require_patcher();
57813
57813
  var util = tslib_1.__importStar(require_util2());
57814
- var namedTypes = types14.namedTypes;
57815
- var isString = types14.builtInTypes.string;
57816
- var isObject2 = types14.builtInTypes.object;
57814
+ var namedTypes = types16.namedTypes;
57815
+ var isString = types16.builtInTypes.string;
57816
+ var isObject2 = types16.builtInTypes.object;
57817
57817
  var PrintResult = function PrintResult2(code, sourceMap) {
57818
57818
  assert_1.default.ok(this instanceof PrintResult2);
57819
57819
  isString.assert(code);
@@ -57975,7 +57975,7 @@ var require_printer2 = __commonJS({
57975
57975
  case "OptionalMemberExpression": {
57976
57976
  parts.push(path2.call(print12, "object"));
57977
57977
  var property = path2.call(print12, "property");
57978
- var optional = types14.getFieldValue(n, "optional");
57978
+ var optional = types16.getFieldValue(n, "optional");
57979
57979
  if (n.computed) {
57980
57980
  parts.push(optional ? "?.[" : "[", property, "]");
57981
57981
  } else {
@@ -58246,7 +58246,7 @@ var require_printer2 = __commonJS({
58246
58246
  if (n.typeArguments) {
58247
58247
  parts.push(path2.call(print12, "typeArguments"));
58248
58248
  }
58249
- if (types14.getFieldValue(n, "optional")) {
58249
+ if (types16.getFieldValue(n, "optional")) {
58250
58250
  parts.push("?.");
58251
58251
  }
58252
58252
  parts.push(printArgumentsList(path2, options, print12));
@@ -59925,8 +59925,8 @@ var require_printer2 = __commonJS({
59925
59925
  });
59926
59926
  }
59927
59927
  function getPossibleRaw(node) {
59928
- var value = types14.getFieldValue(node, "value");
59929
- var extra = types14.getFieldValue(node, "extra");
59928
+ var value = types16.getFieldValue(node, "value");
59929
+ var extra = types16.getFieldValue(node, "extra");
59930
59930
  if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
59931
59931
  return extra.raw;
59932
59932
  }
@@ -59974,8 +59974,8 @@ var require_main2 = __commonJS({
59974
59974
  exports.run = exports.prettyPrint = exports.print = exports.visit = exports.types = exports.parse = void 0;
59975
59975
  var tslib_1 = require_tslib();
59976
59976
  var fs_1 = tslib_1.__importDefault(require("fs"));
59977
- var types14 = tslib_1.__importStar(require_main());
59978
- exports.types = types14;
59977
+ var types16 = tslib_1.__importStar(require_main());
59978
+ exports.types = types16;
59979
59979
  var parser_1 = require_parser2();
59980
59980
  Object.defineProperty(exports, "parse", { enumerable: true, get: function() {
59981
59981
  return parser_1.parse;
@@ -59989,10 +59989,10 @@ var require_main2 = __commonJS({
59989
59989
  return new printer_1.Printer(options).print(node);
59990
59990
  }
59991
59991
  exports.print = print12;
59992
- function prettyPrint(node, options) {
59992
+ function prettyPrint3(node, options) {
59993
59993
  return new printer_1.Printer(options).printGenerically(node);
59994
59994
  }
59995
- exports.prettyPrint = prettyPrint;
59995
+ exports.prettyPrint = prettyPrint3;
59996
59996
  function run(transformer, options) {
59997
59997
  return runFile(process.argv[2], transformer, options);
59998
59998
  }
@@ -65948,7 +65948,7 @@ var printDocASTReducer = {
65948
65948
  leave: ({ name: name2, interfaces, directives, fields }) => join(["interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
65949
65949
  },
65950
65950
  UnionTypeDefinition: {
65951
- leave: ({ name: name2, directives, types: types14 }) => join(["union", name2, join(directives, " "), wrap("= ", join(types14, " | "))], " ")
65951
+ leave: ({ name: name2, directives, types: types16 }) => join(["union", name2, join(directives, " "), wrap("= ", join(types16, " | "))], " ")
65952
65952
  },
65953
65953
  EnumTypeDefinition: {
65954
65954
  leave: ({ name: name2, directives, values }) => join(["enum", name2, join(directives, " "), block(values)], " ")
@@ -65975,7 +65975,7 @@ var printDocASTReducer = {
65975
65975
  leave: ({ name: name2, interfaces, directives, fields }) => join(["extend interface", name2, wrap("implements ", join(interfaces, " & ")), join(directives, " "), block(fields)], " ")
65976
65976
  },
65977
65977
  UnionTypeExtension: {
65978
- leave: ({ name: name2, directives, types: types14 }) => join(["extend union", name2, join(directives, " "), wrap("= ", join(types14, " | "))], " ")
65978
+ leave: ({ name: name2, directives, types: types16 }) => join(["extend union", name2, join(directives, " "), wrap("= ", join(types16, " | "))], " ")
65979
65979
  },
65980
65980
  EnumTypeExtension: {
65981
65981
  leave: ({ name: name2, directives, values }) => join(["extend enum", name2, join(directives, " "), block(values)], " ")
@@ -66855,8 +66855,8 @@ function healTypes(originalTypeMap, directives) {
66855
66855
  }
66856
66856
  }
66857
66857
  function healUnderlyingTypes(type) {
66858
- const types14 = type.getTypes();
66859
- types14.push(...types14.splice(0).map((t2) => healType(t2)).filter(Boolean));
66858
+ const types16 = type.getTypes();
66859
+ types16.push(...types16.splice(0).map((t2) => healType(t2)).filter(Boolean));
66860
66860
  }
66861
66861
  function healType(type) {
66862
66862
  if ((0, import_graphql11.isListType)(type)) {
@@ -67640,11 +67640,11 @@ function mergeEnum(e1, e2, config2) {
67640
67640
 
67641
67641
  // ../../node_modules/.pnpm/@graphql-tools+merge@8.3.14_graphql@15.8.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
67642
67642
  var import_graphql20 = __toESM(require_graphql2(), 1);
67643
- function isStringTypes(types14) {
67644
- return typeof types14 === "string";
67643
+ function isStringTypes(types16) {
67644
+ return typeof types16 === "string";
67645
67645
  }
67646
- function isSourceTypes(types14) {
67647
- return types14 instanceof import_graphql20.Source;
67646
+ function isSourceTypes(types16) {
67647
+ return types16 instanceof import_graphql20.Source;
67648
67648
  }
67649
67649
  function extractType(type) {
67650
67650
  let visitedType = type;
@@ -68670,8 +68670,8 @@ var List = class {
68670
68670
  } else {
68671
68671
  entries = this.cache._internal_unstable.storage.get(value, "edges").value;
68672
68672
  }
68673
- for (let record of entries) {
68674
- yield record;
68673
+ for (let record2 of entries) {
68674
+ yield record2;
68675
68675
  }
68676
68676
  }
68677
68677
  };
@@ -68720,6 +68720,46 @@ var ListCollection = class {
68720
68720
  }
68721
68721
  };
68722
68722
 
68723
+ // src/runtime/cache/schema.ts
68724
+ var SchemaManager = class {
68725
+ cache;
68726
+ fieldTypes = {};
68727
+ constructor(cache) {
68728
+ this.cache = cache;
68729
+ }
68730
+ setFieldType({
68731
+ parent,
68732
+ key,
68733
+ type,
68734
+ nullable = false,
68735
+ link
68736
+ }) {
68737
+ let parensIndex = key.indexOf("(");
68738
+ if (parensIndex !== -1) {
68739
+ key = key.substring(0, parensIndex);
68740
+ }
68741
+ if (parent === rootID) {
68742
+ parent = "Query";
68743
+ } else if (parent.includes(":")) {
68744
+ parent = parent.substring(0, parent.indexOf(":"));
68745
+ }
68746
+ if (!this.fieldTypes[parent]) {
68747
+ this.fieldTypes[parent] = {};
68748
+ }
68749
+ this.fieldTypes[parent][key] = {
68750
+ type,
68751
+ nullable,
68752
+ link: !!link
68753
+ };
68754
+ }
68755
+ fieldType(type, field) {
68756
+ return this.fieldTypes[type]?.[field] || null;
68757
+ }
68758
+ get config() {
68759
+ return this.cache._internal_unstable.config;
68760
+ }
68761
+ };
68762
+
68723
68763
  // src/runtime/cache/storage.ts
68724
68764
  var InMemoryStorage = class {
68725
68765
  data;
@@ -69287,7 +69327,7 @@ var InMemorySubscriptions = class {
69287
69327
  };
69288
69328
 
69289
69329
  // src/runtime/cache/cache.ts
69290
- var Cache2 = class {
69330
+ var Cache3 = class {
69291
69331
  _internal_unstable;
69292
69332
  constructor(config2) {
69293
69333
  this._internal_unstable = new CacheInternal({
@@ -69295,7 +69335,8 @@ var Cache2 = class {
69295
69335
  storage: new InMemoryStorage(),
69296
69336
  subscriptions: new InMemorySubscriptions(this),
69297
69337
  lists: new ListManager(this, rootID),
69298
- lifetimes: new GarbageCollector(this)
69338
+ lifetimes: new GarbageCollector(this),
69339
+ schema: new SchemaManager(this)
69299
69340
  });
69300
69341
  if (config2) {
69301
69342
  this.setConfig(defaultConfigValues(config2));
@@ -69381,18 +69422,21 @@ var CacheInternal = class {
69381
69422
  lists;
69382
69423
  cache;
69383
69424
  lifetimes;
69425
+ schema;
69384
69426
  constructor({
69385
69427
  storage,
69386
69428
  subscriptions,
69387
69429
  lists,
69388
69430
  cache,
69389
- lifetimes
69431
+ lifetimes,
69432
+ schema
69390
69433
  }) {
69391
69434
  this.storage = storage;
69392
69435
  this.subscriptions = subscriptions;
69393
69436
  this.lists = lists;
69394
69437
  this.cache = cache;
69395
69438
  this.lifetimes = lifetimes;
69439
+ this.schema = schema;
69396
69440
  this._disabled = typeof globalThis.window === "undefined";
69397
69441
  try {
69398
69442
  if (process.env.HOUDINI_TEST === "true") {
@@ -69408,7 +69452,6 @@ var CacheInternal = class {
69408
69452
  data,
69409
69453
  selection: selection2,
69410
69454
  variables = {},
69411
- root = rootID,
69412
69455
  parent = rootID,
69413
69456
  applyUpdates = false,
69414
69457
  layer,
@@ -69431,9 +69474,17 @@ var CacheInternal = class {
69431
69474
  selection: fieldSelection,
69432
69475
  operations,
69433
69476
  abstract: isAbstract,
69434
- update
69477
+ update,
69478
+ nullable
69435
69479
  } = targetSelection[field];
69436
69480
  const key = evaluateKey(keyRaw, variables);
69481
+ this.schema.setFieldType({
69482
+ parent,
69483
+ key: keyRaw,
69484
+ type: linkedType,
69485
+ nullable,
69486
+ link: !!fieldSelection
69487
+ });
69437
69488
  const currentSubscribers = this.subscriptions.get(parent, key);
69438
69489
  const { value: previousValue, displayLayers } = this.storage.get(parent, key);
69439
69490
  const displayLayer = layer.isDisplayLayer(displayLayers);
@@ -69502,7 +69553,6 @@ var CacheInternal = class {
69502
69553
  }
69503
69554
  if (linkedID) {
69504
69555
  this.writeSelection({
69505
- root,
69506
69556
  selection: fieldSelection,
69507
69557
  parent: linkedID,
69508
69558
  data: value,
@@ -69893,7 +69943,7 @@ var CacheInternal = class {
69893
69943
  var rootID = "_ROOT_";
69894
69944
 
69895
69945
  // src/runtime/cache/index.ts
69896
- var cache_default = new Cache2();
69946
+ var cache_default = new Cache3();
69897
69947
 
69898
69948
  // src/runtime/lib/types.ts
69899
69949
  var CompiledFragmentKind = "HoudiniFragment" /* Fragment */;
@@ -70085,6 +70135,7 @@ async function writeFile(filepath, data) {
70085
70135
  return;
70086
70136
  }
70087
70137
  if (houdini_mode.is_testing) {
70138
+ import_memfs.fs.mkdirpSync(dirname(filepath));
70088
70139
  return import_memfs.fs.writeFileSync(filepath, data);
70089
70140
  }
70090
70141
  return await import_promises.default.writeFile(filepath, data, "utf8");
@@ -71452,7 +71503,6 @@ var Config = class {
71452
71503
  rootDir;
71453
71504
  projectRoot;
71454
71505
  schema;
71455
- apiUrl;
71456
71506
  schemaPath;
71457
71507
  persistedQueryPath;
71458
71508
  exclude;
@@ -71492,7 +71542,6 @@ var Config = class {
71492
71542
  schema,
71493
71543
  schemaPath = "./schema.graphql",
71494
71544
  exclude = [],
71495
- apiUrl,
71496
71545
  module: module2 = "esm",
71497
71546
  scalars,
71498
71547
  cacheBufferSize,
@@ -71502,7 +71551,7 @@ var Config = class {
71502
71551
  defaultListPosition = "append",
71503
71552
  defaultListTarget = null,
71504
71553
  defaultKeys,
71505
- types: types14 = {},
71554
+ types: types16 = {},
71506
71555
  logLevel,
71507
71556
  defaultFragmentMasking = "enable",
71508
71557
  schemaPollInterval = 2e3,
@@ -71523,11 +71572,6 @@ var Config = class {
71523
71572
  logLevel = LogLevel.Summary;
71524
71573
  }
71525
71574
  this.schemaPath = schemaPath;
71526
- if (apiUrl && apiUrl.startsWith("env:")) {
71527
- this.apiUrl = process.env[apiUrl.slice("env:".length)];
71528
- } else {
71529
- this.apiUrl = apiUrl;
71530
- }
71531
71575
  this.filepath = filepath;
71532
71576
  this.exclude = Array.isArray(exclude) ? exclude : [exclude];
71533
71577
  this.module = module2;
@@ -71550,13 +71594,20 @@ var Config = class {
71550
71594
  if (defaultKeys) {
71551
71595
  this.defaultKeys = defaultKeys;
71552
71596
  }
71553
- if (types14) {
71597
+ if (types16) {
71554
71598
  this.typeConfig = {
71555
71599
  ...this.typeConfig,
71556
- ...types14
71600
+ ...types16
71557
71601
  };
71558
71602
  }
71559
71603
  }
71604
+ async apiURL() {
71605
+ if (!this.configFile.apiUrl) {
71606
+ return "";
71607
+ }
71608
+ const env = await this.getEnv();
71609
+ return this.processEnvValues(env, this.configFile.apiUrl);
71610
+ }
71560
71611
  get include() {
71561
71612
  if (this.configFile.include) {
71562
71613
  return Array.isArray(this.configFile.include) ? this.configFile.include : [this.configFile.include];
@@ -71569,23 +71620,43 @@ var Config = class {
71569
71620
  pluginConfig(name2) {
71570
71621
  return this.configFile.plugins?.[name2] ?? {};
71571
71622
  }
71572
- get pullHeaders() {
71573
- return Object.fromEntries(
71623
+ async getEnv() {
71624
+ let env = process.env;
71625
+ for (const plugin of this.plugins) {
71626
+ if (plugin.env) {
71627
+ env = {
71628
+ ...await plugin.env({ config: this, env })
71629
+ };
71630
+ }
71631
+ }
71632
+ return env;
71633
+ }
71634
+ processEnvValues(env, value) {
71635
+ let headerValue;
71636
+ if (typeof value === "function") {
71637
+ headerValue = value(env);
71638
+ } else if (value.startsWith("env:")) {
71639
+ headerValue = env[value.slice("env:".length)];
71640
+ } else {
71641
+ headerValue = value;
71642
+ }
71643
+ return headerValue;
71644
+ }
71645
+ async pullHeaders() {
71646
+ const env = await this.getEnv();
71647
+ if (typeof this.schemaPollHeaders === "function") {
71648
+ return this.schemaPollHeaders(env);
71649
+ }
71650
+ const headers = Object.fromEntries(
71574
71651
  Object.entries(this.schemaPollHeaders || {}).map(([key, value]) => {
71575
- let headerValue;
71576
- if (typeof value === "function") {
71577
- headerValue = value(process.env);
71578
- } else if (value.startsWith("env:")) {
71579
- headerValue = process.env[value.slice("env:".length)];
71580
- } else {
71581
- headerValue = value;
71582
- }
71652
+ const headerValue = this.processEnvValues(env, value);
71583
71653
  if (!headerValue) {
71584
71654
  return [];
71585
71655
  }
71586
71656
  return [key, headerValue];
71587
- })
71657
+ }).filter(([key]) => key)
71588
71658
  );
71659
+ return headers;
71589
71660
  }
71590
71661
  async sourceFiles() {
71591
71662
  return [
@@ -71991,9 +72062,10 @@ async function getConfig({
71991
72062
  ...extraConfig,
71992
72063
  filepath: configPath
71993
72064
  });
72065
+ const apiURL = await _config.apiURL();
71994
72066
  if (_config.schemaPath && !_config.schema) {
71995
72067
  let schemaOk = true;
71996
- if (_config.apiUrl) {
72068
+ if (apiURL) {
71997
72069
  if (glob.hasMagic(_config.schemaPath)) {
71998
72070
  console.log(
71999
72071
  `\u26A0\uFE0F Your houdini configuration contains an apiUrl and a path pointing to multiple files.
@@ -72001,7 +72073,7 @@ This will prevent your schema from being pulled.`
72001
72073
  );
72002
72074
  } else if (!await readFile(_config.schemaPath)) {
72003
72075
  console.log("\u231B Pulling schema from api");
72004
- schemaOk = await pullSchema(_config.apiUrl, _config.schemaPath);
72076
+ schemaOk = await pullSchema(apiURL, _config.schemaPath);
72005
72077
  }
72006
72078
  }
72007
72079
  if (schemaOk && !noSchema) {
@@ -72012,10 +72084,11 @@ This will prevent your schema from being pulled.`
72012
72084
  reject(e2);
72013
72085
  throw e2;
72014
72086
  }
72087
+ const plugins = [];
72015
72088
  for (const [pluginName, plugin_config] of Object.entries(_config.configFile.plugins ?? {})) {
72016
72089
  try {
72017
72090
  const pluginDirectory = _config.findModule(pluginName);
72018
- const { default: sveltePlugin } = await import((0, import_url.pathToFileURL)(pluginDirectory).toString() + "/build/plugin-esm/index.js");
72091
+ const { default: pluginFactory } = await import((0, import_url.pathToFileURL)(pluginDirectory).toString() + "/build/plugin-esm/index.js");
72019
72092
  let include_runtime = false;
72020
72093
  try {
72021
72094
  await stat(join2(pluginDirectory, "build", "runtime-esm"));
@@ -72032,8 +72105,8 @@ This will prevent your schema from being pulled.`
72032
72105
  version = packageJSON.version;
72033
72106
  } catch {
72034
72107
  }
72035
- _config.plugins.push({
72036
- ...await sveltePlugin(plugin_config),
72108
+ plugins.push({
72109
+ ...await pluginFactory(plugin_config),
72037
72110
  name: pluginName,
72038
72111
  include_runtime,
72039
72112
  version,
@@ -72045,6 +72118,7 @@ This will prevent your schema from being pulled.`
72045
72118
  );
72046
72119
  }
72047
72120
  }
72121
+ _config.plugins = orderedPlugins(plugins);
72048
72122
  await Promise.all(_config.plugins.map((plugin) => plugin.after_load?.(_config)));
72049
72123
  resolve2(_config);
72050
72124
  return _config;
@@ -72056,6 +72130,16 @@ var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
72056
72130
  LogLevel2["Quiet"] = "quiet";
72057
72131
  return LogLevel2;
72058
72132
  })(LogLevel || {});
72133
+ var orderedPlugins = (plugins) => {
72134
+ const ordered = plugins.filter(
72135
+ (plugin) => plugin.order === "before" || plugin.order === void 0
72136
+ );
72137
+ ordered.push(
72138
+ ...plugins.filter((plugin) => plugin.order === "core"),
72139
+ ...plugins.filter((plugin) => plugin.order === "after")
72140
+ );
72141
+ return ordered;
72142
+ };
72059
72143
 
72060
72144
  // src/lib/graphql.ts
72061
72145
  var import_crypto = __toESM(require("crypto"), 1);
@@ -72343,53 +72427,75 @@ var graphql4 = __toESM(require_graphql2(), 1);
72343
72427
  async function find_graphql(config2, parsedScript, walker) {
72344
72428
  await asyncWalk(parsedScript, {
72345
72429
  async enter(node, parent) {
72346
- if (node.type === "TaggedTemplateExpression" && node.tag.name === "graphql") {
72430
+ if (node.type !== "TaggedTemplateExpression" && node.type !== "CallExpression") {
72431
+ return;
72432
+ }
72433
+ let documentString;
72434
+ if (node.type === "TaggedTemplateExpression") {
72347
72435
  const expr = node;
72348
- const tagContent = expr.quasi.quasis[0].value.raw;
72349
- const parsedTag = graphql4.parse(tagContent);
72350
- if (walker.where && !walker.where(parsedTag)) {
72436
+ if (expr.tag.type !== "Identifier" || expr.tag.name !== "graphql") {
72351
72437
  return;
72352
72438
  }
72353
- const definition = config2.extractDefinition(parsedTag);
72354
- const name2 = definition.name?.value;
72355
- if (!name2) {
72356
- throw new Error("Could not find definition name");
72439
+ documentString = expr.quasi.quasis[0].value.raw;
72440
+ } else if (node.type === "CallExpression") {
72441
+ const expr = node;
72442
+ if (expr.callee.type !== "Identifier" || expr.callee.name !== "graphql" || expr.arguments.length !== 1) {
72443
+ return;
72357
72444
  }
72358
- let kind;
72359
- if (definition.kind === "FragmentDefinition") {
72360
- kind = CompiledFragmentKind;
72445
+ const argument = expr.arguments[0];
72446
+ if (argument.type === "TemplateLiteral") {
72447
+ documentString = argument.quasis[0].value.raw;
72448
+ } else if (argument.type === "StringLiteral") {
72449
+ documentString = argument.value;
72361
72450
  } else {
72362
- if (definition.operation === "query") {
72363
- kind = CompiledQueryKind;
72364
- } else if (definition.operation === "mutation") {
72365
- kind = CompiledMutationKind;
72366
- } else {
72367
- kind = CompiledSubscriptionKind;
72368
- }
72451
+ return;
72369
72452
  }
72370
- walker.dependency?.(config2.artifactPath(parsedTag));
72371
- await walker.tag({
72372
- parsedDocument: parsedTag,
72373
- node: {
72374
- ...node,
72375
- ...this,
72376
- remove: this.remove,
72377
- replaceWith: this.replace
72378
- },
72379
- artifact: {
72380
- name: name2,
72381
- kind
72382
- },
72383
- parent,
72384
- tagContent
72385
- });
72453
+ } else {
72454
+ return;
72455
+ }
72456
+ const parsedTag = graphql4.parse(documentString);
72457
+ if (walker.where && !walker.where(parsedTag)) {
72458
+ return;
72386
72459
  }
72460
+ const definition = config2.extractDefinition(parsedTag);
72461
+ const name2 = definition.name?.value;
72462
+ if (!name2) {
72463
+ throw new Error("Could not find definition name");
72464
+ }
72465
+ let kind;
72466
+ if (definition.kind === "FragmentDefinition") {
72467
+ kind = CompiledFragmentKind;
72468
+ } else {
72469
+ if (definition.operation === "query") {
72470
+ kind = CompiledQueryKind;
72471
+ } else if (definition.operation === "mutation") {
72472
+ kind = CompiledMutationKind;
72473
+ } else {
72474
+ kind = CompiledSubscriptionKind;
72475
+ }
72476
+ }
72477
+ walker.dependency?.(config2.artifactPath(parsedTag));
72478
+ await walker.tag({
72479
+ parsedDocument: parsedTag,
72480
+ node: {
72481
+ ...node,
72482
+ ...this,
72483
+ remove: this.remove,
72484
+ replaceWith: this.replace
72485
+ },
72486
+ artifact: {
72487
+ name: name2,
72488
+ kind
72489
+ },
72490
+ parent,
72491
+ tagContent: documentString
72492
+ });
72387
72493
  }
72388
72494
  });
72389
72495
  }
72390
72496
 
72391
72497
  // src/codegen/index.ts
72392
- var graphql28 = __toESM(require_graphql2(), 1);
72498
+ var graphql29 = __toESM(require_graphql2(), 1);
72393
72499
 
72394
72500
  // src/codegen/generators/artifacts/index.ts
72395
72501
  var graphql14 = __toESM(require_graphql2(), 1);
@@ -72809,7 +72915,7 @@ function deepMerge(filepath, ...targets) {
72809
72915
  Object.entries(fields).map(([key, value]) => [key, deepMerge(filepath, ...value)])
72810
72916
  );
72811
72917
  }
72812
- function convertValue(val) {
72918
+ function convertValue(config2, val) {
72813
72919
  let value;
72814
72920
  let kind;
72815
72921
  if (val.kind === graphql7.Kind.INT) {
@@ -72941,7 +73047,7 @@ function operationObject({
72941
73047
  operationWhen[i2 ? "must_not" : "must"] = arg.value.fields.reduce(
72942
73048
  (obj, arg2) => ({
72943
73049
  ...obj,
72944
- [arg2.name.value]: convertValue(arg2.value).value
73050
+ [arg2.name.value]: convertValue(config2, arg2.value).value
72945
73051
  }),
72946
73052
  {}
72947
73053
  );
@@ -72957,7 +73063,7 @@ function operationObject({
72957
73063
  operationWhen[which] = directive.arguments?.reduce(
72958
73064
  (filters, argument) => ({
72959
73065
  ...filters,
72960
- [argument.name.value]: convertValue(argument.value).value
73066
+ [argument.name.value]: convertValue(config2, argument.value).value
72961
73067
  }),
72962
73068
  {}
72963
73069
  );
@@ -73916,7 +74022,9 @@ function fieldKey(config2, field) {
73916
74022
  [arg.name.value]: printed.substring(start - 1, end - 1)
73917
74023
  };
73918
74024
  }, {});
73919
- let key = Object.values(argObj).length > 0 ? `${attributeName}(${Object.entries(argObj).map((entries) => entries.join(": ")).join(", ")})` : attributeName;
74025
+ const args = Object.keys(argObj);
74026
+ args.sort();
74027
+ let key = Object.values(argObj).length > 0 ? `${attributeName}(${args.map((key2) => `${key2}: ${argObj[key2]}`).join(", ")})` : attributeName;
73920
74028
  if (paginated) {
73921
74029
  key = key + "::paginated";
73922
74030
  }
@@ -74099,7 +74207,7 @@ function selection({
74099
74207
  fieldObj.filters = (field.arguments || []).reduce(
74100
74208
  (filters, arg) => ({
74101
74209
  ...filters,
74102
- [arg.name.value]: convertValue(arg.value)
74210
+ [arg.name.value]: convertValue(config2, arg.value)
74103
74211
  }),
74104
74212
  {}
74105
74213
  );
@@ -74386,7 +74494,9 @@ function artifactGenerator(stats) {
74386
74494
  }
74387
74495
 
74388
74496
  // src/codegen/generators/runtime/index.ts
74389
- async function runtimeGenerator(config2) {
74497
+ var recast6 = __toESM(require_main2(), 1);
74498
+ var AST6 = recast6.types.builders;
74499
+ async function runtimeGenerator(config2, docs) {
74390
74500
  await Promise.all([
74391
74501
  fs_exports.recursiveCopy(config2.runtimeSource, config2.runtimeDirectory, {
74392
74502
  [path_exports.join(config2.runtimeSource, "lib", "config.js")]: (content) => {
@@ -74400,6 +74510,59 @@ async function runtimeGenerator(config2) {
74400
74510
  }),
74401
74511
  ...config2.plugins.filter((plugin) => plugin.include_runtime).map((plugin) => generatePluginRuntime(config2, plugin))
74402
74512
  ]);
74513
+ const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
74514
+ const contents = await parseJS(await fs_exports.readFile(indexPath) || "");
74515
+ const graphql_tag_return = config2.plugins.find(
74516
+ (plugin) => plugin.graphql_tag_return
74517
+ )?.graphql_tag_return;
74518
+ if (graphql_tag_return && contents) {
74519
+ const overloaded_returns = {};
74520
+ for (const doc of docs) {
74521
+ const return_value = graphql_tag_return({
74522
+ config: config2,
74523
+ doc,
74524
+ ensure_import({ identifier, module: module2 }) {
74525
+ ensureImports({
74526
+ config: config2,
74527
+ body: contents.script.body,
74528
+ sourceModule: module2,
74529
+ import: [identifier]
74530
+ });
74531
+ }
74532
+ });
74533
+ if (return_value) {
74534
+ overloaded_returns[doc.originalString] = return_value;
74535
+ }
74536
+ }
74537
+ if (Object.keys(overloaded_returns).length > 0) {
74538
+ for (const [i2, expression] of (contents?.script.body ?? []).entries()) {
74539
+ if (expression.type !== "ExportNamedDeclaration" || expression.declaration?.type !== "TSDeclareFunction" || expression.declaration.id?.name !== "graphql") {
74540
+ continue;
74541
+ }
74542
+ for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
74543
+ const input = AST6.identifier("str");
74544
+ input.typeAnnotation = AST6.tsTypeAnnotation(
74545
+ AST6.tsLiteralType(AST6.stringLiteral(queryString))
74546
+ );
74547
+ contents?.script.body.splice(
74548
+ i2,
74549
+ 0,
74550
+ AST6.exportNamedDeclaration(
74551
+ AST6.tsDeclareFunction(
74552
+ AST6.identifier("graphql"),
74553
+ [input],
74554
+ AST6.tsTypeAnnotation(
74555
+ AST6.tsTypeReference(AST6.identifier(returnValue))
74556
+ )
74557
+ )
74558
+ )
74559
+ );
74560
+ }
74561
+ break;
74562
+ }
74563
+ await fs_exports.writeFile(indexPath, recast6.prettyPrint(contents.script).code);
74564
+ }
74565
+ }
74403
74566
  }
74404
74567
  async function generatePluginRuntime(config2, plugin) {
74405
74568
  if (houdini_mode.is_testing) {
@@ -74434,20 +74597,20 @@ async function generatePluginRuntime(config2, plugin) {
74434
74597
  }
74435
74598
 
74436
74599
  // src/codegen/generators/typescript/index.ts
74437
- var recast10 = __toESM(require_main2(), 1);
74600
+ var recast12 = __toESM(require_main2(), 1);
74438
74601
 
74439
74602
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
74440
74603
  var graphql17 = __toESM(require_graphql2(), 1);
74441
- var recast8 = __toESM(require_main2(), 1);
74604
+ var recast9 = __toESM(require_main2(), 1);
74442
74605
 
74443
74606
  // src/codegen/generators/typescript/typeReference.ts
74444
74607
  var graphql16 = __toESM(require_graphql2(), 1);
74445
- var recast7 = __toESM(require_main2(), 1);
74608
+ var recast8 = __toESM(require_main2(), 1);
74446
74609
 
74447
74610
  // src/codegen/generators/typescript/types.ts
74448
74611
  var graphql15 = __toESM(require_graphql2(), 1);
74449
- var recast6 = __toESM(require_main2(), 1);
74450
- var AST6 = recast6.types.builders;
74612
+ var recast7 = __toESM(require_main2(), 1);
74613
+ var AST7 = recast7.types.builders;
74451
74614
  function readonlyProperty(prop, enable = true) {
74452
74615
  if (enable) {
74453
74616
  prop.readonly = true;
@@ -74455,28 +74618,28 @@ function readonlyProperty(prop, enable = true) {
74455
74618
  return prop;
74456
74619
  }
74457
74620
  function nullableField(inner, input = false) {
74458
- const members = [inner, AST6.tsNullKeyword()];
74621
+ const members = [inner, AST7.tsNullKeyword()];
74459
74622
  if (input) {
74460
- members.push(AST6.tsUndefinedKeyword());
74623
+ members.push(AST7.tsUndefinedKeyword());
74461
74624
  }
74462
- return AST6.tsUnionType(members);
74625
+ return AST7.tsUnionType(members);
74463
74626
  }
74464
74627
  function scalarPropertyValue(config2, missingScalars, target) {
74465
74628
  switch (target.name) {
74466
74629
  case "String": {
74467
- return AST6.tsStringKeyword();
74630
+ return AST7.tsStringKeyword();
74468
74631
  }
74469
74632
  case "Int": {
74470
- return AST6.tsNumberKeyword();
74633
+ return AST7.tsNumberKeyword();
74471
74634
  }
74472
74635
  case "Float": {
74473
- return AST6.tsNumberKeyword();
74636
+ return AST7.tsNumberKeyword();
74474
74637
  }
74475
74638
  case "Boolean": {
74476
- return AST6.tsBooleanKeyword();
74639
+ return AST7.tsBooleanKeyword();
74477
74640
  }
74478
74641
  case "ID": {
74479
- return AST6.tsStringKeyword();
74642
+ return AST7.tsStringKeyword();
74480
74643
  }
74481
74644
  default: {
74482
74645
  if (graphql15.isNonNullType(target) && "ofType" in target) {
@@ -74487,23 +74650,23 @@ function scalarPropertyValue(config2, missingScalars, target) {
74487
74650
  );
74488
74651
  }
74489
74652
  if (config2.scalars?.[target.name]) {
74490
- return AST6.tsTypeReference(AST6.identifier(config2.scalars?.[target.name].type));
74653
+ return AST7.tsTypeReference(AST7.identifier(config2.scalars?.[target.name].type));
74491
74654
  }
74492
74655
  missingScalars.add(target.name);
74493
- return AST6.tsAnyKeyword();
74656
+ return AST7.tsAnyKeyword();
74494
74657
  }
74495
74658
  }
74496
74659
  }
74497
74660
 
74498
74661
  // src/codegen/generators/typescript/typeReference.ts
74499
- var AST7 = recast7.types.builders;
74662
+ var AST8 = recast8.types.builders;
74500
74663
  function tsTypeReference(config2, missingScalars, definition) {
74501
74664
  const { type, wrappers } = unwrapType(config2, definition.type);
74502
74665
  let result;
74503
74666
  if (graphql16.isScalarType(type)) {
74504
74667
  result = scalarPropertyValue(config2, missingScalars, type);
74505
74668
  } else {
74506
- result = AST7.tsTypeReference(AST7.identifier(type.name));
74669
+ result = AST8.tsTypeReference(AST8.identifier(type.name));
74507
74670
  }
74508
74671
  for (const toWrap of wrappers) {
74509
74672
  if (toWrap === "NonNull" /* NonNull */) {
@@ -74511,14 +74674,14 @@ function tsTypeReference(config2, missingScalars, definition) {
74511
74674
  } else if (toWrap === "Nullable" /* Nullable */) {
74512
74675
  result = nullableField(result, true);
74513
74676
  } else if (toWrap === "List" /* List */) {
74514
- result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
74677
+ result = AST8.tsArrayType(AST8.tsParenthesizedType(result));
74515
74678
  }
74516
74679
  }
74517
74680
  return result;
74518
74681
  }
74519
74682
 
74520
74683
  // src/codegen/generators/typescript/addReferencedInputTypes.ts
74521
- var AST8 = recast8.types.builders;
74684
+ var AST9 = recast9.types.builders;
74522
74685
  function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
74523
74686
  const { type } = unwrapType(config2, rootType);
74524
74687
  if (graphql17.isScalarType(type)) {
@@ -74545,20 +74708,267 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
74545
74708
  for (const field of Object.values(type.getFields())) {
74546
74709
  addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
74547
74710
  members.push(
74548
- AST8.tsPropertySignature(
74549
- AST8.identifier(field.name),
74550
- AST8.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
74711
+ AST9.tsPropertySignature(
74712
+ AST9.identifier(field.name),
74713
+ AST9.tsTypeAnnotation(tsTypeReference(config2, missingScalars, field)),
74551
74714
  graphql17.isNullableType(field.type)
74552
74715
  )
74553
74716
  );
74554
74717
  }
74555
- body.push(AST8.tsTypeAliasDeclaration(AST8.identifier(type.name), AST8.tsTypeLiteral(members)));
74718
+ body.push(AST9.tsTypeAliasDeclaration(AST9.identifier(type.name), AST9.tsTypeLiteral(members)));
74556
74719
  }
74557
74720
 
74558
- // src/codegen/generators/typescript/inlineType.ts
74721
+ // src/codegen/generators/typescript/imperativeCache.ts
74559
74722
  var graphql18 = __toESM(require_graphql2(), 1);
74560
- var recast9 = __toESM(require_main2(), 1);
74561
- var AST9 = recast9.types.builders;
74723
+ var recast10 = __toESM(require_main2(), 1);
74724
+ var AST10 = recast10.types.builders;
74725
+ async function imperativeCacheTypef(config2, docs) {
74726
+ const target = path_exports.join(config2.runtimeDirectory, "generated.d.ts");
74727
+ const body = [];
74728
+ const declaration = AST10.tsTypeAliasDeclaration(
74729
+ AST10.identifier(CacheTypeDefName),
74730
+ AST10.tsTypeLiteral([
74731
+ AST10.tsPropertySignature(
74732
+ AST10.identifier("types"),
74733
+ AST10.tsTypeAnnotation(typeDefinitions(config2, body))
74734
+ ),
74735
+ AST10.tsPropertySignature(
74736
+ AST10.identifier("lists"),
74737
+ AST10.tsTypeAnnotation(listDefinitions(config2, docs))
74738
+ )
74739
+ ])
74740
+ );
74741
+ declaration.declare = true;
74742
+ const importRecord = AST10.importDeclaration(
74743
+ [AST10.importSpecifier(AST10.identifier("Record"))],
74744
+ AST10.stringLiteral("./public/record")
74745
+ );
74746
+ importRecord.importKind = "type";
74747
+ await fs_exports.writeFile(
74748
+ target,
74749
+ recast10.prettyPrint(
74750
+ AST10.program([importRecord, ...body, AST10.exportNamedDeclaration(declaration)])
74751
+ ).code
74752
+ );
74753
+ }
74754
+ function typeDefinitions(config2, body) {
74755
+ const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
74756
+ const visitedTypes = /* @__PURE__ */ new Set();
74757
+ const types16 = Object.values(config2.schema.getTypeMap()).filter(
74758
+ (type) => !graphql18.isAbstractType(type) && !graphql18.isScalarType(type) && !graphql18.isEnumType(type) && !graphql18.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
74759
+ );
74760
+ return AST10.tsTypeLiteral(
74761
+ types16.map((type) => {
74762
+ let typeName = type.name;
74763
+ if (config2.schema.getQueryType() && config2.schema.getQueryType()?.name === type.name) {
74764
+ typeName = "__ROOT__";
74765
+ }
74766
+ let idFields = AST10.tsNeverKeyword();
74767
+ const keys = keyFieldsForType(config2.configFile, type.name);
74768
+ if (graphql18.isObjectType(type) && keys.length > 0 && keys.every((key) => type.getFields()[key])) {
74769
+ idFields = AST10.tsTypeLiteral(
74770
+ keys.map((key) => {
74771
+ const fieldType = type.getFields()[key];
74772
+ const unwrapped = unwrapType(config2, fieldType.type);
74773
+ return AST10.tsPropertySignature(
74774
+ AST10.identifier(key),
74775
+ AST10.tsTypeAnnotation(
74776
+ scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
74777
+ )
74778
+ );
74779
+ })
74780
+ );
74781
+ } else if (typeName === "__ROOT__") {
74782
+ idFields = AST10.tsTypeLiteral([]);
74783
+ }
74784
+ let fields = AST10.tsTypeLiteral([]);
74785
+ if (graphql18.isObjectType(type)) {
74786
+ fields = AST10.tsTypeLiteral(
74787
+ Object.entries(type.getFields()).map(
74788
+ ([key, fieldType]) => {
74789
+ const unwrapped = unwrapType(config2, fieldType.type);
74790
+ let typeOptions = AST10.tsUnionType([]);
74791
+ if (graphql18.isScalarType(unwrapped.type)) {
74792
+ typeOptions.types.push(
74793
+ scalarPropertyValue(config2, /* @__PURE__ */ new Set(), unwrapped.type)
74794
+ );
74795
+ } else if (graphql18.isEnumType(unwrapped.type)) {
74796
+ typeOptions.types.push(
74797
+ AST10.tsTypeReference(AST10.identifier(unwrapped.type.name))
74798
+ );
74799
+ } else if (!graphql18.isAbstractType(unwrapped.type)) {
74800
+ typeOptions.types.push(record(unwrapped.type.name));
74801
+ } else {
74802
+ typeOptions.types.push(
74803
+ ...config2.schema.getPossibleTypes(unwrapped.type).map((type2) => record(type2.name))
74804
+ );
74805
+ }
74806
+ for (const wrapper of unwrapped.wrappers) {
74807
+ if (wrapper === "Nullable" /* Nullable */) {
74808
+ typeOptions = AST10.tsParenthesizedType(
74809
+ AST10.tsUnionType([typeOptions, AST10.tsNullKeyword()])
74810
+ );
74811
+ } else if (wrapper === "List" /* List */) {
74812
+ typeOptions = AST10.tsArrayType(
74813
+ AST10.tsParenthesizedType(typeOptions)
74814
+ );
74815
+ }
74816
+ }
74817
+ if (typeOptions.type === "TSParenthesizedType") {
74818
+ typeOptions = typeOptions.typeAnnotation;
74819
+ }
74820
+ let args = AST10.tsNeverKeyword();
74821
+ if (fieldType.args?.length > 0) {
74822
+ args = AST10.tsTypeLiteral(
74823
+ fieldType.args.map((arg) => {
74824
+ addReferencedInputTypes(
74825
+ config2,
74826
+ "",
74827
+ body,
74828
+ visitedTypes,
74829
+ /* @__PURE__ */ new Set(),
74830
+ arg.type
74831
+ );
74832
+ const prop = AST10.tsPropertySignature(
74833
+ AST10.identifier(arg.name),
74834
+ AST10.tsTypeAnnotation(
74835
+ tsTypeReference(config2, /* @__PURE__ */ new Set(), arg)
74836
+ )
74837
+ );
74838
+ const unwrapped2 = unwrapType(config2, arg.type);
74839
+ prop.optional = unwrapped2.wrappers[unwrapped2.wrappers.length - 1] === "Nullable" /* Nullable */;
74840
+ return prop;
74841
+ })
74842
+ );
74843
+ }
74844
+ return AST10.tsPropertySignature(
74845
+ AST10.identifier(key),
74846
+ AST10.tsTypeAnnotation(
74847
+ AST10.tsTypeLiteral([
74848
+ AST10.tsPropertySignature(
74849
+ AST10.identifier("type"),
74850
+ AST10.tsTypeAnnotation(typeOptions)
74851
+ ),
74852
+ AST10.tsPropertySignature(
74853
+ AST10.identifier("args"),
74854
+ AST10.tsTypeAnnotation(args)
74855
+ )
74856
+ ])
74857
+ )
74858
+ );
74859
+ }
74860
+ )
74861
+ );
74862
+ }
74863
+ return AST10.tsPropertySignature(
74864
+ AST10.identifier(typeName),
74865
+ AST10.tsTypeAnnotation(
74866
+ AST10.tsTypeLiteral([
74867
+ AST10.tsPropertySignature(
74868
+ AST10.identifier("idFields"),
74869
+ AST10.tsTypeAnnotation(idFields)
74870
+ ),
74871
+ AST10.tsPropertySignature(
74872
+ AST10.identifier("fields"),
74873
+ AST10.tsTypeAnnotation(fields)
74874
+ )
74875
+ ])
74876
+ )
74877
+ );
74878
+ })
74879
+ );
74880
+ }
74881
+ function listDefinitions(config2, docs) {
74882
+ const lists = [];
74883
+ const visitedLists = /* @__PURE__ */ new Set();
74884
+ for (const doc of docs) {
74885
+ graphql18.visit(doc.document, {
74886
+ Directive(node, key, parent, path2, ancestors) {
74887
+ if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
74888
+ return;
74889
+ }
74890
+ const nameArg = node.arguments?.find((arg) => arg.name.value === "name");
74891
+ const nameValue = nameArg?.value?.value || "";
74892
+ if (!nameValue || visitedLists.has(nameValue)) {
74893
+ return;
74894
+ }
74895
+ visitedLists.add(nameValue);
74896
+ const parentType = parentTypeFromAncestors(
74897
+ config2.schema,
74898
+ doc.filename,
74899
+ ancestors.slice(0, -1)
74900
+ );
74901
+ const targetField = ancestors[ancestors.length - 1];
74902
+ const targetFieldDefinition = parentType.getFields()[targetField.name.value];
74903
+ const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
74904
+ const possibleTypes = [];
74905
+ if (graphql18.isAbstractType(listType)) {
74906
+ possibleTypes.push(
74907
+ ...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
74908
+ );
74909
+ } else {
74910
+ possibleTypes.push(listType.name);
74911
+ }
74912
+ lists.push(
74913
+ AST10.tsPropertySignature(
74914
+ AST10.identifier(nameValue),
74915
+ AST10.tsTypeAnnotation(
74916
+ AST10.tsTypeLiteral([
74917
+ AST10.tsPropertySignature(
74918
+ AST10.identifier("types"),
74919
+ AST10.tsTypeAnnotation(
74920
+ AST10.tsUnionType(
74921
+ possibleTypes.map(
74922
+ (possible) => AST10.tsLiteralType(AST10.stringLiteral(possible))
74923
+ )
74924
+ )
74925
+ )
74926
+ ),
74927
+ AST10.tsPropertySignature(
74928
+ AST10.identifier("filters"),
74929
+ AST10.tsTypeAnnotation(
74930
+ targetFieldDefinition.args.length === 0 ? AST10.tsNeverKeyword() : AST10.tsTypeLiteral(
74931
+ targetFieldDefinition.args.map((arg) => {
74932
+ const argDef = AST10.tsPropertySignature(
74933
+ AST10.identifier(arg.name),
74934
+ AST10.tsTypeAnnotation(
74935
+ tsTypeReference(
74936
+ config2,
74937
+ /* @__PURE__ */ new Set(),
74938
+ arg
74939
+ )
74940
+ )
74941
+ );
74942
+ argDef.optional = true;
74943
+ return argDef;
74944
+ })
74945
+ )
74946
+ )
74947
+ )
74948
+ ])
74949
+ )
74950
+ )
74951
+ );
74952
+ }
74953
+ });
74954
+ }
74955
+ return AST10.tsTypeLiteral(lists);
74956
+ }
74957
+ var CacheTypeDefName = "CacheTypeDef";
74958
+ function record(name2) {
74959
+ return AST10.tsTypeReference(
74960
+ AST10.identifier("Record"),
74961
+ AST10.tsTypeParameterInstantiation([
74962
+ AST10.tsTypeReference(AST10.identifier(CacheTypeDefName)),
74963
+ AST10.tsLiteralType(AST10.stringLiteral(name2))
74964
+ ])
74965
+ );
74966
+ }
74967
+
74968
+ // src/codegen/generators/typescript/inlineType.ts
74969
+ var graphql19 = __toESM(require_graphql2(), 1);
74970
+ var recast11 = __toESM(require_main2(), 1);
74971
+ var AST11 = recast11.types.builders;
74562
74972
  var fragmentKey = "$fragments";
74563
74973
  function inlineType({
74564
74974
  config: config2,
@@ -74575,9 +74985,9 @@ function inlineType({
74575
74985
  }) {
74576
74986
  const { type, wrappers } = unwrapType(config2, rootType);
74577
74987
  let result;
74578
- if (graphql18.isScalarType(type)) {
74988
+ if (graphql19.isScalarType(type)) {
74579
74989
  result = scalarPropertyValue(config2, missingScalars, type);
74580
- } else if (graphql18.isEnumType(type)) {
74990
+ } else if (graphql19.isEnumType(type)) {
74581
74991
  if (!visitedTypes.has(type.name)) {
74582
74992
  ensureImports({
74583
74993
  config: config2,
@@ -74587,7 +74997,7 @@ function inlineType({
74587
74997
  });
74588
74998
  visitedTypes.add(type.name);
74589
74999
  }
74590
- result = AST9.tsTypeReference(AST9.identifier(type.name));
75000
+ result = AST11.tsTypeReference(AST11.identifier(type.name));
74591
75001
  } else if (selections) {
74592
75002
  const rootObj = type;
74593
75003
  const inlineFragments = {};
@@ -74595,11 +75005,11 @@ function inlineType({
74595
75005
  for (const selection2 of selections) {
74596
75006
  if (selection2.kind === "InlineFragment" && selection2.typeCondition) {
74597
75007
  const fragmentType = config2.schema.getType(selection2.typeCondition.name.value);
74598
- if (!graphql18.isInterfaceType(type) && !graphql18.isUnionType(type)) {
75008
+ if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
74599
75009
  selectedFields.push(...selection2.selectionSet.selections);
74600
75010
  continue;
74601
75011
  }
74602
- if (!graphql18.isInterfaceType(fragmentType) && !graphql18.isUnionType(fragmentType)) {
75012
+ if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
74603
75013
  if (!inlineFragments[fragmentType.name]) {
74604
75014
  inlineFragments[fragmentType.name] = [];
74605
75015
  }
@@ -74638,7 +75048,7 @@ function inlineType({
74638
75048
  selectedFields.push(selection2);
74639
75049
  }
74640
75050
  }
74641
- result = AST9.tsTypeLiteral([
75051
+ result = AST11.tsTypeLiteral([
74642
75052
  ...(selectedFields || []).filter(
74643
75053
  (field) => field.kind === "Field"
74644
75054
  ).map((selection2) => {
@@ -74658,9 +75068,9 @@ function inlineType({
74658
75068
  allOptional
74659
75069
  });
74660
75070
  const prop = readonlyProperty(
74661
- AST9.tsPropertySignature(
74662
- AST9.identifier(attributeName),
74663
- AST9.tsTypeAnnotation(attributeType)
75071
+ AST11.tsPropertySignature(
75072
+ AST11.identifier(attributeName),
75073
+ AST11.tsTypeAnnotation(attributeType)
74664
75074
  ),
74665
75075
  allowReadonly
74666
75076
  );
@@ -74674,15 +75084,15 @@ function inlineType({
74674
75084
  if (includeFragments && fragmentSpreads && fragmentSpreads.length) {
74675
75085
  result.members.push(
74676
75086
  readonlyProperty(
74677
- AST9.tsPropertySignature(
74678
- AST9.identifier(fragmentKey),
74679
- AST9.tsTypeAnnotation(
74680
- AST9.tsTypeLiteral(
75087
+ AST11.tsPropertySignature(
75088
+ AST11.identifier(fragmentKey),
75089
+ AST11.tsTypeAnnotation(
75090
+ AST11.tsTypeLiteral(
74681
75091
  (fragmentSpreads || []).map(
74682
- (fragmentSpread) => AST9.tsPropertySignature(
74683
- AST9.identifier(fragmentSpread.name.value),
74684
- AST9.tsTypeAnnotation(
74685
- AST9.tsLiteralType(AST9.booleanLiteral(true))
75092
+ (fragmentSpread) => AST11.tsPropertySignature(
75093
+ AST11.identifier(fragmentSpread.name.value),
75094
+ AST11.tsTypeAnnotation(
75095
+ AST11.tsLiteralType(AST11.booleanLiteral(true))
74686
75096
  )
74687
75097
  )
74688
75098
  )
@@ -74719,7 +75129,7 @@ function inlineType({
74719
75129
  }
74720
75130
  }
74721
75131
  }
74722
- if (objectType.type === "TSTypeLiteral" && !graphql18.isInterfaceType(fragmentRootType) && !graphql18.isUnionType(fragmentRootType)) {
75132
+ if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
74723
75133
  const existingTypenameIndex = objectType.members.findIndex(
74724
75134
  (member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
74725
75135
  );
@@ -74728,9 +75138,9 @@ function inlineType({
74728
75138
  }
74729
75139
  objectType.members.push(
74730
75140
  readonlyProperty(
74731
- AST9.tsPropertySignature(
74732
- AST9.identifier("__typename"),
74733
- AST9.tsTypeAnnotation(AST9.tsLiteralType(AST9.stringLiteral(typeName)))
75141
+ AST11.tsPropertySignature(
75142
+ AST11.identifier("__typename"),
75143
+ AST11.tsTypeAnnotation(AST11.tsLiteralType(AST11.stringLiteral(typeName)))
74734
75144
  ),
74735
75145
  allowReadonly
74736
75146
  )
@@ -74741,8 +75151,8 @@ function inlineType({
74741
75151
  if (Object.keys(inlineFragmentSelections).length > 0) {
74742
75152
  let selectionTypes = Object.entries(inlineFragmentSelections).map(
74743
75153
  ([typeName, { type: type2, tsType }]) => {
74744
- return AST9.tsParenthesizedType(
74745
- AST9.tsIntersectionType(
75154
+ return AST11.tsParenthesizedType(
75155
+ AST11.tsIntersectionType(
74746
75156
  [tsType].flatMap((type3) => {
74747
75157
  if (type3.type === "TSUnionType") {
74748
75158
  return type3.types.filter(
@@ -74755,9 +75165,9 @@ function inlineType({
74755
75165
  );
74756
75166
  }
74757
75167
  );
74758
- result = AST9.tsIntersectionType([
75168
+ result = AST11.tsIntersectionType([
74759
75169
  result,
74760
- AST9.tsParenthesizedType(AST9.tsUnionType(selectionTypes))
75170
+ AST11.tsParenthesizedType(AST11.tsUnionType(selectionTypes))
74761
75171
  ]);
74762
75172
  }
74763
75173
  } else {
@@ -74769,7 +75179,7 @@ function inlineType({
74769
75179
  } else if (toWrap === "NonNull" /* NonNull */) {
74770
75180
  continue;
74771
75181
  } else if (toWrap === "List" /* List */) {
74772
- result = AST9.tsArrayType(AST9.tsParenthesizedType(result));
75182
+ result = AST11.tsArrayType(AST11.tsParenthesizedType(result));
74773
75183
  }
74774
75184
  }
74775
75185
  return result;
@@ -74786,7 +75196,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
74786
75196
  },
74787
75197
  type: schema.getType("String")
74788
75198
  };
74789
- } else if (graphql18.isNonNullType(rootType) && "getFields" in rootType.ofType) {
75199
+ } else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
74790
75200
  fields = rootType.ofType.getFields();
74791
75201
  } else {
74792
75202
  fields = rootType.getFields();
@@ -74798,7 +75208,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
74798
75208
  message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
74799
75209
  });
74800
75210
  }
74801
- const fieldType = graphql18.getNamedType(field.type);
75211
+ const fieldType = graphql19.getNamedType(field.type);
74802
75212
  if (!fieldType) {
74803
75213
  throw new HoudiniError({
74804
75214
  filepath,
@@ -74814,7 +75224,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection2) {
74814
75224
  }
74815
75225
 
74816
75226
  // src/codegen/generators/typescript/index.ts
74817
- var AST10 = recast10.types.builders;
75227
+ var AST12 = recast12.types.builders;
74818
75228
  async function typescriptGenerator(config2, docs) {
74819
75229
  const typePaths = [];
74820
75230
  const fragmentDefinitions = {};
@@ -74832,7 +75242,7 @@ async function typescriptGenerator(config2, docs) {
74832
75242
  return;
74833
75243
  }
74834
75244
  const typeDefPath = config2.artifactTypePath(originalDocument);
74835
- const program3 = AST10.program([]);
75245
+ const program3 = AST12.program([]);
74836
75246
  const visitedTypes = /* @__PURE__ */ new Set();
74837
75247
  let definition = originalDocument.definitions.find(
74838
75248
  (def) => (def.kind === "OperationDefinition" || def.kind === "FragmentDefinition") && def.name?.value === name2
@@ -74865,21 +75275,21 @@ async function typescriptGenerator(config2, docs) {
74865
75275
  missingScalars
74866
75276
  );
74867
75277
  }
74868
- await fs_exports.writeFile(typeDefPath, recast10.print(program3).code);
75278
+ await fs_exports.writeFile(typeDefPath, recast12.print(program3).code);
74869
75279
  typePaths.push(typeDefPath);
74870
75280
  })
74871
75281
  );
74872
- const typeIndex = AST10.program(
75282
+ const typeIndex = AST12.program(
74873
75283
  typePaths.sort((a, b) => a.localeCompare(b)).map((typePath) => {
74874
- return AST10.exportAllDeclaration(
74875
- AST10.literal(
75284
+ return AST12.exportAllDeclaration(
75285
+ AST12.literal(
74876
75286
  "./" + path_exports.relative(path_exports.resolve(config2.typeIndexPath, ".."), typePath).replace(/\.[^/.]+\.[^/.]+$/, "")
74877
75287
  ),
74878
75288
  null
74879
75289
  );
74880
75290
  }).concat([
74881
- AST10.exportAllDeclaration(AST10.literal("./runtime"), null),
74882
- AST10.exportAllDeclaration(AST10.literal("./graphql"), null)
75291
+ AST12.exportAllDeclaration(AST12.literal("./runtime"), null),
75292
+ AST12.exportAllDeclaration(AST12.literal("./graphql"), null)
74883
75293
  ])
74884
75294
  );
74885
75295
  const export_default_as = ({ module: module2, as }) => `
@@ -74888,7 +75298,7 @@ export { default as ${as} } from "${module2}"
74888
75298
  const export_star_from = ({ module: module2 }) => `
74889
75299
  export * from "${module2}"
74890
75300
  `;
74891
- let indexContent = recast10.print(typeIndex).code;
75301
+ let indexContent = recast12.print(typeIndex).code;
74892
75302
  for (const plugin of config2.plugins) {
74893
75303
  if (!plugin.index_file) {
74894
75304
  continue;
@@ -74909,6 +75319,7 @@ export * from "${module2}"
74909
75319
  }
74910
75320
  }
74911
75321
  await fs_exports.writeFile(config2.typeIndexPath, indexContent);
75322
+ await imperativeCacheTypef(config2, docs);
74912
75323
  if (missingScalars.size > 0) {
74913
75324
  console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[...missingScalars].join(
74914
75325
  ", "
@@ -74950,23 +75361,23 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
74950
75361
  const optimisticTypeName = `${definition.name.value}$optimistic`;
74951
75362
  const hasInputs = definition.variableDefinitions && definition.variableDefinitions.length > 0;
74952
75363
  body.push(
74953
- AST10.exportNamedDeclaration(
74954
- AST10.tsTypeAliasDeclaration(
74955
- AST10.identifier(definition.name.value),
74956
- AST10.tsTypeLiteral([
75364
+ AST12.exportNamedDeclaration(
75365
+ AST12.tsTypeAliasDeclaration(
75366
+ AST12.identifier(definition.name.value),
75367
+ AST12.tsTypeLiteral([
74957
75368
  readonlyProperty(
74958
- AST10.tsPropertySignature(
74959
- AST10.stringLiteral("input"),
74960
- AST10.tsTypeAnnotation(AST10.tsTypeReference(AST10.identifier(inputTypeName)))
75369
+ AST12.tsPropertySignature(
75370
+ AST12.stringLiteral("input"),
75371
+ AST12.tsTypeAnnotation(AST12.tsTypeReference(AST12.identifier(inputTypeName)))
74961
75372
  )
74962
75373
  ),
74963
75374
  readonlyProperty(
74964
- AST10.tsPropertySignature(
74965
- AST10.stringLiteral("result"),
74966
- AST10.tsTypeAnnotation(
74967
- definition.operation === "mutation" ? AST10.tsTypeReference(AST10.identifier(shapeTypeName)) : AST10.tsUnionType([
74968
- AST10.tsTypeReference(AST10.identifier(shapeTypeName)),
74969
- AST10.tsUndefinedKeyword()
75375
+ AST12.tsPropertySignature(
75376
+ AST12.stringLiteral("result"),
75377
+ AST12.tsTypeAnnotation(
75378
+ definition.operation === "mutation" ? AST12.tsTypeReference(AST12.identifier(shapeTypeName)) : AST12.tsUnionType([
75379
+ AST12.tsTypeReference(AST12.identifier(shapeTypeName)),
75380
+ AST12.tsUndefinedKeyword()
74970
75381
  ])
74971
75382
  )
74972
75383
  )
@@ -74974,9 +75385,9 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
74974
75385
  ])
74975
75386
  )
74976
75387
  ),
74977
- AST10.exportNamedDeclaration(
74978
- AST10.tsTypeAliasDeclaration(
74979
- AST10.identifier(shapeTypeName),
75388
+ AST12.exportNamedDeclaration(
75389
+ AST12.tsTypeAliasDeclaration(
75390
+ AST12.identifier(shapeTypeName),
74980
75391
  inlineType({
74981
75392
  config: config2,
74982
75393
  filepath,
@@ -75004,15 +75415,15 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
75004
75415
  );
75005
75416
  }
75006
75417
  body.push(
75007
- AST10.exportNamedDeclaration(
75008
- AST10.tsTypeAliasDeclaration(
75009
- AST10.identifier(inputTypeName),
75010
- AST10.tsTypeLiteral(
75418
+ AST12.exportNamedDeclaration(
75419
+ AST12.tsTypeAliasDeclaration(
75420
+ AST12.identifier(inputTypeName),
75421
+ AST12.tsTypeLiteral(
75011
75422
  (definition.variableDefinitions || []).map(
75012
75423
  (definition2) => {
75013
- return AST10.tsPropertySignature(
75014
- AST10.identifier(definition2.variable.name.value),
75015
- AST10.tsTypeAnnotation(
75424
+ return AST12.tsPropertySignature(
75425
+ AST12.identifier(definition2.variable.name.value),
75426
+ AST12.tsTypeAnnotation(
75016
75427
  tsTypeReference(config2, missingScalars, definition2)
75017
75428
  ),
75018
75429
  definition2.type.kind !== "NonNullType"
@@ -75025,16 +75436,16 @@ async function generateOperationTypeDefs(config2, filepath, body, definition, se
75025
75436
  );
75026
75437
  } else {
75027
75438
  body.push(
75028
- AST10.exportNamedDeclaration(
75029
- AST10.tsTypeAliasDeclaration(AST10.identifier(inputTypeName), AST10.tsNullKeyword())
75439
+ AST12.exportNamedDeclaration(
75440
+ AST12.tsTypeAliasDeclaration(AST12.identifier(inputTypeName), AST12.tsNullKeyword())
75030
75441
  )
75031
75442
  );
75032
75443
  }
75033
75444
  if (definition.operation === "mutation") {
75034
75445
  body.push(
75035
- AST10.exportNamedDeclaration(
75036
- AST10.tsTypeAliasDeclaration(
75037
- AST10.identifier(optimisticTypeName),
75446
+ AST12.exportNamedDeclaration(
75447
+ AST12.tsTypeAliasDeclaration(
75448
+ AST12.identifier(optimisticTypeName),
75038
75449
  inlineType({
75039
75450
  config: config2,
75040
75451
  filepath,
@@ -75065,28 +75476,28 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
75065
75476
  throw new Error("Should not get here");
75066
75477
  }
75067
75478
  body.push(
75068
- AST10.exportNamedDeclaration(
75069
- AST10.tsTypeAliasDeclaration(
75070
- AST10.identifier(propTypeName),
75071
- AST10.tsTypeLiteral([
75479
+ AST12.exportNamedDeclaration(
75480
+ AST12.tsTypeAliasDeclaration(
75481
+ AST12.identifier(propTypeName),
75482
+ AST12.tsTypeLiteral([
75072
75483
  readonlyProperty(
75073
- AST10.tsPropertySignature(
75074
- AST10.stringLiteral("shape"),
75075
- AST10.tsTypeAnnotation(
75076
- AST10.tsTypeReference(AST10.identifier(shapeTypeName))
75484
+ AST12.tsPropertySignature(
75485
+ AST12.stringLiteral("shape"),
75486
+ AST12.tsTypeAnnotation(
75487
+ AST12.tsTypeReference(AST12.identifier(shapeTypeName))
75077
75488
  ),
75078
75489
  true
75079
75490
  )
75080
75491
  ),
75081
75492
  readonlyProperty(
75082
- AST10.tsPropertySignature(
75083
- AST10.stringLiteral(fragmentKey),
75084
- AST10.tsTypeAnnotation(
75085
- AST10.tsTypeLiteral([
75086
- AST10.tsPropertySignature(
75087
- AST10.stringLiteral(propTypeName),
75088
- AST10.tsTypeAnnotation(
75089
- AST10.tsLiteralType(AST10.booleanLiteral(true))
75493
+ AST12.tsPropertySignature(
75494
+ AST12.stringLiteral(fragmentKey),
75495
+ AST12.tsTypeAnnotation(
75496
+ AST12.tsTypeLiteral([
75497
+ AST12.tsPropertySignature(
75498
+ AST12.stringLiteral(propTypeName),
75499
+ AST12.tsTypeAnnotation(
75500
+ AST12.tsLiteralType(AST12.booleanLiteral(true))
75090
75501
  )
75091
75502
  )
75092
75503
  ])
@@ -75096,9 +75507,9 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
75096
75507
  ])
75097
75508
  )
75098
75509
  ),
75099
- AST10.exportNamedDeclaration(
75100
- AST10.tsTypeAliasDeclaration(
75101
- AST10.identifier(shapeTypeName),
75510
+ AST12.exportNamedDeclaration(
75511
+ AST12.tsTypeAliasDeclaration(
75512
+ AST12.identifier(shapeTypeName),
75102
75513
  inlineType({
75103
75514
  config: config2,
75104
75515
  filepath,
@@ -75118,7 +75529,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
75118
75529
  }
75119
75530
 
75120
75531
  // src/codegen/generators/persistedQueries/index.ts
75121
- var graphql19 = __toESM(require_graphql2(), 1);
75532
+ var graphql20 = __toESM(require_graphql2(), 1);
75122
75533
  async function persistOutputGenerator(config2, docs) {
75123
75534
  if (typeof config2.persistedQueryPath !== "string" || config2.persistedQueryPath.length === 0)
75124
75535
  return;
@@ -75130,8 +75541,8 @@ async function persistOutputGenerator(config2, docs) {
75130
75541
  if (!generateArtifact) {
75131
75542
  return acc;
75132
75543
  }
75133
- let rawString = graphql19.print(
75134
- graphql19.visit(document, {
75544
+ let rawString = graphql20.print(
75545
+ graphql20.visit(document, {
75135
75546
  Directive(node) {
75136
75547
  if (config2.isInternalDirective(node)) {
75137
75548
  return null;
@@ -75140,7 +75551,7 @@ async function persistOutputGenerator(config2, docs) {
75140
75551
  })
75141
75552
  );
75142
75553
  const operations = document.definitions.filter(
75143
- ({ kind }) => kind === graphql19.Kind.OPERATION_DEFINITION
75554
+ ({ kind }) => kind === graphql20.Kind.OPERATION_DEFINITION
75144
75555
  );
75145
75556
  if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
75146
75557
  acc[hashDocument(rawString)] = rawString;
@@ -75153,26 +75564,26 @@ async function persistOutputGenerator(config2, docs) {
75153
75564
  }
75154
75565
 
75155
75566
  // src/codegen/generators/definitions/enums.ts
75156
- var graphql20 = __toESM(require_graphql2(), 1);
75157
- var recast11 = __toESM(require_main2(), 1);
75158
- var AST11 = recast11.types.builders;
75567
+ var graphql21 = __toESM(require_graphql2(), 1);
75568
+ var recast13 = __toESM(require_main2(), 1);
75569
+ var AST13 = recast13.types.builders;
75159
75570
  async function definitionsGenerator(config2) {
75160
- const enums = graphql20.parse(graphql20.printSchema(config2.schema)).definitions.filter(
75571
+ const enums = graphql21.parse(graphql21.printSchema(config2.schema)).definitions.filter(
75161
75572
  (definition) => definition.kind === "EnumTypeDefinition"
75162
75573
  ).filter((def) => !config2.isInternalEnum(def));
75163
- const runtimeDefinitions = recast11.print(
75164
- AST11.program(
75574
+ const runtimeDefinitions = recast13.print(
75575
+ AST13.program(
75165
75576
  enums.map((defn) => {
75166
75577
  const name2 = defn.name.value;
75167
75578
  return moduleExport(
75168
75579
  config2,
75169
75580
  name2,
75170
- AST11.objectExpression(
75581
+ AST13.objectExpression(
75171
75582
  defn.values?.map((value) => {
75172
75583
  const str = value.name.value;
75173
- return AST11.objectProperty(
75174
- AST11.stringLiteral(str),
75175
- AST11.stringLiteral(str)
75584
+ return AST13.objectProperty(
75585
+ AST13.stringLiteral(str),
75586
+ AST13.stringLiteral(str)
75176
75587
  );
75177
75588
  }) || []
75178
75589
  )
@@ -75180,7 +75591,7 @@ async function definitionsGenerator(config2) {
75180
75591
  })
75181
75592
  )
75182
75593
  ).code;
75183
- const typeDefinitions = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
75594
+ const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
75184
75595
  (definition) => `
75185
75596
  export declare enum ${definition.name.value} {
75186
75597
  ${definition.values?.map((value) => ` ${value.name.value} = "${value.name.value}"`).join(",\n")}
@@ -75191,7 +75602,7 @@ ${definition.values?.map((value) => ` ${value.name.value} = "${value.name.val
75191
75602
  export * from './enums.js'
75192
75603
  `;
75193
75604
  await Promise.all([
75194
- fs_exports.writeFile(config2.enumTypesDefinitionsPath, typeDefinitions),
75605
+ fs_exports.writeFile(config2.enumTypesDefinitionsPath, typeDefinitions2),
75195
75606
  fs_exports.writeFile(config2.enumRuntimeDefinitionsPath, runtimeDefinitions),
75196
75607
  fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.js"), definitionsIndex),
75197
75608
  fs_exports.writeFile(path_exports.join(config2.definitionsDirectory, "index.d.ts"), definitionsIndex)
@@ -75330,7 +75741,7 @@ function flattenFragments(filepath, operation, fragments) {
75330
75741
  }
75331
75742
 
75332
75743
  // src/codegen/transforms/schema.ts
75333
- var graphql22 = __toESM(require_graphql2(), 1);
75744
+ var graphql23 = __toESM(require_graphql2(), 1);
75334
75745
  async function graphqlExtensions(config2, documents) {
75335
75746
  const internalSchema = `
75336
75747
  enum CachePolicy {
@@ -75408,19 +75819,19 @@ directive @${config2.maskEnableDirective} on FRAGMENT_SPREAD
75408
75819
  """
75409
75820
  directive @${config2.maskDisableDirective} on FRAGMENT_SPREAD
75410
75821
  `;
75411
- let currentSchema = graphql22.printSchema(config2.schema);
75822
+ let currentSchema = graphql23.printSchema(config2.schema);
75412
75823
  if (!currentSchema.includes(`directive @${config2.listDirective}`)) {
75413
75824
  currentSchema += internalSchema;
75414
75825
  }
75415
75826
  config2.newSchema += internalSchema;
75416
- config2.schema = graphql22.buildSchema(currentSchema);
75827
+ config2.schema = graphql23.buildSchema(currentSchema);
75417
75828
  }
75418
75829
 
75419
75830
  // src/codegen/transforms/typename.ts
75420
- var graphql23 = __toESM(require_graphql2(), 1);
75831
+ var graphql24 = __toESM(require_graphql2(), 1);
75421
75832
  async function addTypename(config2, documents) {
75422
75833
  for (const doc of documents) {
75423
- doc.document = graphql23.visit(doc.document, {
75834
+ doc.document = graphql24.visit(doc.document, {
75424
75835
  Field(node, key, parent, path2, ancestors) {
75425
75836
  if (!node.selectionSet) {
75426
75837
  return;
@@ -75432,7 +75843,7 @@ async function addTypename(config2, documents) {
75432
75843
  );
75433
75844
  const field = type.getFields()[node.name.value];
75434
75845
  const fieldType = unwrapType(config2, field.type).type;
75435
- if (graphql23.isInterfaceType(fieldType) || graphql23.isUnionType(fieldType)) {
75846
+ if (graphql24.isInterfaceType(fieldType) || graphql24.isUnionType(fieldType)) {
75436
75847
  return {
75437
75848
  ...node,
75438
75849
  selectionSet: {
@@ -75440,9 +75851,9 @@ async function addTypename(config2, documents) {
75440
75851
  selections: [
75441
75852
  ...node.selectionSet.selections,
75442
75853
  {
75443
- kind: graphql23.Kind.FIELD,
75854
+ kind: graphql24.Kind.FIELD,
75444
75855
  name: {
75445
- kind: graphql23.Kind.NAME,
75856
+ kind: graphql24.Kind.NAME,
75446
75857
  value: "__typename"
75447
75858
  }
75448
75859
  }
@@ -75456,10 +75867,10 @@ async function addTypename(config2, documents) {
75456
75867
  }
75457
75868
 
75458
75869
  // src/codegen/transforms/addID.ts
75459
- var graphql24 = __toESM(require_graphql2(), 1);
75870
+ var graphql25 = __toESM(require_graphql2(), 1);
75460
75871
  async function addID(config2, documents) {
75461
75872
  for (const doc of documents) {
75462
- doc.document = graphql24.visit(doc.document, {
75873
+ doc.document = graphql25.visit(doc.document, {
75463
75874
  Field(node, key, parent, path2, ancestors) {
75464
75875
  if (!node.selectionSet) {
75465
75876
  return;
@@ -75472,7 +75883,7 @@ async function addID(config2, documents) {
75472
75883
  const field = type.getFields()[node.name.value];
75473
75884
  const fieldType = unwrapType(config2, field.type).type;
75474
75885
  if (node.selectionSet?.selections.length > 0) {
75475
- if (!graphql24.isObjectType(fieldType) && !graphql24.isInterfaceType(fieldType)) {
75886
+ if (!graphql25.isObjectType(fieldType) && !graphql25.isInterfaceType(fieldType)) {
75476
75887
  return;
75477
75888
  }
75478
75889
  const keyFields = config2.keyFieldsForType(fieldType.name);
@@ -75487,9 +75898,9 @@ async function addID(config2, documents) {
75487
75898
  continue;
75488
75899
  }
75489
75900
  selections.push({
75490
- kind: graphql24.Kind.FIELD,
75901
+ kind: graphql25.Kind.FIELD,
75491
75902
  name: {
75492
- kind: graphql24.Kind.NAME,
75903
+ kind: graphql25.Kind.NAME,
75493
75904
  value: keyField
75494
75905
  }
75495
75906
  });
@@ -75508,8 +75919,8 @@ async function addID(config2, documents) {
75508
75919
  }
75509
75920
 
75510
75921
  // src/codegen/transforms/fragmentVariables.ts
75511
- var graphql25 = __toESM(require_graphql2(), 1);
75512
- var GraphqlKinds2 = graphql25.Kind;
75922
+ var graphql26 = __toESM(require_graphql2(), 1);
75923
+ var GraphqlKinds2 = graphql26.Kind;
75513
75924
  async function fragmentVariables(config2, documents) {
75514
75925
  const fragments = collectFragments(config2, documents);
75515
75926
  const generatedFragments = {};
@@ -75532,7 +75943,7 @@ async function fragmentVariables(config2, documents) {
75532
75943
  });
75533
75944
  }
75534
75945
  const doc = {
75535
- kind: graphql25.Kind.DOCUMENT,
75946
+ kind: graphql26.Kind.DOCUMENT,
75536
75947
  definitions: Object.values(generatedFragments)
75537
75948
  };
75538
75949
  documents.push({
@@ -75568,7 +75979,7 @@ function inlineFragmentArgs({
75568
75979
  filepath,
75569
75980
  document
75570
75981
  ).reduce((acc, arg) => ({ ...acc, [arg.name]: arg }), {});
75571
- const result = graphql25.visit(document, {
75982
+ const result = graphql26.visit(document, {
75572
75983
  FragmentSpread(node) {
75573
75984
  const { definition } = fragmentDefinitions[node.name.value];
75574
75985
  let { args, hash } = collectWithArguments(config2, filepath, node, scope);
@@ -75656,7 +76067,7 @@ function inlineFragmentArgs({
75656
76067
  });
75657
76068
  if (newName) {
75658
76069
  result.name = {
75659
- kind: graphql25.Kind.NAME,
76070
+ kind: graphql26.Kind.NAME,
75660
76071
  value: newName
75661
76072
  };
75662
76073
  }
@@ -75768,7 +76179,7 @@ function operationScope(operation) {
75768
76179
  }
75769
76180
 
75770
76181
  // src/codegen/validators/typeCheck.ts
75771
- var graphql26 = __toESM(require_graphql2(), 1);
76182
+ var graphql27 = __toESM(require_graphql2(), 1);
75772
76183
  async function typeCheck(config2, docs) {
75773
76184
  const errors = [];
75774
76185
  const freeLists = [];
@@ -75776,11 +76187,11 @@ async function typeCheck(config2, docs) {
75776
76187
  const listTypes = [];
75777
76188
  const fragments = {};
75778
76189
  for (const { document: parsed, filename } of docs) {
75779
- graphql26.visit(parsed, {
75780
- [graphql26.Kind.FRAGMENT_DEFINITION](definition) {
76190
+ graphql27.visit(parsed, {
76191
+ [graphql27.Kind.FRAGMENT_DEFINITION](definition) {
75781
76192
  fragments[definition.name.value] = definition;
75782
76193
  },
75783
- [graphql26.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
76194
+ [graphql27.Kind.DIRECTIVE](directive, _, parent, __, ancestors) {
75784
76195
  if (![config2.listDirective, config2.paginateDirective].includes(directive.name.value)) {
75785
76196
  return;
75786
76197
  }
@@ -75826,14 +76237,14 @@ async function typeCheck(config2, docs) {
75826
76237
  );
75827
76238
  return;
75828
76239
  }
75829
- if (graphql26.isListType(rootType) || graphql26.isNonNullType(rootType) && graphql26.isListType(rootType.ofType)) {
76240
+ if (graphql27.isListType(rootType) || graphql27.isNonNullType(rootType) && graphql27.isListType(rootType.ofType)) {
75830
76241
  needsParent = true;
75831
76242
  break;
75832
76243
  }
75833
- if (graphql26.isNonNullType(rootType) && "ofType" in rootType) {
76244
+ if (graphql27.isNonNullType(rootType) && "ofType" in rootType) {
75834
76245
  rootType = rootType.ofType;
75835
76246
  }
75836
- if (graphql26.isScalarType(rootType)) {
76247
+ if (graphql27.isScalarType(rootType)) {
75837
76248
  break;
75838
76249
  }
75839
76250
  rootType = rootType?.getFields()[parent2.name.value]?.type;
@@ -75909,9 +76320,9 @@ async function typeCheck(config2, docs) {
75909
76320
  );
75910
76321
  }
75911
76322
  let targetTypes = [type];
75912
- if (graphql26.isUnionType(type)) {
76323
+ if (graphql27.isUnionType(type)) {
75913
76324
  targetTypes = config2.schema.getPossibleTypes(type);
75914
- } else if (graphql26.isInterfaceType(type)) {
76325
+ } else if (graphql27.isInterfaceType(type)) {
75915
76326
  try {
75916
76327
  for (const key of config2.keyFieldsForType(type.name)) {
75917
76328
  if (!type.getFields()[key]) {
@@ -75949,13 +76360,13 @@ async function typeCheck(config2, docs) {
75949
76360
  if (errors.length > 0) {
75950
76361
  throw errors;
75951
76362
  }
75952
- const rules = (filepath) => [...graphql26.specifiedRules].filter(
76363
+ const rules = (filepath) => [...graphql27.specifiedRules].filter(
75953
76364
  (rule) => ![
75954
- graphql26.NoUnusedFragmentsRule,
75955
- graphql26.KnownFragmentNamesRule,
75956
- graphql26.ExecutableDefinitionsRule,
75957
- graphql26.KnownDirectivesRule,
75958
- graphql26.KnownArgumentNamesRule
76365
+ graphql27.NoUnusedFragmentsRule,
76366
+ graphql27.KnownFragmentNamesRule,
76367
+ graphql27.ExecutableDefinitionsRule,
76368
+ graphql27.KnownDirectivesRule,
76369
+ graphql27.KnownArgumentNamesRule
75959
76370
  ].includes(rule)
75960
76371
  ).concat(
75961
76372
  validateLists({
@@ -75974,7 +76385,7 @@ async function typeCheck(config2, docs) {
75974
76385
  noUnusedFragmentArguments(config2)
75975
76386
  );
75976
76387
  for (const { filename, document: parsed } of docs) {
75977
- for (const error of graphql26.validate(config2.schema, parsed, rules(filename))) {
76388
+ for (const error of graphql27.validate(config2.schema, parsed, rules(filename))) {
75978
76389
  errors.push(
75979
76390
  new HoudiniError({
75980
76391
  filepath: filename,
@@ -76000,7 +76411,7 @@ var validateLists = ({
76000
76411
  if (!config2.isListFragment(node.name.value)) {
76001
76412
  if (!fragments[node.name.value]) {
76002
76413
  ctx.reportError(
76003
- new graphql26.GraphQLError(
76414
+ new graphql27.GraphQLError(
76004
76415
  "Encountered unknown fragment: " + node.name.value
76005
76416
  )
76006
76417
  );
@@ -76010,7 +76421,7 @@ var validateLists = ({
76010
76421
  const listName = config2.listNameFromFragment(node.name.value);
76011
76422
  if (!lists.includes(listName)) {
76012
76423
  ctx.reportError(
76013
- new graphql26.GraphQLError(
76424
+ new graphql27.GraphQLError(
76014
76425
  "Encountered fragment referencing unknown list: " + listName
76015
76426
  )
76016
76427
  );
@@ -76035,7 +76446,7 @@ var validateLists = ({
76035
76446
  );
76036
76447
  if (parentArg) {
76037
76448
  ctx.reportError(
76038
- new graphql26.GraphQLError(
76449
+ new graphql27.GraphQLError(
76039
76450
  `@${config2.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
76040
76451
  )
76041
76452
  );
@@ -76051,7 +76462,7 @@ var validateLists = ({
76051
76462
  return;
76052
76463
  }
76053
76464
  ctx.reportError(
76054
- new graphql26.GraphQLError(
76465
+ new graphql27.GraphQLError(
76055
76466
  `For this list fragment, you need to add or @${config2.listParentDirective} or @${config2.listAllListsDirective} directive to specify the behavior`
76056
76467
  )
76057
76468
  );
@@ -76061,7 +76472,7 @@ var validateLists = ({
76061
76472
  const directiveName = node.name.value;
76062
76473
  if (directiveName === "connection") {
76063
76474
  ctx.reportError(
76064
- new graphql26.GraphQLError(
76475
+ new graphql27.GraphQLError(
76065
76476
  "@connection was renamed to @list. Please change your components. If you were using `cache.connection` in your components, you will need to update that to `cache.list` too."
76066
76477
  )
76067
76478
  );
@@ -76070,7 +76481,7 @@ var validateLists = ({
76070
76481
  if (!config2.isInternalDirective(node)) {
76071
76482
  if (!config2.schema.getDirective(directiveName)) {
76072
76483
  ctx.reportError(
76073
- new graphql26.GraphQLError(
76484
+ new graphql27.GraphQLError(
76074
76485
  "Encountered unknown directive: " + directiveName
76075
76486
  )
76076
76487
  );
@@ -76079,7 +76490,7 @@ var validateLists = ({
76079
76490
  }
76080
76491
  if (config2.isListOperationDirective(directiveName) && !listTypes.includes(config2.listNameFromDirective(directiveName))) {
76081
76492
  ctx.reportError(
76082
- new graphql26.GraphQLError(
76493
+ new graphql27.GraphQLError(
76083
76494
  "Encountered directive referencing unknown list: " + directiveName
76084
76495
  )
76085
76496
  );
@@ -76090,7 +76501,7 @@ var validateLists = ({
76090
76501
  };
76091
76502
  function knownArguments(config2) {
76092
76503
  return function(ctx) {
76093
- const nativeValidator = graphql26.KnownArgumentNamesRule(ctx);
76504
+ const nativeValidator = graphql27.KnownArgumentNamesRule(ctx);
76094
76505
  return {
76095
76506
  ...nativeValidator,
76096
76507
  Directive(directiveNode) {
@@ -76123,7 +76534,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76123
76534
  for (const arg of node.arguments || []) {
76124
76535
  if (arg.value.kind !== "ObjectValue") {
76125
76536
  ctx.reportError(
76126
- new graphql26.GraphQLError("values in @arguments must be an object")
76537
+ new graphql27.GraphQLError("values in @arguments must be an object")
76127
76538
  );
76128
76539
  return;
76129
76540
  }
@@ -76133,13 +76544,13 @@ function validateFragmentArguments(config2, filepath, fragments) {
76133
76544
  );
76134
76545
  if (!typeArg) {
76135
76546
  ctx.reportError(
76136
- new graphql26.GraphQLError("missing type field for @arguments directive")
76547
+ new graphql27.GraphQLError("missing type field for @arguments directive")
76137
76548
  );
76138
76549
  return;
76139
76550
  }
76140
- if (typeArg.value.kind !== graphql26.Kind.STRING) {
76551
+ if (typeArg.value.kind !== graphql27.Kind.STRING) {
76141
76552
  ctx.reportError(
76142
- new graphql26.GraphQLError("type field to @arguments must be a string")
76553
+ new graphql27.GraphQLError("type field to @arguments must be a string")
76143
76554
  );
76144
76555
  return;
76145
76556
  }
@@ -76152,7 +76563,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76152
76563
  );
76153
76564
  if (typeArg.value.value !== defaultValueType) {
76154
76565
  ctx.reportError(
76155
- new graphql26.GraphQLError(
76566
+ new graphql27.GraphQLError(
76156
76567
  `Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
76157
76568
  )
76158
76569
  );
@@ -76170,7 +76581,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76170
76581
  try {
76171
76582
  args = fragmentArguments(config2, filepath, fragments[fragmentName]);
76172
76583
  } catch (e2) {
76173
- ctx.reportError(new graphql26.GraphQLError(e2.message));
76584
+ ctx.reportError(new graphql27.GraphQLError(e2.message));
76174
76585
  return;
76175
76586
  }
76176
76587
  fragmentArguments2[fragmentName] = args;
@@ -76193,7 +76604,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76193
76604
  );
76194
76605
  if (missing.length > 0) {
76195
76606
  ctx.reportError(
76196
- new graphql26.GraphQLError(
76607
+ new graphql27.GraphQLError(
76197
76608
  "The following arguments are missing from this fragment: " + JSON.stringify(missing)
76198
76609
  )
76199
76610
  );
@@ -76204,7 +76615,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76204
76615
  );
76205
76616
  if (unknown.length > 0) {
76206
76617
  ctx.reportError(
76207
- new graphql26.GraphQLError(
76618
+ new graphql27.GraphQLError(
76208
76619
  "Encountered unknown arguments: " + JSON.stringify(unknown)
76209
76620
  )
76210
76621
  );
@@ -76216,7 +76627,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76216
76627
  ]
76217
76628
  );
76218
76629
  for (const [applied, target] of zipped) {
76219
- if (applied.value.kind === graphql26.Kind.VARIABLE || applied.value.kind === graphql26.Kind.LIST || applied.value.kind === graphql26.Kind.OBJECT) {
76630
+ if (applied.value.kind === graphql27.Kind.VARIABLE || applied.value.kind === graphql27.Kind.LIST || applied.value.kind === graphql27.Kind.OBJECT) {
76220
76631
  continue;
76221
76632
  }
76222
76633
  const appliedType = applied.value.kind.substring(
@@ -76225,7 +76636,7 @@ function validateFragmentArguments(config2, filepath, fragments) {
76225
76636
  );
76226
76637
  if (appliedType !== target) {
76227
76638
  ctx.reportError(
76228
- new graphql26.GraphQLError(
76639
+ new graphql27.GraphQLError(
76229
76640
  `Invalid argument type. Expected ${target}, found ${appliedType}`
76230
76641
  )
76231
76642
  );
@@ -76246,7 +76657,7 @@ function paginateArgs(config2, filepath) {
76246
76657
  }
76247
76658
  if (alreadyPaginated) {
76248
76659
  ctx.reportError(
76249
- new graphql26.GraphQLError(
76660
+ new graphql27.GraphQLError(
76250
76661
  `@${config2.paginateDirective} can only appear in a document once.`
76251
76662
  )
76252
76663
  );
@@ -76261,7 +76672,7 @@ function paginateArgs(config2, filepath) {
76261
76672
  const hasRequiredArgs = definitionArgs.find((arg) => arg.required);
76262
76673
  if (hasRequiredArgs) {
76263
76674
  ctx.reportError(
76264
- new graphql26.GraphQLError(
76675
+ new graphql27.GraphQLError(
76265
76676
  "@paginate cannot appear on a document with required args"
76266
76677
  )
76267
76678
  );
@@ -76293,14 +76704,14 @@ function paginateArgs(config2, filepath) {
76293
76704
  const backwards = appliedArgs.has("last");
76294
76705
  if (!forward && !backwards) {
76295
76706
  ctx.reportError(
76296
- new graphql26.GraphQLError(
76707
+ new graphql27.GraphQLError(
76297
76708
  "A field with cursor-based pagination must have a first or last argument"
76298
76709
  )
76299
76710
  );
76300
76711
  }
76301
76712
  if (forward && backwards) {
76302
76713
  ctx.reportError(
76303
- new graphql26.GraphQLError(
76714
+ new graphql27.GraphQLError(
76304
76715
  `A field with cursor pagination cannot go forwards an backwards simultaneously`
76305
76716
  )
76306
76717
  );
@@ -76314,7 +76725,7 @@ function paginateArgs(config2, filepath) {
76314
76725
  );
76315
76726
  if (!appliedLimitArg) {
76316
76727
  ctx.reportError(
76317
- new graphql26.GraphQLError(
76728
+ new graphql27.GraphQLError(
76318
76729
  "A field with offset-based pagination must have a limit argument"
76319
76730
  )
76320
76731
  );
@@ -76330,20 +76741,20 @@ function noUnusedFragmentArguments(config2) {
76330
76741
  const args = /* @__PURE__ */ new Set();
76331
76742
  return {
76332
76743
  enter(node) {
76333
- if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
76744
+ if (node.kind === graphql27.Kind.FRAGMENT_DEFINITION) {
76334
76745
  const definitionArguments = node.directives?.filter((directive) => directive.name.value === config2.argumentsDirective).flatMap((directive) => directive.arguments);
76335
76746
  for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
76336
76747
  args.add(arg);
76337
76748
  }
76338
- } else if (node.kind === graphql26.Kind.VARIABLE) {
76749
+ } else if (node.kind === graphql27.Kind.VARIABLE) {
76339
76750
  args.delete(node.name.value);
76340
76751
  }
76341
76752
  },
76342
76753
  leave(node) {
76343
- if (node.kind === graphql26.Kind.FRAGMENT_DEFINITION) {
76754
+ if (node.kind === graphql27.Kind.FRAGMENT_DEFINITION) {
76344
76755
  if (args.size > 0) {
76345
76756
  ctx.reportError(
76346
- new graphql26.GraphQLError(
76757
+ new graphql27.GraphQLError(
76347
76758
  "Encountered unused fragment arguments: " + [...args].join(",")
76348
76759
  )
76349
76760
  );
@@ -76379,7 +76790,7 @@ function nodeDirectives(config2, directives) {
76379
76790
  if (definition.kind === "OperationDefinition") {
76380
76791
  if (definition.operation !== "query") {
76381
76792
  ctx.reportError(
76382
- new graphql26.GraphQLError(
76793
+ new graphql27.GraphQLError(
76383
76794
  `@${node.name.value} must fall on a fragment or query document`
76384
76795
  )
76385
76796
  );
@@ -76391,7 +76802,7 @@ function nodeDirectives(config2, directives) {
76391
76802
  }
76392
76803
  if (!possibleNodes.includes(definitionType)) {
76393
76804
  ctx.reportError(
76394
- new graphql26.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
76805
+ new graphql27.GraphQLError(paginateOnNonNodeMessage(config2, node.name.value))
76395
76806
  );
76396
76807
  }
76397
76808
  }
@@ -76410,7 +76821,7 @@ function checkMutationOperation(config2) {
76410
76821
  );
76411
76822
  if (append && prepend) {
76412
76823
  ctx.reportError(
76413
- new graphql26.GraphQLError(
76824
+ new graphql27.GraphQLError(
76414
76825
  `You can't apply both @${config2.listPrependDirective} and @${config2.listAppendDirective} at the same time`
76415
76826
  )
76416
76827
  );
@@ -76424,7 +76835,7 @@ function checkMutationOperation(config2) {
76424
76835
  );
76425
76836
  if (parentId && allLists) {
76426
76837
  ctx.reportError(
76427
- new graphql26.GraphQLError(
76838
+ new graphql27.GraphQLError(
76428
76839
  `You can't apply both @${config2.listParentDirective} and @${config2.listAllListsDirective} at the same time`
76429
76840
  )
76430
76841
  );
@@ -76446,7 +76857,7 @@ function checkMaskDirective(config2) {
76446
76857
  );
76447
76858
  if (maskEnableDirective && maskDisableDirective) {
76448
76859
  ctx.reportError(
76449
- new graphql26.GraphQLError(
76860
+ new graphql27.GraphQLError(
76450
76861
  `You can't apply both @${config2.maskEnableDirective} and @${config2.maskDisableDirective} at the same time`
76451
76862
  )
76452
76863
  );
@@ -76462,7 +76873,7 @@ function getAndVerifyNodeInterface(config2) {
76462
76873
  if (!nodeInterface) {
76463
76874
  return null;
76464
76875
  }
76465
- if (!graphql26.isInterfaceType(nodeInterface)) {
76876
+ if (!graphql27.isInterfaceType(nodeInterface)) {
76466
76877
  displayInvalidNodeFieldMessage(config2.logLevel);
76467
76878
  return null;
76468
76879
  }
@@ -76560,11 +76971,11 @@ async function uniqueDocumentNames(config2, docs) {
76560
76971
  }
76561
76972
 
76562
76973
  // src/codegen/validators/noIDAlias.ts
76563
- var graphql27 = __toESM(require_graphql2(), 1);
76974
+ var graphql28 = __toESM(require_graphql2(), 1);
76564
76975
  async function noIDAlias(config2, docs) {
76565
76976
  const errors = [];
76566
76977
  for (const { filename, document } of docs) {
76567
- graphql27.visit(document, {
76978
+ graphql28.visit(document, {
76568
76979
  Field(node, _, __, ___, ancestors) {
76569
76980
  const fieldType = parentTypeFromAncestors(config2.schema, filename, ancestors).name;
76570
76981
  if (config2.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
@@ -76706,8 +77117,8 @@ async function collectDocuments(config2) {
76706
77117
  }
76707
77118
  }
76708
77119
  }
76709
- const graphql_extractor = (filepath, content) => [content];
76710
- const javascript_extractor = (filepath, content) => processJSFile(config2, content);
77120
+ const graphql_extractor = (config3, filepath, content) => [content];
77121
+ const javascript_extractor = (fconfig, ilepath, content) => processJSFile(config2, content);
76711
77122
  extractors[".ts"].push(javascript_extractor);
76712
77123
  extractors[".js"].push(javascript_extractor);
76713
77124
  extractors[".graphql"].push(graphql_extractor);
@@ -76731,7 +77142,7 @@ async function collectDocuments(config2) {
76731
77142
  if (!extractor) {
76732
77143
  continue;
76733
77144
  }
76734
- const found = await extractor(filepath, contents);
77145
+ const found = await extractor(config2, filepath, contents);
76735
77146
  if (found.length > 0) {
76736
77147
  documents.push(...found.map((document) => ({ filepath, document })));
76737
77148
  }
@@ -76762,12 +77173,12 @@ async function processJSFile(config2, contents) {
76762
77173
  return documents;
76763
77174
  }
76764
77175
  async function processGraphQLDocument(config2, filepath, document) {
76765
- const parsedDoc = graphql28.parse(document);
77176
+ const parsedDoc = graphql29.parse(document);
76766
77177
  const operations = parsedDoc.definitions.filter(
76767
- ({ kind: kind2 }) => kind2 === graphql28.Kind.OPERATION_DEFINITION
77178
+ ({ kind: kind2 }) => kind2 === graphql29.Kind.OPERATION_DEFINITION
76768
77179
  );
76769
77180
  const fragments = parsedDoc.definitions.filter(
76770
- ({ kind: kind2 }) => kind2 === graphql28.Kind.FRAGMENT_DEFINITION
77181
+ ({ kind: kind2 }) => kind2 === graphql29.Kind.FRAGMENT_DEFINITION
76771
77182
  );
76772
77183
  if (operations.length > 1) {
76773
77184
  throw new HoudiniError({
@@ -76847,7 +77258,8 @@ function logStyled(kind, stat3, logLevel, plugin) {
76847
77258
  // src/cmd/pullSchema.ts
76848
77259
  async function pullSchema_default(args) {
76849
77260
  const config2 = await getConfig({ noSchema: true });
76850
- if (!config2.apiUrl) {
77261
+ const apiURL = await config2.apiURL();
77262
+ if (!apiURL) {
76851
77263
  console.log(
76852
77264
  "\u274C Your project does not have a remote endpoint configured. Please provide one with the `apiUrl` value in your houdini.config.js file."
76853
77265
  );
@@ -76855,7 +77267,7 @@ async function pullSchema_default(args) {
76855
77267
  return;
76856
77268
  }
76857
77269
  const targetPath = process.cwd();
76858
- let headers = config2.pullHeaders;
77270
+ let headers = await config2.pullHeaders();
76859
77271
  let headerStrings = [];
76860
77272
  if (args.headers) {
76861
77273
  headerStrings = args.headers;
@@ -76870,7 +77282,7 @@ async function pullSchema_default(args) {
76870
77282
  }, headers);
76871
77283
  }
76872
77284
  await pullSchema(
76873
- config2.apiUrl,
77285
+ apiURL,
76874
77286
  config2.schemaPath ? config2.schemaPath : path_exports.resolve(targetPath, "schema.json"),
76875
77287
  headers
76876
77288
  );
@@ -76892,7 +77304,7 @@ async function generate(args = {
76892
77304
  if (args.output) {
76893
77305
  config2.persistedQueryPath = args.output;
76894
77306
  }
76895
- if (args.pullSchema && config2.apiUrl) {
77307
+ if (args.pullSchema && await config2.apiURL()) {
76896
77308
  if (args.pullHeader) {
76897
77309
  console.log("\u26A0\uFE0F --pull-headers has been replaced by --headers (abbreviated -h)");
76898
77310
  args.headers = args.pullHeader;
@@ -77068,7 +77480,7 @@ async function init(_path, args) {
77068
77480
  await graphqlRCFile(targetPath);
77069
77481
  await gitIgnore(targetPath);
77070
77482
  if (framework === "kit") {
77071
- await updateSvelteConfig(targetPath);
77483
+ await updateSvelteConfig(targetPath, typescript);
77072
77484
  } else if (framework === "svelte") {
77073
77485
  await updateSvelteMainJs(targetPath);
77074
77486
  }
@@ -77091,14 +77503,15 @@ async function init(_path, args) {
77091
77503
  2\uFE0F\u20E3 Start your application: ${logGreen(cmd_run)}
77092
77504
  `);
77093
77505
  }
77094
- var networkFile = (url, typescript) => `import { HoudiniClient${typescript ? ", type RequestHandlerArgs" : ""} } from '$houdini';
77506
+ var networkFile = (url, typescript) => `import { HoudiniClient${typescript ? ", type RequestHandler" : ""} } from '$houdini';
77095
77507
 
77096
- async function fetchQuery({
77508
+ ${typescript ? `const requestHandler: RequestHandler` : `/** @type {import('$houdini').RequestHandler<any>} */
77509
+ const requestHandler`} = async ({
77097
77510
  fetch,
77098
77511
  text = '',
77099
77512
  variables = {},
77100
77513
  metadata
77101
- }${typescript ? ": RequestHandlerArgs" : ""}) {
77514
+ }) => {
77102
77515
  const url = '${url}';
77103
77516
  const result = await fetch(url, {
77104
77517
  method: 'POST',
@@ -77113,7 +77526,7 @@ async function fetchQuery({
77113
77526
  return await result.json();
77114
77527
  }
77115
77528
 
77116
- export default new HoudiniClient(fetchQuery);
77529
+ export default new HoudiniClient(requestHandler);
77117
77530
  `;
77118
77531
  var writeConfigFile = async ({
77119
77532
  configPath,
@@ -77251,16 +77664,16 @@ export default config;
77251
77664
  });
77252
77665
  }
77253
77666
  }
77254
- async function updateSvelteConfig(targetPath) {
77667
+ async function updateSvelteConfig(targetPath, typescript) {
77255
77668
  const svelteConfigPath = path_exports.join(targetPath, "svelte.config.js");
77256
- const newContent = `import adapter from '@sveltejs/adapter-auto';
77257
- import preprocess from 'svelte-preprocess';
77669
+ const newContentTs = `import adapter from '@sveltejs/adapter-auto';
77670
+ import { vitePreprocess } from '@sveltejs/kit/vite';
77258
77671
 
77259
77672
  /** @type {import('@sveltejs/kit').Config} */
77260
77673
  const config = {
77261
- // Consult https://github.com/sveltejs/svelte-preprocess
77674
+ // Consult https://kit.svelte.dev/docs/integrations#preprocessors
77262
77675
  // for more information about preprocessors
77263
- preprocess: preprocess(),
77676
+ preprocess: vitePreprocess(),
77264
77677
 
77265
77678
  kit: {
77266
77679
  adapter: adapter(),
@@ -77270,11 +77683,25 @@ const config = {
77270
77683
  }
77271
77684
  };
77272
77685
 
77686
+ export default config;
77687
+ `;
77688
+ const newContentJs = `import adapter from '@sveltejs/adapter-auto';
77689
+
77690
+ /** @type {import('@sveltejs/kit').Config} */
77691
+ const config = {
77692
+ kit: {
77693
+ adapter: adapter(),
77694
+ alias: {
77695
+ $houdini: './$houdini',
77696
+ }
77697
+ }
77698
+ };
77699
+
77273
77700
  export default config;
77274
77701
  `;
77275
77702
  await updateFile({
77276
77703
  filepath: svelteConfigPath,
77277
- content: newContent
77704
+ content: typescript ? newContentTs : newContentJs
77278
77705
  });
77279
77706
  }
77280
77707
  async function updateSvelteMainJs(targetPath) {
@@ -77306,8 +77733,8 @@ async function updatePackageJSON(targetPath) {
77306
77733
  }
77307
77734
  packageJSON.devDependencies = {
77308
77735
  ...packageJSON.devDependencies,
77309
- houdini: "^0.18.3",
77310
- "houdini-svelte": "^0.18.3",
77736
+ houdini: "^0.19.1",
77737
+ "houdini-svelte": "^0.19.1",
77311
77738
  graphql: "^15.8.0"
77312
77739
  };
77313
77740
  await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));