@hajewski/latticedb 0.15.0 → 0.17.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 +287 -26
- package/dist/database.d.ts +124 -7
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +117 -5
- package/dist/database.js.map +1 -1
- package/dist/embedding.d.ts +1 -1
- package/dist/embedding.js +1 -1
- package/dist/ffi/bindings.d.ts +11 -1
- package/dist/ffi/bindings.d.ts.map +1 -1
- package/dist/ffi/bindings.js +70 -1
- package/dist/ffi/bindings.js.map +1 -1
- package/dist/ffi/index.d.ts +93 -4
- package/dist/ffi/index.d.ts.map +1 -1
- package/dist/ffi/index.js +368 -43
- package/dist/ffi/index.js.map +1 -1
- package/dist/ffi/library.d.ts +59 -4
- package/dist/ffi/library.d.ts.map +1 -1
- package/dist/ffi/library.js +198 -36
- package/dist/ffi/library.js.map +1 -1
- package/dist/ffi/types.d.ts +52 -4
- package/dist/ffi/types.d.ts.map +1 -1
- package/dist/ffi/types.js +46 -0
- package/dist/ffi/types.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/transaction.d.ts +18 -3
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +36 -4
- package/dist/transaction.js.map +1 -1
- package/dist/types.d.ts +29 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/lib/darwin-arm64/liblattice.dylib +0 -0
- package/lib/darwin-x64/liblattice.dylib +0 -0
- package/lib/linux-arm64/liblattice.so +0 -0
- package/lib/linux-x64/liblattice.so +0 -0
- package/lib/win32-arm64/lattice.dll +0 -0
- package/lib/win32-x64/lattice.dll +0 -0
- package/package.json +1 -1
package/dist/ffi/library.js
CHANGED
|
@@ -5,10 +5,16 @@
|
|
|
5
5
|
* Search order mirrors Python bindings:
|
|
6
6
|
* 1. LATTICE_LIB_PATH environment variable
|
|
7
7
|
* 2. Bundled in package (lib/<platform>/ or libc-aware linux variants)
|
|
8
|
-
* 3.
|
|
9
|
-
* 4.
|
|
10
|
-
* 5.
|
|
11
|
-
* 6.
|
|
8
|
+
* 3. Electron resource directories (asar.unpacked, extraResources, extraFiles)
|
|
9
|
+
* 4. LATTICE_PREFIX environment variable
|
|
10
|
+
* 5. Development build (zig-out/lib, plus zig-out/bin on Windows)
|
|
11
|
+
* 6. pkg-config lattice libdir
|
|
12
|
+
* 7. System paths
|
|
13
|
+
*
|
|
14
|
+
* Electron note: `fs.existsSync()` is asar-aware but `dlopen()`/`LoadLibraryW()`
|
|
15
|
+
* are not, so a candidate that resolves inside an `.asar` archive is unusable
|
|
16
|
+
* even though it appears to exist. Such candidates are rewritten to their
|
|
17
|
+
* `.asar.unpacked` twin, and reported explicitly when no twin was unpacked.
|
|
12
18
|
*/
|
|
13
19
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
20
|
if (k2 === undefined) k2 = k;
|
|
@@ -47,16 +53,36 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
53
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
54
|
};
|
|
49
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
+
exports.ELECTRON_ASAR_UNPACK_GLOB = void 0;
|
|
57
|
+
exports.isElectronRuntime = isElectronRuntime;
|
|
58
|
+
exports.isInsideAsarArchive = isInsideAsarArchive;
|
|
59
|
+
exports.fixPathForAsarUnpack = fixPathForAsarUnpack;
|
|
50
60
|
exports.getBundledPlatformDirs = getBundledPlatformDirs;
|
|
51
61
|
exports.getBundledLibraryCandidates = getBundledLibraryCandidates;
|
|
62
|
+
exports.getElectronLibraryCandidates = getElectronLibraryCandidates;
|
|
63
|
+
exports.buildNotFoundError = buildNotFoundError;
|
|
52
64
|
exports.getLibrary = getLibrary;
|
|
53
65
|
exports.isLibraryAvailable = isLibraryAvailable;
|
|
54
66
|
exports.getLibraryPath = getLibraryPath;
|
|
67
|
+
exports.resolveLibraryPath = resolveLibraryPath;
|
|
55
68
|
const child_process_1 = require("child_process");
|
|
56
69
|
const koffi_1 = __importDefault(require("koffi"));
|
|
57
70
|
const fs = __importStar(require("fs"));
|
|
58
71
|
const path = __importStar(require("path"));
|
|
59
72
|
const os = __importStar(require("os"));
|
|
73
|
+
/**
|
|
74
|
+
* Package name, used to locate the bundled library inside an Electron
|
|
75
|
+
* `app.asar.unpacked` tree when `__dirname` has been rewritten by a bundler.
|
|
76
|
+
*/
|
|
77
|
+
const PACKAGE_NAME = '@hajewski/latticedb';
|
|
78
|
+
/**
|
|
79
|
+
* Glob that Electron packagers must unpack so the native loader can read the
|
|
80
|
+
* bundled shared library. Use it in electron-builder's `asarUnpack`, or in
|
|
81
|
+
* `@electron/packager`'s `asar.unpack`.
|
|
82
|
+
*/
|
|
83
|
+
exports.ELECTRON_ASAR_UNPACK_GLOB = `**/node_modules/${PACKAGE_NAME}/lib/**`;
|
|
84
|
+
/** Matches an asar archive path segment, but not its `.asar.unpacked` sibling. */
|
|
85
|
+
const ASAR_SEGMENT = /\.asar[\\/]/i;
|
|
60
86
|
/**
|
|
61
87
|
* Get the library filename for the current platform.
|
|
62
88
|
*/
|
|
@@ -70,6 +96,38 @@ function getLibName() {
|
|
|
70
96
|
return 'liblattice.so';
|
|
71
97
|
}
|
|
72
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Check whether the current process is an Electron runtime (main, renderer, or
|
|
101
|
+
* utility process, including `ELECTRON_RUN_AS_NODE`).
|
|
102
|
+
*/
|
|
103
|
+
function isElectronRuntime() {
|
|
104
|
+
const version = process.versions.electron;
|
|
105
|
+
return typeof version === 'string' && version.length > 0;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check whether a path resolves inside a packed asar archive.
|
|
109
|
+
*
|
|
110
|
+
* Paths under `.asar.unpacked/` are extracted to the real filesystem and are
|
|
111
|
+
* therefore not considered archived.
|
|
112
|
+
*/
|
|
113
|
+
function isInsideAsarArchive(candidate) {
|
|
114
|
+
return ASAR_SEGMENT.test(candidate);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Rewrite an archived asar path to its `.asar.unpacked` twin.
|
|
118
|
+
*
|
|
119
|
+
* Returns the path unchanged when it is not inside an archive.
|
|
120
|
+
*/
|
|
121
|
+
function fixPathForAsarUnpack(candidate) {
|
|
122
|
+
return candidate.replace(/\.asar([\\/])/i, '.asar.unpacked$1');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get Electron's `process.resourcesPath`, or null outside Electron.
|
|
126
|
+
*/
|
|
127
|
+
function getResourcesPath() {
|
|
128
|
+
const resourcesPath = process.resourcesPath;
|
|
129
|
+
return typeof resourcesPath === 'string' && resourcesPath.length > 0 ? resourcesPath : null;
|
|
130
|
+
}
|
|
73
131
|
/**
|
|
74
132
|
* Detect the libc variant for Linux package bundles.
|
|
75
133
|
*/
|
|
@@ -121,13 +179,67 @@ function getBundledLibraryCandidates(baseDir = __dirname) {
|
|
|
121
179
|
const libName = getLibName();
|
|
122
180
|
return getBundledPlatformDirs().map((platformDir) => path.join(baseDir, '../../lib', platformDir, libName));
|
|
123
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Get Electron-specific library candidates for the current platform.
|
|
184
|
+
*
|
|
185
|
+
* Covers the layouts an Electron app can end up with:
|
|
186
|
+
* - `asarUnpack` of this package's `lib/` directory
|
|
187
|
+
* - an unpacked (`asar: false`) application directory
|
|
188
|
+
* - `extraResources` copying the library, or a platform directory, into
|
|
189
|
+
* `process.resourcesPath`
|
|
190
|
+
* - `extraFiles` copying the library next to the executable
|
|
191
|
+
*
|
|
192
|
+
* Returns an empty array outside Electron.
|
|
193
|
+
*/
|
|
194
|
+
function getElectronLibraryCandidates() {
|
|
195
|
+
const resourcesPath = getResourcesPath();
|
|
196
|
+
if (!resourcesPath) {
|
|
197
|
+
return [];
|
|
198
|
+
}
|
|
199
|
+
const libName = getLibName();
|
|
200
|
+
const candidates = [];
|
|
201
|
+
for (const platformDir of getBundledPlatformDirs()) {
|
|
202
|
+
for (const appDir of ['app.asar.unpacked', 'app']) {
|
|
203
|
+
candidates.push(path.join(resourcesPath, appDir, 'node_modules', PACKAGE_NAME, 'lib', platformDir, libName));
|
|
204
|
+
}
|
|
205
|
+
candidates.push(path.join(resourcesPath, 'lib', platformDir, libName));
|
|
206
|
+
candidates.push(path.join(resourcesPath, platformDir, libName));
|
|
207
|
+
}
|
|
208
|
+
candidates.push(path.join(resourcesPath, 'lib', libName));
|
|
209
|
+
candidates.push(path.join(resourcesPath, libName));
|
|
210
|
+
candidates.push(path.join(path.dirname(process.execPath), libName));
|
|
211
|
+
return candidates;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Accept a candidate path only if the native loader can actually open it.
|
|
215
|
+
*
|
|
216
|
+
* An archived asar candidate is rewritten to its unpacked twin; if no twin was
|
|
217
|
+
* unpacked the candidate is recorded in `asarBlocked` and rejected, because
|
|
218
|
+
* `dlopen()` cannot read through the asar virtual filesystem.
|
|
219
|
+
*/
|
|
220
|
+
function acceptCandidate(candidate, asarBlocked) {
|
|
221
|
+
if (isInsideAsarArchive(candidate)) {
|
|
222
|
+
const unpacked = fixPathForAsarUnpack(candidate);
|
|
223
|
+
if (fs.existsSync(unpacked)) {
|
|
224
|
+
return unpacked;
|
|
225
|
+
}
|
|
226
|
+
if (fs.existsSync(candidate) && !asarBlocked.includes(candidate)) {
|
|
227
|
+
asarBlocked.push(candidate);
|
|
228
|
+
}
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
return fs.existsSync(candidate) ? candidate : null;
|
|
232
|
+
}
|
|
124
233
|
/**
|
|
125
234
|
* Find the lattice shared library.
|
|
126
235
|
*
|
|
127
|
-
* @returns
|
|
236
|
+
* @returns The resolved path (or null), plus any candidates that were found
|
|
237
|
+
* inside a packed asar archive and therefore could not be loaded.
|
|
128
238
|
*/
|
|
129
239
|
function findLibrary() {
|
|
130
240
|
const libName = getLibName();
|
|
241
|
+
const asarBlocked = [];
|
|
242
|
+
const accept = (candidate) => acceptCandidate(candidate, asarBlocked);
|
|
131
243
|
// 1. Environment variable override (explicit path)
|
|
132
244
|
const envPath = process.env.LATTICE_LIB_PATH;
|
|
133
245
|
if (envPath) {
|
|
@@ -135,12 +247,15 @@ function findLibrary() {
|
|
|
135
247
|
// Could be direct path to library or directory containing it
|
|
136
248
|
const stats = fs.statSync(envPath);
|
|
137
249
|
if (stats.isFile()) {
|
|
138
|
-
|
|
250
|
+
const resolved = accept(envPath);
|
|
251
|
+
if (resolved) {
|
|
252
|
+
return { libPath: resolved, asarBlocked };
|
|
253
|
+
}
|
|
139
254
|
}
|
|
140
255
|
if (stats.isDirectory()) {
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
143
|
-
return libPath;
|
|
256
|
+
const resolved = accept(path.join(envPath, libName));
|
|
257
|
+
if (resolved) {
|
|
258
|
+
return { libPath: resolved, asarBlocked };
|
|
144
259
|
}
|
|
145
260
|
}
|
|
146
261
|
}
|
|
@@ -148,41 +263,59 @@ function findLibrary() {
|
|
|
148
263
|
// 2. Bundled in package (for npm installs)
|
|
149
264
|
// Goes up from src/ffi/ to package root, then into lib/
|
|
150
265
|
for (const bundledPath of getBundledLibraryCandidates()) {
|
|
151
|
-
|
|
152
|
-
|
|
266
|
+
const resolved = accept(bundledPath);
|
|
267
|
+
if (resolved) {
|
|
268
|
+
return { libPath: resolved, asarBlocked };
|
|
153
269
|
}
|
|
154
270
|
}
|
|
155
|
-
// 3.
|
|
271
|
+
// 3. Electron resource directories (no-op outside Electron)
|
|
272
|
+
for (const electronPath of getElectronLibraryCandidates()) {
|
|
273
|
+
const resolved = accept(electronPath);
|
|
274
|
+
if (resolved) {
|
|
275
|
+
return { libPath: resolved, asarBlocked };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
// 4. Installed prefix override. An installed Windows DLL sits in bin/, with
|
|
279
|
+
// only the import library under lib/.
|
|
156
280
|
const prefix = process.env.LATTICE_PREFIX;
|
|
157
281
|
if (prefix) {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
282
|
+
const prefixDirs = process.platform === 'win32' ? ['bin', 'lib'] : ['lib'];
|
|
283
|
+
for (const prefixDir of prefixDirs) {
|
|
284
|
+
const resolved = accept(path.join(prefix, prefixDir, libName));
|
|
285
|
+
if (resolved) {
|
|
286
|
+
return { libPath: resolved, asarBlocked };
|
|
287
|
+
}
|
|
161
288
|
}
|
|
162
289
|
}
|
|
163
|
-
//
|
|
164
|
-
// Goes up from bindings/typescript/src/ffi/ to repo root
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
290
|
+
// 5. Development build (zig-out/lib)
|
|
291
|
+
// Goes up from bindings/typescript/src/ffi/ to repo root. Windows keeps the
|
|
292
|
+
// DLL beside the executables and leaves only the import library under lib/.
|
|
293
|
+
const devDirs = process.platform === 'win32'
|
|
294
|
+
? ['../../../../zig-out/bin', '../../../../zig-out/lib']
|
|
295
|
+
: ['../../../../zig-out/lib'];
|
|
296
|
+
for (const devDir of devDirs) {
|
|
297
|
+
const devPath = accept(path.join(__dirname, devDir, libName));
|
|
298
|
+
if (devPath) {
|
|
299
|
+
return { libPath: devPath, asarBlocked };
|
|
300
|
+
}
|
|
168
301
|
}
|
|
169
|
-
//
|
|
302
|
+
// 6. pkg-config metadata
|
|
170
303
|
try {
|
|
171
304
|
const libDir = (0, child_process_1.execFileSync)('pkg-config', ['--variable=libdir', 'lattice'], {
|
|
172
305
|
encoding: 'utf8',
|
|
173
306
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
174
307
|
}).trim();
|
|
175
308
|
if (libDir) {
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
return
|
|
309
|
+
const resolved = accept(path.join(libDir, libName));
|
|
310
|
+
if (resolved) {
|
|
311
|
+
return { libPath: resolved, asarBlocked };
|
|
179
312
|
}
|
|
180
313
|
}
|
|
181
314
|
}
|
|
182
315
|
catch {
|
|
183
316
|
// pkg-config unavailable or lattice.pc not present
|
|
184
317
|
}
|
|
185
|
-
//
|
|
318
|
+
// 7. System paths
|
|
186
319
|
const systemPaths = [
|
|
187
320
|
'/usr/local/lib',
|
|
188
321
|
'/usr/lib',
|
|
@@ -194,12 +327,36 @@ function findLibrary() {
|
|
|
194
327
|
systemPaths.unshift('/usr/local/opt/latticedb/lib');
|
|
195
328
|
}
|
|
196
329
|
for (const dir of systemPaths) {
|
|
197
|
-
const
|
|
198
|
-
if (
|
|
199
|
-
return libPath;
|
|
330
|
+
const resolved = accept(path.join(dir, libName));
|
|
331
|
+
if (resolved) {
|
|
332
|
+
return { libPath: resolved, asarBlocked };
|
|
200
333
|
}
|
|
201
334
|
}
|
|
202
|
-
return null;
|
|
335
|
+
return { libPath: null, asarBlocked };
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Build the "library not found" error, adding Electron packaging guidance when
|
|
339
|
+
* the runtime or the rejected candidates call for it.
|
|
340
|
+
*/
|
|
341
|
+
function buildNotFoundError(asarBlocked) {
|
|
342
|
+
const parts = [
|
|
343
|
+
'Could not find liblattice shared library. ' +
|
|
344
|
+
'Set LATTICE_LIB_PATH or LATTICE_PREFIX, ' +
|
|
345
|
+
'configure PKG_CONFIG_PATH for an installed build, ' +
|
|
346
|
+
'or install lattice-db with bundled binaries, ' +
|
|
347
|
+
'or build from source with "zig build shared".',
|
|
348
|
+
];
|
|
349
|
+
if (asarBlocked.length > 0) {
|
|
350
|
+
parts.push(`The library was found inside a packed Electron asar archive (${asarBlocked.join(', ')}), ` +
|
|
351
|
+
'which the native loader cannot read. Unpack it, for example with electron-builder ' +
|
|
352
|
+
`"asarUnpack": ["${exports.ELECTRON_ASAR_UNPACK_GLOB}"].`);
|
|
353
|
+
}
|
|
354
|
+
else if (isElectronRuntime()) {
|
|
355
|
+
parts.push('Running under Electron: bundlers rewrite __dirname, so the packaged library may not sit ' +
|
|
356
|
+
`beside this module. Add "asarUnpack": ["${exports.ELECTRON_ASAR_UNPACK_GLOB}"], ship the library ` +
|
|
357
|
+
'through extraResources, or set LATTICE_LIB_PATH before opening a database.');
|
|
358
|
+
}
|
|
359
|
+
return new Error(parts.join(' '));
|
|
203
360
|
}
|
|
204
361
|
// Cached library instance
|
|
205
362
|
let _lib = null;
|
|
@@ -213,13 +370,9 @@ function getLibrary() {
|
|
|
213
370
|
if (_lib) {
|
|
214
371
|
return _lib;
|
|
215
372
|
}
|
|
216
|
-
const libPath = findLibrary();
|
|
373
|
+
const { libPath, asarBlocked } = findLibrary();
|
|
217
374
|
if (!libPath) {
|
|
218
|
-
throw
|
|
219
|
-
'Set LATTICE_LIB_PATH or LATTICE_PREFIX, ' +
|
|
220
|
-
'configure PKG_CONFIG_PATH for an installed build, ' +
|
|
221
|
-
'or install lattice-db with bundled binaries, ' +
|
|
222
|
-
'or build from source with "zig build shared".');
|
|
375
|
+
throw buildNotFoundError(asarBlocked);
|
|
223
376
|
}
|
|
224
377
|
try {
|
|
225
378
|
_lib = koffi_1.default.load(libPath);
|
|
@@ -237,7 +390,7 @@ function isLibraryAvailable() {
|
|
|
237
390
|
try {
|
|
238
391
|
if (_lib)
|
|
239
392
|
return true;
|
|
240
|
-
return findLibrary() !== null;
|
|
393
|
+
return findLibrary().libPath !== null;
|
|
241
394
|
}
|
|
242
395
|
catch {
|
|
243
396
|
return false;
|
|
@@ -249,4 +402,13 @@ function isLibraryAvailable() {
|
|
|
249
402
|
function getLibraryPath() {
|
|
250
403
|
return _libPath;
|
|
251
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Resolve the shared library path without loading it.
|
|
407
|
+
*
|
|
408
|
+
* Useful for Electron build scripts that stage the library into
|
|
409
|
+
* `extraResources`, and for diagnosing packaging problems at runtime.
|
|
410
|
+
*/
|
|
411
|
+
function resolveLibraryPath() {
|
|
412
|
+
return findLibrary().libPath;
|
|
413
|
+
}
|
|
252
414
|
//# sourceMappingURL=library.js.map
|
package/dist/ffi/library.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/ffi/library.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../src/ffi/library.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CH,8CAGC;AAQD,kDAEC;AAOD,oDAEC;AAkDD,wDAYC;AAKD,kEAKC;AAcD,oEAwBC;AA+ID,gDAwBC;AAWD,gCAiBC;AAKD,gDAOC;AAKD,wCAEC;AAQD,gDAEC;AA5YD,iDAAwD;AACxD,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAEzB;;;GAGG;AACH,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAE3C;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,mBAAmB,YAAY,SAAS,CAAC;AAElF,kFAAkF;AAClF,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC;;GAEG;AACH,SAAS,UAAU;IACjB,QAAQ,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,aAAa,CAAC;QACvB;YACE,OAAO,eAAe,CAAC;IAC3B,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAC1C,OAAO,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,SAAiB;IACnD,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAED;;;;GAIG;AACH,SA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MAAM,IAAI,KAAK,CAAC,kCAAkC,OAAO,KAAK,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAChC,IAAI,CAAC;QACH,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QACtB,OAAO,WAAW,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB;IAChC,OAAO,WAAW,EAAE,CAAC,OAAO,CAAC;AAC/B,CAAC"}
|
package/dist/ffi/types.d.ts
CHANGED
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* circular dependencies and ensure proper initialization order.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Error codes from lattice.h
|
|
8
|
+
* Error codes from lattice.h. A plain enum, not a const one, so that the
|
|
9
|
+
* package exports it as a value: JavaScript callers, and TypeScript compiled
|
|
10
|
+
* with isolatedModules, cannot read a const enum.
|
|
9
11
|
*/
|
|
10
|
-
export declare
|
|
12
|
+
export declare enum LatticeErrorCode {
|
|
11
13
|
Ok = 0,
|
|
12
14
|
Error = -1,
|
|
13
15
|
IoError = -2,
|
|
@@ -24,7 +26,53 @@ export declare const enum LatticeErrorCode {
|
|
|
24
26
|
OutOfMemory = -13,
|
|
25
27
|
Unsupported = -14,
|
|
26
28
|
ValueTooLarge = -15,
|
|
27
|
-
DatabaseLocked = -16
|
|
29
|
+
DatabaseLocked = -16,
|
|
30
|
+
/** A plain node delete was refused: the node still has relationships. */
|
|
31
|
+
HasRelationships = -17,
|
|
32
|
+
/** Open options contradict the vector index the database file records. */
|
|
33
|
+
ConfigMismatch = -18,
|
|
34
|
+
/**
|
|
35
|
+
* The file was written by a newer release that does not let this one write
|
|
36
|
+
* it. It opens with readOnly: true; a writable open writes nothing.
|
|
37
|
+
*/
|
|
38
|
+
NeedsNewerWriter = -19
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* lattice_open_options_v5 enum values. 0 means "not set" for each.
|
|
42
|
+
*/
|
|
43
|
+
export declare const enum LatticeSyncMode {
|
|
44
|
+
Default = 0,
|
|
45
|
+
Full = 1,
|
|
46
|
+
Normal = 2
|
|
47
|
+
}
|
|
48
|
+
export declare const enum LatticeFullFsync {
|
|
49
|
+
Default = 0,
|
|
50
|
+
Off = 1,
|
|
51
|
+
On = 2
|
|
52
|
+
}
|
|
53
|
+
export declare const enum LatticeVectorMetric {
|
|
54
|
+
Default = 0,
|
|
55
|
+
Cosine = 1,
|
|
56
|
+
Euclidean = 2,
|
|
57
|
+
DotProduct = 3
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* lattice_open_options_v5.changefeed_retention values. 0 keeps the file's policy.
|
|
61
|
+
*/
|
|
62
|
+
export declare const enum LatticeChangefeedRetention {
|
|
63
|
+
Default = 0,
|
|
64
|
+
All = 1,
|
|
65
|
+
Last = 2,
|
|
66
|
+
Age = 3,
|
|
67
|
+
Off = 4
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* lattice_checkpoint_mode values.
|
|
71
|
+
*/
|
|
72
|
+
export declare const enum LatticeCheckpointMode {
|
|
73
|
+
Passive = 0,
|
|
74
|
+
Full = 1,
|
|
75
|
+
Truncate = 2
|
|
28
76
|
}
|
|
29
77
|
/**
|
|
30
78
|
* Transaction modes
|
|
@@ -50,7 +98,7 @@ export declare const enum LatticeValueType {
|
|
|
50
98
|
/**
|
|
51
99
|
* Query diagnostic stages from the C API.
|
|
52
100
|
*/
|
|
53
|
-
export declare
|
|
101
|
+
export declare enum QueryErrorStage {
|
|
54
102
|
None = 0,
|
|
55
103
|
Parse = 1,
|
|
56
104
|
Semantic = 2,
|
package/dist/ffi/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ffi/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ffi/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,oBAAY,gBAAgB;IAC1B,EAAE,IAAI;IACN,KAAK,KAAK;IACV,OAAO,KAAK;IACZ,UAAU,KAAK;IACf,QAAQ,KAAK;IACb,aAAa,KAAK;IAClB,UAAU,KAAK;IACf,UAAU,KAAK;IACf,WAAW,KAAK;IAChB,QAAQ,KAAK;IACb,IAAI,MAAM;IACV,eAAe,MAAM;IACrB,QAAQ,MAAM;IACd,WAAW,MAAM;IACjB,WAAW,MAAM;IACjB,aAAa,MAAM;IACnB,cAAc,MAAM;IACpB,yEAAyE;IACzE,gBAAgB,MAAM;IACtB,0EAA0E;IAC1E,cAAc,MAAM;IACpB;;;OAGG;IACH,gBAAgB,MAAM;CACvB;AAED;;GAEG;AACH,0BAAkB,eAAe;IAC/B,OAAO,IAAI;IACX,IAAI,IAAI;IACR,MAAM,IAAI;CACX;AAED,0BAAkB,gBAAgB;IAChC,OAAO,IAAI;IACX,GAAG,IAAI;IACP,EAAE,IAAI;CACP;AAED,0BAAkB,mBAAmB;IACnC,OAAO,IAAI;IACX,MAAM,IAAI;IACV,SAAS,IAAI;IACb,UAAU,IAAI;CACf;AAED;;GAEG;AACH,0BAAkB,0BAA0B;IAC1C,OAAO,IAAI;IACX,GAAG,IAAI;IACP,IAAI,IAAI;IACR,GAAG,IAAI;IACP,GAAG,IAAI;CACR;AAED;;GAEG;AACH,0BAAkB,qBAAqB;IACrC,OAAO,IAAI;IACX,IAAI,IAAI;IACR,QAAQ,IAAI;CACb;AAED;;GAEG;AACH,0BAAkB,cAAc;IAC9B,QAAQ,IAAI;IACZ,SAAS,IAAI;CACd;AAED;;GAEG;AACH,0BAAkB,gBAAgB;IAChC,IAAI,IAAI;IACR,IAAI,IAAI;IACR,GAAG,IAAI;IACP,KAAK,IAAI;IACT,MAAM,IAAI;IACV,KAAK,IAAI;IACT,MAAM,IAAI;IACV,IAAI,IAAI;IACR,GAAG,IAAI;CACR;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,IAAI,IAAI;IACR,SAAS,IAAI;CACd;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAUA"}
|
package/dist/ffi/types.js
CHANGED
|
@@ -6,7 +6,53 @@
|
|
|
6
6
|
* circular dependencies and ensure proper initialization order.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.QueryErrorStage = exports.LatticeErrorCode = void 0;
|
|
9
10
|
exports.defaultOpenOptions = defaultOpenOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Error codes from lattice.h. A plain enum, not a const one, so that the
|
|
13
|
+
* package exports it as a value: JavaScript callers, and TypeScript compiled
|
|
14
|
+
* with isolatedModules, cannot read a const enum.
|
|
15
|
+
*/
|
|
16
|
+
var LatticeErrorCode;
|
|
17
|
+
(function (LatticeErrorCode) {
|
|
18
|
+
LatticeErrorCode[LatticeErrorCode["Ok"] = 0] = "Ok";
|
|
19
|
+
LatticeErrorCode[LatticeErrorCode["Error"] = -1] = "Error";
|
|
20
|
+
LatticeErrorCode[LatticeErrorCode["IoError"] = -2] = "IoError";
|
|
21
|
+
LatticeErrorCode[LatticeErrorCode["Corruption"] = -3] = "Corruption";
|
|
22
|
+
LatticeErrorCode[LatticeErrorCode["NotFound"] = -4] = "NotFound";
|
|
23
|
+
LatticeErrorCode[LatticeErrorCode["AlreadyExists"] = -5] = "AlreadyExists";
|
|
24
|
+
LatticeErrorCode[LatticeErrorCode["InvalidArg"] = -6] = "InvalidArg";
|
|
25
|
+
LatticeErrorCode[LatticeErrorCode["TxnAborted"] = -7] = "TxnAborted";
|
|
26
|
+
LatticeErrorCode[LatticeErrorCode["LockTimeout"] = -8] = "LockTimeout";
|
|
27
|
+
LatticeErrorCode[LatticeErrorCode["ReadOnly"] = -9] = "ReadOnly";
|
|
28
|
+
LatticeErrorCode[LatticeErrorCode["Full"] = -10] = "Full";
|
|
29
|
+
LatticeErrorCode[LatticeErrorCode["VersionMismatch"] = -11] = "VersionMismatch";
|
|
30
|
+
LatticeErrorCode[LatticeErrorCode["Checksum"] = -12] = "Checksum";
|
|
31
|
+
LatticeErrorCode[LatticeErrorCode["OutOfMemory"] = -13] = "OutOfMemory";
|
|
32
|
+
LatticeErrorCode[LatticeErrorCode["Unsupported"] = -14] = "Unsupported";
|
|
33
|
+
LatticeErrorCode[LatticeErrorCode["ValueTooLarge"] = -15] = "ValueTooLarge";
|
|
34
|
+
LatticeErrorCode[LatticeErrorCode["DatabaseLocked"] = -16] = "DatabaseLocked";
|
|
35
|
+
/** A plain node delete was refused: the node still has relationships. */
|
|
36
|
+
LatticeErrorCode[LatticeErrorCode["HasRelationships"] = -17] = "HasRelationships";
|
|
37
|
+
/** Open options contradict the vector index the database file records. */
|
|
38
|
+
LatticeErrorCode[LatticeErrorCode["ConfigMismatch"] = -18] = "ConfigMismatch";
|
|
39
|
+
/**
|
|
40
|
+
* The file was written by a newer release that does not let this one write
|
|
41
|
+
* it. It opens with readOnly: true; a writable open writes nothing.
|
|
42
|
+
*/
|
|
43
|
+
LatticeErrorCode[LatticeErrorCode["NeedsNewerWriter"] = -19] = "NeedsNewerWriter";
|
|
44
|
+
})(LatticeErrorCode || (exports.LatticeErrorCode = LatticeErrorCode = {}));
|
|
45
|
+
/**
|
|
46
|
+
* Query diagnostic stages from the C API.
|
|
47
|
+
*/
|
|
48
|
+
var QueryErrorStage;
|
|
49
|
+
(function (QueryErrorStage) {
|
|
50
|
+
QueryErrorStage[QueryErrorStage["None"] = 0] = "None";
|
|
51
|
+
QueryErrorStage[QueryErrorStage["Parse"] = 1] = "Parse";
|
|
52
|
+
QueryErrorStage[QueryErrorStage["Semantic"] = 2] = "Semantic";
|
|
53
|
+
QueryErrorStage[QueryErrorStage["Plan"] = 3] = "Plan";
|
|
54
|
+
QueryErrorStage[QueryErrorStage["Execution"] = 4] = "Execution";
|
|
55
|
+
})(QueryErrorStage || (exports.QueryErrorStage = QueryErrorStage = {}));
|
|
10
56
|
/**
|
|
11
57
|
* Default open options matching LATTICE_OPEN_OPTIONS_DEFAULT
|
|
12
58
|
*/
|
package/dist/ffi/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ffi/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ffi/types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAmHH,gDAkBC;AAnID;;;;GAIG;AACH,IAAY,gBA2BX;AA3BD,WAAY,gBAAgB;IAC1B,mDAAM,CAAA;IACN,0DAAU,CAAA;IACV,8DAAY,CAAA;IACZ,oEAAe,CAAA;IACf,gEAAa,CAAA;IACb,0EAAkB,CAAA;IAClB,oEAAe,CAAA;IACf,oEAAe,CAAA;IACf,sEAAgB,CAAA;IAChB,gEAAa,CAAA;IACb,yDAAU,CAAA;IACV,+EAAqB,CAAA;IACrB,iEAAc,CAAA;IACd,uEAAiB,CAAA;IACjB,uEAAiB,CAAA;IACjB,2EAAmB,CAAA;IACnB,6EAAoB,CAAA;IACpB,yEAAyE;IACzE,iFAAsB,CAAA;IACtB,0EAA0E;IAC1E,6EAAoB,CAAA;IACpB;;;OAGG;IACH,iFAAsB,CAAA;AACxB,CAAC,EA3BW,gBAAgB,gCAAhB,gBAAgB,QA2B3B;AAmED;;GAEG;AACH,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,uDAAS,CAAA;IACT,6DAAY,CAAA;IACZ,qDAAQ,CAAA;IACR,+DAAa,CAAA;AACf,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED;;GAEG;AACH,SAAgB,kBAAkB;IAShC,OAAO;QACL,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,GAAG;QAClB,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,GAAG;QACtB,UAAU,EAAE,IAAI;KACjB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
*/
|
|
31
31
|
export { Database, DatabaseOptions, deserialize } from './database';
|
|
32
32
|
export { Transaction } from './transaction';
|
|
33
|
-
export { Node, Edge, Value, QueryResult, StreamRecord, VectorSearchResult, PropertyValue, CreateNodeOptions, CreateEdgeOptions, VectorSearchOptions, FtsSearchOptions, } from './types';
|
|
33
|
+
export { Node, Edge, Value, QueryResult, StreamRecord, CheckpointStats, VectorSearchResult, PropertyValue, CreateNodeOptions, CreateEdgeOptions, DeleteNodeOptions, VectorSearchOptions, FtsSearchOptions, } from './types';
|
|
34
34
|
import { hashEmbed as embeddingHashEmbed, EmbeddingClient as EmbeddingClientClass, EmbeddingApiFormat as embeddingApiFormat, type EmbeddingConfig as EmbeddingConfigType } from './embedding';
|
|
35
|
-
export { isLibraryAvailable, LatticeError, LatticeQueryError, QueryErrorStage, QueryErrorLocation, } from './ffi';
|
|
35
|
+
export { isLibraryAvailable, getLibraryPath, resolveLibraryPath, isElectronRuntime, ELECTRON_ASAR_UNPACK_GLOB, LatticeError, LatticeChangesTrimmedError, LatticeErrorCode, LatticeQueryError, QueryErrorStage, QueryErrorLocation, SyncMode, VectorMetric, ChangefeedRetention, ChangefeedStatus, CheckpointMode, } from './ffi';
|
|
36
36
|
/**
|
|
37
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
37
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
38
38
|
*/
|
|
39
39
|
export declare const hashEmbed: typeof embeddingHashEmbed;
|
|
40
40
|
/**
|
|
41
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
41
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
42
42
|
*/
|
|
43
43
|
export declare const EmbeddingClient: typeof EmbeddingClientClass;
|
|
44
44
|
/**
|
|
45
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
45
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
46
46
|
*/
|
|
47
47
|
export declare const EmbeddingApiFormat: typeof embeddingApiFormat;
|
|
48
48
|
/**
|
|
49
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
49
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
50
50
|
*/
|
|
51
51
|
export type EmbeddingConfig = EmbeddingConfigType;
|
|
52
52
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO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E,OAAO,kBAAuC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAElD;;GAEG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAQhC"}
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.EmbeddingApiFormat = exports.EmbeddingClient = exports.hashEmbed = exports.LatticeQueryError = exports.LatticeError = exports.isLibraryAvailable = exports.Value = exports.Transaction = exports.deserialize = exports.Database = void 0;
|
|
33
|
+
exports.EmbeddingApiFormat = exports.EmbeddingClient = exports.hashEmbed = exports.QueryErrorStage = exports.LatticeQueryError = exports.LatticeErrorCode = exports.LatticeChangesTrimmedError = exports.LatticeError = exports.ELECTRON_ASAR_UNPACK_GLOB = exports.isElectronRuntime = exports.resolveLibraryPath = exports.getLibraryPath = exports.isLibraryAvailable = exports.Value = exports.Transaction = exports.deserialize = exports.Database = void 0;
|
|
34
34
|
exports.version = version;
|
|
35
35
|
var database_1 = require("./database");
|
|
36
36
|
Object.defineProperty(exports, "Database", { enumerable: true, get: function () { return database_1.Database; } });
|
|
@@ -42,18 +42,25 @@ Object.defineProperty(exports, "Value", { enumerable: true, get: function () { r
|
|
|
42
42
|
const embedding_1 = require("./embedding");
|
|
43
43
|
var ffi_1 = require("./ffi");
|
|
44
44
|
Object.defineProperty(exports, "isLibraryAvailable", { enumerable: true, get: function () { return ffi_1.isLibraryAvailable; } });
|
|
45
|
+
Object.defineProperty(exports, "getLibraryPath", { enumerable: true, get: function () { return ffi_1.getLibraryPath; } });
|
|
46
|
+
Object.defineProperty(exports, "resolveLibraryPath", { enumerable: true, get: function () { return ffi_1.resolveLibraryPath; } });
|
|
47
|
+
Object.defineProperty(exports, "isElectronRuntime", { enumerable: true, get: function () { return ffi_1.isElectronRuntime; } });
|
|
48
|
+
Object.defineProperty(exports, "ELECTRON_ASAR_UNPACK_GLOB", { enumerable: true, get: function () { return ffi_1.ELECTRON_ASAR_UNPACK_GLOB; } });
|
|
45
49
|
Object.defineProperty(exports, "LatticeError", { enumerable: true, get: function () { return ffi_1.LatticeError; } });
|
|
50
|
+
Object.defineProperty(exports, "LatticeChangesTrimmedError", { enumerable: true, get: function () { return ffi_1.LatticeChangesTrimmedError; } });
|
|
51
|
+
Object.defineProperty(exports, "LatticeErrorCode", { enumerable: true, get: function () { return ffi_1.LatticeErrorCode; } });
|
|
46
52
|
Object.defineProperty(exports, "LatticeQueryError", { enumerable: true, get: function () { return ffi_1.LatticeQueryError; } });
|
|
53
|
+
Object.defineProperty(exports, "QueryErrorStage", { enumerable: true, get: function () { return ffi_1.QueryErrorStage; } });
|
|
47
54
|
/**
|
|
48
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
55
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
49
56
|
*/
|
|
50
57
|
exports.hashEmbed = embedding_1.hashEmbed;
|
|
51
58
|
/**
|
|
52
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
59
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
53
60
|
*/
|
|
54
61
|
exports.EmbeddingClient = embedding_1.EmbeddingClient;
|
|
55
62
|
/**
|
|
56
|
-
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
63
|
+
* @deprecated Use `@hajewski/latticedb/embedding` instead.
|
|
57
64
|
*/
|
|
58
65
|
exports.EmbeddingApiFormat = embedding_1.EmbeddingApiFormat;
|
|
59
66
|
/**
|
|
@@ -66,7 +73,7 @@ function version() {
|
|
|
66
73
|
return getFFI().version();
|
|
67
74
|
}
|
|
68
75
|
catch {
|
|
69
|
-
return '0.
|
|
76
|
+
return '0.17.0';
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;AAmEH,0BAQC;AAzED,uCAAoE;AAA3D,oGAAA,QAAQ,OAAA;AAAmB,uGAAA,WAAW,OAAA;AAC/C,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,iCAciB;AAXf,8FAAA,KAAK,OAAA;AAYP,2CAKqB;AACrB,6BAiBe;AAhBb,yGAAA,kBAAkB,OAAA;AAClB,qGAAA,cAAc,OAAA;AACd,yGAAA,kBAAkB,OAAA;AAClB,wGAAA,iBAAiB,OAAA;AACjB,gHAAA,yBAAyB,OAAA;AACzB,mGAAA,YAAY,OAAA;AACZ,iHAAA,0BAA0B,OAAA;AAC1B,uGAAA,gBAAgB,OAAA;AAChB,wGAAA,iBAAiB,OAAA;AACjB,sGAAA,eAAe,OAAA;AASjB;;GAEG;AACU,QAAA,SAAS,GAA8B,qBAAkB,CAAC;AAEvE;;GAEG;AACU,QAAA,eAAe,GAAgC,2BAAoB,CAAC;AAEjF;;GAEG;AACU,QAAA,kBAAkB,GAA8B,8BAAkB,CAAC;AAOhF;;GAEG;AACH,SAAgB,OAAO;IACrB,IAAI,CAAC;QACH,8DAA8D;QAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|