hyperdb-wasm 0.0.26301-dev.wasm.g560c2cb5 → 0.0.26305-dev.wasm.gdf59cd37

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.
Binary file
package/dist/node.js CHANGED
@@ -13,7 +13,7 @@ var __export = (target, all) => {
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
15
 
16
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/protocol.ts
16
+ // src/protocol.ts
17
17
  function isRecord(value) {
18
18
  return typeof value === "object" && value !== null;
19
19
  }
@@ -54,15 +54,15 @@ function isWorkerEvent(message) {
54
54
  }
55
55
  }
56
56
  var init_protocol = __esm({
57
- "../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/protocol.ts"() {
57
+ "src/protocol.ts"() {
58
58
  "use strict";
59
59
  }
60
60
  });
61
61
 
62
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/client.ts
62
+ // src/client.ts
63
63
  var HyperDBEngineClient;
64
64
  var init_client = __esm({
65
- "../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/client.ts"() {
65
+ "src/client.ts"() {
66
66
  "use strict";
67
67
  init_protocol();
68
68
  HyperDBEngineClient = class {
@@ -185,7 +185,7 @@ var init_client = __esm({
185
185
  }
186
186
  });
187
187
 
188
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/browser.ts
188
+ // src/browser.ts
189
189
  var browser_exports = {};
190
190
  __export(browser_exports, {
191
191
  BrowserWorker: () => BrowserWorker,
@@ -204,7 +204,7 @@ function createBrowserClient(options = {}) {
204
204
  }
205
205
  var BrowserWorker;
206
206
  var init_browser = __esm({
207
- "../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/browser.ts"() {
207
+ "src/browser.ts"() {
208
208
  "use strict";
209
209
  init_client();
210
210
  BrowserWorker = class {
@@ -235,7 +235,7 @@ var init_browser = __esm({
235
235
  }
236
236
  });
237
237
 
238
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/api.ts
238
+ // src/api.ts
239
239
  import { DataType, RecordBatchReader, Schema, Table, tableToIPC, vectorFromArray } from "apache-arrow";
240
240
  function normalizeArrowInsertOptions(options) {
241
241
  if (!options.name) throw new Error("Arrow insert table name must not be empty");
@@ -619,7 +619,7 @@ var HyperDBConnection = class {
619
619
  }
620
620
  };
621
621
 
622
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/node.ts
622
+ // src/node.ts
623
623
  init_client();
624
624
  import { Worker as NativeWorker } from "node:worker_threads";
625
625
  import { fileURLToPath } from "node:url";
@@ -659,7 +659,7 @@ function createNodeClient(options = {}) {
659
659
  return new HyperDBEngineClient(new NodeWorker(new NativeWorker(workerUrl, { workerData: { engineUrl, hostPath: options.hostPath } })));
660
660
  }
661
661
 
662
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/index.node.ts
662
+ // src/index.node.ts
663
663
  var HyperDB2 = class _HyperDB extends HyperDB {
664
664
  static async create(options = {}) {
665
665
  const client = createNodeClient(options);
@@ -1,4 +1,4 @@
1
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/node_worker.ts
1
+ // src/node_worker.ts
2
2
  import { createReadStream } from "node:fs";
3
3
  import { createRequire } from "node:module";
4
4
  import { dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
@@ -7,7 +7,7 @@ import { parentPort, workerData } from "node:worker_threads";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { createBrotliDecompress } from "node:zlib";
9
9
 
10
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/wasm_bindings.ts
10
+ // src/wasm_bindings.ts
11
11
  var resultStates = ["ok", "pending", "chunk", "done", "error", "busy"];
12
12
  function safeInteger(value, name) {
13
13
  const number = typeof value === "bigint" && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value;
@@ -151,7 +151,7 @@ var HyperDBBindings = class {
151
151
  }
152
152
  };
153
153
 
154
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/protocol.ts
154
+ // src/protocol.ts
155
155
  function isRecord(value) {
156
156
  return typeof value === "object" && value !== null;
157
157
  }
@@ -197,7 +197,7 @@ function isEngineRequest(value) {
197
197
  }
198
198
  }
199
199
 
200
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/worker_setup.ts
200
+ // src/worker_setup.ts
201
201
  function errorText(error) {
202
202
  return error instanceof Error ? error.message : String(error);
203
203
  }
@@ -267,6 +267,7 @@ function configureWorker(module2, transport2, configureFilesystem = () => void 0
267
267
  }
268
268
  try {
269
269
  const result = bindings.handle(request);
270
+ if (request.type === "shutdown" && result.response.result.state === "ok") module2.PThread.terminateAllThreads();
270
271
  transport2.postMessage(result.response, result.transfer);
271
272
  } catch (error) {
272
273
  transport2.postMessage({ id: request.id, type: "response", result: { state: "error", error: errorText(error) } });
@@ -291,7 +292,7 @@ function configureWorker(module2, transport2, configureFilesystem = () => void 0
291
292
  module2.onAbort = (reason) => transport2.postMessage({ type: "fatal", error: `engine aborted: ${String(reason)}` });
292
293
  }
293
294
 
294
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/node_worker.ts
295
+ // src/node_worker.ts
295
296
  if (!parentPort) throw new Error("Node engine worker requires a parent port");
296
297
  var enginePort = parentPort;
297
298
  var options = workerData;
@@ -1,4 +1,4 @@
1
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/protocol.ts
1
+ // src/protocol.ts
2
2
  function isRecord(value) {
3
3
  return typeof value === "object" && value !== null;
4
4
  }
@@ -39,7 +39,7 @@ function isWorkerEvent(message) {
39
39
  }
40
40
  }
41
41
 
42
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/client.ts
42
+ // src/client.ts
43
43
  var HyperDBEngineClient = class {
44
44
  transport;
45
45
  pending = /* @__PURE__ */ new Map();
@@ -158,7 +158,7 @@ var HyperDBEngineClient = class {
158
158
  }
159
159
  };
160
160
 
161
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/wasm_bindings.ts
161
+ // src/wasm_bindings.ts
162
162
  var resultStates = ["ok", "pending", "chunk", "done", "error", "busy"];
163
163
  function safeInteger(value, name) {
164
164
  const number = typeof value === "bigint" && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value;
@@ -302,7 +302,7 @@ var HyperDBBindings = class {
302
302
  }
303
303
  };
304
304
 
305
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/browser.ts
305
+ // src/browser.ts
306
306
  var BrowserWorker = class {
307
307
  constructor(worker) {
308
308
  this.worker = worker;
package/dist/raw.node.js CHANGED
@@ -1,4 +1,4 @@
1
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/protocol.ts
1
+ // src/protocol.ts
2
2
  function isRecord(value) {
3
3
  return typeof value === "object" && value !== null;
4
4
  }
@@ -39,7 +39,7 @@ function isWorkerEvent(message) {
39
39
  }
40
40
  }
41
41
 
42
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/client.ts
42
+ // src/client.ts
43
43
  var HyperDBEngineClient = class {
44
44
  transport;
45
45
  pending = /* @__PURE__ */ new Map();
@@ -158,7 +158,7 @@ var HyperDBEngineClient = class {
158
158
  }
159
159
  };
160
160
 
161
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/wasm_bindings.ts
161
+ // src/wasm_bindings.ts
162
162
  var resultStates = ["ok", "pending", "chunk", "done", "error", "busy"];
163
163
  function safeInteger(value, name) {
164
164
  const number = typeof value === "bigint" && value <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(value) : value;
@@ -302,7 +302,7 @@ var HyperDBBindings = class {
302
302
  }
303
303
  };
304
304
 
305
- // ../../../../../../../hyper-cache/bazel/bazel_user_root/18bf2c17ab56269933d5cfcb90730d2f/execroot/_main/hyper/wasm/npm/src/node.ts
305
+ // src/node.ts
306
306
  import { Worker as NativeWorker } from "node:worker_threads";
307
307
  import { fileURLToPath } from "node:url";
308
308
  var NodeWorker = class {
@@ -6,6 +6,9 @@ export interface WorkerHostTransport {
6
6
  }
7
7
  export interface HyperDBWasmRuntimeModule extends HyperDBWasmModule {
8
8
  HEAPU8: Uint8Array;
9
+ PThread: {
10
+ terminateAllThreads(): void;
11
+ };
9
12
  _malloc(size: number): number | bigint;
10
13
  _hyperdb_wasm_fetch_complete(id: number, pointer: number, length: number): void;
11
14
  _hyperdb_wasm_http_complete(id: number, status: number, headersPointer: number, bodyPointer: number, bodyLength: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hyperdb-wasm",
3
- "version": "0.0.26301-dev.wasm.g560c2cb5",
3
+ "version": "0.0.26305-dev.wasm.gdf59cd37",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"