@lancedb/lancedb 0.39.0-beta.8 → 0.40.0-beta.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/dist/arrow.d.ts +16 -0
- package/dist/arrow.js +19 -0
- package/dist/catalog.d.ts +46 -0
- package/dist/catalog.js +63 -0
- package/dist/connection.d.ts +25 -5
- package/dist/connection.js +7 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7 -1
- package/dist/materialized_view.d.ts +3 -1
- package/dist/materialized_view.js +10 -4
- package/dist/native.d.ts +158 -3
- package/dist/native.js +54 -52
- package/dist/oauth.d.ts +205 -0
- package/dist/oauth.js +97 -1
- package/dist/table.d.ts +6 -2
- package/dist/table.js +4 -7
- package/package.json +8 -8
package/dist/native.js
CHANGED
|
@@ -76,8 +76,8 @@ function requireNative() {
|
|
|
76
76
|
try {
|
|
77
77
|
const binding = require('@lancedb/lancedb-android-arm64');
|
|
78
78
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm64/package.json').version;
|
|
79
|
-
if (bindingPackageVersion !== '0.
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
79
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
81
81
|
}
|
|
82
82
|
return binding;
|
|
83
83
|
}
|
|
@@ -95,8 +95,8 @@ function requireNative() {
|
|
|
95
95
|
try {
|
|
96
96
|
const binding = require('@lancedb/lancedb-android-arm-eabi');
|
|
97
97
|
const bindingPackageVersion = require('@lancedb/lancedb-android-arm-eabi/package.json').version;
|
|
98
|
-
if (bindingPackageVersion !== '0.
|
|
99
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
98
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
99
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
100
100
|
}
|
|
101
101
|
return binding;
|
|
102
102
|
}
|
|
@@ -120,8 +120,8 @@ function requireNative() {
|
|
|
120
120
|
try {
|
|
121
121
|
const binding = require('@lancedb/lancedb-win32-x64-gnu');
|
|
122
122
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-gnu/package.json').version;
|
|
123
|
-
if (bindingPackageVersion !== '0.
|
|
124
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
123
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
124
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
125
125
|
}
|
|
126
126
|
return binding;
|
|
127
127
|
}
|
|
@@ -139,8 +139,8 @@ function requireNative() {
|
|
|
139
139
|
try {
|
|
140
140
|
const binding = require('@lancedb/lancedb-win32-x64-msvc');
|
|
141
141
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-x64-msvc/package.json').version;
|
|
142
|
-
if (bindingPackageVersion !== '0.
|
|
143
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
142
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
143
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
144
144
|
}
|
|
145
145
|
return binding;
|
|
146
146
|
}
|
|
@@ -159,8 +159,8 @@ function requireNative() {
|
|
|
159
159
|
try {
|
|
160
160
|
const binding = require('@lancedb/lancedb-win32-ia32-msvc');
|
|
161
161
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-ia32-msvc/package.json').version;
|
|
162
|
-
if (bindingPackageVersion !== '0.
|
|
163
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
162
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
163
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
164
164
|
}
|
|
165
165
|
return binding;
|
|
166
166
|
}
|
|
@@ -178,8 +178,8 @@ function requireNative() {
|
|
|
178
178
|
try {
|
|
179
179
|
const binding = require('@lancedb/lancedb-win32-arm64-msvc');
|
|
180
180
|
const bindingPackageVersion = require('@lancedb/lancedb-win32-arm64-msvc/package.json').version;
|
|
181
|
-
if (bindingPackageVersion !== '0.
|
|
182
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
181
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
182
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
183
183
|
}
|
|
184
184
|
return binding;
|
|
185
185
|
}
|
|
@@ -201,8 +201,8 @@ function requireNative() {
|
|
|
201
201
|
try {
|
|
202
202
|
const binding = require('@lancedb/lancedb-darwin-universal');
|
|
203
203
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-universal/package.json').version;
|
|
204
|
-
if (bindingPackageVersion !== '0.
|
|
205
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
204
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
205
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
206
206
|
}
|
|
207
207
|
return binding;
|
|
208
208
|
}
|
|
@@ -219,8 +219,8 @@ function requireNative() {
|
|
|
219
219
|
try {
|
|
220
220
|
const binding = require('@lancedb/lancedb-darwin-x64');
|
|
221
221
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-x64/package.json').version;
|
|
222
|
-
if (bindingPackageVersion !== '0.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
222
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
224
224
|
}
|
|
225
225
|
return binding;
|
|
226
226
|
}
|
|
@@ -238,8 +238,8 @@ function requireNative() {
|
|
|
238
238
|
try {
|
|
239
239
|
const binding = require('@lancedb/lancedb-darwin-arm64');
|
|
240
240
|
const bindingPackageVersion = require('@lancedb/lancedb-darwin-arm64/package.json').version;
|
|
241
|
-
if (bindingPackageVersion !== '0.
|
|
242
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
241
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
243
243
|
}
|
|
244
244
|
return binding;
|
|
245
245
|
}
|
|
@@ -262,8 +262,8 @@ function requireNative() {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = require('@lancedb/lancedb-freebsd-x64');
|
|
264
264
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-x64/package.json').version;
|
|
265
|
-
if (bindingPackageVersion !== '0.
|
|
266
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
265
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
266
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
267
267
|
}
|
|
268
268
|
return binding;
|
|
269
269
|
}
|
|
@@ -281,8 +281,8 @@ function requireNative() {
|
|
|
281
281
|
try {
|
|
282
282
|
const binding = require('@lancedb/lancedb-freebsd-arm64');
|
|
283
283
|
const bindingPackageVersion = require('@lancedb/lancedb-freebsd-arm64/package.json').version;
|
|
284
|
-
if (bindingPackageVersion !== '0.
|
|
285
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
284
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
285
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
286
286
|
}
|
|
287
287
|
return binding;
|
|
288
288
|
}
|
|
@@ -306,8 +306,8 @@ function requireNative() {
|
|
|
306
306
|
try {
|
|
307
307
|
const binding = require('@lancedb/lancedb-linux-x64-musl');
|
|
308
308
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-musl/package.json').version;
|
|
309
|
-
if (bindingPackageVersion !== '0.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
309
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
311
311
|
}
|
|
312
312
|
return binding;
|
|
313
313
|
}
|
|
@@ -325,8 +325,8 @@ function requireNative() {
|
|
|
325
325
|
try {
|
|
326
326
|
const binding = require('@lancedb/lancedb-linux-x64-gnu');
|
|
327
327
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-x64-gnu/package.json').version;
|
|
328
|
-
if (bindingPackageVersion !== '0.
|
|
329
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
328
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
330
330
|
}
|
|
331
331
|
return binding;
|
|
332
332
|
}
|
|
@@ -346,8 +346,8 @@ function requireNative() {
|
|
|
346
346
|
try {
|
|
347
347
|
const binding = require('@lancedb/lancedb-linux-arm64-musl');
|
|
348
348
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-musl/package.json').version;
|
|
349
|
-
if (bindingPackageVersion !== '0.
|
|
350
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
349
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
350
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
351
351
|
}
|
|
352
352
|
return binding;
|
|
353
353
|
}
|
|
@@ -365,8 +365,8 @@ function requireNative() {
|
|
|
365
365
|
try {
|
|
366
366
|
const binding = require('@lancedb/lancedb-linux-arm64-gnu');
|
|
367
367
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm64-gnu/package.json').version;
|
|
368
|
-
if (bindingPackageVersion !== '0.
|
|
369
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
368
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
369
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
370
370
|
}
|
|
371
371
|
return binding;
|
|
372
372
|
}
|
|
@@ -386,8 +386,8 @@ function requireNative() {
|
|
|
386
386
|
try {
|
|
387
387
|
const binding = require('@lancedb/lancedb-linux-arm-musleabihf');
|
|
388
388
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-musleabihf/package.json').version;
|
|
389
|
-
if (bindingPackageVersion !== '0.
|
|
390
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
389
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
390
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
391
391
|
}
|
|
392
392
|
return binding;
|
|
393
393
|
}
|
|
@@ -405,8 +405,8 @@ function requireNative() {
|
|
|
405
405
|
try {
|
|
406
406
|
const binding = require('@lancedb/lancedb-linux-arm-gnueabihf');
|
|
407
407
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-arm-gnueabihf/package.json').version;
|
|
408
|
-
if (bindingPackageVersion !== '0.
|
|
409
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
408
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
409
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
410
410
|
}
|
|
411
411
|
return binding;
|
|
412
412
|
}
|
|
@@ -426,8 +426,8 @@ function requireNative() {
|
|
|
426
426
|
try {
|
|
427
427
|
const binding = require('@lancedb/lancedb-linux-loong64-musl');
|
|
428
428
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-musl/package.json').version;
|
|
429
|
-
if (bindingPackageVersion !== '0.
|
|
430
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
429
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
430
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
431
431
|
}
|
|
432
432
|
return binding;
|
|
433
433
|
}
|
|
@@ -445,8 +445,8 @@ function requireNative() {
|
|
|
445
445
|
try {
|
|
446
446
|
const binding = require('@lancedb/lancedb-linux-loong64-gnu');
|
|
447
447
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-loong64-gnu/package.json').version;
|
|
448
|
-
if (bindingPackageVersion !== '0.
|
|
449
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
448
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
449
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
450
450
|
}
|
|
451
451
|
return binding;
|
|
452
452
|
}
|
|
@@ -466,8 +466,8 @@ function requireNative() {
|
|
|
466
466
|
try {
|
|
467
467
|
const binding = require('@lancedb/lancedb-linux-riscv64-musl');
|
|
468
468
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-musl/package.json').version;
|
|
469
|
-
if (bindingPackageVersion !== '0.
|
|
470
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
469
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
470
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
471
471
|
}
|
|
472
472
|
return binding;
|
|
473
473
|
}
|
|
@@ -485,8 +485,8 @@ function requireNative() {
|
|
|
485
485
|
try {
|
|
486
486
|
const binding = require('@lancedb/lancedb-linux-riscv64-gnu');
|
|
487
487
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-riscv64-gnu/package.json').version;
|
|
488
|
-
if (bindingPackageVersion !== '0.
|
|
489
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
488
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
489
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
490
490
|
}
|
|
491
491
|
return binding;
|
|
492
492
|
}
|
|
@@ -505,8 +505,8 @@ function requireNative() {
|
|
|
505
505
|
try {
|
|
506
506
|
const binding = require('@lancedb/lancedb-linux-ppc64-gnu');
|
|
507
507
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-ppc64-gnu/package.json').version;
|
|
508
|
-
if (bindingPackageVersion !== '0.
|
|
509
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
508
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
509
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
510
510
|
}
|
|
511
511
|
return binding;
|
|
512
512
|
}
|
|
@@ -524,8 +524,8 @@ function requireNative() {
|
|
|
524
524
|
try {
|
|
525
525
|
const binding = require('@lancedb/lancedb-linux-s390x-gnu');
|
|
526
526
|
const bindingPackageVersion = require('@lancedb/lancedb-linux-s390x-gnu/package.json').version;
|
|
527
|
-
if (bindingPackageVersion !== '0.
|
|
528
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
527
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
528
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
529
529
|
}
|
|
530
530
|
return binding;
|
|
531
531
|
}
|
|
@@ -548,8 +548,8 @@ function requireNative() {
|
|
|
548
548
|
try {
|
|
549
549
|
const binding = require('@lancedb/lancedb-openharmony-arm64');
|
|
550
550
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm64/package.json').version;
|
|
551
|
-
if (bindingPackageVersion !== '0.
|
|
552
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
551
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
552
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
553
553
|
}
|
|
554
554
|
return binding;
|
|
555
555
|
}
|
|
@@ -567,8 +567,8 @@ function requireNative() {
|
|
|
567
567
|
try {
|
|
568
568
|
const binding = require('@lancedb/lancedb-openharmony-x64');
|
|
569
569
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-x64/package.json').version;
|
|
570
|
-
if (bindingPackageVersion !== '0.
|
|
571
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
570
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
571
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
572
572
|
}
|
|
573
573
|
return binding;
|
|
574
574
|
}
|
|
@@ -586,8 +586,8 @@ function requireNative() {
|
|
|
586
586
|
try {
|
|
587
587
|
const binding = require('@lancedb/lancedb-openharmony-arm');
|
|
588
588
|
const bindingPackageVersion = require('@lancedb/lancedb-openharmony-arm/package.json').version;
|
|
589
|
-
if (bindingPackageVersion !== '0.
|
|
590
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
589
|
+
if (bindingPackageVersion !== '0.40.0-beta.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
590
|
+
throw new Error(`Native binding package version mismatch, expected 0.40.0-beta.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
591
591
|
}
|
|
592
592
|
return binding;
|
|
593
593
|
}
|
|
@@ -664,6 +664,7 @@ module.exports = nativeBinding;
|
|
|
664
664
|
module.exports.BlobFile = nativeBinding.BlobFile;
|
|
665
665
|
module.exports.BranchContents = nativeBinding.BranchContents;
|
|
666
666
|
module.exports.Branches = nativeBinding.Branches;
|
|
667
|
+
module.exports.Catalog = nativeBinding.Catalog;
|
|
667
668
|
module.exports.Connection = nativeBinding.Connection;
|
|
668
669
|
module.exports.Index = nativeBinding.Index;
|
|
669
670
|
module.exports.Job = nativeBinding.Job;
|
|
@@ -671,6 +672,7 @@ module.exports.JsFullTextQuery = nativeBinding.JsFullTextQuery;
|
|
|
671
672
|
module.exports.JsHeaderProvider = nativeBinding.JsHeaderProvider;
|
|
672
673
|
module.exports.NapiScannable = nativeBinding.NapiScannable;
|
|
673
674
|
module.exports.NativeMergeInsertBuilder = nativeBinding.NativeMergeInsertBuilder;
|
|
675
|
+
module.exports.OAuthSession = nativeBinding.OAuthSession;
|
|
674
676
|
module.exports.PermutationBuilder = nativeBinding.PermutationBuilder;
|
|
675
677
|
module.exports.Query = nativeBinding.Query;
|
|
676
678
|
module.exports.RecordBatchIterator = nativeBinding.RecordBatchIterator;
|
package/dist/oauth.d.ts
CHANGED
|
@@ -4,9 +4,64 @@
|
|
|
4
4
|
export declare enum OAuthFlowType {
|
|
5
5
|
/** Client Credentials grant (service-to-service / M2M). */
|
|
6
6
|
ClientCredentials = "client_credentials",
|
|
7
|
+
/** Interactive Authorization Code grant, using PKCE by default. */
|
|
8
|
+
AuthorizationCode = "authorization_code",
|
|
9
|
+
/** Device Authorization grant for CLI and headless environments. */
|
|
10
|
+
DeviceCode = "device_code",
|
|
7
11
|
/** Azure Managed Identity via IMDS. */
|
|
8
12
|
AzureManagedIdentity = "azure_managed_identity"
|
|
9
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Options for the persistent OAuth token cache.
|
|
16
|
+
*
|
|
17
|
+
* The cache is opt-in: it is only used when set as `tokenCache` on
|
|
18
|
+
* {@link OAuthConfig}. Only refresh tokens are persisted, in a private
|
|
19
|
+
* directory with owner-only permissions, so short-lived processes can reuse
|
|
20
|
+
* an authenticated session instead of re-prompting on every start.
|
|
21
|
+
*
|
|
22
|
+
* Multiple identities (issuer, client, scopes, resource, audience, flow, client authentication)
|
|
23
|
+
* get separate cache entries. Within one identity the most recent login wins.
|
|
24
|
+
*/
|
|
25
|
+
export interface TokenCacheOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Directory that holds cached credentials. Defaults to
|
|
28
|
+
* `$XDG_CACHE_HOME/lancedb/oauth`, `$HOME/.cache/lancedb/oauth` on Unix,
|
|
29
|
+
* or `%LOCALAPPDATA%\\lancedb\\oauth` on Windows. The directory is created
|
|
30
|
+
* with owner-only permissions (`0700`) when missing.
|
|
31
|
+
*/
|
|
32
|
+
cacheDir?: string;
|
|
33
|
+
/**
|
|
34
|
+
* How long to wait for the cross-process refresh lock before failing, in
|
|
35
|
+
* seconds (default: 30).
|
|
36
|
+
*/
|
|
37
|
+
lockTimeoutSecs?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* How the client authenticates to the OAuth token endpoint.
|
|
41
|
+
*
|
|
42
|
+
* The method applies to every OAuth request that carries client
|
|
43
|
+
* authentication: client-credentials, authorization-code exchange,
|
|
44
|
+
* refresh-token, and device-authorization requests. The Azure managed
|
|
45
|
+
* identity flow ignores this option.
|
|
46
|
+
*/
|
|
47
|
+
export declare enum ClientAuthMethod {
|
|
48
|
+
/**
|
|
49
|
+
* No client authentication, for public clients using PKCE or the device
|
|
50
|
+
* flow. Cannot be combined with `clientSecret`.
|
|
51
|
+
*/
|
|
52
|
+
None = "none",
|
|
53
|
+
/**
|
|
54
|
+
* HTTP Basic authentication. This is the RFC 6749 recommended method and
|
|
55
|
+
* the normal default for confidential clients, including default Okta
|
|
56
|
+
* applications. Requires `clientSecret`.
|
|
57
|
+
*/
|
|
58
|
+
ClientSecretBasic = "client_secret_basic",
|
|
59
|
+
/**
|
|
60
|
+
* Credentials in the request body, for providers configured to require it.
|
|
61
|
+
* Requires `clientSecret`.
|
|
62
|
+
*/
|
|
63
|
+
ClientSecretPost = "client_secret_post"
|
|
64
|
+
}
|
|
10
65
|
/**
|
|
11
66
|
* OAuth configuration for LanceDB authentication.
|
|
12
67
|
*
|
|
@@ -27,6 +82,18 @@ export declare enum OAuthFlowType {
|
|
|
27
82
|
* };
|
|
28
83
|
* ```
|
|
29
84
|
*
|
|
85
|
+
* Providers requiring an explicit target can set `resource` and/or `audience`:
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const targeted: OAuthConfig = {
|
|
88
|
+
* issuerUrl: "https://issuer.example.com",
|
|
89
|
+
* clientId: "app-id",
|
|
90
|
+
* clientSecret: "secret",
|
|
91
|
+
* scopes: ["read"],
|
|
92
|
+
* resource: "https://api.example.com",
|
|
93
|
+
* audience: "lancedb-api",
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
30
97
|
* @example Azure Managed Identity:
|
|
31
98
|
* ```typescript
|
|
32
99
|
* const config: OAuthConfig = {
|
|
@@ -36,6 +103,21 @@ export declare enum OAuthFlowType {
|
|
|
36
103
|
* flow: OAuthFlowType.AzureManagedIdentity,
|
|
37
104
|
* };
|
|
38
105
|
* ```
|
|
106
|
+
*
|
|
107
|
+
* @example Authorization Code with PKCE:
|
|
108
|
+
* The authorization URL is written to stderr before LanceDB tries to open a
|
|
109
|
+
* browser, so it can be copied in headless environments.
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const config: OAuthConfig = {
|
|
112
|
+
* issuerUrl: "https://login.microsoftonline.com/{tenant}/v2.0",
|
|
113
|
+
* clientId: "app-id",
|
|
114
|
+
* scopes: ["openid", "api://lancedb-api/access"],
|
|
115
|
+
* flow: OAuthFlowType.AuthorizationCode,
|
|
116
|
+
* };
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* Device Authorization writes the verification URL and user code to stderr
|
|
120
|
+
* before polling begins.
|
|
39
121
|
*/
|
|
40
122
|
export interface OAuthConfig {
|
|
41
123
|
/**
|
|
@@ -51,10 +133,35 @@ export interface OAuthConfig {
|
|
|
51
133
|
* For example: `["api://{app_id}/.default"]`
|
|
52
134
|
*/
|
|
53
135
|
scopes: string[];
|
|
136
|
+
/**
|
|
137
|
+
* Resource indicator (RFC 8707), forwarded verbatim to authorization and token
|
|
138
|
+
* endpoints, including refresh requests. Must be an absolute URI without a
|
|
139
|
+
* fragment. Not supported for Azure managed identity.
|
|
140
|
+
*/
|
|
141
|
+
resource?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Provider-specific audience, forwarded to authorization and token endpoints,
|
|
144
|
+
* including refresh requests. Not supported for Azure managed identity.
|
|
145
|
+
*/
|
|
146
|
+
audience?: string;
|
|
54
147
|
/** Authentication flow (default: ClientCredentials). */
|
|
55
148
|
flow?: OAuthFlowType;
|
|
56
149
|
/** Client secret (required for ClientCredentials). */
|
|
57
150
|
clientSecret?: string;
|
|
151
|
+
/**
|
|
152
|
+
* How the client authenticates to the token endpoint (default: auto).
|
|
153
|
+
* With a `clientSecret` the default is `ClientAuthMethod.ClientSecretBasic`,
|
|
154
|
+
* which matches the RFC 6749 recommendation and the default configuration
|
|
155
|
+
* of Okta confidential applications; without a secret the client is public
|
|
156
|
+
* and no client authentication is sent.
|
|
157
|
+
*/
|
|
158
|
+
clientAuthMethod?: ClientAuthMethod;
|
|
159
|
+
/** Loopback redirect URI for AuthorizationCode. */
|
|
160
|
+
redirectUri?: string;
|
|
161
|
+
/** Port for the AuthorizationCode loopback callback server (default: 8400). */
|
|
162
|
+
callbackPort?: number;
|
|
163
|
+
/** Protect AuthorizationCode with S256 PKCE (default: true). */
|
|
164
|
+
usePkce?: boolean;
|
|
58
165
|
/** Client ID for user-assigned managed identity (AzureManagedIdentity). */
|
|
59
166
|
managedIdentityClientId?: string;
|
|
60
167
|
/**
|
|
@@ -63,4 +170,102 @@ export interface OAuthConfig {
|
|
|
63
170
|
* the TTL, each request refreshes the token.
|
|
64
171
|
*/
|
|
65
172
|
refreshBufferSecs?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Opt in to the persistent token cache so short-lived processes reuse one
|
|
175
|
+
* session. Only refresh tokens are persisted. Only supported by
|
|
176
|
+
* AuthorizationCode and DeviceCode; Azure managed identity is rejected.
|
|
177
|
+
* Default: unset (memory only).
|
|
178
|
+
*/
|
|
179
|
+
tokenCache?: TokenCacheOptions;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Safe, non-secret view of a cached OAuth session, returned by
|
|
183
|
+
* {@link OAuthSession.status} and {@link OAuthSession.login}.
|
|
184
|
+
*/
|
|
185
|
+
export interface SessionStatus {
|
|
186
|
+
/**
|
|
187
|
+
* Whether a cached session exists that can obtain tokens without
|
|
188
|
+
* interactive authentication. Because access tokens are not persisted,
|
|
189
|
+
* this is `true` exactly when a refresh token is cached; the next
|
|
190
|
+
* connection refreshes with it rather than opening a browser or device
|
|
191
|
+
* prompt.
|
|
192
|
+
*/
|
|
193
|
+
refreshable: boolean;
|
|
194
|
+
/** Canonical issuer URL of the cached session. */
|
|
195
|
+
issuerUrl: string;
|
|
196
|
+
/** Client ID of the cached session. */
|
|
197
|
+
clientId: string;
|
|
198
|
+
/** Canonical (sorted, de-duplicated) scope set of the cached session. */
|
|
199
|
+
scopes: string[];
|
|
200
|
+
/** Resource indicator used to obtain the cached session, if configured. */
|
|
201
|
+
resource?: string;
|
|
202
|
+
/** Provider-specific audience used to obtain the cached session, if configured. */
|
|
203
|
+
audience?: string;
|
|
204
|
+
/** Flow that produced the cached session. */
|
|
205
|
+
flow: string;
|
|
206
|
+
/** When the cached session was obtained, as Unix seconds. */
|
|
207
|
+
obtainedAt?: number;
|
|
208
|
+
}
|
|
209
|
+
/** Result of {@link OAuthSession.logout}. */
|
|
210
|
+
export interface SessionLogout {
|
|
211
|
+
/**
|
|
212
|
+
* Whether a cached credential was removed. `false` means no matching
|
|
213
|
+
* session was cached; logout is idempotent.
|
|
214
|
+
*/
|
|
215
|
+
removed: boolean;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Explicit OAuth session lifecycle for the persistent token cache: eager
|
|
219
|
+
* `login`, non-secret `status`, and local `logout`.
|
|
220
|
+
*
|
|
221
|
+
* A session is built from the same {@link OAuthConfig} used to connect
|
|
222
|
+
* (including its `tokenCache` options). A connection created with the same
|
|
223
|
+
* configuration shares the cache, so logging in here prepares tokens for
|
|
224
|
+
* later processes without any database request.
|
|
225
|
+
*
|
|
226
|
+
* `login` always runs the configured interactive flow and replaces the cached
|
|
227
|
+
* session (the most recent login wins). `logout` removes only the local
|
|
228
|
+
* credential; it does not revoke anything with the provider and does not sign
|
|
229
|
+
* out of a browser SSO session.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```typescript
|
|
233
|
+
* const config: OAuthConfig = {
|
|
234
|
+
* issuerUrl: "https://issuer.example.com",
|
|
235
|
+
* clientId: "my-app",
|
|
236
|
+
* scopes: ["openid", "offline_access"],
|
|
237
|
+
* flow: OAuthFlowType.DeviceCode,
|
|
238
|
+
* tokenCache: { cacheDir: "/tmp/my-app/oauth-cache" },
|
|
239
|
+
* };
|
|
240
|
+
* const session = new OAuthSession(config);
|
|
241
|
+
* const status = await session.login();
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
export declare class OAuthSession {
|
|
245
|
+
private readonly inner;
|
|
246
|
+
/** Create a session manager for the given OAuth configuration. */
|
|
247
|
+
constructor(config: OAuthConfig);
|
|
248
|
+
/**
|
|
249
|
+
* Eagerly run the configured authentication flow and store the session.
|
|
250
|
+
*
|
|
251
|
+
* A successful login always replaces any prior cached session for this
|
|
252
|
+
* identity; if the provider does not issue a refresh token (for example
|
|
253
|
+
* without `offline_access`), the previous record is removed and the status
|
|
254
|
+
* reports `refreshable == false`.
|
|
255
|
+
*/
|
|
256
|
+
login(): Promise<SessionStatus>;
|
|
257
|
+
/**
|
|
258
|
+
* Report whether a matching cached session exists, with safe metadata.
|
|
259
|
+
*
|
|
260
|
+
* This never contacts the identity provider and never exposes token values.
|
|
261
|
+
*/
|
|
262
|
+
status(): Promise<SessionStatus>;
|
|
263
|
+
/**
|
|
264
|
+
* Remove the matching local cached credential.
|
|
265
|
+
*
|
|
266
|
+
* This only deletes the local cache entry. It does not revoke the refresh
|
|
267
|
+
* token with the provider and does not sign out of a browser SSO session.
|
|
268
|
+
* Repeated calls succeed; `removed` reports whether a credential existed.
|
|
269
|
+
*/
|
|
270
|
+
logout(): Promise<SessionLogout>;
|
|
66
271
|
}
|