@secondlayer/subgraphs 3.6.1 → 3.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -1225,19 +1225,21 @@ function sourceFilters(subgraph) {
1225
1225
  const sources = subgraph.sources;
1226
1226
  return Array.isArray(sources) ? sources : Object.values(sources);
1227
1227
  }
1228
- function referencedIndexEventTypes(subgraph) {
1229
- const filters = sourceFilters(subgraph);
1230
- if (filters.some((f) => TX_SOURCE_TYPES.has(f.type))) {
1228
+ function indexEventTypesForFilterTypes(filterTypes) {
1229
+ if (filterTypes.some((t) => TX_SOURCE_TYPES.has(t))) {
1231
1230
  return ALL_INDEX_EVENT_TYPES;
1232
1231
  }
1233
1232
  const types = new Set;
1234
- for (const f of filters) {
1235
- const t = EVENT_FILTER_TO_INDEX_TYPE[f.type];
1236
- if (t)
1237
- types.add(t);
1233
+ for (const t of filterTypes) {
1234
+ const indexType = EVENT_FILTER_TO_INDEX_TYPE[t];
1235
+ if (indexType)
1236
+ types.add(indexType);
1238
1237
  }
1239
1238
  return [...types];
1240
1239
  }
1240
+ function referencedIndexEventTypes(subgraph) {
1241
+ return indexEventTypesForFilterTypes(sourceFilters(subgraph).map((f) => f.type));
1242
+ }
1241
1243
  function isStreamsIndexEligible(subgraph) {
1242
1244
  if (Array.isArray(subgraph.sources))
1243
1245
  return false;
@@ -1499,6 +1501,8 @@ class SubscriptionMatcher {
1499
1501
  for (const sub of subs) {
1500
1502
  if (sub.status !== "active")
1501
1503
  continue;
1504
+ if (sub.kind !== "subgraph" || !sub.subgraph_name || !sub.table_name)
1505
+ continue;
1502
1506
  this.byId.set(sub.id, sub);
1503
1507
  const k = key(sub.subgraph_name, sub.table_name);
1504
1508
  const arr = this.byKey.get(k);
@@ -2839,5 +2843,5 @@ export {
2839
2843
  backfillSubgraph
2840
2844
  };
2841
2845
 
2842
- //# debugId=393F56BE14245E2264756E2164756E21
2846
+ //# debugId=2BE22F6928E6804264756E2164756E21
2843
2847
  //# sourceMappingURL=index.js.map