@synapcores/sdk 0.1.0 → 0.2.1
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 +94 -1
- package/dist/index.d.mts +1024 -188
- package/dist/index.d.ts +1024 -188
- package/dist/index.js +1779 -893
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1770 -893
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,6 +2,94 @@
|
|
|
2
2
|
|
|
3
3
|
Official Node.js/TypeScript SDK for SynapCores AI-Native Database Management System - A SQL 2026-compliant database with native tenant isolation, AI/ML functions, and multimedia support.
|
|
4
4
|
|
|
5
|
+
> **0.2.0 — gateway v1.5.0-ce alignment.** This release rewires every
|
|
6
|
+
> module against the v1.5.0-ce route surface: AutoML moved from `/ai/*`
|
|
7
|
+
> to `/automl/*`, vector ops collapsed onto `/vector-algebra/operation`,
|
|
8
|
+
> WebSocket auth now uses ticket exchange, and we ship eight new top-level
|
|
9
|
+
> modules: `graph`, `nl2sql`, `filesystem`, `chat`, `multimodal`,
|
|
10
|
+
> `system`, `transactions`, and `mcp`. See "What's new in 0.2.0" below.
|
|
11
|
+
|
|
12
|
+
## What's new in 0.2.0
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { SynapCores } from '@synapcores/sdk';
|
|
16
|
+
|
|
17
|
+
const client = new SynapCores({
|
|
18
|
+
host: 'localhost', port: 8080,
|
|
19
|
+
apiKey: 'ak_prod_xxx...',
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// 1. Cypher-style graph traversal
|
|
23
|
+
const friends = await client.graph.cypher(
|
|
24
|
+
'MATCH (u:User {id:$id})-[:FRIEND]->(f) RETURN f',
|
|
25
|
+
{ id: 'u-123' },
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// 2. Natural language → SQL (with optional execution)
|
|
29
|
+
const ans = await client.nl2sql.ask(
|
|
30
|
+
'top 10 customers by revenue this quarter',
|
|
31
|
+
{ execute: true },
|
|
32
|
+
);
|
|
33
|
+
console.log(ans.sql, ans.rows);
|
|
34
|
+
|
|
35
|
+
// 3. AI chat sessions with streaming
|
|
36
|
+
const session = await client.chat.sessions.create({ model: 'gpt-4o' });
|
|
37
|
+
for await (const chunk of client.chat.stream(session.id, 'Summarize today\'s alerts')) {
|
|
38
|
+
if (chunk.delta) process.stdout.write(chunk.delta);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 4. Filesystem-backed RAG collections with progress
|
|
42
|
+
const fs = await client.filesystem.collections.create({
|
|
43
|
+
name: 'docs', path: '/data/docs', watch: true,
|
|
44
|
+
});
|
|
45
|
+
for await (const evt of client.filesystem.collections.subscribeProgress(fs.id)) {
|
|
46
|
+
console.log(evt.status, evt.progress, evt.filename);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 5. Server-side transactions with savepoints
|
|
50
|
+
const tx = await client.transactions.begin({ isolation_level: 'SERIALIZABLE' });
|
|
51
|
+
try {
|
|
52
|
+
await tx.execute('UPDATE accounts SET balance = balance - $1 WHERE id = $2', [100, 'a']);
|
|
53
|
+
await tx.savepoint('mid');
|
|
54
|
+
await tx.execute('UPDATE accounts SET balance = balance + $1 WHERE id = $2', [100, 'b']);
|
|
55
|
+
await tx.commit();
|
|
56
|
+
} catch (e) {
|
|
57
|
+
if (tx.isActive()) await tx.rollback();
|
|
58
|
+
throw e;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Other new surfaces:
|
|
63
|
+
|
|
64
|
+
- `client.multimodal.{similarity,search,join,embed}` for cross-modal retrieval.
|
|
65
|
+
- `client.system.vision.{get,set,delete,test}` for the admin vision config.
|
|
66
|
+
- `client.mcp.{invoke,batch,info}` for the Model Context Protocol gateway.
|
|
67
|
+
|
|
68
|
+
### Breaking changes vs 0.1.0
|
|
69
|
+
|
|
70
|
+
- `embed()` now hits `/ai/embeddings` (single) / `/ai/embeddings/batch`.
|
|
71
|
+
- `automl.*` paths moved from `/ai/*` to `/automl/*`.
|
|
72
|
+
- All vector math (`vectorAdd`, `cosineSimilarity`, …) goes through
|
|
73
|
+
`POST /vector-algebra/operation` with an `op` discriminator.
|
|
74
|
+
- `knnSearch`/`rangeSearch`/`hybridSearch` POST to
|
|
75
|
+
`/vectors/collections/:c/search` with a `mode` field.
|
|
76
|
+
- `prepareStatement`/`executePrepared`/`deallocatePrepared` use
|
|
77
|
+
`POST /query/{prepare,exec,close}`.
|
|
78
|
+
- `import.import()` only routes to `/data/import/csv` or `/data/import/json`.
|
|
79
|
+
The old `/import/*`, `/export/*`, validate, template and bulk-job
|
|
80
|
+
endpoints throw `ValidationError` since they were removed in v1.5.0-ce.
|
|
81
|
+
- `backup.cancelBackup`, `backup.cancelRestore` and `backup.getMetrics`
|
|
82
|
+
removed (no longer exist server-side).
|
|
83
|
+
- `integrations.*` keys integrations by **type slug**, not arbitrary id;
|
|
84
|
+
webhooks/stats/logs/events/execution-history methods now throw
|
|
85
|
+
`ValidationError` because the gateway has no matching routes.
|
|
86
|
+
- `subscription` (and the new `filesystem` progress stream) authenticate
|
|
87
|
+
by exchanging a JWT/API-key for a short-lived WS ticket via
|
|
88
|
+
`POST /v1/ws/ticket`, then connecting to `/ws?token=...` (or the
|
|
89
|
+
`/ws/filesystem-collections/:id/progress?token=...` channel).
|
|
90
|
+
- `refreshToken()` no longer hits a `/auth/refresh` endpoint — pass the
|
|
91
|
+
username/password (or call `login()` again).
|
|
92
|
+
|
|
5
93
|
## Features
|
|
6
94
|
|
|
7
95
|
- 🚀 **Full TypeScript Support**: Complete type definitions for excellent IDE experience
|
|
@@ -1003,9 +1091,14 @@ const result = await client.listCollectionsDetailed(); // Returns detailed info
|
|
|
1003
1091
|
|
|
1004
1092
|
For detailed API documentation and the complete integration guide, visit:
|
|
1005
1093
|
- **Database Integration Guide**: See `databaseintegrationguide.md`
|
|
1006
|
-
- **API Documentation**: [https://
|
|
1094
|
+
- **API Documentation**: [https://synapcores.com/developers](https://synapcores.com/developers)
|
|
1007
1095
|
|
|
1008
1096
|
## License
|
|
1009
1097
|
|
|
1010
1098
|
MIT License - see LICENSE file for details.
|
|
1011
1099
|
|
|
1100
|
+
## Support
|
|
1101
|
+
|
|
1102
|
+
- **Issues**: [GitHub Issues](https://github.com/synapcores/nodejs-sdk/issues)
|
|
1103
|
+
- **Documentation**: [https://synapcores.com/developers](https://synapcores.com/developers)
|
|
1104
|
+
- **Email**: release@synapcores.com
|