@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
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { Kysely } from "kysely";
|
|
2
|
+
import { Generated, Selectable } from "kysely";
|
|
3
|
+
interface BlocksTable {
|
|
4
|
+
height: number;
|
|
5
|
+
hash: string;
|
|
6
|
+
parent_hash: string;
|
|
7
|
+
burn_block_height: number;
|
|
8
|
+
timestamp: number;
|
|
9
|
+
canonical: Generated<boolean>;
|
|
10
|
+
created_at: Generated<Date>;
|
|
11
|
+
}
|
|
12
|
+
interface TransactionsTable {
|
|
13
|
+
tx_id: string;
|
|
14
|
+
block_height: number;
|
|
15
|
+
tx_index: Generated<number>;
|
|
16
|
+
type: string;
|
|
17
|
+
sender: string;
|
|
18
|
+
status: string;
|
|
19
|
+
contract_id: string | null;
|
|
20
|
+
function_name: string | null;
|
|
21
|
+
function_args: Generated<unknown | null>;
|
|
22
|
+
raw_result: Generated<string | null>;
|
|
23
|
+
raw_tx: string;
|
|
24
|
+
created_at: Generated<Date>;
|
|
25
|
+
}
|
|
26
|
+
interface EventsTable {
|
|
27
|
+
id: Generated<string>;
|
|
28
|
+
tx_id: string;
|
|
29
|
+
block_height: number;
|
|
30
|
+
event_index: number;
|
|
31
|
+
type: string;
|
|
32
|
+
data: unknown;
|
|
33
|
+
created_at: Generated<Date>;
|
|
34
|
+
}
|
|
35
|
+
interface StreamsTable {
|
|
36
|
+
id: Generated<string>;
|
|
37
|
+
name: string;
|
|
38
|
+
status: Generated<string>;
|
|
39
|
+
filters: unknown;
|
|
40
|
+
options: Generated<unknown>;
|
|
41
|
+
endpoint_url: string;
|
|
42
|
+
signing_secret: string | null;
|
|
43
|
+
api_key_id: string;
|
|
44
|
+
project_id: string | null;
|
|
45
|
+
created_at: Generated<Date>;
|
|
46
|
+
updated_at: Generated<Date>;
|
|
47
|
+
}
|
|
48
|
+
interface StreamMetricsTable {
|
|
49
|
+
stream_id: string;
|
|
50
|
+
last_triggered_at: Date | null;
|
|
51
|
+
last_triggered_block: number | null;
|
|
52
|
+
total_deliveries: Generated<number>;
|
|
53
|
+
failed_deliveries: Generated<number>;
|
|
54
|
+
error_message: string | null;
|
|
55
|
+
}
|
|
56
|
+
interface JobsTable {
|
|
57
|
+
id: Generated<string>;
|
|
58
|
+
stream_id: string;
|
|
59
|
+
block_height: number;
|
|
60
|
+
status: Generated<string>;
|
|
61
|
+
attempts: Generated<number>;
|
|
62
|
+
locked_at: Date | null;
|
|
63
|
+
locked_by: string | null;
|
|
64
|
+
error: string | null;
|
|
65
|
+
backfill: Generated<boolean>;
|
|
66
|
+
created_at: Generated<Date>;
|
|
67
|
+
completed_at: Date | null;
|
|
68
|
+
}
|
|
69
|
+
interface IndexProgressTable {
|
|
70
|
+
network: string;
|
|
71
|
+
last_indexed_block: Generated<number>;
|
|
72
|
+
last_contiguous_block: Generated<number>;
|
|
73
|
+
highest_seen_block: Generated<number>;
|
|
74
|
+
updated_at: Generated<Date>;
|
|
75
|
+
}
|
|
76
|
+
interface DeliveriesTable {
|
|
77
|
+
id: Generated<string>;
|
|
78
|
+
stream_id: string;
|
|
79
|
+
job_id: string | null;
|
|
80
|
+
block_height: number;
|
|
81
|
+
status: string;
|
|
82
|
+
status_code: number | null;
|
|
83
|
+
response_time_ms: number | null;
|
|
84
|
+
attempts: Generated<number>;
|
|
85
|
+
error: string | null;
|
|
86
|
+
payload: unknown;
|
|
87
|
+
created_at: Generated<Date>;
|
|
88
|
+
}
|
|
89
|
+
interface SubgraphsTable {
|
|
90
|
+
id: Generated<string>;
|
|
91
|
+
name: string;
|
|
92
|
+
version: Generated<string>;
|
|
93
|
+
status: Generated<string>;
|
|
94
|
+
definition: Record<string, unknown>;
|
|
95
|
+
schema_hash: string;
|
|
96
|
+
handler_path: string;
|
|
97
|
+
schema_name: string | null;
|
|
98
|
+
start_block: Generated<number>;
|
|
99
|
+
last_processed_block: Generated<number>;
|
|
100
|
+
reindex_from_block: number | null;
|
|
101
|
+
reindex_to_block: number | null;
|
|
102
|
+
last_error: string | null;
|
|
103
|
+
last_error_at: Date | null;
|
|
104
|
+
total_processed: Generated<number>;
|
|
105
|
+
total_errors: Generated<number>;
|
|
106
|
+
api_key_id: string | null;
|
|
107
|
+
account_id: string;
|
|
108
|
+
handler_code: string | null;
|
|
109
|
+
project_id: string | null;
|
|
110
|
+
is_public: Generated<boolean>;
|
|
111
|
+
tags: Generated<string[]>;
|
|
112
|
+
description: string | null;
|
|
113
|
+
forked_from_id: string | null;
|
|
114
|
+
created_at: Generated<Date>;
|
|
115
|
+
updated_at: Generated<Date>;
|
|
116
|
+
}
|
|
117
|
+
interface SubgraphGapsTable {
|
|
118
|
+
id: Generated<string>;
|
|
119
|
+
subgraph_id: string;
|
|
120
|
+
subgraph_name: string;
|
|
121
|
+
gap_start: number;
|
|
122
|
+
gap_end: number;
|
|
123
|
+
reason: string;
|
|
124
|
+
detected_at: Generated<Date>;
|
|
125
|
+
resolved_at: Date | null;
|
|
126
|
+
}
|
|
127
|
+
interface ApiKeysTable {
|
|
128
|
+
id: Generated<string>;
|
|
129
|
+
key_hash: string;
|
|
130
|
+
key_prefix: string;
|
|
131
|
+
name: string | null;
|
|
132
|
+
status: Generated<string>;
|
|
133
|
+
rate_limit: Generated<number>;
|
|
134
|
+
ip_address: string;
|
|
135
|
+
account_id: string;
|
|
136
|
+
last_used_at: Date | null;
|
|
137
|
+
revoked_at: Date | null;
|
|
138
|
+
created_at: Generated<Date>;
|
|
139
|
+
}
|
|
140
|
+
interface AccountsTable {
|
|
141
|
+
id: Generated<string>;
|
|
142
|
+
email: string;
|
|
143
|
+
plan: Generated<string>;
|
|
144
|
+
display_name: string | null;
|
|
145
|
+
bio: string | null;
|
|
146
|
+
avatar_url: string | null;
|
|
147
|
+
slug: string | null;
|
|
148
|
+
created_at: Generated<Date>;
|
|
149
|
+
}
|
|
150
|
+
interface SessionsTable {
|
|
151
|
+
id: Generated<string>;
|
|
152
|
+
token_hash: string;
|
|
153
|
+
token_prefix: string;
|
|
154
|
+
account_id: string;
|
|
155
|
+
ip_address: string;
|
|
156
|
+
expires_at: Generated<Date>;
|
|
157
|
+
revoked_at: Date | null;
|
|
158
|
+
last_used_at: Date | null;
|
|
159
|
+
created_at: Generated<Date>;
|
|
160
|
+
}
|
|
161
|
+
interface MagicLinksTable {
|
|
162
|
+
id: Generated<string>;
|
|
163
|
+
email: string;
|
|
164
|
+
token: string;
|
|
165
|
+
code: string | null;
|
|
166
|
+
expires_at: Date;
|
|
167
|
+
used_at: Date | null;
|
|
168
|
+
failed_attempts: Generated<number>;
|
|
169
|
+
created_at: Generated<Date>;
|
|
170
|
+
}
|
|
171
|
+
interface UsageDailyTable {
|
|
172
|
+
account_id: string;
|
|
173
|
+
date: string;
|
|
174
|
+
api_requests: Generated<number>;
|
|
175
|
+
deliveries: Generated<number>;
|
|
176
|
+
}
|
|
177
|
+
interface UsageSnapshotsTable {
|
|
178
|
+
id: Generated<string>;
|
|
179
|
+
account_id: string;
|
|
180
|
+
measured_at: Generated<Date>;
|
|
181
|
+
storage_bytes: Generated<number>;
|
|
182
|
+
}
|
|
183
|
+
interface WaitlistTable {
|
|
184
|
+
id: Generated<string>;
|
|
185
|
+
email: string;
|
|
186
|
+
source: Generated<string>;
|
|
187
|
+
status: Generated<string>;
|
|
188
|
+
created_at: Generated<Date>;
|
|
189
|
+
}
|
|
190
|
+
interface AccountInsightsTable {
|
|
191
|
+
id: Generated<string>;
|
|
192
|
+
account_id: string;
|
|
193
|
+
category: string;
|
|
194
|
+
insight_type: string;
|
|
195
|
+
resource_id: string | null;
|
|
196
|
+
severity: string;
|
|
197
|
+
title: string;
|
|
198
|
+
body: string;
|
|
199
|
+
data: unknown;
|
|
200
|
+
dismissed_at: Date | null;
|
|
201
|
+
expires_at: Date | null;
|
|
202
|
+
created_at: Generated<Date>;
|
|
203
|
+
}
|
|
204
|
+
interface AccountAgentRunsTable {
|
|
205
|
+
id: Generated<string>;
|
|
206
|
+
account_id: string;
|
|
207
|
+
started_at: Generated<Date>;
|
|
208
|
+
completed_at: Date | null;
|
|
209
|
+
status: Generated<string>;
|
|
210
|
+
input_tokens: Generated<number>;
|
|
211
|
+
output_tokens: Generated<number>;
|
|
212
|
+
cost_usd: Generated<number>;
|
|
213
|
+
insights_created: Generated<number>;
|
|
214
|
+
error: string | null;
|
|
215
|
+
}
|
|
216
|
+
interface SubgraphProcessingStatsTable {
|
|
217
|
+
id: Generated<string>;
|
|
218
|
+
subgraph_name: string;
|
|
219
|
+
api_key_id: string | null;
|
|
220
|
+
bucket_start: Date | null;
|
|
221
|
+
bucket_end: Date | null;
|
|
222
|
+
blocks_processed: number | null;
|
|
223
|
+
total_time_ms: number | null;
|
|
224
|
+
handler_time_ms: number | null;
|
|
225
|
+
flush_time_ms: number | null;
|
|
226
|
+
max_block_time_ms: number | null;
|
|
227
|
+
max_handler_time_ms: number | null;
|
|
228
|
+
avg_ops_per_block: number | null;
|
|
229
|
+
is_catchup: Generated<boolean>;
|
|
230
|
+
created_at: Generated<Date>;
|
|
231
|
+
}
|
|
232
|
+
interface SubgraphTableSnapshotsTable {
|
|
233
|
+
id: Generated<string>;
|
|
234
|
+
subgraph_name: string;
|
|
235
|
+
api_key_id: string | null;
|
|
236
|
+
table_name: string;
|
|
237
|
+
row_count: number | null;
|
|
238
|
+
created_at: Generated<Date>;
|
|
239
|
+
}
|
|
240
|
+
interface SubgraphHealthSnapshotsTable {
|
|
241
|
+
id: Generated<string>;
|
|
242
|
+
subgraph_id: string;
|
|
243
|
+
total_processed: number;
|
|
244
|
+
total_errors: number;
|
|
245
|
+
last_processed_block: number | null;
|
|
246
|
+
captured_at: Generated<Date>;
|
|
247
|
+
}
|
|
248
|
+
interface SubgraphUsageDailyTable {
|
|
249
|
+
subgraph_id: string;
|
|
250
|
+
date: string;
|
|
251
|
+
query_count: Generated<number>;
|
|
252
|
+
}
|
|
253
|
+
interface ProjectsTable {
|
|
254
|
+
id: Generated<string>;
|
|
255
|
+
name: string;
|
|
256
|
+
slug: string;
|
|
257
|
+
account_id: string;
|
|
258
|
+
settings: Generated<Record<string, unknown>>;
|
|
259
|
+
network: Generated<string>;
|
|
260
|
+
node_rpc: string | null;
|
|
261
|
+
created_at: Generated<Date>;
|
|
262
|
+
updated_at: Generated<Date>;
|
|
263
|
+
}
|
|
264
|
+
interface TeamMembersTable {
|
|
265
|
+
id: Generated<string>;
|
|
266
|
+
project_id: string;
|
|
267
|
+
account_id: string;
|
|
268
|
+
role: Generated<string>;
|
|
269
|
+
invited_by: string | null;
|
|
270
|
+
created_at: Generated<Date>;
|
|
271
|
+
}
|
|
272
|
+
interface TeamInvitationsTable {
|
|
273
|
+
id: Generated<string>;
|
|
274
|
+
project_id: string;
|
|
275
|
+
email: string;
|
|
276
|
+
role: Generated<string>;
|
|
277
|
+
token: string;
|
|
278
|
+
invited_by: string | null;
|
|
279
|
+
expires_at: Date;
|
|
280
|
+
accepted_at: Date | null;
|
|
281
|
+
created_at: Generated<Date>;
|
|
282
|
+
}
|
|
283
|
+
interface ChatSessionsTable {
|
|
284
|
+
id: Generated<string>;
|
|
285
|
+
account_id: string;
|
|
286
|
+
title: string | null;
|
|
287
|
+
summary: unknown | null;
|
|
288
|
+
created_at: Generated<Date>;
|
|
289
|
+
updated_at: Generated<Date>;
|
|
290
|
+
}
|
|
291
|
+
interface ChatMessagesTable {
|
|
292
|
+
id: Generated<string>;
|
|
293
|
+
chat_session_id: string;
|
|
294
|
+
role: string;
|
|
295
|
+
parts: unknown;
|
|
296
|
+
metadata: unknown | null;
|
|
297
|
+
created_at: Generated<Date>;
|
|
298
|
+
}
|
|
299
|
+
interface WorkflowDefinitionsTable {
|
|
300
|
+
id: Generated<string>;
|
|
301
|
+
name: string;
|
|
302
|
+
version: Generated<string>;
|
|
303
|
+
status: Generated<string>;
|
|
304
|
+
trigger_type: string;
|
|
305
|
+
trigger_config: unknown;
|
|
306
|
+
handler_path: string;
|
|
307
|
+
retries_config: unknown | null;
|
|
308
|
+
timeout_ms: number | null;
|
|
309
|
+
api_key_id: string;
|
|
310
|
+
project_id: string | null;
|
|
311
|
+
created_at: Generated<Date>;
|
|
312
|
+
updated_at: Generated<Date>;
|
|
313
|
+
}
|
|
314
|
+
interface WorkflowRunsTable {
|
|
315
|
+
id: Generated<string>;
|
|
316
|
+
definition_id: string;
|
|
317
|
+
status: Generated<string>;
|
|
318
|
+
trigger_type: string;
|
|
319
|
+
trigger_data: unknown | null;
|
|
320
|
+
dedup_key: string | null;
|
|
321
|
+
error: string | null;
|
|
322
|
+
started_at: Date | null;
|
|
323
|
+
completed_at: Date | null;
|
|
324
|
+
duration_ms: number | null;
|
|
325
|
+
total_ai_tokens: Generated<number>;
|
|
326
|
+
created_at: Generated<Date>;
|
|
327
|
+
}
|
|
328
|
+
interface WorkflowStepsTable {
|
|
329
|
+
id: Generated<string>;
|
|
330
|
+
run_id: string;
|
|
331
|
+
step_index: number;
|
|
332
|
+
step_id: string;
|
|
333
|
+
step_type: string;
|
|
334
|
+
status: Generated<string>;
|
|
335
|
+
input: unknown | null;
|
|
336
|
+
output: unknown | null;
|
|
337
|
+
error: string | null;
|
|
338
|
+
retry_count: Generated<number>;
|
|
339
|
+
ai_tokens_used: Generated<number>;
|
|
340
|
+
started_at: Date | null;
|
|
341
|
+
completed_at: Date | null;
|
|
342
|
+
duration_ms: number | null;
|
|
343
|
+
created_at: Generated<Date>;
|
|
344
|
+
}
|
|
345
|
+
interface WorkflowQueueTable {
|
|
346
|
+
id: Generated<string>;
|
|
347
|
+
run_id: string;
|
|
348
|
+
status: Generated<string>;
|
|
349
|
+
attempts: Generated<number>;
|
|
350
|
+
max_attempts: Generated<number>;
|
|
351
|
+
scheduled_for: Generated<Date>;
|
|
352
|
+
locked_at: Date | null;
|
|
353
|
+
locked_by: string | null;
|
|
354
|
+
error: string | null;
|
|
355
|
+
created_at: Generated<Date>;
|
|
356
|
+
completed_at: Date | null;
|
|
357
|
+
}
|
|
358
|
+
interface WorkflowSchedulesTable {
|
|
359
|
+
id: Generated<string>;
|
|
360
|
+
definition_id: string;
|
|
361
|
+
cron_expr: string;
|
|
362
|
+
timezone: Generated<string>;
|
|
363
|
+
next_run_at: Date;
|
|
364
|
+
last_run_at: Date | null;
|
|
365
|
+
enabled: Generated<boolean>;
|
|
366
|
+
created_at: Generated<Date>;
|
|
367
|
+
}
|
|
368
|
+
interface WorkflowCursorsTable {
|
|
369
|
+
name: string;
|
|
370
|
+
block_height: Generated<number>;
|
|
371
|
+
updated_at: Generated<Date>;
|
|
372
|
+
}
|
|
373
|
+
interface Database {
|
|
374
|
+
blocks: BlocksTable;
|
|
375
|
+
transactions: TransactionsTable;
|
|
376
|
+
events: EventsTable;
|
|
377
|
+
streams: StreamsTable;
|
|
378
|
+
stream_metrics: StreamMetricsTable;
|
|
379
|
+
jobs: JobsTable;
|
|
380
|
+
index_progress: IndexProgressTable;
|
|
381
|
+
deliveries: DeliveriesTable;
|
|
382
|
+
subgraphs: SubgraphsTable;
|
|
383
|
+
api_keys: ApiKeysTable;
|
|
384
|
+
accounts: AccountsTable;
|
|
385
|
+
sessions: SessionsTable;
|
|
386
|
+
magic_links: MagicLinksTable;
|
|
387
|
+
usage_daily: UsageDailyTable;
|
|
388
|
+
usage_snapshots: UsageSnapshotsTable;
|
|
389
|
+
waitlist: WaitlistTable;
|
|
390
|
+
account_insights: AccountInsightsTable;
|
|
391
|
+
account_agent_runs: AccountAgentRunsTable;
|
|
392
|
+
subgraph_health_snapshots: SubgraphHealthSnapshotsTable;
|
|
393
|
+
subgraph_processing_stats: SubgraphProcessingStatsTable;
|
|
394
|
+
subgraph_table_snapshots: SubgraphTableSnapshotsTable;
|
|
395
|
+
subgraph_gaps: SubgraphGapsTable;
|
|
396
|
+
subgraph_usage_daily: SubgraphUsageDailyTable;
|
|
397
|
+
projects: ProjectsTable;
|
|
398
|
+
team_members: TeamMembersTable;
|
|
399
|
+
team_invitations: TeamInvitationsTable;
|
|
400
|
+
chat_sessions: ChatSessionsTable;
|
|
401
|
+
chat_messages: ChatMessagesTable;
|
|
402
|
+
workflow_definitions: WorkflowDefinitionsTable;
|
|
403
|
+
workflow_runs: WorkflowRunsTable;
|
|
404
|
+
workflow_steps: WorkflowStepsTable;
|
|
405
|
+
workflow_queue: WorkflowQueueTable;
|
|
406
|
+
workflow_schedules: WorkflowSchedulesTable;
|
|
407
|
+
workflow_cursors: WorkflowCursorsTable;
|
|
408
|
+
}
|
|
409
|
+
type Subgraph = Selectable<SubgraphsTable>;
|
|
410
|
+
/**
|
|
411
|
+
* List public subgraphs with creator info and usage stats.
|
|
412
|
+
*/
|
|
413
|
+
declare function listPublicSubgraphs(db: Kysely<Database>, opts?: {
|
|
414
|
+
limit?: number
|
|
415
|
+
offset?: number
|
|
416
|
+
tags?: string[]
|
|
417
|
+
search?: string
|
|
418
|
+
sort?: "recent" | "popular" | "name"
|
|
419
|
+
}): Promise<{
|
|
420
|
+
data: any[]
|
|
421
|
+
meta: {
|
|
422
|
+
total: number
|
|
423
|
+
limit: number
|
|
424
|
+
offset: number
|
|
425
|
+
}
|
|
426
|
+
}>;
|
|
427
|
+
/**
|
|
428
|
+
* Get a single public subgraph by name with creator info.
|
|
429
|
+
*/
|
|
430
|
+
declare function getPublicSubgraph(db: Kysely<Database>, name: string): Promise<any | undefined>;
|
|
431
|
+
/**
|
|
432
|
+
* Get a creator profile by slug with their public subgraphs.
|
|
433
|
+
*/
|
|
434
|
+
declare function getCreatorProfile(db: Kysely<Database>, slug: string): Promise<{
|
|
435
|
+
account: any
|
|
436
|
+
subgraphs: any[]
|
|
437
|
+
} | null>;
|
|
438
|
+
/**
|
|
439
|
+
* Publish a subgraph (set is_public = true).
|
|
440
|
+
*/
|
|
441
|
+
declare function publishSubgraph(db: Kysely<Database>, subgraphId: string, opts?: {
|
|
442
|
+
tags?: string[]
|
|
443
|
+
description?: string
|
|
444
|
+
}): Promise<Subgraph>;
|
|
445
|
+
/**
|
|
446
|
+
* Unpublish a subgraph (set is_public = false).
|
|
447
|
+
*/
|
|
448
|
+
declare function unpublishSubgraph(db: Kysely<Database>, subgraphId: string): Promise<Subgraph>;
|
|
449
|
+
/**
|
|
450
|
+
* Increment per-subgraph query count for today. Fire-and-forget safe.
|
|
451
|
+
*/
|
|
452
|
+
declare function incrementSubgraphQueryCount(db: Kysely<Database>, subgraphId: string): Promise<void>;
|
|
453
|
+
/**
|
|
454
|
+
* Get daily usage history for a subgraph.
|
|
455
|
+
*/
|
|
456
|
+
declare function getSubgraphUsageHistory(db: Kysely<Database>, subgraphId: string, days: number): Promise<Array<{
|
|
457
|
+
date: string
|
|
458
|
+
query_count: number
|
|
459
|
+
}>>;
|
|
460
|
+
/**
|
|
461
|
+
* Get total query count for a subgraph over last N days.
|
|
462
|
+
*/
|
|
463
|
+
declare function getSubgraphQueryTotal(db: Kysely<Database>, subgraphId: string, days: number): Promise<number>;
|
|
464
|
+
export { unpublishSubgraph, publishSubgraph, listPublicSubgraphs, incrementSubgraphQueryCount, getSubgraphUsageHistory, getSubgraphQueryTotal, getPublicSubgraph, getCreatorProfile };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __returnValue = (v) => v;
|
|
4
|
+
function __exportSetter(name, newValue) {
|
|
5
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
6
|
+
}
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
set: __exportSetter.bind(all, name)
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/db/queries/marketplace.ts
|
|
18
|
+
import { sql } from "kysely";
|
|
19
|
+
async function listPublicSubgraphs(db, opts = {}) {
|
|
20
|
+
const limit = Math.min(Math.max(1, opts.limit ?? 50), 100);
|
|
21
|
+
const offset = Math.max(0, opts.offset ?? 0);
|
|
22
|
+
let query = db.selectFrom("subgraphs").innerJoin("api_keys", "api_keys.id", "subgraphs.api_key_id").innerJoin("accounts", "accounts.id", "api_keys.account_id").select([
|
|
23
|
+
"subgraphs.id",
|
|
24
|
+
"subgraphs.name",
|
|
25
|
+
"subgraphs.description",
|
|
26
|
+
"subgraphs.tags",
|
|
27
|
+
"subgraphs.status",
|
|
28
|
+
"subgraphs.version",
|
|
29
|
+
"subgraphs.definition",
|
|
30
|
+
"subgraphs.last_processed_block",
|
|
31
|
+
"subgraphs.start_block",
|
|
32
|
+
"subgraphs.total_processed",
|
|
33
|
+
"subgraphs.created_at",
|
|
34
|
+
"subgraphs.forked_from_id",
|
|
35
|
+
"accounts.display_name",
|
|
36
|
+
"accounts.slug",
|
|
37
|
+
sql`(SELECT COALESCE(SUM(query_count), 0) FROM subgraph_usage_daily WHERE subgraph_id = subgraphs.id AND date >= CURRENT_DATE - 7)::int`.as("queries_7d"),
|
|
38
|
+
sql`(SELECT COUNT(*) FROM subgraphs s2 WHERE s2.forked_from_id = subgraphs.id)::int`.as("fork_count")
|
|
39
|
+
]).where("subgraphs.is_public", "=", true);
|
|
40
|
+
if (opts.tags && opts.tags.length > 0) {
|
|
41
|
+
query = query.where(sql`subgraphs.tags @> ${sql.val(opts.tags)}::text[]`);
|
|
42
|
+
}
|
|
43
|
+
if (opts.search) {
|
|
44
|
+
const term = `%${opts.search}%`;
|
|
45
|
+
query = query.where((eb) => eb.or([
|
|
46
|
+
eb("subgraphs.name", "ilike", term),
|
|
47
|
+
eb("subgraphs.description", "ilike", term)
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
if (opts.sort === "popular") {
|
|
51
|
+
query = query.orderBy(sql`queries_7d`, "desc");
|
|
52
|
+
} else if (opts.sort === "name") {
|
|
53
|
+
query = query.orderBy("subgraphs.name", "asc");
|
|
54
|
+
} else {
|
|
55
|
+
query = query.orderBy("subgraphs.created_at", "desc");
|
|
56
|
+
}
|
|
57
|
+
let countQuery = db.selectFrom("subgraphs").select(sql`count(*)::int`.as("count")).where("is_public", "=", true);
|
|
58
|
+
if (opts.tags && opts.tags.length > 0) {
|
|
59
|
+
countQuery = countQuery.where(sql`tags @> ${sql.val(opts.tags)}::text[]`);
|
|
60
|
+
}
|
|
61
|
+
if (opts.search) {
|
|
62
|
+
const term = `%${opts.search}%`;
|
|
63
|
+
countQuery = countQuery.where((eb) => eb.or([
|
|
64
|
+
eb("name", "ilike", term),
|
|
65
|
+
eb("description", "ilike", term)
|
|
66
|
+
]));
|
|
67
|
+
}
|
|
68
|
+
const [rows, countRow] = await Promise.all([
|
|
69
|
+
query.limit(limit).offset(offset).execute(),
|
|
70
|
+
countQuery.executeTakeFirst()
|
|
71
|
+
]);
|
|
72
|
+
return {
|
|
73
|
+
data: rows,
|
|
74
|
+
meta: { total: countRow?.count ?? 0, limit, offset }
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function getPublicSubgraph(db, name) {
|
|
78
|
+
return db.selectFrom("subgraphs").innerJoin("api_keys", "api_keys.id", "subgraphs.api_key_id").innerJoin("accounts", "accounts.id", "api_keys.account_id").selectAll("subgraphs").select(["accounts.display_name", "accounts.slug"]).where("subgraphs.name", "=", name).where("subgraphs.is_public", "=", true).executeTakeFirst();
|
|
79
|
+
}
|
|
80
|
+
async function getCreatorProfile(db, slug) {
|
|
81
|
+
const account = await db.selectFrom("accounts").select(["id", "display_name", "bio", "avatar_url", "slug"]).where("slug", "=", slug).executeTakeFirst();
|
|
82
|
+
if (!account)
|
|
83
|
+
return null;
|
|
84
|
+
const subgraphs = await db.selectFrom("subgraphs").innerJoin("api_keys", "api_keys.id", "subgraphs.api_key_id").select([
|
|
85
|
+
"subgraphs.id",
|
|
86
|
+
"subgraphs.name",
|
|
87
|
+
"subgraphs.description",
|
|
88
|
+
"subgraphs.tags",
|
|
89
|
+
"subgraphs.status",
|
|
90
|
+
"subgraphs.version",
|
|
91
|
+
"subgraphs.definition",
|
|
92
|
+
"subgraphs.last_processed_block",
|
|
93
|
+
"subgraphs.start_block",
|
|
94
|
+
"subgraphs.total_processed",
|
|
95
|
+
"subgraphs.created_at",
|
|
96
|
+
sql`(SELECT COALESCE(SUM(query_count), 0) FROM subgraph_usage_daily WHERE subgraph_id = subgraphs.id AND date >= CURRENT_DATE - 7)::int`.as("queries_7d")
|
|
97
|
+
]).where("api_keys.account_id", "=", account.id).where("subgraphs.is_public", "=", true).orderBy("subgraphs.created_at", "desc").execute();
|
|
98
|
+
return { account, subgraphs };
|
|
99
|
+
}
|
|
100
|
+
async function publishSubgraph(db, subgraphId, opts) {
|
|
101
|
+
const set = {
|
|
102
|
+
is_public: true,
|
|
103
|
+
updated_at: new Date
|
|
104
|
+
};
|
|
105
|
+
if (opts?.tags)
|
|
106
|
+
set.tags = sql`${sql.val(opts.tags)}::text[]`;
|
|
107
|
+
if (opts?.description !== undefined)
|
|
108
|
+
set.description = opts.description;
|
|
109
|
+
return db.updateTable("subgraphs").set(set).where("id", "=", subgraphId).returningAll().executeTakeFirstOrThrow();
|
|
110
|
+
}
|
|
111
|
+
async function unpublishSubgraph(db, subgraphId) {
|
|
112
|
+
return db.updateTable("subgraphs").set({ is_public: false, updated_at: new Date }).where("id", "=", subgraphId).returningAll().executeTakeFirstOrThrow();
|
|
113
|
+
}
|
|
114
|
+
async function incrementSubgraphQueryCount(db, subgraphId) {
|
|
115
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
116
|
+
await sql`
|
|
117
|
+
INSERT INTO subgraph_usage_daily (subgraph_id, date, query_count)
|
|
118
|
+
VALUES (${subgraphId}, ${today}, 1)
|
|
119
|
+
ON CONFLICT (subgraph_id, date)
|
|
120
|
+
DO UPDATE SET query_count = subgraph_usage_daily.query_count + 1
|
|
121
|
+
`.execute(db);
|
|
122
|
+
}
|
|
123
|
+
async function getSubgraphUsageHistory(db, subgraphId, days) {
|
|
124
|
+
return db.selectFrom("subgraph_usage_daily").select(["date", "query_count"]).where("subgraph_id", "=", subgraphId).where("date", ">=", sql`CURRENT_DATE - ${days}::int`).orderBy("date", "asc").execute();
|
|
125
|
+
}
|
|
126
|
+
async function getSubgraphQueryTotal(db, subgraphId, days) {
|
|
127
|
+
const row = await db.selectFrom("subgraph_usage_daily").select(sql`COALESCE(SUM(query_count), 0)::int`.as("total")).where("subgraph_id", "=", subgraphId).where("date", ">=", sql`CURRENT_DATE - ${days}::int`).executeTakeFirst();
|
|
128
|
+
return row?.total ?? 0;
|
|
129
|
+
}
|
|
130
|
+
export {
|
|
131
|
+
unpublishSubgraph,
|
|
132
|
+
publishSubgraph,
|
|
133
|
+
listPublicSubgraphs,
|
|
134
|
+
incrementSubgraphQueryCount,
|
|
135
|
+
getSubgraphUsageHistory,
|
|
136
|
+
getSubgraphQueryTotal,
|
|
137
|
+
getPublicSubgraph,
|
|
138
|
+
getCreatorProfile
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
//# debugId=3D863C761F66BE2664756E2164756E21
|
|
142
|
+
//# sourceMappingURL=marketplace.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/db/queries/marketplace.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { type Kysely, sql } from \"kysely\";\nimport type { Database, Subgraph } from \"../types.ts\";\n\n/**\n * List public subgraphs with creator info and usage stats.\n */\nexport async function listPublicSubgraphs(\n\tdb: Kysely<Database>,\n\topts: {\n\t\tlimit?: number;\n\t\toffset?: number;\n\t\ttags?: string[];\n\t\tsearch?: string;\n\t\tsort?: \"recent\" | \"popular\" | \"name\";\n\t} = {},\n): Promise<{ data: any[]; meta: { total: number; limit: number; offset: number } }> {\n\tconst limit = Math.min(Math.max(1, opts.limit ?? 50), 100);\n\tconst offset = Math.max(0, opts.offset ?? 0);\n\n\tlet query = db\n\t\t.selectFrom(\"subgraphs\")\n\t\t.innerJoin(\"api_keys\", \"api_keys.id\", \"subgraphs.api_key_id\")\n\t\t.innerJoin(\"accounts\", \"accounts.id\", \"api_keys.account_id\")\n\t\t.select([\n\t\t\t\"subgraphs.id\",\n\t\t\t\"subgraphs.name\",\n\t\t\t\"subgraphs.description\",\n\t\t\t\"subgraphs.tags\",\n\t\t\t\"subgraphs.status\",\n\t\t\t\"subgraphs.version\",\n\t\t\t\"subgraphs.definition\",\n\t\t\t\"subgraphs.last_processed_block\",\n\t\t\t\"subgraphs.start_block\",\n\t\t\t\"subgraphs.total_processed\",\n\t\t\t\"subgraphs.created_at\",\n\t\t\t\"subgraphs.forked_from_id\",\n\t\t\t\"accounts.display_name\",\n\t\t\t\"accounts.slug\",\n\t\t\tsql<number>`(SELECT COALESCE(SUM(query_count), 0) FROM subgraph_usage_daily WHERE subgraph_id = subgraphs.id AND date >= CURRENT_DATE - 7)::int`.as(\"queries_7d\"),\n\t\t\tsql<number>`(SELECT COUNT(*) FROM subgraphs s2 WHERE s2.forked_from_id = subgraphs.id)::int`.as(\"fork_count\"),\n\t\t])\n\t\t.where(\"subgraphs.is_public\", \"=\", true);\n\n\t// Filter by tags (AND — all must match)\n\tif (opts.tags && opts.tags.length > 0) {\n\t\tquery = query.where(\n\t\t\tsql<boolean>`subgraphs.tags @> ${sql.val(opts.tags)}::text[]`,\n\t\t);\n\t}\n\n\t// Search by name or description\n\tif (opts.search) {\n\t\tconst term = `%${opts.search}%`;\n\t\tquery = query.where((eb) =>\n\t\t\teb.or([\n\t\t\t\teb(\"subgraphs.name\", \"ilike\", term),\n\t\t\t\teb(\"subgraphs.description\", \"ilike\", term),\n\t\t\t]),\n\t\t);\n\t}\n\n\t// Sort\n\tif (opts.sort === \"popular\") {\n\t\tquery = query.orderBy(sql`queries_7d`, \"desc\");\n\t} else if (opts.sort === \"name\") {\n\t\tquery = query.orderBy(\"subgraphs.name\", \"asc\");\n\t} else {\n\t\t// Default: recent\n\t\tquery = query.orderBy(\"subgraphs.created_at\", \"desc\");\n\t}\n\n\t// Count\n\tlet countQuery = db\n\t\t.selectFrom(\"subgraphs\")\n\t\t.select(sql<number>`count(*)::int`.as(\"count\"))\n\t\t.where(\"is_public\", \"=\", true);\n\n\tif (opts.tags && opts.tags.length > 0) {\n\t\tcountQuery = countQuery.where(\n\t\t\tsql<boolean>`tags @> ${sql.val(opts.tags)}::text[]`,\n\t\t);\n\t}\n\tif (opts.search) {\n\t\tconst term = `%${opts.search}%`;\n\t\tcountQuery = countQuery.where((eb) =>\n\t\t\teb.or([\n\t\t\t\teb(\"name\", \"ilike\", term),\n\t\t\t\teb(\"description\", \"ilike\", term),\n\t\t\t]),\n\t\t);\n\t}\n\n\tconst [rows, countRow] = await Promise.all([\n\t\tquery.limit(limit).offset(offset).execute(),\n\t\tcountQuery.executeTakeFirst(),\n\t]);\n\n\treturn {\n\t\tdata: rows,\n\t\tmeta: { total: countRow?.count ?? 0, limit, offset },\n\t};\n}\n\n/**\n * Get a single public subgraph by name with creator info.\n */\nexport async function getPublicSubgraph(db: Kysely<Database>, name: string): Promise<any | undefined> {\n\treturn db\n\t\t.selectFrom(\"subgraphs\")\n\t\t.innerJoin(\"api_keys\", \"api_keys.id\", \"subgraphs.api_key_id\")\n\t\t.innerJoin(\"accounts\", \"accounts.id\", \"api_keys.account_id\")\n\t\t.selectAll(\"subgraphs\")\n\t\t.select([\"accounts.display_name\", \"accounts.slug\"])\n\t\t.where(\"subgraphs.name\", \"=\", name)\n\t\t.where(\"subgraphs.is_public\", \"=\", true)\n\t\t.executeTakeFirst();\n}\n\n/**\n * Get a creator profile by slug with their public subgraphs.\n */\nexport async function getCreatorProfile(db: Kysely<Database>, slug: string): Promise<{ account: any; subgraphs: any[] } | null> {\n\tconst account = await db\n\t\t.selectFrom(\"accounts\")\n\t\t.select([\"id\", \"display_name\", \"bio\", \"avatar_url\", \"slug\"])\n\t\t.where(\"slug\", \"=\", slug)\n\t\t.executeTakeFirst();\n\n\tif (!account) return null;\n\n\tconst subgraphs = await db\n\t\t.selectFrom(\"subgraphs\")\n\t\t.innerJoin(\"api_keys\", \"api_keys.id\", \"subgraphs.api_key_id\")\n\t\t.select([\n\t\t\t\"subgraphs.id\",\n\t\t\t\"subgraphs.name\",\n\t\t\t\"subgraphs.description\",\n\t\t\t\"subgraphs.tags\",\n\t\t\t\"subgraphs.status\",\n\t\t\t\"subgraphs.version\",\n\t\t\t\"subgraphs.definition\",\n\t\t\t\"subgraphs.last_processed_block\",\n\t\t\t\"subgraphs.start_block\",\n\t\t\t\"subgraphs.total_processed\",\n\t\t\t\"subgraphs.created_at\",\n\t\t\tsql<number>`(SELECT COALESCE(SUM(query_count), 0) FROM subgraph_usage_daily WHERE subgraph_id = subgraphs.id AND date >= CURRENT_DATE - 7)::int`.as(\"queries_7d\"),\n\t\t])\n\t\t.where(\"api_keys.account_id\", \"=\", account.id)\n\t\t.where(\"subgraphs.is_public\", \"=\", true)\n\t\t.orderBy(\"subgraphs.created_at\", \"desc\")\n\t\t.execute();\n\n\treturn { account, subgraphs };\n}\n\n/**\n * Publish a subgraph (set is_public = true).\n */\nexport async function publishSubgraph(\n\tdb: Kysely<Database>,\n\tsubgraphId: string,\n\topts?: { tags?: string[]; description?: string },\n): Promise<Subgraph> {\n\tconst set: Record<string, unknown> = {\n\t\tis_public: true,\n\t\tupdated_at: new Date(),\n\t};\n\tif (opts?.tags) set.tags = sql`${sql.val(opts.tags)}::text[]`;\n\tif (opts?.description !== undefined) set.description = opts.description;\n\n\treturn db\n\t\t.updateTable(\"subgraphs\")\n\t\t.set(set)\n\t\t.where(\"id\", \"=\", subgraphId)\n\t\t.returningAll()\n\t\t.executeTakeFirstOrThrow();\n}\n\n/**\n * Unpublish a subgraph (set is_public = false).\n */\nexport async function unpublishSubgraph(\n\tdb: Kysely<Database>,\n\tsubgraphId: string,\n): Promise<Subgraph> {\n\treturn db\n\t\t.updateTable(\"subgraphs\")\n\t\t.set({ is_public: false, updated_at: new Date() })\n\t\t.where(\"id\", \"=\", subgraphId)\n\t\t.returningAll()\n\t\t.executeTakeFirstOrThrow();\n}\n\n/**\n * Increment per-subgraph query count for today. Fire-and-forget safe.\n */\nexport async function incrementSubgraphQueryCount(\n\tdb: Kysely<Database>,\n\tsubgraphId: string,\n): Promise<void> {\n\tconst today = new Date().toISOString().slice(0, 10);\n\tawait sql`\n\t\tINSERT INTO subgraph_usage_daily (subgraph_id, date, query_count)\n\t\tVALUES (${subgraphId}, ${today}, 1)\n\t\tON CONFLICT (subgraph_id, date)\n\t\tDO UPDATE SET query_count = subgraph_usage_daily.query_count + 1\n\t`.execute(db);\n}\n\n/**\n * Get daily usage history for a subgraph.\n */\nexport async function getSubgraphUsageHistory(\n\tdb: Kysely<Database>,\n\tsubgraphId: string,\n\tdays: number,\n): Promise<Array<{ date: string; query_count: number }>> {\n\treturn db\n\t\t.selectFrom(\"subgraph_usage_daily\")\n\t\t.select([\"date\", \"query_count\"])\n\t\t.where(\"subgraph_id\", \"=\", subgraphId)\n\t\t.where(\"date\", \">=\", sql<string>`CURRENT_DATE - ${days}::int`)\n\t\t.orderBy(\"date\", \"asc\")\n\t\t.execute();\n}\n\n/**\n * Get total query count for a subgraph over last N days.\n */\nexport async function getSubgraphQueryTotal(\n\tdb: Kysely<Database>,\n\tsubgraphId: string,\n\tdays: number,\n): Promise<number> {\n\tconst row = await db\n\t\t.selectFrom(\"subgraph_usage_daily\")\n\t\t.select(sql<number>`COALESCE(SUM(query_count), 0)::int`.as(\"total\"))\n\t\t.where(\"subgraph_id\", \"=\", subgraphId)\n\t\t.where(\"date\", \">=\", sql<string>`CURRENT_DATE - ${days}::int`)\n\t\t.executeTakeFirst();\n\treturn row?.total ?? 0;\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAMA,eAAsB,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