@xmtp/node-bindings 0.0.35 → 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 +25 -19
- package/dist/index.js +2 -1
- package/dist/version.json +5 -0
- package/package.json +13 -9
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -63,8 +63,6 @@ export declare class Conversation {
|
|
|
63
63
|
groupImageUrlSquare(): string
|
|
64
64
|
updateGroupDescription(groupDescription: string): Promise<void>
|
|
65
65
|
groupDescription(): string
|
|
66
|
-
updateGroupPinnedFrameUrl(pinnedFrameUrl: string): Promise<void>
|
|
67
|
-
groupPinnedFrameUrl(): string
|
|
68
66
|
stream(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
69
67
|
createdAtNs(): number
|
|
70
68
|
isActive(): boolean
|
|
@@ -74,20 +72,31 @@ export declare class Conversation {
|
|
|
74
72
|
updateConsentState(state: ConsentState): void
|
|
75
73
|
dmPeerInboxId(): string
|
|
76
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
|
|
77
84
|
}
|
|
78
85
|
|
|
79
86
|
export declare class Conversations {
|
|
80
87
|
createGroup(accountAddresses: Array<string>, options?: CreateGroupOptions | undefined | null): Promise<Conversation>
|
|
81
|
-
|
|
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>
|
|
82
91
|
findGroupById(groupId: string): Conversation
|
|
83
92
|
findDmByTargetInboxId(targetInboxId: string): Conversation
|
|
84
93
|
findMessageById(messageId: string): Message
|
|
85
94
|
processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<Conversation>
|
|
86
95
|
sync(): Promise<void>
|
|
87
|
-
syncAllConversations(): Promise<bigint>
|
|
88
|
-
list(opts?: ListConversationsOptions | undefined | null): Array<
|
|
89
|
-
listGroups(opts?: ListConversationsOptions | undefined | null): Array<
|
|
90
|
-
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>
|
|
91
100
|
getHmacKeys(): Record<string, Array<HmacKey>>
|
|
92
101
|
stream(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
93
102
|
streamGroups(callback: (err: null | Error, result: Conversation | undefined) => void): StreamCloser
|
|
@@ -95,6 +104,8 @@ export declare class Conversations {
|
|
|
95
104
|
streamAllMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
96
105
|
streamAllGroupMessages(callback: (err: null | Error, result: Message | undefined) => void): StreamCloser
|
|
97
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
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
export declare class GroupMember {
|
|
@@ -172,12 +183,15 @@ export declare const enum ConversationType {
|
|
|
172
183
|
*/
|
|
173
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>
|
|
174
185
|
|
|
186
|
+
export interface CreateDmOptions {
|
|
187
|
+
messageDisappearingSettings?: MessageDisappearingSettings
|
|
188
|
+
}
|
|
189
|
+
|
|
175
190
|
export interface CreateGroupOptions {
|
|
176
191
|
permissions?: GroupPermissionsOptions
|
|
177
192
|
groupName?: string
|
|
178
193
|
groupImageUrlSquare?: string
|
|
179
194
|
groupDescription?: string
|
|
180
|
-
groupPinnedFrameUrl?: string
|
|
181
195
|
customPermissionPolicySet?: PermissionPolicySet
|
|
182
196
|
messageDisappearingSettings?: MessageDisappearingSettings
|
|
183
197
|
}
|
|
@@ -241,8 +255,10 @@ export declare export declare function isInstallationAuthorized(host: string, in
|
|
|
241
255
|
|
|
242
256
|
export interface ListConversationsOptions {
|
|
243
257
|
allowedStates?: Array<GroupMembershipState>
|
|
258
|
+
consentStates?: Array<ConsentState>
|
|
244
259
|
createdAfterNs?: number
|
|
245
260
|
createdBeforeNs?: number
|
|
261
|
+
includeDuplicateDms: boolean
|
|
246
262
|
limit?: number
|
|
247
263
|
conversationType?: ConversationType
|
|
248
264
|
}
|
|
@@ -285,14 +301,6 @@ export interface Message {
|
|
|
285
301
|
deliveryStatus: DeliveryStatus
|
|
286
302
|
}
|
|
287
303
|
|
|
288
|
-
/**
|
|
289
|
-
* Settings for disappearing messages in a conversation.
|
|
290
|
-
*
|
|
291
|
-
* # Fields
|
|
292
|
-
*
|
|
293
|
-
* * `from_ns` - The timestamp (in nanoseconds) from when messages should be tracked for deletion.
|
|
294
|
-
* * `in_ns` - The duration (in nanoseconds) after which tracked messages will be deleted.
|
|
295
|
-
*/
|
|
296
304
|
export interface MessageDisappearingSettings {
|
|
297
305
|
fromNs: number
|
|
298
306
|
inNs: number
|
|
@@ -301,8 +309,7 @@ export interface MessageDisappearingSettings {
|
|
|
301
309
|
export declare const enum MetadataField {
|
|
302
310
|
GroupName = 0,
|
|
303
311
|
Description = 1,
|
|
304
|
-
ImageUrlSquare = 2
|
|
305
|
-
PinnedFrameUrl = 3
|
|
312
|
+
ImageUrlSquare = 2
|
|
306
313
|
}
|
|
307
314
|
|
|
308
315
|
export declare const enum PermissionLevel {
|
|
@@ -328,7 +335,6 @@ export interface PermissionPolicySet {
|
|
|
328
335
|
updateGroupNamePolicy: PermissionPolicy
|
|
329
336
|
updateGroupDescriptionPolicy: PermissionPolicy
|
|
330
337
|
updateGroupImageUrlSquarePolicy: PermissionPolicy
|
|
331
|
-
updateGroupPinnedFrameUrlPolicy: PermissionPolicy
|
|
332
338
|
updateMessageDisappearingPolicy: PermissionPolicy
|
|
333
339
|
}
|
|
334
340
|
|
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*"
|
|
@@ -38,17 +40,19 @@
|
|
|
38
40
|
"devDependencies": {
|
|
39
41
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
40
42
|
"@napi-rs/cli": "^3.0.0-alpha.64",
|
|
41
|
-
"@types/node": "^22.
|
|
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": {
|