houdini 1.0.0-next.1 → 1.0.0-next.3

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 (224) hide show
  1. package/build/cmd/generate.d.ts +0 -1
  2. package/build/cmd-cjs/index.js +1400 -2836
  3. package/build/cmd-esm/index.js +1400 -2836
  4. package/build/codegen/generators/artifacts/fieldKey.d.ts +1 -1
  5. package/build/codegen/generators/artifacts/index.d.ts +1 -1
  6. package/build/codegen/generators/artifacts/indexFile.d.ts +1 -1
  7. package/build/codegen/generators/artifacts/inputs.d.ts +2 -2
  8. package/build/codegen/generators/artifacts/operations.d.ts +2 -2
  9. package/build/codegen/generators/artifacts/selection.d.ts +1 -1
  10. package/build/codegen/generators/artifacts/utils.d.ts +1 -1
  11. package/build/codegen/generators/definitions/enums.d.ts +1 -1
  12. package/build/codegen/generators/definitions/index.d.ts +1 -1
  13. package/build/codegen/generators/indexFile/index.d.ts +1 -1
  14. package/build/codegen/generators/persistedQueries/index.d.ts +1 -1
  15. package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -0
  16. package/build/codegen/generators/runtime/index.d.ts +1 -1
  17. package/build/codegen/generators/runtime/injectPlugins.d.ts +7 -0
  18. package/build/codegen/generators/runtime/pluginIndex.d.ts +5 -0
  19. package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
  20. package/build/codegen/generators/typescript/documentTypes.d.ts +2 -0
  21. package/build/codegen/generators/typescript/{imperativeCache.d.ts → imperativeTypeDef.d.ts} +1 -1
  22. package/build/codegen/generators/typescript/index.d.ts +1 -1
  23. package/build/codegen/generators/typescript/inlineType.d.ts +1 -1
  24. package/build/codegen/generators/typescript/typeReference.d.ts +1 -1
  25. package/build/codegen/generators/typescript/types.d.ts +1 -1
  26. package/build/codegen/index.d.ts +1 -1
  27. package/build/codegen/transforms/addID.d.ts +1 -1
  28. package/build/codegen/transforms/composeQueries.d.ts +2 -2
  29. package/build/codegen/transforms/fragmentVariables.d.ts +3 -2
  30. package/build/codegen/transforms/list.d.ts +1 -1
  31. package/build/codegen/transforms/paginate.d.ts +1 -1
  32. package/build/codegen/transforms/schema.d.ts +1 -1
  33. package/build/codegen/transforms/typename.d.ts +1 -1
  34. package/build/codegen/utils/commonjs.d.ts +2 -0
  35. package/build/codegen/utils/flattenSelections.d.ts +2 -2
  36. package/build/codegen/utils/moduleExport.d.ts +1 -1
  37. package/build/codegen/utils/objectIdentificationSelection.d.ts +1 -1
  38. package/build/codegen/validators/noIDAlias.d.ts +1 -1
  39. package/build/codegen/validators/typeCheck.d.ts +1 -1
  40. package/build/codegen-cjs/index.js +1320 -2779
  41. package/build/codegen-esm/index.js +1320 -2779
  42. package/build/lib/config.d.ts +9 -4
  43. package/build/lib/fs.d.ts +1 -1
  44. package/build/lib/graphql.d.ts +1 -1
  45. package/build/lib/imports.d.ts +1 -1
  46. package/build/lib/types.d.ts +3 -3
  47. package/build/lib/walk.d.ts +8 -5
  48. package/build/lib-cjs/index.js +155 -1856
  49. package/build/lib-esm/index.js +155 -1856
  50. package/build/runtime/cache/cache.d.ts +10 -8
  51. package/build/runtime/cache/gc.d.ts +1 -1
  52. package/build/runtime/cache/lists.d.ts +3 -2
  53. package/build/runtime/cache/schema.d.ts +2 -2
  54. package/build/runtime/cache/stuff.d.ts +2 -2
  55. package/build/runtime/cache/subscription.d.ts +19 -11
  56. package/build/runtime/client/documentStore.d.ts +87 -0
  57. package/build/runtime/client/index.d.ts +25 -0
  58. package/build/runtime/client/plugins/cache.d.ts +8 -0
  59. package/build/runtime/client/plugins/fetch.d.ts +37 -0
  60. package/build/runtime/client/plugins/fetchParams.d.ts +9 -0
  61. package/build/runtime/client/plugins/index.d.ts +7 -0
  62. package/build/runtime/client/plugins/injectedPlugins.d.ts +3 -0
  63. package/build/runtime/client/plugins/mutation.d.ts +1 -0
  64. package/build/runtime/client/plugins/query.d.ts +2 -0
  65. package/build/runtime/client/plugins/subscription.d.ts +18 -0
  66. package/build/runtime/client/plugins/throwOnError.d.ts +7 -0
  67. package/build/runtime/client/utils/documentPlugins.d.ts +3 -0
  68. package/build/runtime/client/utils/index.d.ts +1 -0
  69. package/build/runtime/generated.d.ts +1 -0
  70. package/build/runtime/imports/config.d.ts +3 -0
  71. package/build/runtime/index.d.ts +3 -2
  72. package/build/runtime/lib/config.d.ts +26 -25
  73. package/build/runtime/lib/index.d.ts +1 -2
  74. package/build/runtime/lib/scalars.d.ts +6 -5
  75. package/build/runtime/lib/selection.d.ts +1 -1
  76. package/build/runtime/lib/store.d.ts +19 -0
  77. package/build/runtime/lib/types.d.ts +22 -9
  78. package/build/runtime/public/cache.d.ts +20 -7
  79. package/build/runtime/public/list.d.ts +2 -2
  80. package/build/runtime/public/record.d.ts +18 -18
  81. package/build/runtime/public/tests/test.d.ts +44 -1
  82. package/build/runtime/public/types.d.ts +8 -0
  83. package/build/runtime-cjs/cache/cache.d.ts +10 -8
  84. package/build/runtime-cjs/cache/cache.js +5 -11
  85. package/build/runtime-cjs/cache/gc.d.ts +1 -1
  86. package/build/runtime-cjs/cache/lists.d.ts +3 -2
  87. package/build/runtime-cjs/cache/lists.js +5 -2
  88. package/build/runtime-cjs/cache/schema.d.ts +2 -2
  89. package/build/runtime-cjs/cache/stuff.d.ts +2 -2
  90. package/build/runtime-cjs/cache/subscription.d.ts +19 -11
  91. package/build/runtime-cjs/cache/subscription.js +95 -56
  92. package/build/runtime-cjs/client/documentStore.d.ts +87 -0
  93. package/build/runtime-cjs/client/documentStore.js +360 -0
  94. package/build/runtime-cjs/client/index.d.ts +25 -0
  95. package/build/runtime-cjs/client/index.js +87 -0
  96. package/build/runtime-cjs/client/plugins/cache.d.ts +8 -0
  97. package/build/runtime-cjs/client/plugins/cache.js +99 -0
  98. package/build/runtime-cjs/client/plugins/fetch.d.ts +37 -0
  99. package/build/runtime-cjs/{lib/networkUtils.js → client/plugins/fetch.js} +95 -3
  100. package/build/runtime-cjs/client/plugins/fetchParams.d.ts +9 -0
  101. package/build/runtime-cjs/client/plugins/fetchParams.js +40 -0
  102. package/build/runtime-cjs/client/plugins/index.d.ts +7 -0
  103. package/build/runtime-cjs/client/plugins/index.js +24 -0
  104. package/build/runtime-cjs/client/plugins/injectedPlugins.d.ts +3 -0
  105. package/build/runtime-cjs/{lib/errors.js → client/plugins/injectedPlugins.js} +7 -15
  106. package/build/runtime-cjs/client/plugins/mutation.d.ts +1 -0
  107. package/build/runtime-cjs/client/plugins/mutation.js +86 -0
  108. package/build/runtime-cjs/client/plugins/query.d.ts +2 -0
  109. package/build/runtime-cjs/client/plugins/query.js +83 -0
  110. package/build/runtime-cjs/client/plugins/subscription.d.ts +18 -0
  111. package/build/runtime-cjs/client/plugins/subscription.js +98 -0
  112. package/build/runtime-cjs/client/plugins/throwOnError.d.ts +7 -0
  113. package/build/runtime-cjs/client/plugins/throwOnError.js +47 -0
  114. package/build/runtime-cjs/client/utils/documentPlugins.d.ts +3 -0
  115. package/build/runtime-cjs/client/utils/documentPlugins.js +56 -0
  116. package/build/runtime-cjs/client/utils/index.d.ts +1 -0
  117. package/build/runtime-cjs/client/utils/index.js +18 -0
  118. package/build/runtime-cjs/generated.d.ts +1 -0
  119. package/build/runtime-cjs/imports/config.d.ts +3 -0
  120. package/build/runtime-cjs/imports/config.js +26 -0
  121. package/build/runtime-cjs/index.d.ts +3 -2
  122. package/build/runtime-cjs/index.js +1 -0
  123. package/build/runtime-cjs/lib/config.d.ts +26 -25
  124. package/build/runtime-cjs/lib/config.js +5 -4
  125. package/build/runtime-cjs/lib/index.d.ts +1 -2
  126. package/build/runtime-cjs/lib/index.js +1 -2
  127. package/build/runtime-cjs/lib/scalars.d.ts +6 -5
  128. package/build/runtime-cjs/lib/scalars.js +20 -24
  129. package/build/runtime-cjs/lib/selection.d.ts +1 -1
  130. package/build/runtime-cjs/lib/store.d.ts +19 -0
  131. package/build/runtime-cjs/lib/store.js +81 -0
  132. package/build/runtime-cjs/lib/types.d.ts +22 -9
  133. package/build/runtime-cjs/public/cache.d.ts +20 -7
  134. package/build/runtime-cjs/public/cache.js +29 -32
  135. package/build/runtime-cjs/public/list.d.ts +2 -2
  136. package/build/runtime-cjs/public/list.js +6 -28
  137. package/build/runtime-cjs/public/record.d.ts +18 -18
  138. package/build/runtime-cjs/public/record.js +23 -189
  139. package/build/runtime-cjs/public/tests/test.d.ts +44 -1
  140. package/build/runtime-cjs/public/tests/test.js +27 -2
  141. package/build/runtime-cjs/public/types.d.ts +8 -0
  142. package/build/runtime-esm/cache/cache.d.ts +10 -8
  143. package/build/runtime-esm/cache/cache.js +5 -11
  144. package/build/runtime-esm/cache/gc.d.ts +1 -1
  145. package/build/runtime-esm/cache/lists.d.ts +3 -2
  146. package/build/runtime-esm/cache/lists.js +5 -2
  147. package/build/runtime-esm/cache/schema.d.ts +2 -2
  148. package/build/runtime-esm/cache/stuff.d.ts +2 -2
  149. package/build/runtime-esm/cache/subscription.d.ts +19 -11
  150. package/build/runtime-esm/cache/subscription.js +95 -56
  151. package/build/runtime-esm/client/documentStore.d.ts +87 -0
  152. package/build/runtime-esm/client/documentStore.js +336 -0
  153. package/build/runtime-esm/client/index.d.ts +25 -0
  154. package/build/runtime-esm/client/index.js +58 -0
  155. package/build/runtime-esm/client/plugins/cache.d.ts +8 -0
  156. package/build/runtime-esm/client/plugins/cache.js +69 -0
  157. package/build/runtime-esm/client/plugins/fetch.d.ts +37 -0
  158. package/build/runtime-esm/client/plugins/fetch.js +151 -0
  159. package/build/runtime-esm/client/plugins/fetchParams.d.ts +9 -0
  160. package/build/runtime-esm/client/plugins/fetchParams.js +16 -0
  161. package/build/runtime-esm/client/plugins/index.d.ts +7 -0
  162. package/build/runtime-esm/client/plugins/index.js +7 -0
  163. package/build/runtime-esm/client/plugins/injectedPlugins.d.ts +3 -0
  164. package/build/runtime-esm/client/plugins/injectedPlugins.js +5 -0
  165. package/build/runtime-esm/client/plugins/mutation.d.ts +1 -0
  166. package/build/runtime-esm/client/plugins/mutation.js +56 -0
  167. package/build/runtime-esm/client/plugins/query.d.ts +2 -0
  168. package/build/runtime-esm/client/plugins/query.js +53 -0
  169. package/build/runtime-esm/client/plugins/subscription.d.ts +18 -0
  170. package/build/runtime-esm/client/plugins/subscription.js +74 -0
  171. package/build/runtime-esm/client/plugins/throwOnError.d.ts +7 -0
  172. package/build/runtime-esm/client/plugins/throwOnError.js +23 -0
  173. package/build/runtime-esm/client/utils/documentPlugins.d.ts +3 -0
  174. package/build/runtime-esm/client/utils/documentPlugins.js +32 -0
  175. package/build/runtime-esm/client/utils/index.d.ts +1 -0
  176. package/build/runtime-esm/client/utils/index.js +1 -0
  177. package/build/runtime-esm/generated.d.ts +1 -0
  178. package/build/runtime-esm/imports/config.d.ts +3 -0
  179. package/build/runtime-esm/imports/config.js +4 -0
  180. package/build/runtime-esm/index.d.ts +3 -2
  181. package/build/runtime-esm/index.js +1 -0
  182. package/build/runtime-esm/lib/config.d.ts +26 -25
  183. package/build/runtime-esm/lib/config.js +5 -4
  184. package/build/runtime-esm/lib/index.d.ts +1 -2
  185. package/build/runtime-esm/lib/index.js +1 -2
  186. package/build/runtime-esm/lib/scalars.d.ts +6 -5
  187. package/build/runtime-esm/lib/scalars.js +20 -24
  188. package/build/runtime-esm/lib/selection.d.ts +1 -1
  189. package/build/runtime-esm/lib/store.d.ts +19 -0
  190. package/build/runtime-esm/lib/store.js +57 -0
  191. package/build/runtime-esm/lib/types.d.ts +22 -9
  192. package/build/runtime-esm/public/cache.d.ts +20 -7
  193. package/build/runtime-esm/public/cache.js +28 -30
  194. package/build/runtime-esm/public/list.d.ts +2 -2
  195. package/build/runtime-esm/public/list.js +6 -28
  196. package/build/runtime-esm/public/record.d.ts +18 -18
  197. package/build/runtime-esm/public/record.js +22 -185
  198. package/build/runtime-esm/public/tests/test.d.ts +44 -1
  199. package/build/runtime-esm/public/tests/test.js +26 -1
  200. package/build/runtime-esm/public/types.d.ts +8 -0
  201. package/build/test/index.d.ts +4 -3
  202. package/build/test-cjs/index.js +1334 -2766
  203. package/build/test-esm/index.js +1334 -2766
  204. package/build/vite/ast.d.ts +1 -1
  205. package/build/vite/houdini.d.ts +1 -1
  206. package/build/vite/imports.d.ts +3 -3
  207. package/build/vite/index.d.ts +1 -1
  208. package/build/vite/schema.d.ts +1 -1
  209. package/build/vite-cjs/index.js +1395 -2821
  210. package/build/vite-esm/index.js +1395 -2821
  211. package/package.json +1 -1
  212. package/build/runtime/lib/errors.d.ts +0 -3
  213. package/build/runtime/lib/network.d.ts +0 -79
  214. package/build/runtime/lib/networkUtils.d.ts +0 -8
  215. package/build/runtime-cjs/lib/errors.d.ts +0 -3
  216. package/build/runtime-cjs/lib/network.d.ts +0 -79
  217. package/build/runtime-cjs/lib/network.js +0 -200
  218. package/build/runtime-cjs/lib/networkUtils.d.ts +0 -8
  219. package/build/runtime-esm/lib/errors.d.ts +0 -3
  220. package/build/runtime-esm/lib/errors.js +0 -11
  221. package/build/runtime-esm/lib/network.d.ts +0 -79
  222. package/build/runtime-esm/lib/network.js +0 -170
  223. package/build/runtime-esm/lib/networkUtils.d.ts +0 -8
  224. package/build/runtime-esm/lib/networkUtils.js +0 -60
