@secondlayer/shared 0.12.3 → 1.1.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/README.md +5 -7
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.js.map +2 -2
- package/dist/src/crypto/secrets.d.ts +5 -0
- package/dist/src/crypto/secrets.js +69 -0
- package/dist/src/crypto/secrets.js.map +10 -0
- package/dist/src/db/index.d.ts +37 -64
- package/dist/src/db/index.js +2 -2
- package/dist/src/db/index.js.map +2 -2
- package/dist/src/db/queries/accounts.d.ts +30 -51
- package/dist/src/db/queries/integrity.d.ts +30 -51
- package/dist/src/db/queries/marketplace.d.ts +30 -51
- package/dist/src/db/queries/projects.d.ts +30 -51
- package/dist/src/db/queries/subgraph-gaps.d.ts +30 -51
- package/dist/src/db/queries/subgraphs.d.ts +31 -51
- package/dist/src/db/queries/subgraphs.js +3 -1
- package/dist/src/db/queries/subgraphs.js.map +3 -3
- package/dist/src/db/queries/usage.d.ts +31 -56
- package/dist/src/db/queries/usage.js +1 -19
- package/dist/src/db/queries/usage.js.map +4 -4
- package/dist/src/db/queries/workflows.d.ts +35 -53
- package/dist/src/db/queries/workflows.js +130 -13
- package/dist/src/db/queries/workflows.js.map +5 -4
- package/dist/src/db/schema.d.ts +37 -64
- package/dist/src/errors.d.ts +19 -50
- package/dist/src/errors.js +28 -45
- package/dist/src/errors.js.map +3 -3
- package/dist/src/index.d.ts +59 -256
- package/dist/src/index.js +32 -234
- package/dist/src/index.js.map +7 -9
- package/dist/src/lib/plans.d.ts +0 -1
- package/dist/src/lib/plans.js +1 -2
- package/dist/src/lib/plans.js.map +3 -3
- package/dist/src/node/local-client.d.ts +30 -51
- package/dist/src/pricing.d.ts +28 -0
- package/dist/src/pricing.js +47 -0
- package/dist/src/pricing.js.map +10 -0
- package/dist/src/queue/listener.d.ts +1 -18
- package/dist/src/queue/listener.js +2 -12
- package/dist/src/queue/listener.js.map +3 -3
- package/dist/src/schemas/filters.d.ts +3 -3
- package/dist/src/schemas/filters.js +3 -3
- package/dist/src/schemas/filters.js.map +3 -3
- package/dist/src/schemas/index.d.ts +5 -100
- package/dist/src/schemas/index.js +4 -88
- package/dist/src/schemas/index.js.map +5 -6
- package/dist/src/schemas/subgraphs.d.ts +2 -0
- package/dist/src/schemas/subgraphs.js +2 -1
- package/dist/src/schemas/subgraphs.js.map +3 -3
- package/dist/src/schemas/workflows.d.ts +4 -0
- package/dist/src/schemas/workflows.js +5 -1
- package/dist/src/schemas/workflows.js.map +3 -3
- package/dist/src/types.d.ts +1 -53
- package/migrations/0030_workflow_source_code.ts +21 -0
- package/migrations/0031_subgraph_source_code.ts +18 -0
- package/migrations/0032_drop_streams_tables.ts +43 -0
- package/migrations/0033_workflow_steps_memo_key.ts +54 -0
- package/migrations/0034_workflow_signer_secrets.ts +42 -0
- package/migrations/0035_workflow_budgets.ts +53 -0
- package/migrations/0036_tx_confirmed_notify.ts +36 -0
- package/package.json +11 -15
- package/dist/src/db/queries/metrics.d.ts +0 -419
- package/dist/src/db/queries/metrics.js +0 -55
- package/dist/src/db/queries/metrics.js.map +0 -10
- package/dist/src/queue/index.d.ts +0 -50
- package/dist/src/queue/index.js +0 -184
- package/dist/src/queue/index.js.map +0 -12
- package/dist/src/queue/recovery.d.ts +0 -14
- package/dist/src/queue/recovery.js +0 -108
- package/dist/src/queue/recovery.js.map +0 -12
package/dist/src/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var db = null;
|
|
|
39
39
|
var rawClient = null;
|
|
40
40
|
function getDb(connectionString) {
|
|
41
41
|
if (!db) {
|
|
42
|
-
const url = connectionString || process.env.DATABASE_URL || "postgres://postgres:postgres@localhost:5432/
|
|
42
|
+
const url = connectionString || process.env.DATABASE_URL || "postgres://postgres:postgres@localhost:5432/secondlayer_dev";
|
|
43
43
|
const isLocal = url.includes("localhost") || url.includes("127.0.0.1") || url.includes("@postgres:");
|
|
44
44
|
const poolMax = Number.parseInt(process.env.DATABASE_POOL_MAX ?? "20", 10);
|
|
45
45
|
rawClient = postgres(url, {
|
|
@@ -71,18 +71,17 @@ async function closeDb() {
|
|
|
71
71
|
}
|
|
72
72
|
// src/errors.ts
|
|
73
73
|
var ErrorCodes = {
|
|
74
|
-
STREAM_NOT_FOUND: "STREAM_NOT_FOUND",
|
|
75
74
|
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
76
75
|
DATABASE_ERROR: "DATABASE_ERROR",
|
|
77
|
-
DELIVERY_ERROR: "DELIVERY_ERROR",
|
|
78
|
-
FILTER_EVALUATION_ERROR: "FILTER_EVALUATION_ERROR",
|
|
79
76
|
AUTHENTICATION_ERROR: "AUTHENTICATION_ERROR",
|
|
80
77
|
AUTHORIZATION_ERROR: "AUTHORIZATION_ERROR",
|
|
81
78
|
RATE_LIMIT_ERROR: "RATE_LIMIT_ERROR",
|
|
82
|
-
FORBIDDEN: "FORBIDDEN"
|
|
79
|
+
FORBIDDEN: "FORBIDDEN",
|
|
80
|
+
VERSION_CONFLICT: "VERSION_CONFLICT",
|
|
81
|
+
NOT_FOUND: "NOT_FOUND"
|
|
83
82
|
};
|
|
84
83
|
|
|
85
|
-
class
|
|
84
|
+
class SecondLayerError extends Error {
|
|
86
85
|
code;
|
|
87
86
|
cause;
|
|
88
87
|
constructor(code, message, cause) {
|
|
@@ -103,78 +102,63 @@ class StreamsError extends Error {
|
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
|
|
106
|
-
class
|
|
107
|
-
constructor(
|
|
108
|
-
super("
|
|
105
|
+
class NotFoundError extends SecondLayerError {
|
|
106
|
+
constructor(message) {
|
|
107
|
+
super("NOT_FOUND", message);
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
class ValidationError extends
|
|
111
|
+
class ValidationError extends SecondLayerError {
|
|
113
112
|
constructor(message, cause) {
|
|
114
113
|
super("VALIDATION_ERROR", message, cause);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
|
|
118
|
-
class DatabaseError extends
|
|
117
|
+
class DatabaseError extends SecondLayerError {
|
|
119
118
|
constructor(message, cause) {
|
|
120
119
|
super("DATABASE_ERROR", message, cause);
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
|
|
124
|
-
class
|
|
125
|
-
statusCode;
|
|
126
|
-
constructor(message, statusCode, cause) {
|
|
127
|
-
super("DELIVERY_ERROR", message, cause);
|
|
128
|
-
this.statusCode = statusCode;
|
|
129
|
-
}
|
|
130
|
-
toJSON() {
|
|
131
|
-
const base = super.toJSON();
|
|
132
|
-
return {
|
|
133
|
-
name: base.name,
|
|
134
|
-
code: base.code,
|
|
135
|
-
message: base.message,
|
|
136
|
-
stack: base.stack,
|
|
137
|
-
cause: base.cause,
|
|
138
|
-
statusCode: this.statusCode
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
class FilterEvaluationError extends StreamsError {
|
|
144
|
-
constructor(message, cause) {
|
|
145
|
-
super("FILTER_EVALUATION_ERROR", message, cause);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
class AuthenticationError extends StreamsError {
|
|
123
|
+
class AuthenticationError extends SecondLayerError {
|
|
150
124
|
constructor(message) {
|
|
151
125
|
super("AUTHENTICATION_ERROR", message);
|
|
152
126
|
}
|
|
153
127
|
}
|
|
154
128
|
|
|
155
|
-
class AuthorizationError extends
|
|
129
|
+
class AuthorizationError extends SecondLayerError {
|
|
156
130
|
constructor(message) {
|
|
157
131
|
super("AUTHORIZATION_ERROR", message);
|
|
158
132
|
}
|
|
159
133
|
}
|
|
160
134
|
|
|
161
|
-
class RateLimitError extends
|
|
135
|
+
class RateLimitError extends SecondLayerError {
|
|
162
136
|
constructor(message) {
|
|
163
137
|
super("RATE_LIMIT_ERROR", message);
|
|
164
138
|
}
|
|
165
139
|
}
|
|
166
140
|
|
|
167
|
-
class ForbiddenError extends
|
|
141
|
+
class ForbiddenError extends SecondLayerError {
|
|
168
142
|
constructor(message = "Forbidden") {
|
|
169
143
|
super("FORBIDDEN", message);
|
|
170
144
|
}
|
|
171
145
|
}
|
|
146
|
+
|
|
147
|
+
class VersionConflictError extends SecondLayerError {
|
|
148
|
+
currentVersion;
|
|
149
|
+
expectedVersion;
|
|
150
|
+
constructor(currentVersion, expectedVersion) {
|
|
151
|
+
super("VERSION_CONFLICT", `Version conflict: expected ${expectedVersion}, current ${currentVersion}`);
|
|
152
|
+
this.currentVersion = currentVersion;
|
|
153
|
+
this.expectedVersion = expectedVersion;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
172
156
|
var CODE_TO_STATUS = {
|
|
173
157
|
AUTHENTICATION_ERROR: 401,
|
|
174
158
|
AUTHORIZATION_ERROR: 403,
|
|
175
159
|
RATE_LIMIT_ERROR: 429,
|
|
176
160
|
FORBIDDEN: 403,
|
|
177
|
-
|
|
161
|
+
NOT_FOUND: 404,
|
|
178
162
|
VALIDATION_ERROR: 400
|
|
179
163
|
};
|
|
180
164
|
function getErrorMessage(err) {
|
|
@@ -294,106 +278,6 @@ class Logger {
|
|
|
294
278
|
}
|
|
295
279
|
var logger = new Logger;
|
|
296
280
|
|
|
297
|
-
// src/queue/index.ts
|
|
298
|
-
var exports_queue = {};
|
|
299
|
-
__export(exports_queue, {
|
|
300
|
-
stats: () => stats,
|
|
301
|
-
getWorkerId: () => getWorkerId,
|
|
302
|
-
fail: () => fail,
|
|
303
|
-
enqueue: () => enqueue,
|
|
304
|
-
complete: () => complete,
|
|
305
|
-
claim: () => claim,
|
|
306
|
-
WORKER_ID: () => WORKER_ID
|
|
307
|
-
});
|
|
308
|
-
import { randomUUID } from "crypto";
|
|
309
|
-
import { sql as sql3 } from "kysely";
|
|
310
|
-
var WORKER_ID = `worker-${randomUUID().slice(0, 8)}`;
|
|
311
|
-
async function enqueue(streamId, blockHeight, backfill = false) {
|
|
312
|
-
const db2 = getDb();
|
|
313
|
-
const row = await db2.insertInto("jobs").values({
|
|
314
|
-
stream_id: streamId,
|
|
315
|
-
block_height: blockHeight,
|
|
316
|
-
backfill,
|
|
317
|
-
status: "pending",
|
|
318
|
-
attempts: 0
|
|
319
|
-
}).returning(["id"]).executeTakeFirstOrThrow();
|
|
320
|
-
return row.id;
|
|
321
|
-
}
|
|
322
|
-
async function claim() {
|
|
323
|
-
const db2 = getDb();
|
|
324
|
-
const { rows } = await sql3`
|
|
325
|
-
UPDATE jobs
|
|
326
|
-
SET
|
|
327
|
-
status = 'processing',
|
|
328
|
-
locked_at = NOW(),
|
|
329
|
-
locked_by = ${WORKER_ID},
|
|
330
|
-
attempts = attempts + 1
|
|
331
|
-
WHERE id = (
|
|
332
|
-
SELECT id FROM jobs
|
|
333
|
-
WHERE status = 'pending'
|
|
334
|
-
ORDER BY
|
|
335
|
-
backfill ASC,
|
|
336
|
-
block_height ASC,
|
|
337
|
-
created_at ASC
|
|
338
|
-
FOR UPDATE SKIP LOCKED
|
|
339
|
-
LIMIT 1
|
|
340
|
-
)
|
|
341
|
-
RETURNING *
|
|
342
|
-
`.execute(db2);
|
|
343
|
-
return rows[0] ?? null;
|
|
344
|
-
}
|
|
345
|
-
async function complete(jobId) {
|
|
346
|
-
const db2 = getDb();
|
|
347
|
-
await db2.updateTable("jobs").set({
|
|
348
|
-
status: "completed",
|
|
349
|
-
completed_at: new Date,
|
|
350
|
-
locked_at: null,
|
|
351
|
-
locked_by: null
|
|
352
|
-
}).where("id", "=", jobId).execute();
|
|
353
|
-
}
|
|
354
|
-
async function fail(jobId, error, maxAttempts = 3) {
|
|
355
|
-
const db2 = getDb();
|
|
356
|
-
const job = await db2.selectFrom("jobs").select("attempts").where("id", "=", jobId).executeTakeFirst();
|
|
357
|
-
if (!job)
|
|
358
|
-
return;
|
|
359
|
-
if (job.attempts < maxAttempts) {
|
|
360
|
-
await db2.updateTable("jobs").set({
|
|
361
|
-
status: "pending",
|
|
362
|
-
error,
|
|
363
|
-
locked_at: null,
|
|
364
|
-
locked_by: null
|
|
365
|
-
}).where("id", "=", jobId).execute();
|
|
366
|
-
} else {
|
|
367
|
-
await db2.updateTable("jobs").set({
|
|
368
|
-
status: "failed",
|
|
369
|
-
error,
|
|
370
|
-
completed_at: new Date,
|
|
371
|
-
locked_at: null,
|
|
372
|
-
locked_by: null
|
|
373
|
-
}).where("id", "=", jobId).execute();
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
async function stats() {
|
|
377
|
-
const { rows } = await sql3`
|
|
378
|
-
SELECT status, COUNT(*) as count
|
|
379
|
-
FROM jobs
|
|
380
|
-
GROUP BY status
|
|
381
|
-
`.execute(getDb());
|
|
382
|
-
const counts = {};
|
|
383
|
-
for (const row of rows) {
|
|
384
|
-
counts[row.status] = Number.parseInt(row.count, 10);
|
|
385
|
-
}
|
|
386
|
-
return {
|
|
387
|
-
pending: counts["pending"] || 0,
|
|
388
|
-
processing: counts["processing"] || 0,
|
|
389
|
-
completed: counts["completed"] || 0,
|
|
390
|
-
failed: counts["failed"] || 0,
|
|
391
|
-
total: Object.values(counts).reduce((a, b) => a + b, 0)
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
function getWorkerId() {
|
|
395
|
-
return WORKER_ID;
|
|
396
|
-
}
|
|
397
281
|
// src/schemas/filters.ts
|
|
398
282
|
import { isValidAddress as _isValidAddress } from "@secondlayer/stacks";
|
|
399
283
|
import { z as z2 } from "zod/v4";
|
|
@@ -482,7 +366,7 @@ var PrintEventFilterSchema = z2.object({
|
|
|
482
366
|
topic: z2.string().optional(),
|
|
483
367
|
contains: z2.string().optional()
|
|
484
368
|
});
|
|
485
|
-
var
|
|
369
|
+
var EventFilterSchema = z2.discriminatedUnion("type", [
|
|
486
370
|
StxTransferFilterSchema,
|
|
487
371
|
StxMintFilterSchema,
|
|
488
372
|
StxBurnFilterSchema,
|
|
@@ -523,87 +407,9 @@ var DeploySubgraphRequestSchema = z4.object({
|
|
|
523
407
|
sources: z4.record(z4.string(), z4.record(z4.string(), z4.unknown())).refine((s) => Object.keys(s).length > 0, "Must have at least one source"),
|
|
524
408
|
schema: z4.record(z4.string(), z4.unknown()),
|
|
525
409
|
handlerCode: z4.string().max(1048576, "handler code exceeds 1MB limit"),
|
|
410
|
+
sourceCode: z4.string().max(1048576, "source code exceeds 1MB limit").optional(),
|
|
526
411
|
reindex: z4.boolean().optional()
|
|
527
412
|
});
|
|
528
|
-
// src/schemas/stream.ts
|
|
529
|
-
import { z as z5 } from "zod/v4";
|
|
530
|
-
var streamOptionsShape = z5.object({
|
|
531
|
-
decodeClarityValues: z5.boolean().default(true),
|
|
532
|
-
includeRawTx: z5.boolean().default(false),
|
|
533
|
-
includeBlockMetadata: z5.boolean().default(true),
|
|
534
|
-
rateLimit: z5.number().int().positive().max(100).default(10),
|
|
535
|
-
timeoutMs: z5.number().int().positive().max(30000).default(1e4),
|
|
536
|
-
maxRetries: z5.number().int().min(0).max(10).default(3)
|
|
537
|
-
});
|
|
538
|
-
var StreamOptionsSchema = streamOptionsShape;
|
|
539
|
-
var CreateStreamSchema = z5.object({
|
|
540
|
-
name: z5.string().min(1).max(255),
|
|
541
|
-
endpointUrl: z5.string().url(),
|
|
542
|
-
filters: z5.array(StreamFilterSchema).min(1),
|
|
543
|
-
options: streamOptionsShape.optional(),
|
|
544
|
-
startBlock: z5.number().int().positive().optional(),
|
|
545
|
-
endBlock: z5.number().int().positive().optional()
|
|
546
|
-
});
|
|
547
|
-
var UpdateStreamSchema = z5.object({
|
|
548
|
-
name: z5.string().min(1).max(255).optional(),
|
|
549
|
-
endpointUrl: z5.string().url().optional(),
|
|
550
|
-
filters: z5.array(StreamFilterSchema).min(1).optional(),
|
|
551
|
-
options: streamOptionsShape.partial().optional()
|
|
552
|
-
}).refine((data) => Object.keys(data).length > 0, {
|
|
553
|
-
message: "At least one field must be provided for update"
|
|
554
|
-
});
|
|
555
|
-
var DeliveryPayloadSchema = z5.object({
|
|
556
|
-
streamId: z5.string().uuid(),
|
|
557
|
-
streamName: z5.string(),
|
|
558
|
-
block: z5.object({
|
|
559
|
-
height: z5.number(),
|
|
560
|
-
hash: z5.string(),
|
|
561
|
-
parentHash: z5.string(),
|
|
562
|
-
burnBlockHeight: z5.number(),
|
|
563
|
-
timestamp: z5.number()
|
|
564
|
-
}),
|
|
565
|
-
matches: z5.object({
|
|
566
|
-
transactions: z5.array(z5.object({
|
|
567
|
-
txId: z5.string(),
|
|
568
|
-
type: z5.string(),
|
|
569
|
-
sender: z5.string(),
|
|
570
|
-
status: z5.string(),
|
|
571
|
-
contractId: z5.string().nullable(),
|
|
572
|
-
functionName: z5.string().nullable(),
|
|
573
|
-
rawTx: z5.string().optional()
|
|
574
|
-
})),
|
|
575
|
-
events: z5.array(z5.object({
|
|
576
|
-
txId: z5.string(),
|
|
577
|
-
eventIndex: z5.number(),
|
|
578
|
-
type: z5.string(),
|
|
579
|
-
data: z5.any()
|
|
580
|
-
}))
|
|
581
|
-
}),
|
|
582
|
-
isBackfill: z5.boolean(),
|
|
583
|
-
deliveredAt: z5.string().datetime()
|
|
584
|
-
});
|
|
585
|
-
var StreamMetricsSchema = z5.object({
|
|
586
|
-
totalDeliveries: z5.number(),
|
|
587
|
-
failedDeliveries: z5.number(),
|
|
588
|
-
lastTriggeredAt: z5.string().datetime().nullable(),
|
|
589
|
-
lastTriggeredBlock: z5.number().nullable(),
|
|
590
|
-
errorMessage: z5.string().nullable()
|
|
591
|
-
});
|
|
592
|
-
var StreamResponseSchema = z5.object({
|
|
593
|
-
id: z5.string().uuid(),
|
|
594
|
-
name: z5.string(),
|
|
595
|
-
status: z5.enum(["inactive", "active", "paused", "failed"]),
|
|
596
|
-
endpointUrl: z5.string().url(),
|
|
597
|
-
filters: z5.array(StreamFilterSchema),
|
|
598
|
-
options: streamOptionsShape,
|
|
599
|
-
totalDeliveries: z5.number().int().default(0),
|
|
600
|
-
failedDeliveries: z5.number().int().default(0),
|
|
601
|
-
lastTriggeredAt: z5.string().datetime().nullable().optional(),
|
|
602
|
-
lastTriggeredBlock: z5.number().int().nullable().optional(),
|
|
603
|
-
errorMessage: z5.string().nullable().optional(),
|
|
604
|
-
createdAt: z5.string().datetime(),
|
|
605
|
-
updatedAt: z5.string().datetime()
|
|
606
|
-
});
|
|
607
413
|
// src/crypto/hmac.ts
|
|
608
414
|
var exports_hmac = {};
|
|
609
415
|
__export(exports_hmac, {
|
|
@@ -659,7 +465,6 @@ function verifySignatureHeader(payload, header, secret, toleranceSeconds = 300)
|
|
|
659
465
|
}
|
|
660
466
|
export {
|
|
661
467
|
sql2 as sql,
|
|
662
|
-
exports_queue as queue,
|
|
663
468
|
parseJsonb,
|
|
664
469
|
logger,
|
|
665
470
|
jsonb,
|
|
@@ -669,22 +474,18 @@ export {
|
|
|
669
474
|
getDb,
|
|
670
475
|
exports_hmac as crypto,
|
|
671
476
|
closeDb,
|
|
477
|
+
VersionConflictError,
|
|
672
478
|
ValidationError,
|
|
673
|
-
UpdateStreamSchema,
|
|
674
479
|
UpdateProfileRequestSchema,
|
|
675
480
|
StxTransferFilterSchema,
|
|
676
481
|
StxMintFilterSchema,
|
|
677
482
|
StxLockFilterSchema,
|
|
678
483
|
StxBurnFilterSchema,
|
|
679
|
-
|
|
680
|
-
StreamResponseSchema,
|
|
681
|
-
StreamOptionsSchema,
|
|
682
|
-
StreamNotFoundError,
|
|
683
|
-
StreamMetricsSchema,
|
|
684
|
-
StreamFilterSchema,
|
|
484
|
+
SecondLayerError,
|
|
685
485
|
RateLimitError,
|
|
686
486
|
PublishSubgraphRequestSchema,
|
|
687
487
|
PrintEventFilterSchema,
|
|
488
|
+
NotFoundError,
|
|
688
489
|
NftTransferFilterSchema,
|
|
689
490
|
NftMintFilterSchema,
|
|
690
491
|
NftBurnFilterSchema,
|
|
@@ -693,13 +494,10 @@ export {
|
|
|
693
494
|
FtBurnFilterSchema,
|
|
694
495
|
ForkSubgraphRequestSchema,
|
|
695
496
|
ForbiddenError,
|
|
696
|
-
|
|
497
|
+
EventFilterSchema,
|
|
697
498
|
ErrorCodes,
|
|
698
499
|
DeploySubgraphRequestSchema,
|
|
699
|
-
DeliveryPayloadSchema,
|
|
700
|
-
DeliveryError,
|
|
701
500
|
DatabaseError,
|
|
702
|
-
CreateStreamSchema,
|
|
703
501
|
ContractDeployFilterSchema,
|
|
704
502
|
ContractCallFilterSchema,
|
|
705
503
|
CODE_TO_STATUS,
|
|
@@ -707,5 +505,5 @@ export {
|
|
|
707
505
|
AuthenticationError
|
|
708
506
|
};
|
|
709
507
|
|
|
710
|
-
//# debugId=
|
|
508
|
+
//# debugId=7EDE06567E6D25DE64756E2164756E21
|
|
711
509
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/db/jsonb.ts", "../src/db/index.ts", "../src/errors.ts", "../src/env.ts", "../src/logger.ts", "../src/
|
|
3
|
+
"sources": ["../src/db/jsonb.ts", "../src/db/index.ts", "../src/errors.ts", "../src/env.ts", "../src/logger.ts", "../src/schemas/filters.ts", "../src/schemas/marketplace.ts", "../src/schemas/subgraphs.ts", "../src/crypto/hmac.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { type RawBuilder, sql } from \"kysely\";\n\n/**\n * Safely encode a JS value as a JSONB literal for Kysely inserts/updates.\n * Kysely + postgres.js double-encodes JSON when using parameterized queries\n * with ::jsonb casts. This uses sql.raw to inline a properly escaped literal.\n */\nexport function jsonb(value: unknown): RawBuilder<unknown> {\n\tconst escaped = JSON.stringify(value, (_k, v) => (typeof v === \"bigint\" ? v.toString() : v)).replace(/'/g, \"''\");\n\treturn sql`${sql.raw(`'${escaped}'::jsonb`)}`;\n}\n\n/**\n * Safely parse a JSONB value from the database.\n * Handles double-encoded strings where postgres.js returns a JSON string\n * instead of a parsed object.\n */\nexport function parseJsonb<T = unknown>(value: unknown): T {\n\tif (typeof value === \"string\") {\n\t\ttry {\n\t\t\treturn JSON.parse(value) as T;\n\t\t} catch {\n\t\t\treturn value as T;\n\t\t}\n\t}\n\treturn (value ?? {}) as T;\n}\n",
|
|
6
|
-
"import { Kysely } from \"kysely\";\nimport { PostgresJSDialect } from \"kysely-postgres-js\";\nimport postgres from \"postgres\";\nimport type { Database } from \"./types.ts\";\n\nlet db: Kysely<Database> | null = null;\nlet rawClient: ReturnType<typeof postgres> | null = null;\n\nexport function getDb(connectionString?: string): Kysely<Database> {\n\tif (!db) {\n\t\tconst url =\n\t\t\tconnectionString ||\n\t\t\tprocess.env.DATABASE_URL ||\n\t\t\t\"postgres://postgres:postgres@localhost:5432/
|
|
7
|
-
"export const ErrorCodes = {\n\
|
|
6
|
+
"import { Kysely } from \"kysely\";\nimport { PostgresJSDialect } from \"kysely-postgres-js\";\nimport postgres from \"postgres\";\nimport type { Database } from \"./types.ts\";\n\nlet db: Kysely<Database> | null = null;\nlet rawClient: ReturnType<typeof postgres> | null = null;\n\nexport function getDb(connectionString?: string): Kysely<Database> {\n\tif (!db) {\n\t\tconst url =\n\t\t\tconnectionString ||\n\t\t\tprocess.env.DATABASE_URL ||\n\t\t\t\"postgres://postgres:postgres@localhost:5432/secondlayer_dev\";\n\n\t\t// Always use SSL for remote databases, just disable cert verification if needed\n\t\tconst isLocal =\n\t\t\turl.includes(\"localhost\") ||\n\t\t\turl.includes(\"127.0.0.1\") ||\n\t\t\turl.includes(\"@postgres:\");\n\t\tconst poolMax = Number.parseInt(process.env.DATABASE_POOL_MAX ?? \"20\", 10);\n\t\trawClient = postgres(url, {\n\t\t\tmax: poolMax,\n\t\t\tssl: isLocal\n\t\t\t\t? undefined\n\t\t\t\t: {\n\t\t\t\t\t\trejectUnauthorized:\n\t\t\t\t\t\t\tprocess.env.NODE_TLS_REJECT_UNAUTHORIZED !== \"0\",\n\t\t\t\t\t},\n\t\t});\n\t\tdb = new Kysely<Database>({\n\t\t\tdialect: new PostgresJSDialect({ postgres: rawClient }),\n\t\t});\n\t}\n\treturn db;\n}\n\n/** Raw postgres.js client for dynamic schema DDL (CREATE SCHEMA, DROP, etc.) */\nexport function getRawClient(): ReturnType<typeof postgres> {\n\tif (!rawClient) getDb();\n\treturn rawClient!;\n}\n\n/** Close the DB connection pool. Call in CLI commands to allow process exit. */\nexport async function closeDb(): Promise<void> {\n\tif (db) {\n\t\tawait db.destroy();\n\t\tdb = null;\n\t}\n\tif (rawClient) {\n\t\tawait rawClient.end();\n\t\trawClient = null;\n\t}\n}\n\nimport { sql } from \"kysely\";\nexport { sql };\nexport * from \"./types.ts\";\nexport { jsonb, parseJsonb } from \"./jsonb.ts\";\n",
|
|
7
|
+
"export const ErrorCodes = {\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tDATABASE_ERROR: \"DATABASE_ERROR\",\n\tAUTHENTICATION_ERROR: \"AUTHENTICATION_ERROR\",\n\tAUTHORIZATION_ERROR: \"AUTHORIZATION_ERROR\",\n\tRATE_LIMIT_ERROR: \"RATE_LIMIT_ERROR\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tVERSION_CONFLICT: \"VERSION_CONFLICT\",\n\tNOT_FOUND: \"NOT_FOUND\",\n} as const;\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\n/** Base error class for all Secondlayer errors. */\nexport class SecondLayerError extends Error {\n\tpublic code: ErrorCode;\n\tpublic override cause?: unknown;\n\n\tconstructor(code: ErrorCode, message: string, cause?: unknown) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.cause = cause;\n\t\tthis.name = this.constructor.name;\n\t\tError.captureStackTrace?.(this, this.constructor);\n\t}\n\n\ttoJSON(): {\n\t\tname: string;\n\t\tcode: string;\n\t\tmessage: string;\n\t\tstack: string | undefined;\n\t\tcause: unknown;\n\t} {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tcode: this.code,\n\t\t\tmessage: this.message,\n\t\t\tstack: this.stack,\n\t\t\tcause: this.cause,\n\t\t};\n\t}\n}\n\nexport class NotFoundError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"NOT_FOUND\", message);\n\t}\n}\n\nexport class ValidationError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"VALIDATION_ERROR\", message, cause);\n\t}\n}\n\nexport class DatabaseError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"DATABASE_ERROR\", message, cause);\n\t}\n}\n\nexport class AuthenticationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHENTICATION_ERROR\", message);\n\t}\n}\n\nexport class AuthorizationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHORIZATION_ERROR\", message);\n\t}\n}\n\nexport class RateLimitError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"RATE_LIMIT_ERROR\", message);\n\t}\n}\n\nexport class ForbiddenError extends SecondLayerError {\n\tconstructor(message = \"Forbidden\") {\n\t\tsuper(\"FORBIDDEN\", message);\n\t}\n}\n\nexport class VersionConflictError extends SecondLayerError {\n\tpublic currentVersion: string;\n\tpublic expectedVersion: string;\n\n\tconstructor(currentVersion: string, expectedVersion: string) {\n\t\tsuper(\n\t\t\t\"VERSION_CONFLICT\",\n\t\t\t`Version conflict: expected ${expectedVersion}, current ${currentVersion}`,\n\t\t);\n\t\tthis.currentVersion = currentVersion;\n\t\tthis.expectedVersion = expectedVersion;\n\t}\n}\n\n/** Error code → HTTP status. Used by API middleware for code-based matching\n * (avoids cross-bundle instanceof failures from bunup class duplication). */\ntype MappedCode = Extract<\n\tErrorCode,\n\t| \"AUTHENTICATION_ERROR\"\n\t| \"AUTHORIZATION_ERROR\"\n\t| \"RATE_LIMIT_ERROR\"\n\t| \"FORBIDDEN\"\n\t| \"NOT_FOUND\"\n\t| \"VALIDATION_ERROR\"\n>;\nexport const CODE_TO_STATUS: Record<MappedCode, 400 | 401 | 403 | 404 | 429> = {\n\tAUTHENTICATION_ERROR: 401,\n\tAUTHORIZATION_ERROR: 403,\n\tRATE_LIMIT_ERROR: 429,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tVALIDATION_ERROR: 400,\n} as const;\n\nexport function getErrorMessage(err: unknown): string {\n\treturn err instanceof Error ? err.message : String(err);\n}\n",
|
|
8
8
|
"import { z } from \"zod/v4\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tenabledNetworks = [\"mainnet\"]; // Default\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\n// Export for testing\nexport { envSchema };\n",
|
|
9
9
|
"import { getEnv } from \"./env.ts\";\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n\tdebug: 0,\n\tinfo: 1,\n\twarn: 2,\n\terror: 3,\n};\n\nclass Logger {\n\tprivate _level?: LogLevel;\n\tprivate _isProduction?: boolean;\n\tprivate _initialized = false;\n\n\tprivate init() {\n\t\tif (this._initialized) return;\n\t\tthis._initialized = true;\n\t\ttry {\n\t\t\tconst env = getEnv();\n\t\t\tthis._level = env.LOG_LEVEL;\n\t\t\tthis._isProduction = env.NODE_ENV === \"production\";\n\t\t} catch {\n\t\t\t// Fallback when env is unavailable (e.g. tests without DATABASE_URL)\n\t\t\tthis._level = \"info\";\n\t\t\tthis._isProduction = false;\n\t\t}\n\t}\n\n\tprivate get level(): LogLevel {\n\t\tthis.init();\n\t\treturn this._level!;\n\t}\n\n\tprivate get isProduction(): boolean {\n\t\tthis.init();\n\t\treturn this._isProduction!;\n\t}\n\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\treturn LOG_LEVELS[level] >= LOG_LEVELS[this.level];\n\t}\n\n\tprivate formatMessage(\n\t\tlevel: LogLevel,\n\t\tmessage: string,\n\t\tmeta?: Record<string, any>,\n\t) {\n\t\tconst timestamp = new Date().toISOString();\n\n\t\tif (this.isProduction) {\n\t\t\t// JSON output for production\n\t\t\treturn JSON.stringify({\n\t\t\t\ttimestamp,\n\t\t\t\tlevel,\n\t\t\t\tmessage,\n\t\t\t\t...meta,\n\t\t\t});\n\t\t}\n\n\t\t// Human-readable output for development\n\t\tconst metaStr = meta ? ` ${JSON.stringify(meta)}` : \"\";\n\t\treturn `[${timestamp}] ${level.toUpperCase()}: ${message}${metaStr}`;\n\t}\n\n\tdebug(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"debug\")) {\n\t\t\tconsole.debug(this.formatMessage(\"debug\", message, meta));\n\t\t}\n\t}\n\n\tinfo(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"info\")) {\n\t\t\tconsole.info(this.formatMessage(\"info\", message, meta));\n\t\t}\n\t}\n\n\twarn(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"warn\")) {\n\t\t\tconsole.warn(this.formatMessage(\"warn\", message, meta));\n\t\t}\n\t}\n\n\terror(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"error\")) {\n\t\t\tconsole.error(this.formatMessage(\"error\", message, meta));\n\t\t}\n\t}\n}\n\n// Export singleton instance\nexport const logger: Logger = new Logger();\n",
|
|
10
|
-
"import {
|
|
11
|
-
"import { isValidAddress as _isValidAddress } from \"@secondlayer/stacks\";\nimport { z } from \"zod/v4\";\n\nconst isValidAddress = _isValidAddress as (addr: string) => boolean;\n\n/** Validate a Stacks principal (standard or contract, e.g. SP2J...ABC or SP2J...ABC.contract-name) */\nconst stacksPrincipal = z.string().refine((val) => {\n\tconst parts = val.split(\".\");\n\tif (parts.length > 2) return false;\n\treturn isValidAddress(parts[0]!);\n}, \"Invalid Stacks principal address\");\n\n// Base filter with common fields\nconst baseFilter = {\n\t// Optional: filter by sender\n\tsender: stacksPrincipal.optional(),\n\t// Optional: filter by recipient\n\trecipient: stacksPrincipal.optional(),\n};\n\n// Type exports — defined first so they can annotate schemas\nexport interface StxTransferFilter {\n\ttype: \"stx_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tminAmount?: number;\n\tmaxAmount?: number;\n}\n\nexport interface StxMintFilter {\n\ttype: \"stx_mint\";\n\trecipient?: string;\n\tminAmount?: number;\n}\n\nexport interface StxBurnFilter {\n\ttype: \"stx_burn\";\n\tsender?: string;\n\tminAmount?: number;\n}\n\nexport interface StxLockFilter {\n\ttype: \"stx_lock\";\n\tlockedAddress?: string;\n\tminAmount?: number;\n}\n\nexport interface FtTransferFilter {\n\ttype: \"ft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtMintFilter {\n\ttype: \"ft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtBurnFilter {\n\ttype: \"ft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface NftTransferFilter {\n\ttype: \"nft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftMintFilter {\n\ttype: \"nft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftBurnFilter {\n\ttype: \"nft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface ContractCallFilter {\n\ttype: \"contract_call\";\n\tcontractId?: string;\n\tfunctionName?: string;\n\tcaller?: string;\n}\n\nexport interface ContractDeployFilter {\n\ttype: \"contract_deploy\";\n\tdeployer?: string;\n\tcontractName?: string;\n}\n\nexport interface PrintEventFilter {\n\ttype: \"print_event\";\n\tcontractId?: string;\n\ttopic?: string;\n\tcontains?: string;\n}\n\nexport type StreamFilter =\n\t| StxTransferFilter\n\t| StxMintFilter\n\t| StxBurnFilter\n\t| StxLockFilter\n\t| FtTransferFilter\n\t| FtMintFilter\n\t| FtBurnFilter\n\t| NftTransferFilter\n\t| NftMintFilter\n\t| NftBurnFilter\n\t| ContractCallFilter\n\t| ContractDeployFilter\n\t| PrintEventFilter;\n\n// STX Transfer Filter\nexport const StxTransferFilterSchema: z.ZodType<StxTransferFilter> = z.object({\n\ttype: z.literal(\"stx_transfer\"),\n\t...baseFilter,\n\t// Optional: minimum amount in microSTX\n\tminAmount: z.coerce.number().int().positive().optional(),\n\t// Optional: maximum amount in microSTX\n\tmaxAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Mint Filter\nexport const StxMintFilterSchema: z.ZodType<StxMintFilter> = z.object({\n\ttype: z.literal(\"stx_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Burn Filter\nexport const StxBurnFilterSchema: z.ZodType<StxBurnFilter> = z.object({\n\ttype: z.literal(\"stx_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Lock Filter\nexport const StxLockFilterSchema: z.ZodType<StxLockFilter> = z.object({\n\ttype: z.literal(\"stx_lock\"),\n\tlockedAddress: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Transfer Filter\nexport const FtTransferFilterSchema: z.ZodType<FtTransferFilter> = z.object({\n\ttype: z.literal(\"ft_transfer\"),\n\t...baseFilter,\n\t// Contract that defines the token (e.g., SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx)\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Mint Filter\nexport const FtMintFilterSchema: z.ZodType<FtMintFilter> = z.object({\n\ttype: z.literal(\"ft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Burn Filter\nexport const FtBurnFilterSchema: z.ZodType<FtBurnFilter> = z.object({\n\ttype: z.literal(\"ft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// NFT Transfer Filter\nexport const NftTransferFilterSchema: z.ZodType<NftTransferFilter> = z.object({\n\ttype: z.literal(\"nft_transfer\"),\n\t...baseFilter,\n\tassetIdentifier: z.string().optional(),\n\t// Optional: filter by specific token ID (Clarity value as hex)\n\ttokenId: z.string().optional(),\n});\n\n// NFT Mint Filter\nexport const NftMintFilterSchema: z.ZodType<NftMintFilter> = z.object({\n\ttype: z.literal(\"nft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// NFT Burn Filter\nexport const NftBurnFilterSchema: z.ZodType<NftBurnFilter> = z.object({\n\ttype: z.literal(\"nft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// Contract Call Filter\nexport const ContractCallFilterSchema: z.ZodType<ContractCallFilter> = z.object(\n\t{\n\t\ttype: z.literal(\"contract_call\"),\n\t\t// Contract being called\n\t\tcontractId: stacksPrincipal.optional(),\n\t\t// Function name (supports wildcards with *)\n\t\tfunctionName: z.string().optional(),\n\t\t// Caller address\n\t\tcaller: stacksPrincipal.optional(),\n\t},\n);\n\n// Contract Deploy Filter\nexport const ContractDeployFilterSchema: z.ZodType<ContractDeployFilter> =\n\tz.object({\n\t\ttype: z.literal(\"contract_deploy\"),\n\t\t// Deployer address\n\t\tdeployer: stacksPrincipal.optional(),\n\t\t// Contract name pattern (supports wildcards)\n\t\tcontractName: z.string().optional(),\n\t});\n\n// Print Event Filter (smart contract events)\nexport const PrintEventFilterSchema: z.ZodType<PrintEventFilter> = z.object({\n\ttype: z.literal(\"print_event\"),\n\t// Contract emitting the event\n\tcontractId: stacksPrincipal.optional(),\n\t// Topic/name of the event\n\ttopic: z.string().optional(),\n\t// Search for substring in event data\n\tcontains: z.string().optional(),\n});\n\n// Union of all filter types\nexport const StreamFilterSchema: z.ZodType<StreamFilter> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tStxTransferFilterSchema as any,\n\t\tStxMintFilterSchema as any,\n\t\tStxBurnFilterSchema as any,\n\t\tStxLockFilterSchema as any,\n\t\tFtTransferFilterSchema as any,\n\t\tFtMintFilterSchema as any,\n\t\tFtBurnFilterSchema as any,\n\t\tNftTransferFilterSchema as any,\n\t\tNftMintFilterSchema as any,\n\t\tNftBurnFilterSchema as any,\n\t\tContractCallFilterSchema as any,\n\t\tContractDeployFilterSchema as any,\n\t\tPrintEventFilterSchema as any,\n\t],\n);\n",
|
|
10
|
+
"import { isValidAddress as _isValidAddress } from \"@secondlayer/stacks\";\nimport { z } from \"zod/v4\";\n\nconst isValidAddress = _isValidAddress as (addr: string) => boolean;\n\n/** Validate a Stacks principal (standard or contract, e.g. SP2J...ABC or SP2J...ABC.contract-name) */\nconst stacksPrincipal = z.string().refine((val) => {\n\tconst parts = val.split(\".\");\n\tif (parts.length > 2) return false;\n\treturn isValidAddress(parts[0]!);\n}, \"Invalid Stacks principal address\");\n\n// Base filter with common fields\nconst baseFilter = {\n\t// Optional: filter by sender\n\tsender: stacksPrincipal.optional(),\n\t// Optional: filter by recipient\n\trecipient: stacksPrincipal.optional(),\n};\n\n// Type exports — defined first so they can annotate schemas\nexport interface StxTransferFilter {\n\ttype: \"stx_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tminAmount?: number;\n\tmaxAmount?: number;\n}\n\nexport interface StxMintFilter {\n\ttype: \"stx_mint\";\n\trecipient?: string;\n\tminAmount?: number;\n}\n\nexport interface StxBurnFilter {\n\ttype: \"stx_burn\";\n\tsender?: string;\n\tminAmount?: number;\n}\n\nexport interface StxLockFilter {\n\ttype: \"stx_lock\";\n\tlockedAddress?: string;\n\tminAmount?: number;\n}\n\nexport interface FtTransferFilter {\n\ttype: \"ft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtMintFilter {\n\ttype: \"ft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface FtBurnFilter {\n\ttype: \"ft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\tminAmount?: number;\n}\n\nexport interface NftTransferFilter {\n\ttype: \"nft_transfer\";\n\tsender?: string;\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftMintFilter {\n\ttype: \"nft_mint\";\n\trecipient?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface NftBurnFilter {\n\ttype: \"nft_burn\";\n\tsender?: string;\n\tassetIdentifier?: string;\n\ttokenId?: string;\n}\n\nexport interface ContractCallFilter {\n\ttype: \"contract_call\";\n\tcontractId?: string;\n\tfunctionName?: string;\n\tcaller?: string;\n}\n\nexport interface ContractDeployFilter {\n\ttype: \"contract_deploy\";\n\tdeployer?: string;\n\tcontractName?: string;\n}\n\nexport interface PrintEventFilter {\n\ttype: \"print_event\";\n\tcontractId?: string;\n\ttopic?: string;\n\tcontains?: string;\n}\n\nexport type EventFilter =\n\t| StxTransferFilter\n\t| StxMintFilter\n\t| StxBurnFilter\n\t| StxLockFilter\n\t| FtTransferFilter\n\t| FtMintFilter\n\t| FtBurnFilter\n\t| NftTransferFilter\n\t| NftMintFilter\n\t| NftBurnFilter\n\t| ContractCallFilter\n\t| ContractDeployFilter\n\t| PrintEventFilter;\n\n// STX Transfer Filter\nexport const StxTransferFilterSchema: z.ZodType<StxTransferFilter> = z.object({\n\ttype: z.literal(\"stx_transfer\"),\n\t...baseFilter,\n\t// Optional: minimum amount in microSTX\n\tminAmount: z.coerce.number().int().positive().optional(),\n\t// Optional: maximum amount in microSTX\n\tmaxAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Mint Filter\nexport const StxMintFilterSchema: z.ZodType<StxMintFilter> = z.object({\n\ttype: z.literal(\"stx_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Burn Filter\nexport const StxBurnFilterSchema: z.ZodType<StxBurnFilter> = z.object({\n\ttype: z.literal(\"stx_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// STX Lock Filter\nexport const StxLockFilterSchema: z.ZodType<StxLockFilter> = z.object({\n\ttype: z.literal(\"stx_lock\"),\n\tlockedAddress: stacksPrincipal.optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Transfer Filter\nexport const FtTransferFilterSchema: z.ZodType<FtTransferFilter> = z.object({\n\ttype: z.literal(\"ft_transfer\"),\n\t...baseFilter,\n\t// Contract that defines the token (e.g., SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.token-wstx)\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Mint Filter\nexport const FtMintFilterSchema: z.ZodType<FtMintFilter> = z.object({\n\ttype: z.literal(\"ft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// FT Burn Filter\nexport const FtBurnFilterSchema: z.ZodType<FtBurnFilter> = z.object({\n\ttype: z.literal(\"ft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\tminAmount: z.coerce.number().int().positive().optional(),\n});\n\n// NFT Transfer Filter\nexport const NftTransferFilterSchema: z.ZodType<NftTransferFilter> = z.object({\n\ttype: z.literal(\"nft_transfer\"),\n\t...baseFilter,\n\tassetIdentifier: z.string().optional(),\n\t// Optional: filter by specific token ID (Clarity value as hex)\n\ttokenId: z.string().optional(),\n});\n\n// NFT Mint Filter\nexport const NftMintFilterSchema: z.ZodType<NftMintFilter> = z.object({\n\ttype: z.literal(\"nft_mint\"),\n\trecipient: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// NFT Burn Filter\nexport const NftBurnFilterSchema: z.ZodType<NftBurnFilter> = z.object({\n\ttype: z.literal(\"nft_burn\"),\n\tsender: stacksPrincipal.optional(),\n\tassetIdentifier: z.string().optional(),\n\ttokenId: z.string().optional(),\n});\n\n// Contract Call Filter\nexport const ContractCallFilterSchema: z.ZodType<ContractCallFilter> = z.object(\n\t{\n\t\ttype: z.literal(\"contract_call\"),\n\t\t// Contract being called\n\t\tcontractId: stacksPrincipal.optional(),\n\t\t// Function name (supports wildcards with *)\n\t\tfunctionName: z.string().optional(),\n\t\t// Caller address\n\t\tcaller: stacksPrincipal.optional(),\n\t},\n);\n\n// Contract Deploy Filter\nexport const ContractDeployFilterSchema: z.ZodType<ContractDeployFilter> =\n\tz.object({\n\t\ttype: z.literal(\"contract_deploy\"),\n\t\t// Deployer address\n\t\tdeployer: stacksPrincipal.optional(),\n\t\t// Contract name pattern (supports wildcards)\n\t\tcontractName: z.string().optional(),\n\t});\n\n// Print Event Filter (smart contract events)\nexport const PrintEventFilterSchema: z.ZodType<PrintEventFilter> = z.object({\n\ttype: z.literal(\"print_event\"),\n\t// Contract emitting the event\n\tcontractId: stacksPrincipal.optional(),\n\t// Topic/name of the event\n\ttopic: z.string().optional(),\n\t// Search for substring in event data\n\tcontains: z.string().optional(),\n});\n\n// Union of all filter types\nexport const EventFilterSchema: z.ZodType<EventFilter> = z.discriminatedUnion(\n\t\"type\",\n\t[\n\t\tStxTransferFilterSchema as any,\n\t\tStxMintFilterSchema as any,\n\t\tStxBurnFilterSchema as any,\n\t\tStxLockFilterSchema as any,\n\t\tFtTransferFilterSchema as any,\n\t\tFtMintFilterSchema as any,\n\t\tFtBurnFilterSchema as any,\n\t\tNftTransferFilterSchema as any,\n\t\tNftMintFilterSchema as any,\n\t\tNftBurnFilterSchema as any,\n\t\tContractCallFilterSchema as any,\n\t\tContractDeployFilterSchema as any,\n\t\tPrintEventFilterSchema as any,\n\t],\n);\n",
|
|
12
11
|
"import { z } from \"zod/v4\";\n\n// ── Request Types ────────────────────────────────────────────────────\n\nexport interface PublishSubgraphRequest {\n\ttags?: string[];\n\tdescription?: string;\n}\n\nexport interface UpdateProfileRequest {\n\tdisplay_name?: string;\n\tbio?: string;\n\tslug?: string;\n}\n\nexport interface ForkSubgraphRequest {\n\tsourceSubgraphName: string;\n\tnewName?: string;\n}\n\n// ── Request Schemas ───────────────────────────────────────────────────\n\nexport const PublishSubgraphRequestSchema: z.ZodType<PublishSubgraphRequest> =\n\tz.object({\n\t\ttags: z.array(z.string().max(30)).max(5).optional(),\n\t\tdescription: z.string().max(500).optional(),\n\t});\n\nexport const UpdateProfileRequestSchema: z.ZodType<UpdateProfileRequest> =\n\tz.object({\n\t\tdisplay_name: z.string().max(50).optional(),\n\t\tbio: z.string().max(300).optional(),\n\t\tslug: z\n\t\t\t.string()\n\t\t\t.regex(/^[a-z0-9-]+$/, \"lowercase alphanumeric + hyphens only\")\n\t\t\t.min(3)\n\t\t\t.max(30)\n\t\t\t.optional(),\n\t});\n\nexport const ForkSubgraphRequestSchema: z.ZodType<ForkSubgraphRequest> =\n\tz.object({\n\t\tsourceSubgraphName: z.string(),\n\t\tnewName: z\n\t\t\t.string()\n\t\t\t.regex(/^[a-z0-9-]+$/, \"lowercase alphanumeric + hyphens only\")\n\t\t\t.max(63)\n\t\t\t.optional(),\n\t});\n\n// ── Response Types ────────────────────────────────────────────────────\n\nexport interface MarketplaceCreator {\n\tdisplayName: string | null;\n\tslug: string | null;\n}\n\nexport interface MarketplaceSubgraphSummary {\n\tname: string;\n\tdescription: string | null;\n\ttags: string[];\n\tcreator: MarketplaceCreator;\n\tstatus: string;\n\tversion: string;\n\ttables: string[];\n\ttotalQueries7d: number;\n\tprogress: number;\n\tcreatedAt: string;\n}\n\nexport interface MarketplaceSubgraphDetail extends MarketplaceSubgraphSummary {\n\ttableSchemas: Record<\n\t\tstring,\n\t\t{\n\t\t\tcolumns: Record<string, { type: string; nullable?: boolean }>;\n\t\t\trowCount: number;\n\t\t\tendpoint: string;\n\t\t}\n\t>;\n\tsources: Record<string, unknown>;\n\tstartBlock: number;\n\tlastProcessedBlock: number;\n\tforkedFrom: string | null;\n\tusage: {\n\t\ttotalQueries7d: number;\n\t\ttotalQueries30d: number;\n\t\tdaily: Array<{ date: string; count: number }>;\n\t};\n}\n\nexport interface CreatorProfile {\n\tdisplayName: string | null;\n\tbio: string | null;\n\tavatarUrl: string | null;\n\tslug: string | null;\n\tsubgraphs: MarketplaceSubgraphSummary[];\n}\n",
|
|
13
|
-
"import { z } from \"zod/v4\";\n\n// ── Deploy Subgraph Request ─────────────────────────────────────────────────\n\nexport interface DeploySubgraphRequest {\n\tname: string;\n\tversion?: string;\n\tdescription?: string;\n\tsources: Record<string, Record<string, unknown>>;\n\tschema: Record<string, unknown>;\n\thandlerCode: string;\n\t/** @deprecated Use server auto-reindex on breaking changes instead */\n\treindex?: boolean;\n}\n\nexport const DeploySubgraphRequestSchema: z.ZodType<DeploySubgraphRequest> =\n\tz.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.regex(/^[a-z0-9-]+$/, \"lowercase alphanumeric + hyphens only\")\n\t\t\t.max(63),\n\t\tversion: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsources: z.record(z.string(), z.record(z.string(), z.unknown())).refine(\n\t\t\t(s) => Object.keys(s).length > 0,\n\t\t\t\"Must have at least one source\",\n\t\t),\n\t\tschema: z.record(z.string(), z.unknown()),\n\t\thandlerCode: z.string().max(1_048_576, \"handler code exceeds 1MB limit\"),\n\t\treindex: z.boolean().optional(),\n\t});\n\nexport interface DeploySubgraphResponse {\n\taction: \"created\" | \"unchanged\" | \"updated\" | \"reindexed\";\n\tsubgraphId: string;\n\tversion: string;\n\tmessage: string;\n\tdiff?: {\n\t\taddedTables: string[];\n\t\tremovedTables: string[];\n\t\taddedColumns: Record<string, string[]>;\n\t\tbreakingChanges: string[];\n\t};\n}\n\n// Subgraph API response types\n\nexport interface SubgraphSummary {\n\tname: string;\n\tversion: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\ttotalProcessed: number;\n\ttotalErrors: number;\n\ttables: string[];\n\tchainTip: number;\n\tprogress: number;\n\tgapCount: number;\n\tintegrity: \"complete\" | \"gaps_detected\";\n\tcreatedAt: string;\n}\n\nexport interface SubgraphGapRange {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n}\n\nexport interface SubgraphSyncInfo {\n\tstatus: \"synced\" | \"catching_up\" | \"reindexing\" | \"error\";\n\tstartBlock: number;\n\tlastProcessedBlock: number;\n\tchainTip: number;\n\tblocksRemaining: number;\n\tprogress: number;\n\tgaps: {\n\t\tcount: number;\n\t\ttotalMissingBlocks: number;\n\t\tranges: SubgraphGapRange[];\n\t};\n\tintegrity: \"complete\" | \"gaps_detected\";\n}\n\nexport interface SubgraphDetail {\n\tname: string;\n\tversion: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\thealth: {\n\t\ttotalProcessed: number;\n\t\ttotalErrors: number;\n\t\terrorRate: number;\n\t\tlastError: string | null;\n\t\tlastErrorAt: string | null;\n\t};\n\tsync: SubgraphSyncInfo;\n\ttables: Record<\n\t\tstring,\n\t\t{\n\t\t\tendpoint: string;\n\t\t\tcolumns: Record<string, { type: string; nullable?: boolean }>;\n\t\t\trowCount: number;\n\t\t\texample: string;\n\t\t}\n\t>;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubgraphGapEntry {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n\tdetectedAt: string;\n\tresolvedAt: string | null;\n}\n\nexport interface SubgraphGapsResponse {\n\tdata: SubgraphGapEntry[];\n\tmeta: {\n\t\ttotal: number;\n\t\ttotalMissingBlocks: number;\n\t\tlimit: number;\n\t\toffset: number;\n\t};\n}\n\nexport interface ReindexResponse {\n\tmessage: string;\n\tfromBlock: number;\n\ttoBlock: number | string;\n}\n\nexport interface SubgraphQueryParams {\n\tsort?: string;\n\torder?: string;\n\tlimit?: number;\n\toffset?: number;\n\tfields?: string;\n\tfilters?: Record<string, string>;\n}\n",
|
|
14
|
-
"import { z } from \"zod/v4\";\nimport { type StreamFilter, StreamFilterSchema } from \"./filters.ts\";\n\n// ── Type interfaces ──────────────────────────────────────────────────\n\nexport interface StreamOptions {\n\tdecodeClarityValues: boolean;\n\tincludeRawTx: boolean;\n\tincludeBlockMetadata: boolean;\n\trateLimit: number;\n\ttimeoutMs: number;\n\tmaxRetries: number;\n}\n\nexport interface CreateStream {\n\tname: string;\n\tendpointUrl: string;\n\tfilters: StreamFilter[];\n\toptions?: StreamOptions;\n\tstartBlock?: number;\n\tendBlock?: number;\n}\n\nexport interface UpdateStream {\n\tname?: string;\n\tendpointUrl?: string;\n\tfilters?: StreamFilter[];\n\toptions?: Partial<StreamOptions>;\n}\n\nexport interface DeliveryPayload {\n\tstreamId: string;\n\tstreamName: string;\n\tblock: {\n\t\theight: number;\n\t\thash: string;\n\t\tparentHash: string;\n\t\tburnBlockHeight: number;\n\t\ttimestamp: number;\n\t};\n\tmatches: {\n\t\ttransactions: Array<{\n\t\t\ttxId: string;\n\t\t\ttype: string;\n\t\t\tsender: string;\n\t\t\tstatus: string;\n\t\t\tcontractId: string | null;\n\t\t\tfunctionName: string | null;\n\t\t\trawTx?: string;\n\t\t}>;\n\t\tevents: Array<{\n\t\t\ttxId: string;\n\t\t\teventIndex: number;\n\t\t\ttype: string;\n\t\t\tdata?: any;\n\t\t}>;\n\t};\n\tisBackfill: boolean;\n\tdeliveredAt: string;\n}\n\nexport interface StreamMetricsResponse {\n\ttotalDeliveries: number;\n\tfailedDeliveries: number;\n\tlastTriggeredAt: string | null;\n\tlastTriggeredBlock: number | null;\n\terrorMessage: string | null;\n}\n\nexport interface StreamResponse {\n\tid: string;\n\tname: string;\n\tstatus: \"inactive\" | \"active\" | \"paused\" | \"failed\";\n\tendpointUrl: string;\n\tfilters: StreamFilter[];\n\toptions: StreamOptions;\n\ttotalDeliveries: number;\n\tfailedDeliveries: number;\n\tlastTriggeredAt?: string | null;\n\tlastTriggeredBlock?: number | null;\n\terrorMessage?: string | null;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\n// ── Zod schemas ──────────────────────────────────────────────────────\n\n// Stream options schema (internal, keeps ZodObject methods like .partial())\nconst streamOptionsShape = z.object({\n\tdecodeClarityValues: z.boolean().default(true),\n\tincludeRawTx: z.boolean().default(false),\n\tincludeBlockMetadata: z.boolean().default(true),\n\trateLimit: z.number().int().positive().max(100).default(10),\n\ttimeoutMs: z.number().int().positive().max(30000).default(10000),\n\tmaxRetries: z.number().int().min(0).max(10).default(3),\n});\n\n// Cast: .default() makes _input fields optional, but output type matches StreamOptions\nexport const StreamOptionsSchema: z.ZodType<StreamOptions> =\n\tstreamOptionsShape as unknown as z.ZodType<StreamOptions>;\n\nexport const CreateStreamSchema: z.ZodType<CreateStream> = z.object({\n\tname: z.string().min(1).max(255),\n\tendpointUrl: z.string().url(),\n\tfilters: z.array(StreamFilterSchema).min(1),\n\toptions: streamOptionsShape.optional(),\n\tstartBlock: z.number().int().positive().optional(),\n\tendBlock: z.number().int().positive().optional(),\n}) as unknown as z.ZodType<CreateStream>;\n\nexport const UpdateStreamSchema: z.ZodType<UpdateStream> = z\n\t.object({\n\t\tname: z.string().min(1).max(255).optional(),\n\t\tendpointUrl: z.string().url().optional(),\n\t\tfilters: z.array(StreamFilterSchema).min(1).optional(),\n\t\toptions: streamOptionsShape.partial().optional(),\n\t})\n\t.refine((data) => Object.keys(data).length > 0, {\n\t\tmessage: \"At least one field must be provided for update\",\n\t}) as unknown as z.ZodType<UpdateStream>;\n\nexport const DeliveryPayloadSchema: z.ZodType<DeliveryPayload> = z.object({\n\tstreamId: z.string().uuid(),\n\tstreamName: z.string(),\n\tblock: z.object({\n\t\theight: z.number(),\n\t\thash: z.string(),\n\t\tparentHash: z.string(),\n\t\tburnBlockHeight: z.number(),\n\t\ttimestamp: z.number(),\n\t}),\n\tmatches: z.object({\n\t\ttransactions: z.array(\n\t\t\tz.object({\n\t\t\t\ttxId: z.string(),\n\t\t\t\ttype: z.string(),\n\t\t\t\tsender: z.string(),\n\t\t\t\tstatus: z.string(),\n\t\t\t\tcontractId: z.string().nullable(),\n\t\t\t\tfunctionName: z.string().nullable(),\n\t\t\t\trawTx: z.string().optional(),\n\t\t\t}),\n\t\t),\n\t\tevents: z.array(\n\t\t\tz.object({\n\t\t\t\ttxId: z.string(),\n\t\t\t\teventIndex: z.number(),\n\t\t\t\ttype: z.string(),\n\t\t\t\tdata: z.any(),\n\t\t\t}),\n\t\t),\n\t}),\n\tisBackfill: z.boolean(),\n\tdeliveredAt: z.string().datetime(),\n}) as unknown as z.ZodType<DeliveryPayload>;\n\nexport const StreamMetricsSchema: z.ZodType<StreamMetricsResponse> = z.object({\n\ttotalDeliveries: z.number(),\n\tfailedDeliveries: z.number(),\n\tlastTriggeredAt: z.string().datetime().nullable(),\n\tlastTriggeredBlock: z.number().nullable(),\n\terrorMessage: z.string().nullable(),\n});\n\nexport const StreamResponseSchema: z.ZodType<StreamResponse> = z.object({\n\tid: z.string().uuid(),\n\tname: z.string(),\n\tstatus: z.enum([\"inactive\", \"active\", \"paused\", \"failed\"]),\n\tendpointUrl: z.string().url(),\n\tfilters: z.array(StreamFilterSchema),\n\toptions: streamOptionsShape,\n\ttotalDeliveries: z.number().int().default(0),\n\tfailedDeliveries: z.number().int().default(0),\n\tlastTriggeredAt: z.string().datetime().nullable().optional(),\n\tlastTriggeredBlock: z.number().int().nullable().optional(),\n\terrorMessage: z.string().nullable().optional(),\n\tcreatedAt: z.string().datetime(),\n\tupdatedAt: z.string().datetime(),\n}) as unknown as z.ZodType<StreamResponse>;\n\n// API response types\nexport interface CreateStreamResponse {\n\tstream: StreamResponse;\n\tsigningSecret: string;\n}\n\nexport interface ListStreamsResponse {\n\tstreams: StreamResponse[];\n\ttotal: number;\n}\n\nexport interface BulkPauseResponse {\n\tpaused: number;\n\tstreams: StreamResponse[];\n}\n\nexport interface BulkResumeResponse {\n\tresumed: number;\n\tstreams: StreamResponse[];\n}\n",
|
|
12
|
+
"import { z } from \"zod/v4\";\n\n// ── Deploy Subgraph Request ─────────────────────────────────────────────────\n\nexport interface DeploySubgraphRequest {\n\tname: string;\n\tversion?: string;\n\tdescription?: string;\n\tsources: Record<string, Record<string, unknown>>;\n\tschema: Record<string, unknown>;\n\thandlerCode: string;\n\t/** Original TypeScript source, persisted so chat can read/diff/edit later. */\n\tsourceCode?: string;\n\t/** @deprecated Use server auto-reindex on breaking changes instead */\n\treindex?: boolean;\n}\n\nexport const DeploySubgraphRequestSchema: z.ZodType<DeploySubgraphRequest> =\n\tz.object({\n\t\tname: z\n\t\t\t.string()\n\t\t\t.regex(/^[a-z0-9-]+$/, \"lowercase alphanumeric + hyphens only\")\n\t\t\t.max(63),\n\t\tversion: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsources: z\n\t\t\t.record(z.string(), z.record(z.string(), z.unknown()))\n\t\t\t.refine(\n\t\t\t\t(s) => Object.keys(s).length > 0,\n\t\t\t\t\"Must have at least one source\",\n\t\t\t),\n\t\tschema: z.record(z.string(), z.unknown()),\n\t\thandlerCode: z.string().max(1_048_576, \"handler code exceeds 1MB limit\"),\n\t\tsourceCode: z\n\t\t\t.string()\n\t\t\t.max(1_048_576, \"source code exceeds 1MB limit\")\n\t\t\t.optional(),\n\t\treindex: z.boolean().optional(),\n\t});\n\nexport interface DeploySubgraphResponse {\n\taction: \"created\" | \"unchanged\" | \"updated\" | \"reindexed\";\n\tsubgraphId: string;\n\tversion: string;\n\tmessage: string;\n\tdiff?: {\n\t\taddedTables: string[];\n\t\tremovedTables: string[];\n\t\taddedColumns: Record<string, string[]>;\n\t\tbreakingChanges: string[];\n\t};\n}\n\n// Subgraph API response types\n\nexport interface SubgraphSummary {\n\tname: string;\n\tversion: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\ttotalProcessed: number;\n\ttotalErrors: number;\n\ttables: string[];\n\tchainTip: number;\n\tprogress: number;\n\tgapCount: number;\n\tintegrity: \"complete\" | \"gaps_detected\";\n\tcreatedAt: string;\n}\n\nexport interface SubgraphGapRange {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n}\n\nexport interface SubgraphSyncInfo {\n\tstatus: \"synced\" | \"catching_up\" | \"reindexing\" | \"error\";\n\tstartBlock: number;\n\tlastProcessedBlock: number;\n\tchainTip: number;\n\tblocksRemaining: number;\n\tprogress: number;\n\tgaps: {\n\t\tcount: number;\n\t\ttotalMissingBlocks: number;\n\t\tranges: SubgraphGapRange[];\n\t};\n\tintegrity: \"complete\" | \"gaps_detected\";\n}\n\nexport interface SubgraphDetail {\n\tname: string;\n\tversion: string;\n\tstatus: string;\n\tlastProcessedBlock: number;\n\thealth: {\n\t\ttotalProcessed: number;\n\t\ttotalErrors: number;\n\t\terrorRate: number;\n\t\tlastError: string | null;\n\t\tlastErrorAt: string | null;\n\t};\n\tsync: SubgraphSyncInfo;\n\ttables: Record<\n\t\tstring,\n\t\t{\n\t\t\tendpoint: string;\n\t\t\tcolumns: Record<string, { type: string; nullable?: boolean }>;\n\t\t\trowCount: number;\n\t\t\texample: string;\n\t\t}\n\t>;\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface SubgraphGapEntry {\n\tstart: number;\n\tend: number;\n\tsize: number;\n\treason: string;\n\tdetectedAt: string;\n\tresolvedAt: string | null;\n}\n\nexport interface SubgraphGapsResponse {\n\tdata: SubgraphGapEntry[];\n\tmeta: {\n\t\ttotal: number;\n\t\ttotalMissingBlocks: number;\n\t\tlimit: number;\n\t\toffset: number;\n\t};\n}\n\nexport interface ReindexResponse {\n\tmessage: string;\n\tfromBlock: number;\n\ttoBlock: number | string;\n}\n\nexport interface SubgraphQueryParams {\n\tsort?: string;\n\torder?: string;\n\tlimit?: number;\n\toffset?: number;\n\tfields?: string;\n\tfilters?: Record<string, string>;\n}\n",
|
|
15
13
|
"import { createHmac, randomBytes } from \"crypto\";\n\n/**\n * Generate a random secret for delivery signing\n * Returns 32 bytes as a 64-character hex string\n */\nexport function generateSecret(): string {\n\treturn randomBytes(32).toString(\"hex\");\n}\n\n/**\n * Sign a payload with HMAC-SHA256\n * Returns the signature as a hex string\n */\nexport function signPayload(payload: string, secret: string): string {\n\tconst hmac = createHmac(\"sha256\", secret);\n\thmac.update(payload);\n\treturn hmac.digest(\"hex\");\n}\n\n/**\n * Verify an HMAC signature\n * Uses constant-time comparison to prevent timing attacks\n */\nexport function verifySignature(\n\tpayload: string,\n\tsignature: string,\n\tsecret: string,\n): boolean {\n\tconst expectedSignature = signPayload(payload, secret);\n\n\t// Constant-time comparison\n\tif (signature.length !== expectedSignature.length) {\n\t\treturn false;\n\t}\n\n\tlet result = 0;\n\tfor (let i = 0; i < signature.length; i++) {\n\t\tresult |= signature.charCodeAt(i) ^ expectedSignature.charCodeAt(i);\n\t}\n\n\treturn result === 0;\n}\n\n/**\n * Create a Stripe-style signature header\n * Format: t=timestamp,v1=signature\n */\nexport function createSignatureHeader(\n\tpayload: string,\n\tsecret: string,\n\ttimestamp?: number,\n): string {\n\tconst ts = timestamp ?? Math.floor(Date.now() / 1000);\n\tconst signedPayload = `${ts}.${payload}`;\n\tconst signature = signPayload(signedPayload, secret);\n\n\treturn `t=${ts},v1=${signature}`;\n}\n\n/**\n * Parse and verify a Stripe-style signature header\n * Returns true if valid, false otherwise\n */\nexport function verifySignatureHeader(\n\tpayload: string,\n\theader: string,\n\tsecret: string,\n\ttoleranceSeconds = 300, // 5 minutes\n): boolean {\n\t// Parse header\n\tconst parts = header.split(\",\");\n\tconst timestamp = parts.find((p) => p.startsWith(\"t=\"))?.slice(2);\n\tconst signature = parts.find((p) => p.startsWith(\"v1=\"))?.slice(3);\n\n\tif (!timestamp || !signature) {\n\t\treturn false;\n\t}\n\n\tconst ts = Number.parseInt(timestamp, 10);\n\tif (isNaN(ts)) {\n\t\treturn false;\n\t}\n\n\t// Check timestamp is within tolerance\n\tconst now = Math.floor(Date.now() / 1000);\n\tif (Math.abs(now - ts) > toleranceSeconds) {\n\t\treturn false;\n\t}\n\n\t// Verify signature\n\tconst signedPayload = `${ts}.${payload}`;\n\treturn verifySignature(signedPayload, signature, secret);\n}\n"
|
|
16
14
|
],
|
|
17
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAOO,SAAS,KAAK,CAAC,OAAqC;AAAA,EAC1D,MAAM,UAAU,KAAK,UAAU,OAAO,CAAC,IAAI,MAAO,OAAO,MAAM,WAAW,EAAE,SAAS,IAAI,CAAE,EAAE,QAAQ,MAAM,IAAI;AAAA,EAC/G,OAAO,MAAM,IAAI,IAAI,IAAI,iBAAiB;AAAA;AAQpC,SAAS,UAAuB,CAAC,OAAmB;AAAA,EAC1D,IAAI,OAAO,UAAU,UAAU;AAAA,IAC9B,IAAI;AAAA,MACH,OAAO,KAAK,MAAM,KAAK;AAAA,MACtB,MAAM;AAAA,MACP,OAAO;AAAA;AAAA,EAET;AAAA,EACA,OAAQ,SAAS,CAAC;AAAA;;;ACzBnB;AACA;AACA;AAqDA,gBAAS;AAlDT,IAAI,KAA8B;AAClC,IAAI,YAAgD;AAE7C,SAAS,KAAK,CAAC,kBAA6C;AAAA,EAClE,IAAI,CAAC,IAAI;AAAA,IACR,MAAM,MACL,oBACA,QAAQ,IAAI,gBACZ;AAAA,IAGD,MAAM,UACL,IAAI,SAAS,WAAW,KACxB,IAAI,SAAS,WAAW,KACxB,IAAI,SAAS,YAAY;AAAA,IAC1B,MAAM,UAAU,OAAO,SAAS,QAAQ,IAAI,qBAAqB,MAAM,EAAE;AAAA,IACzE,YAAY,SAAS,KAAK;AAAA,MACzB,KAAK;AAAA,MACL,KAAK,UACF,YACA;AAAA,QACA,oBACC,QAAQ,IAAI,iCAAiC;AAAA,MAC/C;AAAA,IACH,CAA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ts
CHANGED
package/dist/src/lib/plans.js
CHANGED
|
@@ -16,7 +16,6 @@ var __export = (target, all) => {
|
|
|
16
16
|
|
|
17
17
|
// src/lib/plans.ts
|
|
18
18
|
var FREE_PLAN = {
|
|
19
|
-
streams: 3,
|
|
20
19
|
subgraphs: 2,
|
|
21
20
|
apiRequestsPerDay: 1000,
|
|
22
21
|
deliveriesPerMonth: 5000,
|
|
@@ -34,5 +33,5 @@ export {
|
|
|
34
33
|
FREE_PLAN
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
//# debugId=
|
|
36
|
+
//# debugId=073DFD0969A0C8D364756E2164756E21
|
|
38
37
|
//# sourceMappingURL=plans.js.map
|