@secondlayer/sdk 0.10.2 → 1.0.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 +1 -22
- package/dist/index.d.ts +195 -55
- package/dist/index.js +143 -89
- package/dist/index.js.map +10 -10
- package/dist/marketplace/index.d.ts +3 -0
- package/dist/marketplace/index.js +22 -4
- package/dist/marketplace/index.js.map +4 -4
- package/dist/subgraphs/index.d.ts +148 -47
- package/dist/subgraphs/index.js +128 -81
- package/dist/subgraphs/index.js.map +8 -9
- package/dist/workflows/index.d.ts +125 -5
- package/dist/workflows/index.js +130 -5
- package/dist/workflows/index.js.map +5 -5
- package/package.json +4 -8
- package/dist/streams/index.d.ts +0 -57
- package/dist/streams/index.js +0 -160
- package/dist/streams/index.js.map +0 -12
package/dist/subgraphs/index.js
CHANGED
|
@@ -1,35 +1,51 @@
|
|
|
1
1
|
// src/errors.ts
|
|
2
2
|
class ApiError extends Error {
|
|
3
3
|
status;
|
|
4
|
-
|
|
4
|
+
body;
|
|
5
|
+
constructor(status, message, body) {
|
|
5
6
|
super(message);
|
|
6
7
|
this.status = status;
|
|
8
|
+
this.body = body;
|
|
7
9
|
this.name = "ApiError";
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
|
|
13
|
+
class VersionConflictError extends ApiError {
|
|
14
|
+
currentVersion;
|
|
15
|
+
expectedVersion;
|
|
16
|
+
constructor(currentVersion, expectedVersion, message = `Version conflict: expected ${expectedVersion}, current ${currentVersion}`) {
|
|
17
|
+
super(409, message, { currentVersion, expectedVersion });
|
|
18
|
+
this.currentVersion = currentVersion;
|
|
19
|
+
this.expectedVersion = expectedVersion;
|
|
20
|
+
this.name = "VersionConflictError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
11
24
|
// src/base.ts
|
|
12
25
|
var DEFAULT_BASE_URL = "https://api.secondlayer.tools";
|
|
13
26
|
|
|
14
27
|
class BaseClient {
|
|
15
28
|
baseUrl;
|
|
16
29
|
apiKey;
|
|
30
|
+
origin;
|
|
17
31
|
constructor(options = {}) {
|
|
18
32
|
this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
19
33
|
this.apiKey = options.apiKey;
|
|
34
|
+
this.origin = options.origin ?? "cli";
|
|
20
35
|
}
|
|
21
36
|
static authHeaders(apiKey) {
|
|
22
37
|
const headers = {
|
|
23
38
|
"Content-Type": "application/json"
|
|
24
39
|
};
|
|
25
40
|
if (apiKey) {
|
|
26
|
-
headers
|
|
41
|
+
headers.Authorization = `Bearer ${apiKey}`;
|
|
27
42
|
}
|
|
28
43
|
return headers;
|
|
29
44
|
}
|
|
30
45
|
async request(method, path, body) {
|
|
31
46
|
const url = `${this.baseUrl}${path}`;
|
|
32
47
|
const headers = BaseClient.authHeaders(this.apiKey);
|
|
48
|
+
headers["x-sl-origin"] = this.origin;
|
|
33
49
|
let response;
|
|
34
50
|
try {
|
|
35
51
|
response = await fetch(url, {
|
|
@@ -54,8 +70,10 @@ class BaseClient {
|
|
|
54
70
|
}
|
|
55
71
|
const errorBody = await response.text();
|
|
56
72
|
let message = `HTTP ${response.status}`;
|
|
73
|
+
let parsedBody = errorBody;
|
|
57
74
|
try {
|
|
58
75
|
const json = JSON.parse(errorBody);
|
|
76
|
+
parsedBody = json;
|
|
59
77
|
const err = json.error ?? json.message;
|
|
60
78
|
if (typeof err === "string") {
|
|
61
79
|
message = err;
|
|
@@ -66,7 +84,7 @@ class BaseClient {
|
|
|
66
84
|
if (errorBody)
|
|
67
85
|
message = errorBody;
|
|
68
86
|
}
|
|
69
|
-
throw new ApiError(response.status, message);
|
|
87
|
+
throw new ApiError(response.status, message, parsedBody);
|
|
70
88
|
}
|
|
71
89
|
if (response.status === 204) {
|
|
72
90
|
return;
|
|
@@ -171,6 +189,12 @@ class Subgraphs extends BaseClient {
|
|
|
171
189
|
async deploy(data) {
|
|
172
190
|
return this.request("POST", "/api/subgraphs", data);
|
|
173
191
|
}
|
|
192
|
+
async getSource(name) {
|
|
193
|
+
return this.request("GET", `/api/subgraphs/${name}/source`);
|
|
194
|
+
}
|
|
195
|
+
async bundle(data) {
|
|
196
|
+
return this.request("POST", "/api/subgraphs/bundle", data);
|
|
197
|
+
}
|
|
174
198
|
async queryTable(name, table, params = {}) {
|
|
175
199
|
const result = await this.request("GET", `/api/subgraphs/${name}/${table}${buildSubgraphQueryString(params)}`);
|
|
176
200
|
return Array.isArray(result) ? result : result.data;
|
|
@@ -281,88 +305,117 @@ class Marketplace extends BaseClient {
|
|
|
281
305
|
}
|
|
282
306
|
}
|
|
283
307
|
|
|
284
|
-
// src/
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
const { streams } = await this.list();
|
|
295
|
-
const matches = streams.filter((s) => s.id.startsWith(partialId));
|
|
296
|
-
if (matches.length === 0) {
|
|
297
|
-
throw new ApiError(404, `No stream found matching "${partialId}"`);
|
|
298
|
-
}
|
|
299
|
-
if (matches.length > 1) {
|
|
300
|
-
throw new ApiError(400, `Multiple streams match "${partialId}": ${matches.map((s) => s.id.slice(0, 8)).join(", ")}`);
|
|
308
|
+
// src/workflows/client.ts
|
|
309
|
+
function parseSseChunk(raw) {
|
|
310
|
+
let event = "message";
|
|
311
|
+
const dataLines = [];
|
|
312
|
+
for (const line of raw.split(`
|
|
313
|
+
`)) {
|
|
314
|
+
if (line.startsWith("event:")) {
|
|
315
|
+
event = line.slice(6).trim();
|
|
316
|
+
} else if (line.startsWith("data:")) {
|
|
317
|
+
dataLines.push(line.slice(5).trimStart());
|
|
301
318
|
}
|
|
302
|
-
return matches[0].id;
|
|
303
|
-
}
|
|
304
|
-
async create(data) {
|
|
305
|
-
return this.request("POST", "/api/streams", data);
|
|
306
319
|
}
|
|
307
|
-
|
|
308
|
-
return
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
if (dataLines.length === 0)
|
|
321
|
+
return null;
|
|
322
|
+
const data = dataLines.join(`
|
|
323
|
+
`);
|
|
324
|
+
try {
|
|
325
|
+
const parsed = JSON.parse(data);
|
|
326
|
+
switch (event) {
|
|
327
|
+
case "step":
|
|
328
|
+
return { type: "step", step: parsed };
|
|
329
|
+
case "done":
|
|
330
|
+
return { type: "done", done: parsed };
|
|
331
|
+
case "heartbeat":
|
|
332
|
+
return {
|
|
333
|
+
type: "heartbeat",
|
|
334
|
+
ts: typeof parsed === "string" ? parsed : String(parsed)
|
|
335
|
+
};
|
|
336
|
+
case "timeout":
|
|
337
|
+
return {
|
|
338
|
+
type: "timeout",
|
|
339
|
+
message: parsed.message ?? "timeout"
|
|
340
|
+
};
|
|
341
|
+
default:
|
|
342
|
+
return null;
|
|
315
343
|
}
|
|
316
|
-
|
|
344
|
+
} catch {
|
|
345
|
+
return null;
|
|
317
346
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
return this.requestWithStreamId("POST", (id2) => `/api/streams/${id2}/enable`, id);
|
|
334
|
-
}
|
|
335
|
-
async disable(id) {
|
|
336
|
-
return this.requestWithStreamId("POST", (id2) => `/api/streams/${id2}/disable`, id);
|
|
337
|
-
}
|
|
338
|
-
async rotateSecret(id) {
|
|
339
|
-
return this.requestWithStreamId("POST", (id2) => `/api/streams/${id2}/rotate-secret`, id);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
class Workflows extends BaseClient {
|
|
350
|
+
async deploy(data) {
|
|
351
|
+
try {
|
|
352
|
+
return await this.request("POST", "/api/workflows", data);
|
|
353
|
+
} catch (err) {
|
|
354
|
+
if (err instanceof ApiError && err.status === 409) {
|
|
355
|
+
const body = err.body;
|
|
356
|
+
if (body?.currentVersion && body.expectedVersion) {
|
|
357
|
+
throw new VersionConflictError(body.currentVersion, body.expectedVersion, err.message);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
throw err;
|
|
361
|
+
}
|
|
340
362
|
}
|
|
341
|
-
async
|
|
342
|
-
|
|
343
|
-
if (params?.limit !== undefined)
|
|
344
|
-
qs.set("limit", String(params.limit));
|
|
345
|
-
if (params?.status)
|
|
346
|
-
qs.set("status", params.status);
|
|
347
|
-
const query = qs.toString();
|
|
348
|
-
return this.requestWithStreamId("GET", (id2) => `/api/streams/${id2}/deliveries${query ? `?${query}` : ""}`, id);
|
|
363
|
+
async getSource(name) {
|
|
364
|
+
return this.request("GET", `/api/workflows/${name}/source`);
|
|
349
365
|
}
|
|
350
|
-
async
|
|
351
|
-
|
|
352
|
-
return this.request("GET", `/api/streams/${fullId}/deliveries/${deliveryId}`);
|
|
366
|
+
async bundle(data) {
|
|
367
|
+
return this.request("POST", "/api/workflows/bundle", data);
|
|
353
368
|
}
|
|
354
369
|
async pauseAll() {
|
|
355
|
-
return this.request("POST", "/api/
|
|
370
|
+
return this.request("POST", "/api/workflows/pause-all");
|
|
356
371
|
}
|
|
357
|
-
async
|
|
358
|
-
return this.request("POST",
|
|
372
|
+
async cancelRun(runId) {
|
|
373
|
+
return this.request("POST", `/api/workflows/runs/${runId}/cancel`);
|
|
359
374
|
}
|
|
360
|
-
|
|
375
|
+
async rollback(name, toVersion) {
|
|
376
|
+
return this.request("POST", `/api/workflows/${name}/rollback`, toVersion ? { toVersion } : {});
|
|
377
|
+
}
|
|
378
|
+
async streamRun(name, runId, onEvent, signal) {
|
|
379
|
+
const url = `${this.baseUrl}/api/workflows/${name}/runs/${runId}/stream`;
|
|
380
|
+
const headers = {
|
|
381
|
+
Accept: "text/event-stream",
|
|
382
|
+
"x-sl-origin": this.origin
|
|
383
|
+
};
|
|
384
|
+
if (this.apiKey) {
|
|
385
|
+
headers.Authorization = `Bearer ${this.apiKey}`;
|
|
386
|
+
}
|
|
387
|
+
const res = await fetch(url, { headers, signal });
|
|
388
|
+
if (!res.ok || !res.body) {
|
|
389
|
+
throw new ApiError(res.status, `Failed to open workflow run stream (HTTP ${res.status})`);
|
|
390
|
+
}
|
|
391
|
+
const reader = res.body.pipeThrough(new TextDecoderStream).getReader();
|
|
392
|
+
let buffer = "";
|
|
393
|
+
while (true) {
|
|
394
|
+
const { value, done } = await reader.read();
|
|
395
|
+
if (done)
|
|
396
|
+
break;
|
|
397
|
+
buffer += value;
|
|
398
|
+
let sep = buffer.indexOf(`
|
|
361
399
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
400
|
+
`);
|
|
401
|
+
while (sep !== -1) {
|
|
402
|
+
const chunk = buffer.slice(0, sep);
|
|
403
|
+
buffer = buffer.slice(sep + 2);
|
|
404
|
+
const parsed = parseSseChunk(chunk);
|
|
405
|
+
if (parsed) {
|
|
406
|
+
onEvent(parsed);
|
|
407
|
+
if (parsed.type === "done" || parsed.type === "timeout") {
|
|
408
|
+
await reader.cancel().catch(() => {
|
|
409
|
+
return;
|
|
410
|
+
});
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
sep = buffer.indexOf(`
|
|
415
|
+
|
|
416
|
+
`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
366
419
|
}
|
|
367
420
|
async list() {
|
|
368
421
|
return this.request("GET", "/api/workflows");
|
|
@@ -398,21 +451,15 @@ class Workflows extends BaseClient {
|
|
|
398
451
|
|
|
399
452
|
// src/client.ts
|
|
400
453
|
class SecondLayer extends BaseClient {
|
|
401
|
-
streams;
|
|
402
454
|
subgraphs;
|
|
403
455
|
marketplace;
|
|
404
456
|
workflows;
|
|
405
457
|
constructor(options = {}) {
|
|
406
458
|
super(options);
|
|
407
|
-
this.streams = new Streams(options);
|
|
408
459
|
this.subgraphs = new Subgraphs(options);
|
|
409
460
|
this.marketplace = new Marketplace(options);
|
|
410
461
|
this.workflows = new Workflows(options);
|
|
411
462
|
}
|
|
412
|
-
async getQueueStats() {
|
|
413
|
-
const status = await this.request("GET", "/status");
|
|
414
|
-
return status.queue;
|
|
415
|
-
}
|
|
416
463
|
}
|
|
417
464
|
|
|
418
465
|
// src/subgraphs/get-subgraph.ts
|
|
@@ -430,5 +477,5 @@ export {
|
|
|
430
477
|
Subgraphs
|
|
431
478
|
};
|
|
432
479
|
|
|
433
|
-
//# debugId=
|
|
480
|
+
//# debugId=7DF9FB71ADB2F65664756E2164756E21
|
|
434
481
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/errors.ts", "../src/base.ts", "../src/subgraphs/serialize.ts", "../src/subgraphs/client.ts", "../src/marketplace/client.ts", "../src/
|
|
3
|
+
"sources": ["../src/errors.ts", "../src/base.ts", "../src/subgraphs/serialize.ts", "../src/subgraphs/client.ts", "../src/marketplace/client.ts", "../src/workflows/client.ts", "../src/client.ts", "../src/subgraphs/get-subgraph.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * Error thrown by {@link SecondLayer} when an API request fails.\n * Includes the HTTP status code for programmatic error handling.\n *\n * @example\n * ```ts\n * try {\n * await client.
|
|
6
|
-
"import { ApiError } from \"./errors.ts\";\n\nexport interface SecondLayerOptions {\n\t/** Base URL of the Secondlayer API (trailing slashes are stripped). */\n\tbaseUrl: string;\n\t/** Bearer token for authenticated requests. */\n\tapiKey?: string;\n}\n\nconst DEFAULT_BASE_URL = \"https://api.secondlayer.tools\";\n\nexport abstract class BaseClient {\n\tprotected baseUrl: string;\n\tprotected apiKey?: string;\n\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tthis.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n\t\tthis.apiKey = options.apiKey;\n\t}\n\n\tstatic authHeaders(apiKey?: string): Record<string, string> {\n\t\tconst headers: Record<string, string> = {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t};\n\t\tif (apiKey) {\n\t\t\theaders
|
|
5
|
+
"/**\n * Error thrown by {@link SecondLayer} when an API request fails.\n * Includes the HTTP status code for programmatic error handling.\n *\n * @example\n * ```ts\n * try {\n * await client.subgraphs.get(\"my-subgraph\");\n * } catch (err) {\n * if (err instanceof ApiError && err.status === 404) {\n * console.log(\"Subgraph not found\");\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n\tconstructor(\n\t\t/** HTTP status code (0 for network errors). */\n\t\tpublic status: number,\n\t\tmessage: string,\n\t\t/** Raw response body (parsed JSON if possible) — preserved for callers that need error details. */\n\t\tpublic body?: unknown,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"ApiError\";\n\t}\n}\n\n/**\n * Thrown by {@link Workflows.deploy} when the server rejects a deploy because the\n * provided `expectedVersion` does not match the current stored version.\n */\nexport class VersionConflictError extends ApiError {\n\tconstructor(\n\t\tpublic currentVersion: string,\n\t\tpublic expectedVersion: string,\n\t\tmessage = `Version conflict: expected ${expectedVersion}, current ${currentVersion}`,\n\t) {\n\t\tsuper(409, message, { currentVersion, expectedVersion });\n\t\tthis.name = \"VersionConflictError\";\n\t}\n}\n",
|
|
6
|
+
"import { ApiError } from \"./errors.ts\";\n\nexport interface SecondLayerOptions {\n\t/** Base URL of the Secondlayer API (trailing slashes are stripped). */\n\tbaseUrl: string;\n\t/** Bearer token for authenticated requests. */\n\tapiKey?: string;\n\t/** Deploy origin label sent as `x-sl-origin` (telemetry). Defaults to `cli`. */\n\torigin?: \"cli\" | \"mcp\" | \"session\";\n}\n\nconst DEFAULT_BASE_URL = \"https://api.secondlayer.tools\";\n\nexport abstract class BaseClient {\n\tprotected baseUrl: string;\n\tprotected apiKey?: string;\n\tprotected origin: \"cli\" | \"mcp\" | \"session\";\n\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tthis.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/+$/, \"\");\n\t\tthis.apiKey = options.apiKey;\n\t\tthis.origin = options.origin ?? \"cli\";\n\t}\n\n\tstatic authHeaders(apiKey?: string): Record<string, string> {\n\t\tconst headers: Record<string, string> = {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t};\n\t\tif (apiKey) {\n\t\t\theaders.Authorization = `Bearer ${apiKey}`;\n\t\t}\n\t\treturn headers;\n\t}\n\n\tprotected async request<T>(\n\t\tmethod: string,\n\t\tpath: string,\n\t\tbody?: unknown,\n\t): Promise<T> {\n\t\tconst url = `${this.baseUrl}${path}`;\n\t\tconst headers = BaseClient.authHeaders(this.apiKey);\n\t\theaders[\"x-sl-origin\"] = this.origin;\n\n\t\tlet response: Response;\n\t\ttry {\n\t\t\tresponse = await fetch(url, {\n\t\t\t\tmethod,\n\t\t\t\theaders,\n\t\t\t\tbody: body ? JSON.stringify(body) : undefined,\n\t\t\t});\n\t\t} catch {\n\t\t\tthrow new ApiError(\n\t\t\t\t0,\n\t\t\t\t`Cannot reach API at ${this.baseUrl}. Check your connection or try again.`,\n\t\t\t);\n\t\t}\n\n\t\tif (!response.ok) {\n\t\t\tif (response.status === 401) {\n\t\t\t\tthrow new ApiError(401, \"API key invalid or expired.\");\n\t\t\t}\n\n\t\t\tif (response.status === 429) {\n\t\t\t\tconst retryAfter = response.headers.get(\"Retry-After\");\n\t\t\t\tconst msg = retryAfter\n\t\t\t\t\t? `Rate limited. Wait ${retryAfter} seconds.`\n\t\t\t\t\t: \"Rate limited. Try again later.\";\n\t\t\t\tthrow new ApiError(429, msg);\n\t\t\t}\n\n\t\t\tif (response.status >= 500) {\n\t\t\t\tthrow new ApiError(\n\t\t\t\t\tresponse.status,\n\t\t\t\t\t`Server error. Try again or check status at ${this.baseUrl}/health`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst errorBody = await response.text();\n\t\t\tlet message = `HTTP ${response.status}`;\n\t\t\tlet parsedBody: unknown = errorBody;\n\t\t\ttry {\n\t\t\t\tconst json = JSON.parse(errorBody);\n\t\t\t\tparsedBody = json;\n\t\t\t\tconst err = json.error ?? json.message;\n\t\t\t\tif (typeof err === \"string\") {\n\t\t\t\t\tmessage = err;\n\t\t\t\t} else if (err && typeof err === \"object\") {\n\t\t\t\t\tmessage = JSON.stringify(err);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\tif (errorBody) message = errorBody;\n\t\t\t}\n\t\t\tthrow new ApiError(response.status, message, parsedBody);\n\t\t}\n\n\t\tif (response.status === 204) {\n\t\t\treturn undefined as T;\n\t\t}\n\n\t\treturn response.json() as Promise<T>;\n\t}\n}\n",
|
|
7
7
|
"/**\n * Maps camelCase system column names (with or without `_` prefix) to the\n * actual snake_case DB column names used in query params.\n */\nconst SYSTEM_COLUMN_MAP: Record<string, string> = {\n\t// underscore-prefixed camelCase (canonical row shape)\n\t_blockHeight: \"_block_height\",\n\t_txId: \"_tx_id\",\n\t_createdAt: \"_created_at\",\n\t_id: \"_id\",\n\t// no-prefix aliases\n\tblockHeight: \"_block_height\",\n\ttxId: \"_tx_id\",\n\tcreatedAt: \"_created_at\",\n\tid: \"_id\",\n};\n\nfunction resolveColumn(col: string): string {\n\treturn SYSTEM_COLUMN_MAP[col] ?? col;\n}\n\n/**\n * Serializes a WhereInput object into the flat filter map expected by\n * SubgraphQueryParams.filters (and the REST API query string).\n *\n * Scalar values → `{ column: \"value\" }`\n * Comparison objects → `{ \"column.gte\": \"100\", \"column.lt\": \"200\" }`\n * System column aliases → `blockHeight` / `_blockHeight` both → `_block_height`\n */\nexport function serializeWhere(\n\twhere: Record<string, unknown>,\n): Record<string, string> {\n\tconst filters: Record<string, string> = {};\n\n\tfor (const [column, value] of Object.entries(where)) {\n\t\tif (value === null || value === undefined) continue;\n\n\t\tconst col = resolveColumn(column);\n\n\t\tif (typeof value === \"object\" && !Array.isArray(value)) {\n\t\t\tconst ops = value as Record<string, unknown>;\n\t\t\tfor (const [op, opValue] of Object.entries(ops)) {\n\t\t\t\tif (opValue === null || opValue === undefined) continue;\n\t\t\t\tif (op === \"eq\") {\n\t\t\t\t\tfilters[col] = String(opValue);\n\t\t\t\t} else if ([\"neq\", \"gt\", \"gte\", \"lt\", \"lte\"].includes(op)) {\n\t\t\t\t\tfilters[`${col}.${op}`] = String(opValue);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfilters[col] = String(value);\n\t\t}\n\t}\n\n\treturn filters;\n}\n\n/**\n * Resolves an orderBy column name (either alias or canonical) to the DB column name.\n */\nexport function resolveOrderByColumn(col: string): string {\n\treturn resolveColumn(col);\n}\n",
|
|
8
|
-
"import type {\n\tReindexResponse,\n\tSubgraphDetail,\n\tSubgraphGapsResponse,\n\tSubgraphQueryParams,\n\tSubgraphSummary,\n} from \"@secondlayer/shared/schemas\";\nimport type {\n\tDeploySubgraphRequest,\n\tDeploySubgraphResponse,\n} from \"@secondlayer/shared/schemas/subgraphs\";\nimport type {\n\tFindManyOptions,\n\tInferSubgraphClient,\n\tWhereInput,\n} from \"@secondlayer/subgraphs\";\nimport { BaseClient } from \"../base.ts\";\nimport { resolveOrderByColumn, serializeWhere } from \"./serialize.ts\";\n\nfunction buildSubgraphQueryString(params: SubgraphQueryParams): string {\n\tconst qs = new URLSearchParams();\n\tif (params.sort) qs.set(\"_sort\", params.sort);\n\tif (params.order) qs.set(\"_order\", params.order);\n\tif (params.limit !== undefined) qs.set(\"_limit\", String(params.limit));\n\tif (params.offset !== undefined) qs.set(\"_offset\", String(params.offset));\n\tif (params.fields) qs.set(\"_fields\", params.fields);\n\tif (params.filters) {\n\t\tfor (const [key, value] of Object.entries(params.filters)) {\n\t\t\tqs.set(key, String(value));\n\t\t}\n\t}\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nexport class Subgraphs extends BaseClient {\n\tasync list(): Promise<{ data: SubgraphSummary[] }> {\n\t\treturn this.request<{ data: SubgraphSummary[] }>(\"GET\", \"/api/subgraphs\");\n\t}\n\n\tasync get(name: string): Promise<SubgraphDetail> {\n\t\treturn this.request<SubgraphDetail>(\"GET\", `/api/subgraphs/${name}`);\n\t}\n\n\tasync reindex(\n\t\tname: string,\n\t\toptions?: { fromBlock?: number; toBlock?: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/reindex`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync stop(name: string): Promise<{ message: string }> {\n\t\treturn this.request<{ message: string }>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/stop`,\n\t\t);\n\t}\n\n\tasync backfill(\n\t\tname: string,\n\t\toptions: { fromBlock: number; toBlock: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/backfill`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync gaps(\n\t\tname: string,\n\t\topts?: { limit?: number; offset?: number; resolved?: boolean },\n\t): Promise<SubgraphGapsResponse> {\n\t\tconst qs = new URLSearchParams();\n\t\tif (opts?.limit !== undefined) qs.set(\"_limit\", String(opts.limit));\n\t\tif (opts?.offset !== undefined) qs.set(\"_offset\", String(opts.offset));\n\t\tif (opts?.resolved !== undefined) qs.set(\"resolved\", String(opts.resolved));\n\t\tconst query = qs.toString();\n\t\treturn this.request<SubgraphGapsResponse>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/gaps${query ? `?${query}` : \"\"}`,\n\t\t);\n\t}\n\n\tasync delete(name: string): Promise<{ message: string }> {\n\t\treturn this.request<{ message: string }>(\n\t\t\t\"DELETE\",\n\t\t\t`/api/subgraphs/${name}`,\n\t\t);\n\t}\n\n\tasync deploy(data: DeploySubgraphRequest): Promise<DeploySubgraphResponse> {\n\t\treturn this.request<DeploySubgraphResponse>(\"POST\", \"/api/subgraphs\", data);\n\t}\n\n\tasync queryTable(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<unknown[]> {\n\t\tconst result = await this.request<{ data: unknown[] } | unknown[]>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}${buildSubgraphQueryString(params)}`,\n\t\t);\n\t\treturn Array.isArray(result) ? result : result.data;\n\t}\n\n\tasync queryTableCount(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<{ count: number }> {\n\t\treturn this.request<{ count: number }>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}/count${buildSubgraphQueryString(params)}`,\n\t\t);\n\t}\n\n\t/**\n\t * Returns a typed client for a subgraph defined with `defineSubgraph()`.\n\t * Row types are inferred from the subgraph's schema literal types.\n\t *\n\t * @example\n\t * ```ts\n\t * import mySubgraph from './subgraphs/my-token-subgraph'\n\t * const client = sl.subgraphs.typed(mySubgraph)\n\t * const rows = await client.transfers.findMany({ where: { sender: 'SP...' } })\n\t * // rows: InferTableRow<typeof mySubgraph.schema.transfers>[]\n\t * ```\n\t */\n\ttyped<T extends { name: string; schema: Record<string, unknown> }>(\n\t\tdef: T,\n\t): InferSubgraphClient<T> {\n\t\tconst result: Record<string, unknown> = {};\n\n\t\tfor (const tableName of Object.keys(def.schema)) {\n\t\t\tresult[tableName] = this.createTableClient(def.name, tableName);\n\t\t}\n\n\t\treturn result as InferSubgraphClient<T>;\n\t}\n\n\tprivate createTableClient(subgraphName: string, tableName: string) {\n\t\tconst self = this;\n\n\t\treturn {\n\t\t\tasync findMany<TRow>(\n\t\t\t\toptions: FindManyOptions<TRow> = {},\n\t\t\t): Promise<TRow[]> {\n\t\t\t\tconst filters = options.where\n\t\t\t\t\t? serializeWhere(options.where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tlet sort: string | undefined;\n\t\t\t\tlet order: string | undefined;\n\t\t\t\tif (options.orderBy) {\n\t\t\t\t\tconst entries = Object.entries(options.orderBy) as [\n\t\t\t\t\t\tstring,\n\t\t\t\t\t\t\"asc\" | \"desc\",\n\t\t\t\t\t][];\n\t\t\t\t\tif (entries.length > 0) {\n\t\t\t\t\t\tif (entries.length > 1) {\n\t\t\t\t\t\t\tconst extra = entries\n\t\t\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t\t\t.map(([col]) => col)\n\t\t\t\t\t\t\t\t.join(\", \");\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`orderBy supports only one column; remove extra keys: ${extra}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [col, dir] = entries[0]!;\n\t\t\t\t\t\tsort = resolveOrderByColumn(col);\n\t\t\t\t\t\torder = dir ?? \"asc\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst params: SubgraphQueryParams = {\n\t\t\t\t\tsort,\n\t\t\t\t\torder,\n\t\t\t\t\tlimit: options.limit,\n\t\t\t\t\toffset: options.offset,\n\t\t\t\t\tfields: options.fields?.join(\",\"),\n\t\t\t\t\tfilters,\n\t\t\t\t};\n\n\t\t\t\treturn self.queryTable(subgraphName, tableName, params) as Promise<\n\t\t\t\t\tTRow[]\n\t\t\t\t>;\n\t\t\t},\n\n\t\t\tasync count<TRow>(where?: WhereInput<TRow>): Promise<number> {\n\t\t\t\tconst filters = where\n\t\t\t\t\t? serializeWhere(where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tconst result = await self.queryTableCount(subgraphName, tableName, {\n\t\t\t\t\tfilters,\n\t\t\t\t});\n\t\t\t\treturn result.count;\n\t\t\t},\n\t\t};\n\t}\n}\n",
|
|
8
|
+
"import type {\n\tReindexResponse,\n\tSubgraphDetail,\n\tSubgraphGapsResponse,\n\tSubgraphQueryParams,\n\tSubgraphSummary,\n} from \"@secondlayer/shared/schemas\";\nimport type {\n\tDeploySubgraphRequest,\n\tDeploySubgraphResponse,\n} from \"@secondlayer/shared/schemas/subgraphs\";\nimport type {\n\tFindManyOptions,\n\tInferSubgraphClient,\n\tWhereInput,\n} from \"@secondlayer/subgraphs\";\nimport { BaseClient } from \"../base.ts\";\nimport { resolveOrderByColumn, serializeWhere } from \"./serialize.ts\";\n\nexport interface SubgraphSource {\n\tname: string;\n\tversion: string;\n\tsourceCode: string | null;\n\treadOnly: boolean;\n\treason?: string;\n\tupdatedAt: string;\n}\n\nexport interface BundleSubgraphResponse {\n\tok: true;\n\tname: string;\n\tversion: string | null;\n\tdescription: string | null;\n\tsources: Record<string, Record<string, unknown>>;\n\tschema: Record<string, unknown>;\n\thandlerCode: string;\n\tsourceCode: string;\n\tbundleSize: number;\n}\n\nfunction buildSubgraphQueryString(params: SubgraphQueryParams): string {\n\tconst qs = new URLSearchParams();\n\tif (params.sort) qs.set(\"_sort\", params.sort);\n\tif (params.order) qs.set(\"_order\", params.order);\n\tif (params.limit !== undefined) qs.set(\"_limit\", String(params.limit));\n\tif (params.offset !== undefined) qs.set(\"_offset\", String(params.offset));\n\tif (params.fields) qs.set(\"_fields\", params.fields);\n\tif (params.filters) {\n\t\tfor (const [key, value] of Object.entries(params.filters)) {\n\t\t\tqs.set(key, String(value));\n\t\t}\n\t}\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nexport class Subgraphs extends BaseClient {\n\tasync list(): Promise<{ data: SubgraphSummary[] }> {\n\t\treturn this.request<{ data: SubgraphSummary[] }>(\"GET\", \"/api/subgraphs\");\n\t}\n\n\tasync get(name: string): Promise<SubgraphDetail> {\n\t\treturn this.request<SubgraphDetail>(\"GET\", `/api/subgraphs/${name}`);\n\t}\n\n\tasync reindex(\n\t\tname: string,\n\t\toptions?: { fromBlock?: number; toBlock?: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/reindex`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync stop(name: string): Promise<{ message: string }> {\n\t\treturn this.request<{ message: string }>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/stop`,\n\t\t);\n\t}\n\n\tasync backfill(\n\t\tname: string,\n\t\toptions: { fromBlock: number; toBlock: number },\n\t): Promise<ReindexResponse> {\n\t\treturn this.request<ReindexResponse>(\n\t\t\t\"POST\",\n\t\t\t`/api/subgraphs/${name}/backfill`,\n\t\t\toptions,\n\t\t);\n\t}\n\n\tasync gaps(\n\t\tname: string,\n\t\topts?: { limit?: number; offset?: number; resolved?: boolean },\n\t): Promise<SubgraphGapsResponse> {\n\t\tconst qs = new URLSearchParams();\n\t\tif (opts?.limit !== undefined) qs.set(\"_limit\", String(opts.limit));\n\t\tif (opts?.offset !== undefined) qs.set(\"_offset\", String(opts.offset));\n\t\tif (opts?.resolved !== undefined) qs.set(\"resolved\", String(opts.resolved));\n\t\tconst query = qs.toString();\n\t\treturn this.request<SubgraphGapsResponse>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/gaps${query ? `?${query}` : \"\"}`,\n\t\t);\n\t}\n\n\tasync delete(name: string): Promise<{ message: string }> {\n\t\treturn this.request<{ message: string }>(\n\t\t\t\"DELETE\",\n\t\t\t`/api/subgraphs/${name}`,\n\t\t);\n\t}\n\n\tasync deploy(data: DeploySubgraphRequest): Promise<DeploySubgraphResponse> {\n\t\treturn this.request<DeploySubgraphResponse>(\"POST\", \"/api/subgraphs\", data);\n\t}\n\n\tasync getSource(name: string): Promise<SubgraphSource> {\n\t\treturn this.request<SubgraphSource>(\"GET\", `/api/subgraphs/${name}/source`);\n\t}\n\n\t/**\n\t * Bundle a TypeScript subgraph source on the server. Used by the web chat\n\t * authoring loop so Vercel's serverless runtime doesn't have to run esbuild.\n\t */\n\tasync bundle(data: { code: string }): Promise<BundleSubgraphResponse> {\n\t\treturn this.request<BundleSubgraphResponse>(\n\t\t\t\"POST\",\n\t\t\t\"/api/subgraphs/bundle\",\n\t\t\tdata,\n\t\t);\n\t}\n\n\tasync queryTable(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<unknown[]> {\n\t\tconst result = await this.request<{ data: unknown[] } | unknown[]>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}${buildSubgraphQueryString(params)}`,\n\t\t);\n\t\treturn Array.isArray(result) ? result : result.data;\n\t}\n\n\tasync queryTableCount(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<{ count: number }> {\n\t\treturn this.request<{ count: number }>(\n\t\t\t\"GET\",\n\t\t\t`/api/subgraphs/${name}/${table}/count${buildSubgraphQueryString(params)}`,\n\t\t);\n\t}\n\n\t/**\n\t * Returns a typed client for a subgraph defined with `defineSubgraph()`.\n\t * Row types are inferred from the subgraph's schema literal types.\n\t *\n\t * @example\n\t * ```ts\n\t * import mySubgraph from './subgraphs/my-token-subgraph'\n\t * const client = sl.subgraphs.typed(mySubgraph)\n\t * const rows = await client.transfers.findMany({ where: { sender: 'SP...' } })\n\t * // rows: InferTableRow<typeof mySubgraph.schema.transfers>[]\n\t * ```\n\t */\n\ttyped<T extends { name: string; schema: Record<string, unknown> }>(\n\t\tdef: T,\n\t): InferSubgraphClient<T> {\n\t\tconst result: Record<string, unknown> = {};\n\n\t\tfor (const tableName of Object.keys(def.schema)) {\n\t\t\tresult[tableName] = this.createTableClient(def.name, tableName);\n\t\t}\n\n\t\treturn result as InferSubgraphClient<T>;\n\t}\n\n\tprivate createTableClient(subgraphName: string, tableName: string) {\n\t\tconst self = this;\n\n\t\treturn {\n\t\t\tasync findMany<TRow>(\n\t\t\t\toptions: FindManyOptions<TRow> = {},\n\t\t\t): Promise<TRow[]> {\n\t\t\t\tconst filters = options.where\n\t\t\t\t\t? serializeWhere(options.where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tlet sort: string | undefined;\n\t\t\t\tlet order: string | undefined;\n\t\t\t\tif (options.orderBy) {\n\t\t\t\t\tconst entries = Object.entries(options.orderBy) as [\n\t\t\t\t\t\tstring,\n\t\t\t\t\t\t\"asc\" | \"desc\",\n\t\t\t\t\t][];\n\t\t\t\t\tif (entries.length > 0) {\n\t\t\t\t\t\tif (entries.length > 1) {\n\t\t\t\t\t\t\tconst extra = entries\n\t\t\t\t\t\t\t\t.slice(1)\n\t\t\t\t\t\t\t\t.map(([col]) => col)\n\t\t\t\t\t\t\t\t.join(\", \");\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t`orderBy supports only one column; remove extra keys: ${extra}`,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [col, dir] = entries[0]!;\n\t\t\t\t\t\tsort = resolveOrderByColumn(col);\n\t\t\t\t\t\torder = dir ?? \"asc\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst params: SubgraphQueryParams = {\n\t\t\t\t\tsort,\n\t\t\t\t\torder,\n\t\t\t\t\tlimit: options.limit,\n\t\t\t\t\toffset: options.offset,\n\t\t\t\t\tfields: options.fields?.join(\",\"),\n\t\t\t\t\tfilters,\n\t\t\t\t};\n\n\t\t\t\treturn self.queryTable(subgraphName, tableName, params) as Promise<\n\t\t\t\t\tTRow[]\n\t\t\t\t>;\n\t\t\t},\n\n\t\t\tasync count<TRow>(where?: WhereInput<TRow>): Promise<number> {\n\t\t\t\tconst filters = where\n\t\t\t\t\t? serializeWhere(where as Record<string, unknown>)\n\t\t\t\t\t: undefined;\n\n\t\t\t\tconst result = await self.queryTableCount(subgraphName, tableName, {\n\t\t\t\t\tfilters,\n\t\t\t\t});\n\t\t\t\treturn result.count;\n\t\t\t},\n\t\t};\n\t}\n}\n",
|
|
9
9
|
"import type {\n\tCreatorProfile,\n\tMarketplaceSubgraphDetail,\n\tMarketplaceSubgraphSummary,\n\tSubgraphQueryParams,\n} from \"@secondlayer/shared/schemas\";\nimport { BaseClient } from \"../base.ts\";\n\nexport interface MarketplaceBrowseOptions {\n\ttags?: string[];\n\tsearch?: string;\n\tsort?: \"recent\" | \"popular\" | \"name\";\n\tlimit?: number;\n\toffset?: number;\n}\n\nfunction buildMarketplaceQuery(opts: MarketplaceBrowseOptions): string {\n\tconst qs = new URLSearchParams();\n\tif (opts.tags?.length) qs.set(\"tags\", opts.tags.join(\",\"));\n\tif (opts.search) qs.set(\"search\", opts.search);\n\tif (opts.sort) qs.set(\"_sort\", opts.sort);\n\tif (opts.limit !== undefined) qs.set(\"_limit\", String(opts.limit));\n\tif (opts.offset !== undefined) qs.set(\"_offset\", String(opts.offset));\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nfunction buildSubgraphQueryString(params: SubgraphQueryParams): string {\n\tconst qs = new URLSearchParams();\n\tif (params.sort) qs.set(\"_sort\", params.sort);\n\tif (params.order) qs.set(\"_order\", params.order);\n\tif (params.limit !== undefined) qs.set(\"_limit\", String(params.limit));\n\tif (params.offset !== undefined) qs.set(\"_offset\", String(params.offset));\n\tif (params.fields) qs.set(\"_fields\", params.fields);\n\tif (params.filters) {\n\t\tfor (const [key, value] of Object.entries(params.filters)) {\n\t\t\tqs.set(key, String(value));\n\t\t}\n\t}\n\tconst str = qs.toString();\n\treturn str ? `?${str}` : \"\";\n}\n\nexport class Marketplace extends BaseClient {\n\tasync browse(\n\t\topts: MarketplaceBrowseOptions = {},\n\t): Promise<{\n\t\tdata: MarketplaceSubgraphSummary[];\n\t\tmeta: { total: number; limit: number; offset: number };\n\t}> {\n\t\treturn this.request(\"GET\", `/api/marketplace/subgraphs${buildMarketplaceQuery(opts)}`);\n\t}\n\n\tasync get(name: string): Promise<MarketplaceSubgraphDetail> {\n\t\treturn this.request(\"GET\", `/api/marketplace/subgraphs/${name}`);\n\t}\n\n\tasync creator(slug: string): Promise<CreatorProfile> {\n\t\treturn this.request(\"GET\", `/api/marketplace/creators/${slug}`);\n\t}\n\n\tasync fork(\n\t\tname: string,\n\t\tnewName?: string,\n\t): Promise<{\n\t\taction: string;\n\t\tsubgraphId: string;\n\t\tname: string;\n\t\tforkedFrom: string;\n\t}> {\n\t\treturn this.request(\"POST\", `/api/marketplace/subgraphs/${name}/fork`, {\n\t\t\tnewName,\n\t\t});\n\t}\n\n\tasync queryTable(\n\t\tname: string,\n\t\ttable: string,\n\t\tparams: SubgraphQueryParams = {},\n\t): Promise<{\n\t\tdata: unknown[];\n\t\tmeta: { total: number; limit: number; offset: number };\n\t}> {\n\t\treturn this.request(\n\t\t\t\"GET\",\n\t\t\t`/api/marketplace/subgraphs/${name}/${table}${buildSubgraphQueryString(params)}`,\n\t\t);\n\t}\n}\n",
|
|
10
|
-
"import type {
|
|
11
|
-
"import
|
|
12
|
-
"import type { QueueStats } from \"@secondlayer/shared/types\";\nimport { BaseClient } from \"./base.ts\";\nimport type { SecondLayerOptions } from \"./base.ts\";\nimport { Marketplace } from \"./marketplace/client.ts\";\nimport { Streams } from \"./streams/client.ts\";\nimport { Subgraphs } from \"./subgraphs/client.ts\";\nimport { Workflows } from \"./workflows/client.ts\";\n\nexport class SecondLayer extends BaseClient {\n\treadonly streams: Streams;\n\treadonly subgraphs: Subgraphs;\n\treadonly marketplace: Marketplace;\n\treadonly workflows: Workflows;\n\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t\tthis.streams = new Streams(options);\n\t\tthis.subgraphs = new Subgraphs(options);\n\t\tthis.marketplace = new Marketplace(options);\n\t\tthis.workflows = new Workflows(options);\n\t}\n\n\tasync getQueueStats(): Promise<QueueStats> {\n\t\tconst status = await this.request<{ queue: QueueStats }>(\"GET\", \"/status\");\n\t\treturn status.queue;\n\t}\n}\n",
|
|
10
|
+
"import type { WorkflowRun, WorkflowRunStatus } from \"@secondlayer/workflows\";\nimport { BaseClient } from \"../base.ts\";\nimport { ApiError, VersionConflictError } from \"../errors.ts\";\n\nfunction parseSseChunk(raw: string): WorkflowTailEvent | null {\n\tlet event = \"message\";\n\tconst dataLines: string[] = [];\n\tfor (const line of raw.split(\"\\n\")) {\n\t\tif (line.startsWith(\"event:\")) {\n\t\t\tevent = line.slice(6).trim();\n\t\t} else if (line.startsWith(\"data:\")) {\n\t\t\tdataLines.push(line.slice(5).trimStart());\n\t\t}\n\t}\n\tif (dataLines.length === 0) return null;\n\tconst data = dataLines.join(\"\\n\");\n\ttry {\n\t\tconst parsed = JSON.parse(data);\n\t\tswitch (event) {\n\t\t\tcase \"step\":\n\t\t\t\treturn { type: \"step\", step: parsed as WorkflowStepEvent };\n\t\t\tcase \"done\":\n\t\t\t\treturn { type: \"done\", done: parsed as WorkflowRunDoneEvent };\n\t\t\tcase \"heartbeat\":\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"heartbeat\",\n\t\t\t\t\tts: typeof parsed === \"string\" ? parsed : String(parsed),\n\t\t\t\t};\n\t\t\tcase \"timeout\":\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"timeout\",\n\t\t\t\t\tmessage: (parsed as { message?: string }).message ?? \"timeout\",\n\t\t\t\t};\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport interface WorkflowSource {\n\tname: string;\n\tversion: string;\n\tsourceCode: string | null;\n\treadOnly: boolean;\n\treason?: string;\n\tupdatedAt: string;\n}\n\nexport interface WorkflowStepEvent {\n\tid: string;\n\tstepIndex: number;\n\tstepId: string;\n\tstepType: string;\n\tstatus: string;\n\toutput?: unknown;\n\terror: string | null;\n\tretryCount: number;\n\taiTokensUsed: number;\n\tstartedAt: string | null;\n\tcompletedAt: string | null;\n\tdurationMs: number | null;\n\tts: string;\n}\n\nexport interface WorkflowRunDoneEvent {\n\trunId: string;\n\tstatus: string;\n\terror?: string | null;\n\tcompletedAt?: string | null;\n}\n\nexport type WorkflowTailEvent =\n\t| { type: \"step\"; step: WorkflowStepEvent }\n\t| { type: \"done\"; done: WorkflowRunDoneEvent }\n\t| { type: \"heartbeat\"; ts: string }\n\t| { type: \"timeout\"; message: string };\n\nexport interface DeployDryRunResponse {\n\tvalid: boolean;\n\tvalidation?: { name: string; triggerType: string };\n\tbundleSize: number;\n\terror?: string;\n}\n\nexport interface DeployResponse {\n\taction: \"created\" | \"updated\";\n\tworkflowId: string;\n\tversion: string;\n\tmessage: string;\n}\n\nexport interface BundleWorkflowResponse {\n\tok: true;\n\tname: string;\n\ttrigger: Record<string, unknown>;\n\thandlerCode: string;\n\tsourceCode: string;\n\tretries: Record<string, unknown> | null;\n\ttimeout: number | null;\n\tbundleSize: number;\n}\n\nexport interface WorkflowSummary {\n\tname: string;\n\tstatus: \"active\" | \"paused\";\n\ttriggerType: \"event\" | \"schedule\" | \"manual\";\n\tcreatedAt: string;\n\tupdatedAt: string;\n}\n\nexport interface WorkflowDetail extends WorkflowSummary {\n\ttrigger: Record<string, unknown>;\n\tretries?: { maxAttempts?: number; backoffMs?: number };\n\ttimeout?: number;\n\ttotalRuns: number;\n\tlastRunAt: string | null;\n}\n\nexport interface WorkflowRunSummary {\n\tid: string;\n\tworkflowName: string;\n\tstatus: WorkflowRunStatus;\n\tduration: number;\n\taiTokensUsed: number;\n\ttriggeredAt: string;\n\tcompletedAt: string | null;\n}\n\nexport class Workflows extends BaseClient {\n\tasync deploy(\n\t\tdata: {\n\t\t\tname: string;\n\t\t\ttrigger: Record<string, unknown>;\n\t\t\thandlerCode: string;\n\t\t\tsourceCode?: string;\n\t\t\texpectedVersion?: string;\n\t\t\tretries?: Record<string, unknown>;\n\t\t\ttimeout?: number;\n\t\t\tclientRequestId?: string;\n\t\t} & { dryRun?: false },\n\t): Promise<DeployResponse>;\n\tasync deploy(data: {\n\t\tname: string;\n\t\ttrigger: Record<string, unknown>;\n\t\thandlerCode: string;\n\t\tsourceCode?: string;\n\t\texpectedVersion?: string;\n\t\tretries?: Record<string, unknown>;\n\t\ttimeout?: number;\n\t\tdryRun: true;\n\t}): Promise<DeployDryRunResponse>;\n\tasync deploy(data: {\n\t\tname: string;\n\t\ttrigger: Record<string, unknown>;\n\t\thandlerCode: string;\n\t\tsourceCode?: string;\n\t\texpectedVersion?: string;\n\t\tdryRun?: boolean;\n\t\tclientRequestId?: string;\n\t\tretries?: Record<string, unknown>;\n\t\ttimeout?: number;\n\t}): Promise<DeployResponse | DeployDryRunResponse> {\n\t\ttry {\n\t\t\treturn await this.request(\"POST\", \"/api/workflows\", data);\n\t\t} catch (err) {\n\t\t\tif (err instanceof ApiError && err.status === 409) {\n\t\t\t\tconst body = err.body as\n\t\t\t\t\t| { currentVersion?: string; expectedVersion?: string }\n\t\t\t\t\t| undefined;\n\t\t\t\tif (body?.currentVersion && body.expectedVersion) {\n\t\t\t\t\tthrow new VersionConflictError(\n\t\t\t\t\t\tbody.currentVersion,\n\t\t\t\t\t\tbody.expectedVersion,\n\t\t\t\t\t\terr.message,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tasync getSource(name: string): Promise<WorkflowSource> {\n\t\treturn this.request(\"GET\", `/api/workflows/${name}/source`);\n\t}\n\n\t/**\n\t * Bundle a TypeScript workflow source on the server. Used by the web chat\n\t * authoring loop so Vercel's serverless runtime doesn't have to run esbuild.\n\t * CLI and MCP still bundle locally — this method is for clients that can't\n\t * install `@secondlayer/bundler` directly (e.g. browser tooling, edge\n\t * functions).\n\t */\n\tasync bundle(data: { code: string }): Promise<BundleWorkflowResponse> {\n\t\treturn this.request(\"POST\", \"/api/workflows/bundle\", data);\n\t}\n\n\tasync pauseAll(): Promise<{\n\t\tpaused: number;\n\t\tworkflows: Array<{ name: string; version: string; status: string }>;\n\t}> {\n\t\treturn this.request(\"POST\", \"/api/workflows/pause-all\");\n\t}\n\n\tasync cancelRun(runId: string): Promise<{\n\t\trunId: string;\n\t\tstatus: string;\n\t\tcancelled: boolean;\n\t\tcompletedAt?: string;\n\t\tmessage?: string;\n\t}> {\n\t\treturn this.request(\"POST\", `/api/workflows/runs/${runId}/cancel`);\n\t}\n\n\tasync rollback(\n\t\tname: string,\n\t\ttoVersion?: string,\n\t): Promise<{\n\t\taction: \"rolled-back\";\n\t\tname: string;\n\t\tfromVersion: string;\n\t\trestoredFromVersion: string;\n\t\tversion: string;\n\t}> {\n\t\treturn this.request(\n\t\t\t\"POST\",\n\t\t\t`/api/workflows/${name}/rollback`,\n\t\t\ttoVersion ? { toVersion } : {},\n\t\t);\n\t}\n\n\t/**\n\t * Subscribe to a workflow run's server-sent event stream. Resolves when the\n\t * run completes, times out, or the signal is aborted. Throws on HTTP errors\n\t * opening the stream.\n\t */\n\tasync streamRun(\n\t\tname: string,\n\t\trunId: string,\n\t\tonEvent: (event: WorkflowTailEvent) => void,\n\t\tsignal?: AbortSignal,\n\t): Promise<void> {\n\t\tconst url = `${this.baseUrl}/api/workflows/${name}/runs/${runId}/stream`;\n\t\tconst headers: Record<string, string> = {\n\t\t\tAccept: \"text/event-stream\",\n\t\t\t\"x-sl-origin\": this.origin,\n\t\t};\n\t\tif (this.apiKey) {\n\t\t\theaders.Authorization = `Bearer ${this.apiKey}`;\n\t\t}\n\n\t\tconst res = await fetch(url, { headers, signal });\n\t\tif (!res.ok || !res.body) {\n\t\t\tthrow new ApiError(\n\t\t\t\tres.status,\n\t\t\t\t`Failed to open workflow run stream (HTTP ${res.status})`,\n\t\t\t);\n\t\t}\n\n\t\tconst reader = res.body.pipeThrough(new TextDecoderStream()).getReader();\n\t\tlet buffer = \"\";\n\n\t\twhile (true) {\n\t\t\tconst { value, done } = await reader.read();\n\t\t\tif (done) break;\n\t\t\tbuffer += value;\n\n\t\t\tlet sep = buffer.indexOf(\"\\n\\n\");\n\t\t\twhile (sep !== -1) {\n\t\t\t\tconst chunk = buffer.slice(0, sep);\n\t\t\t\tbuffer = buffer.slice(sep + 2);\n\t\t\t\tconst parsed = parseSseChunk(chunk);\n\t\t\t\tif (parsed) {\n\t\t\t\t\tonEvent(parsed);\n\t\t\t\t\tif (parsed.type === \"done\" || parsed.type === \"timeout\") {\n\t\t\t\t\t\tawait reader.cancel().catch(() => undefined);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsep = buffer.indexOf(\"\\n\\n\");\n\t\t\t}\n\t\t}\n\t}\n\n\tasync list(): Promise<{ workflows: WorkflowSummary[] }> {\n\t\treturn this.request(\"GET\", \"/api/workflows\");\n\t}\n\n\tasync get(name: string): Promise<WorkflowDetail> {\n\t\treturn this.request(\"GET\", `/api/workflows/${name}`);\n\t}\n\n\tasync trigger(\n\t\tname: string,\n\t\tinput?: Record<string, unknown>,\n\t): Promise<{ runId: string }> {\n\t\treturn this.request(\n\t\t\t\"POST\",\n\t\t\t`/api/workflows/${name}/trigger`,\n\t\t\tinput ? { input } : undefined,\n\t\t);\n\t}\n\n\tasync pause(name: string): Promise<void> {\n\t\treturn this.request(\"POST\", `/api/workflows/${name}/pause`);\n\t}\n\n\tasync resume(name: string): Promise<void> {\n\t\treturn this.request(\"POST\", `/api/workflows/${name}/resume`);\n\t}\n\n\tasync delete(name: string): Promise<void> {\n\t\treturn this.request(\"DELETE\", `/api/workflows/${name}`);\n\t}\n\n\tasync listRuns(\n\t\tname: string,\n\t\tparams?: { status?: WorkflowRunStatus; limit?: number },\n\t): Promise<{ runs: WorkflowRunSummary[] }> {\n\t\tconst qs = new URLSearchParams();\n\t\tif (params?.status) qs.set(\"status\", params.status);\n\t\tif (params?.limit !== undefined) qs.set(\"limit\", String(params.limit));\n\t\tconst query = qs.toString();\n\t\treturn this.request(\n\t\t\t\"GET\",\n\t\t\t`/api/workflows/${name}/runs${query ? `?${query}` : \"\"}`,\n\t\t);\n\t}\n\n\tasync getRun(runId: string): Promise<WorkflowRun> {\n\t\treturn this.request(\"GET\", `/api/workflows/runs/${runId}`);\n\t}\n}\n",
|
|
11
|
+
"import { BaseClient } from \"./base.ts\";\nimport type { SecondLayerOptions } from \"./base.ts\";\nimport { Marketplace } from \"./marketplace/client.ts\";\nimport { Subgraphs } from \"./subgraphs/client.ts\";\nimport { Workflows } from \"./workflows/client.ts\";\n\nexport class SecondLayer extends BaseClient {\n\treadonly subgraphs: Subgraphs;\n\treadonly marketplace: Marketplace;\n\treadonly workflows: Workflows;\n\n\tconstructor(options: Partial<SecondLayerOptions> = {}) {\n\t\tsuper(options);\n\t\tthis.subgraphs = new Subgraphs(options);\n\t\tthis.marketplace = new Marketplace(options);\n\t\tthis.workflows = new Workflows(options);\n\t}\n}\n",
|
|
13
12
|
"import type { InferSubgraphClient } from \"@secondlayer/subgraphs\";\nimport type { SecondLayerOptions } from \"../base.ts\";\nimport { SecondLayer } from \"../client.ts\";\nimport { Subgraphs } from \"./client.ts\";\n\n/**\n * Returns a typed client for a subgraph defined with `defineSubgraph()`.\n *\n * Accepts a plain options object, a `SecondLayer` instance, or a `Subgraphs` instance.\n *\n * @example\n * ```ts\n * import mySubgraph from './subgraphs/my-subgraph'\n * import { getSubgraph } from '@secondlayer/sdk'\n *\n * const client = getSubgraph(mySubgraph, { apiKey: 'sl_...' })\n * const rows = await client.transfers.findMany({ where: { sender: 'SP...' } })\n * ```\n */\nexport function getSubgraph<\n\tT extends { name: string; schema: Record<string, unknown> },\n>(\n\tdef: T,\n\toptions: Partial<SecondLayerOptions> | SecondLayer | Subgraphs = {},\n): InferSubgraphClient<T> {\n\tif (options instanceof Subgraphs) {\n\t\treturn options.typed(def);\n\t}\n\tif (options instanceof SecondLayer) {\n\t\treturn options.subgraphs.typed(def);\n\t}\n\treturn new Subgraphs(options).typed(def);\n}\n"
|
|
14
13
|
],
|
|
15
|
-
"mappings": ";AAeO,MAAM,iBAAiB,MAAM;AAAA,EAG3B;AAAA,EAFR,WAAW,CAEH,QACP,SACC;AAAA,IACD,MAAM,OAAO;AAAA,IAHN;AAAA,IAIP,KAAK,OAAO;AAAA;AAEd;;;ACfA,IAAM,mBAAmB;AAAA;AAElB,MAAe,WAAW;AAAA,EACtB;AAAA,EACA;AAAA,EAEV,WAAW,CAAC,UAAuC,CAAC,GAAG;AAAA,IACtD,KAAK,WAAW,QAAQ,WAAW,kBAA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