@secondlayer/shared 0.10.2 → 0.11.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.
Files changed (43) hide show
  1. package/dist/src/db/index.d.ts +179 -2
  2. package/dist/src/db/queries/accounts.d.ts +156 -2
  3. package/dist/src/db/queries/accounts.js +17 -1
  4. package/dist/src/db/queries/accounts.js.map +3 -3
  5. package/dist/src/db/queries/integrity.d.ts +149 -1
  6. package/dist/src/db/queries/marketplace.d.ts +463 -0
  7. package/dist/src/db/queries/marketplace.js +142 -0
  8. package/dist/src/db/queries/marketplace.js.map +10 -0
  9. package/dist/src/db/queries/metrics.d.ts +149 -1
  10. package/dist/src/db/queries/projects.d.ts +423 -0
  11. package/dist/src/db/queries/projects.js +47 -0
  12. package/dist/src/db/queries/projects.js.map +10 -0
  13. package/dist/src/db/queries/subgraph-gaps.d.ts +149 -1
  14. package/dist/src/db/queries/subgraphs.d.ts +156 -6
  15. package/dist/src/db/queries/subgraphs.js +16 -13
  16. package/dist/src/db/queries/subgraphs.js.map +3 -3
  17. package/dist/src/db/queries/usage.d.ts +149 -1
  18. package/dist/src/db/queries/workflows.d.ts +439 -0
  19. package/dist/src/db/queries/workflows.js +115 -0
  20. package/dist/src/db/queries/workflows.js.map +11 -0
  21. package/dist/src/db/schema.d.ts +179 -2
  22. package/dist/src/index.d.ts +249 -10
  23. package/dist/src/index.js +91 -72
  24. package/dist/src/index.js.map +4 -3
  25. package/dist/src/node/local-client.d.ts +149 -1
  26. package/dist/src/schemas/index.d.ts +71 -9
  27. package/dist/src/schemas/index.js +93 -74
  28. package/dist/src/schemas/index.js.map +4 -3
  29. package/dist/src/schemas/marketplace.d.ts +63 -0
  30. package/dist/src/schemas/marketplace.js +39 -0
  31. package/dist/src/schemas/marketplace.js.map +10 -0
  32. package/dist/src/schemas/workflows.d.ts +66 -0
  33. package/dist/src/schemas/workflows.js +39 -0
  34. package/dist/src/schemas/workflows.js.map +10 -0
  35. package/dist/src/types.d.ts +1 -0
  36. package/migrations/0022_marketplace.ts +88 -0
  37. package/migrations/0023_projects.ts +149 -0
  38. package/migrations/0024_chat_sessions.ts +51 -0
  39. package/migrations/0025_chat_session_summary.ts +15 -0
  40. package/migrations/0026_workflows.ts +204 -0
  41. package/migrations/0027_workflow_cursors.ts +16 -0
  42. package/migrations/0028_subgraph_account_scoping.ts +116 -0
  43. package/package.json +22 -2
@@ -40,6 +40,7 @@ interface StreamsTable {
40
40
  endpoint_url: string;
41
41
  signing_secret: string | null;
42
42
  api_key_id: string;
43
+ project_id: string | null;
43
44
  created_at: Generated<Date>;
44
45
  updated_at: Generated<Date>;
45
46
  }
@@ -101,7 +102,13 @@ interface SubgraphsTable {
101
102
  last_error_at: Date | null;
102
103
  total_processed: Generated<number>;
103
104
  total_errors: Generated<number>;
104
- api_key_id: string;
105
+ api_key_id: string | null;
106
+ account_id: string;
107
+ project_id: string | null;
108
+ is_public: Generated<boolean>;
109
+ tags: Generated<string[]>;
110
+ description: string | null;
111
+ forked_from_id: string | null;
105
112
  created_at: Generated<Date>;
106
113
  updated_at: Generated<Date>;
107
114
  }
@@ -132,6 +139,10 @@ interface AccountsTable {
132
139
  id: Generated<string>;
133
140
  email: string;
134
141
  plan: Generated<string>;
142
+ display_name: string | null;
143
+ bio: string | null;
144
+ avatar_url: string | null;
145
+ slug: string | null;
135
146
  created_at: Generated<Date>;
136
147
  }
