@secondlayer/subgraphs 5.0.1 → 6.0.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.
- package/dist/index.d.ts +23 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -514,19 +514,34 @@ type SystemOrderByAliases = {
|
|
|
514
514
|
createdAt?: "asc" | "desc"
|
|
515
515
|
id?: "asc" | "desc"
|
|
516
516
|
};
|
|
517
|
-
/** Ordered list form for deterministic multi-column sort. */
|
|
518
|
-
type OrderByList<TRow> = Array<[keyof (TRow & SystemOrderByAliases) & string, "asc" | "desc"]>;
|
|
519
517
|
interface FindManyOptions<TRow> {
|
|
520
518
|
where?: WhereInput<TRow> & SystemWhereAliases;
|
|
521
519
|
/**
|
|
522
|
-
* Single-
|
|
523
|
-
*
|
|
520
|
+
* Single-column object, e.g. `{ price: "desc" }`. `/v1` sorts by one
|
|
521
|
+
* column only (the keyset cursor pairs it with `_id` as a tiebreaker) —
|
|
522
|
+
* a second key throws at call time, since a plain object type can't
|
|
523
|
+
* reject "more than one key" at compile time.
|
|
524
524
|
*/
|
|
525
|
-
orderBy?:
|
|
525
|
+
orderBy?: { [K in keyof TRow]? : "asc" | "desc" } & SystemOrderByAliases;
|
|
526
526
|
limit?: number;
|
|
527
|
-
|
|
527
|
+
/** Resume from a previous page's `nextCursor`. */
|
|
528
|
+
cursor?: string;
|
|
528
529
|
fields?: (keyof TRow & string)[];
|
|
529
530
|
}
|
|
531
|
+
/** Wire tip: chain height, subgraph's processed height, and the gap between
|
|
532
|
+
* them — same object on every `/v1` row/page response. */
|
|
533
|
+
interface SubgraphTip {
|
|
534
|
+
block_height: number;
|
|
535
|
+
subgraph_height: number;
|
|
536
|
+
blocks_behind: number;
|
|
537
|
+
}
|
|
538
|
+
/** A page of rows from `findMany`, keyset-paginated. `nextCursor` is `null`
|
|
539
|
+
* on the last page; pass it back as `cursor` to resume. */
|
|
540
|
+
interface FindManyPage<TRow> {
|
|
541
|
+
rows: TRow[];
|
|
542
|
+
nextCursor: string | null;
|
|
543
|
+
tip: SubgraphTip;
|
|
544
|
+
}
|
|
530
545
|
/** Options for the realtime row stream (SSE). */
|
|
531
546
|
interface SubscribeOptions<TRow> {
|
|
532
547
|
/** Same column filters as `findMany`, applied server-side per row. */
|
|
@@ -587,7 +602,7 @@ interface SubgraphTableClient<TRow> {
|
|
|
587
602
|
*/
|
|
588
603
|
findMany<const F extends readonly (keyof TRow & string)[] = readonly (keyof TRow & string)[]>(options?: Omit<FindManyOptions<TRow>, "fields"> & {
|
|
589
604
|
fields?: F
|
|
590
|
-
}): Promise<Pick<TRow, F[number]
|
|
605
|
+
}): Promise<FindManyPage<Pick<TRow, F[number]>>>;
|
|
591
606
|
count(where?: WhereInput<TRow> & SystemWhereAliases): Promise<number>;
|
|
592
607
|
/**
|
|
593
608
|
* Scalar aggregates over the filtered set. SUM/MIN/MAX accept numeric columns
|
|
@@ -1197,4 +1212,4 @@ interface ReindexOptions {
|
|
|
1197
1212
|
operationId?: string;
|
|
1198
1213
|
signal?: AbortSignal;
|
|
1199
1214
|
}
|
|
1200
|
-
export { AggregateResult, AggregateSpec, AnyEvent, ChainReadCacheMode, ChainReadClient, ChainReadError, ChainReadMethods, ChainReadOptions, ColumnDiff, ColumnToTS, ColumnType, ComparisonFilter, ContractCallEvent, ContractCallFilter, ContractCallPayload, ContractDeployFilter, ContractDeployPayload, DeployDiff, DeployPlan, DrizzleGenOptions, ErasedChainReadClient, EventForFilter, FactoryScope, FindManyOptions, FtBurnFilter, FtBurnPayload, FtMintFilter, FtMintPayload, FtTransferFilter, FtTransferPayload, GeneratedSQL, IndexCodegenOptions, IndexCodegenTarget, InferColumnType, InferContext, InferSubgraphClient, InferTableRow, InferredPrintField, InferredTopicSchema, KyselyGenOptions, MapDeletePayload, MapWritePayload, NestedContractCallPayload, NftBurnFilter, NftBurnPayload, NftMintFilter, NftMintPayload, NftTransferFilter, NftTransferPayload, PinnedPrintEventFilter, PrintDataOf, PrintEventFilter, PrintEventFor, PrintEventPayload, PrintEventPrints, PrintField, PrintFieldToTS, PrintSample, PrintValidationResult, PrismaGenOptions, ReindexOptions, RowValue, SparseProbeTarget, StxBurnFilter, StxBurnPayload, StxLockFilter, StxLockPayload, StxMintFilter, StxMintPayload, StxTransferFilter, StxTransferPayload, SubgraphColumn, SubgraphContext, SubgraphDefinition, SubgraphFilter, SubgraphHandler, SubgraphSchema, SubgraphTable, SubgraphTableClient, SubscribeOptions, SystemRow, TableDiff, TraitPrintEventFilter, TxMeta, TypedHandlers, TypedSubgraphContext, TypedSubgraphDefinition, UnpinnedPrintEventFilter, VarSetPayload, WhereInput, WriteRow, camelizeKeys, canSparseScan, defineSchema, defineSubgraph, deploySchema, diffSchema, filterFieldsByType, generateDrizzleSchema, generateIndexSchema, generateKyselySchema, generatePrismaSchema, generateSubgraphSQL, hasBreakingChanges, inferPrintTopics, pgSchemaName, readContractAt, renderDeployPlan, sparseProbeTargets, validateSubgraphDefinition };
|
|
1215
|
+
export { AggregateResult, AggregateSpec, AnyEvent, ChainReadCacheMode, ChainReadClient, ChainReadError, ChainReadMethods, ChainReadOptions, ColumnDiff, ColumnToTS, ColumnType, ComparisonFilter, ContractCallEvent, ContractCallFilter, ContractCallPayload, ContractDeployFilter, ContractDeployPayload, DeployDiff, DeployPlan, DrizzleGenOptions, ErasedChainReadClient, EventForFilter, FactoryScope, FindManyOptions, FindManyPage, FtBurnFilter, FtBurnPayload, FtMintFilter, FtMintPayload, FtTransferFilter, FtTransferPayload, GeneratedSQL, IndexCodegenOptions, IndexCodegenTarget, InferColumnType, InferContext, InferSubgraphClient, InferTableRow, InferredPrintField, InferredTopicSchema, KyselyGenOptions, MapDeletePayload, MapWritePayload, NestedContractCallPayload, NftBurnFilter, NftBurnPayload, NftMintFilter, NftMintPayload, NftTransferFilter, NftTransferPayload, PinnedPrintEventFilter, PrintDataOf, PrintEventFilter, PrintEventFor, PrintEventPayload, PrintEventPrints, PrintField, PrintFieldToTS, PrintSample, PrintValidationResult, PrismaGenOptions, ReindexOptions, RowValue, SparseProbeTarget, StxBurnFilter, StxBurnPayload, StxLockFilter, StxLockPayload, StxMintFilter, StxMintPayload, StxTransferFilter, StxTransferPayload, SubgraphColumn, SubgraphContext, SubgraphDefinition, SubgraphFilter, SubgraphHandler, SubgraphSchema, SubgraphTable, SubgraphTableClient, SubgraphTip, SubscribeOptions, SystemRow, TableDiff, TraitPrintEventFilter, TxMeta, TypedHandlers, TypedSubgraphContext, TypedSubgraphDefinition, UnpinnedPrintEventFilter, VarSetPayload, WhereInput, WriteRow, camelizeKeys, canSparseScan, defineSchema, defineSubgraph, deploySchema, diffSchema, filterFieldsByType, generateDrizzleSchema, generateIndexSchema, generateKyselySchema, generatePrismaSchema, generateSubgraphSQL, hasBreakingChanges, inferPrintTopics, pgSchemaName, readContractAt, renderDeployPlan, sparseProbeTargets, validateSubgraphDefinition };
|