@ensnode/ensdb-sdk 1.13.1 → 1.14.0

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.
@@ -1,4 +1,4 @@
1
- export { b as account, c as account_relations, d as domain, e as domainEvent, f as domainResolverRelation, g as domainResolverRelation_relations, h as domainType, i as event, j as internal_registrarActionMetadata, k as internal_registrarActionMetadataType, l as label, m as label_relations, n as latestRegistrationIndex, o as latestRegistrationIndex_relations, p as latestRenewalIndex, q as latestRenewalIndex_relations, r as migratedNodeByNode, s as migratedNodeByParent, t as nameSales, u as nameTokens, v as permissions, w as permissionsEvent, x as permissionsResource, y as permissionsUser, z as permissionsUserEvent, A as registrarActionRelations, B as registrarActionType, C as registrarActions, D as registration, E as registrationLifecycleRelations, F as registrationLifecycles, G as registrationType, H as registration_relations, I as registry, J as registryType, K as relations_domain, L as relations_permissions, M as relations_permissionsResource, N as relations_permissionsUser, O as relations_registry, P as renewal, Q as renewal_relations, R as resolver, S as resolverAddressRecord, T as resolverAddressRecordRelations, U as resolverEvent, V as resolverRecords, W as resolverRecords_relations, X as resolverTextRecord, Y as resolverTextRecordRelations, Z as resolver_relations, _ as reverseNameRecord, $ as subgraph_abiChanged, a0 as subgraph_abiChangedRelations, a1 as subgraph_account, a2 as subgraph_accountRelations, a3 as subgraph_addrChanged, a4 as subgraph_addrChangedRelations, a5 as subgraph_authorisationChanged, a6 as subgraph_authorisationChangedRelations, a7 as subgraph_contenthashChanged, a8 as subgraph_contenthashChangedRelations, a9 as subgraph_domain, aa as subgraph_domainRelations, ab as subgraph_expiryExtended, ac as subgraph_expiryExtendedRelations, ad as subgraph_fusesSet, ae as subgraph_fusesSetRelations, af as subgraph_interfaceChanged, ag as subgraph_interfaceChangedRelations, ah as subgraph_multicoinAddrChanged, ai as subgraph_multicoinAddrChangedRelations, aj as subgraph_nameChanged, ak as subgraph_nameChangedRelations, al as subgraph_nameRegistered, am as subgraph_nameRegisteredRelations, an as subgraph_nameRenewed, ao as subgraph_nameRenewedRelations, ap as subgraph_nameTransferred, aq as subgraph_nameTransferredRelations, ar as subgraph_nameUnwrapped, as as subgraph_nameUnwrappedRelations, at as subgraph_nameWrapped, au as subgraph_nameWrappedRelations, av as subgraph_newOwner, aw as subgraph_newOwnerRelations, ax as subgraph_newResolver, ay as subgraph_newResolverRelations, az as subgraph_newTTL, aA as subgraph_newTTLRelations, aB as subgraph_pubkeyChanged, aC as subgraph_pubkeyChangedRelations, aD as subgraph_registration, aE as subgraph_registrationRelations, aF as subgraph_resolver, aG as subgraph_resolverRelations, aH as subgraph_textChanged, aI as subgraph_textChangedRelations, aJ as subgraph_transfer, aK as subgraph_transferRelations, aL as subgraph_versionChanged, aM as subgraph_versionChangedRelations, aN as subgraph_wrappedDomain, aO as subgraph_wrappedDomainRelations, aP as subgraph_wrappedTransfer, aQ as subgraph_wrappedTransferRelations, aR as subregistries, aS as subregistryRelations } from '../index-CVAtPcO6.js';
1
+ export { b as account, c as account_relations, d as domain, e as domainEvent, f as domainResolverRelation, g as domainResolverRelation_relations, h as domainType, i as event, j as internal_registrarActionMetadata, k as internal_registrarActionMetadataType, l as label, m as label_relations, n as latestRegistrationIndex, o as latestRegistrationIndex_relations, p as latestRenewalIndex, q as latestRenewalIndex_relations, r as migratedNodeByNode, s as migratedNodeByParent, t as nameSales, u as nameTokens, v as permissions, w as permissionsEvent, x as permissionsResource, y as permissionsUser, z as permissionsUserEvent, A as registrarActionRelations, B as registrarActionType, C as registrarActions, D as registration, E as registrationLifecycleRelations, F as registrationLifecycles, G as registrationType, H as registration_relations, I as registry, J as registryType, K as relations_domain, L as relations_permissions, M as relations_permissionsResource, N as relations_permissionsUser, O as relations_registry, P as renewal, Q as renewal_relations, R as resolver, S as resolverAddressRecord, T as resolverAddressRecordRelations, U as resolverEvent, V as resolverRecords, W as resolverRecords_relations, X as resolverTextRecord, Y as resolverTextRecordRelations, Z as resolver_relations, _ as reverseNameRecord, $ as subgraph_abiChanged, a0 as subgraph_abiChangedRelations, a1 as subgraph_account, a2 as subgraph_accountRelations, a3 as subgraph_addrChanged, a4 as subgraph_addrChangedRelations, a5 as subgraph_authorisationChanged, a6 as subgraph_authorisationChangedRelations, a7 as subgraph_contenthashChanged, a8 as subgraph_contenthashChangedRelations, a9 as subgraph_domain, aa as subgraph_domainRelations, ab as subgraph_expiryExtended, ac as subgraph_expiryExtendedRelations, ad as subgraph_fusesSet, ae as subgraph_fusesSetRelations, af as subgraph_interfaceChanged, ag as subgraph_interfaceChangedRelations, ah as subgraph_multicoinAddrChanged, ai as subgraph_multicoinAddrChangedRelations, aj as subgraph_nameChanged, ak as subgraph_nameChangedRelations, al as subgraph_nameRegistered, am as subgraph_nameRegisteredRelations, an as subgraph_nameRenewed, ao as subgraph_nameRenewedRelations, ap as subgraph_nameTransferred, aq as subgraph_nameTransferredRelations, ar as subgraph_nameUnwrapped, as as subgraph_nameUnwrappedRelations, at as subgraph_nameWrapped, au as subgraph_nameWrappedRelations, av as subgraph_newOwner, aw as subgraph_newOwnerRelations, ax as subgraph_newResolver, ay as subgraph_newResolverRelations, az as subgraph_newTTL, aA as subgraph_newTTLRelations, aB as subgraph_pubkeyChanged, aC as subgraph_pubkeyChangedRelations, aD as subgraph_registration, aE as subgraph_registrationRelations, aF as subgraph_resolver, aG as subgraph_resolverRelations, aH as subgraph_textChanged, aI as subgraph_textChangedRelations, aJ as subgraph_transfer, aK as subgraph_transferRelations, aL as subgraph_versionChanged, aM as subgraph_versionChangedRelations, aN as subgraph_wrappedDomain, aO as subgraph_wrappedDomainRelations, aP as subgraph_wrappedTransfer, aQ as subgraph_wrappedTransferRelations, aR as subregistries, aS as subregistryRelations } from '../index-DdrIzPaZ.js';
2
2
  import 'drizzle-orm/pg-core';
