@vibecook/truffle-native 0.3.17 → 0.3.22
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/index.d.ts +283 -277
- package/index.js +56 -56
- package/package.json +1 -1
- package/truffle.darwin-arm64.node +0 -0
- package/truffle.darwin-x64.node +0 -0
- package/truffle.linux-arm64-gnu.node +0 -0
- package/truffle.linux-x64-gnu.node +0 -0
- package/truffle.win32-x64-msvc.node +0 -0
package/index.d.ts
CHANGED
|
@@ -1,360 +1,366 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* File transfer handle exposed to JavaScript.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Obtained via `NapiNode.fileTransfer()`. Holds an `Arc<Node>` to create
|
|
7
|
+
* fresh `FileTransfer` handles on each method call (the Rust `FileTransfer`
|
|
8
|
+
* borrows `&Node`, so we can't store it across JS boundaries).
|
|
8
9
|
*/
|
|
9
|
-
export declare class
|
|
10
|
+
export declare class NapiFileTransfer {
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Send a file to a peer.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
+
* Resolves with transfer result on success.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
sendFile(peerId: string, localPath: string, remotePath: string): Promise<NapiTransferResult>
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Returns the transfer ID.
|
|
19
|
-
*/
|
|
20
|
-
sendFile(targetDeviceId: string, filePath: string): Promise<string>
|
|
21
|
-
/** Accept an incoming file transfer offer. */
|
|
22
|
-
acceptTransfer(offer: NapiFileTransferOffer, savePath?: string | undefined | null): Promise<void>
|
|
23
|
-
/** Reject an incoming file transfer offer. */
|
|
24
|
-
rejectTransfer(offer: NapiFileTransferOffer, reason: string): Promise<void>
|
|
25
|
-
/** Cancel an active transfer. */
|
|
26
|
-
cancelTransfer(transferId: string): Promise<void>
|
|
27
|
-
/** Get all tracked transfers. */
|
|
28
|
-
getTransfers(): Promise<Array<NapiAdapterTransferInfo>>
|
|
29
|
-
/**
|
|
30
|
-
* Handle an incoming message from the mesh bus.
|
|
31
|
-
* Call this when a file-transfer namespace message arrives.
|
|
32
|
-
*/
|
|
33
|
-
handleBusMessage(msgType: string, payload: any): Promise<void>
|
|
34
|
-
/**
|
|
35
|
-
* Subscribe to adapter events (offers, progress, completed, failed, cancelled).
|
|
18
|
+
* Pull (download) a file from a remote peer.
|
|
36
19
|
*
|
|
37
|
-
*
|
|
20
|
+
* Resolves with transfer result on success.
|
|
38
21
|
*/
|
|
39
|
-
|
|
22
|
+
pullFile(peerId: string, remotePath: string, localPath: string): Promise<NapiTransferResult>
|
|
23
|
+
/** Auto-accept all incoming file offers, saving files to `output_dir`. */
|
|
24
|
+
autoAccept(outputDir: string): Promise<void>
|
|
25
|
+
/** Auto-reject all incoming file offers. */
|
|
26
|
+
autoReject(): Promise<void>
|
|
40
27
|
/**
|
|
41
|
-
* Subscribe to
|
|
28
|
+
* Subscribe to incoming file offers with a callback.
|
|
29
|
+
*
|
|
30
|
+
* The callback receives a `NapiFileOffer`. Use `autoAccept()` or
|
|
31
|
+
* `autoReject()` for automated handling, or use `onOffer()` for
|
|
32
|
+
* manual inspection of offers.
|
|
33
|
+
* Subscribe to incoming file offers with a callback.
|
|
42
34
|
*
|
|
43
|
-
* The
|
|
44
|
-
*
|
|
45
|
-
*
|
|
35
|
+
* The callback receives `(offer, responder)` — call `responder.accept(path)`
|
|
36
|
+
* or `responder.reject(reason)` to handle the offer. If neither is called
|
|
37
|
+
* within 60 seconds, the offer is auto-rejected.
|
|
46
38
|
*/
|
|
47
|
-
|
|
39
|
+
onOffer(callback: (offer: FileOffer, responder: NapiOfferResponder) => void): void
|
|
48
40
|
/**
|
|
49
|
-
*
|
|
41
|
+
* Subscribe to file transfer events.
|
|
50
42
|
*
|
|
51
|
-
* The
|
|
52
|
-
*
|
|
53
|
-
* Also spawns any pending event/bus callbacks registered before a Tokio
|
|
54
|
-
* runtime was available.
|
|
43
|
+
* The callback receives `NapiFileTransferEvent` objects for all
|
|
44
|
+
* transfer lifecycle events (hashing, progress, completed, failed, etc.).
|
|
55
45
|
*/
|
|
56
|
-
|
|
46
|
+
onEvent(callback: (event: FileTransferEvent) => void): void
|
|
47
|
+
/** Set the maximum allowed transfer size in bytes. */
|
|
48
|
+
setMaxTransferSize(bytes: number): void
|
|
57
49
|
}
|
|
58
50
|
|
|
59
51
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* Manages the full lifecycle: BridgeManager, GoShim sidecar, ConnectionManager,
|
|
63
|
-
* and MeshNode via the unified `TruffleRuntime`. The sidecar provides Tailscale
|
|
64
|
-
* connectivity; the bridge routes TCP streams; the connection manager upgrades
|
|
65
|
-
* them to WebSocket; and the mesh node handles device discovery, election,
|
|
66
|
-
* and messaging.
|
|
52
|
+
* The main truffle node exposed to JavaScript.
|
|
67
53
|
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
54
|
+
* Lifecycle:
|
|
55
|
+
* 1. `new NapiNode()` — creates an empty wrapper.
|
|
56
|
+
* 2. `await node.start(config)` — builds and starts the underlying `Node<TailscaleProvider>`.
|
|
57
|
+
* 3. Use `getPeers()`, `send()`, `onPeerChange()`, etc.
|
|
58
|
+
* 4. `await node.stop()` — shuts down the node.
|
|
72
59
|
*/
|
|
73
|
-
export declare class
|
|
60
|
+
export declare class NapiNode {
|
|
61
|
+
/** Create a new (unstarted) NapiNode. */
|
|
62
|
+
constructor()
|
|
74
63
|
/**
|
|
75
|
-
*
|
|
64
|
+
* Start the node with the given configuration.
|
|
76
65
|
*
|
|
77
|
-
*
|
|
66
|
+
* Resolves when the Tailscale sidecar is connected and the node is ready.
|
|
67
|
+
*
|
|
68
|
+
* # Safety
|
|
69
|
+
* This takes `&mut self` in an async context. The caller must ensure that
|
|
70
|
+
* no other calls are made on this NapiNode while `start()` is in progress.
|
|
78
71
|
*/
|
|
79
|
-
|
|
72
|
+
start(config: NapiNodeConfig): Promise<void>
|
|
80
73
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* If `sidecarPath` was provided, this spawns the Go sidecar process,
|
|
84
|
-
* creates a BridgeManager to route connections, and wires everything
|
|
85
|
-
* together for full Tailscale mesh networking.
|
|
74
|
+
* Stop the node and release all resources.
|
|
86
75
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
76
|
+
* # Safety
|
|
77
|
+
* This takes `&mut self` in an async context. The caller must ensure that
|
|
78
|
+
* no other calls are made on this NapiNode while `stop()` is in progress.
|
|
89
79
|
*/
|
|
90
|
-
start(): Promise<void>
|
|
91
|
-
/** Stop the mesh node and sidecar. */
|
|
92
80
|
stop(): Promise<void>
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
/** Get
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
|
|
101
|
-
/** Get
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
|
|
107
|
-
/** Get the current role as a string ("primary" or "secondary"). */
|
|
108
|
-
role(): Promise<string>
|
|
81
|
+
/** Get the local node's identity. */
|
|
82
|
+
getLocalInfo(): NapiNodeIdentity
|
|
83
|
+
/** Get all known peers. */
|
|
84
|
+
getPeers(): Promise<Array<NapiPeer>>
|
|
85
|
+
/** Resolve a peer identifier (name or ID) to the canonical node ID. */
|
|
86
|
+
resolvePeerId(peerId: string): Promise<string>
|
|
87
|
+
/** Ping a peer and return latency info. */
|
|
88
|
+
ping(peerId: string): Promise<NapiPingResult>
|
|
89
|
+
/** Get health information from the network layer. */
|
|
90
|
+
health(): Promise<NapiHealthInfo>
|
|
91
|
+
/** Send a namespaced message to a specific peer. */
|
|
92
|
+
send(peerId: string, namespace: string, data: Buffer): Promise<void>
|
|
93
|
+
/** Broadcast a namespaced message to all connected peers. */
|
|
94
|
+
broadcast(namespace: string, data: Buffer): Promise<void>
|
|
109
95
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
96
|
+
* Subscribe to peer change events.
|
|
97
|
+
*
|
|
98
|
+
* The callback receives `NapiPeerEvent` objects whenever peers
|
|
99
|
+
* join, leave, connect, disconnect, or update.
|
|
112
100
|
*/
|
|
113
|
-
|
|
114
|
-
/** Broadcast a mesh envelope to all connected devices. */
|
|
115
|
-
broadcastEnvelope(namespace: string, msgType: string, payload: any): Promise<void>
|
|
116
|
-
/** Get the current auth status ("unknown", "required", "authenticated"). */
|
|
117
|
-
authStatus(): Promise<string>
|
|
118
|
-
/** Get the current auth URL, if auth is required. */
|
|
119
|
-
authUrl(): Promise<string | null>
|
|
101
|
+
onPeerChange(callback: (event: PeerEvent) => void): void
|
|
120
102
|
/**
|
|
121
|
-
*
|
|
103
|
+
* Subscribe to messages on a specific namespace.
|
|
122
104
|
*
|
|
123
|
-
*
|
|
124
|
-
* the RFC 009 wire format). Use this to check compatibility with peers
|
|
125
|
-
* or to display version info in a UI.
|
|
105
|
+
* The callback receives `NapiNamespacedMessage` objects.
|
|
126
106
|
*/
|
|
127
|
-
|
|
128
|
-
/** Get
|
|
129
|
-
|
|
130
|
-
/** Handle tailnet peers update from the sidecar. */
|
|
131
|
-
handleTailnetPeers(peers: Array<NapiTailnetPeer>): Promise<void>
|
|
132
|
-
/** Set the local device as online with its Tailscale IP. */
|
|
133
|
-
setLocalOnline(tailscaleIp: string, dnsName?: string | undefined | null): Promise<void>
|
|
107
|
+
onMessage(namespace: string, callback: (msg: NamespacedMessage) => void): void
|
|
108
|
+
/** Get a `NapiFileTransfer` handle for file transfer operations. */
|
|
109
|
+
fileTransfer(): NapiFileTransfer
|
|
134
110
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* Uses ThreadsafeFunction with Blocking mode per RFC 003:
|
|
138
|
-
* - Critical events (device join/leave, election, errors) are never dropped
|
|
139
|
-
* - If the JS event queue is full, Rust waits rather than dropping events
|
|
140
|
-
*
|
|
141
|
-
* The callback receives NapiMeshEvent objects with event_type, device_id, and payload.
|
|
111
|
+
* Get a `NapiSyncedStore` handle for synchronized state operations.
|
|
142
112
|
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* event loop is spawned when `start()` is called.
|
|
113
|
+
* Each call creates a new store instance with the given `store_id`.
|
|
114
|
+
* Multiple stores can coexist with different IDs.
|
|
146
115
|
*/
|
|
147
|
-
|
|
116
|
+
syncedStore(storeId: string): NapiSyncedStore
|
|
148
117
|
}
|
|
149
118
|
|
|
150
119
|
/**
|
|
151
|
-
*
|
|
120
|
+
* Responder for accepting or rejecting a file offer from JS.
|
|
152
121
|
*
|
|
153
|
-
*
|
|
122
|
+
* The responder is consumed on the first call to `accept()` or `reject()`.
|
|
123
|
+
* If neither is called, the offer times out after 60 seconds.
|
|
154
124
|
*/
|
|
155
|
-
export declare class
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
|
|
125
|
+
export declare class NapiOfferResponder {
|
|
126
|
+
/** Accept the file offer, saving to the specified path. */
|
|
127
|
+
accept(savePath: string): Promise<void>
|
|
128
|
+
/** Reject the file offer with a reason. */
|
|
129
|
+
reject(reason: string): Promise<void>
|
|
160
130
|
}
|
|
161
131
|
|
|
162
132
|
/**
|
|
163
|
-
*
|
|
133
|
+
* Synchronized store handle exposed to JavaScript.
|
|
164
134
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
135
|
+
* Obtained via `NapiNode.syncedStore(storeId)`. Each store instance manages
|
|
136
|
+
* device-owned slices of JSON data that are automatically synchronized
|
|
137
|
+
* across the mesh.
|
|
167
138
|
*/
|
|
168
|
-
export declare class
|
|
139
|
+
export declare class NapiSyncedStore {
|
|
140
|
+
/** Update this device's data in the store. */
|
|
141
|
+
set(data: any): Promise<void>
|
|
142
|
+
/** Get this device's current data, or `null` if `set()` hasn't been called. */
|
|
143
|
+
local(): Promise<any | null>
|
|
144
|
+
/** Get a specific peer's slice by device ID. */
|
|
145
|
+
get(deviceId: string): Promise<NapiSlice | null>
|
|
146
|
+
/** Get all slices (local + remote) as an array. */
|
|
147
|
+
all(): Promise<Array<NapiSlice>>
|
|
148
|
+
/** Get all device IDs that have data in this store. */
|
|
149
|
+
deviceIds(): Promise<Array<string>>
|
|
150
|
+
/** The store identifier. */
|
|
151
|
+
storeId(): string
|
|
152
|
+
/** Current local version number. */
|
|
153
|
+
version(): number
|
|
169
154
|
/**
|
|
170
|
-
*
|
|
155
|
+
* Subscribe to store change events.
|
|
171
156
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
157
|
+
* The callback receives `NapiStoreEvent` objects whenever local data
|
|
158
|
+
* changes, a peer's data is updated, or a peer is removed.
|
|
174
159
|
*/
|
|
175
|
-
|
|
160
|
+
onChange(callback: (event: StoreEvent) => void): void
|
|
176
161
|
/**
|
|
177
|
-
*
|
|
162
|
+
* Stop the store and cancel all event-forwarding tasks.
|
|
178
163
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
164
|
+
* # Safety
|
|
165
|
+
* This takes `&mut self` in an async context. The caller must ensure that
|
|
166
|
+
* no other calls are made on this NapiSyncedStore while `stop()` is in progress.
|
|
181
167
|
*/
|
|
182
|
-
start(): Promise<void>
|
|
183
|
-
/** Stop syncing. */
|
|
184
168
|
stop(): Promise<void>
|
|
185
|
-
/** Dispose the adapter. */
|
|
186
|
-
dispose(): Promise<void>
|
|
187
|
-
/** Handle an incoming sync message from a remote device. */
|
|
188
|
-
handleSyncMessage(from: string | undefined | null, msgType: string, payload: any): Promise<void>
|
|
189
|
-
/** Handle a device going offline. */
|
|
190
|
-
handleDeviceOffline(deviceId: string): Promise<void>
|
|
191
|
-
/** Handle a new device being discovered. */
|
|
192
|
-
handleDeviceDiscovered(deviceId: string): Promise<void>
|
|
193
|
-
/** Notify that a local store changed (triggers sync broadcast). */
|
|
194
|
-
handleLocalChanged(storeId: string, slice: NapiDeviceSlice): Promise<void>
|
|
195
|
-
/**
|
|
196
|
-
* Subscribe to outgoing sync messages.
|
|
197
|
-
*
|
|
198
|
-
* The callback receives messages that should be broadcast to all devices
|
|
199
|
-
* via the mesh message bus. Can be called before or after `start()`.
|
|
200
|
-
*/
|
|
201
|
-
onOutgoing(callback: (err: null | Error, message: NapiOutgoingSyncMessage) => void): void
|
|
202
169
|
}
|
|
203
170
|
|
|
204
|
-
/**
|
|
205
|
-
export interface
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
171
|
+
/** An incoming file offer from a remote peer. */
|
|
172
|
+
export interface NapiFileOffer {
|
|
173
|
+
/** Stable node ID of the sending peer. */
|
|
174
|
+
fromPeer: string
|
|
175
|
+
/** Human-readable name of the sending peer. */
|
|
176
|
+
fromName: string
|
|
177
|
+
/** File name being offered. */
|
|
210
178
|
fileName: string
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
export interface NapiBaseDevice {
|
|
220
|
-
id: string
|
|
221
|
-
deviceType: string
|
|
222
|
-
name: string
|
|
223
|
-
tailscaleHostname: string
|
|
224
|
-
tailscaleDnsName?: string
|
|
225
|
-
tailscaleIp?: string
|
|
226
|
-
role?: string
|
|
227
|
-
status: string
|
|
228
|
-
capabilities: Array<string>
|
|
229
|
-
metadata?: any
|
|
230
|
-
lastSeen?: number
|
|
231
|
-
startedAt?: number
|
|
232
|
-
os?: string
|
|
233
|
-
latencyMs?: number
|
|
179
|
+
/** File size in bytes. */
|
|
180
|
+
size: number
|
|
181
|
+
/** Expected SHA-256 hash (hex). */
|
|
182
|
+
sha256: string
|
|
183
|
+
/** Suggested save path from the sender. */
|
|
184
|
+
suggestedPath: string
|
|
185
|
+
/** Unique token for this transfer. */
|
|
186
|
+
token: string
|
|
234
187
|
}
|
|
235
188
|
|
|
236
|
-
/**
|
|
237
|
-
export interface
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
189
|
+
/** Events emitted by the file transfer subsystem. */
|
|
190
|
+
export interface NapiFileTransferEvent {
|
|
191
|
+
/**
|
|
192
|
+
* Event type: "offer_received", "hashing", "waiting_for_accept",
|
|
193
|
+
* "progress", "completed", "rejected", "failed".
|
|
194
|
+
*/
|
|
195
|
+
eventType: string
|
|
196
|
+
/** Transfer token (if applicable). */
|
|
197
|
+
token?: string
|
|
198
|
+
/** File name (if applicable). */
|
|
199
|
+
fileName?: string
|
|
200
|
+
/** Direction: "send" or "receive" (if applicable). */
|
|
201
|
+
direction?: string
|
|
202
|
+
/** Progress info (present for "progress" events). */
|
|
203
|
+
progress?: NapiTransferProgress
|
|
204
|
+
/** Offer info (present for "offer_received" events). */
|
|
205
|
+
offer?: NapiFileOffer
|
|
206
|
+
/** Bytes transferred (present for "completed" events). */
|
|
207
|
+
bytesTransferred?: number
|
|
208
|
+
/** SHA-256 hash (present for "completed" events). */
|
|
209
|
+
sha256?: string
|
|
210
|
+
/** Elapsed seconds (present for "completed" events). */
|
|
211
|
+
elapsedSecs?: number
|
|
212
|
+
/** Reason for rejection or failure. */
|
|
213
|
+
reason?: string
|
|
214
|
+
/** Bytes hashed so far (present for "hashing" events). */
|
|
215
|
+
bytesHashed?: number
|
|
216
|
+
/** Total bytes to hash (present for "hashing" events). */
|
|
217
|
+
totalBytes?: number
|
|
241
218
|
}
|
|
242
219
|
|
|
243
|
-
/**
|
|
244
|
-
export interface
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
220
|
+
/** Health information from the network layer. */
|
|
221
|
+
export interface NapiHealthInfo {
|
|
222
|
+
/** Current backend state (e.g., "Running", "NeedsLogin"). */
|
|
223
|
+
state: string
|
|
224
|
+
/** Key expiry timestamp (RFC 3339), if applicable. */
|
|
225
|
+
keyExpiry?: string
|
|
226
|
+
/** Active health warnings. */
|
|
227
|
+
warnings: Array<string>
|
|
228
|
+
/** Whether the network is fully operational. */
|
|
229
|
+
healthy: boolean
|
|
249
230
|
}
|
|
250
231
|
|
|
251
|
-
/**
|
|
252
|
-
export interface
|
|
253
|
-
/**
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
|
|
263
|
-
/** Progress event interval in milliseconds. */
|
|
264
|
-
progressIntervalMs?: number
|
|
265
|
-
/** Progress event byte threshold. */
|
|
266
|
-
progressBytes?: number
|
|
232
|
+
/** A message received on a specific namespace. */
|
|
233
|
+
export interface NapiNamespacedMessage {
|
|
234
|
+
/** Stable node ID of the sender. */
|
|
235
|
+
from: string
|
|
236
|
+
/** Namespace the message was sent on. */
|
|
237
|
+
namespace: string
|
|
238
|
+
/** Application-defined message type. */
|
|
239
|
+
msgType: string
|
|
240
|
+
/** Opaque JSON payload (as a JS value via serde). */
|
|
241
|
+
payload: any
|
|
242
|
+
/** Millisecond Unix timestamp from the sender, if set. */
|
|
243
|
+
timestamp?: number
|
|
267
244
|
}
|
|
268
245
|
|
|
269
|
-
/**
|
|
270
|
-
export interface
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
246
|
+
/** Configuration for starting a Node. */
|
|
247
|
+
export interface NapiNodeConfig {
|
|
248
|
+
/** Human-readable node name (used as Tailscale hostname). */
|
|
249
|
+
name: string
|
|
250
|
+
/** Path to the Go sidecar binary. */
|
|
251
|
+
sidecarPath: string
|
|
252
|
+
/** Tailscale state directory. Defaults to `/tmp/truffle-{name}`. */
|
|
253
|
+
stateDir?: string
|
|
254
|
+
/** Tailscale auth key for headless authentication. */
|
|
255
|
+
authKey?: string
|
|
256
|
+
/** Whether the node is ephemeral (auto-removed from tailnet on shutdown). */
|
|
257
|
+
ephemeral?: boolean
|
|
258
|
+
/** WebSocket listen port. Defaults to 9417. */
|
|
259
|
+
wsPort?: number
|
|
274
260
|
}
|
|
275
261
|
|
|
276
|
-
/**
|
|
277
|
-
export interface
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
262
|
+
/** Identity of the local node. */
|
|
263
|
+
export interface NapiNodeIdentity {
|
|
264
|
+
/** Stable node ID. */
|
|
265
|
+
id: string
|
|
266
|
+
/** Hostname on the network. */
|
|
267
|
+
hostname: string
|
|
268
|
+
/** Human-readable display name. */
|
|
269
|
+
name: string
|
|
270
|
+
/** DNS name on the tailnet, if available. */
|
|
271
|
+
dnsName?: string
|
|
272
|
+
/** Tailscale IP address as a string, if available. */
|
|
273
|
+
ip?: string
|
|
285
274
|
}
|
|
286
275
|
|
|
287
|
-
/**
|
|
288
|
-
export interface
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
276
|
+
/** A peer as seen by application code. */
|
|
277
|
+
export interface NapiPeer {
|
|
278
|
+
/** Stable node ID. */
|
|
279
|
+
id: string
|
|
280
|
+
/** Human-readable name (hostname). */
|
|
281
|
+
name: string
|
|
282
|
+
/** Network IP address as a string. */
|
|
283
|
+
ip: string
|
|
284
|
+
/** Whether the peer is online (from Layer 3). */
|
|
285
|
+
online: boolean
|
|
286
|
+
/** Whether there is an active WebSocket connection. */
|
|
287
|
+
wsConnected: boolean
|
|
288
|
+
/** Connection type description (e.g., "direct" or "relay:ord"). */
|
|
289
|
+
connectionType: string
|
|
290
|
+
/** Operating system, if known. */
|
|
291
|
+
os?: string
|
|
292
|
+
/** Last time the peer was seen online (RFC 3339 string). */
|
|
293
|
+
lastSeen?: string
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
/** A
|
|
297
|
-
export interface
|
|
296
|
+
/** A peer change event delivered to JS. */
|
|
297
|
+
export interface NapiPeerEvent {
|
|
298
|
+
/** Event type: "joined", "left", "updated", "ws_connected", "ws_disconnected", "auth_required". */
|
|
298
299
|
eventType: string
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
/** Peer ID (present for peer events, empty for auth_required). */
|
|
301
|
+
peerId: string
|
|
302
|
+
/** Full peer info (present for joined/updated events). */
|
|
303
|
+
peer?: NapiPeer
|
|
304
|
+
/** Auth URL (present only for auth_required events). */
|
|
305
|
+
authUrl?: string
|
|
301
306
|
}
|
|
302
307
|
|
|
303
|
-
/**
|
|
304
|
-
export interface
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
|
|
311
|
-
* from `@vibecook/truffle` for automatic platform detection.
|
|
312
|
-
*/
|
|
313
|
-
sidecarPath?: string
|
|
314
|
-
stateDir?: string
|
|
315
|
-
authKey?: string
|
|
316
|
-
preferPrimary?: boolean
|
|
317
|
-
staticPath?: string
|
|
318
|
-
capabilities?: Array<string>
|
|
319
|
-
timing?: NapiMeshTimingConfig
|
|
320
|
-
/** If true, the node is ephemeral (cleaned up when offline). */
|
|
321
|
-
ephemeral?: boolean
|
|
322
|
-
/** ACL tags to advertise (e.g. ["tag:truffle"]). */
|
|
323
|
-
tags?: Array<string>
|
|
308
|
+
/** Result of a network-level ping. */
|
|
309
|
+
export interface NapiPingResult {
|
|
310
|
+
/** Round-trip latency in milliseconds. */
|
|
311
|
+
latencyMs: number
|
|
312
|
+
/** Connection type description (e.g., "direct" or "relay:sfo"). */
|
|
313
|
+
connection: string
|
|
314
|
+
/** Direct peer endpoint address, if available. */
|
|
315
|
+
peerAddr?: string
|
|
324
316
|
}
|
|
325
317
|
|
|
326
|
-
/**
|
|
327
|
-
export interface
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
318
|
+
/** A versioned slice of data owned by a single device. */
|
|
319
|
+
export interface NapiSlice {
|
|
320
|
+
/** Device that owns this slice (stable node ID). */
|
|
321
|
+
deviceId: string
|
|
322
|
+
/** The data (JSON value). */
|
|
323
|
+
data: any
|
|
324
|
+
/** Monotonically increasing version (per-device). */
|
|
325
|
+
version: number
|
|
326
|
+
/** When this version was created (Unix milliseconds). */
|
|
327
|
+
updatedAt: number
|
|
334
328
|
}
|
|
335
329
|
|
|
336
|
-
/**
|
|
337
|
-
export interface
|
|
338
|
-
|
|
339
|
-
|
|
330
|
+
/** A store change event delivered to JS. */
|
|
331
|
+
export interface NapiStoreEvent {
|
|
332
|
+
/** Event type: "local_changed", "peer_updated", "peer_removed". */
|
|
333
|
+
eventType: string
|
|
334
|
+
/** Device ID (present for peer_updated/peer_removed events). */
|
|
335
|
+
deviceId?: string
|
|
336
|
+
/** Data payload (present for local_changed/peer_updated events). */
|
|
337
|
+
data?: any
|
|
338
|
+
/** Version number (present for peer_updated events). */
|
|
339
|
+
version?: number
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
/**
|
|
343
|
-
export interface
|
|
344
|
-
|
|
342
|
+
/** Progress update for an in-flight file transfer. */
|
|
343
|
+
export interface NapiTransferProgress {
|
|
344
|
+
/** Unique token for this transfer. */
|
|
345
|
+
token: string
|
|
346
|
+
/** Direction: "send" or "receive". */
|
|
347
|
+
direction: string
|
|
348
|
+
/** File name being transferred. */
|
|
349
|
+
fileName: string
|
|
350
|
+
/** Bytes transferred so far. */
|
|
351
|
+
bytesTransferred: number
|
|
352
|
+
/** Total file size in bytes. */
|
|
353
|
+
totalBytes: number
|
|
354
|
+
/** Current transfer speed in bytes per second. */
|
|
355
|
+
speedBps: number
|
|
345
356
|
}
|
|
346
357
|
|
|
347
|
-
/**
|
|
348
|
-
export interface
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
curAddr?: string
|
|
356
|
-
relay?: string
|
|
357
|
-
lastSeen?: string
|
|
358
|
-
keyExpiry?: string
|
|
359
|
-
expired?: boolean
|
|
358
|
+
/** Result of a completed file transfer. */
|
|
359
|
+
export interface NapiTransferResult {
|
|
360
|
+
/** Number of bytes transferred. */
|
|
361
|
+
bytesTransferred: number
|
|
362
|
+
/** SHA-256 hash of the transferred file. */
|
|
363
|
+
sha256: string
|
|
364
|
+
/** Elapsed time in seconds. */
|
|
365
|
+
elapsedSecs: number
|
|
360
366
|
}
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('@vibecook/truffle-native-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('@vibecook/truffle-native-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
80
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('@vibecook/truffle-native-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('@vibecook/truffle-native-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
96
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('@vibecook/truffle-native-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('@vibecook/truffle-native-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
117
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('@vibecook/truffle-native-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('@vibecook/truffle-native-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
133
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@vibecook/truffle-native-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@vibecook/truffle-native-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
150
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('@vibecook/truffle-native-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('@vibecook/truffle-native-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
166
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('@vibecook/truffle-native-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('@vibecook/truffle-native-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
185
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('@vibecook/truffle-native-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('@vibecook/truffle-native-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
201
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('@vibecook/truffle-native-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('@vibecook/truffle-native-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
217
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@vibecook/truffle-native-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('@vibecook/truffle-native-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
237
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('@vibecook/truffle-native-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('@vibecook/truffle-native-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
253
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('@vibecook/truffle-native-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
274
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('@vibecook/truffle-native-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
290
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('@vibecook/truffle-native-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
308
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('@vibecook/truffle-native-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
324
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('@vibecook/truffle-native-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
342
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('@vibecook/truffle-native-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
358
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('@vibecook/truffle-native-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
376
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('@vibecook/truffle-native-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
392
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('@vibecook/truffle-native-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
410
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('@vibecook/truffle-native-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
426
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@vibecook/truffle-native-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
443
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@vibecook/truffle-native-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@vibecook/truffle-native-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
459
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@vibecook/truffle-native-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('@vibecook/truffle-native-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
479
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@vibecook/truffle-native-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('@vibecook/truffle-native-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
495
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('@vibecook/truffle-native-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('@vibecook/truffle-native-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.
|
|
511
|
+
if (bindingPackageVersion !== '0.3.17' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.3.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -576,7 +576,7 @@ if (!nativeBinding) {
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
module.exports = nativeBinding
|
|
579
|
-
module.exports.
|
|
580
|
-
module.exports.
|
|
581
|
-
module.exports.
|
|
582
|
-
module.exports.
|
|
579
|
+
module.exports.NapiFileTransfer = nativeBinding.NapiFileTransfer
|
|
580
|
+
module.exports.NapiNode = nativeBinding.NapiNode
|
|
581
|
+
module.exports.NapiOfferResponder = nativeBinding.NapiOfferResponder
|
|
582
|
+
module.exports.NapiSyncedStore = nativeBinding.NapiSyncedStore
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|