@@ -9523,18 +9523,18 @@ var require_execute = __commonJS({
9523
9523
  }
9524
9524
  var returnType = fieldDef.type;
9525
9525
  var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _fieldDef$resolve : exeContext.fieldResolver;
9526
- var info2 = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path2);
9526
+ var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path2);
9527
9527
  try {
9528
9528
  var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], exeContext.variableValues);
9529
9529
  var _contextValue = exeContext.contextValue;
9530
- var result = resolveFn(source, args, _contextValue, info2);
9530
+ var result = resolveFn(source, args, _contextValue, info);
9531
9531
  var completed;
9532
9532
  if ((0, _isPromise.default)(result)) {
9533
9533
  completed = result.then(function(resolved) {
9534
- return completeValue(exeContext, returnType, fieldNodes, info2, path2, resolved);
9534
+ return completeValue(exeContext, returnType, fieldNodes, info, path2, resolved);
9535
9535
  });
9536
9536
  } else {
9537
- completed = completeValue(exeContext, returnType, fieldNodes, info2, path2, result);
9537
+ completed = completeValue(exeContext, returnType, fieldNodes, info, path2, result);
9538
9538
  }
9539
9539
  if ((0, _isPromise.default)(completed)) {
9540
9540
  return completed.then(void 0, function(rawError) {
@@ -9569,14 +9569,14 @@ var require_execute = __commonJS({
9569
9569
  exeContext.errors.push(error);
9570
9570
  return null;
9571
9571
  }
9572
- function completeValue(exeContext, returnType, fieldNodes, info2, path2, result) {
9572
+ function completeValue(exeContext, returnType, fieldNodes, info, path2, result) {
9573
9573
  if (result instanceof Error) {
9574
9574
  throw result;
9575
9575
  }
9576
9576
  if ((0, _definition.isNonNullType)(returnType)) {
9577
- var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info2, path2, result);
9577
+ var completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path2, result);
9578
9578
  if (completed === null) {
9579
- throw new Error("Cannot return null for non-nullable field ".concat(info2.parentType.name, ".").concat(info2.fieldName, "."));
9579
+ throw new Error("Cannot return null for non-nullable field ".concat(info.parentType.name, ".").concat(info.fieldName, "."));
9580
9580
  }
9581
9581
  return completed;
9582
9582
  }
@@ -9584,20 +9584,20 @@ var require_execute = __commonJS({
9584
9584
  return null;
9585
9585
  }
9586
9586
  if ((0, _definition.isListType)(returnType)) {
9587
- return completeListValue(exeContext, returnType, fieldNodes, info2, path2, result);
9587
+ return completeListValue(exeContext, returnType, fieldNodes, info, path2, result);
9588
9588
  }
9589
9589
  if ((0, _definition.isLeafType)(returnType)) {
9590
9590
  return completeLeafValue(returnType, result);
9591
9591
  }
9592
9592
  if ((0, _definition.isAbstractType)(returnType)) {
9593
- return completeAbstractValue(exeContext, returnType, fieldNodes, info2, path2, result);
9593
+ return completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result);
9594
9594
  }
9595
9595
  if ((0, _definition.isObjectType)(returnType)) {
9596
- return completeObjectValue(exeContext, returnType, fieldNodes, info2, path2, result);
9596
+ return completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result);
9597
9597
  }
9598
9598
  (0, _invariant.default)(0, "Cannot complete value of unexpected output type: " + (0, _inspect.default)(returnType));
9599
9599
  }
9600
- function completeListValue(exeContext, returnType, fieldNodes, info2, path2, result) {
9600
+ function completeListValue(exeContext, returnType, fieldNodes, info, path2, result) {
9601
9601
  var itemType = returnType.ofType;
9602
9602
  var containsPromise = false;
9603
9603
  var completedResults = (0, _safeArrayFrom.default)(result, function(item, index) {
@@ -9606,10 +9606,10 @@ var require_execute = __commonJS({
9606
9606
  var completedItem;
9607
9607
  if ((0, _isPromise.default)(item)) {
9608
9608
  completedItem = item.then(function(resolved) {
9609
- return completeValue(exeContext, itemType, fieldNodes, info2, itemPath, resolved);
9609
+ return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved);
9610
9610
  });
9611
9611
  } else {
9612
- completedItem = completeValue(exeContext, itemType, fieldNodes, info2, itemPath, item);
9612
+ completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item);
9613
9613
  }
9614
9614
  if ((0, _isPromise.default)(completedItem)) {
9615
9615
  containsPromise = true;
@@ -9625,7 +9625,7 @@ var require_execute = __commonJS({
9625
9625
  }
9626
9626
  });
9627
9627
  if (completedResults == null) {
9628
- throw new _GraphQLError.GraphQLError('Expected Iterable, but did not find one for field "'.concat(info2.parentType.name, ".").concat(info2.fieldName, '".'));
9628
+ throw new _GraphQLError.GraphQLError('Expected Iterable, but did not find one for field "'.concat(info.parentType.name, ".").concat(info.fieldName, '".'));
9629
9629
  }
9630
9630
  return containsPromise ? Promise.all(completedResults) : completedResults;
9631
9631
  }
@@ -9636,25 +9636,25 @@ var require_execute = __commonJS({
9636
9636
  }
9637
9637
  return serializedResult;
9638
9638
  }
9639
- function completeAbstractValue(exeContext, returnType, fieldNodes, info2, path2, result) {
9639
+ function completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result) {
9640
9640
  var _returnType$resolveTy;
9641
9641
  var resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : exeContext.typeResolver;
9642
9642
  var contextValue = exeContext.contextValue;
9643
- var runtimeType = resolveTypeFn(result, contextValue, info2, returnType);
9643
+ var runtimeType = resolveTypeFn(result, contextValue, info, returnType);
9644
9644
  if ((0, _isPromise.default)(runtimeType)) {
9645
9645
  return runtimeType.then(function(resolvedRuntimeType) {
9646
- return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info2, result), fieldNodes, info2, path2, result);
9646
+ return completeObjectValue(exeContext, ensureValidRuntimeType(resolvedRuntimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path2, result);
9647
9647
  });
9648
9648
  }
9649
- return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info2, result), fieldNodes, info2, path2, result);
9649
+ return completeObjectValue(exeContext, ensureValidRuntimeType(runtimeType, exeContext, returnType, fieldNodes, info, result), fieldNodes, info, path2, result);
9650
9650
  }
9651
- function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info2, result) {
9651
+ function ensureValidRuntimeType(runtimeTypeOrName, exeContext, returnType, fieldNodes, info, result) {
9652
9652
  if (runtimeTypeOrName == null) {
9653
- throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info2.parentType.name, ".").concat(info2.fieldName, '". Either the "').concat(returnType.name, '" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'), fieldNodes);
9653
+ throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info.parentType.name, ".").concat(info.fieldName, '". Either the "').concat(returnType.name, '" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'), fieldNodes);
9654
9654
  }
9655
9655
  var runtimeTypeName = (0, _definition.isNamedType)(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName;
9656
9656
  if (typeof runtimeTypeName !== "string") {
9657
- throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info2.parentType.name, ".").concat(info2.fieldName, '" with ') + "value ".concat((0, _inspect.default)(result), ', received "').concat((0, _inspect.default)(runtimeTypeOrName), '".'));
9657
+ throw new _GraphQLError.GraphQLError('Abstract type "'.concat(returnType.name, '" must resolve to an Object type at runtime for field "').concat(info.parentType.name, ".").concat(info.fieldName, '" with ') + "value ".concat((0, _inspect.default)(result), ', received "').concat((0, _inspect.default)(runtimeTypeOrName), '".'));
9658
9658
  }
9659
9659
  var runtimeType = exeContext.schema.getType(runtimeTypeName);