3
3
  import 'drizzle-orm';
4
4
  import 'ponder';
@@ -145,7 +145,43 @@ var domain = onchainTable(
145
145
  // If this is an ENSv1Domain, may have a `rootRegistryOwner`, otherwise null.
146
146
  rootRegistryOwnerId: t.hex().$type(),
147
147
  // Whether this Domain is part of the canonical nametree. Mirrors the parent Registry's flag.
148
- canonical: t.boolean().notNull().default(false)
148
+ canonical: t.boolean().notNull().default(false),
149
+ /**
150
+ * Materialized Canonical Name, NULL iff `canonical = false`.
151
+ * Maintained by `canonicality-db-helpers.ts`.
152
+ *
153
+ * @example "vitalik.eth"
154
+ */
155
+ canonicalName: t.text().$type(),
156
+ /**
157
+ * Materialized Canonical LabelHashPath, NULL iff `canonical = false`.
158
+ * Maintained by `canonicality-db-helpers.ts`.
159
+ *
160
+ * @dev Note that LabelHashPaths are in traversal-order (i.e. [labelhash("eth"), labelhash("vitalik")]).
161
+ */
162
+ canonicalLabelHashPath: t.hex().array().$type(),
163
+ /**
164
+ * Materialized Canonical Domain Path, NULL iff `canonical = false`.
165
+ * Maintained by `canonicality-db-helpers.ts`.
166
+ *
167
+ * @dev Note that canonicalPath is in traversal-order (i.e. ["eth"'s DomainId, "vitalik"'s DomainId]).
168
+ */
169
+ canonicalPath: t.text().array().$type(),
170
+ /**
171
+ * Materialized Canonical Depth, NULL iff `canonical = false`.
172
+ * Maintained by `canonicality-db-helpers.ts`.
173
+ *
174
+ * @dev The depth of this Domain in the Canonical Nametree i.e. the number of Labels in its Canonical Name.
175
+ * @example "eth" depth 1, "vitalik.eth" depth 2, etc
176
+ */
177
+ canonicalDepth: t.integer(),
178
+ /**
179
+ * Materialized Canonical Node, NULL iff `canonical = false`.
180
+ * Maintained by `canonicality-db-helpers.ts`.
181
+ *
182
+ * @dev the computed Node (via `namehash`) of this Domain's Canonical Name.
183
+ */
184
+ canonicalNode: t.hex().$type()
149
185
  // NOTE: Domain-Resolver Relations tracked via Protocol Acceleration plugin
150
186
  }),
