@effectstream/node-sdk 0.100.14 → 0.100.16
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 +75 -0
- package/package.json +13 -13
- package/test/examples.test.ts +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# @effectstream/node-sdk
|
|
2
|
+
|
|
3
|
+
An umbrella package that re-exports every EffectStream runtime piece
|
|
4
|
+
(runtime, state machine, sync, database, events, config, utils, concise
|
|
5
|
+
schemas) under stable subpaths. Depend on this if you want a single
|
|
6
|
+
name; import the underlying packages directly if you prefer.
|
|
7
|
+
|
|
8
|
+
- Umbrella package: every Effectstream node piece reachable from one dependency.
|
|
9
|
+
- Stable subpaths re-exporting the underlying packages (`/runtime`, `/sm`, `/db`, `/config`, ...).
|
|
10
|
+
- Depend on this if you want a single name; import the underlying packages directly if you prefer.
|
|
11
|
+
- Subpaths are thin re-exports, identical semantics to the source packages.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add @effectstream/node-sdk
|
|
17
|
+
# or
|
|
18
|
+
npm install @effectstream/node-sdk
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Standalone usage
|
|
22
|
+
|
|
23
|
+
Every piece is reachable from one dependency:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { init, start } from "@effectstream/node-sdk/runtime";
|
|
27
|
+
import { Stm } from "@effectstream/node-sdk/sm";
|
|
28
|
+
import { getConnection } from "@effectstream/node-sdk/db";
|
|
29
|
+
import { ConfigBuilder, ConfigNetworkType } from "@effectstream/node-sdk/config";
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The subpaths are thin re-exports — semantics are identical to importing
|
|
33
|
+
from the underlying packages.
|
|
34
|
+
|
|
35
|
+
## Inside EffectStream
|
|
36
|
+
|
|
37
|
+
A namespace seam, not a runtime piece. Each subpath simply re-exports
|
|
38
|
+
the corresponding package:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
@effectstream/node-sdk/runtime → @effectstream/runtime
|
|
42
|
+
@effectstream/node-sdk/sm → @effectstream/sm
|
|
43
|
+
@effectstream/node-sdk/db → @effectstream/db
|
|
44
|
+
…
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Subpath exports
|
|
48
|
+
|
|
49
|
+
- `@effectstream/node-sdk/runtime`: `init`, `start`, `StartConfig`, `DBMigrations`.
|
|
50
|
+
- `@effectstream/node-sdk/sm`: `Stm` plus state-machine types and helpers.
|
|
51
|
+
- `@effectstream/node-sdk/sm/builtin` ships built-in primitive type tags (ERC20, ERC721, ERC1155, Cardano transfer/mint-burn/pool-delegation, Midnight generic, NEAR, Avail, Celestia, ...).
|
|
52
|
+
- `@effectstream/node-sdk/sm/grammar`: concise/grammar parsing utilities.
|
|
53
|
+
- `@effectstream/node-sdk/sync` — `genSyncProtocols` and per-chain fetcher classes.
|
|
54
|
+
- `@effectstream/node-sdk/db`: `getConnection`, query helpers, snapshot utilities.
|
|
55
|
+
- `@effectstream/node-sdk/db/start-pglite`, `./db/apply-migrations`, `./db/db-wait`, `./db/pgtyped-update`, `./db/version`: DB operations scripts.
|
|
56
|
+
- `@effectstream/node-sdk/db-emulator`: in-memory test DB migration runner.
|
|
57
|
+
- `@effectstream/node-sdk/event-server`: local MQTT broker.
|
|
58
|
+
- `@effectstream/node-sdk/config`: `ConfigBuilder` and friends.
|
|
59
|
+
- `@effectstream/node-sdk/chain-types`, `./precompile`, `./concise`, `./coroutine` are pass-throughs to the same-named SDK packages.
|
|
60
|
+
- `@effectstream/node-sdk/utils`, `./utils/node-env`, `./utils/runtime`: utility helpers.
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
Runnable: [`test/examples.test.ts`](./test/examples.test.ts) — verifies
|
|
65
|
+
each subpath resolves.
|
|
66
|
+
|
|
67
|
+
For full working nodes, see:
|
|
68
|
+
|
|
69
|
+
- [`templates/minimal/`](https://github.com/effectstream/effectstream/tree/main/templates/minimal)
|
|
70
|
+
- [`templates/dice/`](https://github.com/effectstream/effectstream/tree/main/templates/dice)
|
|
71
|
+
|
|
72
|
+
## Links
|
|
73
|
+
|
|
74
|
+
- Docs: https://effectstream.github.io/docs/packages/node/node-sdk
|
|
75
|
+
- Source: https://github.com/effectstream/effectstream/tree/main/packages/node-sdk/node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effectstream/node-sdk",
|
|
3
|
-
"version": "0.100.
|
|
3
|
+
"version": "0.100.16",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://effectstream.github.io/docs/",
|
|
6
6
|
"repository": {
|
|
@@ -83,18 +83,18 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@effectstream/runtime": "0.100.
|
|
87
|
-
"@effectstream/sm": "0.100.
|
|
88
|
-
"@effectstream/sync": "0.100.
|
|
89
|
-
"@effectstream/db": "0.100.
|
|
90
|
-
"@effectstream/db-emulator": "0.100.
|
|
91
|
-
"@effectstream/coroutine": "0.100.
|
|
92
|
-
"@effectstream/event-server": "0.100.
|
|
93
|
-
"@effectstream/config": "0.100.
|
|
94
|
-
"@effectstream/chain-types": "0.100.
|
|
95
|
-
"@effectstream/precompile": "0.100.
|
|
96
|
-
"@effectstream/utils": "0.100.
|
|
97
|
-
"@effectstream/concise": "0.100.
|
|
86
|
+
"@effectstream/runtime": "0.100.16",
|
|
87
|
+
"@effectstream/sm": "0.100.16",
|
|
88
|
+
"@effectstream/sync": "0.100.16",
|
|
89
|
+
"@effectstream/db": "0.100.16",
|
|
90
|
+
"@effectstream/db-emulator": "0.100.16",
|
|
91
|
+
"@effectstream/coroutine": "0.100.16",
|
|
92
|
+
"@effectstream/event-server": "0.100.16",
|
|
93
|
+
"@effectstream/config": "0.100.16",
|
|
94
|
+
"@effectstream/chain-types": "0.100.16",
|
|
95
|
+
"@effectstream/precompile": "0.100.16",
|
|
96
|
+
"@effectstream/utils": "0.100.16",
|
|
97
|
+
"@effectstream/concise": "0.100.16"
|
|
98
98
|
},
|
|
99
99
|
"description": "Main application node SDK for EffectStream"
|
|
100
100
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Examples for the README — verify the subpath surface resolves.
|
|
2
|
+
|
|
3
|
+
import { test, expect } from "bun:test";
|
|
4
|
+
|
|
5
|
+
test("README: subpaths resolve to live modules", async () => {
|
|
6
|
+
const runtime = await import("../src/mod.ts");
|
|
7
|
+
expect(typeof runtime.init).toBe("function");
|
|
8
|
+
expect(typeof runtime.start).toBe("function");
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test("README: state-machine subpath exposes Stm", async () => {
|
|
12
|
+
const sm = await import("../src/sm.ts");
|
|
13
|
+
expect("Stm" in sm).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("README: db subpath exposes getConnection", async () => {
|
|
17
|
+
const db = await import("../src/db.ts");
|
|
18
|
+
expect(typeof db.getConnection).toBe("function");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("README: concise re-export keeps generateStmInput in shape", async () => {
|
|
22
|
+
const concise = await import("../src/concise.ts");
|
|
23
|
+
expect(typeof concise.generateStmInput).toBe("function");
|
|
24
|
+
expect(typeof concise.parseStmInput).toBe("function");
|
|
25
|
+
});
|