@loradb/lora-wasm 0.1.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/LICENSE +87 -0
- package/README.md +197 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/loader-node.d.ts +12 -0
- package/dist/loader-node.d.ts.map +1 -0
- package/dist/loader-node.js +12 -0
- package/dist/loader-node.js.map +1 -0
- package/dist/types.d.ts +193 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +111 -0
- package/dist/types.js.map +1 -0
- package/dist/worker-client.d.ts +41 -0
- package/dist/worker-client.d.ts.map +1 -0
- package/dist/worker-client.js +69 -0
- package/dist/worker-client.js.map +1 -0
- package/dist/worker-protocol.d.ts +40 -0
- package/dist/worker-protocol.d.ts.map +1 -0
- package/dist/worker-protocol.js +9 -0
- package/dist/worker-protocol.js.map +1 -0
- package/dist/worker.d.ts +12 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +75 -0
- package/dist/worker.js.map +1 -0
- package/package.json +98 -0
- package/pkg-bundler/LICENSE +87 -0
- package/pkg-bundler/README.md +197 -0
- package/pkg-bundler/lora_wasm.d.ts +25 -0
- package/pkg-bundler/lora_wasm.js +5 -0
- package/pkg-bundler/lora_wasm_bg.js +559 -0
- package/pkg-bundler/lora_wasm_bg.wasm +0 -0
- package/pkg-bundler/lora_wasm_bg.wasm.d.ts +18 -0
- package/pkg-bundler/package.json +22 -0
- package/pkg-node/LICENSE +87 -0
- package/pkg-node/README.md +197 -0
- package/pkg-node/lora_wasm.d.ts +25 -0
- package/pkg-node/lora_wasm.js +566 -0
- package/pkg-node/lora_wasm_bg.wasm +0 -0
- package/pkg-node/lora_wasm_bg.wasm.d.ts +18 -0
- package/pkg-node/package.json +16 -0
- package/pkg-web/LICENSE +87 -0
- package/pkg-web/README.md +197 -0
- package/pkg-web/lora_wasm.d.ts +67 -0
- package/pkg-web/lora_wasm.js +607 -0
- package/pkg-web/lora_wasm_bg.wasm +0 -0
- package/pkg-web/lora_wasm_bg.wasm.d.ts +18 -0
- package/pkg-web/package.json +20 -0
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
let wasm;
|
|
5
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
6
|
+
|
|
7
|
+
let WASM_VECTOR_LEN = 0;
|
|
8
|
+
|
|
9
|
+
let cachedUint8ArrayMemory0 = null;
|
|
10
|
+
|
|
11
|
+
function getUint8ArrayMemory0() {
|
|
12
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
13
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
14
|
+
}
|
|
15
|
+
return cachedUint8ArrayMemory0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
19
|
+
|
|
20
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
21
|
+
? function (arg, view) {
|
|
22
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
23
|
+
}
|
|
24
|
+
: function (arg, view) {
|
|
25
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
26
|
+
view.set(buf);
|
|
27
|
+
return {
|
|
28
|
+
read: arg.length,
|
|
29
|
+
written: buf.length
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
34
|
+
|
|
35
|
+
if (realloc === undefined) {
|
|
36
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
37
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
38
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
39
|
+
WASM_VECTOR_LEN = buf.length;
|
|
40
|
+
return ptr;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let len = arg.length;
|
|
44
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
45
|
+
|
|
46
|
+
const mem = getUint8ArrayMemory0();
|
|
47
|
+
|
|
48
|
+
let offset = 0;
|
|
49
|
+
|
|
50
|
+
for (; offset < len; offset++) {
|
|
51
|
+
const code = arg.charCodeAt(offset);
|
|
52
|
+
if (code > 0x7F) break;
|
|
53
|
+
mem[ptr + offset] = code;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (offset !== len) {
|
|
57
|
+
if (offset !== 0) {
|
|
58
|
+
arg = arg.slice(offset);
|
|
59
|
+
}
|
|
60
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
61
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
62
|
+
const ret = encodeString(arg, view);
|
|
63
|
+
|
|
64
|
+
offset += ret.written;
|
|
65
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
WASM_VECTOR_LEN = offset;
|
|
69
|
+
return ptr;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let cachedDataViewMemory0 = null;
|
|
73
|
+
|
|
74
|
+
function getDataViewMemory0() {
|
|
75
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
76
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
77
|
+
}
|
|
78
|
+
return cachedDataViewMemory0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function addToExternrefTable0(obj) {
|
|
82
|
+
const idx = wasm.__externref_table_alloc();
|
|
83
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
84
|
+
return idx;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function handleError(f, args) {
|
|
88
|
+
try {
|
|
89
|
+
return f.apply(this, args);
|
|
90
|
+
} catch (e) {
|
|
91
|
+
const idx = addToExternrefTable0(e);
|
|
92
|
+
wasm.__wbindgen_exn_store(idx);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
97
|
+
|
|
98
|
+
cachedTextDecoder.decode();
|
|
99
|
+
|
|
100
|
+
function getStringFromWasm0(ptr, len) {
|
|
101
|
+
ptr = ptr >>> 0;
|
|
102
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isLikeNone(x) {
|
|
106
|
+
return x === undefined || x === null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function debugString(val) {
|
|
110
|
+
// primitive types
|
|
111
|
+
const type = typeof val;
|
|
112
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
113
|
+
return `${val}`;
|
|
114
|
+
}
|
|
115
|
+
if (type == 'string') {
|
|
116
|
+
return `"${val}"`;
|
|
117
|
+
}
|
|
118
|
+
if (type == 'symbol') {
|
|
119
|
+
const description = val.description;
|
|
120
|
+
if (description == null) {
|
|
121
|
+
return 'Symbol';
|
|
122
|
+
} else {
|
|
123
|
+
return `Symbol(${description})`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (type == 'function') {
|
|
127
|
+
const name = val.name;
|
|
128
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
129
|
+
return `Function(${name})`;
|
|
130
|
+
} else {
|
|
131
|
+
return 'Function';
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
// objects
|
|
135
|
+
if (Array.isArray(val)) {
|
|
136
|
+
const length = val.length;
|
|
137
|
+
let debug = '[';
|
|
138
|
+
if (length > 0) {
|
|
139
|
+
debug += debugString(val[0]);
|
|
140
|
+
}
|
|
141
|
+
for(let i = 1; i < length; i++) {
|
|
142
|
+
debug += ', ' + debugString(val[i]);
|
|
143
|
+
}
|
|
144
|
+
debug += ']';
|
|
145
|
+
return debug;
|
|
146
|
+
}
|
|
147
|
+
// Test for built-in
|
|
148
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
149
|
+
let className;
|
|
150
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
151
|
+
className = builtInMatches[1];
|
|
152
|
+
} else {
|
|
153
|
+
// Failed to match the standard '[object ClassName]'
|
|
154
|
+
return toString.call(val);
|
|
155
|
+
}
|
|
156
|
+
if (className == 'Object') {
|
|
157
|
+
// we're a user defined class or Object
|
|
158
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
159
|
+
// easier than looping through ownProperties of `val`.
|
|
160
|
+
try {
|
|
161
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
162
|
+
} catch (_) {
|
|
163
|
+
return 'Object';
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
// errors
|
|
167
|
+
if (val instanceof Error) {
|
|
168
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
169
|
+
}
|
|
170
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
171
|
+
return className;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function takeFromExternrefTable0(idx) {
|
|
175
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
176
|
+
wasm.__externref_table_dealloc(idx);
|
|
177
|
+
return value;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Call once at module start to install a panic hook that routes Rust
|
|
181
|
+
* panics to `console.error`. No-op if compiled without the default feature.
|
|
182
|
+
*/
|
|
183
|
+
module.exports.init = function() {
|
|
184
|
+
wasm.init();
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const WasmDatabaseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
188
|
+
? { register: () => {}, unregister: () => {} }
|
|
189
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdatabase_free(ptr >>> 0, 1));
|
|
190
|
+
/**
|
|
191
|
+
* In-memory Lora graph database handle.
|
|
192
|
+
*/
|
|
193
|
+
class WasmDatabase {
|
|
194
|
+
|
|
195
|
+
__destroy_into_raw() {
|
|
196
|
+
const ptr = this.__wbg_ptr;
|
|
197
|
+
this.__wbg_ptr = 0;
|
|
198
|
+
WasmDatabaseFinalization.unregister(this);
|
|
199
|
+
return ptr;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
free() {
|
|
203
|
+
const ptr = this.__destroy_into_raw();
|
|
204
|
+
wasm.__wbg_wasmdatabase_free(ptr, 0);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @returns {number}
|
|
208
|
+
*/
|
|
209
|
+
nodeCount() {
|
|
210
|
+
const ret = wasm.wasmdatabase_nodeCount(this.__wbg_ptr);
|
|
211
|
+
return ret >>> 0;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @returns {number}
|
|
215
|
+
*/
|
|
216
|
+
relationshipCount() {
|
|
217
|
+
const ret = wasm.wasmdatabase_relationshipCount(this.__wbg_ptr);
|
|
218
|
+
return ret >>> 0;
|
|
219
|
+
}
|
|
220
|
+
constructor() {
|
|
221
|
+
const ret = wasm.wasmdatabase_new();
|
|
222
|
+
this.__wbg_ptr = ret >>> 0;
|
|
223
|
+
WasmDatabaseFinalization.register(this, this.__wbg_ptr, this);
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
clear() {
|
|
227
|
+
wasm.wasmdatabase_clear(this.__wbg_ptr);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Execute a Lora query. `params` may be `undefined`, `null`, or a
|
|
231
|
+
* plain object keyed by parameter name.
|
|
232
|
+
*
|
|
233
|
+
* Returns `{ columns: string[], rows: Array<Record<string, LoraValue>> }`
|
|
234
|
+
* as a plain JS object (structured-clonable).
|
|
235
|
+
* @param {string} query
|
|
236
|
+
* @param {any} params
|
|
237
|
+
* @returns {any}
|
|
238
|
+
*/
|
|
239
|
+
execute(query, params) {
|
|
240
|
+
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
241
|
+
const len0 = WASM_VECTOR_LEN;
|
|
242
|
+
const ret = wasm.wasmdatabase_execute(this.__wbg_ptr, ptr0, len0, params);
|
|
243
|
+
if (ret[2]) {
|
|
244
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
245
|
+
}
|
|
246
|
+
return takeFromExternrefTable0(ret[0]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
module.exports.WasmDatabase = WasmDatabase;
|
|
250
|
+
|
|
251
|
+
module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
252
|
+
const ret = String(arg1);
|
|
253
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
254
|
+
const len1 = WASM_VECTOR_LEN;
|
|
255
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
256
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
260
|
+
const ret = arg0.buffer;
|
|
261
|
+
return ret;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
265
|
+
const ret = arg0.call(arg1);
|
|
266
|
+
return ret;
|
|
267
|
+
}, arguments) };
|
|
268
|
+
|
|
269
|
+
module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
270
|
+
const ret = arg0.done;
|
|
271
|
+
return ret;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
|
275
|
+
const ret = Object.entries(arg0);
|
|
276
|
+
return ret;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
280
|
+
let deferred0_0;
|
|
281
|
+
let deferred0_1;
|
|
282
|
+
try {
|
|
283
|
+
deferred0_0 = arg0;
|
|
284
|
+
deferred0_1 = arg1;
|
|
285
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
286
|
+
} finally {
|
|
287
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
292
|
+
const ret = Reflect.get(arg0, arg1);
|
|
293
|
+
return ret;
|
|
294
|
+
}, arguments) };
|
|
295
|
+
|
|
296
|
+
module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
297
|
+
const ret = arg0[arg1 >>> 0];
|
|
298
|
+
return ret;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
302
|
+
let result;
|
|
303
|
+
try {
|
|
304
|
+
result = arg0 instanceof ArrayBuffer;
|
|
305
|
+
} catch (_) {
|
|
306
|
+
result = false;
|
|
307
|
+
}
|
|
308
|
+
const ret = result;
|
|
309
|
+
return ret;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
|
313
|
+
let result;
|
|
314
|
+
try {
|
|
315
|
+
result = arg0 instanceof Map;
|
|
316
|
+
} catch (_) {
|
|
317
|
+
result = false;
|
|
318
|
+
}
|
|
319
|
+
const ret = result;
|
|
320
|
+
return ret;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
324
|
+
let result;
|
|
325
|
+
try {
|
|
326
|
+
result = arg0 instanceof Uint8Array;
|
|
327
|
+
} catch (_) {
|
|
328
|
+
result = false;
|
|
329
|
+
}
|
|
330
|
+
const ret = result;
|
|
331
|
+
return ret;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
335
|
+
const ret = Array.isArray(arg0);
|
|
336
|
+
return ret;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
340
|
+
const ret = Number.isSafeInteger(arg0);
|
|
341
|
+
return ret;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
345
|
+
const ret = Symbol.iterator;
|
|
346
|
+
return ret;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
350
|
+
const ret = arg0.length;
|
|
351
|
+
return ret;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
355
|
+
const ret = arg0.length;
|
|
356
|
+
return ret;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
module.exports.__wbg_new_405e22f390576ce2 = function() {
|
|
360
|
+
const ret = new Object();
|
|
361
|
+
return ret;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
module.exports.__wbg_new_5e0be73521bc8c17 = function() {
|
|
365
|
+
const ret = new Map();
|
|
366
|
+
return ret;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
module.exports.__wbg_new_78feb108b6472713 = function() {
|
|
370
|
+
const ret = new Array();
|
|
371
|
+
return ret;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
375
|
+
const ret = new Error();
|
|
376
|
+
return ret;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
380
|
+
const ret = new Uint8Array(arg0);
|
|
381
|
+
return ret;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
385
|
+
const ret = arg0.next;
|
|
386
|
+
return ret;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
390
|
+
const ret = arg0.next();
|
|
391
|
+
return ret;
|
|
392
|
+
}, arguments) };
|
|
393
|
+
|
|
394
|
+
module.exports.__wbg_now_807e54c39636c349 = function() {
|
|
395
|
+
const ret = Date.now();
|
|
396
|
+
return ret;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
400
|
+
arg0[arg1 >>> 0] = arg2;
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
404
|
+
arg0[arg1] = arg2;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
408
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
module.exports.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
|
|
412
|
+
const ret = arg0.set(arg1, arg2);
|
|
413
|
+
return ret;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
417
|
+
const ret = arg1.stack;
|
|
418
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
419
|
+
const len1 = WASM_VECTOR_LEN;
|
|
420
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
421
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
425
|
+
const ret = arg0.value;
|
|
426
|
+
return ret;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
430
|
+
const ret = arg0;
|
|
431
|
+
return ret;
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
435
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
436
|
+
return ret;
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
440
|
+
const v = arg1;
|
|
441
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
442
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
443
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
|
447
|
+
const v = arg0;
|
|
448
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
449
|
+
return ret;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
|
453
|
+
const ret = debugString(arg1);
|
|
454
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
455
|
+
const len1 = WASM_VECTOR_LEN;
|
|
456
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
457
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
461
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
462
|
+
return ret;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
466
|
+
const ret = arg0 in arg1;
|
|
467
|
+
return ret;
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
471
|
+
const table = wasm.__wbindgen_export_4;
|
|
472
|
+
const offset = table.grow(4);
|
|
473
|
+
table.set(0, undefined);
|
|
474
|
+
table.set(offset + 0, undefined);
|
|
475
|
+
table.set(offset + 1, null);
|
|
476
|
+
table.set(offset + 2, true);
|
|
477
|
+
table.set(offset + 3, false);
|
|
478
|
+
;
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
module.exports.__wbindgen_is_bigint = function(arg0) {
|
|
482
|
+
const ret = typeof(arg0) === 'bigint';
|
|
483
|
+
return ret;
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
|
487
|
+
const ret = typeof(arg0) === 'function';
|
|
488
|
+
return ret;
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
492
|
+
const ret = arg0 === null;
|
|
493
|
+
return ret;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
|
497
|
+
const val = arg0;
|
|
498
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
499
|
+
return ret;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
503
|
+
const ret = typeof(arg0) === 'string';
|
|
504
|
+
return ret;
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
508
|
+
const ret = arg0 === undefined;
|
|
509
|
+
return ret;
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
513
|
+
const ret = arg0 === arg1;
|
|
514
|
+
return ret;
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
518
|
+
const ret = arg0 == arg1;
|
|
519
|
+
return ret;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
module.exports.__wbindgen_memory = function() {
|
|
523
|
+
const ret = wasm.memory;
|
|
524
|
+
return ret;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
528
|
+
const obj = arg1;
|
|
529
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
530
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
531
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
535
|
+
const ret = arg0;
|
|
536
|
+
return ret;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
540
|
+
const obj = arg1;
|
|
541
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
542
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
543
|
+
var len1 = WASM_VECTOR_LEN;
|
|
544
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
545
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
549
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
550
|
+
return ret;
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
554
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
const path = require('path').join(__dirname, 'lora_wasm_bg.wasm');
|
|
558
|
+
const bytes = require('fs').readFileSync(path);
|
|
559
|
+
|
|
560
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
561
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
562
|
+
wasm = wasmInstance.exports;
|
|
563
|
+
module.exports.__wasm = wasm;
|
|
564
|
+
|
|
565
|
+
wasm.__wbindgen_start();
|
|
566
|
+
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_wasmdatabase_free: (a: number, b: number) => void;
|
|
5
|
+
export const wasmdatabase_clear: (a: number) => void;
|
|
6
|
+
export const wasmdatabase_execute: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
7
|
+
export const wasmdatabase_new: () => number;
|
|
8
|
+
export const wasmdatabase_nodeCount: (a: number) => number;
|
|
9
|
+
export const wasmdatabase_relationshipCount: (a: number) => number;
|
|
10
|
+
export const init: () => void;
|
|
11
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
12
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
13
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
14
|
+
export const __externref_table_alloc: () => number;
|
|
15
|
+
export const __wbindgen_export_4: WebAssembly.Table;
|
|
16
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
17
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
18
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lora-wasm",
|
|
3
|
+
"collaborators": [
|
|
4
|
+
"LoraDB, Inc."
|
|
5
|
+
],
|
|
6
|
+
"description": "WebAssembly bindings for the Lora in-memory graph database",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"license": "BUSL-1.1",
|
|
9
|
+
"files": [
|
|
10
|
+
"lora_wasm_bg.wasm",
|
|
11
|
+
"lora_wasm.js",
|
|
12
|
+
"lora_wasm.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"main": "lora_wasm.js",
|
|
15
|
+
"types": "lora_wasm.d.ts"
|
|
16
|
+
}
|
package/pkg-web/LICENSE
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: LoraDB, Inc.
|
|
6
|
+
Licensed Work: LoraDB
|
|
7
|
+
Change Date: 2029-04-19
|
|
8
|
+
Change License: Apache License, Version 2.0
|
|
9
|
+
|
|
10
|
+
Additional Use Grant: You may use, copy, modify, create derivative works of,
|
|
11
|
+
distribute, and make production use of the Licensed Work
|
|
12
|
+
for internal business purposes and non-production
|
|
13
|
+
purposes, provided that you do not use the Licensed Work
|
|
14
|
+
to offer, operate, or make available a database-as-a-
|
|
15
|
+
service, hosted API, managed database platform, or any
|
|
16
|
+
substantially similar hosted service for third parties.
|
|
17
|
+
|
|
18
|
+
The Additional Use Grant does not permit using the
|
|
19
|
+
Licensed Work to provide a commercial or non-commercial
|
|
20
|
+
hosted service that allows third parties to access LoraDB
|
|
21
|
+
functionality, including as part of a competing managed
|
|
22
|
+
database platform, backend-as-a-service, application
|
|
23
|
+
platform, developer platform, or resale offering.
|
|
24
|
+
|
|
25
|
+
Business Source License
|
|
26
|
+
|
|
27
|
+
Terms
|
|
28
|
+
|
|
29
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
30
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
31
|
+
Licensor may make an Additional Use Grant, above, permitting limited production
|
|
32
|
+
use.
|
|
33
|
+
|
|
34
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
35
|
+
available distribution of a specific version of the Licensed Work under this
|
|
36
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
37
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
38
|
+
above terminate.
|
|
39
|
+
|
|
40
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
41
|
+
currently in effect as described in this License, you must purchase a
|
|
42
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
43
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
44
|
+
|
|
45
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
46
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
47
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
48
|
+
for each version of the Licensed Work released by Licensor.
|
|
49
|
+
|
|
50
|
+
You must conspicuously display this License on each original or modified copy
|
|
51
|
+
of the Licensed Work. If you receive the Licensed Work in original or modified
|
|
52
|
+
form from a third party, the terms and conditions set forth in this License
|
|
53
|
+
apply to your use of that work.
|
|
54
|
+
|
|
55
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
56
|
+
terminate your rights under this License for the current and all other
|
|
57
|
+
versions of the Licensed Work.
|
|
58
|
+
|
|
59
|
+
This License does not grant you any right in any trademark or logo of Licensor
|
|
60
|
+
or its affiliates.
|
|
61
|
+
|
|
62
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
63
|
+
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
64
|
+
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY,
|
|
65
|
+
FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE.
|
|
66
|
+
|
|
67
|
+
MariaDB hereby grants you permission to use this License's text to license
|
|
68
|
+
your works, and to refer to it using the trademark "Business Source License",
|
|
69
|
+
as long as you comply with the Covenants of Licensor below.
|
|
70
|
+
|
|
71
|
+
Covenants of Licensor
|
|
72
|
+
|
|
73
|
+
In consideration of the right to use this License's text and the "Business
|
|
74
|
+
Source License" name and trademark, Licensor covenants to MariaDB, and to all
|
|
75
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
76
|
+
|
|
77
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
78
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
79
|
+
where "compatible" means that software provided under the Change License can
|
|
80
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
81
|
+
later version. Licensor may specify additional Change Licenses without
|
|
82
|
+
limitation.
|
|
83
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
84
|
+
impose any additional restriction on the right granted in this License, as
|
|
85
|
+
the Additional Use Grant; or (b) insert the text "None".
|
|
86
|
+
3. To specify a Change Date.
|
|
87
|
+
4. Not to modify this License in any other way.
|