@xmtp/node-bindings 0.0.15 → 0.0.16
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 +39 -11
- package/dist/index.js +3 -0
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -2,43 +2,50 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export class NapiClient {
|
|
4
4
|
accountAddress: string
|
|
5
|
+
setConsentStates(records: Array<NapiConsent>): Promise<void>
|
|
6
|
+
getConsentState(entityType: NapiConsentEntityType, entity: string): Promise<NapiConsentState>
|
|
7
|
+
/**
|
|
8
|
+
* Get the client's inbox state.
|
|
9
|
+
*
|
|
10
|
+
* If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
11
|
+
* Otherwise, the state will be read from the local database.
|
|
12
|
+
*/
|
|
13
|
+
inboxState(refreshFromNetwork: boolean): Promise<NapiInboxState>
|
|
14
|
+
getLatestInboxState(inboxId: string): Promise<NapiInboxState>
|
|
5
15
|
inboxId(): string
|
|
6
16
|
isRegistered(): boolean
|
|
7
17
|
installationId(): string
|
|
8
18
|
canMessage(accountAddresses: Array<string>): Promise<Record<string, boolean>>
|
|
9
19
|
registerIdentity(): Promise<void>
|
|
10
|
-
createInboxSignatureText(): Promise<string | null>
|
|
11
20
|
conversations(): NapiConversations
|
|
12
21
|
requestHistorySync(): Promise<void>
|
|
13
22
|
findInboxIdByAddress(address: string): Promise<string | null>
|
|
14
|
-
/**
|
|
15
|
-
* Get the client's inbox state.
|
|
16
|
-
*
|
|
17
|
-
* If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
18
|
-
* Otherwise, the state will be read from the local database.
|
|
19
|
-
*/
|
|
20
|
-
inboxState(refreshFromNetwork: boolean): Promise<NapiInboxState>
|
|
21
23
|
addressesFromInboxId(refreshFromNetwork: boolean, inboxIds: Array<string>): Promise<Array<NapiInboxState>>
|
|
22
|
-
|
|
24
|
+
createInboxSignatureText(): Promise<string | null>
|
|
23
25
|
addWalletSignatureText(existingWalletAddress: string, newWalletAddress: string): Promise<string>
|
|
24
26
|
revokeWalletSignatureText(walletAddress: string): Promise<string>
|
|
25
27
|
revokeInstallationsSignatureText(): Promise<string>
|
|
26
28
|
addSignature(signatureType: NapiSignatureRequestType, signatureBytes: Uint8Array): Promise<void>
|
|
27
29
|
applySignatureRequests(): Promise<void>
|
|
28
|
-
setConsentStates(records: Array<NapiConsent>): Promise<void>
|
|
29
|
-
getConsentState(entityType: NapiConsentEntityType, entity: string): Promise<NapiConsentState>
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export class NapiConversations {
|
|
33
33
|
createGroup(accountAddresses: Array<string>, options?: NapiCreateGroupOptions | undefined | null): Promise<NapiGroup>
|
|
34
|
+
createDm(accountAddress: string): Promise<NapiGroup>
|
|
34
35
|
findGroupById(groupId: string): NapiGroup
|
|
35
36
|
findDmByTargetInboxId(targetInboxId: string): NapiGroup
|
|
36
37
|
findMessageById(messageId: string): NapiMessage
|
|
37
38
|
processStreamedWelcomeMessage(envelopeBytes: Uint8Array): Promise<NapiGroup>
|
|
38
39
|
sync(): Promise<void>
|
|
39
40
|
list(opts?: NapiListConversationsOptions | undefined | null): Promise<Array<NapiGroup>>
|
|
41
|
+
listGroups(opts?: NapiListConversationsOptions | undefined | null): Promise<Array<NapiGroup>>
|
|
42
|
+
listDms(opts?: NapiListConversationsOptions | undefined | null): Promise<Array<NapiGroup>>
|
|
40
43
|
stream(callback: (err: null | Error, result: NapiGroup) => void): NapiStreamCloser
|
|
44
|
+
streamGroups(callback: (err: null | Error, result: NapiGroup) => void): NapiStreamCloser
|
|
45
|
+
streamDms(callback: (err: null | Error, result: NapiGroup) => void): NapiStreamCloser
|
|
41
46
|
streamAllMessages(callback: (err: null | Error, result: NapiMessage) => void): NapiStreamCloser
|
|
47
|
+
streamAllGroupMessages(callback: (err: null | Error, result: NapiMessage) => void): NapiStreamCloser
|
|
48
|
+
streamAllDmMessages(callback: (err: null | Error, result: NapiMessage) => void): NapiStreamCloser
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
export class NapiGroup {
|
|
@@ -80,6 +87,7 @@ export class NapiGroup {
|
|
|
80
87
|
groupMetadata(): NapiGroupMetadata
|
|
81
88
|
consentState(): NapiConsentState
|
|
82
89
|
updateConsentState(state: NapiConsentState): void
|
|
90
|
+
dmPeerInboxId(): string
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
export class NapiGroupMember {
|
|
@@ -163,6 +171,12 @@ export interface NapiContentTypeId {
|
|
|
163
171
|
versionMinor: number
|
|
164
172
|
}
|
|
165
173
|
|
|
174
|
+
export const enum NapiConversationType {
|
|
175
|
+
Dm = 0,
|
|
176
|
+
Group = 1,
|
|
177
|
+
Sync = 2
|
|
178
|
+
}
|
|
179
|
+
|
|
166
180
|
export interface NapiCreateGroupOptions {
|
|
167
181
|
permissions?: NapiGroupPermissionsOptions
|
|
168
182
|
groupName?: string
|
|
@@ -177,6 +191,11 @@ export const enum NapiDeliveryStatus {
|
|
|
177
191
|
Failed = 2
|
|
178
192
|
}
|
|
179
193
|
|
|
194
|
+
export const enum NapiDirection {
|
|
195
|
+
Ascending = 0,
|
|
196
|
+
Descending = 1
|
|
197
|
+
}
|
|
198
|
+
|
|
180
199
|
export interface NapiEncodedContent {
|
|
181
200
|
type?: NapiContentTypeId
|
|
182
201
|
parameters: Record<string, string>
|
|
@@ -185,6 +204,12 @@ export interface NapiEncodedContent {
|
|
|
185
204
|
content: Uint8Array
|
|
186
205
|
}
|
|
187
206
|
|
|
207
|
+
export const enum NapiGroupMembershipState {
|
|
208
|
+
Allowed = 0,
|
|
209
|
+
Rejected = 1,
|
|
210
|
+
Pending = 2
|
|
211
|
+
}
|
|
212
|
+
|
|
188
213
|
export const enum NapiGroupMessageKind {
|
|
189
214
|
Application = 0,
|
|
190
215
|
MembershipChange = 1
|
|
@@ -209,9 +234,11 @@ export interface NapiInstallation {
|
|
|
209
234
|
}
|
|
210
235
|
|
|
211
236
|
export interface NapiListConversationsOptions {
|
|
237
|
+
allowedStates?: Array<NapiGroupMembershipState>
|
|
212
238
|
createdAfterNs?: number
|
|
213
239
|
createdBeforeNs?: number
|
|
214
240
|
limit?: number
|
|
241
|
+
conversationType?: NapiConversationType
|
|
215
242
|
}
|
|
216
243
|
|
|
217
244
|
export interface NapiListMessagesOptions {
|
|
@@ -219,6 +246,7 @@ export interface NapiListMessagesOptions {
|
|
|
219
246
|
sentAfterNs?: number
|
|
220
247
|
limit?: number
|
|
221
248
|
deliveryStatus?: NapiDeliveryStatus
|
|
249
|
+
direction?: NapiDirection
|
|
222
250
|
}
|
|
223
251
|
|
|
224
252
|
export const enum NapiPermissionLevel {
|
package/dist/index.js
CHANGED
|
@@ -374,7 +374,10 @@ module.exports.generateInboxId = nativeBinding.generateInboxId
|
|
|
374
374
|
module.exports.getInboxIdForAddress = nativeBinding.getInboxIdForAddress
|
|
375
375
|
module.exports.NapiConsentEntityType = nativeBinding.NapiConsentEntityType
|
|
376
376
|
module.exports.NapiConsentState = nativeBinding.NapiConsentState
|
|
377
|
+
module.exports.NapiConversationType = nativeBinding.NapiConversationType
|
|
377
378
|
module.exports.NapiDeliveryStatus = nativeBinding.NapiDeliveryStatus
|
|
379
|
+
module.exports.NapiDirection = nativeBinding.NapiDirection
|
|
380
|
+
module.exports.NapiGroupMembershipState = nativeBinding.NapiGroupMembershipState
|
|
378
381
|
module.exports.NapiGroupMessageKind = nativeBinding.NapiGroupMessageKind
|
|
379
382
|
module.exports.NapiGroupPermissionsOptions = nativeBinding.NapiGroupPermissionsOptions
|
|
380
383
|
module.exports.NapiPermissionLevel = nativeBinding.NapiPermissionLevel
|