9660
9660
  if (runtimeType == null) {
@@ -9668,9 +9668,9 @@ var require_execute = __commonJS({
9668
9668
  }
9669
9669
  return runtimeType;
9670
9670
  }
9671
- function completeObjectValue(exeContext, returnType, fieldNodes, info2, path2, result) {
9671
+ function completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result) {
9672
9672
  if (returnType.isTypeOf) {
9673
- var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info2);
9673
+ var isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);
9674
9674
  if ((0, _isPromise.default)(isTypeOf)) {
9675
9675
  return isTypeOf.then(function(resolvedIsTypeOf) {
9676
9676
  if (!resolvedIsTypeOf) {
@@ -9704,16 +9704,16 @@ var require_execute = __commonJS({
9704
9704
  }
9705
9705
  return subFieldNodes;
9706
9706
  }
9707
- var defaultTypeResolver = function defaultTypeResolver2(value, contextValue, info2, abstractType) {
9707
+ var defaultTypeResolver = function defaultTypeResolver2(value, contextValue, info, abstractType) {
9708
9708
  if ((0, _isObjectLike.default)(value) && typeof value.__typename === "string") {
9709
9709
  return value.__typename;
9710
9710
  }
9711
- var possibleTypes = info2.schema.getPossibleTypes(abstractType);
9711
+ var possibleTypes = info.schema.getPossibleTypes(abstractType);
9712
9712
  var promisedIsTypeOfResults = [];
9713
9713
  for (var i2 = 0; i2 < possibleTypes.length; i2++) {
9714
9714
  var type = possibleTypes[i2];
9715
9715
  if (type.isTypeOf) {
9716
- var isTypeOfResult = type.isTypeOf(value, contextValue, info2);
9716
+ var isTypeOfResult = type.isTypeOf(value, contextValue, info);
9717
9717
  if ((0, _isPromise.default)(isTypeOfResult)) {
9718
9718
  promisedIsTypeOfResults[i2] = isTypeOfResult;
9719
9719
  } else if (isTypeOfResult) {
@@ -9732,11 +9732,11 @@ var require_execute = __commonJS({
9732
9732
  }
9733
9733
  };
9734
9734
  exports.defaultTypeResolver = defaultTypeResolver;
9735
- var defaultFieldResolver = function defaultFieldResolver2(source, args, contextValue, info2) {
9735
+ var defaultFieldResolver = function defaultFieldResolver2(source, args, contextValue, info) {
9736
9736
  if ((0, _isObjectLike.default)(source) || typeof source === "function") {
9737
- var property = source[info2.fieldName];
9737
+ var property = source[info.fieldName];
9738
9738
  if (typeof property === "function") {
9739
- return source[info2.fieldName](args, contextValue, info2);
9739
+ return source[info.fieldName](args, contextValue, info);
9740
9740
  }
9741
9741
  return property;
9742
9742
  }
@@ -10756,13 +10756,13 @@ var require_subscribe = __commonJS({
10756
10756
  throw new _GraphQLError.GraphQLError('The subscription field "'.concat(fieldName, '" is not defined.'), fieldNodes);
10757
10757
  }
10758
10758
  var path2 = (0, _Path.addPath)(void 0, responseName, type.name);
10759
- var info2 = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path2);
10759
+ var info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path2);
10760
10760
  return new Promise(function(resolveResult) {
10761
10761
  var _fieldDef$subscribe;
10762
10762
  var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], variableValues);
10763
10763
  var contextValue = exeContext.contextValue;
10764
10764
  var resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.fieldResolver;
10765
- resolveResult(resolveFn(rootValue, args, contextValue, info2));
10765
+ resolveResult(resolveFn(rootValue, args, contextValue, info));
10766
10766
  }).then(function(eventStream) {
10767
10767
  if (eventStream instanceof Error) {
10768
10768
  throw (0, _locatedError.locatedError)(eventStream, fieldNodes, (0, _Path.pathToArray)(path2));
@@ -20570,42 +20570,42 @@ var require_node = __commonJS({
20570
20570
  return Link2;
20571
20571
  }(events_1.EventEmitter);
20572
20572
  exports.Link = Link;
20573
- var File4 = function() {
20574
- function File5(link, node, flags, fd) {
20573
+ var File3 = function() {
20574
+ function File4(link, node, flags, fd) {
20575
20575
  this.position = 0;
20576
20576
  this.link = link;
20577
20577
  this.node = node;
20578
20578
  this.flags = flags;
20579
20579
  this.fd = fd;
20580
20580
  }
20581
- File5.prototype.getString = function(encoding) {
20581
+ File4.prototype.getString = function(encoding) {
20582
20582
  if (encoding === void 0) {
20583
20583
  encoding = "utf8";
20584
20584
  }
20585
20585
  return this.node.getString();
20586
20586
  };
20587
- File5.prototype.setString = function(str) {
20587
+ File4.prototype.setString = function(str) {
20588
20588
  this.node.setString(str);
20589
20589
  };
20590
- File5.prototype.getBuffer = function() {
20590
+ File4.prototype.getBuffer = function() {
20591
20591
  return this.node.getBuffer();
20592
20592
  };
20593
- File5.prototype.setBuffer = function(buf) {
20593
+ File4.prototype.setBuffer = function(buf) {
20594
20594
  this.node.setBuffer(buf);
20595
20595
  };
20596
- File5.prototype.getSize = function() {
20596
+ File4.prototype.getSize = function() {
20597
20597
  return this.node.getSize();
20598
20598
  };
20599
- File5.prototype.truncate = function(len) {
20599
+ File4.prototype.truncate = function(len) {
20600
20600
  this.node.truncate(len);
20601
20601
  };
20602
- File5.prototype.seekTo = function(position) {
20602
+ File4.prototype.seekTo = function(position) {
20603
20603
  this.position = position;
20604
20604
  };
20605
- File5.prototype.stats = function() {
20605
+ File4.prototype.stats = function() {
20606
20606
  return Stats_1.default.build(this.node);
20607
20607
  };
20608
- File5.prototype.write = function(buf, offset, length, position) {
20608
+ File4.prototype.write = function(buf, offset, length, position) {
20609
20609
  if (offset === void 0) {
20610
20610
  offset = 0;
20611
20611
  }
@@ -20620,7 +20620,7 @@ var require_node = __commonJS({
20620
20620
  this.position = position + bytes;
20621
20621
  return bytes;
20622
20622
  };
20623
- File5.prototype.read = function(buf, offset, length, position) {
20623
+ File4.prototype.read = function(buf, offset, length, position) {
20624
20624
  if (offset === void 0) {
20625
20625
  offset = 0;
20626
20626
  }
@@ -20633,15 +20633,15 @@ var require_node = __commonJS({
20633
20633
  this.position = position + bytes;
20634
20634
  return bytes;
20635
20635
  };
20636
- File5.prototype.chmod = function(perm) {
20636
+ File4.prototype.chmod = function(perm) {
20637
20637
  this.node.chmod(perm);
20638
20638
  };
20639
- File5.prototype.chown = function(uid, gid) {
20639
+ File4.prototype.chown = function(uid, gid) {
20640
20640
  this.node.chown(uid, gid);
20641
20641
  };
20642
- return File5;
20642
+ return File4;
20643
20643
  }();
20644
- exports.File = File4;
20644
+ exports.File = File3;
20645
20645
  }
20646
20646
  });
20647
20647
 
@@ -26750,9 +26750,9 @@ var require_streams = __commonJS({
26750
26750
  }
26751
26751
  }
26752
26752
  try {
26753
- const { Blob: Blob4 } = __require("buffer");
26754
- if (Blob4 && !Blob4.prototype.stream) {
26755
- Blob4.prototype.stream = function name(params) {
26753
+ const { Blob: Blob3 } = __require("buffer");
26754
+ if (Blob3 && !Blob3.prototype.stream) {
26755
+ Blob3.prototype.stream = function name(params) {
26756
26756
  let position = 0;
26757
26757
  const blob = this;
26758
26758
  return new ReadableStream({
@@ -26803,12 +26803,12 @@ async function* toIterator(parts, clone2 = true) {
26803
26803
  }
26804
26804
  }
26805
26805
  }
26806
- var import_streams, POOL_SIZE, _Blob, Blob3, fetch_blob_default;
26806
+ var import_streams, POOL_SIZE, _Blob, Blob2, fetch_blob_default;
26807
26807
  var init_fetch_blob = __esm({
26808
26808
  "../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/index.js"() {
26809
26809
  import_streams = __toESM(require_streams(), 1);
26810
26810
  POOL_SIZE = 65536;
26811
- _Blob = class Blob2 {
26811
+ _Blob = class Blob {
26812
26812
  #parts = [];
26813
26813
  #type = "";
26814
26814
  #size = 0;
@@ -26832,7 +26832,7 @@ var init_fetch_blob = __esm({
26832
26832
  part = new Uint8Array(element.buffer.slice(element.byteOffset, element.byteOffset + element.byteLength));
26833
26833
  } else if (element instanceof ArrayBuffer) {
26834
26834
  part = new Uint8Array(element.slice(0));
26835
- } else if (element instanceof Blob2) {
26835
+ } else if (element instanceof Blob) {
26836
26836
  part = element;
26837
26837
  } else {
26838
26838
  part = encoder.encode(`${element}`);
@@ -26911,7 +26911,7 @@ var init_fetch_blob = __esm({
26911
26911
  relativeStart = 0;
26912
26912
  }
26913
26913
  }
26914
- const blob = new Blob2([], { type: String(type).toLowerCase() });
26914
+ const blob = new Blob([], { type: String(type).toLowerCase() });
26915
26915
  blob.#size = span;
26916
26916
  blob.#parts = blobParts;
26917
26917
  return blob;
@@ -26928,17 +26928,17 @@ var init_fetch_blob = __esm({
26928
26928
  type: { enumerable: true },
26929
26929
  slice: { enumerable: true }
26930
26930
  });
26931
- Blob3 = _Blob;
26932
- fetch_blob_default = Blob3;
26931
+ Blob2 = _Blob;
26932
+ fetch_blob_default = Blob2;
26933
26933
  }
26934
26934
  });
26935
26935
 
26936
26936
  // ../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js
26937
- var _File, File3, file_default;
26937
+ var _File, File2, file_default;
26938
26938
  var init_file = __esm({
26939
26939
  "../../node_modules/.pnpm/fetch-blob@3.2.0/node_modules/fetch-blob/file.js"() {
26940
26940
  init_fetch_blob();
26941
- _File = class File2 extends fetch_blob_default {
26941
+ _File = class File extends fetch_blob_default {
26942
26942
  #lastModified = 0;
26943
26943
  #name = "";
26944
26944
  constructor(fileBits, fileName, options = {}) {
@@ -26967,8 +26967,8 @@ var init_file = __esm({
26967
26967
  return !!object && object instanceof fetch_blob_default && /^(File)$/.test(object[Symbol.toStringTag]);
26968
26968
  }
26969
26969
  };
26970
- File3 = _File;
26971
- file_default = File3;
26970
+ File2 = _File;
26971
+ file_default = File2;
26972
26972
  }
26973
26973
  });
26974
26974
 
@@ -26986,7 +26986,7 @@ Content-Type: ${v.type || "application/octet-stream"}\r
26986
26986
  c.push(`--${b}--`);
26987
26987
  return new B(c, { type: "multipart/form-data; boundary=" + b });
26988
26988
  }
26989
- var t, i, h, r, m, f, e, x, FormData2;
26989
+ var t, i, h, r, m, f, e, x, FormData;
26990
26990
  var init_esm_min = __esm({
26991
26991
  "../../node_modules/.pnpm/formdata-polyfill@4.0.10/node_modules/formdata-polyfill/esm.min.js"() {
26992
26992
  init_fetch_blob();
@@ -27001,7 +27001,7 @@ var init_esm_min = __esm({
27001
27001
  throw new TypeError(`Failed to execute '${n}' on 'FormData': ${e2} arguments required, but only ${a.length} present.`);
27002
27002
  }
27003
27003
  };
27004
- FormData2 = class FormData3 {
27004
+ FormData = class FormData2 {
27005
27005
  #d = [];
27006
27006
  constructor(...a) {
27007
27007
  if (a.length)
@@ -27167,7 +27167,7 @@ async function toFormData(Body2, ct) {
27167
27167
  let contentType;
27168
27168
  let filename;
27169
27169
  const entryChunks = [];
27170
- const formData = new FormData2();
27170
+ const formData = new FormData();
27171
27171
  const onPartData = (ui8a) => {
27172
27172
  entryValue += decoder.decode(ui8a, { stream: true });
27173
27173
  };
@@ -54378,18 +54378,18 @@ var require_lines = __commonJS({
54378
54378
  assert_1.default.strictEqual(typeof pos, "object");
54379
54379
  assert_1.default.strictEqual(typeof pos.line, "number");
54380
54380
  assert_1.default.strictEqual(typeof pos.column, "number");
54381
- var line = pos.line, column = pos.column, secret = this, infos = secret.infos, info2 = infos[line - 1], c = column;
54382
- if (typeof info2 === "undefined" || c < 0)
54381
+ var line = pos.line, column = pos.column, secret = this, infos = secret.infos, info = infos[line - 1], c = column;
54382
+ if (typeof info === "undefined" || c < 0)
54383
54383
  return "";
54384
54384
  var indent2 = this.getIndentAt(line);
54385
54385
  if (c < indent2)
54386
54386
  return " ";
54387
- c += info2.sliceStart - indent2;
54388
- if (c === info2.sliceEnd && line < this.length)
54387
+ c += info.sliceStart - indent2;
54388
+ if (c === info.sliceEnd && line < this.length)
54389
54389
  return "\n";
54390
- if (c >= info2.sliceEnd)
54390
+ if (c >= info.sliceEnd)
54391
54391
  return "";
54392
- return info2.line.charAt(c);
54392
+ return info.line.charAt(c);
54393
54393
  };
54394
54394
  Lines2.prototype.stripMargin = function(width, skipFirstLine) {
54395
54395
  if (width === 0)
@@ -54397,11 +54397,11 @@ var require_lines = __commonJS({
54397
54397
  assert_1.default.ok(width > 0, "negative margin: " + width);
54398
54398
  if (skipFirstLine && this.length === 1)
54399
54399
  return this;
54400
- var lines = new Lines2(this.infos.map(function(info2, i2) {
54401
- if (info2.line && (i2 > 0 || !skipFirstLine)) {
54402
- info2 = tslib_1.__assign(tslib_1.__assign({}, info2), { indent: Math.max(0, info2.indent - width) });
54400
+ var lines = new Lines2(this.infos.map(function(info, i2) {
54401
+ if (info.line && (i2 > 0 || !skipFirstLine)) {
54402
+ info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: Math.max(0, info.indent - width) });
54403
54403
  }
54404
- return info2;
54404
+ return info;
54405
54405
  }));
54406
54406
  if (this.mappings.length > 0) {
54407
54407
  var newMappings_1 = lines.mappings;
@@ -54416,11 +54416,11 @@ var require_lines = __commonJS({
54416
54416
  if (by === 0) {
54417
54417
  return this;
54418
54418
  }
54419
- var lines = new Lines2(this.infos.map(function(info2) {
54420
- if (info2.line && !info2.locked) {
54421
- info2 = tslib_1.__assign(tslib_1.__assign({}, info2), { indent: info2.indent + by });
54419
+ var lines = new Lines2(this.infos.map(function(info) {
54420
+ if (info.line && !info.locked) {
54421
+ info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by });
54422
54422
  }
54423
- return info2;
54423
+ return info;
54424
54424
  }));
54425
54425
  if (this.mappings.length > 0) {
54426
54426
  var newMappings_2 = lines.mappings;
@@ -54438,11 +54438,11 @@ var require_lines = __commonJS({
54438
54438
  if (this.length < 2) {
54439
54439
  return this;
54440
54440
  }
54441
- var lines = new Lines2(this.infos.map(function(info2, i2) {
54442
- if (i2 > 0 && info2.line && !info2.locked) {
54443
- info2 = tslib_1.__assign(tslib_1.__assign({}, info2), { indent: info2.indent + by });
54441
+ var lines = new Lines2(this.infos.map(function(info, i2) {
54442
+ if (i2 > 0 && info.line && !info.locked) {
54443
+ info = tslib_1.__assign(tslib_1.__assign({}, info), { indent: info.indent + by });
54444
54444
  }
54445
- return info2;
54445
+ return info;
54446
54446
  }));
54447
54447
  if (this.mappings.length > 0) {
54448
54448
  var newMappings_3 = lines.mappings;
@@ -54457,8 +54457,8 @@ var require_lines = __commonJS({
54457
54457
  if (this.length < 2) {
54458
54458
  return this;
54459
54459
  }
54460
- return new Lines2(this.infos.map(function(info2, i2) {
54461
- return tslib_1.__assign(tslib_1.__assign({}, info2), { locked: i2 > 0 });
54460
+ return new Lines2(this.infos.map(function(info, i2) {
54461
+ return tslib_1.__assign(tslib_1.__assign({}, info), { locked: i2 > 0 });
54462
54462
  }));
54463
54463
  };
54464
54464
  Lines2.prototype.getIndentAt = function(line) {
@@ -54472,14 +54472,14 @@ var require_lines = __commonJS({
54472
54472
  var counts = [];
54473
54473
  var lastIndent = 0;
54474
54474
  for (var line = 1, last = this.length; line <= last; ++line) {
54475
- var info2 = this.infos[line - 1];
54476
- var sliced = info2.line.slice(info2.sliceStart, info2.sliceEnd);
54475
+ var info = this.infos[line - 1];
54476
+ var sliced = info.line.slice(info.sliceStart, info.sliceEnd);
54477
54477
  if (isOnlyWhitespace(sliced)) {
54478
54478
  continue;
54479
54479
  }
54480
- var diff = Math.abs(info2.indent - lastIndent);
54480
+ var diff = Math.abs(info.indent - lastIndent);
54481
54481
  counts[diff] = ~~counts[diff] + 1;
54482
- lastIndent = info2.indent;
54482
+ lastIndent = info.indent;
54483
54483
  }
54484
54484
  var maxCount = -1;
54485
54485
  var result = 2;
@@ -54502,20 +54502,20 @@ var require_lines = __commonJS({
54502
54502
  return isOnlyWhitespace(this.toString());
54503
54503
  };
54504
54504
  Lines2.prototype.isPrecededOnlyByWhitespace = function(pos) {
54505
- var info2 = this.infos[pos.line - 1];
54506
- var indent2 = Math.max(info2.indent, 0);
54505
+ var info = this.infos[pos.line - 1];
54506
+ var indent2 = Math.max(info.indent, 0);
54507
54507
  var diff = pos.column - indent2;
54508
54508
  if (diff <= 0) {
54509
54509
  return true;
54510
54510
  }
54511
- var start = info2.sliceStart;
54512
- var end = Math.min(start + diff, info2.sliceEnd);
54513
- var prefix = info2.line.slice(start, end);
54511
+ var start = info.sliceStart;
54512
+ var end = Math.min(start + diff, info.sliceEnd);
54513
+ var prefix = info.line.slice(start, end);
54514
54514
  return isOnlyWhitespace(prefix);
54515
54515
  };
54516
54516
  Lines2.prototype.getLineLength = function(line) {
54517
- var info2 = this.infos[line - 1];
54518
- return this.getIndentAt(line) + info2.sliceEnd - info2.sliceStart;
54517
+ var info = this.infos[line - 1];
54518
+ return this.getIndentAt(line) + info.sliceEnd - info.sliceStart;
54519
54519
  };
54520
54520
  Lines2.prototype.nextPos = function(pos, skipSpaces) {
54521
54521
  if (skipSpaces === void 0) {
@@ -54681,20 +54681,20 @@ var require_lines = __commonJS({
54681
54681
  var _a = (0, options_1.normalize)(options), tabWidth = _a.tabWidth, useTabs = _a.useTabs, reuseWhitespace = _a.reuseWhitespace, lineTerminator = _a.lineTerminator;
54682
54682
  var parts = [];
54683
54683
  for (var line = start.line; line <= end.line; ++line) {
54684
- var info2 = this.infos[line - 1];
54684
+ var info = this.infos[line - 1];
54685
54685
  if (line === start.line) {
54686
54686
  if (line === end.line) {
54687
- info2 = sliceInfo(info2, start.column, end.column);
54687
+ info = sliceInfo(info, start.column, end.column);
54688
54688
  } else {
54689
- info2 = sliceInfo(info2, start.column);
54689
+ info = sliceInfo(info, start.column);
54690
54690
  }
54691
54691
  } else if (line === end.line) {
54692
- info2 = sliceInfo(info2, 0, end.column);
54692
+ info = sliceInfo(info, 0, end.column);
54693
54693
  }
54694
- var indent2 = Math.max(info2.indent, 0);
54695
- var before_1 = info2.line.slice(0, info2.sliceStart);
54694
+ var indent2 = Math.max(info.indent, 0);
54695
+ var before_1 = info.line.slice(0, info.sliceStart);
54696
54696
  if (reuseWhitespace && isOnlyWhitespace(before_1) && countSpaces(before_1, tabWidth) === indent2) {
54697
- parts.push(info2.line.slice(0, info2.sliceEnd));
54697
+ parts.push(info.line.slice(0, info.sliceEnd));
54698
54698
  continue;
54699
54699
  }
54700
54700
  var tabs = 0;
@@ -54710,7 +54710,7 @@ var require_lines = __commonJS({
54710
54710
  if (spaces > 0) {
54711
54711
  result += new Array(spaces + 1).join(" ");
54712
54712
  }
54713
- result += info2.line.slice(info2.sliceStart, info2.sliceEnd);
54713
+ result += info.line.slice(info.sliceStart, info.sliceEnd);
54714
54714
  parts.push(result);
54715
54715
  }
54716
54716
  return parts.join(lineTerminator);
@@ -54728,12 +54728,12 @@ var require_lines = __commonJS({
54728
54728
  return;
54729
54729
  }
54730
54730
  if (prevInfo) {
54731
- var info2 = linesOrNull.infos[0];
54732
- var indent2 = new Array(info2.indent + 1).join(" ");
54731
+ var info = linesOrNull.infos[0];
54732
+ var indent2 = new Array(info.indent + 1).join(" ");
54733
54733
  var prevLine_1 = infos.length;
54734
54734
  var prevColumn_1 = Math.max(prevInfo.indent, 0) + prevInfo.sliceEnd - prevInfo.sliceStart;
54735
- prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent2 + info2.line.slice(info2.sliceStart, info2.sliceEnd);
54736
- prevInfo.locked = prevInfo.locked || info2.locked;
54735
+ prevInfo.line = prevInfo.line.slice(0, prevInfo.sliceEnd) + indent2 + info.line.slice(info.sliceStart, info.sliceEnd);
54736
+ prevInfo.locked = prevInfo.locked || info.locked;
54737
54737
  prevInfo.sliceEnd = prevInfo.line.length;
54738
54738
  if (linesOrNull.mappings.length > 0) {
54739
54739
  linesOrNull.mappings.forEach(function(mapping) {
@@ -54743,9 +54743,9 @@ var require_lines = __commonJS({
54743
54743
  } else if (linesOrNull.mappings.length > 0) {
54744
54744
  mappings.push.apply(mappings, linesOrNull.mappings);
54745
54745
  }
54746
- linesOrNull.infos.forEach(function(info3, i2) {
54746
+ linesOrNull.infos.forEach(function(info2, i2) {
54747
54747
  if (!prevInfo || i2 > 0) {
54748
- prevInfo = tslib_1.__assign({}, info3);
54748
+ prevInfo = tslib_1.__assign({}, info2);
54749
54749
  infos.push(prevInfo);
54750
54750
  }
54751
54751
  });
@@ -54849,10 +54849,10 @@ var require_lines = __commonJS({
54849
54849
  function isOnlyWhitespace(string) {
54850
54850
  return !/\S/.test(string);
54851
54851
  }
54852
- function sliceInfo(info2, startCol, endCol) {
54853
- var sliceStart = info2.sliceStart;
54854
- var sliceEnd = info2.sliceEnd;
54855
- var indent2 = Math.max(info2.indent, 0);
54852
+ function sliceInfo(info, startCol, endCol) {
54853
+ var sliceStart = info.sliceStart;
54854
+ var sliceEnd = info.sliceEnd;
54855
+ var indent2 = Math.max(info.indent, 0);
54856
54856
  var lineLength = indent2 + sliceEnd - sliceStart;
54857
54857
  if (typeof endCol === "undefined") {
54858
54858
  endCol = lineLength;
@@ -54878,11 +54878,11 @@ var require_lines = __commonJS({
54878
54878
  assert_1.default.ok(indent2 >= 0);
54879
54879
  assert_1.default.ok(sliceStart <= sliceEnd);
54880
54880
  assert_1.default.strictEqual(lineLength, indent2 + sliceEnd - sliceStart);
54881
- if (info2.indent === indent2 && info2.sliceStart === sliceStart && info2.sliceEnd === sliceEnd) {
54882
- return info2;
54881
+ if (info.indent === indent2 && info.sliceStart === sliceStart && info.sliceEnd === sliceEnd) {
54882
+ return info;
54883
54883
  }
54884
54884
  return {
54885
- line: info2.line,
54885
+ line: info.line,
54886
54886
  indent: indent2,
54887
54887
  locked: false,
54888
54888
  sliceStart,
@@ -57889,9 +57889,9 @@ var require_printer2 = __commonJS({
57889
57889
  var prevTrailingSpace = null;
57890
57890
  var len = filtered.length;
57891
57891
  var parts = [];
57892
- filtered.forEach(function(info2, i2) {
57893
- var printed = info2.printed;
57894
- var stmt = info2.node;
57892
+ filtered.forEach(function(info, i2) {
57893
+ var printed = info.printed;
57894
+ var stmt = info.node;
57895
57895
  var multiLine = printed.length > 1;
57896
57896
  var notFirst = i2 > 0;
57897
57897
  var notLast = i2 < len - 1;
@@ -61417,6 +61417,9 @@ var graphql2 = __toESM(require_graphql2(), 1);
61417
61417
  var import_minimatch = __toESM(require_minimatch(), 1);
61418
61418
  import { fileURLToPath, pathToFileURL } from "url";
61419
61419
 
61420
+ // src/runtime/imports/config.ts
61421
+ var config_default = {};
61422
+
61420
61423
  // src/runtime/lib/config.ts
61421
61424
  var mockConfig = null;
61422
61425
  function getMockConfig() {
@@ -61452,1726 +61455,13 @@ function computeID(configFile, type, data) {
61452
61455
  }
61453
61456
  return id.slice(0, -2);
61454
61457
  }
61455
- async function getCurrentConfig() {
61458
+ function getCurrentConfig() {
61456
61459
  const mockConfig2 = getMockConfig();
61457
61460
  if (mockConfig2) {
61458
61461
  return mockConfig2;
61459
61462
  }
61460
- return defaultConfigValues((await import("HOUDINI_CONFIG_PATH")).default);
61461
- }
61462
-
61463
- // src/runtime/lib/deepEquals.ts
61464
- function deepEquals(objA, objB, map = /* @__PURE__ */ new WeakMap()) {
61465
- if (Object.is(objA, objB))
61466
- return true;
61467
- if (objA instanceof Date && objB instanceof Date) {
61468
- return objA.getTime() === objB.getTime();
61469
- }
61470
- if (objA instanceof RegExp && objB instanceof RegExp) {
61471
- return objA.toString() === objB.toString();
61472
- }
61473
- if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
61474
- return false;
61475
- }
61476
- if (map.get(objA) === objB)
61477
- return true;
61478
- map.set(objA, objB);
61479
- const keysA = Reflect.ownKeys(objA);
61480
- const keysB = Reflect.ownKeys(objB);
61481
- if (keysA.length !== keysB.length) {
61482
- return false;
61483
- }
61484
- for (let i2 = 0; i2 < keysA.length; i2++) {
61485
- if (!Reflect.has(objB, keysA[i2]) || !deepEquals(objA[keysA[i2]], objB[keysA[i2]], map)) {
61486
- return false;
61487
- }
61488
- }
61489
- return true;
61490
- }
61491
-
61492
- // src/runtime/lib/selection.ts
61493
- function getFieldsForType(selection, __typename) {
61494
- let targetSelection = selection.fields || {};
61495
- if (selection.abstractFields && __typename) {
61496
- const mappedType = selection.abstractFields.typeMap[__typename];
61497
- if (mappedType) {
61498
- targetSelection = selection.abstractFields.fields[mappedType];
61499
- } else if (selection.abstractFields.fields[__typename]) {
61500
- targetSelection = selection.abstractFields.fields[__typename];
61501
- }
61502
- }
61503
- return targetSelection;
61504
- }
61505
-
61506
- // src/runtime/cache/gc.ts
61507
- var GarbageCollector = class {
61508
- cache;
61509
- lifetimes = /* @__PURE__ */ new Map();
61510
- get cacheBufferSize() {
61511
- return this.cache._internal_unstable.config.cacheBufferSize ?? 10;
61512
- }
61513
- constructor(cache) {
61514
- this.cache = cache;
61515
- }
61516
- resetLifetime(id, field) {
61517
- if (!this.lifetimes.get(id)) {
61518
- this.lifetimes.set(id, /* @__PURE__ */ new Map());
61519
- }
61520
- this.lifetimes.get(id).set(field, 0);
61521
- }
61522
- tick() {
61523
- for (const [id, fieldMap] of this.lifetimes.entries()) {
61524
- for (const [field, lifetime] of fieldMap.entries()) {
61525
- if (this.cache._internal_unstable.subscriptions.get(id, field).length > 0) {
61526
- continue;
61527
- }
61528
- fieldMap.set(field, lifetime + 1);
61529
- if (fieldMap.get(field) > this.cacheBufferSize) {
61530
- this.cache._internal_unstable.storage.deleteField(id, field);
61531
- this.cache._internal_unstable.lists.deleteField(id, field);
61532
- fieldMap.delete(field);
61533
- if ([...fieldMap.keys()].length === 0) {
61534
- this.lifetimes.delete(id);
61535
- }
61536
- }
61537
- }
61538
- }
61539
- }
61540
- };
61541
-
61542
- // src/runtime/cache/stuff.ts
61543
- function flattenList(source) {
61544
- const flat = [];
61545
- const unvisited = [source || []];
61546
- while (unvisited.length > 0) {
61547
- const target = unvisited.shift();
61548
- for (const id of target) {
61549
- if (Array.isArray(id)) {
61550
- unvisited.push(id);
61551
- continue;
61552
- }
61553
- flat.push(id);
61554
- }
61555
- }
61556
- return flat;
61557
- }
61558
- function evaluateKey(key, variables = {}) {
61559
- let evaluated = "";
61560
- let varName = "";
61561
- let inString = false;
61562
- for (const char of key) {
61563
- if (varName) {
61564
- if (varChars.includes(char)) {
61565
- varName += char;
61566
- continue;
61567
- }
61568
- const value = variables[varName.slice(1)];
61569
- evaluated += typeof value !== "undefined" ? JSON.stringify(value) : "undefined";
61570
- varName = "";
61571
- }
61572
- if (char === "$" && !inString) {
61573
- varName = "$";
61574
- continue;
61575
- }
61576
- if (char === '"') {
61577
- inString = !inString;
61578
- }
61579
- evaluated += char;
61580
- }
61581
- return evaluated;
61582
- }
61583
- var varChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789";
61584
-
61585
- // src/runtime/cache/lists.ts
61586
- var ListManager = class {
61587
- rootID;
61588
- cache;
61589
- constructor(cache, rootID2) {
61590
- this.rootID = rootID2;
61591
- this.cache = cache;
61592
- }
61593
- lists = /* @__PURE__ */ new Map();
61594
- listsByField = /* @__PURE__ */ new Map();
61595
- get(listName, id, allLists) {
61596
- const matches = this.lists.get(listName);
61597
- if (!matches || matches.size === 0) {
61598
- return null;
61599
- }
61600
- if (allLists) {
61601
- return new ListCollection(
61602
- Array.from(matches, ([key, value]) => [...value.lists]).flat()
61603
- );
61604
- }
61605
- const head = [...matches.values()][0];
61606
- const { recordType } = head.lists[0];
61607
- const parentID = id ? this.cache._internal_unstable.id(recordType || "", id) : this.rootID;
61608
- if (matches?.size === 1) {
61609
- if (!id) {
61610
- return head;
61611
- }
61612
- return parentID === Array.from(matches.keys())[0] ? head : null;
61613
- }
61614
- if (!id) {
61615
- console.error(
61616
- `Found multiple instances of "${listName}". Please provide one of @parentID or @allLists directives to help identify which list you want modify. For more information, visit this guide: https://www.houdinigraphql.com/api/graphql#parentidvalue-string `
61617
- );
61618
- return null;
61619
- }
61620
- return this.lists.get(listName)?.get(parentID);
61621
- }
61622
- remove(listName, id) {
61623
- this.lists.get(listName)?.delete(id || this.rootID);
61624
- }
61625
- add(list) {
61626
- if (!this.lists.has(list.name)) {
61627
- this.lists.set(list.name, /* @__PURE__ */ new Map());
61628
- }
61629
- const name = list.name;
61630
- const parentID = list.recordID || this.rootID;
61631
- if (this.lists.get(name)?.get(parentID)?.includes(list.key)) {
61632
- return;
61633
- }
61634
- if (!this.lists.has(name)) {
61635
- this.lists.set(name, /* @__PURE__ */ new Map());
61636
- }
61637
- if (!this.lists.get(name).has(parentID)) {
61638
- this.lists.get(name).set(parentID, new ListCollection([]));
61639
- }
61640
- if (!this.listsByField.has(parentID)) {
61641
- this.listsByField.set(parentID, /* @__PURE__ */ new Map());
61642
- }
61643
- if (!this.listsByField.get(parentID).has(list.key)) {
61644
- this.listsByField.get(parentID)?.set(list.key, []);
61645
- }
61646
- const handler = new List({ ...list, manager: this });
61647
- this.lists.get(list.name).get(parentID).lists.push(handler);
61648
- this.listsByField.get(parentID).get(list.key).push(handler);
61649
- }
61650
- removeIDFromAllLists(id) {
61651
- for (const fieldMap of this.lists.values()) {
61652
- for (const list of fieldMap.values()) {
61653
- list.removeID(id);
61654
- }
61655
- }
61656
- }
61657
- deleteField(parentID, field) {
61658
- if (!this.listsByField.get(parentID)?.has(field)) {
61659
- return;
61660
- }
61661
- for (const list of this.listsByField.get(parentID).get(field)) {
61662
- this.lists.get(list.name)?.get(list.recordID)?.deleteListWithKey(field);
61663
- if (this.lists.get(list.name)?.get(list.recordID)?.lists.length === 0) {
61664
- this.lists.get(list.name)?.delete(list.recordID);
61665
- }
61666
- }
61667
- this.listsByField.get(parentID).delete(field);
61668
- }
61669
- };
61670
- var List = class {
61671
- recordID;
61672
- recordType;
61673
- key;
61674
- type;
61675
- cache;
61676
- selection;
61677
- _when;
61678
- filters;
61679
- name;
61680
- connection;
61681
- manager;
61682
- abstract;
61683
- constructor({
61684
- name,
61685
- recordID,
61686
- recordType,
61687
- key,
61688
- listType,
61689
- selection,
61690
- when,
61691
- filters,
61692
- connection,
61693
- manager,
61694
- abstract
61695
- }) {
61696
- this.recordID = recordID || rootID;
61697
- this.recordType = recordType;
61698
- this.key = key;
61699
- this.type = listType;
61700
- this.cache = manager.cache;
61701
- this.selection = selection;
61702
- this._when = when;
61703
- this.filters = filters;
61704
- this.name = name;
61705
- this.connection = connection;
61706
- this.manager = manager;
61707
- this.abstract = abstract;
61708
- }
61709
- when(when) {
61710
- return this.manager.lists.get(this.name).get(this.recordID).when(when);
61711
- }
61712
- append(selection, data, variables = {}) {
61713
- return this.addToList(selection, data, variables, "last");
61714
- }
61715
- prepend(selection, data, variables = {}) {
61716
- return this.addToList(selection, data, variables, "first");
61717
- }
61718
- addToList(selection, data, variables = {}, where) {
61719
- const listType = this.listType(data);
61720
- const dataID = this.cache._internal_unstable.id(listType, data);
61721
- if (!this.validateWhen() || !dataID) {
61722
- return;
61723
- }
61724
- let insertSelection = selection;
61725
- let insertData = data;
61726
- if (this.connection) {
61727
- insertSelection = {
61728
- fields: {
61729
- newEntry: {
61730
- keyRaw: this.key,
61731
- type: "Connection",
61732
- selection: {
61733
- fields: {
61734
- edges: {
61735
- keyRaw: "edges",
61736
- type: "ConnectionEdge",
61737
- update: where === "first" ? "prepend" : "append",
61738
- selection: {
61739
- fields: {
61740
- node: {
61741
- type: listType,
61742
- keyRaw: "node",
61743
- selection: {
61744
- ...selection,
61745
- fields: {
61746
- ...selection.fields,
61747
- __typename: {
61748
- keyRaw: "__typename",
61749
- type: "String"
61750
- }
61751
- }
61752
- }
61753
- }
61754
- }
61755
- }
61756
- }
61757
- }
61758
- }
61759
- }
61760
- }
61761
- };
61762
- insertData = {
61763
- newEntry: {
61764
- edges: [{ node: { ...data, __typename: listType } }]
61765
- }
61766
- };
61767
- } else {
61768
- insertSelection = {
61769
- fields: {
61770
- newEntries: {
61771
- keyRaw: this.key,
61772
- type: listType,
61773
- update: where === "first" ? "prepend" : "append",
61774
- selection: {
61775
- ...selection,
61776
- fields: {
61777
- ...selection.fields,
61778
- __typename: {
61779
- keyRaw: "__typename",
61780
- type: "String"
61781
- }
61782
- }
61783
- }
61784
- }
61785
- }
61786
- };
61787
- insertData = {
61788
- newEntries: [{ ...data, __typename: listType }]
61789
- };
61790
- }
61791
- this.cache.write({
61792
- selection: insertSelection,
61793
- data: insertData,
61794
- variables,
61795
- parent: this.recordID,
61796
- applyUpdates: true
61797
- });
61798
- }
61799
- removeID(id, variables = {}) {
61800
- if (!this.validateWhen()) {
61801
- return;
61802
- }
61803
- let parentID = this.recordID;
61804
- let targetID = id;
61805
- let targetKey = this.key;
61806
- if (this.connection) {
61807
- const { value: embeddedConnection } = this.cache._internal_unstable.storage.get(
61808
- this.recordID,
61809
- this.key
61810
- );
61811
- if (!embeddedConnection) {
61812
- return;
61813
- }
61814
- const embeddedConnectionID = embeddedConnection;
61815
- const { value: edges } = this.cache._internal_unstable.storage.get(
61816
- embeddedConnectionID,
61817
- "edges"
61818
- );
61819
- for (const edge of flattenList(edges) || []) {
61820
- if (!edge) {
61821
- continue;
61822
- }
61823
- const edgeID = edge;
61824
- const { value: nodeID } = this.cache._internal_unstable.storage.get(edgeID, "node");
61825
- if (!nodeID) {
61826
- continue;
61827
- }
61828
- if (nodeID === id) {
61829
- targetID = edgeID;
61830
- }
61831
- }
61832
- parentID = embeddedConnectionID;
61833
- targetKey = "edges";
61834
- }
61835
- let value = this.cache._internal_unstable.storage.get(parentID, targetKey).value;
61836
- if (!value || !value.includes(targetID)) {
61837
- return;
61838
- }
61839
- const subscribers = this.cache._internal_unstable.subscriptions.get(this.recordID, this.key);
61840
- this.cache._internal_unstable.subscriptions.remove(
61841
- targetID,
61842
- this.connection ? this.selection.fields.edges.selection : this.selection,
61843
- subscribers,
61844
- variables
61845
- );
61846
- this.cache._internal_unstable.storage.remove(parentID, targetKey, targetID);
61847
- for (const spec of subscribers) {
61848
- spec.set(
61849
- this.cache._internal_unstable.getSelection({
61850
- parent: spec.parentID || this.manager.rootID,
61851
- selection: spec.selection,
61852
- variables: spec.variables?.() || {}
61853
- }).data
61854
- );
61855
- }
61856
- return true;
61857
- }
61858
- remove(data, variables = {}) {
61859
- const targetID = this.cache._internal_unstable.id(this.listType(data), data);
61860
- if (!targetID) {
61861
- return;
61862
- }
61863
- return this.removeID(targetID, variables);
61864
- }
61865
- listType(data) {
61866
- return data.__typename || this.type;
61867
- }
61868
- validateWhen(when) {
61869
- let filters = when || this._when;
61870
- let ok = true;
61871
- if (filters) {
61872
- const targets = this.filters;
61873
- if (filters.must && targets) {
61874
- ok = Object.entries(filters.must).reduce(
61875
- (prev, [key, value]) => Boolean(prev && targets[key] == value),
61876
- ok
61877
- );
61878
- }
61879
- if (filters.must_not) {
61880
- ok = !targets || Object.entries(filters.must_not).reduce(
61881
- (prev, [key, value]) => Boolean(prev && targets[key] != value),
61882
- ok
61883
- );
61884
- }
61885
- }
61886
- return ok;
61887
- }
61888
- toggleElement(selection, data, variables = {}, where) {
61889
- if (!this.remove(data, variables)) {
61890
- this.addToList(selection, data, variables, where);
61891
- }
61892
- }
61893
- *[Symbol.iterator]() {
61894
- let entries = [];
61895
- let value = this.cache._internal_unstable.storage.get(this.recordID, this.key).value;
61896
- if (!this.connection) {
61897
- entries = flattenList(value);
61898
- } else {
61899
- entries = this.cache._internal_unstable.storage.get(value, "edges").value;
61900
- }
61901
- for (let record of entries) {
61902
- yield record;
61903
- }
61904
- }
61905
- };
61906
- var ListCollection = class {
61907
- lists = [];
61908
- constructor(lists) {
61909
- this.lists = lists;
61910
- }
61911
- append(...args) {
61912
- this.lists.forEach((list) => list.append(...args));
61913
- }
61914
- prepend(...args) {
61915
- this.lists.forEach((list) => list.prepend(...args));
61916
- }
61917
- addToList(...args) {
61918
- this.lists.forEach((list) => list.addToList(...args));
61919
- }
61920
- removeID(...args) {
61921
- this.lists.forEach((list) => list.removeID(...args));
61922
- }
61923
- remove(...args) {
61924
- this.lists.forEach((list) => list.remove(...args));
61925
- }
61926
- toggleElement(...args) {
61927
- this.lists.forEach((list) => list.toggleElement(...args));
61928
- }
61929
- when(when) {
61930
- return new ListCollection(
61931
- this.lists.filter((list) => {
61932
- return list.validateWhen(when);
61933
- })
61934
- );
61935
- }
61936
- includes(key) {
61937
- return !!this.lists.find((list) => list.key === key);
61938
- }
61939
- deleteListWithKey(key) {
61940
- return this.lists = this.lists.filter((list) => list.key !== key);
61941
- }
61942
- *[Symbol.iterator]() {
61943
- for (let list of this.lists) {
61944
- for (const entry of list) {
61945
- yield entry;
61946
- }
61947
- }
61948
- }
61949
- };
61950
-
61951
- // src/runtime/cache/schema.ts
61952
- var SchemaManager = class {
61953
- cache;
61954
- fieldTypes = {};
61955
- constructor(cache) {
61956
- this.cache = cache;
61957
- }
61958
- setFieldType({
61959
- parent,
61960
- key,
61961
- type,
61962
- nullable = false,
61963
- link
61964
- }) {
61965
- let parensIndex = key.indexOf("(");
61966
- if (parensIndex !== -1) {
61967
- key = key.substring(0, parensIndex);
61968
- }
61969
- if (parent === rootID) {
61970
- parent = "Query";
61971
- } else if (parent.includes(":")) {
61972
- parent = parent.substring(0, parent.indexOf(":"));
61973
- }
61974
- if (!this.fieldTypes[parent]) {
61975
- this.fieldTypes[parent] = {};
61976
- }
61977
- this.fieldTypes[parent][key] = {
61978
- type,
61979
- nullable,
61980
- link: !!link
61981
- };
61982
- }
61983
- fieldType(type, field) {
61984
- return this.fieldTypes[type]?.[field] || null;
61985
- }
61986
- get config() {
61987
- return this.cache._internal_unstable.config;
61988
- }
61989
- };
61990
-
61991
- // src/runtime/cache/storage.ts
61992
- var InMemoryStorage = class {
61993
- data;
61994
- idCount = 0;
61995
- rank = 0;
61996
- constructor() {
61997
- this.data = [];
61998
- }
61999
- get layerCount() {
62000
- return this.data.length;
62001
- }
62002
- get nextRank() {
62003
- return this.rank++;
62004
- }
62005
- createLayer(optimistic = false) {
62006
- const layer = new Layer(this.idCount++);
62007
- layer.optimistic = optimistic;
62008
- this.data.push(layer);
62009
- return layer;
62010
- }
62011
- insert(id, field, location, target) {
62012
- return this.topLayer.insert(id, field, location, target);
62013
- }
62014
- remove(id, field, target) {
62015
- return this.topLayer.remove(id, field, target);
62016
- }
62017
- delete(id) {
62018
- return this.topLayer.delete(id);
62019
- }
62020
- deleteField(id, field) {
62021
- return this.topLayer.deleteField(id, field);
62022
- }
62023
- getLayer(id) {
62024
- for (const layer of this.data) {
62025
- if (layer.id === id) {
62026
- return layer;
62027
- }
62028
- }
62029
- throw new Error("Could not find layer with id: " + id);
62030
- }
62031
- replaceID(replacement) {
62032
- for (const layer of this.data) {
62033
- layer.replaceID(replacement);
62034
- }
62035
- }
62036
- get(id, field) {
62037
- const operations = {
62038
- [OperationKind.insert]: {
62039
- [OperationLocation.start]: [],
62040
- [OperationLocation.end]: []
62041
- },
62042
- [OperationKind.remove]: /* @__PURE__ */ new Set()
62043
- };
62044
- const layerIDs = [];
62045
- for (let i2 = this.data.length - 1; i2 >= 0; i2--) {
62046
- const layer = this.data[i2];
62047
- const [layerValue, kind] = layer.get(id, field);
62048
- const layerOperations = layer.getOperations(id, field) || [];
62049
- layer.deletedIDs.forEach((v) => {
62050
- if (layer.operations[v]?.undoDeletesInList?.includes(field)) {
62051
- return;
62052
- }
62053
- operations.remove.add(v);
62054
- });
62055
- if (typeof layerValue === "undefined" && layerOperations.length === 0) {
62056
- if (layer.deletedIDs.size > 0) {
62057
- layerIDs.push(layer.id);
62058
- }
62059
- continue;
62060
- }
62061
- if (typeof layerValue !== "undefined" && !Array.isArray(layerValue)) {
62062
- return {
62063
- value: layerValue,
62064
- kind,
62065
- displayLayers: [layer.id]
62066
- };
62067
- }
62068
- layerIDs.push(layer.id);
62069
- if (layerOperations.length > 0) {
62070
- for (const op of layerOperations) {
62071
- if (isRemoveOperation(op)) {
62072
- operations.remove.add(op.id);
62073
- }
62074
- if (isInsertOperation(op)) {
62075
- operations.insert[op.location].unshift(op.id);
62076
- }
62077
- if (isDeleteOperation(op)) {
62078
- return {
62079
- value: void 0,
62080
- kind: "unknown",
62081
- displayLayers: []
62082
- };
62083
- }
62084
- }
62085
- }
62086
- if (typeof layerValue === "undefined") {
62087
- continue;
62088
- }
62089
- if (!operations.remove.size && !operations.insert.start.length && !operations.insert.end.length) {
62090
- return { value: layerValue, displayLayers: layerIDs, kind: "link" };
62091
- }
62092
- return {
62093
- value: [...operations.insert.start, ...layerValue, ...operations.insert.end].filter(
62094
- (value) => !operations.remove.has(value)
62095
- ),
62096
- displayLayers: layerIDs,
62097
- kind
62098
- };
62099
- }
62100
- return {
62101
- value: void 0,
62102
- kind: "unknown",
62103
- displayLayers: []
62104
- };
62105
- }
62106
- writeLink(id, field, value) {
62107
- return this.topLayer.writeLink(id, field, value);
62108
- }
62109
- writeField(id, field, value) {
62110
- return this.topLayer.writeField(id, field, value);
62111
- }
62112
- resolveLayer(id) {
62113
- let startingIndex = null;
62114
- for (const [index, layer] of this.data.entries()) {
62115
- if (layer.id !== id) {
62116
- continue;
62117
- }
62118
- startingIndex = index - 1;
62119
- this.data[index].optimistic = false;
62120
- break;
62121
- }
62122
- if (startingIndex === null) {
62123
- throw new Error("could not find layer with id: " + id);
62124
- }
62125
- if (startingIndex === -1) {
62126
- startingIndex = 0;
62127
- }
62128
- if (this.data[startingIndex].optimistic) {
62129
- startingIndex++;
62130
- }
62131
- const baseLayer = this.data[startingIndex];
62132
- let layerIndex = startingIndex;
62133
- while (layerIndex < this.data.length) {
62134
- const layer = this.data[layerIndex++];
62135
- if (layer.optimistic) {
62136
- layerIndex--;
62137
- break;
62138
- }
62139
- baseLayer.writeLayer(layer);
62140
- }
62141
- this.data.splice(startingIndex + 1, layerIndex - startingIndex - 1);
62142
- }
62143
- get topLayer() {
62144
- if (this.data.length === 0) {
62145
- this.createLayer();
62146
- }
62147
- if (this.data[this.data.length - 1]?.optimistic) {
62148
- this.createLayer();
62149
- }
62150
- return this.data[this.data.length - 1];
62151
- }
62152
- };
62153
- var Layer = class {
62154
- id;
62155
- optimistic = false;
62156
- fields = {};
62157
- links = {};
62158
- operations = {};
62159
- deletedIDs = /* @__PURE__ */ new Set();
62160
- constructor(id) {
62161
- this.id = id;
62162
- }
62163
- get(id, field) {
62164
- if (typeof this.links[id]?.[field] !== "undefined") {
62165
- return [this.links[id][field], "link"];
62166
- }
62167
- return [this.fields[id]?.[field], "scalar"];
62168
- }
62169
- getOperations(id, field) {
62170
- if (this.operations[id]?.deleted) {
62171
- return [
62172
- {
62173
- kind: OperationKind.delete,
62174
- target: id
62175
- }
62176
- ];
62177
- }
62178
- if (this.operations[id]?.fields?.[field]) {
62179
- return this.operations[id].fields[field];
62180
- }
62181
- }
62182
- writeField(id, field, value) {
62183
- this.fields[id] = {
62184
- ...this.fields[id],
62185
- [field]: value
62186
- };
62187
- return this.id;
62188
- }
62189
- writeLink(id, field, value) {
62190
- const valueList = Array.isArray(value) ? value : [value];
62191
- for (const value2 of flattenList(valueList)) {
62192
- if (!value2) {
62193
- continue;
62194
- }
62195
- const fieldOperations = this.operations[id]?.fields[field];
62196
- if (this.operations[value2]?.deleted || this.deletedIDs.has(value2)) {
62197
- this.operations[value2] = {
62198
- ...this.operations[value2],
62199
- undoDeletesInList: [...this.operations[id]?.undoDeletesInList || [], field]
62200
- };
62201
- } else if (value2 && fieldOperations?.length > 0) {
62202
- this.operations[id].fields[field] = fieldOperations.filter(
62203
- (op) => op.kind !== "remove" || op.id !== value2
62204
- );
62205
- }
62206
- }
62207
- this.links[id] = {
62208
- ...this.links[id],
62209
- [field]: value
62210
- };
62211
- return this.id;
62212
- }
62213
- isDisplayLayer(displayLayers) {
62214
- return displayLayers.length === 0 || displayLayers.includes(this.id) || Math.max(...displayLayers) < this.id;
62215
- }
62216
- clear() {
62217
- this.links = {};
62218
- this.fields = {};
62219
- this.operations = {};
62220
- this.deletedIDs = /* @__PURE__ */ new Set();
62221
- }
62222
- replaceID({ from, to }) {
62223
- this.fields[to] = this.fields[from];
62224
- this.links[to] = this.links[from];
62225
- this.operations[to] = this.operations[from] || { fields: {} };
62226
- if (this.deletedIDs.has(from)) {
62227
- this.deletedIDs.add(to);
62228
- }
62229
- }
62230
- removeUndefinedFields() {
62231
- for (const [id, fields] of Object.entries(this.fields)) {
62232
- for (const [field, value] of Object.entries(fields)) {
62233
- if (typeof value === "undefined") {
62234
- try {
62235
- delete this.fields[id][field];
62236
- } catch {
62237
- }
62238
- try {
62239
- delete this.links[id][field];
62240
- } catch {
62241
- }
62242
- }
62243
- }
62244
- if (Object.keys(fields || {}).length === 0) {
62245
- delete this.fields[id];
62246
- }
62247
- if (Object.keys(this.links[id] || {}).length === 0) {
62248
- delete this.links[id];
62249
- }
62250
- }
62251
- }
62252
- delete(id) {
62253
- this.operations = {
62254
- ...this.operations,
62255
- [id]: {
62256
- ...this.operations[id],
62257
- deleted: true,
62258
- undoDeletesInList: []
62259
- }
62260
- };
62261
- this.deletedIDs.add(id);
62262
- }
62263
- deleteField(id, field) {
62264
- this.fields[id] = {
62265
- ...this.fields[id],
62266
- [field]: void 0
62267
- };
62268
- }
62269
- insert(id, field, where, target) {
62270
- this.addFieldOperation(id, field, {
62271
- kind: OperationKind.insert,
62272
- id: target,
62273
- location: where
62274
- });
62275
- }
62276
- remove(id, field, target) {
62277
- this.addFieldOperation(id, field, {
62278
- kind: OperationKind.remove,
62279
- id: target
62280
- });
62281
- }
62282
- writeLayer(layer) {
62283
- if (layer.id === this.id) {
62284
- return;
62285
- }
62286
- for (const [id, ops] of Object.entries(layer.operations)) {
62287
- const fields = {};
62288
- for (const opMap of [this.operations[id], layer.operations[id]].filter(Boolean)) {
62289
- for (const [fieldName, operations] of Object.entries(opMap.fields || {})) {
62290
- fields[fieldName] = [...fields[fieldName] || [], ...operations];
62291
- }
62292
- }
62293
- if (Object.keys(fields).length > 0) {
62294
- this.operations[id] = {
62295
- ...this.operations[id],
62296
- fields
62297
- };
62298
- }
62299
- if (ops?.deleted) {
62300
- delete this.fields[id];
62301
- delete this.links[id];
62302
- }
62303
- }
62304
- for (const [id, values] of Object.entries(layer.fields)) {
62305
- if (!values) {
62306
- continue;
62307
- }
62308
- for (const [field, value] of Object.entries(values)) {
62309
- this.writeField(id, field, value);
62310
- }
62311
- }
62312
- for (const [id, values] of Object.entries(layer.links)) {
62313
- if (!values) {
62314
- continue;
62315
- }
62316
- for (const [field, value] of Object.entries(values)) {
62317
- this.writeLink(id, field, value);
62318
- }
62319
- }
62320
- layer.deletedIDs.forEach((v) => this.deletedIDs.add(v));
62321
- }
62322
- addFieldOperation(id, field, operation) {
62323
- this.operations = {
62324
- ...this.operations,
62325
- [id]: {
62326
- ...this.operations[id],
62327
- fields: {
62328
- [field]: [...this.operations[id]?.fields[field] || [], operation]
62329
- }
62330
- }
62331
- };
62332
- }
62333
- };
62334
- function isDeleteOperation(value) {
62335
- return !!value && value.kind === OperationKind.delete;
62336
- }
62337
- function isInsertOperation(value) {
62338
- return !!value && value.kind === OperationKind.insert;
61463
+ return defaultConfigValues(config_default);
62339
61464
  }
62340
- function isRemoveOperation(value) {
62341
- return !!value && value.kind === OperationKind.remove;
62342
- }
62343
- var OperationLocation = /* @__PURE__ */ ((OperationLocation2) => {
62344
- OperationLocation2["start"] = "start";
62345
- OperationLocation2["end"] = "end";
62346
- return OperationLocation2;
62347
- })(OperationLocation || {});
62348
- var OperationKind = /* @__PURE__ */ ((OperationKind2) => {
62349
- OperationKind2["delete"] = "delete";
62350
- OperationKind2["insert"] = "insert";
62351
- OperationKind2["remove"] = "remove";
62352
- return OperationKind2;
62353
- })(OperationKind || {});
62354
-
62355
- // src/runtime/cache/subscription.ts
62356
- var InMemorySubscriptions = class {
62357
- cache;
62358
- constructor(cache) {
62359
- this.cache = cache;
62360
- }
62361
- subscribers = {};
62362
- referenceCounts = {};
62363
- keyVersions = {};
62364
- add({
62365
- parent,
62366
- spec,
62367
- selection,
62368
- variables,
62369
- parentType
62370
- }) {
62371
- const __typename = this.cache._internal_unstable.storage.get(parent, "__typename").value;
62372
- let targetSelection = getFieldsForType(selection, __typename);
62373
- for (const fieldSelection of Object.values(targetSelection || {})) {
62374
- const { keyRaw, selection: innerSelection, type } = fieldSelection;
62375
- const key = evaluateKey(keyRaw, variables);
62376
- this.addFieldSubscription({
62377
- id: parent,
62378
- key,
62379
- field: fieldSelection,
62380
- spec,
62381
- parentType: parentType || spec.rootType,
62382
- variables
62383
- });
62384
- if (innerSelection) {
62385
- const { value: linkedRecord } = this.cache._internal_unstable.storage.get(
62386
- parent,
62387
- key
62388
- );
62389
- let children = !Array.isArray(linkedRecord) ? [linkedRecord] : flattenList(linkedRecord) || [];
62390
- for (const child of children) {
62391
- if (!child) {
62392
- continue;
62393
- }
62394
- this.add({
62395
- parent: child,
62396
- spec,
62397
- selection: innerSelection,
62398
- variables,
62399
- parentType: type
62400
- });
62401
- }
62402
- }
62403
- }
62404
- }
62405
- addFieldSubscription({
62406
- id,
62407
- key,
62408
- field,
62409
- spec,
62410
- parentType,
62411
- variables
62412
- }) {
62413
- if (!this.subscribers[id]) {
62414
- this.subscribers[id] = {};
62415
- }
62416
- if (!this.subscribers[id][key]) {
62417
- this.subscribers[id][key] = [];
62418
- }
62419
- if (!this.keyVersions[key]) {
62420
- this.keyVersions[key] = /* @__PURE__ */ new Set();
62421
- }
62422
- this.keyVersions[key].add(key);
62423
- if (!this.subscribers[id][key].map(({ set }) => set).includes(spec.set)) {
62424
- this.subscribers[id][key].push(spec);
62425
- }
62426
- if (!this.referenceCounts[id]) {
62427
- this.referenceCounts[id] = {};
62428
- }
62429
- if (!this.referenceCounts[id][key]) {
62430
- this.referenceCounts[id][key] = /* @__PURE__ */ new Map();
62431
- }
62432
- const counts = this.referenceCounts[id][key];
62433
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
62434
- this.cache._internal_unstable.lifetimes.resetLifetime(id, key);
62435
- const { selection, list, filters } = field;
62436
- if (selection && list) {
62437
- this.cache._internal_unstable.lists.add({
62438
- name: list.name,
62439
- connection: list.connection,
62440
- recordID: id,
62441
- recordType: this.cache._internal_unstable.storage.get(id, "__typename")?.value || parentType,
62442
- listType: list.type,
62443
- key,
62444
- selection,
62445
- filters: Object.entries(filters || {}).reduce((acc, [key2, { kind, value }]) => {
62446
- return {
62447
- ...acc,
62448
- [key2]: kind !== "Variable" ? value : variables[value]
62449
- };
62450
- }, {})
62451
- });
62452
- }
62453
- }
62454
- addMany({
62455
- parent,
62456
- selection,
62457
- variables,
62458
- subscribers,
62459
- parentType
62460
- }) {
62461
- let targetSelection = getFieldsForType(selection, parentType);
62462
- for (const fieldSelection of Object.values(targetSelection)) {
62463
- const { type: linkedType, keyRaw, selection: innerSelection } = fieldSelection;
62464
- const key = evaluateKey(keyRaw, variables);
62465
- for (const spec of subscribers) {
62466
- this.addFieldSubscription({
62467
- id: parent,
62468
- key,
62469
- field: fieldSelection,
62470
- spec,
62471
- parentType,
62472
- variables
62473
- });
62474
- }
62475
- if (innerSelection) {
62476
- const { value: link } = this.cache._internal_unstable.storage.get(parent, key);
62477
- const children = !Array.isArray(link) ? [link] : flattenList(link);
62478
- for (const linkedRecord of children) {
62479
- if (!linkedRecord) {
62480
- continue;
62481
- }
62482
- this.addMany({
62483
- parent: linkedRecord,
62484
- selection: innerSelection,
62485
- variables,
62486
- subscribers,
62487
- parentType: linkedType
62488
- });
62489
- }
62490
- }
62491
- }
62492
- }
62493
- get(id, field) {
62494
- return this.subscribers[id]?.[field] || [];
62495
- }
62496
- remove(id, selection, targets, variables, visited = []) {
62497
- visited.push(id);
62498
- const linkedIDs = [];
62499
- for (const fieldSelection of Object.values(selection.fields || {})) {
62500
- const key = evaluateKey(fieldSelection.keyRaw, variables);
62501
- this.removeSubscribers(id, key, targets);
62502
- if (!fieldSelection.selection?.fields) {
62503
- continue;
62504
- }
62505
- const { value: previousValue } = this.cache._internal_unstable.storage.get(id, key);
62506
- const links = !Array.isArray(previousValue) ? [previousValue] : flattenList(previousValue);
62507
- for (const link of links) {
62508
- if (link !== null) {
62509
- linkedIDs.push([link, fieldSelection.selection || {}]);
62510
- }
62511
- }
62512
- }
62513
- for (const [linkedRecordID, linkFields] of linkedIDs) {
62514
- this.remove(linkedRecordID, linkFields, targets, visited);
62515
- }
62516
- }
62517
- removeSubscribers(id, fieldName, specs) {
62518
- let targets = [];
62519
- for (const spec of specs) {
62520
- if (!this.referenceCounts[id]?.[fieldName]?.has(spec.set)) {
62521
- continue;
62522
- }
62523
- const counts = this.referenceCounts[id][fieldName];
62524
- const newVal = (counts.get(spec.set) || 0) - 1;
62525
- counts.set(spec.set, newVal);
62526
- if (newVal <= 0) {
62527
- targets.push(spec.set);
62528
- counts.delete(spec.set);
62529
- }
62530
- }
62531
- if (this.subscribers[id]) {
62532
- this.subscribers[id][fieldName] = this.get(id, fieldName).filter(
62533
- ({ set }) => !targets.includes(set)
62534
- );
62535
- }
62536
- }
62537
- removeAllSubscribers(id, targets, visited = []) {
62538
- visited.push(id);
62539
- for (const field of Object.keys(this.subscribers[id] || [])) {
62540
- const subscribers = targets || this.subscribers[id][field];
62541
- this.removeSubscribers(id, field, subscribers);
62542
- const { value, kind } = this.cache._internal_unstable.storage.get(id, field);
62543
- if (kind === "scalar") {
62544
- continue;
62545
- }
62546
- const nextTargets = Array.isArray(value) ? flattenList(value) : [value];
62547
- for (const id2 of nextTargets) {
62548
- if (visited.includes(id2)) {
62549
- continue;
62550
- }
62551
- this.removeAllSubscribers(id2, subscribers, visited);
62552
- }
62553
- }
62554
- }
62555
- };
62556
-
62557
- // src/runtime/cache/cache.ts
62558
- var Cache3 = class {
62559
- _internal_unstable;
62560
- constructor(config) {
62561
- this._internal_unstable = new CacheInternal({
62562
- cache: this,
62563
- storage: new InMemoryStorage(),
62564
- subscriptions: new InMemorySubscriptions(this),
62565
- lists: new ListManager(this, rootID),
62566
- lifetimes: new GarbageCollector(this),
62567
- schema: new SchemaManager(this)
62568
- });
62569
- if (config) {
62570
- this.setConfig(defaultConfigValues(config));
62571
- }
62572
- }
62573
- write({
62574
- layer: layerID,
62575
- notifySubscribers = [],
62576
- ...args
62577
- }) {
62578
- const layer = layerID ? this._internal_unstable.storage.getLayer(layerID) : this._internal_unstable.storage.topLayer;
62579
- const subscribers = this._internal_unstable.writeSelection({ ...args, layer });
62580
- const notified = [];
62581
- for (const spec of subscribers.concat(notifySubscribers)) {
62582
- if (!notified.includes(spec.set)) {
62583
- notified.push(spec.set);
62584
- spec.set(
62585
- this._internal_unstable.getSelection({
62586
- parent: spec.parentID || rootID,
62587
- selection: spec.selection,
62588
- variables: spec.variables?.() || {}
62589
- }).data
62590
- );
62591
- }
62592
- }
62593
- return subscribers;
62594
- }
62595
- read(...args) {
62596
- const { data, partial, hasData } = this._internal_unstable.getSelection(...args);
62597
- if (!hasData) {
62598
- return { data: null, partial: false };
62599
- }
62600
- return {
62601
- data,
62602
- partial
62603
- };
62604
- }
62605
- subscribe(spec, variables = {}) {
62606
- return this._internal_unstable.subscriptions.add({
62607
- parent: spec.parentID || rootID,
62608
- spec,
62609
- selection: spec.selection,
62610
- variables
62611
- });
62612
- }
62613
- unsubscribe(spec, variables = {}) {
62614
- return this._internal_unstable.subscriptions.remove(
62615
- spec.parentID || rootID,
62616
- spec.selection,
62617
- [spec],
62618
- variables
62619
- );
62620
- }
62621
- list(name, parentID, allLists) {
62622
- const handler = this._internal_unstable.lists.get(name, parentID, allLists);
62623
- if (!handler) {
62624
- throw new Error(
62625
- `Cannot find list with name: ${name}${parentID ? " under parent " + parentID : ""}. Is it possible that the query is not mounted?`
62626
- );
62627
- }
62628
- return handler;
62629
- }
62630
- delete(id) {
62631
- this._internal_unstable.subscriptions.removeAllSubscribers(id);
62632
- this._internal_unstable.lists.removeIDFromAllLists(id);
62633
- this._internal_unstable.storage.delete(id);
62634
- }
62635
- setConfig(config) {
62636
- this._internal_unstable.setConfig(config);
62637
- }
62638
- };
62639
- var CacheInternal = class {
62640
- _disabled = false;
62641
- config = defaultConfigValues({
62642
- plugins: {
62643
- "houdini-svelte": {
62644
- client: ""
62645
- }
62646
- }
62647
- });
62648
- storage;
62649
- subscriptions;
62650
- lists;
62651
- cache;
62652
- lifetimes;
62653
- schema;
62654
- constructor({
62655
- storage,
62656
- subscriptions,
62657
- lists,
62658
- cache,
62659
- lifetimes,
62660
- schema
62661
- }) {
62662
- this.storage = storage;
62663
- this.subscriptions = subscriptions;
62664
- this.lists = lists;
62665
- this.cache = cache;
62666
- this.lifetimes = lifetimes;
62667
- this.schema = schema;
62668
- this._disabled = typeof globalThis.window === "undefined";
62669
- try {
62670
- if (process.env.HOUDINI_TEST === "true") {
62671
- this._disabled = false;
62672
- }
62673
- } catch {
62674
- }
62675
- }
62676
- setConfig(config) {
62677
- this.config = config;
62678
- }
62679
- writeSelection({
62680
- data,
62681
- selection,
62682
- variables = {},
62683
- parent = rootID,
62684
- applyUpdates = false,
62685
- layer,
62686
- toNotify = [],
62687
- forceNotify
62688
- }) {
62689
- if (this._disabled) {
62690
- return [];
62691
- }
62692
- let targetSelection = getFieldsForType(selection, data["__typename"]);
62693
- for (const [field, value] of Object.entries(data)) {
62694
- if (!selection || !targetSelection[field]) {
62695
- throw new Error(
62696
- "Could not find field listing in selection for " + field + " @ " + JSON.stringify(selection)
62697
- );
62698
- }
62699
- let {
62700
- type: linkedType,
62701
- keyRaw,
62702
- selection: fieldSelection,
62703
- operations,
62704
- abstract: isAbstract,
62705
- update,
62706
- nullable
62707
- } = targetSelection[field];
62708
- const key = evaluateKey(keyRaw, variables);
62709
- this.schema.setFieldType({
62710
- parent,
62711
- key: keyRaw,
62712
- type: linkedType,
62713
- nullable,
62714
- link: !!fieldSelection
62715
- });
62716
- const currentSubscribers = this.subscriptions.get(parent, key);
62717
- const { value: previousValue, displayLayers } = this.storage.get(parent, key);
62718
- const displayLayer = layer.isDisplayLayer(displayLayers);
62719
- if (displayLayer) {
62720
- this.lifetimes.resetLifetime(parent, key);
62721
- }
62722
- if (!fieldSelection) {
62723
- let newValue = value;
62724
- if (Array.isArray(value) && applyUpdates && update) {
62725
- if (update === "append") {
62726
- newValue = (previousValue || []).concat(value);
62727
- } else if (update === "prepend") {
62728
- newValue = value.concat(previousValue || []);
62729
- }
62730
- }
62731
- const valueChanged = !deepEquals(newValue, previousValue);
62732
- if (displayLayer && (valueChanged || forceNotify)) {
62733
- toNotify.push(...currentSubscribers);
62734
- }
62735
- layer.writeField(parent, key, newValue);
62736
- } else if (value === null) {
62737
- if (previousValue === null) {
62738
- continue;
62739
- }
62740
- const previousLinks = flattenList([previousValue]);
62741
- for (const link of previousLinks) {
62742
- this.subscriptions.remove(link, fieldSelection, currentSubscribers, variables);
62743
- }
62744
- layer.writeLink(parent, key, null);
62745
- toNotify.push(...currentSubscribers);
62746
- } else if (value instanceof Object && !Array.isArray(value)) {
62747
- if (isAbstract) {
62748
- if (!value.__typename) {
62749
- throw new Error(
62750
- "Encountered interface type without __typename in the payload"
62751
- );
62752
- }
62753
- linkedType = value.__typename;
62754
- }
62755
- const embedded = this.idFields(linkedType)?.filter(
62756
- (field2) => typeof value[field2] === "undefined"
62757
- ).length > 0;
62758
- let linkedID = null;
62759
- if (value !== null) {
62760
- linkedID = !embedded ? this.id(linkedType, value) : `${parent}.${key}`;
62761
- }
62762
- let linkChange = linkedID !== previousValue;
62763
- layer.writeLink(parent, key, linkedID);
62764
- if (linkedID && displayLayer && (linkChange || forceNotify)) {
62765
- if (previousValue && typeof previousValue === "string") {
62766
- this.subscriptions.remove(
62767
- previousValue,
62768
- fieldSelection,
62769
- currentSubscribers,
62770
- variables
62771
- );
62772
- }
62773
- this.subscriptions.addMany({
62774
- parent: linkedID,
62775
- selection: fieldSelection,
62776
- subscribers: currentSubscribers,
62777
- variables,
62778
- parentType: linkedType
62779
- });
62780
- toNotify.push(...currentSubscribers);
62781
- }
62782
- if (linkedID) {
62783
- this.writeSelection({
62784
- selection: fieldSelection,
62785
- parent: linkedID,
62786
- data: value,
62787
- variables,
62788
- toNotify,
62789
- applyUpdates,
62790
- layer,
62791
- forceNotify
62792
- });
62793
- }
62794
- } else if (Array.isArray(value) && (typeof previousValue === "undefined" || Array.isArray(previousValue))) {
62795
- let oldIDs = [...previousValue || []];
62796
- const emptyEdges = !update ? [] : oldIDs.map((id) => {
62797
- if (!id) {
62798
- return "";
62799
- }
62800
- const { value: cursorField } = this.storage.get(id, "cursor");
62801
- if (cursorField) {
62802
- return "";
62803
- }
62804
- const { value: node } = this.storage.get(id, "node");
62805
- if (!node) {
62806
- return "";
62807
- }
62808
- return node;
62809
- });
62810
- let linkedIDs = [];
62811
- const { newIDs, nestedIDs } = this.extractNestedListIDs({
62812
- value,
62813
- abstract: Boolean(isAbstract),
62814
- specs: toNotify,
62815
- applyUpdates,
62816
- recordID: parent,
62817
- key,
62818
- linkedType,
62819
- variables,
62820
- fields: fieldSelection,
62821
- layer,
62822
- forceNotify
62823
- });
62824
- if (applyUpdates && update) {
62825
- if (key === "edges") {
62826
- const newNodeIDs = [];
62827
- for (const id of newIDs) {
62828
- if (!id) {
62829
- continue;
62830
- }
62831
- const { value: node } = this.storage.get(id, "node");
62832
- if (typeof node !== "string") {
62833
- continue;
62834
- }
62835
- if (!node || !this.storage.get(node, "__typename")) {
62836
- continue;
62837
- }
62838
- newNodeIDs.push(node);
62839
- }
62840
- oldIDs = oldIDs.filter((id) => {
62841
- if (!id) {
62842
- return true;
62843
- }
62844
- const { value: value2 } = this.storage.get(id, "node");
62845
- const node = value2;
62846
- if (newNodeIDs.includes(node) && emptyEdges.includes(node)) {
62847
- return false;
62848
- }
62849
- return true;
62850
- });
62851
- }
62852
- if (update === "prepend") {
62853
- linkedIDs = newIDs.concat(oldIDs);
62854
- } else if (update === "append") {
62855
- linkedIDs = oldIDs.concat(newIDs);
62856
- } else if (update === "replace") {
62857
- linkedIDs = newIDs;
62858
- }
62859
- } else {
62860
- linkedIDs = nestedIDs;
62861
- }
62862
- const contentChanged = !deepEquals(linkedIDs, oldIDs);
62863
- if (contentChanged || forceNotify) {
62864
- toNotify.push(...currentSubscribers);
62865
- }
62866
- for (const lostID of oldIDs) {
62867
- if (linkedIDs.includes(lostID) || !lostID) {
62868
- continue;
62869
- }
62870
- this.subscriptions.remove(lostID, fieldSelection, currentSubscribers, variables);
62871
- }
62872
- if (contentChanged || oldIDs.length === 0 && newIDs.length === 0) {
62873
- layer.writeLink(parent, key, linkedIDs);
62874
- }
62875
- for (const id of newIDs.filter((id2) => !oldIDs.includes(id2))) {
62876
- if (id == null) {
62877
- continue;
62878
- }
62879
- this.subscriptions.addMany({
62880
- parent: id,
62881
- selection: fieldSelection,
62882
- subscribers: currentSubscribers,
62883
- variables,
62884
- parentType: linkedType
62885
- });
62886
- }
62887
- }
62888
- for (const operation of operations || []) {
62889
- let parentID;
62890
- if (operation.parentID) {
62891
- if (operation.parentID.kind !== "Variable") {
62892
- parentID = operation.parentID.value;
62893
- } else {
62894
- const id = variables[operation.parentID.value];
62895
- if (typeof id !== "string") {
62896
- throw new Error("parentID value must be a string");
62897
- }
62898
- parentID = id;
62899
- }
62900
- }
62901
- if (operation.list && !this.lists.get(operation.list, parentID, operation.target === "all")) {
62902
- continue;
62903
- }
62904
- const targets = Array.isArray(value) ? value : [value];
62905
- for (const target of targets) {
62906
- if (operation.action === "insert" && target instanceof Object && fieldSelection && operation.list) {
62907
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).addToList(
62908
- fieldSelection,
62909
- target,
62910
- variables,
62911
- operation.position || "last"
62912
- );
62913
- } else if (operation.action === "remove" && target instanceof Object && fieldSelection && operation.list) {
62914
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).remove(target, variables);
62915
- } else if (operation.action === "delete" && operation.type) {
62916
- if (typeof target !== "string") {
62917
- throw new Error("Cannot delete a record with a non-string ID");
62918
- }
62919
- const targetID = this.id(operation.type, target);
62920
- if (!targetID) {
62921
- continue;
62922
- }
62923
- this.cache.delete(targetID);
62924
- } else if (operation.action === "toggle" && target instanceof Object && fieldSelection && operation.list) {
62925
- this.cache.list(operation.list, parentID, operation.target === "all").when(operation.when).toggleElement(
62926
- fieldSelection,
62927
- target,
62928
- variables,
62929
- operation.position || "last"
62930
- );
62931
- }
62932
- }
62933
- }
62934
- }
62935
- return toNotify;
62936
- }
62937
- getSelection({
62938
- selection,
62939
- parent = rootID,
62940
- variables,
62941
- stepsFromConnection = null
62942
- }) {
62943
- if (parent === null) {
62944
- return { data: null, partial: false, hasData: true };
62945
- }
62946
- const target = {};
62947
- let hasData = false;
62948
- let partial = false;
62949
- let cascadeNull = false;
62950
- const typename = this.storage.get(parent, "__typename").value;
62951
- let targetSelection = getFieldsForType(selection, typename);
62952
- for (const [
62953
- attributeName,
62954
- { type, keyRaw, selection: fieldSelection, nullable, list }
62955
- ] of Object.entries(targetSelection)) {
62956
- const key = evaluateKey(keyRaw, variables);
62957
- const { value } = this.storage.get(parent, key);
62958
- let nextStep = stepsFromConnection;
62959
- if (nextStep !== null) {
62960
- if (nextStep >= 2) {
62961
- nextStep = null;
62962
- } else {
62963
- nextStep += 1;
62964
- }
62965
- }
62966
- if (list?.connection) {
62967
- nextStep = 0;
62968
- }
62969
- const embeddedCursor = key === "cursor" && stepsFromConnection === 1;
62970
- if (typeof value === "undefined" && !embeddedCursor) {
62971
- partial = true;
62972
- }
62973
- if (typeof value === "undefined" || value === null) {
62974
- target[attributeName] = null;
62975
- if (typeof value !== "undefined") {
62976
- hasData = true;
62977
- }
62978
- } else if (!fieldSelection) {
62979
- const fnUnmarshal = this.config?.scalars?.[type]?.unmarshal;
62980
- if (fnUnmarshal) {
62981
- target[attributeName] = fnUnmarshal(value);
62982
- } else {
62983
- target[attributeName] = value;
62984
- }
62985
- hasData = true;
62986
- } else if (Array.isArray(value)) {
62987
- const listValue = this.hydrateNestedList({
62988
- fields: fieldSelection,
62989
- variables,
62990
- linkedList: value,
62991
- stepsFromConnection: nextStep
62992
- });
62993
- target[attributeName] = listValue.data;
62994
- if (listValue.partial) {
62995
- partial = true;
62996
- }
62997
- if (listValue.hasData || value.length === 0) {
62998
- hasData = true;
62999
- }
63000
- } else {
63001
- const objectFields = this.getSelection({
63002
- parent: value,
63003
- selection: fieldSelection,
63004
- variables,
63005
- stepsFromConnection: nextStep
63006
- });
63007
- target[attributeName] = objectFields.data;
63008
- if (objectFields.partial) {
63009
- partial = true;
63010
- }
63011
- if (objectFields.hasData) {
63012
- hasData = true;
63013
- }
63014
- }
63015
- if (target[attributeName] === null && !nullable && !embeddedCursor) {
63016
- cascadeNull = true;
63017
- }
63018
- }
63019
- return {
63020
- data: cascadeNull ? null : target,
63021
- partial: hasData && partial,
63022
- hasData
63023
- };
63024
- }
63025
- id(type, data) {
63026
- const id = typeof data === "string" ? data : this.computeID(type, data);
63027
- if (!id) {
63028
- return null;
63029
- }
63030
- if (!type) {
63031
- return id;
63032
- }
63033
- return type + ":" + id;
63034
- }
63035
- idFields(type) {
63036
- return keyFieldsForType(this.config, type);
63037
- }
63038
- computeID(type, data) {
63039
- return computeID(this.config, type, data);
63040
- }
63041
- hydrateNestedList({
63042
- fields,
63043
- variables,
63044
- linkedList,
63045
- stepsFromConnection
63046
- }) {
63047
- const result = [];
63048
- let partialData = false;
63049
- let hasValues = false;
63050
- for (const entry of linkedList) {
63051
- if (Array.isArray(entry)) {
63052
- const nestedValue = this.hydrateNestedList({
63053
- fields,
63054
- variables,
63055
- linkedList: entry,
63056
- stepsFromConnection
63057
- });
63058
- result.push(nestedValue.data);
63059
- if (nestedValue.partial) {
63060
- partialData = true;
63061
- }
63062
- continue;
63063
- }
63064
- if (entry === null) {
63065
- result.push(entry);
63066
- continue;
63067
- }
63068
- const { data, partial, hasData } = this.getSelection({
63069
- parent: entry,
63070
- selection: fields,
63071
- variables,
63072
- stepsFromConnection
63073
- });
63074
- result.push(data);
63075
- if (partial) {
63076
- partialData = true;
63077
- }
63078
- if (hasData) {
63079
- hasValues = true;
63080
- }
63081
- }
63082
- return {
63083
- data: result,
63084
- partial: partialData,
63085
- hasData: hasValues
63086
- };
63087
- }
63088
- extractNestedListIDs({
63089
- value,
63090
- abstract,
63091
- recordID,
63092
- key,
63093
- linkedType,
63094
- fields,
63095
- variables,
63096
- applyUpdates,
63097
- specs,
63098
- layer,
63099
- forceNotify
63100
- }) {
63101
- const nestedIDs = [];
63102
- const newIDs = [];
63103
- for (const [i2, entry] of value.entries()) {
63104
- if (Array.isArray(entry)) {
63105
- const inner = this.extractNestedListIDs({
63106
- value: entry,
63107
- abstract,
63108
- recordID,
63109
- key,
63110
- linkedType,
63111
- fields,
63112
- variables,
63113
- applyUpdates,
63114
- specs,
63115
- layer,
63116
- forceNotify
63117
- });
63118
- newIDs.push(...inner.newIDs);
63119
- nestedIDs[i2] = inner.nestedIDs;
63120
- continue;
63121
- }
63122
- if (entry === null || typeof entry === "undefined") {
63123
- newIDs.push(null);
63124
- nestedIDs[i2] = null;
63125
- continue;
63126
- }
63127
- const entryObj = entry;
63128
- let linkedID = `${recordID}.${key}[${this.storage.nextRank}]`;
63129
- const embedded = this.idFields(linkedType)?.filter(
63130
- (field) => typeof entry[field] === "undefined"
63131
- ).length > 0;
63132
- const typename = entryObj.__typename;
63133
- let innerType = linkedType;
63134
- if (abstract) {
63135
- if (!typename) {
63136
- throw new Error("Encountered interface type without __typename in the payload");
63137
- }
63138
- innerType = typename;
63139
- }
63140
- if (!embedded) {
63141
- const id = this.id(innerType, entry);
63142
- if (id) {
63143
- linkedID = id;
63144
- } else {
63145
- continue;
63146
- }
63147
- }
63148
- this.writeSelection({
63149
- root: rootID,
63150
- selection: fields,
63151
- parent: linkedID,
63152
- data: entryObj,
63153
- variables,
63154
- toNotify: specs,
63155
- applyUpdates,
63156
- layer,
63157
- forceNotify
63158
- });
63159
- newIDs.push(linkedID);
63160
- nestedIDs[i2] = linkedID;
63161
- }
63162
- return { newIDs, nestedIDs };
63163
- }
63164
- collectGarbage() {
63165
- this.lifetimes.tick();
63166
- if (this.storage.layerCount === 1) {
63167
- this.storage.topLayer.removeUndefinedFields();
63168
- }
63169
- }
63170
- };
63171
- var rootID = "_ROOT_";
63172
-
63173
- // src/runtime/cache/index.ts
63174
- var cache_default = new Cache3();
63175
61465
 
63176
61466
  // src/runtime/lib/types.ts
63177
61467
  var CachePolicy = /* @__PURE__ */ ((CachePolicy2) => {
@@ -63496,7 +61786,7 @@ async function recursiveCopy(source, target, transforms, notRoot) {
63496
61786
  const targetPath = join2(parentDir, child);
63497
61787
  let original = await readFile(childPath) || "";
63498
61788
  if (transforms?.[childPath]) {
63499
- original = transforms[childPath](original);
61789
+ original = await transforms[childPath](original, childPath);
63500
61790
  }
63501
61791
  await writeFile(targetPath, original);
63502
61792
  }
@@ -63632,7 +61922,7 @@ var Body = class {
63632
61922
  } else if (ArrayBuffer.isView(body)) {
63633
61923
  body = Buffer2.from(body.buffer, body.byteOffset, body.byteLength);
63634
61924
  } else if (body instanceof Stream) {
63635
- } else if (body instanceof FormData2) {
61925
+ } else if (body instanceof FormData) {
63636
61926
  body = formDataToBlob(body);
63637
61927
  boundary = body.type.split("=")[1];
63638
61928
  } else {
@@ -63672,7 +61962,7 @@ var Body = class {
63672
61962
  async formData() {
63673
61963
  const ct = this.headers.get("content-type");
63674
61964
  if (ct.startsWith("application/x-www-form-urlencoded")) {
63675
- const formData = new FormData2();
61965
+ const formData = new FormData();
63676
61966
  const parameters = new URLSearchParams(await this.text());
63677
61967
  for (const [name, value] of parameters) {
63678
61968
  formData.append(name, value);
@@ -63798,7 +62088,7 @@ var extractContentType = (body, request) => {
63798
62088
  if (Buffer2.isBuffer(body) || types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
63799
62089
  return null;
63800
62090
  }
63801
- if (body instanceof FormData2) {
62091
+ if (body instanceof FormData) {
63802
62092
  return `multipart/form-data; boundary=${request[INTERNALS].boundary}`;
63803
62093
  }
63804
62094
  if (body && typeof body.getBoundary === "function") {
@@ -64807,8 +63097,7 @@ var Config = class {
64807
63097
  types: types4 = {},
64808
63098
  logLevel,
64809
63099
  defaultFragmentMasking = "enable",
64810
- schemaPollInterval = 2e3,
64811
- schemaPollHeaders = {},
63100
+ watchSchema,
64812
63101
  projectDir
64813
63102
  } = this.configFile;
64814
63103
  if (typeof schema === "string") {
@@ -64841,8 +63130,8 @@ var Config = class {
64841
63130
  this.logLevel = (logLevel || LogLevel.Summary).toLowerCase();
64842
63131
  this.defaultFragmentMasking = defaultFragmentMasking;
64843
63132
  this.routesDir = join2(this.projectRoot, "src", "routes");
64844
- this.schemaPollInterval = schemaPollInterval;
64845
- this.schemaPollHeaders = schemaPollHeaders;
63133
+ this.schemaPollInterval = watchSchema?.interval ?? 2e3;
63134
+ this.schemaPollHeaders = watchSchema?.headers ?? {};
64846
63135
  this.rootDir = join2(this.projectRoot, "$houdini");
64847
63136
  if (defaultKeys) {
64848
63137
  this.defaultKeys = defaultKeys;
@@ -64855,11 +63144,12 @@ var Config = class {
64855
63144
  }
64856
63145
  }
64857
63146
  async apiURL() {
64858
- if (!this.configFile.apiUrl) {
63147
+ const apiURL = this.configFile.watchSchema?.url;
63148
+ if (!apiURL) {
64859
63149
  return "";
64860
63150
  }
64861
63151
  const env = await this.getEnv();
64862
- return this.processEnvValues(env, this.configFile.apiUrl);
63152
+ return this.processEnvValues(env, apiURL);
64863
63153
  }
64864
63154
  get include() {
64865
63155
  if (this.configFile.include) {
@@ -65057,11 +63347,14 @@ var Config = class {
65057
63347
  pluginRuntimeDirectory(name) {
65058
63348
  return join2(this.pluginDirectory(name), "runtime");
65059
63349
  }
63350
+ get pluginRootDirectory() {
63351
+ return houdini_mode.is_testing ? "../../../" : join2(this.rootDir, "plugins");
63352
+ }
65060
63353
  pluginDirectory(name) {
65061
- return houdini_mode.is_testing ? resolve("../../../", name) : join2(this.rootDir, "plugins", name);
63354
+ return join2(this.pluginRootDirectory, name);
65062
63355
  }
65063
- get manualLoadDirective() {
65064
- return "manual_load";
63356
+ get loadDirective() {
63357
+ return "load";
65065
63358
  }
65066
63359
  get maskEnableDirective() {
65067
63360
  return "mask_enable";
@@ -65108,6 +63401,9 @@ var Config = class {
65108
63401
  get whenNotDirective() {
65109
63402
  return this.whenDirective + "_not";
65110
63403
  }
63404
+ get liveDirective() {
63405
+ return "live";
63406
+ }
65111
63407
  get argumentsDirective() {
65112
63408
  return "arguments";
65113
63409
  }
@@ -65175,7 +63471,7 @@ var Config = class {
65175
63471
  this.withDirective,
65176
63472
  this.paginateDirective,
65177
63473
  this.cacheDirective,
65178
- this.manualLoadDirective,
63474
+ this.loadDirective,
65179
63475
  this.maskEnableDirective,
65180
63476
  this.maskDisableDirective
65181
63477
  ].includes(name.value) || this.isDeleteDirective(name.value);
@@ -65303,7 +63599,9 @@ async function getConfig({
65303
63599
  resolve2 = res;
65304
63600
  reject = rej;
65305
63601
  });
65306
- let configFile = await readConfigFile(configPath);
63602
+ let configFile = {
63603
+ ...await readConfigFile(configPath)
63604
+ };
65307
63605
  if (!configFile.plugins) {
65308
63606
  throw new HoudiniError({
65309
63607
  message: "Welcome to 0.17.0! Please following the migration guide here: http://www.houdinigraphql.com/guides/release-notes#0170"
@@ -65358,13 +63656,14 @@ This will prevent your schema from being pulled.`
65358
63656
  version = packageJSON.version;
65359
63657
  } catch {
65360
63658
  }
65361
- plugins.push({
65362
- ...await pluginFactory(plugin_config),
65363
- name: pluginName,
65364
- include_runtime,
65365
- version,
65366
- directory: pluginDirectory
65367
- });
63659
+ if (typeof plugin_config)
63660
+ plugins.push({
63661
+ ...await pluginFactory(plugin_config),
63662
+ name: pluginName,
63663
+ include_runtime,
63664
+ version,
63665
+ directory: pluginDirectory
63666
+ });
65368
63667
  } catch (e2) {
65369
63668
  throw new Error(
65370
63669
  `Could not find plugin: ${pluginName}. Are you sure its installed? If so, please open a ticket on GitHub.`
@@ -65782,7 +64081,7 @@ async function find_graphql(config, parsedScript, walker) {
65782
64081
  return;
65783
64082
  }
65784
64083
  const parsedTag = graphql4.parse(documentString);
65785
- if (walker.where && !walker.where(parsedTag)) {
64084
+ if (walker.where && !walker.where(parsedTag, { node, parent })) {
65786
64085
  return;
65787
64086
  }
65788
64087
  const definition = config.extractDefinition(parsedTag);