@xmtp/node-bindings 0.0.37 → 0.0.38
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 +24 -13
- package/dist/index.js +2 -1
- package/dist/version.json +5 -0
- package/package.json +12 -8
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -72,20 +72,31 @@ export declare class Conversation {
|
|
|
72
72
|
updateConsentState(state: ConsentState): void
|
|
73
73
|
dmPeerInboxId(): string
|
|
74
74
|
updatePermissionPolicy(permissionUpdateType: PermissionUpdateType, permissionPolicyOption: PermissionPolicy, metadataField?: MetadataField | undefined | null): Promise<void>
|
|
75
|
+
updateMessageDisappearingSettings(settings: MessageDisappearingSettings): Promise<void>
|
|
76
|
+
removeMessageDisappearingSettings(): Promise<void>
|
|
77
|
+
messageDisappearingSettings(): MessageDisappearingSettings | null
|
|
78
|
+
isMessageDisappearingEnabled(): boolean
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export declare class ConversationListItem {
|
|
82
|
+
get conversation(): Conversation
|
|
83
|
+
get lastMessage(): Message | null
|
|
75
84
|
}
|
|
76
85
|
|
|
77
86
|
export declare class Conversations {
|
|
78
87
|
createGroup(accountAddresses: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
|
|
79
|
-
|
|
88
|
+
createGroupByInboxId(inboxIds: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
|
|
89
|
+
createDm(accountAddress: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
|
|
90
|
+
createDmByInboxId(inboxId: string, options?: CreateDmOptions | undefined | null): Promise<Conversation>
|
|
80
91
|
findGroupById(groupId: string): Conversation
|
|
81
92
|
findDmByTargetInboxId(targetInboxId: string): Conversation
|
|
82
93
|
findMessageById(messageId: string): Message
|
|
83
94
|
processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
|
|
84
95
|
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<
|
|
96
|
+
syncAllConversations(consentStates?: Array<ConsentState> | undefined | null): Promise<bigint>
|
|
97
|
+
list(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
98
|
+
listGroups(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
99
|
+
listDms(opts?: ListConversationsOptions | undefined | null): Array<ConversationListItem>
|
|
89
100
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
90
101
|
stream(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
91
102
|
streamGroups(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
@@ -93,6 +104,8 @@ export declare class Conversations {
|
|
|
93
104
|
streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
94
105
|
streamAllGroupMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
95
106
|
streamAllDmMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
107
|
+
streamConsent(callback: (err: null | Error, result: Consent[] | undefined) => void): StreamCloser
|
|
108
|
+
streamPreferences(callback: (err: null | Error, result: any[] | undefined) => void): StreamCloser
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
export declare class GroupMember {
|
|
@@ -170,6 +183,10 @@ export declare const enum ConversationType {
|
|
|
170
183
|
*/
|
|
171
184
|
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
185
|
|
|
186
|
+
export interface CreateDmOptions {
|
|
187
|
+
messageDisappearingSettings?: MessageDisappearingSettings
|
|
188
|
+
}
|
|
189
|
+
|
|
173
190
|
export interface CreateGroupOptions {
|
|
174
191
|
permissions?: GroupPermissionsOptions
|
|
175
192
|
groupName?: string
|
|
@@ -238,8 +255,10 @@ export declare export declare function isInstallationAuthorized(host: string, in
|
|
|
238
255
|
|
|
239
256
|
export interface ListConversationsOptions {
|
|
240
257
|
allowedStates?: Array<GroupMembershipState>
|
|
258
|
+
consentStates?: Array<ConsentState>
|
|
241
259
|
createdAfterNs?: number
|
|
242
260
|
createdBeforeNs?: number
|
|
261
|
+
includeDuplicateDms: boolean
|
|
243
262
|
limit?: number
|
|
244
263
|
conversationType?: ConversationType
|
|
245
264
|
}
|
|
@@ -282,14 +301,6 @@ export interface Message {
|
|
|
282
301
|
deliveryStatus: DeliveryStatus
|
|
283
302
|
}
|
|
284
303
|
|
|
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
304
|
export interface MessageDisappearingSettings {
|
|
294
305
|
fromNs: number
|
|
295
306
|
inNs: number
|
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, ConversationType, createClient, DeliveryStatus, generateInboxId, getInboxIdForAddress, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, 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 }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmtp/node-bindings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
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",
|
|
48
|
+
"tsx": "^4.19.3",
|
|
46
49
|
"typescript": "^5.7.3",
|
|
47
50
|
"uuid": "^11.0.5",
|
|
48
|
-
"viem": "^2.
|
|
49
|
-
"vite": "^6.0
|
|
51
|
+
"viem": "^2.23.2",
|
|
52
|
+
"vite": "^6.1.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": {
|