@wiscale/velesdb-sdk 1.9.3 → 1.11.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 CHANGED
@@ -2,15 +2,23 @@
2
2
 
3
3
  Official TypeScript SDK for [VelesDB](https://github.com/cyberlife-coder/VelesDB) -- the local-first vector database for AI and RAG. Sub-millisecond semantic search in Browser and Node.js.
4
4
 
5
- **v1.9.2** | Node.js >= 18 | Browser (WASM) | MIT License
5
+ **v1.11.0** | Node.js >= 18 | Browser (WASM) | MIT License
6
6
 
7
- ## What's New in v1.9.2
7
+ ## What's New in v1.11.0
8
8
 
9
- - **SearchQuality type** -- new `SearchQuality` type and `quality` field in `SearchOptions` for per-query recall/latency control (`fast`, `balanced`, `accurate`, `perfect`, `custom:N`, `adaptive:min:max`)
9
+ - **15 new VelesQL statements** -- SHOW COLLECTIONS, DESCRIBE, EXPLAIN, CREATE/DROP INDEX, ANALYZE, TRUNCATE, ALTER COLLECTION, FLUSH, multi-row INSERT, UPSERT, SELECT EDGES, INSERT NODE
10
+ - **203 BDD E2E tests** -- comprehensive end-to-end test coverage for all VelesQL features
11
+ - **TRUNCATE on graph collections** -- clears nodes + edges in a single statement
12
+ - **Python `execute_query()`** -- full VelesQL execution from Python bindings
13
+ - **Cyclomatic complexity ≤ 8** -- refactored 6 hotspots for Codacy compliance
14
+
15
+ ### Previous (v1.10.0)
16
+
17
+ - **SearchQuality type** -- `SearchQuality` type and `quality` field in `SearchOptions`
10
18
  - **StorageMode in HnswParams** -- `storageMode` field in HNSW configuration
11
- - **Relative score fusion** -- `'relative_score'` fusion strategy in `MultiQuerySearchOptions`
12
- - **DistanceMetric "ip" alias** -- `"ip"` accepted as an alias for `"dot"` (inner product)
13
- - **StorageMode aliases** -- `"f32"`, `"int8"`, `"bit"` accepted as aliases for `"full"`, `"sq8"`, `"binary"`
19
+ - **Relative score fusion** -- `'relative_score'` fusion strategy
20
+ - **DistanceMetric "ip" alias** -- `"ip"` accepted as alias for `"dot"`
21
+ - **StorageMode aliases** -- `"f32"`, `"int8"`, `"bit"` accepted
14
22
 
15
23
  ### Previous (v1.9.1)
16
24
 
package/dist/index.d.mts CHANGED
@@ -321,7 +321,11 @@ interface AggregationQueryResponse {
321
321
  /** Execution statistics */
322
322
  stats: QueryStats;
323
323
  }
324
- /** Unified response type for `query()` (rows or aggregation). */
324
+ /** Unified response type for `query()` (rows, aggregation, or DDL).
325
+ *
326
+ * DDL statements (CREATE, DROP) and mutations (INSERT EDGE, DELETE) return
327
+ * a standard `QueryResponse` with an empty `results` array.
328
+ */
325
329
  type QueryApiResponse = QueryResponse | AggregationQueryResponse;
326
330
  /** Query explain request/response metadata */
327
331
  interface ExplainPlanStep {
package/dist/index.d.ts CHANGED
@@ -321,7 +321,11 @@ interface AggregationQueryResponse {
321
321
  /** Execution statistics */
322
322
  stats: QueryStats;
323
323
  }
324
- /** Unified response type for `query()` (rows or aggregation). */
324
+ /** Unified response type for `query()` (rows, aggregation, or DDL).
325
+ *
326
+ * DDL statements (CREATE, DROP) and mutations (INSERT EDGE, DELETE) return
327
+ * a standard `QueryResponse` with an empty `results` array.
328
+ */
325
329
  type QueryApiResponse = QueryResponse | AggregationQueryResponse;
326
330
  /** Query explain request/response metadata */
327
331
  interface ExplainPlanStep {
package/dist/index.js CHANGED
@@ -909,8 +909,11 @@ function isLikelyAggregationQuery(queryString) {
909
909
  queryString
910
910
  );
911
911
  }
912
+ function isLikelyDdlOrMutationQuery(queryString) {
913
+ return /^\s*(CREATE|DROP)\s+(COLLECTION|GRAPH|METADATA|INDEX)\b/i.test(queryString) || /^\s*DELETE\s+(FROM|EDGE)\b/i.test(queryString) || /^\s*INSERT\s+(INTO|EDGE|NODE)\b/i.test(queryString) || /^\s*UPSERT\s+INTO\b/i.test(queryString) || /^\s*(SHOW|DESCRIBE|EXPLAIN)\b/i.test(queryString) || /^\s*(FLUSH|ANALYZE|TRUNCATE)\b/i.test(queryString) || /^\s*ALTER\s+COLLECTION\b/i.test(queryString) || /^\s*SELECT\s+EDGES\b/i.test(queryString);
914
+ }
912
915
  async function query(transport, collection, queryString, params, options) {
913
- const endpoint = isLikelyAggregationQuery(queryString) ? "/aggregate" : "/query";
916
+ const endpoint = isLikelyDdlOrMutationQuery(queryString) ? "/query" : isLikelyAggregationQuery(queryString) ? "/aggregate" : "/query";
914
917
  const response = await transport.requestJson(
915
918
  "POST",
916
919
  endpoint,
package/dist/index.mjs CHANGED
@@ -863,8 +863,11 @@ function isLikelyAggregationQuery(queryString) {
863
863
  queryString
864
864
  );
865
865
  }
866
+ function isLikelyDdlOrMutationQuery(queryString) {
867
+ return /^\s*(CREATE|DROP)\s+(COLLECTION|GRAPH|METADATA|INDEX)\b/i.test(queryString) || /^\s*DELETE\s+(FROM|EDGE)\b/i.test(queryString) || /^\s*INSERT\s+(INTO|EDGE|NODE)\b/i.test(queryString) || /^\s*UPSERT\s+INTO\b/i.test(queryString) || /^\s*(SHOW|DESCRIBE|EXPLAIN)\b/i.test(queryString) || /^\s*(FLUSH|ANALYZE|TRUNCATE)\b/i.test(queryString) || /^\s*ALTER\s+COLLECTION\b/i.test(queryString) || /^\s*SELECT\s+EDGES\b/i.test(queryString);
868
+ }
866
869
  async function query(transport, collection, queryString, params, options) {
867
- const endpoint = isLikelyAggregationQuery(queryString) ? "/aggregate" : "/query";
870
+ const endpoint = isLikelyDdlOrMutationQuery(queryString) ? "/query" : isLikelyAggregationQuery(queryString) ? "/aggregate" : "/query";
868
871
  const response = await transport.requestJson(
869
872
  "POST",
870
873
  endpoint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiscale/velesdb-sdk",
3
- "version": "1.9.3",
3
+ "version": "1.11.0",
4
4
  "description": "VelesDB TypeScript SDK: The Local Vector Database for AI & RAG. Microsecond semantic search in Browser & Node.js.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",