albedo-node 0.5.5 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ interface ObjectIdInstance {
19
19
  }
20
20
  interface ObjectIdConstructor {
21
21
  new (buffer?: ByteBuffer): ObjectIdInstance;
22
- fromString(hex: string): ObjectIdInstance;
22
+ fromString(str: string): ObjectIdInstance;
23
23
  }
24
24
  interface AlbedoModule {
25
25
  ObjectId: ObjectIdConstructor;
@@ -48,6 +48,16 @@ export declare const BSON: {
48
48
  serialize: (value: unknown) => Uint8Array;
49
49
  deserialize: <T = unknown>(data: ByteBuffer) => T;
50
50
  };
51
+ /**
52
+ * Native ObjectId class constructor.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * const id = new ObjectId();
57
+ * const parsed = ObjectId.fromString(id.toString());
58
+ * ```
59
+ */
60
+ export declare const ObjectId: ObjectIdConstructor;
51
61
  /**
52
62
  * Wrapper around a native Albedo bucket handle providing
53
63
  * methods for CRUD operations, indexing, iteration, and
@@ -227,7 +237,7 @@ export declare class Bucket {
227
237
  type BSONValue = any;
228
238
  type FilterOperators = {
229
239
  $eq: BSONValue;
230
- } | {
240
+ } | BSONValue | {
231
241
  $ne: BSONValue;
232
242
  } | {
233
243
  $lt: BSONValue;
package/dist/index.js CHANGED
@@ -1,17 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Query = exports.Bucket = exports.BSON = void 0;
3
+ exports.Query = exports.Bucket = exports.ObjectId = exports.BSON = void 0;
4
4
  exports.where = where;
5
5
  const platformSuffix = process.platform == "darwin" ? "macos" : process.platform === "win32" ? "windows" : process.platform;
6
6
  const archSuffix = process.arch === "x64" ? "x86_64" : process.arch === "arm64" ? "aarch64" : process.arch;
7
7
  const isMusl = process.versions.libc && process.versions.libc.includes("musl");
8
- const libcSuffix = isMusl ? "_musl" : "";
8
+ const libcSuffix = process.platform == "linux" ? (isMusl ? "_musl" : "_gnu") : "";
9
9
  const albedo = require(`../native/albedo.${archSuffix}_${platformSuffix}${libcSuffix}.node`);
10
10
  exports.default = albedo;
11
11
  exports.BSON = {
12
12
  serialize: albedo.serialize,
13
13
  deserialize: albedo.deserialize,
14
14
  };
15
+ /**
16
+ * Native ObjectId class constructor.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const id = new ObjectId();
21
+ * const parsed = ObjectId.fromString(id.toString());
22
+ * ```
23
+ */
24
+ exports.ObjectId = albedo.ObjectId;
15
25
  /**
16
26
  * Wrapper around a native Albedo bucket handle providing
17
27
  * methods for CRUD operations, indexing, iteration, and
Binary file
package/package.json CHANGED
@@ -1,9 +1,25 @@
1
1
  {
2
2
  "name": "albedo-node",
3
- "version": "0.5.5",
4
- "description": "Albedo DB native bindings",
3
+ "version": "0.5.7",
4
+ "description": "High-performance embedded database for Node.js with native bindings, BSON support, indexing, and replication",
5
+ "keywords": [
6
+ "albedo",
7
+ "database",
8
+ "embedded-database",
9
+ "bson",
10
+ "native",
11
+ "node-addon"
12
+ ],
5
13
  "main": "dist/index.js",
6
14
  "types": "dist/index.d.ts",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/klirix/albedo-node.git"
18
+ },
19
+ "homepage": "https://github.com/klirix/albedo-node#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/klirix/albedo-node/issues"
22
+ },
7
23
  "scripts": {
8
24
  "build:binding": "zig build",
9
25
  "build:ts": "bun run tsc -p tsconfig.json",