@xmtp/node-bindings 1.2.0-dev.3d6d1ef → 1.2.0-dev.7eef2ea

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.
Binary file
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export declare class Client {
14
14
  sendConsentSyncRequest(): Promise<void>
15
15
  findInboxIdByIdentifier(identifier: Identifier): Promise<string | null>
16
16
  addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<InboxState>>
17
+ syncPreferences(): Promise<number>
17
18
  setConsentStates(records: Array<Consent>): Promise<void>
18
19
  getConsentState(entityType: ConsentEntityType, entity: string): Promise<ConsentState>
19
20
  /**
@@ -24,6 +25,12 @@ export declare class Client {
24
25
  */
25
26
  inboxState(refreshFromNetwork: boolean): Promise<InboxState>
26
27
  getLatestInboxState(inboxId: string): Promise<InboxState>
28
+ /**
29
+ * Get key package statuses for a list of installation IDs.
30
+ *
31
+ * Returns a JavaScript Object mapping installation ID strings to KeyPackageStatus objects.
32
+ */
33
+ getKeyPackageStatusesForInstallationIds(installationIds: Array<string>): Promise<Record<string, KeyPackageStatus>>
27
34
  createInboxSignatureText(): Promise<string | null>
28
35
  addIdentifierSignatureText(newIdentifier: Identifier): Promise<string>
29
36
  revokeIdentifierSignatureText(identifier: Identifier): Promise<string>
@@ -82,6 +89,7 @@ export declare class Conversation {
82
89
  messageDisappearingSettings(): MessageDisappearingSettings | null
83
90
  isMessageDisappearingEnabled(): boolean
84
91
  getHmacKeys(): Array<HmacKey>
92
+ debugInfo(): Promise<ConversationDebugInfo>
85
93
  }
86
94
 
87
95
  export declare class ConversationListItem {
@@ -186,6 +194,12 @@ export interface ContentTypeId {
186
194
  versionMinor: number
187
195
  }
188
196
 
197
+ export interface ConversationDebugInfo {
198
+ epoch: bigint
199
+ maybeForked: boolean
200
+ forkDetails: string
201
+ }
202
+
189
203
  export declare const enum ConversationType {
190
204
  Dm = 0,
191
205
  Group = 1,
@@ -193,13 +207,13 @@ export declare const enum ConversationType {
193
207
  }
194
208
 
195
209
  /**
196
- * Create a client
210
+ * Create a client.
197
211
  *
198
212
  * Optionally specify a filter for the log level as a string.
199
213
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
200
214
  * By default, logging is disabled.
201
215
  */
202
- export declare export declare function createClient(host: string, isSecure: boolean, dbPath: string | undefined | null, inboxId: string, accountIdentifier: Identifier, encryptionKey?: Uint8Array | undefined | null, historySyncUrl?: string | undefined | null, logOptions?: LogOptions | undefined | null): Promise<Client>
216
+ export declare export declare function createClient(host: string, 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): Promise<Client>
203
217
 
204
218
  export interface CreateDmOptions {
205
219
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -289,6 +303,16 @@ export declare export declare function isAddressAuthorized(host: string, inboxId
289
303
 
290
304
  export declare export declare function isInstallationAuthorized(host: string, inboxId: string, installationId: Uint8Array): Promise<boolean>
291
305
 
306
+ export interface KeyPackageStatus {
307
+ lifetime?: Lifetime
308
+ validationError?: string
309
+ }
310
+
311
+ export interface Lifetime {
312
+ notBefore: bigint
313
+ notAfter: bigint
314
+ }
315
+
292
316
  export interface ListConversationsOptions {
293
317
  consentStates?: Array<ConsentState>
294
318
  createdAfterNs?: number
@@ -442,4 +466,9 @@ export declare const enum SortDirection {
442
466
  Descending = 1
443
467
  }
444
468
 
469
+ export declare const enum SyncWorkerMode {
470
+ enabled = 'enabled',
471
+ disabled = 'disabled'
472
+ }
473
+
445
474
  export declare export declare function verifySignedWithPublicKey(signatureText: string, signatureBytes: Uint8Array, publicKey: Uint8Array): void
package/dist/index.js CHANGED
@@ -365,7 +365,7 @@ if (!nativeBinding) {
365
365
  throw new Error(`Failed to load native binding`)
366
366
  }
367
367
 
368
- const { Client, Conversation, ConversationListItem, Conversations, GroupMember, GroupMetadata, GroupPermissions, StreamCloser, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, 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, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, isAddressAuthorized, isInstallationAuthorized, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, SignatureRequestType, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
369
369
  export { Client }
370
370
  export { Conversation }
371
371
  export { ConversationListItem }
@@ -401,4 +401,5 @@ export { ReactionAction }
401
401
  export { ReactionSchema }
402
402
  export { SignatureRequestType }
403
403
  export { SortDirection }
404
+ export { SyncWorkerMode }
404
405
  export { verifySignedWithPublicKey }
package/dist/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "branch": "main",
3
- "version": "3d6d1ef",
4
- "date": "2025-03-26 03:44:38 +0000"
2
+ "branch": "cv/swallow-stream-errors-in-js-bindings",
3
+ "version": "7eef2ea",
4
+ "date": "2025-05-01 01:09:13 +0000"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "1.2.0-dev.3d6d1ef",
3
+ "version": "1.2.0-dev.7eef2ea",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@ianvs/prettier-plugin-sort-imports": "^4.4.1",
42
42
  "@napi-rs/cli": "^3.0.0-alpha.64",
43
- "@types/node": "^22.13.0",
43
+ "@types/node": "^22.15.2",
44
44
  "@types/uuid": "^10.0.0",
45
45
  "fast-glob": "^3.3.3",
46
46
  "prettier": "^3.5.0",
@@ -48,11 +48,11 @@
48
48
  "tsx": "^4.19.3",
49
49
  "typescript": "^5.8.2",
50
50
  "uuid": "^11.1.0",
51
- "viem": "^2.23.2",
52
- "vite": "^6.2.0",
51
+ "viem": "^2.28.0",
52
+ "vite": "^6.3.2",
53
53
  "vite-tsconfig-paths": "^5.1.4",
54
- "vitest": "^3.0.4",
55
- "zx": "^8.4.0"
54
+ "vitest": "^3.1.1",
55
+ "zx": "^8.5.0"
56
56
  },
57
57
  "packageManager": "yarn@4.6.0",
58
58
  "engines": {