@xmtp/node-bindings 0.0.37 → 0.0.39
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 +90 -16
- package/dist/index.js +9 -1
- package/dist/version.json +5 -0
- package/package.json +14 -10
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare class Conversation {
|
|
|
42
42
|
publishMessages(): Promise<void>
|
|
43
43
|
sync(): Promise<void>
|
|
44
44
|
findMessages(opts?: ListMessagesOptions | undefined | null): Promise<Array<Message>>
|
|
45
|
+
findMessagesWithReactions(opts?: ListMessagesOptions | undefined | null): Promise<Array<MessageWithReactions>>
|
|
45
46
|
processStreamedGroupMessage(envelopeBytes: Uint8Array): Promise<Message>
|
|
46
47
|
listMembers(): Promise<Array<GroupMember>>
|
|
47
48
|
adminList(): Array<string>
|
|
@@ -72,20 +73,32 @@ export declare class Conversation {
|
|
|
72
73
|
updateConsentState(state: ConsentState): void
|
|
73
74
|
dmPeerInboxId(): string
|
|
74
75
|
updatePermissionPolicy(permissionUpdateType: PermissionUpdateType, permissionPolicyOption: PermissionPolicy, metadataField?: MetadataField | undefined | null): Promise<void>
|
|
76
|
+
updateMessageDisappearingSettings(settings: MessageDisappearingSettings): Promise<void>
|
|
77
|
+
removeMessageDisappearingSettings(): Promise<void>
|
|
78
|
+
messageDisappearingSettings(): MessageDisappearingSettings | null
|
|
79
|
+
isMessageDisappearingEnabled(): boolean
|
|
80
|
+
getHmacKeys(): Array<HmacKey>
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare class ConversationListItem {
|
|
84
|
+
get conversation(): Conversation
|
|
85
|
+
get lastMessage(): Message | null
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
export declare class Conversations {
|
|
78
89
|
createGroup(accountAddresses: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
|
|
79
|
-
|
|
90
|
+
createGroupByInboxId(inboxIds: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
|
|
91
|
+
createDm(accountAddress: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
|
|
92
|
+
createDmByInboxId(inboxId: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
|
|
80
93
|
findGroupById(groupId: string): Conversation
|
|
81
94
|
findDmByTargetInboxId(targetInboxId: string): Conversation
|
|
82
95
|
findMessageById(messageId: string): Message
|
|
83
96
|
processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
|
|
84
97
|
sync(): Promise<void>
|
|
85
|
-
syncAllConversations(): Promise<bigint>
|
|
86
|
-
list(opts?: ListConversationsOptions | undefined | null): Array<
|
|
87
|
-
listGroups(opts?: ListConversationsOptions | undefined | null): Array<
|
|
88
|
-
listDms(opts?: ListConversationsOptions | undefined | null): Array<
|
|
98
|
+
syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
|
|
99
|
+
list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
100
|
+
listGroups(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
101
|
+
listDms(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
89
102
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
90
103
|
stream(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
91
104
|
streamGroups(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
@@ -93,6 +106,8 @@ export declare class Conversations {
|
|
|
93
106
|
streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
94
107
|
streamAllGroupMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
95
108
|
streamAllDmMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
109
|
+
streamConsent(callback: (err: null | Error, result: Consent[] | undefined) => void): StreamCloser
|
|
110
|
+
streamPreferences(callback: (err: null | Error, result: any[] | undefined) => void): StreamCloser
|
|
96
111
|
}
|
|
97
112
|
|
|
98
113
|
export declare class GroupMember {
|
|
@@ -148,6 +163,19 @@ export declare const enum ConsentState {
|
|
|
148
163
|
Denied = 2
|
|
149
164
|
}
|
|
150
165
|
|
|
166
|
+
export declare const enum ContentType {
|
|
167
|
+
Unknown = 0,
|
|
168
|
+
Text = 1,
|
|
169
|
+
GroupMembershipChange = 2,
|
|
170
|
+
GroupUpdated = 3,
|
|
171
|
+
Reaction = 4,
|
|
172
|
+
ReadReceipt = 5,
|
|
173
|
+
Reply = 6,
|
|
174
|
+
Attachment = 7,
|
|
175
|
+
RemoteAttachment = 8,
|
|
176
|
+
TransactionReference = 9
|
|
177
|
+
}
|
|
178
|
+
|
|
151
179
|
export interface ContentTypeId {
|
|
152
180
|
authorityId: string
|
|
153
181
|
typeId: string
|
|
@@ -170,6 +198,10 @@ export declare const enum ConversationType {
|
|
|
170
198
|
*/
|
|
171
199
|
export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountAddress: string, encryptionKey?: Uint8Array | undefined | null, historySyncUrl?: string | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
|
|
172
200
|
|
|
201
|
+
export interface CreateDmOptions {
|
|
202
|
+
messageDisappearingSettings?: MessageDisappearingSettings
|
|
203
|
+
}
|
|
204
|
+
|
|
173
205
|
export interface CreateGroupOptions {
|
|
174
206
|
permissions?: GroupPermissionsOptions
|
|
175
207
|
groupName?: string
|
|
@@ -179,6 +211,10 @@ export interface CreateGroupOptions {
|
|
|
179
211
|
messageDisappearingSettings?: MessageDisappearingSettings
|
|
180
212
|
}
|
|
181
213
|
|
|
214
|
+
export declare export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
|
|
215
|
+
|
|
216
|
+
export declare export declare function decodeReaction(bytes: Uint8Array): Reaction
|
|
217
|
+
|
|
182
218
|
export declare const enum DeliveryStatus {
|
|
183
219
|
Unpublished = 0,
|
|
184
220
|
Published = 1,
|
|
@@ -193,6 +229,10 @@ export interface EncodedContent {
|
|
|
193
229
|
content: Uint8Array
|
|
194
230
|
}
|
|
195
231
|
|
|
232
|
+
export declare export declare function encodeMultiRemoteAttachment(multiRemoteAttachment: MultiRemoteAttachment): Uint8Array
|
|
233
|
+
|
|
234
|
+
export declare export declare function encodeReaction(reaction: Reaction): Uint8Array
|
|
235
|
+
|
|
196
236
|
export declare export declare function generateInboxId(accountAddress: string): string
|
|
197
237
|
|
|
198
238
|
export declare export declare function getInboxIdForAddress(host: string, isSecure: boolean, accountAddress: string): Promise<string | null>
|
|
@@ -215,7 +255,7 @@ export declare const enum GroupPermissionsOptions {
|
|
|
215
255
|
}
|
|
216
256
|
|
|
217
257
|
export interface HmacKey {
|
|
218
|
-
key:
|
|
258
|
+
key: Uint8Array
|
|
219
259
|
epoch: bigint
|
|
220
260
|
}
|
|
221
261
|
|
|
@@ -237,11 +277,11 @@ export declare export declare function isAddressAuthorized(host: string, inboxId
|
|
|
237
277
|
export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
|
|
238
278
|
|
|
239
279
|
export interface ListConversationsOptions {
|
|
240
|
-
|
|
280
|
+
consentStates?: Array<ConsentState>
|
|
241
281
|
createdAfterNs?: number
|
|
242
282
|
createdBeforeNs?: number
|
|
283
|
+
includeDuplicateDms: boolean
|
|
243
284
|
limit?: number
|
|
244
|
-
conversationType?: ConversationType
|
|
245
285
|
}
|
|
246
286
|
|
|
247
287
|
export interface ListMessagesOptions {
|
|
@@ -250,6 +290,7 @@ export interface ListMessagesOptions {
|
|
|
250
290
|
limit?: number
|
|
251
291
|
deliveryStatus?: DeliveryStatus
|
|
252
292
|
direction?: SortDirection
|
|
293
|
+
contentTypes?: Array<ContentType>
|
|
253
294
|
}
|
|
254
295
|
|
|
255
296
|
export declare const enum LogLevel {
|
|
@@ -282,25 +323,26 @@ export interface Message {
|
|
|
282
323
|
deliveryStatus: DeliveryStatus
|
|
283
324
|
}
|
|
284
325
|
|
|
285
|
-
/**
|
|
286
|
-
* Settings for disappearing messages in a conversation.
|
|
287
|
-
*
|
|
288
|
-
* # Fields
|
|
289
|
-
*
|
|
290
|
-
* * `from_ns` - The timestamp (in nanoseconds) from when messages should be tracked for deletion.
|
|
291
|
-
* * `in_ns` - The duration (in nanoseconds) after which tracked messages will be deleted.
|
|
292
|
-
*/
|
|
293
326
|
export interface MessageDisappearingSettings {
|
|
294
327
|
fromNs: number
|
|
295
328
|
inNs: number
|
|
296
329
|
}
|
|
297
330
|
|
|
331
|
+
export interface MessageWithReactions {
|
|
332
|
+
message: Message
|
|
333
|
+
reactions: Array<Message>
|
|
334
|
+
}
|
|
335
|
+
|
|
298
336
|
export declare const enum MetadataField {
|
|
299
337
|
GroupName = 0,
|
|
300
338
|
Description = 1,
|
|
301
339
|
ImageUrlSquare = 2
|
|
302
340
|
}
|
|
303
341
|
|
|
342
|
+
export interface MultiRemoteAttachment {
|
|
343
|
+
attachments: Array<RemoteAttachmentInfo>
|
|
344
|
+
}
|
|
345
|
+
|
|
304
346
|
export declare const enum PermissionLevel {
|
|
305
347
|
Member = 0,
|
|
306
348
|
Admin = 1,
|
|
@@ -335,6 +377,38 @@ export declare const enum PermissionUpdateType {
|
|
|
335
377
|
UpdateMetadata = 4
|
|
336
378
|
}
|
|
337
379
|
|
|
380
|
+
export interface Reaction {
|
|
381
|
+
reference: string
|
|
382
|
+
referenceInboxId: string
|
|
383
|
+
action: ReactionAction
|
|
384
|
+
content: string
|
|
385
|
+
schema: ReactionSchema
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export declare const enum ReactionAction {
|
|
389
|
+
Unknown = 0,
|
|
390
|
+
Added = 1,
|
|
391
|
+
Removed = 2
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export declare const enum ReactionSchema {
|
|
395
|
+
Unknown = 0,
|
|
396
|
+
Unicode = 1,
|
|
397
|
+
Shortcode = 2,
|
|
398
|
+
Custom = 3
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface RemoteAttachmentInfo {
|
|
402
|
+
secret: Uint8Array
|
|
403
|
+
contentDigest: string
|
|
404
|
+
nonce: Uint8Array
|
|
405
|
+
scheme: string
|
|
406
|
+
url: string
|
|
407
|
+
salt: Uint8Array
|
|
408
|
+
contentLength?: number
|
|
409
|
+
filename?: string
|
|
410
|
+
}
|
|
411
|
+
|
|
338
412
|
export declare const enum SignatureRequestType {
|
|
339
413
|
AddWallet = 0,
|
|
340
414
|
CreateInbox = 1,
|
package/dist/index.js
CHANGED
|
@@ -365,9 +365,10 @@ if (!nativeBinding) {
|
|
|
365
365
|
throw new Error(`Failed to load native binding`)
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
const { Client, Conversation, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ConversationType, createClient, DeliveryStatus, generateInboxId, getInboxIdForAddress, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, SignatureRequestType, SortDirection, verifySignedWithPublicKey } = nativeBinding
|
|
368
|
+
const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForAddress, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, verifySignedWithPublicKey } = nativeBinding
|
|
369
369
|
export { Client }
|
|
370
370
|
export { Conversation }
|
|
371
|
+
export { ConversationListItem }
|
|
371
372
|
export { Conversations }
|
|
372
373
|
export { GroupMember }
|
|
373
374
|
export { GroupMetadata }
|
|
@@ -375,9 +376,14 @@ export { GroupPermissions }
|
|
|
375
376
|
export { StreamCloser }
|
|
376
377
|
export { ConsentEntityType }
|
|
377
378
|
export { ConsentState }
|
|
379
|
+
export { ContentType }
|
|
378
380
|
export { ConversationType }
|
|
379
381
|
export { createClient }
|
|
382
|
+
export { decodeMultiRemoteAttachment }
|
|
383
|
+
export { decodeReaction }
|
|
380
384
|
export { DeliveryStatus }
|
|
385
|
+
export { encodeMultiRemoteAttachment }
|
|
386
|
+
export { encodeReaction }
|
|
381
387
|
export { generateInboxId }
|
|
382
388
|
export { getInboxIdForAddress }
|
|
383
389
|
export { GroupMembershipState }
|
|
@@ -390,6 +396,8 @@ export { MetadataField }
|
|
|
390
396
|
export { PermissionLevel }
|
|
391
397
|
export { PermissionPolicy }
|
|
392
398
|
export { PermissionUpdateType }
|
|
399
|
+
export { ReactionAction }
|
|
400
|
+
export { ReactionSchema }
|
|
393
401
|
export { SignatureRequestType }
|
|
394
402
|
export { SortDirection }
|
|
395
403
|
export { verifySignedWithPublicKey }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-bindings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.39",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://git@github.com/xmtp/libxmtp.git",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"default": "./dist/index.js"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"./version.json": "./dist/version.json"
|
|
16
17
|
},
|
|
17
18
|
"main": "dist/index.js",
|
|
18
19
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
24
|
"artifacts": "napi artifacts",
|
|
24
|
-
"build": "yarn build:clean && yarn build:release && yarn build:finish",
|
|
25
|
+
"build": "yarn build:clean && yarn build:release && yarn build:finish && yarn generate:version",
|
|
25
26
|
"build:clean": "rm -rf dist",
|
|
26
27
|
"build:debug": "napi build --platform --esm",
|
|
27
28
|
"build:finish": "mkdir dist && mv index.js dist && mv index.d.ts dist && mv *.node dist",
|
|
@@ -29,8 +30,9 @@
|
|
|
29
30
|
"clean": "yarn build:clean && yarn test:clean",
|
|
30
31
|
"format": "prettier -w .",
|
|
31
32
|
"format:check": "prettier -c .",
|
|
33
|
+
"generate:version": "tsx scripts/version.ts",
|
|
32
34
|
"lint": "yarn lint:clippy && yarn lint:fmt",
|
|
33
|
-
"lint:clippy": "cargo clippy --all-features --all-targets --no-deps -- -
|
|
35
|
+
"lint:clippy": "cargo clippy --locked --all-features --all-targets --no-deps -- -D warnings",
|
|
34
36
|
"lint:fmt": "cargo fmt --check",
|
|
35
37
|
"test": "vitest run",
|
|
36
38
|
"test:clean": "rm -rf test/*.db3*"
|
|
@@ -41,14 +43,16 @@
|
|
|
41
43
|
"@types/node": "^22.13.0",
|
|
42
44
|
"@types/uuid": "^10.0.0",
|
|
43
45
|
"fast-glob": "^3.3.3",
|
|
44
|
-
"prettier": "^3.
|
|
46
|
+
"prettier": "^3.5.0",
|
|
45
47
|
"prettier-plugin-packagejson": "^2.5.8",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
48
|
+
"tsx": "^4.19.3",
|
|
49
|
+
"typescript": "^5.8.2",
|
|
50
|
+
"uuid": "^11.1.0",
|
|
51
|
+
"viem": "^2.23.2",
|
|
52
|
+
"vite": "^6.2.0",
|
|
50
53
|
"vite-tsconfig-paths": "^5.1.4",
|
|
51
|
-
"vitest": "^3.0.4"
|
|
54
|
+
"vitest": "^3.0.4",
|
|
55
|
+
"zx": "^8.3.2"
|
|
52
56
|
},
|
|
53
57
|
"packageManager": "yarn@4.6.0",
|
|
54
58
|
"engines": {
|