@ray-db/core 0.1.5 → 0.1.7

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 (3) hide show
  1. package/README.md +77 -51
  2. package/index.js +54 -52
  3. package/package.json +21 -22
package/README.md CHANGED
@@ -1,87 +1,113 @@
1
- # `@napi-rs/package-template`
1
+ # @ray-db/core
2
2
 
3
- ![https://github.com/napi-rs/package-template/actions](https://github.com/napi-rs/package-template/workflows/CI/badge.svg)
3
+ RayDB native bindings for Node.js (and WASI/browser builds), powered by Rust + N-API.
4
4
 
5
- > Template project for writing node packages with napi-rs.
5
+ Docs: https://ray-kwaf.vercel.app/docs
6
6
 
7
- # Usage
8
-
9
- 1. Click **Use this template**.
10
- 2. **Clone** your project.
11
- 3. Run `yarn install` to install dependencies.
12
- 4. Run `yarn napi rename -n [@your-scope/package-name] -b [binary-name]` command under the project folder to rename your package.
13
-
14
- ## Install this test package
7
+ ## Install
15
8
 
16
9
  ```bash
17
- yarn add @napi-rs/package-template
10
+ npm install @ray-db/core
11
+ # or
12
+ pnpm add @ray-db/core
13
+ # or
14
+ yarn add @ray-db/core
18
15
  ```
19
16
 
20
- ## Ability
17
+ This package ships prebuilt binaries for major platforms. If a prebuild isn't available for your target, you'll need a Rust toolchain to build from source.
21
18
 
22
- ### Build
19
+ ## Quickstart (graph basics)
23
20
 
24
- After `yarn build/npm run build` command, you can see `package-template.[darwin|win32|linux].node` file in project root. This is the native addon built from [lib.rs](./src/lib.rs).
21
+ ```ts
22
+ import {
23
+ Database,
24
+ JsTraversalDirection,
25
+ PropType,
26
+ pathConfig,
27
+ traversalStep,
28
+ } from '@ray-db/core'
25
29
 
26
- ### Test
30
+ const db = Database.open('example.raydb', { createIfMissing: true })
27
31
 
28
- With [ava](https://github.com/avajs/ava), run `yarn test/npm run test` to testing native addon. You can also switch to another testing framework if you want.
32
+ // Transactions are explicit for write operations
33
+ db.begin()
34
+ const alice = db.createNode('user:alice')
35
+ const bob = db.createNode('user:bob')
29
36
 
30
- ### CI
37
+ const knows = db.getOrCreateEtype('knows')
38
+ const weight = db.getOrCreatePropkey('weight')
31
39
 
32
- With GitHub Actions, each commit and pull request will be built and tested automatically in [`node@20`, `@node22`] x [`macOS`, `Linux`, `Windows`] matrix. You will never be afraid of the native addon broken in these platforms.
40
+ db.addEdge(alice, knows, bob)
33
41
 
34
- ### Release
42
+ // Set a typed edge property
43
+ db.setEdgeProp(alice, knows, bob, weight, {
44
+ propType: PropType.Int,
45
+ intValue: 1,
46
+ })
35
47
 
36
- Release native package is very difficult in old days. Native packages may ask developers who use it to install `build toolchain` like `gcc/llvm`, `node-gyp` or something more.
48
+ db.commit()
37
49
 
38
- With `GitHub actions`, we can easily prebuild a `binary` for major platforms. And with `N-API`, we should never be afraid of **ABI Compatible**.
50
+ // Traverse
51
+ const oneHop = db.traverseSingle([alice], JsTraversalDirection.Out, knows)
52
+ console.log(oneHop)
39
53
 
40
- The other problem is how to deliver prebuild `binary` to users. Downloading it in `postinstall` script is a common way that most packages do it right now. The problem with this solution is it introduced many other packages to download binary that has not been used by `runtime codes`. The other problem is some users may not easily download the binary from `GitHub/CDN` if they are behind a private network (But in most cases, they have a private NPM mirror).
54
+ // Multi-hop traversal
55
+ const steps = [
56
+ traversalStep(JsTraversalDirection.Out, knows),
57
+ traversalStep(JsTraversalDirection.Out, knows),
58
+ ]
59
+ const twoHop = db.traverse([alice], steps)
60
+ console.log(twoHop)
41
61
 
42
- In this package, we choose a better way to solve this problem. We release different `npm packages` for different platforms. And add it to `optionalDependencies` before releasing the `Major` package to npm.
62
+ // Pathfinding
63
+ const config = pathConfig(alice, bob)
64
+ config.allowedEdgeTypes = [knows]
65
+ const shortest = db.bfs(config)
66
+ console.log(shortest)
43
67
 
44
- `NPM` will choose which native package should download from `registry` automatically. You can see [npm](./npm) dir for details. And you can also run `yarn add @napi-rs/package-template` to see how it works.
68
+ db.close()
69
+ ```
45
70
 
46
- ## Develop requirements
71
+ ## Backups and health checks
47
72
 
48
- - Install the latest `Rust`
49
- - Install `Node.js@10+` which fully supported `Node-API`
50
- - Install `yarn@1.x`
73
+ ```ts
74
+ import { createBackup, restoreBackup, healthCheck } from '@ray-db/core'
51
75
 
52
- ## Test in local
76
+ const backup = createBackup(db, 'backups/graph')
77
+ const restoredPath = restoreBackup(backup.path, 'restored/graph')
53
78
 
54
- - yarn
55
- - yarn build
56
- - yarn test
79
+ const health = healthCheck(db)
80
+ console.log(health.healthy)
81
+ ```
57
82
 
58
- And you will see:
83
+ ## Vector search
59
84
 
60
- ```bash
61
- $ ava --verbose
85
+ ```ts
86
+ import { createVectorIndex } from '@ray-db/core'
62
87
 
63
- sync function from native code
64
- sleep function from native code (201ms)
65
-
88
+ const index = createVectorIndex({ dimensions: 3 })
89
+ index.set(1, [0.1, 0.2, 0.3])
90
+ index.set(2, [0.1, 0.25, 0.35])
91
+ index.buildIndex()
66
92
 
67
- 2 tests passed
68
- ✨ Done in 1.12s.
93
+ const hits = index.search([0.1, 0.2, 0.3], { k: 5 })
94
+ console.log(hits)
69
95
  ```
70
96
 
71
- ## Release package
97
+ ## Browser/WASI builds
72
98
 
73
- Ensure you have set your **NPM_TOKEN** in the `GitHub` project setting.
99
+ This package exposes a WASI-compatible build via the `browser` export for bundlers, backed by `@ray-db/core-wasm32-wasi`. If you need to import it directly:
74
100
 
75
- In `Settings -> Secrets`, add **NPM_TOKEN** into it.
101
+ ```ts
102
+ import { Database } from '@ray-db/core-wasm32-wasi'
103
+ ```
76
104
 
77
- When you want to release the package:
105
+ ## API surface
78
106
 
79
- ```bash
80
- npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
107
+ The Node bindings expose both low-level graph primitives (`Database`) and higher-level APIs (Ray) for schema-driven workflows, plus metrics, backups, traversal, and vector search. For full API details and guides, see the docs:
81
108
 
82
- git push
83
- ```
109
+ https://ray-kwaf.vercel.app/docs
84
110
 
85
- GitHub actions will do the rest job for you.
111
+ ## License
86
112
 
87
- > WARN: Don't run `npm publish` manually.
113
+ MIT
package/index.js CHANGED
@@ -77,8 +77,8 @@ function requireNative() {
77
77
  try {
78
78
  const binding = require('@ray-db/core-android-arm64')
79
79
  const bindingPackageVersion = require('@ray-db/core-android-arm64/package.json').version
80
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
82
82
  }
83
83
  return binding
84
84
  } catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
93
93
  try {
94
94
  const binding = require('@ray-db/core-android-arm-eabi')
95
95
  const bindingPackageVersion = require('@ray-db/core-android-arm-eabi/package.json').version
96
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
98
98
  }
99
99
  return binding
100
100
  } catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
114
114
  try {
115
115
  const binding = require('@ray-db/core-win32-x64-gnu')
116
116
  const bindingPackageVersion = require('@ray-db/core-win32-x64-gnu/package.json').version
117
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
117
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
119
119
  }
120
120
  return binding
121
121
  } catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
130
130
  try {
131
131
  const binding = require('@ray-db/core-win32-x64-msvc')
132
132
  const bindingPackageVersion = require('@ray-db/core-win32-x64-msvc/package.json').version
133
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
135
135
  }
136
136
  return binding
137
137
  } catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
147
147
  try {
148
148
  const binding = require('@ray-db/core-win32-ia32-msvc')
149
149
  const bindingPackageVersion = require('@ray-db/core-win32-ia32-msvc/package.json').version
150
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
152
152
  }
153
153
  return binding
154
154
  } catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
163
163
  try {
164
164
  const binding = require('@ray-db/core-win32-arm64-msvc')
165
165
  const bindingPackageVersion = require('@ray-db/core-win32-arm64-msvc/package.json').version
166
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
168
168
  }
169
169
  return binding
170
170
  } catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
182
182
  try {
183
183
  const binding = require('@ray-db/core-darwin-universal')
184
184
  const bindingPackageVersion = require('@ray-db/core-darwin-universal/package.json').version
185
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
187
187
  }
188
188
  return binding
189
189
  } catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
198
198
  try {
199
199
  const binding = require('@ray-db/core-darwin-x64')
200
200
  const bindingPackageVersion = require('@ray-db/core-darwin-x64/package.json').version
201
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
203
203
  }
204
204
  return binding
205
205
  } catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
214
214
  try {
215
215
  const binding = require('@ray-db/core-darwin-arm64')
216
216
  const bindingPackageVersion = require('@ray-db/core-darwin-arm64/package.json').version
217
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
219
219
  }
220
220
  return binding
221
221
  } catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
234
234
  try {
235
235
  const binding = require('@ray-db/core-freebsd-x64')
236
236
  const bindingPackageVersion = require('@ray-db/core-freebsd-x64/package.json').version
237
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
239
239
  }
240
240
  return binding
241
241
  } catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
250
250
  try {
251
251
  const binding = require('@ray-db/core-freebsd-arm64')
252
252
  const bindingPackageVersion = require('@ray-db/core-freebsd-arm64/package.json').version
253
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
255
255
  }
256
256
  return binding
257
257
  } catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
271
271
  try {
272
272
  const binding = require('@ray-db/core-linux-x64-musl')
273
273
  const bindingPackageVersion = require('@ray-db/core-linux-x64-musl/package.json').version
274
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
276
276
  }
277
277
  return binding
278
278
  } catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
287
287
  try {
288
288
  const binding = require('@ray-db/core-linux-x64-gnu')
289
289
  const bindingPackageVersion = require('@ray-db/core-linux-x64-gnu/package.json').version
290
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
292
292
  }
293
293
  return binding
294
294
  } catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
305
305
  try {
306
306
  const binding = require('@ray-db/core-linux-arm64-musl')
307
307
  const bindingPackageVersion = require('@ray-db/core-linux-arm64-musl/package.json').version
308
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
310
310
  }
311
311
  return binding
312
312
  } catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
321
321
  try {
322
322
  const binding = require('@ray-db/core-linux-arm64-gnu')
323
323
  const bindingPackageVersion = require('@ray-db/core-linux-arm64-gnu/package.json').version
324
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
326
326
  }
327
327
  return binding
328
328
  } catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
339
339
  try {
340
340
  const binding = require('@ray-db/core-linux-arm-musleabihf')
341
341
  const bindingPackageVersion = require('@ray-db/core-linux-arm-musleabihf/package.json').version
342
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
344
344
  }
345
345
  return binding
346
346
  } catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
355
355
  try {
356
356
  const binding = require('@ray-db/core-linux-arm-gnueabihf')
357
357
  const bindingPackageVersion = require('@ray-db/core-linux-arm-gnueabihf/package.json').version
358
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
360
360
  }
361
361
  return binding
362
362
  } catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
373
373
  try {
374
374
  const binding = require('@ray-db/core-linux-loong64-musl')
375
375
  const bindingPackageVersion = require('@ray-db/core-linux-loong64-musl/package.json').version
376
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
378
378
  }
379
379
  return binding
380
380
  } catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
389
389
  try {
390
390
  const binding = require('@ray-db/core-linux-loong64-gnu')
391
391
  const bindingPackageVersion = require('@ray-db/core-linux-loong64-gnu/package.json').version
392
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
394
394
  }
395
395
  return binding
396
396
  } catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
407
407
  try {
408
408
  const binding = require('@ray-db/core-linux-riscv64-musl')
409
409
  const bindingPackageVersion = require('@ray-db/core-linux-riscv64-musl/package.json').version
410
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
412
412
  }
413
413
  return binding
414
414
  } catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
423
423
  try {
424
424
  const binding = require('@ray-db/core-linux-riscv64-gnu')
425
425
  const bindingPackageVersion = require('@ray-db/core-linux-riscv64-gnu/package.json').version
426
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
428
428
  }
429
429
  return binding
430
430
  } catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
440
440
  try {
441
441
  const binding = require('@ray-db/core-linux-ppc64-gnu')
442
442
  const bindingPackageVersion = require('@ray-db/core-linux-ppc64-gnu/package.json').version
443
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
445
445
  }
446
446
  return binding
447
447
  } catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
456
456
  try {
457
457
  const binding = require('@ray-db/core-linux-s390x-gnu')
458
458
  const bindingPackageVersion = require('@ray-db/core-linux-s390x-gnu/package.json').version
459
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
461
461
  }
462
462
  return binding
463
463
  } catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
476
476
  try {
477
477
  const binding = require('@ray-db/core-openharmony-arm64')
478
478
  const bindingPackageVersion = require('@ray-db/core-openharmony-arm64/package.json').version
479
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
481
481
  }
482
482
  return binding
483
483
  } catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
492
492
  try {
493
493
  const binding = require('@ray-db/core-openharmony-x64')
494
494
  const bindingPackageVersion = require('@ray-db/core-openharmony-x64/package.json').version
495
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
497
497
  }
498
498
  return binding
499
499
  } catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
508
508
  try {
509
509
  const binding = require('@ray-db/core-openharmony-arm')
510
510
  const bindingPackageVersion = require('@ray-db/core-openharmony-arm/package.json').version
511
- if (bindingPackageVersion !== '1.0.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
- throw new Error(`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '0.1.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ throw new Error(`Native binding package version mismatch, expected 0.1.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
513
513
  }
