@secondlayer/sdk 6.54.1 → 8.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 +3 -7
- package/dist/index.d.ts +10 -740
- package/dist/index.js +41 -623
- package/dist/index.js.map +14 -22
- package/dist/sinks/bun-sqlite.js +2 -24
- package/dist/sinks/bun-sqlite.js.map +3 -3
- package/dist/sinks/core.js +2 -24
- package/dist/sinks/core.js.map +3 -3
- package/dist/sinks/drizzle.js +2 -24
- package/dist/sinks/drizzle.js.map +3 -3
- package/dist/sinks/kysely.js +2 -24
- package/dist/sinks/kysely.js.map +3 -3
- package/dist/streams/index.d.ts +9 -378
- package/dist/streams/index.js +35 -309
- package/dist/streams/index.js.map +9 -15
- package/dist/streams/rows.d.ts +2 -355
- package/dist/streams/rows.js +26 -280
- package/dist/streams/rows.js.map +4 -10
- package/dist/subgraphs/index.d.ts +1 -294
- package/dist/subgraphs/index.js +10 -174
- package/dist/subgraphs/index.js.map +10 -13
- package/package.json +4 -8
- package/dist/x402.d.ts +0 -160
- package/dist/x402.js +0 -531
- package/dist/x402.js.map +0 -12
package/README.md
CHANGED
|
@@ -14,12 +14,12 @@ bun add @secondlayer/sdk
|
|
|
14
14
|
import { SecondLayer } from "@secondlayer/sdk";
|
|
15
15
|
|
|
16
16
|
const sl = new SecondLayer({
|
|
17
|
-
apiKey: process.env.INSTANCE_TOKEN, // from
|
|
17
|
+
apiKey: process.env.INSTANCE_TOKEN, // from secondlayer init; omit on loopback
|
|
18
18
|
// default baseUrl: http://127.0.0.1:3800 (or SL_API_URL)
|
|
19
19
|
});
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Reads hit your instance. Writes use `INSTANCE_TOKEN` from `
|
|
22
|
+
Reads hit your instance. Writes use `INSTANCE_TOKEN` from `secondlayer init` when the
|
|
23
23
|
API is bound beyond loopback. Public archive dumps (`client.dumps`) need no
|
|
24
24
|
instance key.
|
|
25
25
|
|
|
@@ -370,12 +370,8 @@ const spec = await sl.subgraphs.openapi("my-subgraph");
|
|
|
370
370
|
const source = await sl.subgraphs.getSource("my-subgraph");
|
|
371
371
|
const gaps = await sl.subgraphs.gaps("my-subgraph");
|
|
372
372
|
|
|
373
|
-
// Deploy —
|
|
373
|
+
// Deploy — deploys default visibility "public" (409 PUBLIC_NAME_TAKEN if the name is claimed)
|
|
374
374
|
const result = await sl.subgraphs.deploy({ name, sources, schema, handlerCode, visibility: "public" });
|
|
375
|
-
|
|
376
|
-
// Flip visibility — publish claims the global public name (409 PUBLIC_NAME_TAKEN if claimed)
|
|
377
|
-
await sl.subgraphs.publish("my-subgraph");
|
|
378
|
-
await sl.subgraphs.unpublish("my-subgraph");
|
|
379
375
|
```
|
|
380
376
|
|
|
381
377
|
Stream rows live with the typed client — each table exposes `subscribe`
|