@secondlayer/shared 0.10.1 → 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.
- package/dist/src/db/index.d.ts +181 -2
- package/dist/src/db/queries/accounts.d.ts +158 -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 +151 -1
- package/dist/src/db/queries/marketplace.d.ts +463 -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 +151 -1
- package/dist/src/db/queries/projects.d.ts +423 -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 +151 -1
- package/dist/src/db/queries/subgraphs.d.ts +158 -6
- package/dist/src/db/queries/subgraphs.js +16 -13
- package/dist/src/db/queries/subgraphs.js.map +3 -3
- package/dist/src/db/queries/usage.d.ts +151 -1
- package/dist/src/db/queries/workflows.d.ts +439 -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 +181 -2
- package/dist/src/index.d.ts +251 -10
- package/dist/src/index.js +91 -72
- package/dist/src/index.js.map +4 -3
- package/dist/src/node/hiro-pg-client.js +5 -3
- package/dist/src/node/hiro-pg-client.js.map +3 -3
- package/dist/src/node/local-client.d.ts +155 -1
- package/dist/src/node/local-client.js +19 -9
- package/dist/src/node/local-client.js.map +3 -3
- package/dist/src/schemas/index.d.ts +71 -9
- package/dist/src/schemas/index.js +93 -74
- package/dist/src/schemas/index.js.map +4 -3
- 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/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 +3 -0
- package/migrations/0021_tx_function_args_result.ts +27 -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/package.json +22 -2
package/dist/src/db/schema.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ interface TransactionsTable {
|
|
|
17
17
|
status: string;
|
|
18
18
|
contract_id: string | null;
|
|
19
19
|
function_name: string | null;
|
|
20
|
+
function_args: Generated<unknown | null>;
|
|
21
|
+
raw_result: Generated<string | null>;
|
|
20
22
|
raw_tx: string;
|
|
21
23
|
created_at: Generated<Date>;
|
|
22
24
|
}
|
|
@@ -38,6 +40,7 @@ interface StreamsTable {
|
|
|
38
40
|
endpoint_url: string;
|
|
39
41
|
signing_secret: string | null;
|
|
40
42
|
api_key_id: string;
|
|
43
|
+
project_id: string | null;
|
|
41
44
|
created_at: Generated<Date>;
|
|
42
45
|
updated_at: Generated<Date>;
|
|
43
46
|
}
|
|
@@ -99,7 +102,13 @@ interface SubgraphsTable {
|
|
|
99
102
|
last_error_at: Date | null;
|
|
100
103
|
total_processed: Generated<number>;
|
|
101
104
|
total_errors: Generated<number>;
|
|
102
|
-
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;
|
|
103
112
|
created_at: Generated<Date>;
|
|
104
113
|
updated_at: Generated<Date>;
|
|
105
114
|
}
|
|
@@ -130,6 +139,10 @@ interface AccountsTable {
|
|
|
130
139
|
id: Generated<string>;
|
|
131
140
|
email: string;
|
|
132
141
|
plan: Generated<string>;
|
|
142
|
+
display_name: string | null;
|
|
143
|
+
bio: string | null;
|
|
144
|
+
avatar_url: string | null;
|
|
145
|
+
slug: string | null;
|
|
133
146
|
created_at: Generated<Date>;
|
|
134
147
|
}
|
|
135
148
|
interface SessionsTable {
|
|
@@ -230,6 +243,131 @@ interface SubgraphHealthSnapshotsTable {
|
|
|
230
243
|
last_processed_block: number | null;
|
|
231
244
|
captured_at: Generated<Date>;
|
|
232
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
|
+
}
|
|
233
371
|
interface Database {
|
|
234
372
|
blocks: BlocksTable;
|
|
235
373
|
transactions: TransactionsTable;
|
|
@@ -253,6 +391,18 @@ interface Database {
|
|
|
253
391
|
subgraph_processing_stats: SubgraphProcessingStatsTable;
|
|
254
392
|
subgraph_table_snapshots: SubgraphTableSnapshotsTable;
|
|
255
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;
|
|
256
406
|
}
|
|
257
407
|
type Block = Selectable<BlocksTable>;
|
|
258
408
|
type InsertBlock = Insertable<BlocksTable>;
|
|
@@ -300,4 +450,33 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
|
|
|
300
450
|
type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
|
|
301
451
|
type SubgraphGap = Selectable<SubgraphGapsTable>;
|
|
302
452
|
type InsertSubgraphGap = Insertable<SubgraphGapsTable>;
|
|
303
|
-
|
|
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 };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ interface TransactionsTable {
|
|
|
17
17
|
status: string;
|
|
18
18
|
contract_id: string | null;
|
|
19
19
|
function_name: string | null;
|
|
20
|
+
function_args: Generated<unknown | null>;
|
|
21
|
+
raw_result: Generated<string | null>;
|
|
20
22
|
raw_tx: string;
|
|
21
23
|
created_at: Generated<Date>;
|
|
22
24
|
}
|
|
@@ -38,6 +40,7 @@ interface StreamsTable {
|
|
|
38
40
|
endpoint_url: string;
|
|
39
41
|
signing_secret: string | null;
|
|
40
42
|
api_key_id: string;
|
|
43
|
+
project_id: string | null;
|
|
41
44
|
created_at: Generated<Date>;
|
|
42
45
|
updated_at: Generated<Date>;
|
|
43
46
|
}
|
|
@@ -99,7 +102,13 @@ interface SubgraphsTable {
|
|
|
99
102
|
last_error_at: Date | null;
|
|
100
103
|
total_processed: Generated<number>;
|
|
101
104
|
total_errors: Generated<number>;
|
|
102
|
-
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;
|
|
103
112
|
created_at: Generated<Date>;
|
|
104
113
|
updated_at: Generated<Date>;
|
|
105
114
|
}
|
|
@@ -130,6 +139,10 @@ interface AccountsTable {
|
|
|
130
139
|
id: Generated<string>;
|
|
131
140
|
email: string;
|
|
132
141
|
plan: Generated<string>;
|
|
142
|
+
display_name: string | null;
|
|
143
|
+
bio: string | null;
|
|
144
|
+
avatar_url: string | null;
|
|
145
|
+
slug: string | null;
|
|
133
146
|
created_at: Generated<Date>;
|
|
134
147
|
}
|
|
135
148
|
interface SessionsTable {
|
|
@@ -230,6 +243,131 @@ interface SubgraphHealthSnapshotsTable {
|
|
|
230
243
|
last_processed_block: number | null;
|
|
231
244
|
captured_at: Generated<Date>;
|
|
232
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
|
+
}
|
|
233
371
|
interface Database {
|
|
234
372
|
blocks: BlocksTable;
|
|
235
373
|
transactions: TransactionsTable;
|
|
@@ -253,6 +391,18 @@ interface Database {
|
|
|
253
391
|
subgraph_processing_stats: SubgraphProcessingStatsTable;
|
|
254
392
|
subgraph_table_snapshots: SubgraphTableSnapshotsTable;
|
|
255
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;
|
|
256
406
|
}
|
|
257
407
|
type Block = Selectable<BlocksTable>;
|
|
258
408
|
type InsertBlock = Insertable<BlocksTable>;
|
|
@@ -300,6 +450,35 @@ type SubgraphHealthSnapshot = Selectable<SubgraphHealthSnapshotsTable>;
|
|
|
300
450
|
type InsertSubgraphHealthSnapshot = Insertable<SubgraphHealthSnapshotsTable>;
|
|
301
451
|
type SubgraphGap = Selectable<SubgraphGapsTable>;
|
|
302
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>;
|
|
303
482
|
interface EnvSchemaOutput {
|
|
304
483
|
DATABASE_URL?: string;
|
|
305
484
|
NETWORK?: "mainnet" | "testnet";
|
|
@@ -571,6 +750,68 @@ declare const ContractDeployFilterSchema: z2.ZodType<ContractDeployFilter>;
|
|
|
571
750
|
declare const PrintEventFilterSchema: z2.ZodType<PrintEventFilter>;
|
|
572
751
|
declare const StreamFilterSchema: z2.ZodType<StreamFilter>;
|
|
573
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";
|
|
574
815
|
interface DeploySubgraphRequest {
|
|
575
816
|
name: string;
|
|
576
817
|
version?: string;
|
|
@@ -580,7 +821,7 @@ interface DeploySubgraphRequest {
|
|
|
580
821
|
handlerCode: string;
|
|
581
822
|
reindex?: boolean;
|
|
582
823
|
}
|
|
583
|
-
declare const DeploySubgraphRequestSchema:
|
|
824
|
+
declare const DeploySubgraphRequestSchema: z4.ZodType<DeploySubgraphRequest>;
|
|
584
825
|
interface DeploySubgraphResponse {
|
|
585
826
|
action: "created" | "unchanged" | "updated" | "reindexed";
|
|
586
827
|
subgraphId: string;
|
|
@@ -675,7 +916,7 @@ interface SubgraphQueryParams {
|
|
|
675
916
|
fields?: string;
|
|
676
917
|
filters?: Record<string, string>;
|
|
677
918
|
}
|
|
678
|
-
import { z as
|
|
919
|
+
import { z as z5 } from "zod/v4";
|
|
679
920
|
interface StreamOptions {
|
|
680
921
|
decodeClarityValues: boolean;
|
|
681
922
|
includeRawTx: boolean;
|
|
@@ -750,12 +991,12 @@ interface StreamResponse {
|
|
|
750
991
|
createdAt: string;
|
|
751
992
|
updatedAt: string;
|
|
752
993
|
}
|
|
753
|
-
declare const StreamOptionsSchema:
|
|
754
|
-
declare const CreateStreamSchema:
|
|
755
|
-
declare const UpdateStreamSchema:
|
|
756
|
-
declare const DeliveryPayloadSchema:
|
|
757
|
-
declare const StreamMetricsSchema:
|
|
758
|
-
declare const StreamResponseSchema:
|
|
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>;
|
|
759
1000
|
interface CreateStreamResponse {
|
|
760
1001
|
stream: StreamResponse;
|
|
761
1002
|
signingSecret: string;
|
|
@@ -800,4 +1041,4 @@ declare function createSignatureHeader(payload: string, secret: string, timestam
|
|
|
800
1041
|
* Returns true if valid, false otherwise
|
|
801
1042
|
*/
|
|
802
1043
|
declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
|
|
803
|
-
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 };
|