151
187
  (t) => ({
@@ -153,7 +189,18 @@ var domain = onchainTable(
153
189
  byRegistry: index().on(t.registryId),
154
190
  bySubregistry: index().on(t.subregistryId).where(sql`${t.subregistryId} IS NOT NULL`),
155
191
  byOwner: index().on(t.ownerId),
156
- byLabelHash: index().on(t.labelHash)
192
+ byLabelHash: index().on(t.labelHash),
193
+ // hash index avoids the btree 8191-byte row-size hazard for spam names
194
+ byCanonicalNameExact: index().using("hash", t.canonicalName),
195
+ // GIN trigram index for substring / similarity queries (inline `gin_trgm_ops` via `sql`
196
+ // because passing it through `.op()` gets dropped by Ponder)
197
+ byCanonicalNameFuzzy: index().using("gin", sql`${t.canonicalName} gin_trgm_ops`),
198
+ // GIN containment for `cascadeLabelHeal`'s `canonical_label_hash_path @> ARRAY[lh]` lookup
199
+ byCanonicalLabelHashPath: index().using("gin", t.canonicalLabelHashPath),
200
+ // hash index for resolver-record → canonical-domain joins
201
+ byCanonicalNode: index().using("hash", t.canonicalNode),
202
+ // btree for ORDER BY canonical_depth (typeahead and DEPTH-ordered browse)
203
+ byCanonicalDepth: index().on(t.canonicalDepth)
157
204
  })
158
205
  );
159
206
  var relations_domain = relations(domain, ({ one, many }) => ({
@@ -401,7 +448,12 @@ var label = onchainTable(
401
448
  interpreted: t.text().notNull().$type()
402
449
  }),
403
450
  (t) => ({
404
- byInterpreted: index().on(t.interpreted)
451
+ // hash index avoids the btree 8191-byte row-size hazard for spam labels (a single label can
452
+ // exceed btree's leaf-size limit)
453
+ byInterpretedExact: index().using("hash", t.interpreted),
454
+ // GIN trigram index for substring / similarity queries (inline `gin_trgm_ops` via `sql`
455
+ // because passing it through `.op()` gets dropped by Ponder)
456
+ byInterpretedFuzzy: index().using("gin", sql`${t.interpreted} gin_trgm_ops`)
405
457
  })
406
458
  );
407
459
  var label_relations = relations(label, ({ many }) => ({