@anvailabs/proximadb-client 0.3.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.
Files changed (65) hide show
  1. package/README.md +160 -0
  2. package/dist/client.d.ts +319 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +681 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/collection.d.ts +227 -0
  7. package/dist/collection.d.ts.map +1 -0
  8. package/dist/collection.js +436 -0
  9. package/dist/collection.js.map +1 -0
  10. package/dist/esm/client.js +674 -0
  11. package/dist/esm/client.js.map +1 -0
  12. package/dist/esm/collection.js +428 -0
  13. package/dist/esm/collection.js.map +1 -0
  14. package/dist/esm/filter.js +228 -0
  15. package/dist/esm/filter.js.map +1 -0
  16. package/dist/esm/generated/schema.js +6 -0
  17. package/dist/esm/generated/schema.js.map +1 -0
  18. package/dist/esm/graph.js +678 -0
  19. package/dist/esm/graph.js.map +1 -0
  20. package/dist/esm/index.js +86 -0
  21. package/dist/esm/index.js.map +1 -0
  22. package/dist/esm/search.js +317 -0
  23. package/dist/esm/search.js.map +1 -0
  24. package/dist/esm/transport.js +33 -0
  25. package/dist/esm/transport.js.map +1 -0
  26. package/dist/esm/types.js +181 -0
  27. package/dist/esm/types.js.map +1 -0
  28. package/dist/filter.d.ts +51 -0
  29. package/dist/filter.d.ts.map +1 -0
  30. package/dist/filter.js +241 -0
  31. package/dist/filter.js.map +1 -0
  32. package/dist/generated/schema.d.ts +4271 -0
  33. package/dist/generated/schema.d.ts.map +1 -0
  34. package/dist/generated/schema.js +7 -0
  35. package/dist/generated/schema.js.map +1 -0
  36. package/dist/graph.d.ts +350 -0
  37. package/dist/graph.d.ts.map +1 -0
  38. package/dist/graph.js +690 -0
  39. package/dist/graph.js.map +1 -0
  40. package/dist/index.d.ts +58 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +126 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/search.d.ts +160 -0
  45. package/dist/search.d.ts.map +1 -0
  46. package/dist/search.js +322 -0
  47. package/dist/search.js.map +1 -0
  48. package/dist/transport.d.ts +40 -0
  49. package/dist/transport.d.ts.map +1 -0
  50. package/dist/transport.js +39 -0
  51. package/dist/transport.js.map +1 -0
  52. package/dist/types.d.ts +632 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +185 -0
  55. package/dist/types.js.map +1 -0
  56. package/package.json +72 -0
  57. package/src/client.ts +856 -0
  58. package/src/collection.ts +578 -0
  59. package/src/filter.ts +280 -0
  60. package/src/generated/schema.ts +4271 -0
  61. package/src/graph.ts +811 -0
  62. package/src/index.ts +184 -0
  63. package/src/search.ts +401 -0
  64. package/src/transport.ts +52 -0
  65. package/src/types.ts +726 -0
