@secondlayer/subgraphs 0.9.1 → 0.9.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.
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -325,4 +327,4 @@ interface SubgraphTableClient<TRow> {
325
327
  type InferSubgraphClient<T> = T extends {
326
328
  schema: infer S
327
329
  } ? { [K in keyof S] : S[K] extends SubgraphTable ? SubgraphTableClient<InferTableRow<S[K]>> : never } : never;
328
- export { validateSubgraphDefinition, resumeReindex, reindexSubgraph, pgSchemaName, generateSubgraphSQL, diffSchema, deploySchema, defineSubgraph, backfillSubgraph, WhereInput, TxMeta, TableDiff, SystemRow, SubgraphTableClient, SubgraphTable, SubgraphSchema, SubgraphHandler, SubgraphFilter, SubgraphDefinition, SubgraphContext, SubgraphColumn, StxTransferFilter, StxMintFilter, StxLockFilter, StxBurnFilter, ReindexOptions, PrintEventFilter, NftTransferFilter, NftMintFilter, NftBurnFilter, InferTableRow, InferSubgraphClient, InferColumnType, GeneratedSQL, FtTransferFilter, FtMintFilter, FtBurnFilter, FindManyOptions, ContractDeployFilter, ContractCallFilter, ComputedValue, ComparisonFilter, ColumnType, ColumnToTS, ColumnDiff };
330
+ export { validateSubgraphDefinition, resumeReindex, reindexSubgraph, pgSchemaName, generateSubgraphSQL, diffSchema, deploySchema, defineSubgraph, backfillSubgraph, WhereInput, TxMeta, TableDiff, SystemRow, SubgraphTableClient, SubgraphTable, SubgraphSchema, SubgraphHandler, SubgraphFilter, SubgraphDefinition, SubgraphContext, SubgraphColumn, StxTransferFilter, StxMintFilter, StxLockFilter, StxBurnFilter, RowValue, ReindexOptions, PrintEventFilter, NftTransferFilter, NftMintFilter, NftBurnFilter, InferTableRow, InferSubgraphClient, InferColumnType, GeneratedSQL, FtTransferFilter, FtMintFilter, FtBurnFilter, FindManyOptions, ContractDeployFilter, ContractCallFilter, ComputedValue, ComparisonFilter, ColumnType, ColumnToTS, ColumnDiff };
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -18,8 +18,10 @@ interface SubgraphTable {
18
18
  }
19
19
  /** Subgraph schema — maps table names to table definitions */
20
20
  type SubgraphSchema = Record<string, SubgraphTable>;
21
+ /** Scalar types that can appear as row values */
22
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
21
23
  /** Value or computed function that receives existing row */
22
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
24
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
23
25
  import { Database } from "@secondlayer/shared/db";
24
26
  import { Kysely, Transaction } from "kysely";
25
27
  type AnyDb = Kysely<Database> | Transaction<Database>;
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
@@ -161,4 +163,4 @@ interface SubgraphDefinition {
161
163
  /** Handler functions — keys must match source names (or "*" for catch-all) */
162
164
  handlers: Record<string, SubgraphHandler>;
163
165
  }
164
- export { TxMeta, SubgraphTable, SubgraphSchema, SubgraphHandler, SubgraphFilter, SubgraphDefinition, SubgraphContext, SubgraphColumn, StxTransferFilter, StxMintFilter, StxLockFilter, StxBurnFilter, PrintEventFilter, NftTransferFilter, NftMintFilter, NftBurnFilter, FtTransferFilter, FtMintFilter, FtBurnFilter, ContractDeployFilter, ContractCallFilter, ComputedValue, ColumnType };
166
+ export { TxMeta, SubgraphTable, SubgraphSchema, SubgraphHandler, SubgraphFilter, SubgraphDefinition, SubgraphContext, SubgraphColumn, StxTransferFilter, StxMintFilter, StxLockFilter, StxBurnFilter, RowValue, PrintEventFilter, NftTransferFilter, NftMintFilter, NftBurnFilter, FtTransferFilter, FtMintFilter, FtBurnFilter, ContractDeployFilter, ContractCallFilter, ComputedValue, ColumnType };
@@ -108,8 +108,10 @@ interface TxMeta {
108
108
  contractId?: string | null;
109
109
  functionName?: string | null;
110
110
  }
111
+ /** Scalar types that can appear as row values */
112
+ type RowValue = string | number | bigint | boolean | null | undefined | Record<string, unknown> | unknown[];
111
113
  /** Value or computed function that receives existing row */
112
- type ComputedValue<T = unknown> = T | ((existing: Record<string, unknown> | null) => T);
114
+ type ComputedValue = RowValue | ((existing: Record<string, unknown> | null) => unknown);
113
115
  /** Context passed to subgraph handlers during event processing */
114
116
  interface SubgraphContext {
115
117
  block: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/subgraphs",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@secondlayer/shared": "^0.10.1",
41
41
  "@secondlayer/stacks": "^0.2.2",
42
- "kysely": "^0.28.10",
42
+ "kysely": "0.28.15",
43
43
  "postgres": "^3.4.6",
44
44
  "zod": "^4.3.6"
45
45
  },