tigerbeetle-node 0.13.75 → 0.13.76
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/bin/aarch64-linux-gnu/client.node +0 -0
- package/dist/bin/aarch64-linux-musl/client.node +0 -0
- package/dist/bin/aarch64-macos/client.node +0 -0
- package/dist/bin/x86_64-linux-gnu/client.node +0 -0
- package/dist/bin/x86_64-linux-musl/client.node +0 -0
- package/dist/bin/x86_64-macos/client.node +0 -0
- package/package.json +2 -2
- package/src/translate.zig +14 -14
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tigerbeetle-node",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.76",
|
|
4
4
|
"description": "TigerBeetle Node.js client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test": "node dist/test",
|
|
29
29
|
"build": "npm run build_tsc && npm run build_lib",
|
|
30
30
|
"build_tsc": "./node_modules/typescript/bin/tsc",
|
|
31
|
-
"build_lib": "node scripts/windows_generate_node_lib.js && cd ../../.. && ./
|
|
31
|
+
"build_lib": "node scripts/windows_generate_node_lib.js && cd ../../.. && ./zig/zig build node_client -Drelease-safe",
|
|
32
32
|
"prepack": "npm run build && find dist/bin -name '*.o' -delete && for path in dist/bin/*; do mv ${path}/libtb_nodeclient.* ${path}/client.node; done",
|
|
33
33
|
"clean": "rm -rf build dist node_modules src/zig-cache zig"
|
|
34
34
|
},
|
package/src/translate.zig
CHANGED
|
@@ -6,21 +6,21 @@ pub fn register_function(
|
|
|
6
6
|
env: c.napi_env,
|
|
7
7
|
exports: c.napi_value,
|
|
8
8
|
comptime name: [:0]const u8,
|
|
9
|
-
function: fn (env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_value,
|
|
9
|
+
function: *const fn (env: c.napi_env, info: c.napi_callback_info) callconv(.C) c.napi_value,
|
|
10
10
|
) !void {
|
|
11
11
|
var napi_function: c.napi_value = undefined;
|
|
12
12
|
if (c.napi_create_function(env, null, 0, function, null, &napi_function) != c.napi_ok) {
|
|
13
13
|
return throw(env, "Failed to create function " ++ name ++ "().");
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
if (c.napi_set_named_property(env, exports, name, napi_function) != c.napi_ok) {
|
|
16
|
+
if (c.napi_set_named_property(env, exports, @ptrCast([*c]const u8, name), napi_function) != c.napi_ok) {
|
|
17
17
|
return throw(env, "Failed to add " ++ name ++ "() to exports.");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const TranslationError = error{ExceptionThrown};
|
|
22
22
|
pub fn throw(env: c.napi_env, comptime message: [:0]const u8) TranslationError {
|
|
23
|
-
var result = c.napi_throw_error(env, null, message);
|
|
23
|
+
var result = c.napi_throw_error(env, null, @ptrCast([*c]const u8, message));
|
|
24
24
|
switch (result) {
|
|
25
25
|
c.napi_ok, c.napi_pending_exception => {},
|
|
26
26
|
else => unreachable,
|
|
@@ -41,7 +41,7 @@ pub fn capture_undefined(env: c.napi_env) !c.napi_value {
|
|
|
41
41
|
pub fn set_instance_data(
|
|
42
42
|
env: c.napi_env,
|
|
43
43
|
data: *anyopaque,
|
|
44
|
-
finalize_callback: fn (env: c.napi_env, data: ?*anyopaque, hint: ?*anyopaque) callconv(.C) void,
|
|
44
|
+
finalize_callback: *const fn (env: c.napi_env, data: ?*anyopaque, hint: ?*anyopaque) callconv(.C) void,
|
|
45
45
|
) !void {
|
|
46
46
|
if (c.napi_set_instance_data(env, data, finalize_callback, null) != c.napi_ok) {
|
|
47
47
|
return throw(env, "Failed to initialize environment.");
|
|
@@ -70,7 +70,7 @@ pub fn value_external(
|
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
pub const UserData =
|
|
73
|
+
pub const UserData = extern struct {
|
|
74
74
|
env: c.napi_env,
|
|
75
75
|
callback_reference: c.napi_ref,
|
|
76
76
|
};
|
|
@@ -110,7 +110,7 @@ pub fn slice_from_object(
|
|
|
110
110
|
comptime key: [:0]const u8,
|
|
111
111
|
) ![]const u8 {
|
|
112
112
|
var property: c.napi_value = undefined;
|
|
113
|
-
if (c.napi_get_named_property(env, object, key, &property) != c.napi_ok) {
|
|
113
|
+
if (c.napi_get_named_property(env, object, @ptrCast([*c]const u8, key), &property) != c.napi_ok) {
|
|
114
114
|
return throw(env, key ++ " must be defined");
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -143,7 +143,7 @@ pub fn bytes_from_object(
|
|
|
143
143
|
comptime key: [:0]const u8,
|
|
144
144
|
) ![length]u8 {
|
|
145
145
|
var property: c.napi_value = undefined;
|
|
146
|
-
if (c.napi_get_named_property(env, object, key, &property) != c.napi_ok) {
|
|
146
|
+
if (c.napi_get_named_property(env, object, @ptrCast([*c]const u8, key), &property) != c.napi_ok) {
|
|
147
147
|
return throw(env, key ++ " must be defined");
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -181,7 +181,7 @@ pub fn bytes_from_buffer(
|
|
|
181
181
|
|
|
182
182
|
pub fn u128_from_object(env: c.napi_env, object: c.napi_value, comptime key: [:0]const u8) !u128 {
|
|
183
183
|
var property: c.napi_value = undefined;
|
|
184
|
-
if (c.napi_get_named_property(env, object, key, &property) != c.napi_ok) {
|
|
184
|
+
if (c.napi_get_named_property(env, object, @ptrCast([*c]const u8, key), &property) != c.napi_ok) {
|
|
185
185
|
return throw(env, key ++ " must be defined");
|
|
186
186
|
}
|
|
187
187
|
|
|
@@ -190,7 +190,7 @@ pub fn u128_from_object(env: c.napi_env, object: c.napi_value, comptime key: [:0
|
|
|
190
190
|
|
|
191
191
|
pub fn u64_from_object(env: c.napi_env, object: c.napi_value, comptime key: [:0]const u8) !u64 {
|
|
192
192
|
var property: c.napi_value = undefined;
|
|
193
|
-
if (c.napi_get_named_property(env, object, key, &property) != c.napi_ok) {
|
|
193
|
+
if (c.napi_get_named_property(env, object, @ptrCast([*c]const u8, key), &property) != c.napi_ok) {
|
|
194
194
|
return throw(env, key ++ " must be defined");
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -199,7 +199,7 @@ pub fn u64_from_object(env: c.napi_env, object: c.napi_value, comptime key: [:0]
|
|
|
199
199
|
|
|
200
200
|
pub fn u32_from_object(env: c.napi_env, object: c.napi_value, comptime key: [:0]const u8) !u32 {
|
|
201
201
|
var property: c.napi_value = undefined;
|
|
202
|
-
if (c.napi_get_named_property(env, object, key, &property) != c.napi_ok) {
|
|
202
|
+
if (c.napi_get_named_property(env, object, @ptrCast([*c]const u8, key), &property) != c.napi_ok) {
|
|
203
203
|
return throw(env, key ++ " must be defined");
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -274,7 +274,7 @@ pub fn byte_slice_into_object(
|
|
|
274
274
|
return throw(env, error_message ++ " Failed to allocate Buffer in V8.");
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
if (c.napi_set_named_property(env, object, key, result) != c.napi_ok) {
|
|
277
|
+
if (c.napi_set_named_property(env, object, @ptrCast([*c]const u8, key), result) != c.napi_ok) {
|
|
278
278
|
return throw(env, error_message);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -301,7 +301,7 @@ pub fn u128_into_object(
|
|
|
301
301
|
return throw(env, error_message);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
if (c.napi_set_named_property(env, object, key, bigint) != c.napi_ok) {
|
|
304
|
+
if (c.napi_set_named_property(env, object, @ptrCast([*c]const u8, key), bigint) != c.napi_ok) {
|
|
305
305
|
return throw(env, error_message);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
@@ -318,7 +318,7 @@ pub fn u64_into_object(
|
|
|
318
318
|
return throw(env, error_message);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
if (c.napi_set_named_property(env, object, key, result) != c.napi_ok) {
|
|
321
|
+
if (c.napi_set_named_property(env, object, @ptrCast([*c]const u8, key), result) != c.napi_ok) {
|
|
322
322
|
return throw(env, error_message);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -335,7 +335,7 @@ pub fn u32_into_object(
|
|
|
335
335
|
return throw(env, error_message);
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
if (c.napi_set_named_property(env, object, key, result) != c.napi_ok) {
|
|
338
|
+
if (c.napi_set_named_property(env, object, @ptrCast([*c]const u8, key), result) != c.napi_ok) {
|
|
339
339
|
return throw(env, error_message);
|
|
340
340
|
}
|
|
341
341
|
}
|