package/dist/types.js ADDED
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ /**
3
+ * ProximaDB TypeScript SDK - Type Definitions
4
+ *
5
+ * Copyright 2025 ProximaDB Contributors
6
+ * Licensed under the Apache License, Version 2.0
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ProximaDBError = exports.ErrorCode = exports.TraversalDirection = exports.SearchMode = exports.LogicalOp = exports.FilterOp = exports.IndexType = exports.StorageEngine = exports.DistanceMetric = void 0;
10
+ // ============================================================================
11
+ // ENUMS
12
+ // ============================================================================
13
+ /**
14
+ * Distance metrics for vector similarity search
15
+ */
16
+ var DistanceMetric;
17
+ (function (DistanceMetric) {
18
+ /** Cosine similarity (normalized dot product) */
19
+ DistanceMetric["Cosine"] = "cosine";
20
+ /** Euclidean (L2) distance */
21
+ DistanceMetric["Euclidean"] = "euclidean";
22
+ /** Dot product similarity */
23
+ DistanceMetric["DotProduct"] = "dot_product";
24
+ /** Manhattan (L1) distance */
25
+ DistanceMetric["Manhattan"] = "manhattan";
26
+ /** Hamming distance for binary vectors */
27
+ DistanceMetric["Hamming"] = "hamming";
28
+ /** Jaccard similarity for set-like vectors */
29
+ DistanceMetric["Jaccard"] = "jaccard";
30
+ })(DistanceMetric || (exports.DistanceMetric = DistanceMetric = {}));
31
+ /**
32
+ * Storage engines available in ProximaDB
33
+ */
34
+ var StorageEngine;
35
+ (function (StorageEngine) {
36
+ /** Write-optimized, real-time workloads */
37
+ StorageEngine["Sst"] = "sst";
38
+ /** Locality-optimized with Hilbert curves */
39
+ StorageEngine["Helix"] = "helix";
40
+ /** Columnar Parquet for analytics */
41
+ StorageEngine["Viper"] = "viper";
42
+ /** Ultra-low latency for small datasets */
43
+ StorageEngine["Swift"] = "swift";
44
+ /** Progressive columnar for mixed workloads */
45
+ StorageEngine["Nova"] = "nova";
46
+ /** Adaptive row-group for dynamic workloads */
47
+ StorageEngine["Raptor"] = "raptor";
48
+ })(StorageEngine || (exports.StorageEngine = StorageEngine = {}));
49
+ /**
50
+ * Index types for vector search
51
+ */
52
+ var IndexType;
53
+ (function (IndexType) {
54
+ /** Hierarchical Navigable Small World */
55
+ IndexType["Hnsw"] = "hnsw";
56
+ /** Inverted File Index */
57
+ IndexType["Ivf"] = "ivf";
58
+ /** Locality Sensitive Hashing */
59
+ IndexType["Lsh"] = "lsh";
60
+ /** Brute force (no index) */
61
+ IndexType["Flat"] = "flat";
62
+ /** Product Quantization */
63
+ IndexType["Pq"] = "pq";
64
+ /** Approximate Nearest Neighbors Oh Yeah */
65
+ IndexType["Annoy"] = "annoy";
66
+ })(IndexType || (exports.IndexType = IndexType = {}));
67
+ /**
68
+ * Filter operations for metadata filtering
69
+ */
70
+ var FilterOp;
71
+ (function (FilterOp) {
72
+ /** Equal to */
73
+ FilterOp["Eq"] = "equals";
74
+ /** Not equal to */
75
+ FilterOp["Ne"] = "not_equals";
76
+ /** Greater than */
77
+ FilterOp["Gt"] = "gt";
78
+ /** Greater than or equal */
79
+ FilterOp["Gte"] = "gte";
80
+ /** Less than */
81
+ FilterOp["Lt"] = "lt";
82
+ /** Less than or equal */
83
+ FilterOp["Lte"] = "lte";
84
+ /** In list of values */
85
+ FilterOp["In"] = "in";
86
+ /** Not in list of values */
87
+ FilterOp["NotIn"] = "not_in";
88
+ /** Contains (for strings/arrays) */
89
+ FilterOp["Contains"] = "contains";
90
+ /** Starts with (for strings) */
91
+ FilterOp["StartsWith"] = "starts_with";
92
+ /** Ends with (for strings) */
93
+ FilterOp["EndsWith"] = "ends_with";
94
+ /** Field exists */
95
+ FilterOp["Exists"] = "exists";
96
+ /** Field is null */
97
+ FilterOp["IsNull"] = "is_null";
98
+ })(FilterOp || (exports.FilterOp = FilterOp = {}));
99
+ /**
100
+ * Logical operators for combining filter conditions
101
+ */
102
+ var LogicalOp;
103
+ (function (LogicalOp) {
104
+ /** All conditions must match */
105
+ LogicalOp["And"] = "and";
106
+ /** Any condition must match */
107
+ LogicalOp["Or"] = "or";
108
+ })(LogicalOp || (exports.LogicalOp = LogicalOp = {}));
109
+ /**
110
+ * Search mode for controlling recall vs performance tradeoff
111
+ */
112
+ var SearchMode;
113
+ (function (SearchMode) {
114
+ /** Exact search - 100% recall, searches all partitions */
115
+ SearchMode["Exact"] = "exact";
116
+ /** Approximate search - faster with ~95% recall */
117
+ SearchMode["Approximate"] = "approximate";
118
+ /** Adaptive search - auto-selects based on dataset size */
119
+ SearchMode["Adaptive"] = "adaptive";
120
+ })(SearchMode || (exports.SearchMode = SearchMode = {}));
121
+ /**
122
+ * Traversal direction for graph queries
123
+ */
124
+ var TraversalDirection;
125
+ (function (TraversalDirection) {
126
+ /** Traverse outgoing edges */
127
+ TraversalDirection["Outgoing"] = "outgoing";
128
+ /** Traverse incoming edges */
129
+ TraversalDirection["Incoming"] = "incoming";
130
+ /** Traverse both directions */
131
+ TraversalDirection["Both"] = "both";
132
+ })(TraversalDirection || (exports.TraversalDirection = TraversalDirection = {}));
133
+ // ============================================================================
134
+ // ERROR TYPES
135
+ // ============================================================================
136
+ /**
137
+ * ProximaDB error codes
138
+ */
139
+ var ErrorCode;
140
+ (function (ErrorCode) {
141
+ /** Unknown error */
142
+ ErrorCode["Unknown"] = "UNKNOWN";
143
+ /** Network error */
144
+ ErrorCode["Network"] = "NETWORK_ERROR";
145
+ /** Authentication failed */
146
+ ErrorCode["AuthenticationFailed"] = "AUTHENTICATION_FAILED";
147
+ /** Authorization denied */
148
+ ErrorCode["AuthorizationDenied"] = "AUTHORIZATION_DENIED";
149
+ /** Rate limited */
150
+ ErrorCode["RateLimited"] = "RATE_LIMITED";
151
+ /** Collection not found */
152
+ ErrorCode["CollectionNotFound"] = "COLLECTION_NOT_FOUND";
153
+ /** Collection already exists */
154
+ ErrorCode["CollectionExists"] = "COLLECTION_EXISTS";
155
+ /** Vector not found */
156
+ ErrorCode["VectorNotFound"] = "VECTOR_NOT_FOUND";
157
+ /** Invalid vector dimension */
158
+ ErrorCode["InvalidDimension"] = "INVALID_DIMENSION";
159
+ /** Invalid configuration */
160
+ ErrorCode["InvalidConfig"] = "INVALID_CONFIG";
161
+ /** Invalid filter */
162
+ ErrorCode["InvalidFilter"] = "INVALID_FILTER";
163
+ /** Timeout */
164
+ ErrorCode["Timeout"] = "TIMEOUT";
165
+ /** Server error */
166
+ ErrorCode["ServerError"] = "SERVER_ERROR";
167
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
168
+ /**
169
+ * ProximaDB error
170
+ */
171
+ class ProximaDBError extends Error {
172
+ code;
173
+ statusCode;
174
+ details;
175
+ constructor(message, code = ErrorCode.Unknown, statusCode, details) {
176
+ super(message);
177
+ this.code = code;
178
+ this.statusCode = statusCode;
179
+ this.details = details;
180
+ this.name = "ProximaDBError";
181
+ Object.setPrototypeOf(this, ProximaDBError.prototype);
182
+ }
183
+ }
184
+ exports.ProximaDBError = ProximaDBError;
185
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+EAA+E;AAC/E,QAAQ;AACR,+EAA+E;AAE/E;;GAEG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB,iDA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mBAAmB;IACnB,yCAA4B,CAAA;AAC9B,CAAC,EA3BW,SAAS,yBAAT,SAAS,QA2BpB;AAED;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IAGrB;IACA;IACA;IAJlB,YACE,OAAe,EACC,OAAkB,SAAS,CAAC,OAAO,EACnC,UAAmB,EACnB,OAAiC;QAEjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAA+B;QACnC,eAAU,GAAV,UAAU,CAAS;QACnB,YAAO,GAAP,OAAO,CAA0B;QAGjD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF;AAXD,wCAWC"}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@anvailabs/proximadb-client",
3
+ "version": "0.3.0",
4
+ "description": "TypeScript/Node.js SDK for ProximaDB vector database",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "module": "dist/index.mjs",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc && tsc -p tsconfig.esm.json",
21
+ "clean": "rm -rf dist",
22
+ "prepublishOnly": "npm run clean && npm run build",
23
+ "lint": "tsc --noEmit",
24
+ "format": "prettier --write src/**/*.ts",
25
+ "test": "vitest run",
26
+ "test:watch": "vitest",
27
+ "gen-sdk": "bash codegen/gen.sh"
28
+ },
29
+ "keywords": [
30
+ "proximadb",
31
+ "vector",
32
+ "database",
33
+ "embeddings",
34
+ "similarity-search",
35
+ "ai",
36
+ "ml",
37
+ "graph",
38
+ "typescript"
39
+ ],
40
+ "author": "ProximaDB Contributors",
41
+ "license": "Apache-2.0",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/anvai-labs/proximaDB.git",
45
+ "directory": "clients/nodejs-embedded"
46
+ },
47
+ "bugs": {
48
+ "url": "https://github.com/proximadb/proximadb/issues"
49
+ },
50
+ "homepage": "https://github.com/proximadb/proximadb#readme",
51
+ "engines": {
52
+ "node": ">=18.0.0"
53
+ },
54
+ "dependencies": {
55
+ "openapi-fetch": "0.17.0"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^20.10.0",
59
+ "@vitest/coverage-v8": "^4.1.10",
60
+ "openapi-typescript": "7.13.0",
61
+ "typescript": "^5.3.0",
62
+ "vitest": "^4.1.7",
63
+ "yaml": "^2.9.0"
64
+ },
65
+ "overrides": {
66
+ "js-yaml": "^4.3.0",
67
+ "brace-expansion": "^2.1.4"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ }
72
+ }