@secondlayer/shared 6.24.0 → 6.25.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.
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "import { isValidAddress as _isValidAddress } from \"@secondlayer/stacks\";\nimport { z } from \"zod/v4\";\n\nconst isValidAddress = _isValidAddress as (addr: string) => boolean;\n\n/** Validate a Stacks principal (standard or contract, e.g. SP2J...ABC or SP2J...ABC.contract-name) */\nconst stacksPrincipal = z.string().refine((val) => {\n\tconst parts = val.split(\".\");\n\tif (parts.length > 2) return false;\n\t// biome-ignore lint/style/noNonNullAssertion: value is non-null after preceding check or by construction; TS narrowing limitation\n\treturn isValidAddress(parts[0]!);\n}, \"Invalid Stacks principal address\");\n\n// Base filter with common fields\nconst baseFilter = {\n\t// Optional: filter by sender\n\tsender: stacksPrincipal.optional(),\n\t// Optional: filter by recipient\n\trecipient: stacksPrincipal.optional(),\n};\n\n// Type exports — defined first so they can annotate schemas\nexport interface StxTransferFilter {\n\ttype: \"stx_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tminAmount?: number;\n\tmaxAmount?: number;\n}\n\nexport interface StxMintFilter {\n\ttype: \"stx_mint\";\n\trecipient?: string;\n\tminAmount?: number;\n}\n\nexport interface StxBurnFilter {\n\ttype: \"stx_burn\";\n\tsender?: string;\n\tminAmount?: number;\n}\n\nexport interface StxLockFilter {\n\ttype: \"stx_lock\";\n\tlockedAddress?: string;\n\tminAmount?: number;\n}\n\nexport interface FtTransferFilter {\n\ttype: \"ft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtMintFilter {\n\ttype: \"ft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtBurnFilter {\n\ttype: \"ft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface NftTransferFilter {\n\ttype: \"nft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftMintFilter {\n\ttype: \"nft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftBurnFilter {\n\ttype: \"nft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface ContractCallFilter {\n\ttype: \"contract_call\";\n\tcontractId?: string;\n\tfunctionName?: string;\n\tcaller?: string;\n}\n\nexport interface ContractDeployFilter {\n\ttype: \"contract_deploy\";\n\tdeployer?: string;\n\tcontractName?: string;\n}\n\nexport interface PrintEventFilter {\n\ttype: \"print_event\";\n\tcontractId?: string;\n\ttopic?: string;\n\tcontains?: string;\n}\n\nexport type EventFilter =\n\t| StxTransferFilter\n\t| StxMintFilter\n\t| StxBurnFilter\n\t| StxLockFilter\n\t| FtTransferFilter\n\t| FtMintFilter\n\t| FtBurnFilter\n\t| NftTransferFilter\n\t| NftMintFilter\n\t| NftBurnFilter\n\t| ContractCallFilter\n\t| ContractDeployFilter\n\t| PrintEventFilter;\n\n// STX Transfer Filter\nexport const StxTransferFilterSchema: z.ZodType<StxTransferFilter> = z.object({\n\ttype: z.literal(\"stx_transfer\"),\n\t...baseFilter,\n\t// Optional: minimum amount in microSTX\n\tminAmount: z.coerce.number().int().positive().optional(),\n\t// Optional: maximum amount in microSTX\n\tmaxAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Mint Filter\nexport const StxMintFilterSchema: z.ZodType<StxMintFilter> = z.object({\n\ttype: z.literal(\"stx_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Burn Filter\nexport const StxBurnFilterSchema: z.ZodType<StxBurnFilter> = z.object({\n\ttype: z.literal(\"stx_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Lock Filter\nexport const StxLockFilterSchema: z.ZodType<StxLockFilter> = z.object({\n\ttype: z.literal(\"stx_lock\"),\n\tlockedAddress: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Transfer Filter\nexport const FtTransferFilterSchema: z.ZodType<FtTransferFilter> = z.object({\n\ttype: z.literal(\"ft_transfer\"),\n\t...baseFilter,\n\t// Contract that defines the token (e.g., SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx)\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Mint Filter\nexport const FtMintFilterSchema: z.ZodType<FtMintFilter> = z.object({\n\ttype: z.literal(\"ft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Burn Filter\nexport const FtBurnFilterSchema: z.ZodType<FtBurnFilter> = z.object({\n\ttype: z.literal(\"ft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// NFT Transfer Filter\nexport const NftTransferFilterSchema: z.ZodType<NftTransferFilter> = z.object({\n\ttype: z.literal(\"nft_transfer\"),\n\t...baseFilter,\n\tassetIdentifier: z.string().optional(),\n\t// Optional: filter by specific token ID (Clarity value as hex)\n\ttokenId: z.string().optional(),\n});\n\n// NFT Mint Filter\nexport const NftMintFilterSchema: z.ZodType<NftMintFilter> = z.object({\n\ttype: z.literal(\"nft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// NFT Burn Filter\nexport const NftBurnFilterSchema: z.ZodType<NftBurnFilter> = z.object({\n\ttype: z.literal(\"nft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// Contract Call Filter\nexport const ContractCallFilterSchema: z.ZodType<ContractCallFilter> = z.object(\n\t{\n\t\ttype: z.literal(\"contract_call\"),\n\t\t// Contract being called\n\t\tcontractId: stacksPrincipal.optional(),\n\t\t// Function name (supports wildcards with *)\n\t\tfunctionName: z.string().optional(),\n\t\t// Caller address\n\t\tcaller: stacksPrincipal.optional(),\n\t},\n);\n\n// Contract Deploy Filter\nexport const ContractDeployFilterSchema: z.ZodType<ContractDeployFilter> =\n\tz.object({\n\t\ttype: z.literal(\"contract_deploy\"),\n\t\t// Deployer address\n\t\tdeployer: stacksPrincipal.optional(),\n\t\t// Contract name pattern (supports wildcards)\n\t\tcontractName: z.string().optional(),\n\t});\n\n// Print Event Filter (smart contract events)\nexport const PrintEventFilterSchema: z.ZodType<PrintEventFilter> = z.object({\n\ttype: z.literal(\"print_event\"),\n\t// Contract emitting the event\n\tcontractId: stacksPrincipal.optional(),\n\t// Topic/name of the event\n\ttopic: z.string().optional(),\n\t// Search for substring in event data\n\tcontains: z.string().optional(),\n});\n\n// Union of all filter types\nexport const EventFilterSchema: z.ZodType<EventFilter> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tStxTransferFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tStxMintFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tStxBurnFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tStxLockFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tFtTransferFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tFtMintFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tFtBurnFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tNftTransferFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tNftMintFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tNftBurnFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tContractCallFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tContractDeployFilterSchema as any,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tPrintEventFilterSchema as any,\n\t],\n);\n",
6
6
  "import { z } from \"zod/v4\";\n\n// ── Deploy Subgraph Request ─────────────────────────────────────────────────\n\nexport interface DeploySubgraphRequest {\n\tname: string;\n\tversion?: string;\n\tdescription?: string;\n\tsources: Record<string, Record<string, unknown>>;\n\tschema: Record<string, unknown>;\n\thandlerCode: string;\n\t/** Override the definition's startBlock for this deploy only. */\n\tstartBlock?: number;\n\t/** Original TypeScript source, persisted so chat can read/diff/edit later. */\n\tsourceCode?: string;\n\t/**\n\t * BYO data plane: a user-owned Postgres connection string. When set, the\n\t * subgraph's schema, handler writes, and serving reads live in this DB instead\n\t * of the managed one. Stored encrypted at rest, never returned.\n\t */\n\tdatabaseUrl?: string;\n\t/** Validate the connection + print the DDL/grant plan without deploying. */\n\tdryRun?: boolean;\n}\n\nexport const DeploySubgraphRequestSchema: z.ZodType<DeploySubgraphRequest> =\n\tz.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.regex(/^[a-z0-9-]+$/, \"lowercase alphanumeric + hyphens only\")\n\t\t\t.max(63),\n\t\tversion: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsources: z\n\t\t\t.record(z.string(), z.record(z.string(), z.unknown()))\n\t\t\t.refine(\n\t\t\t\t(s) => Object.keys(s).length > 0,\n\t\t\t\t\"Must have at least one source\",\n\t\t\t),\n\t\tschema: z.record(z.string(), z.unknown()),\n\t\thandlerCode: z.string().max(1_048_576, \"handler code exceeds 1MB limit\"),\n\t\tstartBlock: z.number().int().nonnegative().optional(),\n\t\tsourceCode: z\n\t\t\t.string()\n\t\t\t.max(1_048_576, \"source code exceeds 1MB limit\")\n\t\t\t.optional(),\n\t\tdatabaseUrl: z\n\t\t\t.string()\n\t\t\t.url()\n\t\t\t.refine(\n\t\t\t\t(u) => u.startsWith(\"postgres://\") || u.startsWith(\"postgresql://\"),\n\t\t\t\t\"must be a postgres:// connection string\",\n\t\t\t)\n\t\t\t.optional(),\n\t\tdryRun: z.boolean().optional(),\n\t});\n\nexport interface DeploySubgraphResponse {\n\taction: \"created\" | \"unchanged\" | \"handler_updated\" | \"updated\" | \"reindexed\";\n\tsubgraphId: string;\n\tversion: string;\n\tmessage: string;\n\toperationId?: string;\n\treindexStarted?: boolean;\n\tdiff?: {\n\t\taddedTables: string[];\n\t\tremovedTables: string[];\n\t\taddedColumns: Record<string, string[]>;\n\t\tbreakingChanges: string[];\n\t};\n}\n\n// Subgraph API response types\n\nexport interface SubgraphSummary {\n\tname: string;\n\tversion: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\ttotalProcessed: number;\n\ttotalErrors: number;\n\ttables: string[];\n\tchainTip: number;\n\tsourceChainTip?: number;\n\ttargetBlock?: number;\n\tprogress: number;\n\tblocksRemaining?: number;\n\tsyncMode?: \"sync\" | \"reindex\";\n\tresourceWarning?: SubgraphResourceWarning;\n\tgapCount: number;\n\tintegrity: \"complete\" | \"gaps_detected\";\n\tcreatedAt: string;\n}\n\nexport interface SubgraphGapRange {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n}\n\nexport interface SubgraphSyncInfo {\n\tstatus: \"synced\" | \"catching_up\" | \"reindexing\" | \"error\";\n\tmode?: \"sync\" | \"reindex\";\n\tstartBlock: number;\n\tlastProcessedBlock: number;\n\t/**\n\t * Backward-compatible denominator for progress displays. During reindexing,\n\t * this is the reindex target block rather than the live source chain tip.\n\t */\n\tchainTip: number;\n\tsourceChainTip?: number;\n\ttargetBlock?: number;\n\tblocksRemaining: number;\n\tprocessedBlocks?: number;\n\ttotalBlocks?: number;\n\tprogress: number;\n\tresourceWarning?: SubgraphResourceWarning;\n\tgaps: {\n\t\tcount: number;\n\t\ttotalMissingBlocks: number;\n\t\tranges: SubgraphGapRange[];\n\t};\n\tintegrity: \"complete\" | \"gaps_detected\";\n}\n\nexport interface SubgraphResourceWarning {\n\tcode: string;\n\tmessage: string;\n\tplan?: string;\n\tblockRange: number;\n\tprocessorMemoryMb: number;\n\trecommendedPlan: \"launch\";\n}\n\nexport interface SubgraphDetail {\n\tname: string;\n\tversion: string;\n\tschemaHash?: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\tdescription?: string;\n\tsources?: Record<string, unknown>;\n\tdefinition?: Record<string, unknown>;\n\thealth: {\n\t\ttotalProcessed: number;\n\t\ttotalErrors: number;\n\t\terrorRate: number;\n\t\tlastError: string | null;\n\t\tlastErrorAt: string | null;\n\t};\n\tsync: SubgraphSyncInfo;\n\ttables: Record<\n\t\tstring,\n\t\t{\n\t\t\tendpoint: string;\n\t\t\tcolumns: Record<\n\t\t\t\tstring,\n\t\t\t\t{\n\t\t\t\t\ttype: string;\n\t\t\t\t\tnullable?: boolean;\n\t\t\t\t\tindexed?: boolean;\n\t\t\t\t\tsearchable?: boolean;\n\t\t\t\t\tdefault?: string | number | boolean;\n\t\t\t\t}\n\t\t\t>;\n\t\t\trowCount: number;\n\t\t\texample: string;\n\t\t\tindexes?: string[][];\n\t\t\tuniqueKeys?: string[][];\n\t\t}\n\t>;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubgraphGapEntry {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n\tdetectedAt: string;\n\tresolvedAt: string | null;\n}\n\nexport interface SubgraphGapsResponse {\n\tdata: SubgraphGapEntry[];\n\tmeta: {\n\t\ttotal: number;\n\t\ttotalMissingBlocks: number;\n\t\tlimit: number;\n\t\toffset: number;\n\t};\n}\n\nexport interface ReindexResponse {\n\tmessage: string;\n\tfromBlock: number;\n\ttoBlock: number | string;\n\toperationId?: string;\n\tstatus?: \"queued\" | \"running\" | \"cancel_requested\";\n}\n\nexport interface SubgraphQueryParams {\n\tsort?: string;\n\torder?: string;\n\tlimit?: number;\n\toffset?: number;\n\tfields?: string;\n\tfilters?: Record<string, string>;\n}\n",
