@xmtp/node-bindings 1.7.0-dev.5b3dd5f → 1.7.0-dev.9bc470b
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/bindings_node.darwin-arm64.node +0 -0
- package/dist/bindings_node.darwin-x64.node +0 -0
- package/dist/bindings_node.linux-arm64-gnu.node +0 -0
- package/dist/bindings_node.linux-arm64-musl.node +0 -0
- package/dist/bindings_node.linux-x64-gnu.node +0 -0
- package/dist/bindings_node.linux-x64-musl.node +0 -0
- package/dist/bindings_node.win32-x64-msvc.node +0 -0
- package/dist/index.d.ts +34 -31
- package/dist/index.js +322 -112
- package/package.json +17 -20
- package/dist/version.json +0 -5
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export declare class Client {
|
|
4
|
-
accountIdentifier: Identifier
|
|
4
|
+
get accountIdentifier(): Identifier
|
|
5
5
|
inboxId(): string
|
|
6
6
|
isRegistered(): boolean
|
|
7
7
|
installationId(): string
|
|
@@ -23,18 +23,18 @@ export declare class Client {
|
|
|
23
23
|
uploadDebugArchive(serverUrl: string): Promise<string>
|
|
24
24
|
deleteMessage(messageId: Uint8Array): number
|
|
25
25
|
enrichedMessage(messageId: Array<number>): Promise<DecodedMessage>
|
|
26
|
+
releaseDbConnection(): void
|
|
27
|
+
dbReconnect(): Promise<void>
|
|
26
28
|
setConsentStates(records: Array<Consent>): Promise<void>
|
|
27
29
|
getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
|
|
28
|
-
/**
|
|
29
|
-
* Get the client's inbox state.
|
|
30
|
+
/** * Get the client's inbox state.
|
|
30
31
|
*
|
|
31
32
|
* If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
32
33
|
* Otherwise, the state will be read from the local database.
|
|
33
34
|
*/
|
|
34
35
|
inboxState(refreshFromNetwork: boolean): Promise<InboxState>
|
|
35
36
|
getLatestInboxState(inboxId: string): Promise<InboxState>
|
|
36
|
-
/**
|
|
37
|
-
* Get key package statuses for a list of installation IDs.
|
|
37
|
+
/** * Get key package statuses for a list of installation IDs.
|
|
38
38
|
*
|
|
39
39
|
* Returns a JavaScript Object mapping installation ID strings to KeyPackageStatus objects.
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export declare class Client {
|
|
|
42
42
|
createInboxSignatureRequest(): Promise<SignatureRequestHandle | null>
|
|
43
43
|
addIdentifierSignatureRequest(newIdentifier: Identifier): Promise<SignatureRequestHandle>
|
|
44
44
|
revokeIdentifierSignatureRequest(identifier: Identifier): Promise<SignatureRequestHandle>
|
|
45
|
-
revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle
|
|
45
|
+
revokeAllOtherInstallationsSignatureRequest(): Promise<SignatureRequestHandle>
|
|
46
46
|
revokeInstallationsSignatureRequest(installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
|
|
47
47
|
changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier: Identifier): Promise<SignatureRequestHandle>
|
|
48
48
|
applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>
|
|
@@ -80,7 +80,7 @@ export declare class Conversation {
|
|
|
80
80
|
groupImageUrlSquare(): string
|
|
81
81
|
updateGroupDescription(groupDescription: string): Promise<void>
|
|
82
82
|
groupDescription(): string
|
|
83
|
-
stream(callback: (err:
|
|
83
|
+
stream(callback: ((err: Error | null, arg: Message) => void), onClose: ((err: Error | null, ) => void)): Promise<StreamCloser>
|
|
84
84
|
createdAtNs(): number
|
|
85
85
|
isActive(): boolean
|
|
86
86
|
pausedForVersion(): string | null
|
|
@@ -121,11 +121,11 @@ export declare class Conversations {
|
|
|
121
121
|
syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<GroupSyncSummary>
|
|
122
122
|
list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
123
123
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
124
|
-
stream(callback: (err: Error | null,
|
|
125
|
-
streamAllMessages(callback: (err:
|
|
126
|
-
streamConsent(callback: (err:
|
|
127
|
-
streamPreferences(callback: (err:
|
|
128
|
-
streamMessageDeletions(callback: (err:
|
|
124
|
+
stream(callback: ((err: Error | null, arg: Conversation) => void), onClose: ((err: Error | null, ) => void), conversationType?: ConversationType | undefined | null): Promise<StreamCloser>
|
|
125
|
+
streamAllMessages(callback: ((err: Error | null, arg: Message) => void), onClose: ((err: Error | null, ) => void), conversationType?: ConversationType | undefined | null, consentStates?: Array<ConsentState> | undefined | null): Promise<StreamCloser>
|
|
126
|
+
streamConsent(callback: ((err: Error | null, arg: Array<Consent>) => void), onClose: ((err: Error | null, ) => void)): Promise<StreamCloser>
|
|
127
|
+
streamPreferences(callback: ((err: Error | null, arg: Array<UserPreferenceUpdate>) => void), onClose: ((err: Error | null, ) => void)): Promise<StreamCloser>
|
|
128
|
+
streamMessageDeletions(callback: ((err: Error | null, arg: string) => void)): StreamCloser
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export declare class DecodedMessage {
|
|
@@ -134,12 +134,12 @@ export declare class DecodedMessage {
|
|
|
134
134
|
kind: GroupMessageKind
|
|
135
135
|
senderInstallationId: Array<number>
|
|
136
136
|
senderInboxId: string
|
|
137
|
-
contentType: ContentTypeId
|
|
138
137
|
conversationId: Array<number>
|
|
139
138
|
fallbackText?: string
|
|
140
139
|
deliveryStatus: DeliveryStatus
|
|
141
140
|
numReplies: number
|
|
142
141
|
get reactions(): Array<DecodedMessage>
|
|
142
|
+
get contentType(): ContentTypeId
|
|
143
143
|
get textContent(): TextContent | null
|
|
144
144
|
get replyContent(): EnrichedReply | null
|
|
145
145
|
get reactionContent(): ReactionPayload | null
|
|
@@ -161,10 +161,10 @@ export declare class EnrichedReply {
|
|
|
161
161
|
|
|
162
162
|
export declare class GroupMember {
|
|
163
163
|
inboxId: string
|
|
164
|
-
accountIdentifiers: Array<Identifier>
|
|
165
164
|
installationIds: Array<string>
|
|
166
165
|
permissionLevel: PermissionLevel
|
|
167
166
|
consentState: ConsentState
|
|
167
|
+
get accountIdentifiers(): Array<Identifier>
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
export declare class GroupMetadata {
|
|
@@ -212,7 +212,7 @@ export interface ApiStats {
|
|
|
212
212
|
subscribeWelcomes: bigint
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
export declare
|
|
215
|
+
export declare function applySignatureRequest(v3Host: string, gatewayHost: string | undefined | null, signatureRequest: SignatureRequestHandle): Promise<void>
|
|
216
216
|
|
|
217
217
|
export interface Attachment {
|
|
218
218
|
filename?: string
|
|
@@ -275,14 +275,13 @@ export declare const enum ConversationType {
|
|
|
275
275
|
Oneshot = 3
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
-
/**
|
|
279
|
-
* Create a client.
|
|
278
|
+
/** * Create a client.
|
|
280
279
|
*
|
|
281
280
|
* Optionally specify a filter for the log level as a string.
|
|
282
281
|
* It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
|
|
283
282
|
* By default, logging is disabled.
|
|
284
283
|
*/
|
|
285
|
-
export declare
|
|
284
|
+
export declare function createClient(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, deviceSyncServerUrl?: string | undefined | null, deviceSyncWorkerMode?: SyncWorkerMode | undefined | null, logOptions?: LogOptions | undefined | null, allowOffline?: boolean | undefined | null, disableEvents?: boolean | undefined | null, appVersion?: string | undefined | null, nonce?: bigint | undefined | null): Promise<Client>
|
|
286
285
|
|
|
287
286
|
export interface CreateDmOptions {
|
|
288
287
|
messageDisappearingSettings?: MessageDisappearingSettings
|
|
@@ -310,9 +309,9 @@ export interface DecodedMessageBody {
|
|
|
310
309
|
customContent?: EncodedContent
|
|
311
310
|
}
|
|
312
311
|
|
|
313
|
-
export declare
|
|
312
|
+
export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
|
|
314
313
|
|
|
315
|
-
export declare
|
|
314
|
+
export declare function decodeReaction(bytes: Uint8Array): Reaction
|
|
316
315
|
|
|
317
316
|
export declare const enum DeliveryStatus {
|
|
318
317
|
Unpublished = 0,
|
|
@@ -320,7 +319,7 @@ export declare const enum DeliveryStatus {
|
|
|
320
319
|
Failed = 2
|
|
321
320
|
}
|
|
322
321
|
|
|
323
|
-
export declare
|
|
322
|
+
export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
|
|
324
323
|
|
|
325
324
|
export interface EncodedContent {
|
|
326
325
|
type?: ContentTypeId
|
|
@@ -330,13 +329,13 @@ export interface EncodedContent {
|
|
|
330
329
|
content: Uint8Array
|
|
331
330
|
}
|
|
332
331
|
|
|
333
|
-
export declare
|
|
332
|
+
export declare function encodeMultiRemoteAttachment(multiRemoteAttachment: MultiRemoteAttachment): Uint8Array
|
|
334
333
|
|
|
335
|
-
export declare
|
|
334
|
+
export declare function encodeReaction(reaction: Reaction): Uint8Array
|
|
336
335
|
|
|
337
|
-
export declare
|
|
336
|
+
export declare function generateInboxId(accountIdent: Identifier, nonce?: bigint | undefined | null): string
|
|
338
337
|
|
|
339
|
-
export declare
|
|
338
|
+
export declare function getInboxIdForIdentifier(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, identifier: Identifier): Promise<string | null>
|
|
340
339
|
|
|
341
340
|
export declare const enum GroupMembershipState {
|
|
342
341
|
Allowed = 0,
|
|
@@ -402,7 +401,7 @@ export interface InboxState {
|
|
|
402
401
|
identifiers: Array<Identifier>
|
|
403
402
|
}
|
|
404
403
|
|
|
405
|
-
export declare
|
|
404
|
+
export declare function inboxStateFromInboxIds(v3Host: string, gatewayHost: string | undefined | null, inboxIds: Array<string>): Promise<Array<InboxState>>
|
|
406
405
|
|
|
407
406
|
export interface Installation {
|
|
408
407
|
bytes: Uint8Array
|
|
@@ -410,9 +409,9 @@ export interface Installation {
|
|
|
410
409
|
id: string
|
|
411
410
|
}
|
|
412
411
|
|
|
413
|
-
export declare
|
|
412
|
+
export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
|
|
414
413
|
|
|
415
|
-
export declare
|
|
414
|
+
export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
|
|
416
415
|
|
|
417
416
|
export interface KeyPackageStatus {
|
|
418
417
|
lifetime?: Lifetime
|
|
@@ -618,13 +617,13 @@ export interface RemoteAttachmentInfoPayload {
|
|
|
618
617
|
filename?: string
|
|
619
618
|
}
|
|
620
619
|
|
|
621
|
-
export declare
|
|
620
|
+
export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
|
|
622
621
|
|
|
623
622
|
export interface SendMessageOpts {
|
|
624
623
|
shouldPush: boolean
|
|
625
624
|
}
|
|
626
625
|
|
|
627
|
-
export declare
|
|
626
|
+
export declare function serializeEncodedContent(content: EncodedContent): Uint8Array
|
|
628
627
|
|
|
629
628
|
export declare const enum SortDirection {
|
|
630
629
|
Ascending = 0,
|
|
@@ -656,7 +655,11 @@ export interface TransactionReference {
|
|
|
656
655
|
metadata?: TransactionMetadata
|
|
657
656
|
}
|
|
658
657
|
|
|
659
|
-
export
|
|
658
|
+
export type UserPreferenceUpdate =
|
|
659
|
+
| { type: 'ConsentUpdate', consent: Consent }
|
|
660
|
+
| { type: 'HmacKeyUpdate', key: Uint8Array }
|
|
661
|
+
|
|
662
|
+
export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
|
|
660
663
|
|
|
661
664
|
export interface WalletCall {
|
|
662
665
|
to?: string
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,11 @@ const isMuslFromFilesystem = () => {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const isMuslFromReport = () => {
|
|
39
|
-
|
|
39
|
+
let report = null
|
|
40
|
+
if (typeof process.report?.getReport === 'function') {
|
|
41
|
+
process.report.excludeNetwork = true
|
|
42
|
+
report = process.report.getReport()
|
|
43
|
+
}
|
|
40
44
|
if (!report) {
|
|
41
45
|
return null
|
|
42
46
|
}
|
|
@@ -61,7 +65,13 @@ const isMuslFromChildProcess = () => {
|
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
function requireNative() {
|
|
64
|
-
if (process.
|
|
68
|
+
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
|
|
69
|
+
try {
|
|
70
|
+
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
|
71
|
+
} catch (err) {
|
|
72
|
+
loadErrors.push(err)
|
|
73
|
+
}
|
|
74
|
+
} else if (process.platform === 'android') {
|
|
65
75
|
if (process.arch === 'arm64') {
|
|
66
76
|
try {
|
|
67
77
|
return require('./bindings_node.android-arm64.node')
|
|
@@ -69,11 +79,15 @@ function requireNative() {
|
|
|
69
79
|
loadErrors.push(e)
|
|
70
80
|
}
|
|
71
81
|
try {
|
|
72
|
-
|
|
82
|
+
const binding = require('@xmtp/node-bindings-android-arm64')
|
|
83
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-android-arm64/package.json').version
|
|
84
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
85
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
86
|
+
}
|
|
87
|
+
return binding
|
|
73
88
|
} catch (e) {
|
|
74
89
|
loadErrors.push(e)
|
|
75
90
|
}
|
|
76
|
-
|
|
77
91
|
} else if (process.arch === 'arm') {
|
|
78
92
|
try {
|
|
79
93
|
return require('./bindings_node.android-arm-eabi.node')
|
|
@@ -81,27 +95,53 @@ function requireNative() {
|
|
|
81
95
|
loadErrors.push(e)
|
|
82
96
|
}
|
|
83
97
|
try {
|
|
84
|
-
|
|
98
|
+
const binding = require('@xmtp/node-bindings-android-arm-eabi')
|
|
99
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-android-arm-eabi/package.json').version
|
|
100
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
|
+
}
|
|
103
|
+
return binding
|
|
85
104
|
} catch (e) {
|
|
86
105
|
loadErrors.push(e)
|
|
87
106
|
}
|
|
88
|
-
|
|
89
107
|
} else {
|
|
90
108
|
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`))
|
|
91
109
|
}
|
|
92
110
|
} else if (process.platform === 'win32') {
|
|
93
111
|
if (process.arch === 'x64') {
|
|
112
|
+
if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
|
|
113
|
+
try {
|
|
114
|
+
return require('./bindings_node.win32-x64-gnu.node')
|
|
115
|
+
} catch (e) {
|
|
116
|
+
loadErrors.push(e)
|
|
117
|
+
}
|
|
94
118
|
try {
|
|
119
|
+
const binding = require('@xmtp/node-bindings-win32-x64-gnu')
|
|
120
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-win32-x64-gnu/package.json').version
|
|
121
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
122
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
123
|
+
}
|
|
124
|
+
return binding
|
|
125
|
+
} catch (e) {
|
|
126
|
+
loadErrors.push(e)
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
try {
|
|
95
130
|
return require('./bindings_node.win32-x64-msvc.node')
|
|
96
131
|
} catch (e) {
|
|
97
132
|
loadErrors.push(e)
|
|
98
133
|
}
|
|
99
134
|
try {
|
|
100
|
-
|
|
135
|
+
const binding = require('@xmtp/node-bindings-win32-x64-msvc')
|
|
136
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-win32-x64-msvc/package.json').version
|
|
137
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
139
|
+
}
|
|
140
|
+
return binding
|
|
101
141
|
} catch (e) {
|
|
102
142
|
loadErrors.push(e)
|
|
103
143
|
}
|
|
104
|
-
|
|
144
|
+
}
|
|
105
145
|
} else if (process.arch === 'ia32') {
|
|
106
146
|
try {
|
|
107
147
|
return require('./bindings_node.win32-ia32-msvc.node')
|
|
@@ -109,11 +149,15 @@ function requireNative() {
|
|
|
109
149
|
loadErrors.push(e)
|
|
110
150
|
}
|
|
111
151
|
try {
|
|
112
|
-
|
|
152
|
+
const binding = require('@xmtp/node-bindings-win32-ia32-msvc')
|
|
153
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-win32-ia32-msvc/package.json').version
|
|
154
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
155
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
156
|
+
}
|
|
157
|
+
return binding
|
|
113
158
|
} catch (e) {
|
|
114
159
|
loadErrors.push(e)
|
|
115
160
|
}
|
|
116
|
-
|
|
117
161
|
} else if (process.arch === 'arm64') {
|
|
118
162
|
try {
|
|
119
163
|
return require('./bindings_node.win32-arm64-msvc.node')
|
|
@@ -121,26 +165,34 @@ function requireNative() {
|
|
|
121
165
|
loadErrors.push(e)
|
|
122
166
|
}
|
|
123
167
|
try {
|
|
124
|
-
|
|
168
|
+
const binding = require('@xmtp/node-bindings-win32-arm64-msvc')
|
|
169
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-win32-arm64-msvc/package.json').version
|
|
170
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
|
+
}
|
|
173
|
+
return binding
|
|
125
174
|
} catch (e) {
|
|
126
175
|
loadErrors.push(e)
|
|
127
176
|
}
|
|
128
|
-
|
|
129
177
|
} else {
|
|
130
178
|
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`))
|
|
131
179
|
}
|
|
132
180
|
} else if (process.platform === 'darwin') {
|
|
133
181
|
try {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
182
|
+
return require('./bindings_node.darwin-universal.node')
|
|
183
|
+
} catch (e) {
|
|
184
|
+
loadErrors.push(e)
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
const binding = require('@xmtp/node-bindings-darwin-universal')
|
|
188
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-darwin-universal/package.json').version
|
|
189
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
190
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
191
|
+
}
|
|
192
|
+
return binding
|
|
193
|
+
} catch (e) {
|
|
194
|
+
loadErrors.push(e)
|
|
195
|
+
}
|
|
144
196
|
if (process.arch === 'x64') {
|
|
145
197
|
try {
|
|
146
198
|
return require('./bindings_node.darwin-x64.node')
|
|
@@ -148,11 +200,15 @@ function requireNative() {
|
|
|
148
200
|
loadErrors.push(e)
|
|
149
201
|
}
|
|
150
202
|
try {
|
|
151
|
-
|
|
203
|
+
const binding = require('@xmtp/node-bindings-darwin-x64')
|
|
204
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-darwin-x64/package.json').version
|
|
205
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
207
|
+
}
|
|
208
|
+
return binding
|
|
152
209
|
} catch (e) {
|
|
153
210
|
loadErrors.push(e)
|
|
154
211
|
}
|
|
155
|
-
|
|
156
212
|
} else if (process.arch === 'arm64') {
|
|
157
213
|
try {
|
|
158
214
|
return require('./bindings_node.darwin-arm64.node')
|
|
@@ -160,11 +216,15 @@ function requireNative() {
|
|
|
160
216
|
loadErrors.push(e)
|
|
161
217
|
}
|
|
162
218
|
try {
|
|
163
|
-
|
|
219
|
+
const binding = require('@xmtp/node-bindings-darwin-arm64')
|
|
220
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-darwin-arm64/package.json').version
|
|
221
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
223
|
+
}
|
|
224
|
+
return binding
|
|
164
225
|
} catch (e) {
|
|
165
226
|
loadErrors.push(e)
|
|
166
227
|
}
|
|
167
|
-
|
|
168
228
|
} else {
|
|
169
229
|
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))
|
|
170
230
|
}
|
|
@@ -176,11 +236,15 @@ function requireNative() {
|
|
|
176
236
|
loadErrors.push(e)
|
|
177
237
|
}
|
|
178
238
|
try {
|
|
179
|
-
|
|
239
|
+
const binding = require('@xmtp/node-bindings-freebsd-x64')
|
|
240
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-freebsd-x64/package.json').version
|
|
241
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
242
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
243
|
+
}
|
|
244
|
+
return binding
|
|
180
245
|
} catch (e) {
|
|
181
246
|
loadErrors.push(e)
|
|
182
247
|
}
|
|
183
|
-
|
|
184
248
|
} else if (process.arch === 'arm64') {
|
|
185
249
|
try {
|
|
186
250
|
return require('./bindings_node.freebsd-arm64.node')
|
|
@@ -188,11 +252,15 @@ function requireNative() {
|
|
|
188
252
|
loadErrors.push(e)
|
|
189
253
|
}
|
|
190
254
|
try {
|
|
191
|
-
|
|
255
|
+
const binding = require('@xmtp/node-bindings-freebsd-arm64')
|
|
256
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-freebsd-arm64/package.json').version
|
|
257
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
259
|
+
}
|
|
260
|
+
return binding
|
|
192
261
|
} catch (e) {
|
|
193
262
|
loadErrors.push(e)
|
|
194
263
|
}
|
|
195
|
-
|
|
196
264
|
} else {
|
|
197
265
|
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`))
|
|
198
266
|
}
|
|
@@ -200,133 +268,259 @@ function requireNative() {
|
|
|
200
268
|
if (process.arch === 'x64') {
|
|
201
269
|
if (isMusl()) {
|
|
202
270
|
try {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
271
|
+
return require('./bindings_node.linux-x64-musl.node')
|
|
272
|
+
} catch (e) {
|
|
273
|
+
loadErrors.push(e)
|
|
274
|
+
}
|
|
275
|
+
try {
|
|
276
|
+
const binding = require('@xmtp/node-bindings-linux-x64-musl')
|
|
277
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-x64-musl/package.json').version
|
|
278
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
279
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
280
|
+
}
|
|
281
|
+
return binding
|
|
282
|
+
} catch (e) {
|
|
283
|
+
loadErrors.push(e)
|
|
284
|
+
}
|
|
213
285
|
} else {
|
|
214
286
|
try {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
287
|
+
return require('./bindings_node.linux-x64-gnu.node')
|
|
288
|
+
} catch (e) {
|
|
289
|
+
loadErrors.push(e)
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
const binding = require('@xmtp/node-bindings-linux-x64-gnu')
|
|
293
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-x64-gnu/package.json').version
|
|
294
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
295
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
296
|
+
}
|
|
297
|
+
return binding
|
|
298
|
+
} catch (e) {
|
|
299
|
+
loadErrors.push(e)
|
|
300
|
+
}
|
|
225
301
|
}
|
|
226
302
|
} else if (process.arch === 'arm64') {
|
|
227
303
|
if (isMusl()) {
|
|
228
304
|
try {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
305
|
+
return require('./bindings_node.linux-arm64-musl.node')
|
|
306
|
+
} catch (e) {
|
|
307
|
+
loadErrors.push(e)
|
|
308
|
+
}
|
|
309
|
+
try {
|
|
310
|
+
const binding = require('@xmtp/node-bindings-linux-arm64-musl')
|
|
311
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-arm64-musl/package.json').version
|
|
312
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
313
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
314
|
+
}
|
|
315
|
+
return binding
|
|
316
|
+
} catch (e) {
|
|
317
|
+
loadErrors.push(e)
|
|
318
|
+
}
|
|
239
319
|
} else {
|
|
240
320
|
try {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
321
|
+
return require('./bindings_node.linux-arm64-gnu.node')
|
|
322
|
+
} catch (e) {
|
|
323
|
+
loadErrors.push(e)
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
const binding = require('@xmtp/node-bindings-linux-arm64-gnu')
|
|
327
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-arm64-gnu/package.json').version
|
|
328
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
329
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
330
|
+
}
|
|
331
|
+
return binding
|
|
332
|
+
} catch (e) {
|
|
333
|
+
loadErrors.push(e)
|
|
334
|
+
}
|
|
251
335
|
}
|
|
252
336
|
} else if (process.arch === 'arm') {
|
|
253
337
|
if (isMusl()) {
|
|
254
338
|
try {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
339
|
+
return require('./bindings_node.linux-arm-musleabihf.node')
|
|
340
|
+
} catch (e) {
|
|
341
|
+
loadErrors.push(e)
|
|
342
|
+
}
|
|
343
|
+
try {
|
|
344
|
+
const binding = require('@xmtp/node-bindings-linux-arm-musleabihf')
|
|
345
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-arm-musleabihf/package.json').version
|
|
346
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
347
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
348
|
+
}
|
|
349
|
+
return binding
|
|
350
|
+
} catch (e) {
|
|
351
|
+
loadErrors.push(e)
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
try {
|
|
355
|
+
return require('./bindings_node.linux-arm-gnueabihf.node')
|
|
356
|
+
} catch (e) {
|
|
357
|
+
loadErrors.push(e)
|
|
358
|
+
}
|
|
359
|
+
try {
|
|
360
|
+
const binding = require('@xmtp/node-bindings-linux-arm-gnueabihf')
|
|
361
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-arm-gnueabihf/package.json').version
|
|
362
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
363
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
364
|
+
}
|
|
365
|
+
return binding
|
|
366
|
+
} catch (e) {
|
|
367
|
+
loadErrors.push(e)
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
} else if (process.arch === 'loong64') {
|
|
371
|
+
if (isMusl()) {
|
|
372
|
+
try {
|
|
373
|
+
return require('./bindings_node.linux-loong64-musl.node')
|
|
374
|
+
} catch (e) {
|
|
375
|
+
loadErrors.push(e)
|
|
376
|
+
}
|
|
377
|
+
try {
|
|
378
|
+
const binding = require('@xmtp/node-bindings-linux-loong64-musl')
|
|
379
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-loong64-musl/package.json').version
|
|
380
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
381
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
382
|
+
}
|
|
383
|
+
return binding
|
|
384
|
+
} catch (e) {
|
|
385
|
+
loadErrors.push(e)
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
try {
|
|
389
|
+
return require('./bindings_node.linux-loong64-gnu.node')
|
|
390
|
+
} catch (e) {
|
|
391
|
+
loadErrors.push(e)
|
|
392
|
+
}
|
|
393
|
+
try {
|
|
394
|
+
const binding = require('@xmtp/node-bindings-linux-loong64-gnu')
|
|
395
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-loong64-gnu/package.json').version
|
|
396
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
397
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
398
|
+
}
|
|
399
|
+
return binding
|
|
400
|
+
} catch (e) {
|
|
401
|
+
loadErrors.push(e)
|
|
402
|
+
}
|
|
263
403
|
}
|
|
264
|
-
|
|
404
|
+
} else if (process.arch === 'riscv64') {
|
|
405
|
+
if (isMusl()) {
|
|
406
|
+
try {
|
|
407
|
+
return require('./bindings_node.linux-riscv64-musl.node')
|
|
408
|
+
} catch (e) {
|
|
409
|
+
loadErrors.push(e)
|
|
410
|
+
}
|
|
411
|
+
try {
|
|
412
|
+
const binding = require('@xmtp/node-bindings-linux-riscv64-musl')
|
|
413
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-riscv64-musl/package.json').version
|
|
414
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
415
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
416
|
+
}
|
|
417
|
+
return binding
|
|
418
|
+
} catch (e) {
|
|
419
|
+
loadErrors.push(e)
|
|
420
|
+
}
|
|
265
421
|
} else {
|
|
266
422
|
try {
|
|
267
|
-
|
|
423
|
+
return require('./bindings_node.linux-riscv64-gnu.node')
|
|
424
|
+
} catch (e) {
|
|
425
|
+
loadErrors.push(e)
|
|
426
|
+
}
|
|
427
|
+
try {
|
|
428
|
+
const binding = require('@xmtp/node-bindings-linux-riscv64-gnu')
|
|
429
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-riscv64-gnu/package.json').version
|
|
430
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
431
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
432
|
+
}
|
|
433
|
+
return binding
|
|
434
|
+
} catch (e) {
|
|
435
|
+
loadErrors.push(e)
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
} else if (process.arch === 'ppc64') {
|
|
439
|
+
try {
|
|
440
|
+
return require('./bindings_node.linux-ppc64-gnu.node')
|
|
268
441
|
} catch (e) {
|
|
269
442
|
loadErrors.push(e)
|
|
270
443
|
}
|
|
271
444
|
try {
|
|
272
|
-
|
|
445
|
+
const binding = require('@xmtp/node-bindings-linux-ppc64-gnu')
|
|
446
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-ppc64-gnu/package.json').version
|
|
447
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
448
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
449
|
+
}
|
|
450
|
+
return binding
|
|
273
451
|
} catch (e) {
|
|
274
452
|
loadErrors.push(e)
|
|
275
453
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (isMusl()) {
|
|
280
|
-
try {
|
|
281
|
-
return require('./bindings_node.linux-riscv64-musl.node')
|
|
454
|
+
} else if (process.arch === 's390x') {
|
|
455
|
+
try {
|
|
456
|
+
return require('./bindings_node.linux-s390x-gnu.node')
|
|
282
457
|
} catch (e) {
|
|
283
458
|
loadErrors.push(e)
|
|
284
459
|
}
|
|
285
460
|
try {
|
|
286
|
-
|
|
461
|
+
const binding = require('@xmtp/node-bindings-linux-s390x-gnu')
|
|
462
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-linux-s390x-gnu/package.json').version
|
|
463
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
464
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
465
|
+
}
|
|
466
|
+
return binding
|
|
287
467
|
} catch (e) {
|
|
288
468
|
loadErrors.push(e)
|
|
289
469
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
470
|
+
} else {
|
|
471
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`))
|
|
472
|
+
}
|
|
473
|
+
} else if (process.platform === 'openharmony') {
|
|
474
|
+
if (process.arch === 'arm64') {
|
|
475
|
+
try {
|
|
476
|
+
return require('./bindings_node.openharmony-arm64.node')
|
|
294
477
|
} catch (e) {
|
|
295
478
|
loadErrors.push(e)
|
|
296
479
|
}
|
|
297
480
|
try {
|
|
298
|
-
|
|
481
|
+
const binding = require('@xmtp/node-bindings-openharmony-arm64')
|
|
482
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-openharmony-arm64/package.json').version
|
|
483
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
484
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
485
|
+
}
|
|
486
|
+
return binding
|
|
299
487
|
} catch (e) {
|
|
300
488
|
loadErrors.push(e)
|
|
301
489
|
}
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
} else if (process.arch === 'ppc64') {
|
|
490
|
+
} else if (process.arch === 'x64') {
|
|
305
491
|
try {
|
|
306
|
-
return require('./bindings_node.
|
|
492
|
+
return require('./bindings_node.openharmony-x64.node')
|
|
307
493
|
} catch (e) {
|
|
308
494
|
loadErrors.push(e)
|
|
309
495
|
}
|
|
310
496
|
try {
|
|
311
|
-
|
|
497
|
+
const binding = require('@xmtp/node-bindings-openharmony-x64')
|
|
498
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-openharmony-x64/package.json').version
|
|
499
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
500
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
501
|
+
}
|
|
502
|
+
return binding
|
|
312
503
|
} catch (e) {
|
|
313
504
|
loadErrors.push(e)
|
|
314
505
|
}
|
|
315
|
-
|
|
316
|
-
} else if (process.arch === 's390x') {
|
|
506
|
+
} else if (process.arch === 'arm') {
|
|
317
507
|
try {
|
|
318
|
-
return require('./bindings_node.
|
|
508
|
+
return require('./bindings_node.openharmony-arm.node')
|
|
319
509
|
} catch (e) {
|
|
320
510
|
loadErrors.push(e)
|
|
321
511
|
}
|
|
322
512
|
try {
|
|
323
|
-
|
|
513
|
+
const binding = require('@xmtp/node-bindings-openharmony-arm')
|
|
514
|
+
const bindingPackageVersion = require('@xmtp/node-bindings-openharmony-arm/package.json').version
|
|
515
|
+
if (bindingPackageVersion !== '1.7.0-dev' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 1.7.0-dev but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
517
|
+
}
|
|
518
|
+
return binding
|
|
324
519
|
} catch (e) {
|
|
325
520
|
loadErrors.push(e)
|
|
326
521
|
}
|
|
327
|
-
|
|
328
522
|
} else {
|
|
329
|
-
loadErrors.push(new Error(`Unsupported architecture on
|
|
523
|
+
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`))
|
|
330
524
|
}
|
|
331
525
|
} else {
|
|
332
526
|
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))
|
|
@@ -336,31 +530,47 @@ function requireNative() {
|
|
|
336
530
|
nativeBinding = requireNative()
|
|
337
531
|
|
|
338
532
|
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
533
|
+
let wasiBinding = null
|
|
534
|
+
let wasiBindingError = null
|
|
339
535
|
try {
|
|
340
|
-
|
|
536
|
+
wasiBinding = require('./bindings_node.wasi.cjs')
|
|
537
|
+
nativeBinding = wasiBinding
|
|
341
538
|
} catch (err) {
|
|
342
539
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
343
|
-
|
|
540
|
+
wasiBindingError = err
|
|
344
541
|
}
|
|
345
542
|
}
|
|
346
543
|
if (!nativeBinding) {
|
|
347
544
|
try {
|
|
348
|
-
|
|
545
|
+
wasiBinding = require('@xmtp/node-bindings-wasm32-wasi')
|
|
546
|
+
nativeBinding = wasiBinding
|
|
349
547
|
} catch (err) {
|
|
350
548
|
if (process.env.NAPI_RS_FORCE_WASI) {
|
|
549
|
+
wasiBindingError.cause = err
|
|
351
550
|
loadErrors.push(err)
|
|
352
551
|
}
|
|
353
552
|
}
|
|
354
553
|
}
|
|
554
|
+
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
|
|
555
|
+
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
|
|
556
|
+
error.cause = wasiBindingError
|
|
557
|
+
throw error
|
|
558
|
+
}
|
|
355
559
|
}
|
|
356
560
|
|
|
357
561
|
if (!nativeBinding) {
|
|
358
562
|
if (loadErrors.length > 0) {
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
563
|
+
throw new Error(
|
|
564
|
+
`Cannot find native binding. ` +
|
|
565
|
+
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
566
|
+
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
567
|
+
{
|
|
568
|
+
cause: loadErrors.reduce((err, cur) => {
|
|
569
|
+
cur.cause = err
|
|
570
|
+
return cur
|
|
571
|
+
}),
|
|
572
|
+
},
|
|
573
|
+
)
|
|
364
574
|
}
|
|
365
575
|
throw new Error(`Failed to load native binding`)
|
|
366
576
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-bindings",
|
|
3
|
-
"version": "1.7.0-dev.
|
|
3
|
+
"version": "1.7.0-dev.9bc470b",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://git@github.com/xmtp/libxmtp.git",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"default": "./dist/index.js"
|
|
15
|
-
}
|
|
16
|
-
"./version.json": "./dist/version.json"
|
|
15
|
+
}
|
|
17
16
|
},
|
|
18
17
|
"main": "dist/index.js",
|
|
19
18
|
"types": "dist/index.d.ts",
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
],
|
|
23
22
|
"scripts": {
|
|
24
23
|
"artifacts": "napi artifacts",
|
|
25
|
-
"build": "yarn build:clean && yarn build:release && yarn build:finish
|
|
24
|
+
"build": "yarn build:clean && yarn build:release && yarn build:finish",
|
|
26
25
|
"build:clean": "rm -rf dist",
|
|
27
26
|
"build:debug": "napi build --platform --esm",
|
|
28
27
|
"build:finish": "mkdir dist && mv index.js dist && mv index.d.ts dist && mv *.node dist",
|
|
@@ -31,7 +30,6 @@
|
|
|
31
30
|
"clean": "yarn build:clean && yarn test:clean",
|
|
32
31
|
"format": "prettier -w .",
|
|
33
32
|
"format:check": "prettier -c .",
|
|
34
|
-
"generate:version": "tsx scripts/version.ts",
|
|
35
33
|
"lint": "yarn lint:clippy && yarn lint:fmt",
|
|
36
34
|
"lint:clippy": "cargo clippy --locked --all-features --all-targets --no-deps -- -D warnings",
|
|
37
35
|
"lint:fmt": "cargo fmt --check",
|
|
@@ -39,27 +37,26 @@
|
|
|
39
37
|
"test:clean": "rm -rf test/*.db3*"
|
|
40
38
|
},
|
|
41
39
|
"devDependencies": {
|
|
42
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.
|
|
43
|
-
"@napi-rs/cli": "^3.
|
|
44
|
-
"@types/node": "^24.1
|
|
45
|
-
"@types/uuid": "^
|
|
40
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
41
|
+
"@napi-rs/cli": "^3.4.1",
|
|
42
|
+
"@types/node": "^24.10.1",
|
|
43
|
+
"@types/uuid": "^11.0.0",
|
|
46
44
|
"@xmtp/content-type-group-updated": "^2.0.2",
|
|
47
45
|
"@xmtp/content-type-text": "^2.0.2",
|
|
48
46
|
"fast-glob": "^3.3.3",
|
|
49
|
-
"prettier": "^3.6.
|
|
50
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
51
|
-
"tsx": "^4.20.
|
|
52
|
-
"typescript": "^5.9.
|
|
53
|
-
"uuid": "^
|
|
54
|
-
"viem": "^2.
|
|
55
|
-
"vite": "^7.
|
|
47
|
+
"prettier": "^3.6.2",
|
|
48
|
+
"prettier-plugin-packagejson": "^2.5.19",
|
|
49
|
+
"tsx": "^4.20.6",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"uuid": "^13.0.0",
|
|
52
|
+
"viem": "^2.39.0",
|
|
53
|
+
"vite": "^7.2.2",
|
|
56
54
|
"vite-tsconfig-paths": "^5.1.4",
|
|
57
|
-
"vitest": "^
|
|
58
|
-
"zx": "^8.7.1"
|
|
55
|
+
"vitest": "^4.0.8"
|
|
59
56
|
},
|
|
60
|
-
"packageManager": "yarn@4.
|
|
57
|
+
"packageManager": "yarn@4.11.0",
|
|
61
58
|
"engines": {
|
|
62
|
-
"node": ">=
|
|
59
|
+
"node": ">=22"
|
|
63
60
|
},
|
|
64
61
|
"publishConfig": {
|
|
65
62
|
"access": "public",
|