137
148
  interface SessionsTable {
@@ -232,6 +243,131 @@ interface SubgraphHealthSnapshotsTable {
232
243
  last_processed_block: number | null;
233
244
  captured_at: Generated<Date>;
234
245
  }
246
+ interface SubgraphUsageDailyTable {
247
+ subgraph_id: string;
248
+ date: string;
249
+ query_count: Generated<number>;
250
+ }
251
+ interface ProjectsTable {
252
+ id: Generated<string>;
253
+ name: string;
254
+ slug: string;
255
+ account_id: string;
256
+ settings: Generated<Record<string, unknown>>;
257
+ network: Generated<string>;
258
+ node_rpc: string | null;
259
+ created_at: Generated<Date>;
260
+ updated_at: Generated<Date>;
261
+ }
262
+ interface TeamMembersTable {
263
+ id: Generated<string>;
264
+ project_id: string;
265
+ account_id: string;
266
+ role: Generated<string>;
267
+ invited_by: string | null;
268
+ created_at: Generated<Date>;
269
+ }
270
+ interface TeamInvitationsTable {
271
+ id: Generated<string>;
272
+ project_id: string;
273
+ email: string;
274
+ role: Generated<string>;
275
+ token: string;
276
+ invited_by: string | null;
277
+ expires_at: Date;
278
+ accepted_at: Date | null;
279
+ created_at: Generated<Date>;
280
+ }
281
+ interface ChatSessionsTable {
282
+ id: Generated<string>;
283
+ account_id: string;
284
+ title: string | null;
285
+ summary: unknown | null;
286
+ created_at: Generated<Date>;
287
+ updated_at: Generated<Date>;
288
+ }
289
+ interface ChatMessagesTable {
290
+ id: Generated<string>;
291
+ chat_session_id: string;
292
+ role: string;
293
+ parts: unknown;
294
+ metadata: unknown | null;
295
+ created_at: Generated<Date>;
296
+ }
297
+ interface WorkflowDefinitionsTable {
298
+ id: Generated<string>;
299
+ name: string;
300
+ version: Generated<string>;
301
+ status: Generated<string>;
302
+ trigger_type: string;
303
+ trigger_config: unknown;
304
+ handler_path: string;
305
+ retries_config: unknown | null;
306
+ timeout_ms: number | null;
307
+ api_key_id: string;
308
+ project_id: string | null;
309
+ created_at: Generated<Date>;
310
+ updated_at: Generated<Date>;
311
+ }
312
+ interface WorkflowRunsTable {
313
+ id: Generated<string>;
314
+ definition_id: string;
315
+ status: Generated<string>;
316
+ trigger_type: string;
317
+ trigger_data: unknown | null;
318
+ dedup_key: string | null;
319
+ error: string | null;
320
+ started_at: Date | null;
321
+ completed_at: Date | null;
322
+ duration_ms: number | null;
323
+ total_ai_tokens: Generated<number>;
324
+ created_at: Generated<Date>;
325
+ }
326
+ interface WorkflowStepsTable {
327
+ id: Generated<string>;
328
+ run_id: string;
329
+ step_index: number;
330
+ step_id: string;
331
+ step_type: string;
332
+ status: Generated<string>;
333
+ input: unknown | null;
334
+ output: unknown | null;
335
+ error: string | null;
336
+ retry_count: Generated<number>;
337
+ ai_tokens_used: Generated<number>;
338
+ started_at: Date | null;
339
+ completed_at: Date | null;
340
+ duration_ms: number | null;
341
+ created_at: Generated<Date>;
342
+ }
343
+ interface WorkflowQueueTable {
344
+ id: Generated<string>;
345
+ run_id: string;
346
+ status: Generated<string>;
347
+ attempts: Generated<number>;
348
+ max_attempts: Generated<number>;
349
+ scheduled_for: Generated<Date>;
350
+ locked_at: Date | null;
351
+ locked_by: string | null;
352
+ error: string | null;
353
+ created_at: Generated<Date>;
354
+ completed_at: Date | null;
355
+ }
356
+ interface WorkflowSchedulesTable {
357
+ id: Generated<string>;
358
+ definition_id: string;
359
+ cron_expr: string;
360
+ timezone: Generated<string>;
361
+ next_run_at: Date;
362
+ last_run_at: Date | null;
363
+ enabled: Generated<boolean>;
364
+ created_at: Generated<Date>;
365
+ }
366
+ interface WorkflowCursorsTable {
367
+ name: string;
368
+ block_height: Generated<number>;
369
+ updated_at: Generated<Date>;
370
+ }
235
371
  interface Database {
236
372
  blocks: BlocksTable;
237
373
  transactions: TransactionsTable;
@@ -255,6 +391,18 @@ interface Database {
255
391
  subgraph_processing_stats: SubgraphProcessingStatsTable;
256
392
  subgraph_table_snapshots: SubgraphTableSnapshotsTable;
257
393
  subgraph_gaps: SubgraphGapsTable;
394
+ subgraph_usage_daily: SubgraphUsageDailyTable;
395
+ projects: ProjectsTable;
396
+ team_members: TeamMembersTable;
397
+ team_invitations: TeamInvitationsTable;
398
+ chat_sessions: ChatSessionsTable;
399
+ chat_messages: ChatMessagesTable;
400
+ workflow_definitions: WorkflowDefinitionsTable;
401
+ workflow_runs: WorkflowRunsTable;
402
+ workflow_steps: WorkflowStepsTable;
403
+ workflow_queue: WorkflowQueueTable;
404
+ workflow_schedules: WorkflowSchedulesTable;
405
+ workflow_cursors: WorkflowCursorsTable;
258
406
  }
259
407
  type Block = Selectable<BlocksTable>;
260
408
  type InsertBlock = Insertable<BlocksTable>;
@@ -302,4 +450,33 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
302
450
  type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
303
451
  type SubgraphGap = Selectable<SubgraphGapsTable>;
304
452
  type InsertSubgraphGap = Insertable<SubgraphGapsTable>;
305
- export { WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateSubgraph, UpdateStreamRow, UpdateStreamMetrics, UpdateJob, UpdateIndexProgress, UpdateEvent, UpdateDelivery, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, SubgraphsTable, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, StreamsTable, StreamMetricsTable, StreamMetrics, Stream, SessionsTable, Session, MagicLinksTable, MagicLink, JobsTable, Job, InsertTransaction, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertStreamMetrics, InsertStream, InsertSession, InsertMagicLink, InsertJob, InsertIndexProgress, InsertEvent, InsertDelivery, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, Delivery, DeliveriesTable, Database, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
453
+ type SubgraphUsageDaily = Selectable<SubgraphUsageDailyTable>;
454
+ type InsertSubgraphUsageDaily = Insertable<SubgraphUsageDailyTable>;
455
+ type WorkflowDefinition = Selectable<WorkflowDefinitionsTable>;
456
+ type InsertWorkflowDefinition = Insertable<WorkflowDefinitionsTable>;
457
+ type UpdateWorkflowDefinition = Updateable<WorkflowDefinitionsTable>;
458
+ type WorkflowRun = Selectable<WorkflowRunsTable>;
459
+ type InsertWorkflowRun = Insertable<WorkflowRunsTable>;
460
+ type UpdateWorkflowRun = Updateable<WorkflowRunsTable>;
461
+ type WorkflowStep = Selectable<WorkflowStepsTable>;
462
+ type InsertWorkflowStep = Insertable<WorkflowStepsTable>;
463
+ type UpdateWorkflowStep = Updateable<WorkflowStepsTable>;
464
+ type WorkflowQueueItem = Selectable<WorkflowQueueTable>;
465
+ type InsertWorkflowQueueItem = Insertable<WorkflowQueueTable>;
466
+ type WorkflowSchedule = Selectable<WorkflowSchedulesTable>;
467
+ type InsertWorkflowSchedule = Insertable<WorkflowSchedulesTable>;
468
+ type UpdateWorkflowSchedule = Updateable<WorkflowSchedulesTable>;
469
+ type WorkflowCursor = Selectable<WorkflowCursorsTable>;
470
+ type Project = Selectable<ProjectsTable>;
471
+ type InsertProject = Insertable<ProjectsTable>;
472
+ type UpdateProject = Updateable<ProjectsTable>;
473
+ type TeamMember = Selectable<TeamMembersTable>;
474
+ type InsertTeamMember = Insertable<TeamMembersTable>;
475
+ type TeamInvitation = Selectable<TeamInvitationsTable>;
476
+ type InsertTeamInvitation = Insertable<TeamInvitationsTable>;
477
+ type ChatSession = Selectable<ChatSessionsTable>;
478
+ type InsertChatSession = Insertable<ChatSessionsTable>;
479
+ type UpdateChatSession = Updateable<ChatSessionsTable>;
480
+ type ChatMessage = Selectable<ChatMessagesTable>;
481
+ type InsertChatMessage = Insertable<ChatMessagesTable>;
482
+ export { WorkflowStepsTable, WorkflowStep, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateTransaction, UpdateSubgraph, UpdateStreamRow, UpdateStreamMetrics, UpdateProject, UpdateJob, UpdateIndexProgress, UpdateEvent, UpdateDelivery, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, StreamsTable, StreamMetricsTable, StreamMetrics, Stream, SessionsTable, Session, ProjectsTable, Project, MagicLinksTable, MagicLink, JobsTable, Job, InsertWorkflowStep, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertTransaction, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertStreamMetrics, InsertStream, InsertSession, InsertProject, InsertMagicLink, InsertJob, InsertIndexProgress, InsertEvent, InsertDelivery, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, Delivery, DeliveriesTable, Database, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
@@ -40,6 +40,7 @@ interface StreamsTable {
40
40
  endpoint_url: string;
41
41
  signing_secret: string | null;
42
42
  api_key_id: string;
43
+ project_id: string | null;
43
44
  created_at: Generated<Date>;
44
45
  updated_at: Generated<Date>;
45
46
  }
@@ -101,7 +102,13 @@ interface SubgraphsTable {
101
102
  last_error_at: Date | null;
102
103
  total_processed: Generated<number>;
103
104
  total_errors: Generated<number>;
104
- api_key_id: string;
105
+ api_key_id: string | null;
106
+ account_id: string;
107
+ project_id: string | null;
108
+ is_public: Generated<boolean>;
109
+ tags: Generated<string[]>;
110
+ description: string | null;
111
+ forked_from_id: string | null;
105
112
  created_at: Generated<Date>;
106
113
  updated_at: Generated<Date>;
107
114
  }
@@ -132,6 +139,10 @@ interface AccountsTable {
132
139
  id: Generated<string>;
133
140
  email: string;
134
141
  plan: Generated<string>;
142
+ display_name: string | null;
143
+ bio: string | null;
144
+ avatar_url: string | null;
145
+ slug: string | null;
135
146
  created_at: Generated<Date>;
136
147
  }
137
148
  interface SessionsTable {
@@ -232,6 +243,131 @@ interface SubgraphHealthSnapshotsTable {
232
243
  last_processed_block: number | null;
233
244
  captured_at: Generated<Date>;
234
245
  }
246
+ interface SubgraphUsageDailyTable {
247
+ subgraph_id: string;
248
+ date: string;
249
+ query_count: Generated<number>;
250
+ }
251
+ interface ProjectsTable {
252
+ id: Generated<string>;
253
+ name: string;
254
+ slug: string;
255
+ account_id: string;
256
+ settings: Generated<Record<string, unknown>>;
257
+ network: Generated<string>;
258
+ node_rpc: string | null;
259
+ created_at: Generated<Date>;
260
+ updated_at: Generated<Date>;
261
+ }
262
+ interface TeamMembersTable {
263
+ id: Generated<string>;
264
+ project_id: string;
265
+ account_id: string;
266
+ role: Generated<string>;
267
+ invited_by: string | null;
268
+ created_at: Generated<Date>;
269
+ }
270
+ interface TeamInvitationsTable {
271
+ id: Generated<string>;
272
+ project_id: string;
273
+ email: string;
274
+ role: Generated<string>;
275
+ token: string;
276
+ invited_by: string | null;
277
+ expires_at: Date;
278
+ accepted_at: Date | null;
279
+ created_at: Generated<Date>;
280
+ }
281
+ interface ChatSessionsTable {
282
+ id: Generated<string>;
283
+ account_id: string;
284
+ title: string | null;
285
+ summary: unknown | null;
286
+ created_at: Generated<Date>;
287
+ updated_at: Generated<Date>;
288
+ }
289
+ interface ChatMessagesTable {
290
+ id: Generated<string>;
291
+ chat_session_id: string;
292
+ role: string;
293
+ parts: unknown;
294
+ metadata: unknown | null;
295
+ created_at: Generated<Date>;
296
+ }
297
+ interface WorkflowDefinitionsTable {
298
+ id: Generated<string>;
299
+ name: string;
300
+ version: Generated<string>;
301
+ status: Generated<string>;
302
+ trigger_type: string;
303
+ trigger_config: unknown;
304
+ handler_path: string;
305
+ retries_config: unknown | null;
306
+ timeout_ms: number | null;
307
+ api_key_id: string;
308
+ project_id: string | null;
309
+ created_at: Generated<Date>;
310
+ updated_at: Generated<Date>;
311
+ }
312
+ interface WorkflowRunsTable {
313
+ id: Generated<string>;
314
+ definition_id: string;
315
+ status: Generated<string>;
316
+ trigger_type: string;
317
+ trigger_data: unknown | null;
318
+ dedup_key: string | null;
319
+ error: string | null;
320
+ started_at: Date | null;
321
+ completed_at: Date | null;
322
+ duration_ms: number | null;
323
+ total_ai_tokens: Generated<number>;
324
+ created_at: Generated<Date>;
325
+ }
326
+ interface WorkflowStepsTable {
327
+ id: Generated<string>;
328
+ run_id: string;
329
+ step_index: number;
330
+ step_id: string;
331
+ step_type: string;
332
+ status: Generated<string>;
333
+ input: unknown | null;
334
+ output: unknown | null;
335
+ error: string | null;
336
+ retry_count: Generated<number>;
337
+ ai_tokens_used: Generated<number>;
338
+ started_at: Date | null;
339
+ completed_at: Date | null;
340
+ duration_ms: number | null;
341
+ created_at: Generated<Date>;
342
+ }
343
+ interface WorkflowQueueTable {
344
+ id: Generated<string>;
345
+ run_id: string;
346
+ status: Generated<string>;
347
+ attempts: Generated<number>;
348
+ max_attempts: Generated<number>;
349
+ scheduled_for: Generated<Date>;
350
+ locked_at: Date | null;
351
+ locked_by: string | null;
352
+ error: string | null;
353
+ created_at: Generated<Date>;
354
+ completed_at: Date | null;
355
+ }
356
+ interface WorkflowSchedulesTable {
357
+ id: Generated<string>;
358
+ definition_id: string;
359
+ cron_expr: string;
360
+ timezone: Generated<string>;
361
+ next_run_at: Date;
362
+ last_run_at: Date | null;
363
+ enabled: Generated<boolean>;
364
+ created_at: Generated<Date>;
365
+ }
366
+ interface WorkflowCursorsTable {
367
+ name: string;
368
+ block_height: Generated<number>;
369
+ updated_at: Generated<Date>;
370
+ }
235
371
  interface Database {
236
372
  blocks: BlocksTable;
237
373
  transactions: TransactionsTable;
@@ -255,6 +391,18 @@ interface Database {
255
391
  subgraph_processing_stats: SubgraphProcessingStatsTable;
256
392
  subgraph_table_snapshots: SubgraphTableSnapshotsTable;
257
393
  subgraph_gaps: SubgraphGapsTable;
394
+ subgraph_usage_daily: SubgraphUsageDailyTable;
395
+ projects: ProjectsTable;
396
+ team_members: TeamMembersTable;
397
+ team_invitations: TeamInvitationsTable;
398
+ chat_sessions: ChatSessionsTable;
399
+ chat_messages: ChatMessagesTable;
400
+ workflow_definitions: WorkflowDefinitionsTable;
401
+ workflow_runs: WorkflowRunsTable;
402
+ workflow_steps: WorkflowStepsTable;
403
+ workflow_queue: WorkflowQueueTable;
404
+ workflow_schedules: WorkflowSchedulesTable;
405
+ workflow_cursors: WorkflowCursorsTable;
258
406
  }
259
407
  type Block = Selectable<BlocksTable>;
260
408
  type InsertBlock = Insertable<BlocksTable>;
@@ -302,6 +450,35 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
302
450
  type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
303
451
  type SubgraphGap = Selectable<SubgraphGapsTable>;
304
452
  type InsertSubgraphGap = Insertable<SubgraphGapsTable>;
453
+ type SubgraphUsageDaily = Selectable<SubgraphUsageDailyTable>;
454
+ type InsertSubgraphUsageDaily = Insertable<SubgraphUsageDailyTable>;
455
+ type WorkflowDefinition = Selectable<WorkflowDefinitionsTable>;
456
+ type InsertWorkflowDefinition = Insertable<WorkflowDefinitionsTable>;
457
+ type UpdateWorkflowDefinition = Updateable<WorkflowDefinitionsTable>;
458
+ type WorkflowRun = Selectable<WorkflowRunsTable>;
459
+ type InsertWorkflowRun = Insertable<WorkflowRunsTable>;
460
+ type UpdateWorkflowRun = Updateable<WorkflowRunsTable>;
461
+ type WorkflowStep = Selectable<WorkflowStepsTable>;
462
+ type InsertWorkflowStep = Insertable<WorkflowStepsTable>;
463
+ type UpdateWorkflowStep = Updateable<WorkflowStepsTable>;
464
+ type WorkflowQueueItem = Selectable<WorkflowQueueTable>;
465
+ type InsertWorkflowQueueItem = Insertable<WorkflowQueueTable>;
466
+ type WorkflowSchedule = Selectable<WorkflowSchedulesTable>;
467
+ type InsertWorkflowSchedule = Insertable<WorkflowSchedulesTable>;
468
+ type UpdateWorkflowSchedule = Updateable<WorkflowSchedulesTable>;
469
+ type WorkflowCursor = Selectable<WorkflowCursorsTable>;
470
+ type Project = Selectable<ProjectsTable>;
471
+ type InsertProject = Insertable<ProjectsTable>;
472
+ type UpdateProject = Updateable<ProjectsTable>;
473
+ type TeamMember = Selectable<TeamMembersTable>;
474
+ type InsertTeamMember = Insertable<TeamMembersTable>;
475
+ type TeamInvitation = Selectable<TeamInvitationsTable>;
476
+ type InsertTeamInvitation = Insertable<TeamInvitationsTable>;
477
+ type ChatSession = Selectable<ChatSessionsTable>;
478
+ type InsertChatSession = Insertable<ChatSessionsTable>;
479
+ type UpdateChatSession = Updateable<ChatSessionsTable>;
480
+ type ChatMessage = Selectable<ChatMessagesTable>;
481
+ type InsertChatMessage = Insertable<ChatMessagesTable>;
305
482
  interface EnvSchemaOutput {
306
483
  DATABASE_URL?: string;
307
484
  NETWORK?: "mainnet" | "testnet";
@@ -573,6 +750,68 @@ declare const ContractDeployFilterSchema: z2.ZodType<ContractDeployFilter>;
573
750
  declare const PrintEventFilterSchema: z2.ZodType<PrintEventFilter>;
574
751
  declare const StreamFilterSchema: z2.ZodType<StreamFilter>;
575
752
  import { z as z3 } from "zod/v4";
753
+ interface PublishSubgraphRequest {
754
+ tags?: string[];
755
+ description?: string;
756
+ }
757
+ interface UpdateProfileRequest {
758
+ display_name?: string;
759
+ bio?: string;
760
+ slug?: string;
761
+ }
762
+ interface ForkSubgraphRequest {
763
+ sourceSubgraphName: string;
764
+ newName?: string;
765
+ }
766
+ declare const PublishSubgraphRequestSchema: z3.ZodType<PublishSubgraphRequest>;
767
+ declare const UpdateProfileRequestSchema: z3.ZodType<UpdateProfileRequest>;
768
+ declare const ForkSubgraphRequestSchema: z3.ZodType<ForkSubgraphRequest>;
769
+ interface MarketplaceCreator {
770
+ displayName: string | null;
771
+ slug: string | null;
772
+ }
773
+ interface MarketplaceSubgraphSummary {
774
+ name: string;
775
+ description: string | null;
776
+ tags: string[];
777
+ creator: MarketplaceCreator;
778
+ status: string;
779
+ version: string;
780
+ tables: string[];
781
+ totalQueries7d: number;
782
+ progress: number;
783
+ createdAt: string;
784
+ }
785
+ interface MarketplaceSubgraphDetail extends MarketplaceSubgraphSummary {
786
+ tableSchemas: Record<string, {
787
+ columns: Record<string, {
788
+ type: string
789
+ nullable?: boolean
790
+ }>
791
+ rowCount: number
792
+ endpoint: string
793
+ }>;
794
+ sources: Record<string, unknown>;
795
+ startBlock: number;
796
+ lastProcessedBlock: number;
797
+ forkedFrom: string | null;
798
+ usage: {
799
+ totalQueries7d: number
800
+ totalQueries30d: number
801
+ daily: Array<{
802
+ date: string
803
+ count: number
804
+ }>
805
+ };
806
+ }
807
+ interface CreatorProfile {
808
+ displayName: string | null;
809
+ bio: string | null;
810
+ avatarUrl: string | null;
811
+ slug: string | null;
812
+ subgraphs: MarketplaceSubgraphSummary[];
813
+ }
814
+ import { z as z4 } from "zod/v4";
576
815
  interface DeploySubgraphRequest {
577
816
  name: string;
578
817
  version?: string;
@@ -582,7 +821,7 @@ interface DeploySubgraphRequest {
582
821
  handlerCode: string;
583
822
  reindex?: boolean;
584
823
  }
585
- declare const DeploySubgraphRequestSchema: z3.ZodType<DeploySubgraphRequest>;
824
+ declare const DeploySubgraphRequestSchema: z4.ZodType<DeploySubgraphRequest>;
586
825
  interface DeploySubgraphResponse {
587
826
  action: "created" | "unchanged" | "updated" | "reindexed";
588
827
  subgraphId: string;
@@ -677,7 +916,7 @@ interface SubgraphQueryParams {
677
916
  fields?: string;
678
917
  filters?: Record<string, string>;
679
918
  }
680
- import { z as z4 } from "zod/v4";
919
+ import { z as z5 } from "zod/v4";
681
920
  interface StreamOptions {
682
921
  decodeClarityValues: boolean;
683
922
  includeRawTx: boolean;
@@ -752,12 +991,12 @@ interface StreamResponse {
752
991
  createdAt: string;
753
992
  updatedAt: string;
754
993
  }
755
- declare const StreamOptionsSchema: z4.ZodType<StreamOptions>;
756
- declare const CreateStreamSchema: z4.ZodType<CreateStream>;
757
- declare const UpdateStreamSchema: z4.ZodType<UpdateStream>;
758
- declare const DeliveryPayloadSchema: z4.ZodType<DeliveryPayload>;
759
- declare const StreamMetricsSchema: z4.ZodType<StreamMetricsResponse>;
760
- declare const StreamResponseSchema: z4.ZodType<StreamResponse>;
994
+ declare const StreamOptionsSchema: z5.ZodType<StreamOptions>;
995
+ declare const CreateStreamSchema: z5.ZodType<CreateStream>;
996
+ declare const UpdateStreamSchema: z5.ZodType<UpdateStream>;
997
+ declare const DeliveryPayloadSchema: z5.ZodType<DeliveryPayload>;
998
+ declare const StreamMetricsSchema: z5.ZodType<StreamMetricsResponse>;
999
+ declare const StreamResponseSchema: z5.ZodType<StreamResponse>;
761
1000
  interface CreateStreamResponse {
762
1001
  stream: StreamResponse;
763
1002
  signingSecret: string;
@@ -802,4 +1041,4 @@ declare function createSignatureHeader(payload: string, secret: string, timestam
802
1041
  * Returns true if valid, false otherwise
803
1042
  */
804
1043
  declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
805
- export { sql, exports_queue as queue, parseJsonb, logger, jsonb, getRawClient, getErrorMessage, getEnv, getDb, exports_hmac as crypto, closeDb, WaitlistTable, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateTransaction, UpdateSubgraph, UpdateStreamSchema, UpdateStreamRow, UpdateStreamMetrics, UpdateStream, UpdateJob, UpdateIndexProgress, UpdateEvent, UpdateDelivery, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, SubgraphsTable, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, StreamsTable, StreamsError, StreamResponseSchema, StreamResponse, StreamOptionsSchema, StreamOptions, StreamNotFoundError, StreamMetricsTable, StreamMetricsSchema, StreamMetricsResponse, StreamMetrics, StreamFilterSchema, StreamFilter, Stream, SessionsTable, Session, ReindexResponse, RateLimitError, QueueStats, PrintEventFilterSchema, PrintEventFilter, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MagicLinksTable, MagicLink, ListStreamsResponse, JobsTable, Job, InsertTransaction, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertStreamMetrics, InsertStream, InsertSession, InsertMagicLink, InsertJob, InsertIndexProgress, InsertEvent, InsertDelivery, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForbiddenError, FilterEvaluationError, EventsTable, Event, ErrorCodes, ErrorCode, Env, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DeliveryPayloadSchema, DeliveryPayload, DeliveryError, Delivery, DeliveriesTable, DatabaseError, Database, CreateStreamSchema, CreateStreamResponse, CreateStream, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, CODE_TO_STATUS, BulkResumeResponse, BulkPauseResponse, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
1044
+ export { sql, exports_queue as queue, parseJsonb, logger, jsonb, getRawClient, getErrorMessage, getEnv, getDb, exports_hmac as crypto, closeDb, WorkflowStepsTable, WorkflowStep, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WaitlistTable, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateTransaction, UpdateSubgraph, UpdateStreamSchema, UpdateStreamRow, UpdateStreamMetrics, UpdateStream, UpdateProject, UpdateProfileRequestSchema, UpdateProfileRequest, UpdateJob, UpdateIndexProgress, UpdateEvent, UpdateDelivery, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, StreamsTable, StreamsError, StreamResponseSchema, StreamResponse, StreamOptionsSchema, StreamOptions, StreamNotFoundError, StreamMetricsTable, StreamMetricsSchema, StreamMetricsResponse, StreamMetrics, StreamFilterSchema, StreamFilter, Stream, SessionsTable, Session, ReindexResponse, RateLimitError, QueueStats, PublishSubgraphRequestSchema, PublishSubgraphRequest, ProjectsTable, Project, PrintEventFilterSchema, PrintEventFilter, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MarketplaceSubgraphSummary, MarketplaceSubgraphDetail, MarketplaceCreator, MagicLinksTable, MagicLink, ListStreamsResponse, JobsTable, Job, InsertWorkflowStep, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertTransaction, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertStreamMetrics, InsertStream, InsertSession, InsertProject, InsertMagicLink, InsertJob, InsertIndexProgress, InsertEvent, InsertDelivery, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForkSubgraphRequestSchema, ForkSubgraphRequest, ForbiddenError, FilterEvaluationError, EventsTable, Event, ErrorCodes, ErrorCode, Env, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DeliveryPayloadSchema, DeliveryPayload, DeliveryError, Delivery, DeliveriesTable, DatabaseError, Database, CreatorProfile, CreateStreamSchema, CreateStreamResponse, CreateStream, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, CODE_TO_STATUS, BulkResumeResponse, BulkPauseResponse, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };