@laserdata/laser-sdk 0.0.1-rc.2 → 0.0.1-rc.21
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 -5
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The native TypeScript client for LaserData over Apache Iggy. It provides typed s
|
|
|
4
4
|
|
|
5
5
|
This prerelease targets Node 22.14 or later. Bun, Deno, and browsers are not supported because the Apache Iggy transport uses Node TCP and TLS APIs.
|
|
6
6
|
|
|
7
|
-
> **Prerelease (`0.0.1-rc.
|
|
7
|
+
> **Prerelease (`0.0.1-rc.21`).** Pin an exact version while the public API and wire contract are still in release-candidate development.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -32,9 +32,9 @@ console.log(`read ${records.length} order(s)`)
|
|
|
32
32
|
|
|
33
33
|
Use the bare `user:password@host:port` connection string. The SDK supplies the Apache Iggy TCP scheme internally. One connection addresses every stream on the server. Select a stream explicitly with `laser.stream(name)`, then a topic with `.topic(name)`. `Laser.connectWithStream()` only pins a default stream so `laser.topic(name)` can be used as a shortcut. It does not limit the connection to that stream. `Laser.connectEnv()` reads `LASER_CONNECTION_STRING` and the optional `LASER_STREAM`. `Laser.local()` targets the default local server. `Laser.builder()` accepts a connection string, an address and credentials, or an injected Apache Iggy client with explicit owned or borrowed lifetime.
|
|
34
34
|
|
|
35
|
-
Owned connections retry the initial handshake and reconnect after a dropped socket, with unlimited retries at one-second intervals by default. Set `reconnection_retries` to a non-negative integer and `reconnection_interval` to `250ms`, `1s`, or `1m` in the connection string to tune the policy.
|
|
35
|
+
Owned connections retry the initial handshake and reconnect after a dropped socket, with unlimited retries at one-second intervals by default. Set `reconnection_retries` to a non-negative integer and `reconnection_interval` to `250ms`, `1s`, or `1m` in the connection string to tune the policy. An injected client remains under its caller's lifecycle and reconnect policy.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
The TypeScript SDK pins Apache Iggy `0.8.1-edge.3` and always constructs a VSR client. There is no protocol option in the Laser API. An injected Apache Iggy client must also use VSR and is rejected before use otherwise.
|
|
38
38
|
|
|
39
39
|
## Streaming model
|
|
40
40
|
|
|
@@ -81,14 +81,14 @@ Registered Avro, Protobuf, and JSON Schema topics compile the writer schema once
|
|
|
81
81
|
|
|
82
82
|
## Managed data surfaces
|
|
83
83
|
|
|
84
|
-
LaserData Cloud
|
|
84
|
+
LaserData Cloud and Laser Stack announce their capabilities during connection setup. Apache Iggy without a managed backend serves streaming and returns `UnsupportedError` for managed calls. The same client code can feature-detect through `laser.capabilities()`.
|
|
85
85
|
|
|
86
86
|
The root client exposes query, projections, bindings, schemas, key-value and CAS, forks, graph traversal, RBAC, runs, watch feeds, and independent managed command batches. Query uses the managed command path, not a request topic. Every command is encoded through the same Rust-owned AGDX fixtures consumed by the other SDKs.
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
89
|
import { graphNodeEntity } from "@laserdata/laser-sdk"
|
|
90
90
|
|
|
91
|
-
const paid = await laser.query("orders_v1").
|
|
91
|
+
const paid = await laser.query("orders_v1").whereEq("status", "paid").limit(20).fetch()
|
|
92
92
|
|
|
93
93
|
const key = new TextEncoder().encode("user:42")
|
|
94
94
|
const session = { cart: ["sku-1"] }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laserdata/laser-sdk",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.21",
|
|
4
4
|
"description": "LaserData SDK for TypeScript: an open data-platform SDK over Apache Iggy (typed streaming, declared projections and a query DSL, a key-value store, copy-on-write forks, and an optional agent runtime with AGDX)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"test:unit": "node ./scripts/run-tests.mjs unit",
|
|
65
65
|
"test:wire": "node ./scripts/run-tests.mjs wire",
|
|
66
66
|
"test:robustness": "node ./scripts/run-tests.mjs robustness",
|
|
67
|
-
"test:integration": "node
|
|
67
|
+
"test:integration": "npm run build:test && node ../../scripts/run-with-test-iggy.mjs npm run test:integration:run",
|
|
68
|
+
"test:integration:run": "node ./scripts/run-tests.mjs integration",
|
|
68
69
|
"test": "npm run test:unit && npm run test:wire && npm run test:robustness",
|
|
69
70
|
"coverage": "c8 --all --src src --check-coverage --lines 70 --functions 70 --branches 60 --statements 70 node ./scripts/run-tests.mjs unit wire robustness",
|
|
70
71
|
"pack:check": "node ./scripts/pack-check.mjs",
|
|
@@ -82,9 +83,9 @@
|
|
|
82
83
|
"@noble/hashes": "2.2.0",
|
|
83
84
|
"@types/node": "22.20.1",
|
|
84
85
|
"ajv": "8.20.0",
|
|
85
|
-
"apache-iggy": "0.8.1-edge.
|
|
86
|
+
"apache-iggy": "0.8.1-edge.3",
|
|
86
87
|
"avsc": "5.7.9",
|
|
87
|
-
"cborg": "^
|
|
88
|
+
"cborg": "^6.1.1",
|
|
88
89
|
"protobufjs": "8.7.1"
|
|
89
90
|
},
|
|
90
91
|
"devDependencies": {
|
|
@@ -92,8 +93,8 @@
|
|
|
92
93
|
"@microsoft/api-extractor": "^7.58.12",
|
|
93
94
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
94
95
|
"c8": "^12.0.0",
|
|
95
|
-
"eslint": "10.
|
|
96
|
-
"globals": "17.
|
|
96
|
+
"eslint": "10.8.0",
|
|
97
|
+
"globals": "17.8.0",
|
|
97
98
|
"prettier": "3.9.6",
|
|
98
99
|
"typescript": "npm:@typescript/typescript6@6.0.3",
|
|
99
100
|
"typescript-eslint": "8.65.0"
|