7
- "import { z } from \"zod/v4\";\n\nexport const SUBSCRIPTION_FORMATS = [\n\t\"standard-webhooks\",\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"cloudevents\",\n\t\"raw\",\n] as const;\n\nexport const SUBSCRIPTION_RUNTIMES = [\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"node\",\n] as const;\n\nexport const SUBSCRIPTION_STATUSES = [\"active\", \"paused\", \"error\"] as const;\n\nexport const SUBSCRIPTION_FILTER_OPERATORS = [\n\t\"eq\",\n\t\"neq\",\n\t\"gt\",\n\t\"gte\",\n\t\"lt\",\n\t\"lte\",\n\t\"in\",\n] as const;\n\nconst webhookUrl = z\n\t.string()\n\t.trim()\n\t.min(1)\n\t.refine(\n\t\t(value) => value.startsWith(\"http://\") || value.startsWith(\"https://\"),\n\t\t\"must be an http(s) URL\",\n\t);\n\nconst name = z.string().trim().min(1).max(128);\nconst resourceName = z.string().trim().min(1).max(128);\n\nexport const SubscriptionStatusSchema: z.ZodType<SubscriptionStatus> = z.enum(\n\tSUBSCRIPTION_STATUSES,\n);\nexport const SubscriptionFormatSchema: z.ZodType<SubscriptionFormat> =\n\tz.enum(SUBSCRIPTION_FORMATS);\nexport const SubscriptionRuntimeSchema: z.ZodType<SubscriptionRuntime> = z.enum(\n\tSUBSCRIPTION_RUNTIMES,\n);\n\nexport const SubscriptionFilterPrimitiveSchema: z.ZodType<SubscriptionFilterPrimitive> =\n\tz.union([z.string(), z.number().finite(), z.boolean()]);\n\nexport const SubscriptionFilterOperatorSchema: z.ZodType<SubscriptionFilterOperator> =\n\tz.union([\n\t\tz.object({ eq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ neq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ gt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ gte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\tin: z.array(SubscriptionFilterPrimitiveSchema).min(1),\n\t\t\t})\n\t\t\t.strict(),\n\t]);\n\nexport const SubscriptionFilterClauseSchema: z.ZodType<SubscriptionFilterClause> =\n\tz.union([\n\t\tSubscriptionFilterPrimitiveSchema,\n\t\tSubscriptionFilterOperatorSchema,\n\t]);\n\nexport const SubscriptionFilterSchema: z.ZodType<SubscriptionFilter> = z.record(\n\tz.string().min(1),\n\tSubscriptionFilterClauseSchema,\n);\n\n// --- Chain triggers (direct chain-level subscriptions) -----------------------\n// A chain subscription reacts to raw chain events matched directly off the\n// Index/Streams clock (no subgraph). `triggers` is an array of these filters —\n// the JSON mirror of the subgraph runtime's `SubgraphFilter` union. Defined\n// here (not imported from @secondlayer/subgraphs) to avoid a shared→subgraphs\n// cycle; the evaluator maps these to `SubgraphFilter` at match time. Amounts are\n// non-negative integer strings (uint128 can exceed JS safe-int) or numbers.\n\nexport const CHAIN_TRIGGER_TYPES = [\n\t\"stx_transfer\",\n\t\"stx_mint\",\n\t\"stx_burn\",\n\t\"stx_lock\",\n\t\"ft_transfer\",\n\t\"ft_mint\",\n\t\"ft_burn\",\n\t\"nft_transfer\",\n\t\"nft_mint\",\n\t\"nft_burn\",\n\t\"contract_call\",\n\t\"contract_deploy\",\n\t\"print_event\",\n] as const;\n\nconst triggerAmount = z.union([\n\tz.string().trim().regex(/^\\d+$/, \"must be a non-negative integer string\"),\n\tz.number().int().nonnegative(),\n]);\n/** Principal/identifier/name patterns — `*` wildcards allowed (matched by the\n * evaluator). */\nconst triggerPattern = z.string().trim().min(1);\nconst trait = z.string().trim().min(1);\n\nexport const ChainTriggerSchema: z.ZodType<ChainTrigger> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_transfer\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\tmaxAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_mint\"),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_burn\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_lock\"),\n\t\t\t\tlockedAddress: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_call\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\tfunctionName: triggerPattern.optional(),\n\t\t\t\tcaller: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_deploy\"),\n\t\t\t\tdeployer: triggerPattern.optional(),\n\t\t\t\tcontractName: triggerPattern.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"print_event\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\ttopic: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t],\n);\n\nexport const ChainTriggersSchema: z.ZodType<ChainTrigger[]> = z\n\t.array(ChainTriggerSchema)\n\t.min(1)\n\t.max(50);\n\nexport const CreateSubscriptionRequestSchema: z.ZodType<ParsedCreateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname,\n\t\t\t// Subgraph mode (kind=subgraph): subgraphName + tableName + optional filter.\n\t\t\tsubgraphName: resourceName.optional(),\n\t\t\ttableName: resourceName.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\t// Chain mode (kind=chain): triggers.\n\t\t\ttriggers: ChainTriggersSchema.optional(),\n\t\t\turl: webhookUrl,\n\t\t\tformat: SubscriptionFormatSchema.default(\"standard-webhooks\"),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine(\n\t\t\t(v) => {\n\t\t\t\tconst subgraphMode =\n\t\t\t\t\tv.subgraphName !== undefined || v.tableName !== undefined;\n\t\t\t\tconst chainMode = v.triggers !== undefined;\n\t\t\t\tif (chainMode && subgraphMode) return false;\n\t\t\t\tif (chainMode) return true;\n\t\t\t\t// Subgraph mode requires BOTH subgraphName and tableName.\n\t\t\t\treturn v.subgraphName !== undefined && v.tableName !== undefined;\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"provide either { subgraphName, tableName } for a subgraph subscription OR { triggers } for a chain subscription — not both\",\n\t\t\t},\n\t\t)\n\t\t.refine((v) => v.filter === undefined || v.triggers === undefined, {\n\t\t\tmessage:\n\t\t\t\t\"`filter` applies to subgraph subscriptions; chain subscriptions use `triggers`\",\n\t\t\tpath: [\"filter\"],\n\t\t});\n\nexport const UpdateSubscriptionRequestSchema: z.ZodType<UpdateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname: name.optional(),\n\t\t\turl: webhookUrl.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\tformat: SubscriptionFormatSchema.optional(),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine((value) => Object.keys(value).length > 0, {\n\t\t\tmessage: \"At least one field must be provided\",\n\t\t});\n\nexport const ReplaySubscriptionRequestSchema: z.ZodType<ReplaySubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tfromBlock: z.number().int().nonnegative(),\n\t\t\ttoBlock: z.number().int().nonnegative(),\n\t\t\tforce: z.string().trim().min(1).max(64).optional(),\n\t\t})\n\t\t.refine((value) => value.fromBlock <= value.toBlock, {\n\t\t\tmessage: \"fromBlock must be less than or equal to toBlock\",\n\t\t\tpath: [\"toBlock\"],\n\t\t});\n\nexport type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];\n/** Polymorphic subscription mode (mirrors db/types `SubscriptionKind`). */\nexport type SubscriptionKind = \"subgraph\" | \"chain\";\nexport type SubscriptionFormat = (typeof SUBSCRIPTION_FORMATS)[number];\nexport type SubscriptionRuntime = (typeof SUBSCRIPTION_RUNTIMES)[number];\nexport type SubscriptionFilterPrimitive = string | number | boolean;\nexport type SubscriptionFilterOperator =\n\t| { eq: SubscriptionFilterPrimitive }\n\t| { neq: SubscriptionFilterPrimitive }\n\t| { gt: string | number }\n\t| { gte: string | number }\n\t| { lt: string | number }\n\t| { lte: string | number }\n\t| { in: SubscriptionFilterPrimitive[] };\nexport type SubscriptionFilterClause =\n\t| SubscriptionFilterPrimitive\n\t| SubscriptionFilterOperator;\nexport type SubscriptionFilter = Record<string, SubscriptionFilterClause>;\n\nexport type ChainTriggerType = (typeof CHAIN_TRIGGER_TYPES)[number];\n/** Non-negative integer amount over JSON (string for uint128 safety, or number). */\nexport type ChainTriggerAmount = string | number;\n\ninterface TraitScoped {\n\ttrait?: string;\n}\n\n/** JSON mirror of the subgraph runtime's `SubgraphFilter` union. */\nexport type ChainTrigger =\n\t| {\n\t\t\ttype: \"stx_transfer\";\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t\t\tmaxAmount?: ChainTriggerAmount;\n\t }\n\t| { type: \"stx_mint\"; recipient?: string; minAmount?: ChainTriggerAmount }\n\t| { type: \"stx_burn\"; sender?: string; minAmount?: ChainTriggerAmount }\n\t| {\n\t\t\ttype: \"stx_lock\";\n\t\t\tlockedAddress?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t }\n\t| ({\n\t\t\ttype: \"ft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"contract_call\";\n\t\t\tcontractId?: string;\n\t\t\tfunctionName?: string;\n\t\t\tcaller?: string;\n\t } & TraitScoped)\n\t| { type: \"contract_deploy\"; deployer?: string; contractName?: string }\n\t| ({\n\t\t\ttype: \"print_event\";\n\t\t\tcontractId?: string;\n\t\t\ttopic?: string;\n\t } & TraitScoped);\n\n/** Args for a chain-trigger builder — every field of a variant except `type`. */\ntype TriggerArgs<T extends ChainTrigger[\"type\"]> = Omit<\n\tExtract<ChainTrigger, { type: T }>,\n\t\"type\"\n>;\n\n/**\n * Ergonomic chain-trigger constructors for `subscriptions.create({ triggers })`.\n * Each returns a bare `ChainTrigger` (the wire shape the API expects):\n *\n * ```ts\n * client.subscriptions.create({\n * url: \"https://my.app/webhook\",\n * triggers: [trigger.contractCall({ contractId: \"SP....amm\", functionName: \"swap-*\" })],\n * });\n * ```\n */\nexport const trigger = {\n\tstxTransfer: (f: TriggerArgs<\"stx_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_transfer\",\n\t\t...f,\n\t}),\n\tstxMint: (f: TriggerArgs<\"stx_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_mint\",\n\t\t...f,\n\t}),\n\tstxBurn: (f: TriggerArgs<\"stx_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_burn\",\n\t\t...f,\n\t}),\n\tstxLock: (f: TriggerArgs<\"stx_lock\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_lock\",\n\t\t...f,\n\t}),\n\tftTransfer: (f: TriggerArgs<\"ft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_transfer\",\n\t\t...f,\n\t}),\n\tftMint: (f: TriggerArgs<\"ft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_mint\",\n\t\t...f,\n\t}),\n\tftBurn: (f: TriggerArgs<\"ft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_burn\",\n\t\t...f,\n\t}),\n\tnftTransfer: (f: TriggerArgs<\"nft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_transfer\",\n\t\t...f,\n\t}),\n\tnftMint: (f: TriggerArgs<\"nft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_mint\",\n\t\t...f,\n\t}),\n\tnftBurn: (f: TriggerArgs<\"nft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_burn\",\n\t\t...f,\n\t}),\n\tcontractCall: (f: TriggerArgs<\"contract_call\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_call\",\n\t\t...f,\n\t}),\n\tcontractDeploy: (f: TriggerArgs<\"contract_deploy\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_deploy\",\n\t\t...f,\n\t}),\n\tprintEvent: (f: TriggerArgs<\"print_event\"> = {}): ChainTrigger => ({\n\t\ttype: \"print_event\",\n\t\t...f,\n\t}),\n} as const;\n\nexport interface CreateSubscriptionRequest {\n\tname: string;\n\t/** Subgraph mode. */\n\tsubgraphName?: string;\n\ttableName?: string;\n\tfilter?: SubscriptionFilter;\n\t/** Chain mode. */\n\ttriggers?: ChainTrigger[];\n\turl: string;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport interface ParsedCreateSubscriptionRequest\n\textends Omit<CreateSubscriptionRequest, \"format\"> {\n\tformat: SubscriptionFormat;\n}\n\nexport interface UpdateSubscriptionRequest {\n\tname?: string;\n\turl?: string;\n\tfilter?: SubscriptionFilter;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport type ParsedUpdateSubscriptionRequest = UpdateSubscriptionRequest;\n\nexport interface ReplaySubscriptionRequest {\n\tfromBlock: number;\n\ttoBlock: number;\n\tforce?: string;\n}\n\nexport type ParsedReplaySubscriptionRequest = ReplaySubscriptionRequest;\n\nexport interface SubscriptionSummary {\n\tid: string;\n\tname: string;\n\tstatus: SubscriptionStatus;\n\tkind: SubscriptionKind;\n\t/** Null for chain subscriptions. */\n\tsubgraphName: string | null;\n\t/** Null for chain subscriptions. */\n\ttableName: string | null;\n\tformat: SubscriptionFormat;\n\truntime: SubscriptionRuntime | null;\n\turl: string;\n\tlastDeliveryAt: string | null;\n\tlastSuccessAt: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubscriptionDetail extends SubscriptionSummary {\n\tfilter: Record<string, unknown>;\n\t/** Chain-trigger filters (chain subscriptions only). */\n\ttriggers: ChainTrigger[] | null;\n\tauthConfig: Record<string, unknown>;\n\tmaxRetries: number;\n\ttimeoutMs: number;\n\tconcurrency: number;\n\tcircuitFailures: number;\n\tcircuitOpenedAt: string | null;\n\tlastError: string | null;\n}\n\nexport interface CreateSubscriptionResponse {\n\tsubscription: SubscriptionDetail;\n\t/** Plaintext signing secret — surfaced ONCE. Store it server-side. */\n\tsigningSecret: string;\n}\n\nexport interface RotateSecretResponse {\n\tsubscription: SubscriptionDetail;\n\tsigningSecret: string;\n}\n\nexport interface DeliveryRow {\n\tid: string;\n\tattempt: number;\n\tstatusCode: number | null;\n\terrorMessage: string | null;\n\tdurationMs: number | null;\n\tresponseBody: string | null;\n\tdispatchedAt: string;\n}\n\nexport interface ReplayResult {\n\treplayId: string;\n\tenqueuedCount: number;\n\tscannedCount: number;\n}\n\nexport interface DeadRow {\n\tid: string;\n\teventType: string;\n\tattempt: number;\n\tblockHeight: number;\n\ttxId: string | null;\n\tpayload: Record<string, unknown>;\n\tfailedAt: string | null;\n\tcreatedAt: string;\n}\n\nexport interface SubscriptionSchemaColumn {\n\ttype?: unknown;\n}\n\nexport interface SubscriptionSchemaTable {\n\tcolumns: Record<string, SubscriptionSchemaColumn>;\n}\n\nexport type SubscriptionSchemaTables = Record<string, SubscriptionSchemaTable>;\n\nconst SCALAR_COLUMN_TYPES = new Set([\n\t\"text\",\n\t\"uint\",\n\t\"int\",\n\t\"principal\",\n\t\"boolean\",\n\t\"timestamp\",\n]);\n\nconst COMPARISON_COLUMN_TYPES = new Set([\"uint\", \"int\", \"timestamp\"]);\n\nfunction formatIssuePath(path: PropertyKey[]): string {\n\treturn path.length > 0 ? `${path.map(String).join(\".\")}: ` : \"\";\n}\n\nexport function formatSubscriptionSchemaErrors(error: z.ZodError): string[] {\n\treturn error.issues.map(\n\t\t(issue) => `${formatIssuePath(issue.path)}${issue.message}`,\n\t);\n}\n\nfunction operatorForClause(clause: SubscriptionFilterClause): string {\n\tif (clause === null || typeof clause !== \"object\" || Array.isArray(clause)) {\n\t\treturn \"eq\";\n\t}\n\treturn Object.keys(clause)[0] ?? \"eq\";\n}\n\nexport function validateSubscriptionFilterForTable(input: {\n\tsubgraphName?: string;\n\ttableName: string;\n\tfilter?: unknown;\n\ttables: SubscriptionSchemaTables;\n}): string[] {\n\tconst errors: string[] = [];\n\tconst table = input.tables[input.tableName];\n\tif (!table) {\n\t\tconst names = Object.keys(input.tables);\n\t\terrors.push(\n\t\t\t`Unknown table \"${input.tableName}\"${\n\t\t\t\tinput.subgraphName ? ` in subgraph \"${input.subgraphName}\"` : \"\"\n\t\t\t}.${names.length > 0 ? ` Available tables: ${names.join(\", \")}.` : \"\"}`,\n\t\t);\n\t\treturn errors;\n\t}\n\n\tif (input.filter === undefined) return errors;\n\n\tconst parsed = SubscriptionFilterSchema.safeParse(input.filter);\n\tif (!parsed.success) {\n\t\treturn formatSubscriptionSchemaErrors(parsed.error);\n\t}\n\n\tfor (const [field, clause] of Object.entries(parsed.data)) {\n\t\tconst column = table.columns[field];\n\t\tif (!column) {\n\t\t\terrors.push(\n\t\t\t\t`Unknown filter field \"${field}\" on table \"${input.tableName}\".`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst columnType =\n\t\t\ttypeof column.type === \"string\" ? column.type.toLowerCase() : \"\";\n\t\tif (!SCALAR_COLUMN_TYPES.has(columnType)) {\n\t\t\terrors.push(\n\t\t\t\t`Filter field \"${field}\" has unsupported type \"${columnType || \"unknown\"}\"; subscription filters require scalar columns.`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst operator = operatorForClause(clause);\n\t\tif (\n\t\t\t(operator === \"gt\" ||\n\t\t\t\toperator === \"gte\" ||\n\t\t\t\toperator === \"lt\" ||\n\t\t\t\toperator === \"lte\") &&\n\t\t\t!COMPARISON_COLUMN_TYPES.has(columnType)\n\t\t) {\n\t\t\terrors.push(\n\t\t\t\t`Operator \"${operator}\" is not supported for ${columnType} field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn errors;\n}\n"
7
+ "import { z } from \"zod/v4\";\n\nexport const SUBSCRIPTION_FORMATS = [\n\t\"standard-webhooks\",\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"cloudevents\",\n\t\"raw\",\n] as const;\n\nexport const SUBSCRIPTION_RUNTIMES = [\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"node\",\n] as const;\n\nexport const SUBSCRIPTION_STATUSES = [\"active\", \"paused\", \"error\"] as const;\n\nexport const SUBSCRIPTION_FILTER_OPERATORS = [\n\t\"eq\",\n\t\"neq\",\n\t\"gt\",\n\t\"gte\",\n\t\"lt\",\n\t\"lte\",\n\t\"in\",\n] as const;\n\nconst webhookUrl = z\n\t.string()\n\t.trim()\n\t.min(1)\n\t.refine(\n\t\t(value) => value.startsWith(\"http://\") || value.startsWith(\"https://\"),\n\t\t\"must be an http(s) URL\",\n\t);\n\nconst name = z.string().trim().min(1).max(128);\nconst resourceName = z.string().trim().min(1).max(128);\n\nexport const SubscriptionStatusSchema: z.ZodType<SubscriptionStatus> = z.enum(\n\tSUBSCRIPTION_STATUSES,\n);\nexport const SubscriptionFormatSchema: z.ZodType<SubscriptionFormat> =\n\tz.enum(SUBSCRIPTION_FORMATS);\nexport const SubscriptionRuntimeSchema: z.ZodType<SubscriptionRuntime> = z.enum(\n\tSUBSCRIPTION_RUNTIMES,\n);\n\nexport const SubscriptionFilterPrimitiveSchema: z.ZodType<SubscriptionFilterPrimitive> =\n\tz.union([z.string(), z.number().finite(), z.boolean()]);\n\nexport const SubscriptionFilterOperatorSchema: z.ZodType<SubscriptionFilterOperator> =\n\tz.union([\n\t\tz.object({ eq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ neq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ gt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ gte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\tin: z.array(SubscriptionFilterPrimitiveSchema).min(1),\n\t\t\t})\n\t\t\t.strict(),\n\t]);\n\nexport const SubscriptionFilterClauseSchema: z.ZodType<SubscriptionFilterClause> =\n\tz.union([\n\t\tSubscriptionFilterPrimitiveSchema,\n\t\tSubscriptionFilterOperatorSchema,\n\t]);\n\nexport const SubscriptionFilterSchema: z.ZodType<SubscriptionFilter> = z.record(\n\tz.string().min(1),\n\tSubscriptionFilterClauseSchema,\n);\n\n// --- Chain triggers (direct chain-level subscriptions) -----------------------\n// A chain subscription reacts to raw chain events matched directly off the\n// Index/Streams clock (no subgraph). `triggers` is an array of these filters —\n// the JSON mirror of the subgraph runtime's `SubgraphFilter` union. Defined\n// here (not imported from @secondlayer/subgraphs) to avoid a shared→subgraphs\n// cycle; the evaluator maps these to `SubgraphFilter` at match time. Amounts are\n// non-negative integer strings (uint128 can exceed JS safe-int) or numbers.\n\nexport const CHAIN_TRIGGER_TYPES = [\n\t\"stx_transfer\",\n\t\"stx_mint\",\n\t\"stx_burn\",\n\t\"stx_lock\",\n\t\"ft_transfer\",\n\t\"ft_mint\",\n\t\"ft_burn\",\n\t\"nft_transfer\",\n\t\"nft_mint\",\n\t\"nft_burn\",\n\t\"contract_call\",\n\t\"contract_deploy\",\n\t\"print_event\",\n] as const;\n\nconst triggerAmount = z.union([\n\tz.string().trim().regex(/^\\d+$/, \"must be a non-negative integer string\"),\n\tz.number().int().nonnegative(),\n]);\n/** Principal/identifier/name patterns — `*` wildcards allowed (matched by the\n * evaluator). */\nconst triggerPattern = z.string().trim().min(1);\nconst trait = z.string().trim().min(1);\n\nexport const ChainTriggerSchema: z.ZodType<ChainTrigger> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_transfer\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\tmaxAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_mint\"),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_burn\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_lock\"),\n\t\t\t\tlockedAddress: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_call\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\tfunctionName: triggerPattern.optional(),\n\t\t\t\tcaller: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_deploy\"),\n\t\t\t\tdeployer: triggerPattern.optional(),\n\t\t\t\tcontractName: triggerPattern.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"print_event\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\ttopic: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t],\n);\n\nexport const ChainTriggersSchema: z.ZodType<ChainTrigger[]> = z\n\t.array(ChainTriggerSchema)\n\t.min(1)\n\t.max(50);\n\nexport const CreateSubscriptionRequestSchema: z.ZodType<ParsedCreateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname,\n\t\t\t// Subgraph mode (kind=subgraph): subgraphName + tableName + optional filter.\n\t\t\tsubgraphName: resourceName.optional(),\n\t\t\ttableName: resourceName.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\t// Chain mode (kind=chain): triggers.\n\t\t\ttriggers: ChainTriggersSchema.optional(),\n\t\t\turl: webhookUrl,\n\t\t\tformat: SubscriptionFormatSchema.default(\"standard-webhooks\"),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine(\n\t\t\t(v) => {\n\t\t\t\tconst subgraphMode =\n\t\t\t\t\tv.subgraphName !== undefined || v.tableName !== undefined;\n\t\t\t\tconst chainMode = v.triggers !== undefined;\n\t\t\t\tif (chainMode && subgraphMode) return false;\n\t\t\t\tif (chainMode) return true;\n\t\t\t\t// Subgraph mode requires BOTH subgraphName and tableName.\n\t\t\t\treturn v.subgraphName !== undefined && v.tableName !== undefined;\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"provide either { subgraphName, tableName } for a subgraph subscription OR { triggers } for a chain subscription — not both\",\n\t\t\t},\n\t\t)\n\t\t.refine((v) => v.filter === undefined || v.triggers === undefined, {\n\t\t\tmessage:\n\t\t\t\t\"`filter` applies to subgraph subscriptions; chain subscriptions use `triggers`\",\n\t\t\tpath: [\"filter\"],\n\t\t});\n\nexport const UpdateSubscriptionRequestSchema: z.ZodType<UpdateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname: name.optional(),\n\t\t\turl: webhookUrl.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\tformat: SubscriptionFormatSchema.optional(),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine((value) => Object.keys(value).length > 0, {\n\t\t\tmessage: \"At least one field must be provided\",\n\t\t});\n\nexport const ReplaySubscriptionRequestSchema: z.ZodType<ReplaySubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tfromBlock: z.number().int().nonnegative(),\n\t\t\ttoBlock: z.number().int().nonnegative(),\n\t\t\tforce: z.string().trim().min(1).max(64).optional(),\n\t\t})\n\t\t.refine((value) => value.fromBlock <= value.toBlock, {\n\t\t\tmessage: \"fromBlock must be less than or equal to toBlock\",\n\t\t\tpath: [\"toBlock\"],\n\t\t});\n\nexport type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];\n/** Polymorphic subscription mode (mirrors db/types `SubscriptionKind`). */\nexport type SubscriptionKind = \"subgraph\" | \"chain\";\nexport type SubscriptionFormat = (typeof SUBSCRIPTION_FORMATS)[number];\nexport type SubscriptionRuntime = (typeof SUBSCRIPTION_RUNTIMES)[number];\nexport type SubscriptionFilterPrimitive = string | number | boolean;\nexport type SubscriptionFilterOperator =\n\t| { eq: SubscriptionFilterPrimitive }\n\t| { neq: SubscriptionFilterPrimitive }\n\t| { gt: string | number }\n\t| { gte: string | number }\n\t| { lt: string | number }\n\t| { lte: string | number }\n\t| { in: SubscriptionFilterPrimitive[] };\nexport type SubscriptionFilterClause =\n\t| SubscriptionFilterPrimitive\n\t| SubscriptionFilterOperator;\nexport type SubscriptionFilter = Record<string, SubscriptionFilterClause>;\n\nexport type ChainTriggerType = (typeof CHAIN_TRIGGER_TYPES)[number];\n/** Non-negative integer amount over JSON (string for uint128 safety, or number). */\nexport type ChainTriggerAmount = string | number;\n\ninterface TraitScoped {\n\ttrait?: string;\n}\n\n/** JSON mirror of the subgraph runtime's `SubgraphFilter` union. */\nexport type ChainTrigger =\n\t| {\n\t\t\ttype: \"stx_transfer\";\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t\t\tmaxAmount?: ChainTriggerAmount;\n\t }\n\t| { type: \"stx_mint\"; recipient?: string; minAmount?: ChainTriggerAmount }\n\t| { type: \"stx_burn\"; sender?: string; minAmount?: ChainTriggerAmount }\n\t| {\n\t\t\ttype: \"stx_lock\";\n\t\t\tlockedAddress?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t }\n\t| ({\n\t\t\ttype: \"ft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"contract_call\";\n\t\t\tcontractId?: string;\n\t\t\tfunctionName?: string;\n\t\t\tcaller?: string;\n\t } & TraitScoped)\n\t| { type: \"contract_deploy\"; deployer?: string; contractName?: string }\n\t| ({\n\t\t\ttype: \"print_event\";\n\t\t\tcontractId?: string;\n\t\t\ttopic?: string;\n\t } & TraitScoped);\n\n/** Args for a chain-trigger builder — every field of a variant except `type`. */\ntype TriggerArgs<T extends ChainTrigger[\"type\"]> = Omit<\n\tExtract<ChainTrigger, { type: T }>,\n\t\"type\"\n>;\n\n/**\n * Ergonomic chain-trigger constructors for `subscriptions.create({ triggers })`.\n * Each returns a bare `ChainTrigger` (the wire shape the API expects):\n *\n * ```ts\n * client.subscriptions.create({\n * url: \"https://my.app/webhook\",\n * triggers: [trigger.contractCall({ contractId: \"SP....amm\", functionName: \"swap-*\" })],\n * });\n * ```\n */\nexport const trigger = {\n\tstxTransfer: (f: TriggerArgs<\"stx_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_transfer\",\n\t\t...f,\n\t}),\n\tstxMint: (f: TriggerArgs<\"stx_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_mint\",\n\t\t...f,\n\t}),\n\tstxBurn: (f: TriggerArgs<\"stx_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_burn\",\n\t\t...f,\n\t}),\n\tstxLock: (f: TriggerArgs<\"stx_lock\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_lock\",\n\t\t...f,\n\t}),\n\tftTransfer: (f: TriggerArgs<\"ft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_transfer\",\n\t\t...f,\n\t}),\n\tftMint: (f: TriggerArgs<\"ft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_mint\",\n\t\t...f,\n\t}),\n\tftBurn: (f: TriggerArgs<\"ft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_burn\",\n\t\t...f,\n\t}),\n\tnftTransfer: (f: TriggerArgs<\"nft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_transfer\",\n\t\t...f,\n\t}),\n\tnftMint: (f: TriggerArgs<\"nft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_mint\",\n\t\t...f,\n\t}),\n\tnftBurn: (f: TriggerArgs<\"nft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_burn\",\n\t\t...f,\n\t}),\n\tcontractCall: (f: TriggerArgs<\"contract_call\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_call\",\n\t\t...f,\n\t}),\n\tcontractDeploy: (f: TriggerArgs<\"contract_deploy\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_deploy\",\n\t\t...f,\n\t}),\n\tprintEvent: (f: TriggerArgs<\"print_event\"> = {}): ChainTrigger => ({\n\t\ttype: \"print_event\",\n\t\t...f,\n\t}),\n} as const;\n\nexport interface CreateSubscriptionRequest {\n\tname: string;\n\t/** Subgraph mode. */\n\tsubgraphName?: string;\n\ttableName?: string;\n\tfilter?: SubscriptionFilter;\n\t/** Chain mode. */\n\ttriggers?: ChainTrigger[];\n\turl: string;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport interface ParsedCreateSubscriptionRequest\n\textends Omit<CreateSubscriptionRequest, \"format\"> {\n\tformat: SubscriptionFormat;\n}\n\nexport interface UpdateSubscriptionRequest {\n\tname?: string;\n\turl?: string;\n\tfilter?: SubscriptionFilter;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport type ParsedUpdateSubscriptionRequest = UpdateSubscriptionRequest;\n\nexport interface ReplaySubscriptionRequest {\n\tfromBlock: number;\n\ttoBlock: number;\n\tforce?: string;\n}\n\nexport type ParsedReplaySubscriptionRequest = ReplaySubscriptionRequest;\n\nexport interface SubscriptionSummary {\n\tid: string;\n\tname: string;\n\tstatus: SubscriptionStatus;\n\tkind: SubscriptionKind;\n\t/** Null for chain subscriptions. */\n\tsubgraphName: string | null;\n\t/** Null for chain subscriptions. */\n\ttableName: string | null;\n\tformat: SubscriptionFormat;\n\truntime: SubscriptionRuntime | null;\n\turl: string;\n\tlastDeliveryAt: string | null;\n\tlastSuccessAt: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubscriptionDetail extends SubscriptionSummary {\n\tfilter: Record<string, unknown>;\n\t/** Chain-trigger filters (chain subscriptions only). */\n\ttriggers: ChainTrigger[] | null;\n\tauthConfig: Record<string, unknown>;\n\tmaxRetries: number;\n\ttimeoutMs: number;\n\tconcurrency: number;\n\tcircuitFailures: number;\n\tcircuitOpenedAt: string | null;\n\tlastError: string | null;\n}\n\nexport interface CreateSubscriptionResponse {\n\tsubscription: SubscriptionDetail;\n\t/** Plaintext signing secret — surfaced ONCE. Store it server-side. */\n\tsigningSecret: string;\n}\n\nexport interface RotateSecretResponse {\n\tsubscription: SubscriptionDetail;\n\tsigningSecret: string;\n}\n\nexport interface DeliveryRow {\n\tid: string;\n\tattempt: number;\n\tstatusCode: number | null;\n\terrorMessage: string | null;\n\tdurationMs: number | null;\n\tresponseBody: string | null;\n\tdispatchedAt: string;\n}\n\nexport interface ReplayResult {\n\treplayId: string;\n\tenqueuedCount: number;\n\tscannedCount: number;\n}\n\n/** Result of a one-off test delivery (`POST /:id/test`). Logged as a delivery\n * row (with a null outbox_id) so it shows up under the subscription's deliveries. */\nexport interface SubscriptionTestResult {\n\tok: boolean;\n\tstatusCode: number | null;\n\terror: string | null;\n\tdurationMs: number;\n\tdeliveryId: string;\n}\n\nexport interface DeadRow {\n\tid: string;\n\teventType: string;\n\tattempt: number;\n\tblockHeight: number;\n\ttxId: string | null;\n\tpayload: Record<string, unknown>;\n\tfailedAt: string | null;\n\tcreatedAt: string;\n}\n\nexport interface SubscriptionSchemaColumn {\n\ttype?: unknown;\n}\n\nexport interface SubscriptionSchemaTable {\n\tcolumns: Record<string, SubscriptionSchemaColumn>;\n}\n\nexport type SubscriptionSchemaTables = Record<string, SubscriptionSchemaTable>;\n\nconst SCALAR_COLUMN_TYPES = new Set([\n\t\"text\",\n\t\"uint\",\n\t\"int\",\n\t\"principal\",\n\t\"boolean\",\n\t\"timestamp\",\n]);\n\nconst COMPARISON_COLUMN_TYPES = new Set([\"uint\", \"int\", \"timestamp\"]);\n\nfunction formatIssuePath(path: PropertyKey[]): string {\n\treturn path.length > 0 ? `${path.map(String).join(\".\")}: ` : \"\";\n}\n\nexport function formatSubscriptionSchemaErrors(error: z.ZodError): string[] {\n\treturn error.issues.map(\n\t\t(issue) => `${formatIssuePath(issue.path)}${issue.message}`,\n\t);\n}\n\nfunction operatorForClause(clause: SubscriptionFilterClause): string {\n\tif (clause === null || typeof clause !== \"object\" || Array.isArray(clause)) {\n\t\treturn \"eq\";\n\t}\n\treturn Object.keys(clause)[0] ?? \"eq\";\n}\n\nexport function validateSubscriptionFilterForTable(input: {\n\tsubgraphName?: string;\n\ttableName: string;\n\tfilter?: unknown;\n\ttables: SubscriptionSchemaTables;\n}): string[] {\n\tconst errors: string[] = [];\n\tconst table = input.tables[input.tableName];\n\tif (!table) {\n\t\tconst names = Object.keys(input.tables);\n\t\terrors.push(\n\t\t\t`Unknown table \"${input.tableName}\"${\n\t\t\t\tinput.subgraphName ? ` in subgraph \"${input.subgraphName}\"` : \"\"\n\t\t\t}.${names.length > 0 ? ` Available tables: ${names.join(\", \")}.` : \"\"}`,\n\t\t);\n\t\treturn errors;\n\t}\n\n\tif (input.filter === undefined) return errors;\n\n\tconst parsed = SubscriptionFilterSchema.safeParse(input.filter);\n\tif (!parsed.success) {\n\t\treturn formatSubscriptionSchemaErrors(parsed.error);\n\t}\n\n\tfor (const [field, clause] of Object.entries(parsed.data)) {\n\t\tconst column = table.columns[field];\n\t\tif (!column) {\n\t\t\terrors.push(\n\t\t\t\t`Unknown filter field \"${field}\" on table \"${input.tableName}\".`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst columnType =\n\t\t\ttypeof column.type === \"string\" ? column.type.toLowerCase() : \"\";\n\t\tif (!SCALAR_COLUMN_TYPES.has(columnType)) {\n\t\t\terrors.push(\n\t\t\t\t`Filter field \"${field}\" has unsupported type \"${columnType || \"unknown\"}\"; subscription filters require scalar columns.`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst operator = operatorForClause(clause);\n\t\tif (\n\t\t\t(operator === \"gt\" ||\n\t\t\t\toperator === \"gte\" ||\n\t\t\t\toperator === \"lt\" ||\n\t\t\t\toperator === \"lte\") &&\n\t\t\t!COMPARISON_COLUMN_TYPES.has(columnType)\n\t\t) {\n\t\t\terrors.push(\n\t\t\t\t`Operator \"${operator}\" is not supported for ${columnType} field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn errors;\n}\n"
8
8
  ],
