@xmtp/node-bindings 1.7.0-dev.9bc470b → 1.7.0-dev.b057f23

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
@@ -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 | null>
46
46
  revokeInstallationsSignatureRequest(installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
47
47
  changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier: Identifier): Promise<SignatureRequestHandle>
48
48
  applySignatureRequest(signatureRequest: SignatureRequestHandle): Promise<void>
@@ -159,6 +159,16 @@ export declare class EnrichedReply {
159
159
  get inReplyTo(): NodeDecodedMessage | null
160
160
  }
161
161
 
162
+ export declare class FfiAuthCallback {
163
+ constructor(callback: () => Promise<FfiCredential>)
164
+ }
165
+
166
+ export declare class FfiAuthHandle {
167
+ constructor()
168
+ set(credential: FfiCredential): Promise<void>
169
+ id(): bigint
170
+ }
171
+
162
172
  export declare class GroupMember {
163
173
  inboxId: string
164
174
  installationIds: Array<string>
@@ -201,6 +211,27 @@ export declare class StreamCloser {
201
211
  isClosed(): boolean
202
212
  }
203
213
 
214
+ export interface Action {
215
+ id: string
216
+ label: string
217
+ imageUrl?: string
218
+ style?: ActionStyle
219
+ expiresAtNs?: number
220
+ }
221
+
222
+ export interface Actions {
223
+ id: string
224
+ description: string
225
+ actions: Array<Action>
226
+ expiresAtNs?: number
227
+ }
228
+
229
+ export declare const enum ActionStyle {
230
+ Primary = 0,
231
+ Secondary = 1,
232
+ Danger = 2
233
+ }
234
+
204
235
  export interface ApiStats {
205
236
  uploadKeyPackage: bigint
206
237
  fetchKeyPackage: bigint
@@ -220,6 +251,11 @@ export interface Attachment {
220
251
  content: Array<number>
221
252
  }
222
253
 
254
+ export declare const enum ClientMode {
255
+ default = 'default',
256
+ notification = 'notification'
257
+ }
258
+
223
259
  export interface Consent {
224
260
  entityType: ConsentEntityType
225
261
  state: ConsentState
@@ -281,7 +317,7 @@ export declare const enum ConversationType {
281
317
  * It can be one of: `debug`, `info`, `warn`, `error` or 'off'.
282
318
  * By default, logging is disabled.
283
319
  */
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>
320
+ 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, authCallback?: FfiAuthCallback | undefined | null, authHandle?: FfiAuthHandle | undefined | null, clientMode?: ClientMode | undefined | null): Promise<Client>
285
321
 
286
322
  export interface CreateDmOptions {
287
323
  messageDisappearingSettings?: MessageDisappearingSettings
@@ -296,6 +332,8 @@ export interface CreateGroupOptions {
296
332
  messageDisappearingSettings?: MessageDisappearingSettings
297
333
  }
298
334
 
335
+ export declare function decodeActions(bytes: Uint8Array): Actions
336
+
299
337
  export interface DecodedMessageBody {
300
338
  textContent?: TextContent
301
339
  reactionContent?: ReactionPayload
@@ -306,13 +344,19 @@ export interface DecodedMessageBody {
306
344
  groupUpdatedContent?: GroupUpdated
307
345
  readReceiptContent?: ReadReceipt
308
346
  walletSendCallsContent?: WalletSendCalls
347
+ intentContent?: Intent
348
+ actionsContent?: Actions
309
349
  customContent?: EncodedContent
310
350
  }
311
351
 
352
+ export declare function decodeIntent(bytes: Uint8Array): Intent
353
+
312
354
  export declare function decodeMultiRemoteAttachment(bytes: Uint8Array): MultiRemoteAttachment
313
355
 
314
356
  export declare function decodeReaction(bytes: Uint8Array): Reaction
315
357
 
358
+ export declare function decodeReply(bytes: Uint8Array): Reply
359
+
316
360
  export declare const enum DeliveryStatus {
317
361
  Unpublished = 0,
318
362
  Published = 1,
@@ -321,6 +365,8 @@ export declare const enum DeliveryStatus {
321
365
 
322
366
  export declare function deserializeEncodedContent(bytes: Uint8Array): EncodedContent
323
367
 
368
+ export declare function encodeActions(actions: Actions): Uint8Array
369
+
324
370
  export interface EncodedContent {
325
371
  type?: ContentTypeId
326
372
  parameters: Record<string, string>
@@ -329,10 +375,20 @@ export interface EncodedContent {
329
375
  content: Uint8Array
330
376
  }
331
377
 
378
+ export declare function encodeIntent(intent: Intent): Uint8Array
379
+
332
380
  export declare function encodeMultiRemoteAttachment(multiRemoteAttachment: MultiRemoteAttachment): Uint8Array
333
381
 
334
382
  export declare function encodeReaction(reaction: Reaction): Uint8Array
335
383
 
384
+ export declare function encodeReply(reply: Reply): Uint8Array
385
+
386
+ export interface FfiCredential {
387
+ name?: string
388
+ value: string
389
+ expiresAtSeconds: number
390
+ }
391
+
336
392
  export declare function generateInboxId(accountIdent: Identifier, nonce?: bigint | undefined | null): string
337
393
 
338
394
  export declare function getInboxIdForIdentifier(v3Host: string, gatewayHost: string | undefined | null, isSecure: boolean, identifier: Identifier): Promise<string | null>
@@ -409,6 +465,12 @@ export interface Installation {
409
465
  id: string
410
466
  }
411
467
 
468
+ export interface Intent {
469
+ id: string
470
+ actionId: string
471
+ metadata?: Record<string, any>
472
+ }
473
+
412
474
  export declare function isAddressAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, address: string): Promise<boolean>
413
475
 
414
476
  export declare function isInstallationAuthorized(host: string, gatewayHost: string | undefined | null, inboxId: string, installationId: Uint8Array): Promise<boolean>
@@ -448,6 +510,9 @@ export interface ListMessagesOptions {
448
510
  excludeContentTypes?: Array<ContentType>
449
511
  kind?: GroupMessageKind
450
512
  excludeSenderInboxIds?: Array<string>
513
+ sortBy?: MessageSortBy
514
+ insertedAfterNs?: number
515
+ insertedBeforeNs?: number
451
516
  }
452
517
 
453
518
  export declare const enum LogLevel {
@@ -478,6 +543,7 @@ export interface Message {
478
543
  content: EncodedContent
479
544
  kind: GroupMessageKind
480
545
  deliveryStatus: DeliveryStatus
546
+ insertedAtNs: number
481
547
  }
482
548
 
483
549
  export interface MessageDisappearingSettings {
@@ -485,6 +551,11 @@ export interface MessageDisappearingSettings {
485
551
  inNs: number
486
552
  }
487
553
 
554
+ export declare const enum MessageSortBy {
555
+ SentAt = 0,
556
+ InsertedAt = 1
557
+ }
558
+
488
559
  export interface MessageWithReactions {
489
560
  message: Message
490
561
  reactions: Array<Message>
@@ -617,6 +688,12 @@ export interface RemoteAttachmentInfoPayload {
617
688
  filename?: string
618
689
  }
619
690
 
691
+ export interface Reply {
692
+ content: EncodedContent
693
+ reference: string
694
+ referenceInboxId?: string
695
+ }
696
+
620
697
  export declare function revokeInstallationsSignatureRequest(v3Host: string, gatewayHost: string | undefined | null, recoveryIdentifier: Identifier, inboxId: string, installationIds: Array<Uint8Array>): Promise<SignatureRequestHandle>
621
698
 
622
699
  export interface SendMessageOpts {
package/dist/index.js CHANGED
@@ -575,30 +575,40 @@ if (!nativeBinding) {
575
575
  throw new Error(`Failed to load native binding`)
576
576
  }
577
577
 
578
- const { Client, Conversation, ConversationListItem, Conversations, DecodedMessage, EnrichedReply, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, applySignatureRequest, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeMultiRemoteAttachment, decodeReaction, DeliveryStatus, deserializeEncodedContent, encodeMultiRemoteAttachment, encodeReaction, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, ListConversationsOrderBy, LogLevel, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, serializeEncodedContent, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
578
+ const { Client, Conversation, ConversationListItem, Conversations, DecodedMessage, EnrichedReply, FfiAuthCallback, FfiAuthHandle, GroupMember, GroupMetadata, GroupPermissions, SignatureRequestHandle, StreamCloser, ActionStyle, applySignatureRequest, ClientMode, ConsentEntityType, ConsentState, ContentType, ConversationType, createClient, decodeActions, decodeIntent, decodeMultiRemoteAttachment, decodeReaction, decodeReply, DeliveryStatus, deserializeEncodedContent, encodeActions, encodeIntent, encodeMultiRemoteAttachment, encodeReaction, encodeReply, generateInboxId, getInboxIdForIdentifier, GroupMembershipState, GroupMessageKind, GroupPermissionsOptions, IdentifierKind, inboxStateFromInboxIds, isAddressAuthorized, isInstallationAuthorized, ListConversationsOrderBy, LogLevel, MessageSortBy, MetadataField, PermissionLevel, PermissionPolicy, PermissionUpdateType, ReactionAction, ReactionSchema, revokeInstallationsSignatureRequest, serializeEncodedContent, SortDirection, SyncWorkerMode, verifySignedWithPublicKey } = nativeBinding
579
579
  export { Client }
580
580
  export { Conversation }
581
581
  export { ConversationListItem }
582
582
  export { Conversations }
583
583
  export { DecodedMessage }
584
584
  export { EnrichedReply }
585
+ export { FfiAuthCallback }
586
+ export { FfiAuthHandle }
585
587
  export { GroupMember }
586
588
  export { GroupMetadata }
587
589
  export { GroupPermissions }
588
590
  export { SignatureRequestHandle }
589
591
  export { StreamCloser }
592
+ export { ActionStyle }
590
593
  export { applySignatureRequest }
594
+ export { ClientMode }
591
595
  export { ConsentEntityType }
592
596
  export { ConsentState }
593
597
  export { ContentType }
594
598
  export { ConversationType }
595
599
  export { createClient }
600
+ export { decodeActions }
601
+ export { decodeIntent }
596
602
  export { decodeMultiRemoteAttachment }
597
603
  export { decodeReaction }
604
+ export { decodeReply }
598
605
  export { DeliveryStatus }
599
606
  export { deserializeEncodedContent }
607
+ export { encodeActions }
608
+ export { encodeIntent }
600
609
  export { encodeMultiRemoteAttachment }
601
610
  export { encodeReaction }
611
+ export { encodeReply }
602
612
  export { generateInboxId }
603
613
  export { getInboxIdForIdentifier }
604
614
  export { GroupMembershipState }
@@ -610,6 +620,7 @@ export { isAddressAuthorized }
610
620
  export { isInstallationAuthorized }
611
621
  export { ListConversationsOrderBy }
612
622
  export { LogLevel }
623
+ export { MessageSortBy }
613
624
  export { MetadataField }
614
625
  export { PermissionLevel }
615
626
  export { PermissionPolicy }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/node-bindings",
3
- "version": "1.7.0-dev.9bc470b",
3
+ "version": "1.7.0-dev.b057f23",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://git@github.com/xmtp/libxmtp.git",