@secondlayer/shared 0.10.2 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/db/index.d.ts +180 -2
- package/dist/src/db/queries/accounts.d.ts +157 -2
- package/dist/src/db/queries/accounts.js +17 -1
- package/dist/src/db/queries/accounts.js.map +3 -3
- package/dist/src/db/queries/integrity.d.ts +150 -1
- package/dist/src/db/queries/marketplace.d.ts +464 -0
- package/dist/src/db/queries/marketplace.js +142 -0
- package/dist/src/db/queries/marketplace.js.map +10 -0
- package/dist/src/db/queries/metrics.d.ts +150 -1
- package/dist/src/db/queries/projects.d.ts +424 -0
- package/dist/src/db/queries/projects.js +47 -0
- package/dist/src/db/queries/projects.js.map +10 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +150 -1
- package/dist/src/db/queries/subgraphs.d.ts +158 -6
- package/dist/src/db/queries/subgraphs.js +18 -13
- package/dist/src/db/queries/subgraphs.js.map +3 -3
- package/dist/src/db/queries/usage.d.ts +150 -1
- package/dist/src/db/queries/workflows.d.ts +440 -0
- package/dist/src/db/queries/workflows.js +115 -0
- package/dist/src/db/queries/workflows.js.map +11 -0
- package/dist/src/db/schema.d.ts +180 -2
- package/dist/src/index.d.ts +258 -10
- package/dist/src/index.js +91 -72
- package/dist/src/index.js.map +5 -4
- package/dist/src/node/local-client.d.ts +150 -1
- package/dist/src/schemas/index.d.ts +79 -9
- package/dist/src/schemas/index.js +93 -74
- package/dist/src/schemas/index.js.map +5 -4
- package/dist/src/schemas/marketplace.d.ts +63 -0
- package/dist/src/schemas/marketplace.js +39 -0
- package/dist/src/schemas/marketplace.js.map +10 -0
- package/dist/src/schemas/subgraphs.d.ts +8 -0
- package/dist/src/schemas/subgraphs.js.map +2 -2
- package/dist/src/schemas/workflows.d.ts +66 -0
- package/dist/src/schemas/workflows.js +39 -0
- package/dist/src/schemas/workflows.js.map +10 -0
- package/dist/src/types.d.ts +1 -0
- package/migrations/0022_marketplace.ts +88 -0
- package/migrations/0023_projects.ts +149 -0
- package/migrations/0024_chat_sessions.ts +51 -0
- package/migrations/0025_chat_session_summary.ts +15 -0
- package/migrations/0026_workflows.ts +204 -0
- package/migrations/0027_workflow_cursors.ts +16 -0
- package/migrations/0028_subgraph_account_scoping.ts +116 -0
- package/migrations/0029_subgraph_handler_code.ts +23 -0
- package/package.json +22 -2
package/dist/src/db/schema.d.ts
CHANGED
|
@@ -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,14 @@ 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
|
+
handler_code: string | null;
|
|
108
|
+
project_id: string | null;
|
|
109
|
+
is_public: Generated<boolean>;
|
|
110
|
+
tags: Generated<string[]>;
|
|
111
|
+
description: string | null;
|
|
112
|
+
forked_from_id: string | null;
|
|
105
113
|
created_at: Generated<Date>;
|
|
106
114
|
updated_at: Generated<Date>;
|
|
107
115
|
}
|
|
@@ -132,6 +140,10 @@ interface AccountsTable {
|
|
|
132
140
|
id: Generated<string>;
|
|
133
141
|
email: string;
|
|
134
142
|
plan: Generated<string>;
|
|
143
|
+
display_name: string | null;
|
|
144
|
+
bio: string | null;
|
|
145
|
+
avatar_url: string | null;
|
|
146
|
+
slug: string | null;
|
|
135
147
|
created_at: Generated<Date>;
|
|
136
148
|
}
|
|
137
149
|
interface SessionsTable {
|
|
@@ -232,6 +244,131 @@ interface SubgraphHealthSnapshotsTable {
|
|
|
232
244
|
last_processed_block: number | null;
|
|
233
245
|
captured_at: Generated<Date>;
|
|
234
246
|
}
|
|
247
|
+
interface SubgraphUsageDailyTable {
|
|
248
|
+
subgraph_id: string;
|
|
249
|
+
date: string;
|
|
250
|
+
query_count: Generated<number>;
|
|
251
|
+
}
|
|
252
|
+
interface ProjectsTable {
|
|
253
|
+
id: Generated<string>;
|
|
254
|
+
name: string;
|
|
255
|
+
slug: string;
|
|
256
|
+
account_id: string;
|
|
257
|
+
settings: Generated<Record<string, unknown>>;
|
|
258
|
+
network: Generated<string>;
|
|
259
|
+
node_rpc: string | null;
|
|
260
|
+
created_at: Generated<Date>;
|
|
261
|
+
updated_at: Generated<Date>;
|
|
262
|
+
}
|
|
263
|
+
interface TeamMembersTable {
|
|
264
|
+
id: Generated<string>;
|
|
265
|
+
project_id: string;
|
|
266
|
+
account_id: string;
|
|
267
|
+
role: Generated<string>;
|
|
268
|
+
invited_by: string | null;
|
|
269
|
+
created_at: Generated<Date>;
|
|
270
|
+
}
|
|
271
|
+
interface TeamInvitationsTable {
|
|
272
|
+
id: Generated<string>;
|
|
273
|
+
project_id: string;
|
|
274
|
+
email: string;
|
|
275
|
+
role: Generated<string>;
|
|
276
|
+
token: string;
|
|
277
|
+
invited_by: string | null;
|
|
278
|
+
expires_at: Date;
|
|
279
|
+
accepted_at: Date | null;
|
|
280
|
+
created_at: Generated<Date>;
|
|
281
|
+
}
|
|
282
|
+
interface ChatSessionsTable {
|
|
283
|
+
id: Generated<string>;
|
|
284
|
+
account_id: string;
|
|
285
|
+
title: string | null;
|
|
286
|
+
summary: unknown | null;
|
|
287
|
+
created_at: Generated<Date>;
|
|
288
|
+
updated_at: Generated<Date>;
|
|
289
|
+
}
|
|
290
|
+
interface ChatMessagesTable {
|
|
291
|
+
id: Generated<string>;
|
|
292
|
+
chat_session_id: string;
|
|
293
|
+
role: string;
|
|
294
|
+
parts: unknown;
|
|
295
|
+
metadata: unknown | null;
|
|
296
|
+
created_at: Generated<Date>;
|
|
297
|
+
}
|
|
298
|
+
interface WorkflowDefinitionsTable {
|
|
299
|
+
id: Generated<string>;
|
|
300
|
+
name: string;
|
|
301
|
+
version: Generated<string>;
|
|
302
|
+
status: Generated<string>;
|
|
303
|
+
trigger_type: string;
|
|
304
|
+
trigger_config: unknown;
|
|
305
|
+
handler_path: string;
|
|
306
|
+
retries_config: unknown | null;
|
|
307
|
+
timeout_ms: number | null;
|
|
308
|
+
api_key_id: string;
|
|
309
|
+
project_id: string | null;
|
|
310
|
+
created_at: Generated<Date>;
|
|
311
|
+
updated_at: Generated<Date>;
|
|
312
|
+
}
|
|
313
|
+
interface WorkflowRunsTable {
|
|
314
|
+
id: Generated<string>;
|
|
315
|
+
definition_id: string;
|
|
316
|
+
status: Generated<string>;
|
|
317
|
+
trigger_type: string;
|
|
318
|
+
trigger_data: unknown | null;
|
|
319
|
+
dedup_key: string | null;
|
|
320
|
+
error: string | null;
|
|
321
|
+
started_at: Date | null;
|
|
322
|
+
completed_at: Date | null;
|
|
323
|
+
duration_ms: number | null;
|
|
324
|
+
total_ai_tokens: Generated<number>;
|
|
325
|
+
created_at: Generated<Date>;
|
|
326
|
+
}
|
|
327
|
+
interface WorkflowStepsTable {
|
|
328
|
+
id: Generated<string>;
|
|
329
|
+
run_id: string;
|
|
330
|
+
step_index: number;
|
|
331
|
+
step_id: string;
|
|
332
|
+
step_type: string;
|
|
333
|
+
status: Generated<string>;
|
|
334
|
+
input: unknown | null;
|
|
335
|
+
output: unknown | null;
|
|
336
|
+
error: string | null;
|
|
337
|
+
retry_count: Generated<number>;
|
|
338
|
+
ai_tokens_used: Generated<number>;
|
|
339
|
+
started_at: Date | null;
|
|
340
|
+
completed_at: Date | null;
|
|
341
|
+
duration_ms: number | null;
|
|
342
|
+
created_at: Generated<Date>;
|
|
343
|
+
}
|
|
344
|
+
interface WorkflowQueueTable {
|
|
345
|
+
id: Generated<string>;
|
|
346
|
+
run_id: string;
|
|
347
|
+
status: Generated<string>;
|
|
348
|
+
attempts: Generated<number>;
|
|
349
|
+
max_attempts: Generated<number>;
|
|
350
|
+
scheduled_for: Generated<Date>;
|
|
351
|
+
locked_at: Date | null;
|
|
352
|
+
locked_by: string | null;
|
|
353
|
+
error: string | null;
|
|
354
|
+
created_at: Generated<Date>;
|
|
355
|
+
completed_at: Date | null;
|
|
356
|
+
}
|
|
357
|
+
interface WorkflowSchedulesTable {
|
|
358
|
+
id: Generated<string>;
|
|
359
|
+
definition_id: string;
|
|
360
|
+
cron_expr: string;
|
|
361
|
+
timezone: Generated<string>;
|
|
362
|
+
next_run_at: Date;
|
|
363
|
+
last_run_at: Date | null;
|
|
364
|
+
enabled: Generated<boolean>;
|
|
365
|
+
created_at: Generated<Date>;
|
|
366
|
+
}
|
|
367
|
+
interface WorkflowCursorsTable {
|
|
368
|
+
name: string;
|
|
369
|
+
block_height: Generated<number>;
|
|
370
|
+
updated_at: Generated<Date>;
|
|
371
|
+
}
|
|
235
372
|
interface Database {
|
|
236
373
|
blocks: BlocksTable;
|
|
237
374
|
transactions: TransactionsTable;
|
|
@@ -255,6 +392,18 @@ interface Database {
|
|
|
255
392
|
subgraph_processing_stats: SubgraphProcessingStatsTable;
|
|
256
393
|
subgraph_table_snapshots: SubgraphTableSnapshotsTable;
|
|
257
394
|
subgraph_gaps: SubgraphGapsTable;
|
|
395
|
+
subgraph_usage_daily: SubgraphUsageDailyTable;
|
|
396
|
+
projects: ProjectsTable;
|
|
397
|
+
team_members: TeamMembersTable;
|
|
398
|
+
team_invitations: TeamInvitationsTable;
|
|
399
|
+
chat_sessions: ChatSessionsTable;
|
|
400
|
+
chat_messages: ChatMessagesTable;
|
|
401
|
+
workflow_definitions: WorkflowDefinitionsTable;
|
|
402
|
+
workflow_runs: WorkflowRunsTable;
|
|
403
|
+
workflow_steps: WorkflowStepsTable;
|
|
404
|
+
workflow_queue: WorkflowQueueTable;
|
|
405
|
+
workflow_schedules: WorkflowSchedulesTable;
|
|
406
|
+
workflow_cursors: WorkflowCursorsTable;
|
|
258
407
|
}
|
|
259
408
|
type Block = Selectable<BlocksTable>;
|
|
260
409
|
type InsertBlock = Insertable<BlocksTable>;
|
|
@@ -302,4 +451,33 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
|
|
|
302
451
|
type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
|
|
303
452
|
type SubgraphGap = Selectable<SubgraphGapsTable>;
|
|
304
453
|
type InsertSubgraphGap = Insertable<SubgraphGapsTable>;
|
|
305
|
-
|
|
454
|
+
type SubgraphUsageDaily = Selectable<SubgraphUsageDailyTable>;
|
|
455
|
+
type InsertSubgraphUsageDaily = Insertable<SubgraphUsageDailyTable>;
|
|
456
|
+
type WorkflowDefinition = Selectable<WorkflowDefinitionsTable>;
|
|
457
|
+
type InsertWorkflowDefinition = Insertable<WorkflowDefinitionsTable>;
|
|
458
|
+
type UpdateWorkflowDefinition = Updateable<WorkflowDefinitionsTable>;
|
|
459
|
+
type WorkflowRun = Selectable<WorkflowRunsTable>;
|
|
460
|
+
type InsertWorkflowRun = Insertable<WorkflowRunsTable>;
|
|
461
|
+
type UpdateWorkflowRun = Updateable<WorkflowRunsTable>;
|
|
462
|
+
type WorkflowStep = Selectable<WorkflowStepsTable>;
|
|
463
|
+
type InsertWorkflowStep = Insertable<WorkflowStepsTable>;
|
|
464
|
+
type UpdateWorkflowStep = Updateable<WorkflowStepsTable>;
|
|
465
|
+
type WorkflowQueueItem = Selectable<WorkflowQueueTable>;
|
|
466
|
+
type InsertWorkflowQueueItem = Insertable<WorkflowQueueTable>;
|
|
467
|
+
type WorkflowSchedule = Selectable<WorkflowSchedulesTable>;
|
|
468
|
+
type InsertWorkflowSchedule = Insertable<WorkflowSchedulesTable>;
|
|
469
|
+
type UpdateWorkflowSchedule = Updateable<WorkflowSchedulesTable>;
|
|
470
|
+
type WorkflowCursor = Selectable<WorkflowCursorsTable>;
|
|
471
|
+
type Project = Selectable<ProjectsTable>;
|
|
472
|
+
type InsertProject = Insertable<ProjectsTable>;
|
|
473
|
+
type UpdateProject = Updateable<ProjectsTable>;
|
|
474
|
+
type TeamMember = Selectable<TeamMembersTable>;
|
|
475
|
+
type InsertTeamMember = Insertable<TeamMembersTable>;
|
|
476
|
+
type TeamInvitation = Selectable<TeamInvitationsTable>;
|
|
477
|
+
type InsertTeamInvitation = Insertable<TeamInvitationsTable>;
|
|
478
|
+
type ChatSession = Selectable<ChatSessionsTable>;
|
|
479
|
+
type InsertChatSession = Insertable<ChatSessionsTable>;
|
|
480
|
+
type UpdateChatSession = Updateable<ChatSessionsTable>;
|
|
481
|
+
type ChatMessage = Selectable<ChatMessagesTable>;
|
|
482
|
+
type InsertChatMessage = Insertable<ChatMessagesTable>;
|
|
483
|
+
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 };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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,14 @@ 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
|
+
handler_code: string | null;
|
|
108
|
+
project_id: string | null;
|
|
109
|
+
is_public: Generated<boolean>;
|
|
110
|
+
tags: Generated<string[]>;
|
|
111
|
+
description: string | null;
|
|
112
|
+
forked_from_id: string | null;
|
|
105
113
|
created_at: Generated<Date>;
|
|
106
114
|
updated_at: Generated<Date>;
|
|
107
115
|
}
|
|
@@ -132,6 +140,10 @@ interface AccountsTable {
|
|
|
132
140
|
id: Generated<string>;
|
|
133
141
|
email: string;
|
|
134
142
|
plan: Generated<string>;
|
|
143
|
+
display_name: string | null;
|
|
144
|
+
bio: string | null;
|
|
145
|
+
avatar_url: string | null;
|
|
146
|
+
slug: string | null;
|
|
135
147
|
created_at: Generated<Date>;
|
|
136
148
|
}
|
|
137
149
|
interface SessionsTable {
|
|
@@ -232,6 +244,131 @@ interface SubgraphHealthSnapshotsTable {
|
|
|
232
244
|
last_processed_block: number | null;
|
|
233
245
|
captured_at: Generated<Date>;
|
|
234
246
|
}
|
|
247
|
+
interface SubgraphUsageDailyTable {
|
|
248
|
+
subgraph_id: string;
|
|
249
|
+
date: string;
|
|
250
|
+
query_count: Generated<number>;
|
|
251
|
+
}
|
|
252
|
+
interface ProjectsTable {
|
|
253
|
+
id: Generated<string>;
|
|
254
|
+
name: string;
|
|
255
|
+
slug: string;
|
|
256
|
+
account_id: string;
|
|
257
|
+
settings: Generated<Record<string, unknown>>;
|
|
258
|
+
network: Generated<string>;
|
|
259
|
+
node_rpc: string | null;
|
|
260
|
+
created_at: Generated<Date>;
|
|
261
|
+
updated_at: Generated<Date>;
|
|
262
|
+
}
|
|
263
|
+
interface TeamMembersTable {
|
|
264
|
+
id: Generated<string>;
|
|
265
|
+
project_id: string;
|
|
266
|
+
account_id: string;
|
|
267
|
+
role: Generated<string>;
|
|
268
|
+
invited_by: string | null;
|
|
269
|
+
created_at: Generated<Date>;
|
|
270
|
+
}
|
|
271
|
+
interface TeamInvitationsTable {
|
|
272
|
+
id: Generated<string>;
|
|
273
|
+
project_id: string;
|
|
274
|
+
email: string;
|
|
275
|
+
role: Generated<string>;
|
|
276
|
+
token: string;
|
|
277
|
+
invited_by: string | null;
|
|
278
|
+
expires_at: Date;
|
|
279
|
+
accepted_at: Date | null;
|
|
280
|
+
created_at: Generated<Date>;
|
|
281
|
+
}
|
|
282
|
+
interface ChatSessionsTable {
|
|
283
|
+
id: Generated<string>;
|
|
284
|
+
account_id: string;
|
|
285
|
+
title: string | null;
|
|
286
|
+
summary: unknown | null;
|
|
287
|
+
created_at: Generated<Date>;
|
|
288
|
+
updated_at: Generated<Date>;
|
|
289
|
+
}
|
|
290
|
+
interface ChatMessagesTable {
|
|
291
|
+
id: Generated<string>;
|
|
292
|
+
chat_session_id: string;
|
|
293
|
+
role: string;
|
|
294
|
+
parts: unknown;
|
|
295
|
+
metadata: unknown | null;
|
|
296
|
+
created_at: Generated<Date>;
|
|
297
|
+
}
|
|
298
|
+
interface WorkflowDefinitionsTable {
|
|
299
|
+
id: Generated<string>;
|
|
300
|
+
name: string;
|
|
301
|
+
version: Generated<string>;
|
|
302
|
+
status: Generated<string>;
|
|
303
|
+
trigger_type: string;
|
|
304
|
+
trigger_config: unknown;
|
|
305
|
+
handler_path: string;
|
|
306
|
+
retries_config: unknown | null;
|
|
307
|
+
timeout_ms: number | null;
|
|
308
|
+
api_key_id: string;
|
|
309
|
+
project_id: string | null;
|
|
310
|
+
created_at: Generated<Date>;
|
|
311
|
+
updated_at: Generated<Date>;
|
|
312
|
+
}
|
|
313
|
+
interface WorkflowRunsTable {
|
|
314
|
+
id: Generated<string>;
|
|
315
|
+
definition_id: string;
|
|
316
|
+
status: Generated<string>;
|
|
317
|
+
trigger_type: string;
|
|
318
|
+
trigger_data: unknown | null;
|
|
319
|
+
dedup_key: string | null;
|
|
320
|
+
error: string | null;
|
|
321
|
+
started_at: Date | null;
|
|
322
|
+
completed_at: Date | null;
|
|
323
|
+
duration_ms: number | null;
|
|
324
|
+
total_ai_tokens: Generated<number>;
|
|
325
|
+
created_at: Generated<Date>;
|
|
326
|
+
}
|
|
327
|
+
interface WorkflowStepsTable {
|
|
328
|
+
id: Generated<string>;
|
|
329
|
+
run_id: string;
|
|
330
|
+
step_index: number;
|
|
331
|
+
step_id: string;
|
|
332
|
+
step_type: string;
|
|
333
|
+
status: Generated<string>;
|
|
334
|
+
input: unknown | null;
|
|
335
|
+
output: unknown | null;
|
|
336
|
+
error: string | null;
|
|
337
|
+
retry_count: Generated<number>;
|
|
338
|
+
ai_tokens_used: Generated<number>;
|
|
339
|
+
started_at: Date | null;
|
|
340
|
+
completed_at: Date | null;
|
|
341
|
+
duration_ms: number | null;
|
|
342
|
+
created_at: Generated<Date>;
|
|
343
|
+
}
|
|
344
|
+
interface WorkflowQueueTable {
|
|
345
|
+
id: Generated<string>;
|
|
346
|
+
run_id: string;
|
|
347
|
+
status: Generated<string>;
|
|
348
|
+
attempts: Generated<number>;
|
|
349
|
+
max_attempts: Generated<number>;
|
|
350
|
+
scheduled_for: Generated<Date>;
|
|
351
|
+
locked_at: Date | null;
|
|
352
|
+
locked_by: string | null;
|
|
353
|
+
error: string | null;
|
|
354
|
+
created_at: Generated<Date>;
|
|
355
|
+
completed_at: Date | null;
|
|
356
|
+
}
|
|
357
|
+
interface WorkflowSchedulesTable {
|
|
358
|
+
id: Generated<string>;
|
|
359
|
+
definition_id: string;
|
|
360
|
+
cron_expr: string;
|
|
361
|
+
timezone: Generated<string>;
|
|
362
|
+
next_run_at: Date;
|
|
363
|
+
last_run_at: Date | null;
|
|
364
|
+
enabled: Generated<boolean>;
|
|
365
|
+
created_at: Generated<Date>;
|
|
366
|
+
}
|
|
367
|
+
interface WorkflowCursorsTable {
|
|
368
|
+
name: string;
|
|
369
|
+
block_height: Generated<number>;
|
|
370
|
+
updated_at: Generated<Date>;
|
|
371
|
+
}
|
|
235
372
|
interface Database {
|
|
236
373
|
blocks: BlocksTable;
|
|
237
374
|
transactions: TransactionsTable;
|
|
@@ -255,6 +392,18 @@ interface Database {
|
|
|
255
392
|
subgraph_processing_stats: SubgraphProcessingStatsTable;
|
|
256
393
|
subgraph_table_snapshots: SubgraphTableSnapshotsTable;
|
|
257
394
|
subgraph_gaps: SubgraphGapsTable;
|
|
395
|
+
subgraph_usage_daily: SubgraphUsageDailyTable;
|
|
396
|
+
projects: ProjectsTable;
|
|
397
|
+
team_members: TeamMembersTable;
|
|
398
|
+
team_invitations: TeamInvitationsTable;
|
|
399
|
+
chat_sessions: ChatSessionsTable;
|
|
400
|
+
chat_messages: ChatMessagesTable;
|
|
401
|
+
workflow_definitions: WorkflowDefinitionsTable;
|
|
402
|
+
workflow_runs: WorkflowRunsTable;
|
|
403
|
+
workflow_steps: WorkflowStepsTable;
|
|
404
|
+
workflow_queue: WorkflowQueueTable;
|
|
405
|
+
workflow_schedules: WorkflowSchedulesTable;
|
|
406
|
+
workflow_cursors: WorkflowCursorsTable;
|
|
258
407
|
}
|
|
259
408
|
type Block = Selectable<BlocksTable>;
|
|
260
409
|
type InsertBlock = Insertable<BlocksTable>;
|
|
@@ -302,6 +451,35 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
|
|
|
302
451
|
type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
|
|
303
452
|
type SubgraphGap = Selectable<SubgraphGapsTable>;
|
|
304
453
|
type InsertSubgraphGap = Insertable<SubgraphGapsTable>;
|
|
454
|
+
type SubgraphUsageDaily = Selectable<SubgraphUsageDailyTable>;
|
|
455
|
+
type InsertSubgraphUsageDaily = Insertable<SubgraphUsageDailyTable>;
|
|
456
|
+
type WorkflowDefinition = Selectable<WorkflowDefinitionsTable>;
|
|
457
|
+
type InsertWorkflowDefinition = Insertable<WorkflowDefinitionsTable>;
|
|
458
|
+
type UpdateWorkflowDefinition = Updateable<WorkflowDefinitionsTable>;
|
|
459
|
+
type WorkflowRun = Selectable<WorkflowRunsTable>;
|
|
460
|
+
type InsertWorkflowRun = Insertable<WorkflowRunsTable>;
|
|
461
|
+
type UpdateWorkflowRun = Updateable<WorkflowRunsTable>;
|
|
462
|
+
type WorkflowStep = Selectable<WorkflowStepsTable>;
|
|
463
|
+
type InsertWorkflowStep = Insertable<WorkflowStepsTable>;
|
|
464
|
+
type UpdateWorkflowStep = Updateable<WorkflowStepsTable>;
|
|
465
|
+
type WorkflowQueueItem = Selectable<WorkflowQueueTable>;
|
|
466
|
+
type InsertWorkflowQueueItem = Insertable<WorkflowQueueTable>;
|
|
467
|
+
type WorkflowSchedule = Selectable<WorkflowSchedulesTable>;
|
|
468
|
+
type InsertWorkflowSchedule = Insertable<WorkflowSchedulesTable>;
|
|
469
|
+
type UpdateWorkflowSchedule = Updateable<WorkflowSchedulesTable>;
|
|
470
|
+
type WorkflowCursor = Selectable<WorkflowCursorsTable>;
|
|
471
|
+
type Project = Selectable<ProjectsTable>;
|
|
472
|
+
type InsertProject = Insertable<ProjectsTable>;
|
|
473
|
+
type UpdateProject = Updateable<ProjectsTable>;
|
|
474
|
+
type TeamMember = Selectable<TeamMembersTable>;
|
|
475
|
+
type InsertTeamMember = Insertable<TeamMembersTable>;
|
|
476
|
+
type TeamInvitation = Selectable<TeamInvitationsTable>;
|
|
477
|
+
type InsertTeamInvitation = Insertable<TeamInvitationsTable>;
|
|
478
|
+
type ChatSession = Selectable<ChatSessionsTable>;
|
|
479
|
+
type InsertChatSession = Insertable<ChatSessionsTable>;
|
|
480
|
+
type UpdateChatSession = Updateable<ChatSessionsTable>;
|
|
481
|
+
type ChatMessage = Selectable<ChatMessagesTable>;
|
|
482
|
+
type InsertChatMessage = Insertable<ChatMessagesTable>;
|
|
305
483
|
interface EnvSchemaOutput {
|
|
306
484
|
DATABASE_URL?: string;
|
|
307
485
|
NETWORK?: "mainnet" | "testnet";
|
|
@@ -573,6 +751,68 @@ declare const ContractDeployFilterSchema: z2.ZodType<ContractDeployFilter>;
|
|
|
573
751
|
declare const PrintEventFilterSchema: z2.ZodType<PrintEventFilter>;
|
|
574
752
|
declare const StreamFilterSchema: z2.ZodType<StreamFilter>;
|
|
575
753
|
import { z as z3 } from "zod/v4";
|
|
754
|
+
interface PublishSubgraphRequest {
|
|
755
|
+
tags?: string[];
|
|
756
|
+
description?: string;
|
|
757
|
+
}
|
|
758
|
+
interface UpdateProfileRequest {
|
|
759
|
+
display_name?: string;
|
|
760
|
+
bio?: string;
|
|
761
|
+
slug?: string;
|
|
762
|
+
}
|
|
763
|
+
interface ForkSubgraphRequest {
|
|
764
|
+
sourceSubgraphName: string;
|
|
765
|
+
newName?: string;
|
|
766
|
+
}
|
|
767
|
+
declare const PublishSubgraphRequestSchema: z3.ZodType<PublishSubgraphRequest>;
|
|
768
|
+
declare const UpdateProfileRequestSchema: z3.ZodType<UpdateProfileRequest>;
|
|
769
|
+
declare const ForkSubgraphRequestSchema: z3.ZodType<ForkSubgraphRequest>;
|
|
770
|
+
interface MarketplaceCreator {
|
|
771
|
+
displayName: string | null;
|
|
772
|
+
slug: string | null;
|
|
773
|
+
}
|
|
774
|
+
interface MarketplaceSubgraphSummary {
|
|
775
|
+
name: string;
|
|
776
|
+
description: string | null;
|
|
777
|
+
tags: string[];
|
|
778
|
+
creator: MarketplaceCreator;
|
|
779
|
+
status: string;
|
|
780
|
+
version: string;
|
|
781
|
+
tables: string[];
|
|
782
|
+
totalQueries7d: number;
|
|
783
|
+
progress: number;
|
|
784
|
+
createdAt: string;
|
|
785
|
+
}
|
|
786
|
+
interface MarketplaceSubgraphDetail extends MarketplaceSubgraphSummary {
|
|
787
|
+
tableSchemas: Record<string, {
|
|
788
|
+
columns: Record<string, {
|
|
789
|
+
type: string
|
|
790
|
+
nullable?: boolean
|
|
791
|
+
}>
|
|
792
|
+
rowCount: number
|
|
793
|
+
endpoint: string
|
|
794
|
+
}>;
|
|
795
|
+
sources: Record<string, unknown>;
|
|
796
|
+
startBlock: number;
|
|
797
|
+
lastProcessedBlock: number;
|
|
798
|
+
forkedFrom: string | null;
|
|
799
|
+
usage: {
|
|
800
|
+
totalQueries7d: number
|
|
801
|
+
totalQueries30d: number
|
|
802
|
+
daily: Array<{
|
|
803
|
+
date: string
|
|
804
|
+
count: number
|
|
805
|
+
}>
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
interface CreatorProfile {
|
|
809
|
+
displayName: string | null;
|
|
810
|
+
bio: string | null;
|
|
811
|
+
avatarUrl: string | null;
|
|
812
|
+
slug: string | null;
|
|
813
|
+
subgraphs: MarketplaceSubgraphSummary[];
|
|
814
|
+
}
|
|
815
|
+
import { z as z4 } from "zod/v4";
|
|
576
816
|
interface DeploySubgraphRequest {
|
|
577
817
|
name: string;
|
|
578
818
|
version?: string;
|
|
@@ -580,13 +820,21 @@ interface DeploySubgraphRequest {
|
|
|
580
820
|
sources: Record<string, Record<string, unknown>>;
|
|
581
821
|
schema: Record<string, unknown>;
|
|
582
822
|
handlerCode: string;
|
|
823
|
+
/** @deprecated Use server auto-reindex on breaking changes instead */
|
|
583
824
|
reindex?: boolean;
|
|
584
825
|
}
|
|
585
|
-
declare const DeploySubgraphRequestSchema:
|
|
826
|
+
declare const DeploySubgraphRequestSchema: z4.ZodType<DeploySubgraphRequest>;
|
|
586
827
|
interface DeploySubgraphResponse {
|
|
587
828
|
action: "created" | "unchanged" | "updated" | "reindexed";
|
|
588
829
|
subgraphId: string;
|
|
830
|
+
version: string;
|
|
589
831
|
message: string;
|
|
832
|
+
diff?: {
|
|
833
|
+
addedTables: string[]
|
|
834
|
+
removedTables: string[]
|
|
835
|
+
addedColumns: Record<string, string[]>
|
|
836
|
+
breakingChanges: string[]
|
|
837
|
+
};
|
|
590
838
|
}
|
|
591
839
|
interface SubgraphSummary {
|
|
592
840
|
name: string;
|
|
@@ -677,7 +925,7 @@ interface SubgraphQueryParams {
|
|
|
677
925
|
fields?: string;
|
|
678
926
|
filters?: Record<string, string>;
|
|
679
927
|
}
|
|
680
|
-
import { z as
|
|
928
|
+
import { z as z5 } from "zod/v4";
|
|
681
929
|
interface StreamOptions {
|
|
682
930
|
decodeClarityValues: boolean;
|
|
683
931
|
includeRawTx: boolean;
|
|
@@ -752,12 +1000,12 @@ interface StreamResponse {
|
|
|
752
1000
|
createdAt: string;
|
|
753
1001
|
updatedAt: string;
|
|
754
1002
|
}
|
|
755
|
-
declare const StreamOptionsSchema:
|
|
756
|
-
declare const CreateStreamSchema:
|
|
757
|
-
declare const UpdateStreamSchema:
|
|
758
|
-
declare const DeliveryPayloadSchema:
|
|
759
|
-
declare const StreamMetricsSchema:
|
|
760
|
-
declare const StreamResponseSchema:
|
|
1003
|
+
declare const StreamOptionsSchema: z5.ZodType<StreamOptions>;
|
|
1004
|
+
declare const CreateStreamSchema: z5.ZodType<CreateStream>;
|
|
1005
|
+
declare const UpdateStreamSchema: z5.ZodType<UpdateStream>;
|
|
1006
|
+
declare const DeliveryPayloadSchema: z5.ZodType<DeliveryPayload>;
|
|
1007
|
+
declare const StreamMetricsSchema: z5.ZodType<StreamMetricsResponse>;
|
|
1008
|
+
declare const StreamResponseSchema: z5.ZodType<StreamResponse>;
|
|
761
1009
|
interface CreateStreamResponse {
|
|
762
1010
|
stream: StreamResponse;
|
|
763
1011
|
signingSecret: string;
|
|
@@ -802,4 +1050,4 @@ declare function createSignatureHeader(payload: string, secret: string, timestam
|
|
|
802
1050
|
* Returns true if valid, false otherwise
|
|
803
1051
|
*/
|
|
804
1052
|
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 };
|
|
1053
|
+
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 };
|