9
- "mappings": ";;;;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pD;AAAA,MACA;AAAA,IACD;AAAA,IAEA,MAAM,aACL,OAAO,OAAO,SAAS,WAAW,OAAO,KAAK,YAAY,IAAI;AAAA,IAC/D,IAAI,CAAC,oBAAoB,IAAI,UAAU,GAAG;AAAA,MACzC,OAAO,KACN,iBAAiB,gCAAgC,cAAc,0DAChE;AAAA,MACA;AAAA,IACD;AAAA,IAEA,MAAM,WAAW,kBAAkB,MAAM;AAAA,IACzC,KACE,aAAa,QACb,aAAa,SACb,aAAa,QACb,aAAa,UACd,CAAC,wBAAwB,IAAI,UAAU,GACtC;AAAA,MACD,OAAO,KACN,aAAa,kCAAkC,qBAAqB,SACrE;AAAA,IACD;AAAA,EACD;AAAA,EAEA,OAAO;AAAA;",
10
10
  "debugId": "B7EDC4001F31A1C164756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -226,6 +226,15 @@ interface ReplayResult {
226
226
  enqueuedCount: number;
227
227
  scannedCount: number;
228
228
  }
229
+ /** Result of a one-off test delivery (`POST /:id/test`). Logged as a delivery
230
+ * row (with a null outbox_id) so it shows up under the subscription's deliveries. */
231
+ interface SubscriptionTestResult {
232
+ ok: boolean;
233
+ statusCode: number | null;
234
+ error: string | null;
235
+ durationMs: number;
236
+ deliveryId: string;
237
+ }
229
238
  interface DeadRow {
230
239
  id: string;
231
240
  eventType: string;
@@ -250,4 +259,4 @@ declare function validateSubscriptionFilterForTable(input: {
250
259
  filter?: unknown
251
260
  tables: SubscriptionSchemaTables
252
261
  }): string[];
253
- export { validateSubscriptionFilterForTable, trigger, formatSubscriptionSchemaErrors, UpdateSubscriptionRequestSchema, UpdateSubscriptionRequest, SubscriptionSummary, SubscriptionStatusSchema, SubscriptionStatus, SubscriptionSchemaTables, SubscriptionSchemaTable, SubscriptionSchemaColumn, SubscriptionRuntimeSchema, SubscriptionRuntime, SubscriptionKind, SubscriptionFormatSchema, SubscriptionFormat, SubscriptionFilterSchema, SubscriptionFilterPrimitiveSchema, SubscriptionFilterPrimitive, SubscriptionFilterOperatorSchema, SubscriptionFilterOperator, SubscriptionFilterClauseSchema, SubscriptionFilterClause, SubscriptionFilter, SubscriptionDetail, SUBSCRIPTION_STATUSES, SUBSCRIPTION_RUNTIMES, SUBSCRIPTION_FORMATS, SUBSCRIPTION_FILTER_OPERATORS, RotateSecretResponse, ReplaySubscriptionRequestSchema, ReplaySubscriptionRequest, ReplayResult, ParsedUpdateSubscriptionRequest, ParsedReplaySubscriptionRequest, ParsedCreateSubscriptionRequest, DeliveryRow, DeadRow, CreateSubscriptionResponse, CreateSubscriptionRequestSchema, CreateSubscriptionRequest, ChainTriggersSchema, ChainTriggerType, ChainTriggerSchema, ChainTriggerAmount, ChainTrigger, CHAIN_TRIGGER_TYPES };
262
+ export { validateSubscriptionFilterForTable, trigger, formatSubscriptionSchemaErrors, UpdateSubscriptionRequestSchema, UpdateSubscriptionRequest, SubscriptionTestResult, SubscriptionSummary, SubscriptionStatusSchema, SubscriptionStatus, SubscriptionSchemaTables, SubscriptionSchemaTable, SubscriptionSchemaColumn, SubscriptionRuntimeSchema, SubscriptionRuntime, SubscriptionKind, SubscriptionFormatSchema, SubscriptionFormat, SubscriptionFilterSchema, SubscriptionFilterPrimitiveSchema, SubscriptionFilterPrimitive, SubscriptionFilterOperatorSchema, SubscriptionFilterOperator, SubscriptionFilterClauseSchema, SubscriptionFilterClause, SubscriptionFilter, SubscriptionDetail, SUBSCRIPTION_STATUSES, SUBSCRIPTION_RUNTIMES, SUBSCRIPTION_FORMATS, SUBSCRIPTION_FILTER_OPERATORS, RotateSecretResponse, ReplaySubscriptionRequestSchema, ReplaySubscriptionRequest, ReplayResult, ParsedUpdateSubscriptionRequest, ParsedReplaySubscriptionRequest, ParsedCreateSubscriptionRequest, DeliveryRow, DeadRow, CreateSubscriptionResponse, CreateSubscriptionRequestSchema, CreateSubscriptionRequest, ChainTriggersSchema, ChainTriggerType, ChainTriggerSchema, ChainTriggerAmount, ChainTrigger, CHAIN_TRIGGER_TYPES };
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/schemas/subscriptions.ts"],
4
4
  "sourcesContent": [
5
- "import { z } from \"zod/v4\";\n\nexport const SUBSCRIPTION_FORMATS = [\n\t\"standard-webhooks\",\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"cloudevents\",\n\t\"raw\",\n] as const;\n\nexport const SUBSCRIPTION_RUNTIMES = [\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"node\",\n] as const;\n\nexport const SUBSCRIPTION_STATUSES = [\"active\", \"paused\", \"error\"] as const;\n\nexport const SUBSCRIPTION_FILTER_OPERATORS = [\n\t\"eq\",\n\t\"neq\",\n\t\"gt\",\n\t\"gte\",\n\t\"lt\",\n\t\"lte\",\n\t\"in\",\n] as const;\n\nconst webhookUrl = z\n\t.string()\n\t.trim()\n\t.min(1)\n\t.refine(\n\t\t(value) => value.startsWith(\"http://\") || value.startsWith(\"https://\"),\n\t\t\"must be an http(s) URL\",\n\t);\n\nconst name = z.string().trim().min(1).max(128);\nconst resourceName = z.string().trim().min(1).max(128);\n\nexport const SubscriptionStatusSchema: z.ZodType<SubscriptionStatus> = z.enum(\n\tSUBSCRIPTION_STATUSES,\n);\nexport const SubscriptionFormatSchema: z.ZodType<SubscriptionFormat> =\n\tz.enum(SUBSCRIPTION_FORMATS);\nexport const SubscriptionRuntimeSchema: z.ZodType<SubscriptionRuntime> = z.enum(\n\tSUBSCRIPTION_RUNTIMES,\n);\n\nexport const SubscriptionFilterPrimitiveSchema: z.ZodType<SubscriptionFilterPrimitive> =\n\tz.union([z.string(), z.number().finite(), z.boolean()]);\n\nexport const SubscriptionFilterOperatorSchema: z.ZodType<SubscriptionFilterOperator> =\n\tz.union([\n\t\tz.object({ eq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ neq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ gt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ gte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\tin: z.array(SubscriptionFilterPrimitiveSchema).min(1),\n\t\t\t})\n\t\t\t.strict(),\n\t]);\n\nexport const SubscriptionFilterClauseSchema: z.ZodType<SubscriptionFilterClause> =\n\tz.union([\n\t\tSubscriptionFilterPrimitiveSchema,\n\t\tSubscriptionFilterOperatorSchema,\n\t]);\n\nexport const SubscriptionFilterSchema: z.ZodType<SubscriptionFilter> = z.record(\n\tz.string().min(1),\n\tSubscriptionFilterClauseSchema,\n);\n\n// --- Chain triggers (direct chain-level subscriptions) -----------------------\n// A chain subscription reacts to raw chain events matched directly off the\n// Index/Streams clock (no subgraph). `triggers` is an array of these filters —\n// the JSON mirror of the subgraph runtime's `SubgraphFilter` union. Defined\n// here (not imported from @secondlayer/subgraphs) to avoid a shared→subgraphs\n// cycle; the evaluator maps these to `SubgraphFilter` at match time. Amounts are\n// non-negative integer strings (uint128 can exceed JS safe-int) or numbers.\n\nexport const CHAIN_TRIGGER_TYPES = [\n\t\"stx_transfer\",\n\t\"stx_mint\",\n\t\"stx_burn\",\n\t\"stx_lock\",\n\t\"ft_transfer\",\n\t\"ft_mint\",\n\t\"ft_burn\",\n\t\"nft_transfer\",\n\t\"nft_mint\",\n\t\"nft_burn\",\n\t\"contract_call\",\n\t\"contract_deploy\",\n\t\"print_event\",\n] as const;\n\nconst triggerAmount = z.union([\n\tz.string().trim().regex(/^\\d+$/, \"must be a non-negative integer string\"),\n\tz.number().int().nonnegative(),\n]);\n/** Principal/identifier/name patterns — `*` wildcards allowed (matched by the\n * evaluator). */\nconst triggerPattern = z.string().trim().min(1);\nconst trait = z.string().trim().min(1);\n\nexport const ChainTriggerSchema: z.ZodType<ChainTrigger> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_transfer\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\tmaxAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_mint\"),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_burn\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_lock\"),\n\t\t\t\tlockedAddress: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_call\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\tfunctionName: triggerPattern.optional(),\n\t\t\t\tcaller: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_deploy\"),\n\t\t\t\tdeployer: triggerPattern.optional(),\n\t\t\t\tcontractName: triggerPattern.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"print_event\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\ttopic: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t],\n);\n\nexport const ChainTriggersSchema: z.ZodType<ChainTrigger[]> = z\n\t.array(ChainTriggerSchema)\n\t.min(1)\n\t.max(50);\n\nexport const CreateSubscriptionRequestSchema: z.ZodType<ParsedCreateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname,\n\t\t\t// Subgraph mode (kind=subgraph): subgraphName + tableName + optional filter.\n\t\t\tsubgraphName: resourceName.optional(),\n\t\t\ttableName: resourceName.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\t// Chain mode (kind=chain): triggers.\n\t\t\ttriggers: ChainTriggersSchema.optional(),\n\t\t\turl: webhookUrl,\n\t\t\tformat: SubscriptionFormatSchema.default(\"standard-webhooks\"),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine(\n\t\t\t(v) => {\n\t\t\t\tconst subgraphMode =\n\t\t\t\t\tv.subgraphName !== undefined || v.tableName !== undefined;\n\t\t\t\tconst chainMode = v.triggers !== undefined;\n\t\t\t\tif (chainMode && subgraphMode) return false;\n\t\t\t\tif (chainMode) return true;\n\t\t\t\t// Subgraph mode requires BOTH subgraphName and tableName.\n\t\t\t\treturn v.subgraphName !== undefined && v.tableName !== undefined;\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"provide either { subgraphName, tableName } for a subgraph subscription OR { triggers } for a chain subscription — not both\",\n\t\t\t},\n\t\t)\n\t\t.refine((v) => v.filter === undefined || v.triggers === undefined, {\n\t\t\tmessage:\n\t\t\t\t\"`filter` applies to subgraph subscriptions; chain subscriptions use `triggers`\",\n\t\t\tpath: [\"filter\"],\n\t\t});\n\nexport const UpdateSubscriptionRequestSchema: z.ZodType<UpdateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname: name.optional(),\n\t\t\turl: webhookUrl.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\tformat: SubscriptionFormatSchema.optional(),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine((value) => Object.keys(value).length > 0, {\n\t\t\tmessage: \"At least one field must be provided\",\n\t\t});\n\nexport const ReplaySubscriptionRequestSchema: z.ZodType<ReplaySubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tfromBlock: z.number().int().nonnegative(),\n\t\t\ttoBlock: z.number().int().nonnegative(),\n\t\t\tforce: z.string().trim().min(1).max(64).optional(),\n\t\t})\n\t\t.refine((value) => value.fromBlock <= value.toBlock, {\n\t\t\tmessage: \"fromBlock must be less than or equal to toBlock\",\n\t\t\tpath: [\"toBlock\"],\n\t\t});\n\nexport type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];\n/** Polymorphic subscription mode (mirrors db/types `SubscriptionKind`). */\nexport type SubscriptionKind = \"subgraph\" | \"chain\";\nexport type SubscriptionFormat = (typeof SUBSCRIPTION_FORMATS)[number];\nexport type SubscriptionRuntime = (typeof SUBSCRIPTION_RUNTIMES)[number];\nexport type SubscriptionFilterPrimitive = string | number | boolean;\nexport type SubscriptionFilterOperator =\n\t| { eq: SubscriptionFilterPrimitive }\n\t| { neq: SubscriptionFilterPrimitive }\n\t| { gt: string | number }\n\t| { gte: string | number }\n\t| { lt: string | number }\n\t| { lte: string | number }\n\t| { in: SubscriptionFilterPrimitive[] };\nexport type SubscriptionFilterClause =\n\t| SubscriptionFilterPrimitive\n\t| SubscriptionFilterOperator;\nexport type SubscriptionFilter = Record<string, SubscriptionFilterClause>;\n\nexport type ChainTriggerType = (typeof CHAIN_TRIGGER_TYPES)[number];\n/** Non-negative integer amount over JSON (string for uint128 safety, or number). */\nexport type ChainTriggerAmount = string | number;\n\ninterface TraitScoped {\n\ttrait?: string;\n}\n\n/** JSON mirror of the subgraph runtime's `SubgraphFilter` union. */\nexport type ChainTrigger =\n\t| {\n\t\t\ttype: \"stx_transfer\";\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t\t\tmaxAmount?: ChainTriggerAmount;\n\t }\n\t| { type: \"stx_mint\"; recipient?: string; minAmount?: ChainTriggerAmount }\n\t| { type: \"stx_burn\"; sender?: string; minAmount?: ChainTriggerAmount }\n\t| {\n\t\t\ttype: \"stx_lock\";\n\t\t\tlockedAddress?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t }\n\t| ({\n\t\t\ttype: \"ft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"contract_call\";\n\t\t\tcontractId?: string;\n\t\t\tfunctionName?: string;\n\t\t\tcaller?: string;\n\t } & TraitScoped)\n\t| { type: \"contract_deploy\"; deployer?: string; contractName?: string }\n\t| ({\n\t\t\ttype: \"print_event\";\n\t\t\tcontractId?: string;\n\t\t\ttopic?: string;\n\t } & TraitScoped);\n\n/** Args for a chain-trigger builder — every field of a variant except `type`. */\ntype TriggerArgs<T extends ChainTrigger[\"type\"]> = Omit<\n\tExtract<ChainTrigger, { type: T }>,\n\t\"type\"\n>;\n\n/**\n * Ergonomic chain-trigger constructors for `subscriptions.create({ triggers })`.\n * Each returns a bare `ChainTrigger` (the wire shape the API expects):\n *\n * ```ts\n * client.subscriptions.create({\n * url: \"https://my.app/webhook\",\n * triggers: [trigger.contractCall({ contractId: \"SP....amm\", functionName: \"swap-*\" })],\n * });\n * ```\n */\nexport const trigger = {\n\tstxTransfer: (f: TriggerArgs<\"stx_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_transfer\",\n\t\t...f,\n\t}),\n\tstxMint: (f: TriggerArgs<\"stx_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_mint\",\n\t\t...f,\n\t}),\n\tstxBurn: (f: TriggerArgs<\"stx_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_burn\",\n\t\t...f,\n\t}),\n\tstxLock: (f: TriggerArgs<\"stx_lock\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_lock\",\n\t\t...f,\n\t}),\n\tftTransfer: (f: TriggerArgs<\"ft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_transfer\",\n\t\t...f,\n\t}),\n\tftMint: (f: TriggerArgs<\"ft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_mint\",\n\t\t...f,\n\t}),\n\tftBurn: (f: TriggerArgs<\"ft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_burn\",\n\t\t...f,\n\t}),\n\tnftTransfer: (f: TriggerArgs<\"nft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_transfer\",\n\t\t...f,\n\t}),\n\tnftMint: (f: TriggerArgs<\"nft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_mint\",\n\t\t...f,\n\t}),\n\tnftBurn: (f: TriggerArgs<\"nft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_burn\",\n\t\t...f,\n\t}),\n\tcontractCall: (f: TriggerArgs<\"contract_call\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_call\",\n\t\t...f,\n\t}),\n\tcontractDeploy: (f: TriggerArgs<\"contract_deploy\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_deploy\",\n\t\t...f,\n\t}),\n\tprintEvent: (f: TriggerArgs<\"print_event\"> = {}): ChainTrigger => ({\n\t\ttype: \"print_event\",\n\t\t...f,\n\t}),\n} as const;\n\nexport interface CreateSubscriptionRequest {\n\tname: string;\n\t/** Subgraph mode. */\n\tsubgraphName?: string;\n\ttableName?: string;\n\tfilter?: SubscriptionFilter;\n\t/** Chain mode. */\n\ttriggers?: ChainTrigger[];\n\turl: string;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport interface ParsedCreateSubscriptionRequest\n\textends Omit<CreateSubscriptionRequest, \"format\"> {\n\tformat: SubscriptionFormat;\n}\n\nexport interface UpdateSubscriptionRequest {\n\tname?: string;\n\turl?: string;\n\tfilter?: SubscriptionFilter;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport type ParsedUpdateSubscriptionRequest = UpdateSubscriptionRequest;\n\nexport interface ReplaySubscriptionRequest {\n\tfromBlock: number;\n\ttoBlock: number;\n\tforce?: string;\n}\n\nexport type ParsedReplaySubscriptionRequest = ReplaySubscriptionRequest;\n\nexport interface SubscriptionSummary {\n\tid: string;\n\tname: string;\n\tstatus: SubscriptionStatus;\n\tkind: SubscriptionKind;\n\t/** Null for chain subscriptions. */\n\tsubgraphName: string | null;\n\t/** Null for chain subscriptions. */\n\ttableName: string | null;\n\tformat: SubscriptionFormat;\n\truntime: SubscriptionRuntime | null;\n\turl: string;\n\tlastDeliveryAt: string | null;\n\tlastSuccessAt: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubscriptionDetail extends SubscriptionSummary {\n\tfilter: Record<string, unknown>;\n\t/** Chain-trigger filters (chain subscriptions only). */\n\ttriggers: ChainTrigger[] | null;\n\tauthConfig: Record<string, unknown>;\n\tmaxRetries: number;\n\ttimeoutMs: number;\n\tconcurrency: number;\n\tcircuitFailures: number;\n\tcircuitOpenedAt: string | null;\n\tlastError: string | null;\n}\n\nexport interface CreateSubscriptionResponse {\n\tsubscription: SubscriptionDetail;\n\t/** Plaintext signing secret — surfaced ONCE. Store it server-side. */\n\tsigningSecret: string;\n}\n\nexport interface RotateSecretResponse {\n\tsubscription: SubscriptionDetail;\n\tsigningSecret: string;\n}\n\nexport interface DeliveryRow {\n\tid: string;\n\tattempt: number;\n\tstatusCode: number | null;\n\terrorMessage: string | null;\n\tdurationMs: number | null;\n\tresponseBody: string | null;\n\tdispatchedAt: string;\n}\n\nexport interface ReplayResult {\n\treplayId: string;\n\tenqueuedCount: number;\n\tscannedCount: number;\n}\n\nexport interface DeadRow {\n\tid: string;\n\teventType: string;\n\tattempt: number;\n\tblockHeight: number;\n\ttxId: string | null;\n\tpayload: Record<string, unknown>;\n\tfailedAt: string | null;\n\tcreatedAt: string;\n}\n\nexport interface SubscriptionSchemaColumn {\n\ttype?: unknown;\n}\n\nexport interface SubscriptionSchemaTable {\n\tcolumns: Record<string, SubscriptionSchemaColumn>;\n}\n\nexport type SubscriptionSchemaTables = Record<string, SubscriptionSchemaTable>;\n\nconst SCALAR_COLUMN_TYPES = new Set([\n\t\"text\",\n\t\"uint\",\n\t\"int\",\n\t\"principal\",\n\t\"boolean\",\n\t\"timestamp\",\n]);\n\nconst COMPARISON_COLUMN_TYPES = new Set([\"uint\", \"int\", \"timestamp\"]);\n\nfunction formatIssuePath(path: PropertyKey[]): string {\n\treturn path.length > 0 ? `${path.map(String).join(\".\")}: ` : \"\";\n}\n\nexport function formatSubscriptionSchemaErrors(error: z.ZodError): string[] {\n\treturn error.issues.map(\n\t\t(issue) => `${formatIssuePath(issue.path)}${issue.message}`,\n\t);\n}\n\nfunction operatorForClause(clause: SubscriptionFilterClause): string {\n\tif (clause === null || typeof clause !== \"object\" || Array.isArray(clause)) {\n\t\treturn \"eq\";\n\t}\n\treturn Object.keys(clause)[0] ?? \"eq\";\n}\n\nexport function validateSubscriptionFilterForTable(input: {\n\tsubgraphName?: string;\n\ttableName: string;\n\tfilter?: unknown;\n\ttables: SubscriptionSchemaTables;\n}): string[] {\n\tconst errors: string[] = [];\n\tconst table = input.tables[input.tableName];\n\tif (!table) {\n\t\tconst names = Object.keys(input.tables);\n\t\terrors.push(\n\t\t\t`Unknown table \"${input.tableName}\"${\n\t\t\t\tinput.subgraphName ? ` in subgraph \"${input.subgraphName}\"` : \"\"\n\t\t\t}.${names.length > 0 ? ` Available tables: ${names.join(\", \")}.` : \"\"}`,\n\t\t);\n\t\treturn errors;\n\t}\n\n\tif (input.filter === undefined) return errors;\n\n\tconst parsed = SubscriptionFilterSchema.safeParse(input.filter);\n\tif (!parsed.success) {\n\t\treturn formatSubscriptionSchemaErrors(parsed.error);\n\t}\n\n\tfor (const [field, clause] of Object.entries(parsed.data)) {\n\t\tconst column = table.columns[field];\n\t\tif (!column) {\n\t\t\terrors.push(\n\t\t\t\t`Unknown filter field \"${field}\" on table \"${input.tableName}\".`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst columnType =\n\t\t\ttypeof column.type === \"string\" ? column.type.toLowerCase() : \"\";\n\t\tif (!SCALAR_COLUMN_TYPES.has(columnType)) {\n\t\t\terrors.push(\n\t\t\t\t`Filter field \"${field}\" has unsupported type \"${columnType || \"unknown\"}\"; subscription filters require scalar columns.`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst operator = operatorForClause(clause);\n\t\tif (\n\t\t\t(operator === \"gt\" ||\n\t\t\t\toperator === \"gte\" ||\n\t\t\t\toperator === \"lt\" ||\n\t\t\t\toperator === \"lte\") &&\n\t\t\t!COMPARISON_COLUMN_TYPES.has(columnType)\n\t\t) {\n\t\t\terrors.push(\n\t\t\t\t`Operator \"${operator}\" is not supported for ${columnType} field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn errors;\n}\n"
5
+ "import { z } from \"zod/v4\";\n\nexport const SUBSCRIPTION_FORMATS = [\n\t\"standard-webhooks\",\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"cloudevents\",\n\t\"raw\",\n] as const;\n\nexport const SUBSCRIPTION_RUNTIMES = [\n\t\"inngest\",\n\t\"trigger\",\n\t\"cloudflare\",\n\t\"node\",\n] as const;\n\nexport const SUBSCRIPTION_STATUSES = [\"active\", \"paused\", \"error\"] as const;\n\nexport const SUBSCRIPTION_FILTER_OPERATORS = [\n\t\"eq\",\n\t\"neq\",\n\t\"gt\",\n\t\"gte\",\n\t\"lt\",\n\t\"lte\",\n\t\"in\",\n] as const;\n\nconst webhookUrl = z\n\t.string()\n\t.trim()\n\t.min(1)\n\t.refine(\n\t\t(value) => value.startsWith(\"http://\") || value.startsWith(\"https://\"),\n\t\t\"must be an http(s) URL\",\n\t);\n\nconst name = z.string().trim().min(1).max(128);\nconst resourceName = z.string().trim().min(1).max(128);\n\nexport const SubscriptionStatusSchema: z.ZodType<SubscriptionStatus> = z.enum(\n\tSUBSCRIPTION_STATUSES,\n);\nexport const SubscriptionFormatSchema: z.ZodType<SubscriptionFormat> =\n\tz.enum(SUBSCRIPTION_FORMATS);\nexport const SubscriptionRuntimeSchema: z.ZodType<SubscriptionRuntime> = z.enum(\n\tSUBSCRIPTION_RUNTIMES,\n);\n\nexport const SubscriptionFilterPrimitiveSchema: z.ZodType<SubscriptionFilterPrimitive> =\n\tz.union([z.string(), z.number().finite(), z.boolean()]);\n\nexport const SubscriptionFilterOperatorSchema: z.ZodType<SubscriptionFilterOperator> =\n\tz.union([\n\t\tz.object({ eq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ neq: SubscriptionFilterPrimitiveSchema }).strict(),\n\t\tz.object({ gt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ gte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lt: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz.object({ lte: z.union([z.string(), z.number().finite()]) }).strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\tin: z.array(SubscriptionFilterPrimitiveSchema).min(1),\n\t\t\t})\n\t\t\t.strict(),\n\t]);\n\nexport const SubscriptionFilterClauseSchema: z.ZodType<SubscriptionFilterClause> =\n\tz.union([\n\t\tSubscriptionFilterPrimitiveSchema,\n\t\tSubscriptionFilterOperatorSchema,\n\t]);\n\nexport const SubscriptionFilterSchema: z.ZodType<SubscriptionFilter> = z.record(\n\tz.string().min(1),\n\tSubscriptionFilterClauseSchema,\n);\n\n// --- Chain triggers (direct chain-level subscriptions) -----------------------\n// A chain subscription reacts to raw chain events matched directly off the\n// Index/Streams clock (no subgraph). `triggers` is an array of these filters —\n// the JSON mirror of the subgraph runtime's `SubgraphFilter` union. Defined\n// here (not imported from @secondlayer/subgraphs) to avoid a shared→subgraphs\n// cycle; the evaluator maps these to `SubgraphFilter` at match time. Amounts are\n// non-negative integer strings (uint128 can exceed JS safe-int) or numbers.\n\nexport const CHAIN_TRIGGER_TYPES = [\n\t\"stx_transfer\",\n\t\"stx_mint\",\n\t\"stx_burn\",\n\t\"stx_lock\",\n\t\"ft_transfer\",\n\t\"ft_mint\",\n\t\"ft_burn\",\n\t\"nft_transfer\",\n\t\"nft_mint\",\n\t\"nft_burn\",\n\t\"contract_call\",\n\t\"contract_deploy\",\n\t\"print_event\",\n] as const;\n\nconst triggerAmount = z.union([\n\tz.string().trim().regex(/^\\d+$/, \"must be a non-negative integer string\"),\n\tz.number().int().nonnegative(),\n]);\n/** Principal/identifier/name patterns — `*` wildcards allowed (matched by the\n * evaluator). */\nconst triggerPattern = z.string().trim().min(1);\nconst trait = z.string().trim().min(1);\n\nexport const ChainTriggerSchema: z.ZodType<ChainTrigger> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_transfer\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\tmaxAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_mint\"),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_burn\"),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"stx_lock\"),\n\t\t\t\tlockedAddress: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"ft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\tminAmount: triggerAmount.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_transfer\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_mint\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\trecipient: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"nft_burn\"),\n\t\t\t\tassetIdentifier: triggerPattern.optional(),\n\t\t\t\tsender: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_call\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\tfunctionName: triggerPattern.optional(),\n\t\t\t\tcaller: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"contract_deploy\"),\n\t\t\t\tdeployer: triggerPattern.optional(),\n\t\t\t\tcontractName: triggerPattern.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tz\n\t\t\t.object({\n\t\t\t\ttype: z.literal(\"print_event\"),\n\t\t\t\tcontractId: triggerPattern.optional(),\n\t\t\t\ttopic: triggerPattern.optional(),\n\t\t\t\ttrait: trait.optional(),\n\t\t\t})\n\t\t\t.strict(),\n\t],\n);\n\nexport const ChainTriggersSchema: z.ZodType<ChainTrigger[]> = z\n\t.array(ChainTriggerSchema)\n\t.min(1)\n\t.max(50);\n\nexport const CreateSubscriptionRequestSchema: z.ZodType<ParsedCreateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname,\n\t\t\t// Subgraph mode (kind=subgraph): subgraphName + tableName + optional filter.\n\t\t\tsubgraphName: resourceName.optional(),\n\t\t\ttableName: resourceName.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\t// Chain mode (kind=chain): triggers.\n\t\t\ttriggers: ChainTriggersSchema.optional(),\n\t\t\turl: webhookUrl,\n\t\t\tformat: SubscriptionFormatSchema.default(\"standard-webhooks\"),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine(\n\t\t\t(v) => {\n\t\t\t\tconst subgraphMode =\n\t\t\t\t\tv.subgraphName !== undefined || v.tableName !== undefined;\n\t\t\t\tconst chainMode = v.triggers !== undefined;\n\t\t\t\tif (chainMode && subgraphMode) return false;\n\t\t\t\tif (chainMode) return true;\n\t\t\t\t// Subgraph mode requires BOTH subgraphName and tableName.\n\t\t\t\treturn v.subgraphName !== undefined && v.tableName !== undefined;\n\t\t\t},\n\t\t\t{\n\t\t\t\tmessage:\n\t\t\t\t\t\"provide either { subgraphName, tableName } for a subgraph subscription OR { triggers } for a chain subscription — not both\",\n\t\t\t},\n\t\t)\n\t\t.refine((v) => v.filter === undefined || v.triggers === undefined, {\n\t\t\tmessage:\n\t\t\t\t\"`filter` applies to subgraph subscriptions; chain subscriptions use `triggers`\",\n\t\t\tpath: [\"filter\"],\n\t\t});\n\nexport const UpdateSubscriptionRequestSchema: z.ZodType<UpdateSubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tname: name.optional(),\n\t\t\turl: webhookUrl.optional(),\n\t\t\tfilter: SubscriptionFilterSchema.optional(),\n\t\t\tformat: SubscriptionFormatSchema.optional(),\n\t\t\truntime: SubscriptionRuntimeSchema.nullable().optional(),\n\t\t\tauthConfig: z.record(z.string(), z.unknown()).optional(),\n\t\t\tmaxRetries: z.number().int().min(0).max(100).optional(),\n\t\t\ttimeoutMs: z.number().int().min(100).max(300_000).optional(),\n\t\t\tconcurrency: z.number().int().min(1).max(100).optional(),\n\t\t})\n\t\t.refine((value) => Object.keys(value).length > 0, {\n\t\t\tmessage: \"At least one field must be provided\",\n\t\t});\n\nexport const ReplaySubscriptionRequestSchema: z.ZodType<ReplaySubscriptionRequest> =\n\tz\n\t\t.object({\n\t\t\tfromBlock: z.number().int().nonnegative(),\n\t\t\ttoBlock: z.number().int().nonnegative(),\n\t\t\tforce: z.string().trim().min(1).max(64).optional(),\n\t\t})\n\t\t.refine((value) => value.fromBlock <= value.toBlock, {\n\t\t\tmessage: \"fromBlock must be less than or equal to toBlock\",\n\t\t\tpath: [\"toBlock\"],\n\t\t});\n\nexport type SubscriptionStatus = (typeof SUBSCRIPTION_STATUSES)[number];\n/** Polymorphic subscription mode (mirrors db/types `SubscriptionKind`). */\nexport type SubscriptionKind = \"subgraph\" | \"chain\";\nexport type SubscriptionFormat = (typeof SUBSCRIPTION_FORMATS)[number];\nexport type SubscriptionRuntime = (typeof SUBSCRIPTION_RUNTIMES)[number];\nexport type SubscriptionFilterPrimitive = string | number | boolean;\nexport type SubscriptionFilterOperator =\n\t| { eq: SubscriptionFilterPrimitive }\n\t| { neq: SubscriptionFilterPrimitive }\n\t| { gt: string | number }\n\t| { gte: string | number }\n\t| { lt: string | number }\n\t| { lte: string | number }\n\t| { in: SubscriptionFilterPrimitive[] };\nexport type SubscriptionFilterClause =\n\t| SubscriptionFilterPrimitive\n\t| SubscriptionFilterOperator;\nexport type SubscriptionFilter = Record<string, SubscriptionFilterClause>;\n\nexport type ChainTriggerType = (typeof CHAIN_TRIGGER_TYPES)[number];\n/** Non-negative integer amount over JSON (string for uint128 safety, or number). */\nexport type ChainTriggerAmount = string | number;\n\ninterface TraitScoped {\n\ttrait?: string;\n}\n\n/** JSON mirror of the subgraph runtime's `SubgraphFilter` union. */\nexport type ChainTrigger =\n\t| {\n\t\t\ttype: \"stx_transfer\";\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t\t\tmaxAmount?: ChainTriggerAmount;\n\t }\n\t| { type: \"stx_mint\"; recipient?: string; minAmount?: ChainTriggerAmount }\n\t| { type: \"stx_burn\"; sender?: string; minAmount?: ChainTriggerAmount }\n\t| {\n\t\t\ttype: \"stx_lock\";\n\t\t\tlockedAddress?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t }\n\t| ({\n\t\t\ttype: \"ft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"ft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\tminAmount?: ChainTriggerAmount;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_transfer\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_mint\";\n\t\t\tassetIdentifier?: string;\n\t\t\trecipient?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"nft_burn\";\n\t\t\tassetIdentifier?: string;\n\t\t\tsender?: string;\n\t } & TraitScoped)\n\t| ({\n\t\t\ttype: \"contract_call\";\n\t\t\tcontractId?: string;\n\t\t\tfunctionName?: string;\n\t\t\tcaller?: string;\n\t } & TraitScoped)\n\t| { type: \"contract_deploy\"; deployer?: string; contractName?: string }\n\t| ({\n\t\t\ttype: \"print_event\";\n\t\t\tcontractId?: string;\n\t\t\ttopic?: string;\n\t } & TraitScoped);\n\n/** Args for a chain-trigger builder — every field of a variant except `type`. */\ntype TriggerArgs<T extends ChainTrigger[\"type\"]> = Omit<\n\tExtract<ChainTrigger, { type: T }>,\n\t\"type\"\n>;\n\n/**\n * Ergonomic chain-trigger constructors for `subscriptions.create({ triggers })`.\n * Each returns a bare `ChainTrigger` (the wire shape the API expects):\n *\n * ```ts\n * client.subscriptions.create({\n * url: \"https://my.app/webhook\",\n * triggers: [trigger.contractCall({ contractId: \"SP....amm\", functionName: \"swap-*\" })],\n * });\n * ```\n */\nexport const trigger = {\n\tstxTransfer: (f: TriggerArgs<\"stx_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_transfer\",\n\t\t...f,\n\t}),\n\tstxMint: (f: TriggerArgs<\"stx_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_mint\",\n\t\t...f,\n\t}),\n\tstxBurn: (f: TriggerArgs<\"stx_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_burn\",\n\t\t...f,\n\t}),\n\tstxLock: (f: TriggerArgs<\"stx_lock\"> = {}): ChainTrigger => ({\n\t\ttype: \"stx_lock\",\n\t\t...f,\n\t}),\n\tftTransfer: (f: TriggerArgs<\"ft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_transfer\",\n\t\t...f,\n\t}),\n\tftMint: (f: TriggerArgs<\"ft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_mint\",\n\t\t...f,\n\t}),\n\tftBurn: (f: TriggerArgs<\"ft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"ft_burn\",\n\t\t...f,\n\t}),\n\tnftTransfer: (f: TriggerArgs<\"nft_transfer\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_transfer\",\n\t\t...f,\n\t}),\n\tnftMint: (f: TriggerArgs<\"nft_mint\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_mint\",\n\t\t...f,\n\t}),\n\tnftBurn: (f: TriggerArgs<\"nft_burn\"> = {}): ChainTrigger => ({\n\t\ttype: \"nft_burn\",\n\t\t...f,\n\t}),\n\tcontractCall: (f: TriggerArgs<\"contract_call\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_call\",\n\t\t...f,\n\t}),\n\tcontractDeploy: (f: TriggerArgs<\"contract_deploy\"> = {}): ChainTrigger => ({\n\t\ttype: \"contract_deploy\",\n\t\t...f,\n\t}),\n\tprintEvent: (f: TriggerArgs<\"print_event\"> = {}): ChainTrigger => ({\n\t\ttype: \"print_event\",\n\t\t...f,\n\t}),\n} as const;\n\nexport interface CreateSubscriptionRequest {\n\tname: string;\n\t/** Subgraph mode. */\n\tsubgraphName?: string;\n\ttableName?: string;\n\tfilter?: SubscriptionFilter;\n\t/** Chain mode. */\n\ttriggers?: ChainTrigger[];\n\turl: string;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport interface ParsedCreateSubscriptionRequest\n\textends Omit<CreateSubscriptionRequest, \"format\"> {\n\tformat: SubscriptionFormat;\n}\n\nexport interface UpdateSubscriptionRequest {\n\tname?: string;\n\turl?: string;\n\tfilter?: SubscriptionFilter;\n\tformat?: SubscriptionFormat;\n\truntime?: SubscriptionRuntime | null;\n\tauthConfig?: Record<string, unknown>;\n\tmaxRetries?: number;\n\ttimeoutMs?: number;\n\tconcurrency?: number;\n}\n\nexport type ParsedUpdateSubscriptionRequest = UpdateSubscriptionRequest;\n\nexport interface ReplaySubscriptionRequest {\n\tfromBlock: number;\n\ttoBlock: number;\n\tforce?: string;\n}\n\nexport type ParsedReplaySubscriptionRequest = ReplaySubscriptionRequest;\n\nexport interface SubscriptionSummary {\n\tid: string;\n\tname: string;\n\tstatus: SubscriptionStatus;\n\tkind: SubscriptionKind;\n\t/** Null for chain subscriptions. */\n\tsubgraphName: string | null;\n\t/** Null for chain subscriptions. */\n\ttableName: string | null;\n\tformat: SubscriptionFormat;\n\truntime: SubscriptionRuntime | null;\n\turl: string;\n\tlastDeliveryAt: string | null;\n\tlastSuccessAt: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubscriptionDetail extends SubscriptionSummary {\n\tfilter: Record<string, unknown>;\n\t/** Chain-trigger filters (chain subscriptions only). */\n\ttriggers: ChainTrigger[] | null;\n\tauthConfig: Record<string, unknown>;\n\tmaxRetries: number;\n\ttimeoutMs: number;\n\tconcurrency: number;\n\tcircuitFailures: number;\n\tcircuitOpenedAt: string | null;\n\tlastError: string | null;\n}\n\nexport interface CreateSubscriptionResponse {\n\tsubscription: SubscriptionDetail;\n\t/** Plaintext signing secret — surfaced ONCE. Store it server-side. */\n\tsigningSecret: string;\n}\n\nexport interface RotateSecretResponse {\n\tsubscription: SubscriptionDetail;\n\tsigningSecret: string;\n}\n\nexport interface DeliveryRow {\n\tid: string;\n\tattempt: number;\n\tstatusCode: number | null;\n\terrorMessage: string | null;\n\tdurationMs: number | null;\n\tresponseBody: string | null;\n\tdispatchedAt: string;\n}\n\nexport interface ReplayResult {\n\treplayId: string;\n\tenqueuedCount: number;\n\tscannedCount: number;\n}\n\n/** Result of a one-off test delivery (`POST /:id/test`). Logged as a delivery\n * row (with a null outbox_id) so it shows up under the subscription's deliveries. */\nexport interface SubscriptionTestResult {\n\tok: boolean;\n\tstatusCode: number | null;\n\terror: string | null;\n\tdurationMs: number;\n\tdeliveryId: string;\n}\n\nexport interface DeadRow {\n\tid: string;\n\teventType: string;\n\tattempt: number;\n\tblockHeight: number;\n\ttxId: string | null;\n\tpayload: Record<string, unknown>;\n\tfailedAt: string | null;\n\tcreatedAt: string;\n}\n\nexport interface SubscriptionSchemaColumn {\n\ttype?: unknown;\n}\n\nexport interface SubscriptionSchemaTable {\n\tcolumns: Record<string, SubscriptionSchemaColumn>;\n}\n\nexport type SubscriptionSchemaTables = Record<string, SubscriptionSchemaTable>;\n\nconst SCALAR_COLUMN_TYPES = new Set([\n\t\"text\",\n\t\"uint\",\n\t\"int\",\n\t\"principal\",\n\t\"boolean\",\n\t\"timestamp\",\n]);\n\nconst COMPARISON_COLUMN_TYPES = new Set([\"uint\", \"int\", \"timestamp\"]);\n\nfunction formatIssuePath(path: PropertyKey[]): string {\n\treturn path.length > 0 ? `${path.map(String).join(\".\")}: ` : \"\";\n}\n\nexport function formatSubscriptionSchemaErrors(error: z.ZodError): string[] {\n\treturn error.issues.map(\n\t\t(issue) => `${formatIssuePath(issue.path)}${issue.message}`,\n\t);\n}\n\nfunction operatorForClause(clause: SubscriptionFilterClause): string {\n\tif (clause === null || typeof clause !== \"object\" || Array.isArray(clause)) {\n\t\treturn \"eq\";\n\t}\n\treturn Object.keys(clause)[0] ?? \"eq\";\n}\n\nexport function validateSubscriptionFilterForTable(input: {\n\tsubgraphName?: string;\n\ttableName: string;\n\tfilter?: unknown;\n\ttables: SubscriptionSchemaTables;\n}): string[] {\n\tconst errors: string[] = [];\n\tconst table = input.tables[input.tableName];\n\tif (!table) {\n\t\tconst names = Object.keys(input.tables);\n\t\terrors.push(\n\t\t\t`Unknown table \"${input.tableName}\"${\n\t\t\t\tinput.subgraphName ? ` in subgraph \"${input.subgraphName}\"` : \"\"\n\t\t\t}.${names.length > 0 ? ` Available tables: ${names.join(\", \")}.` : \"\"}`,\n\t\t);\n\t\treturn errors;\n\t}\n\n\tif (input.filter === undefined) return errors;\n\n\tconst parsed = SubscriptionFilterSchema.safeParse(input.filter);\n\tif (!parsed.success) {\n\t\treturn formatSubscriptionSchemaErrors(parsed.error);\n\t}\n\n\tfor (const [field, clause] of Object.entries(parsed.data)) {\n\t\tconst column = table.columns[field];\n\t\tif (!column) {\n\t\t\terrors.push(\n\t\t\t\t`Unknown filter field \"${field}\" on table \"${input.tableName}\".`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst columnType =\n\t\t\ttypeof column.type === \"string\" ? column.type.toLowerCase() : \"\";\n\t\tif (!SCALAR_COLUMN_TYPES.has(columnType)) {\n\t\t\terrors.push(\n\t\t\t\t`Filter field \"${field}\" has unsupported type \"${columnType || \"unknown\"}\"; subscription filters require scalar columns.`,\n\t\t\t);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst operator = operatorForClause(clause);\n\t\tif (\n\t\t\t(operator === \"gt\" ||\n\t\t\t\toperator === \"gte\" ||\n\t\t\t\toperator === \"lt\" ||\n\t\t\t\toperator === \"lte\") &&\n\t\t\t!COMPARISON_COLUMN_TYPES.has(columnType)\n\t\t) {\n\t\t\terrors.push(\n\t\t\t\t`Operator \"${operator}\" is not supported for ${columnType} field \"${field}\".`,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn errors;\n}\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAEO,IAAM,uBAAuB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,wBAAwB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEO,IAAM,wBAAwB,CAAC,UAAU,UAAU,OAAO;AAE1D,IAAM,gCAAgC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAEA,IAAM,aAAa,EACjB,OAAO,EACP,KAAK,EACL,IAAI,CAAC,EACL,OACA,CAAC,UAAU,MAAM,WAAW,SAAS,KAAK,MAAM,WAAW,UAAU,GACrE,wBACD;AAED,IAAM,OAAO,EAAE,OAAO,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IAAI,GAAG;AAAA,IAC1D,MAAM,SAAS,MAAM,QAAQ;AAAA,IAC7B,IAAI,CAAC,QAAQ;AAAA,MACZ,OAAO,KACN,yBAAyB,oBAAoB,MAAM,aACpD;AAAA,MACA;AAAA,IACD;AAAA,IAEA,MAAM,aACL,OAAO,OAAO,SAAS,WAAW,OAAO,KAAK,YAAY,IAAI;AAAA,IAC/D,IAAI,CAAC,oBAAoB,IAAI,UAAU,GAAG;AAAA,MACzC,OAAO,KACN,iBAAiB,gCAAgC,cAAc,0DAChE;AAAA,MACA;AAAA,IACD;AAAA,IAEA,MAAM,WAAW,kBAAkB,MAAM;AAAA,IACzC,KACE,aAAa,QACb,aAAa,SACb,aAAa,QACb,aAAa,UACd,CAAC,wBAAwB,IAAI,UAAU,GACtC;AAAA,MACD,OAAO,KACN,aAAa,kCAAkC,qBAAqB,SACrE;AAAA,IACD;AAAA,EACD;AAAA,EAEA,OAAO;AAAA;",
8
8
  "debugId": "420686B508CCE30264756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondlayer/shared",
3
- "version": "6.24.0",
3
+ "version": "6.25.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",