514
514
  return binding
515
515
  } catch (e) {
@@ -587,6 +587,7 @@ module.exports.RayInsertExecutorSingle = nativeBinding.RayInsertExecutorSingle
587
587
  module.exports.RayPath = nativeBinding.RayPath
588
588
  module.exports.RayTraversal = nativeBinding.RayTraversal
589
589
  module.exports.RayUpdateBuilder = nativeBinding.RayUpdateBuilder
590
+ module.exports.RayUpdateEdgeBuilder = nativeBinding.RayUpdateEdgeBuilder
590
591
  module.exports.VectorIndex = nativeBinding.VectorIndex
591
592
  module.exports.bruteForceSearch = nativeBinding.bruteForceSearch
592
593
  module.exports.collectMetrics = nativeBinding.collectMetrics
@@ -596,6 +597,7 @@ module.exports.createVectorIndex = nativeBinding.createVectorIndex
596
597
  module.exports.getBackupInfo = nativeBinding.getBackupInfo
597
598
  module.exports.healthCheck = nativeBinding.healthCheck
598
599
  module.exports.JsAggregation = nativeBinding.JsAggregation
600
+ module.exports.JsCompressionType = nativeBinding.JsCompressionType
599
601
  module.exports.JsDistanceMetric = nativeBinding.JsDistanceMetric
600
602
  module.exports.JsSyncMode = nativeBinding.JsSyncMode
601
603
  module.exports.JsTraversalDirection = nativeBinding.JsTraversalDirection
package/package.json CHANGED
@@ -1,21 +1,27 @@
1
1
  {
2
2
  "name": "@ray-db/core",
3
- "version": "0.1.5",
4
- "description": "Template project for writing node package with napi-rs",
3
+ "version": "0.1.7",
4
+ "description": "RayDB - A fast, lightweight, embedded graph database for Node.js",
5
+ "author": "mask <mask@mask.dev>",
6
+ "homepage": "https://github.com/maskdotdev/ray",
5
7
  "main": "index.js",
6
8
  "repository": {
7
9
  "type": "git",
8
- "url": "git+ssh://git@github.com/napi-rs/package-template.git"
10
+ "url": "https://github.com/maskdotdev/ray"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/maskdotdev/ray/issues"
9
14
  },
10
15
  "license": "MIT",
11
16
  "browser": "browser.js",
12
17
  "keywords": [
13
- "napi-rs",
14
- "NAPI",
15
- "N-API",
16
- "Rust",
17
- "node-addon",
18
- "node-addon-api"
18
+ "raydb",
19
+ "graph-database",
20
+ "embedded-database",
21
+ "database",
22
+ "graph",
23
+ "rust",
24
+ "napi-rs"
19
25
  ],
20
26
  "files": [
21
27
  "index.d.ts",
@@ -28,14 +34,8 @@
28
34
  "x86_64-pc-windows-msvc",
29
35
  "x86_64-apple-darwin",
30
36
  "x86_64-unknown-linux-gnu",
31
- "aarch64-apple-darwin",
32
- "wasm32-wasip1-threads"
33
- ],
34
- "wasm": {
35
- "browser": {
36
- "fs": true
37
- }
38
- }
37
+ "aarch64-apple-darwin"
38
+ ]
39
39
  },
40
40
  "engines": {
41
41
  "node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
@@ -117,10 +117,9 @@
117
117
  },
118
118
  "packageManager": "yarn@4.12.0",
119
119
  "optionalDependencies": {
120
- "@ray-db/core-win32-x64-msvc": "0.1.5",
121
- "@ray-db/core-darwin-x64": "0.1.5",
122
- "@ray-db/core-linux-x64-gnu": "0.1.5",
123
- "@ray-db/core-darwin-arm64": "0.1.5",
124
- "@ray-db/core-wasm32-wasi": "0.1.5"
120
+ "@ray-db/core-win32-x64-msvc": "0.1.7",
121
+ "@ray-db/core-darwin-x64": "0.1.7",
122
+ "@ray-db/core-linux-x64-gnu": "0.1.7",
123
+ "@ray-db/core-darwin-arm64": "0.1.7"
125
124
  }
126
125
  }