@xmtp/node-sdk 5.5.0 → 6.0.0-dev.4b2b209
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/index.d.ts +214 -27
- package/dist/index.js +324 -97
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ContentCodec, ContentTypeId } from '@xmtp/content-type-primitives';
|
|
2
2
|
import * as _xmtp_node_bindings from '@xmtp/node-bindings';
|
|
3
|
-
import { ContentTypeId as ContentTypeId$1, DeliveryStatus, GroupMessageKind, Reaction, DecodedMessage as DecodedMessage$1, LeaveRequest, ReadReceipt, Attachment, RemoteAttachment, TransactionReference, WalletSendCalls, Actions, Intent, MultiRemoteAttachment, GroupUpdated, DeletedMessage, LogLevel, Identifier, StreamCloser, Conversation as Conversation$1, Message, EncodedContent, SendMessageOpts, Reply, ListMessagesOptions, ConsentState, PermissionUpdateType, PermissionPolicy, MetadataField, Conversations as Conversations$1, CreateGroupOptions, CreateDmOptions, ListConversationsOptions, ConversationType, Client as Client$1, Consent, ConsentEntityType, UserPreferenceUpdate, SignatureRequestHandle } from '@xmtp/node-bindings';
|
|
4
|
-
export { Action, ActionStyle, Actions, ApiStats, Attachment, Consent, ConsentEntityType, ConsentState, ContentType, ConversationDebugInfo, ConversationListItem, ConversationType, CreateDmOptions, CreateGroupOptions, Cursor, DeliveryStatus, EncryptedAttachment, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, GroupSyncSummary, GroupUpdated, HmacKey, Identifier, IdentifierKind, IdentityStats, Inbox, InboxState, Installation, Intent, KeyPackageStatus, LeaveRequest, Lifetime, ListConversationsOptions, ListConversationsOrderBy, ListMessagesOptions, LogLevel, LogOptions, Message, MessageDisappearingSettings, MessageSortBy, MetadataField, MetadataFieldChange, MultiRemoteAttachment, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, Reaction, ReactionAction, ReactionSchema, ReadReceipt, RemoteAttachment,
|
|
3
|
+
import { ContentTypeId as ContentTypeId$1, DeliveryStatus, GroupMessageKind, Reaction, DecodedMessage as DecodedMessage$1, LeaveRequest, ReadReceipt, Attachment, RemoteAttachment, TransactionReference, WalletSendCalls, Actions, Intent, MultiRemoteAttachment, GroupUpdated, DeletedMessage, Backend, LogLevel, VisibilityConfirmationOptions, XmtpEnv as XmtpEnv$1, Identifier, StreamCloser, Conversation as Conversation$1, Message, EncodedContent, SendMessageOpts, Reply, ListMessagesOptions, ConsentState, PermissionUpdateType, PermissionPolicy, MetadataField, Conversations as Conversations$1, CreateGroupOptions, CreateDmOptions, ListConversationsOptions, ConversationType, Client as Client$1, Consent, ConsentEntityType, UserPreferenceUpdate, SignatureRequestHandle, InboxState, ArchiveOptions, AvailableArchiveInfo, ArchiveMetadata, GroupSyncSummary } from '@xmtp/node-bindings';
|
|
4
|
+
export { Action, ActionStyle, Actions, ApiStats, ArchiveMetadata, ArchiveOptions, Attachment, AvailableArchiveInfo, Backend, BackendBuilder, BackupElementSelectionOption, Consent, ConsentEntityType, ConsentState, ContentType, ConversationDebugInfo, ConversationListItem, ConversationType, CreateDmOptions, CreateGroupOptions, Cursor, DeliveryStatus, EncryptedAttachment, GroupMember, GroupMembershipState, GroupMessageKind, GroupMetadata, GroupPermissions, GroupPermissionsOptions, GroupSyncSummary, GroupUpdated, HmacKey, Identifier, IdentifierKind, IdentityStats, Inbox, InboxState, Installation, Intent, KeyPackageStatus, LeaveRequest, Lifetime, ListConversationsOptions, ListConversationsOrderBy, ListMessagesOptions, LogLevel, LogOptions, Message, MessageDisappearingSettings, MessageSortBy, MetadataField, MetadataFieldChange, MultiRemoteAttachment, PermissionLevel, PermissionPolicy, PermissionPolicySet, PermissionUpdateType, Reaction, ReactionAction, ReactionSchema, ReadReceipt, RemoteAttachment, Reply, SendMessageOpts, SignatureRequestHandle, SortDirection, TransactionMetadata, TransactionReference, UserPreferenceUpdate, VisibilityConfirmationOptions, WalletCall, WalletSendCalls, contentTypeActions, contentTypeAttachment, contentTypeGroupUpdated, contentTypeIntent, contentTypeLeaveRequest, contentTypeMarkdown, contentTypeMultiRemoteAttachment, contentTypeReaction, contentTypeReadReceipt, contentTypeRemoteAttachment, contentTypeReply, contentTypeText, contentTypeTransactionReference, contentTypeWalletSendCalls, decryptAttachment, encodeActions, encodeAttachment, encodeIntent, encodeMarkdown, encodeMultiRemoteAttachment, encodeReaction, encodeReadReceipt, encodeRemoteAttachment, encodeText, encodeTransactionReference, encodeWalletSendCalls, encryptAttachment } from '@xmtp/node-bindings';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Pre-configured URLs for the XMTP network based on the environment
|
|
8
8
|
*
|
|
9
|
+
* @deprecated Use `createBackend()` instead.
|
|
9
10
|
* @constant
|
|
10
11
|
* @property {string} local - The local URL for the XMTP network
|
|
11
12
|
* @property {string} dev - The development URL for the XMTP network
|
|
@@ -28,6 +29,10 @@ declare const HistorySyncUrls: {
|
|
|
28
29
|
readonly local: "http://localhost:5558";
|
|
29
30
|
readonly dev: "https://message-history.dev.ephemera.network";
|
|
30
31
|
readonly production: "https://message-history.production.ephemera.network";
|
|
32
|
+
readonly "testnet-staging": "https://message-history.dev.ephemera.network";
|
|
33
|
+
readonly "testnet-dev": "https://message-history.dev.ephemera.network";
|
|
34
|
+
readonly testnet: "https://message-history.dev.ephemera.network";
|
|
35
|
+
readonly mainnet: "https://message-history.production.ephemera.network";
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
declare class CodecRegistry {
|
|
@@ -86,7 +91,7 @@ declare function validHex(value: unknown): HexString;
|
|
|
86
91
|
/**
|
|
87
92
|
* XMTP environment
|
|
88
93
|
*/
|
|
89
|
-
type XmtpEnv =
|
|
94
|
+
type XmtpEnv = "local" | "dev" | "production" | "testnet-staging" | "testnet-dev" | "testnet" | "mainnet";
|
|
90
95
|
/**
|
|
91
96
|
* Network options
|
|
92
97
|
*/
|
|
@@ -102,6 +107,23 @@ type NetworkOptions = {
|
|
|
102
107
|
* specific endpoint
|
|
103
108
|
*/
|
|
104
109
|
apiUrl?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The host of the XMTP Gateway for your application
|
|
112
|
+
*
|
|
113
|
+
* Only valid for `dev` and `production` environments
|
|
114
|
+
*
|
|
115
|
+
* @see https://docs.xmtp.org/fund-agents-apps/run-gateway
|
|
116
|
+
*/
|
|
117
|
+
gatewayHost?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Custom app version
|
|
120
|
+
*/
|
|
121
|
+
appVersion?: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Device sync options
|
|
125
|
+
*/
|
|
126
|
+
type DeviceSyncOptions = {
|
|
105
127
|
/**
|
|
106
128
|
* historySyncUrl can be used to override the `env` flag and connect to a
|
|
107
129
|
* specific endpoint for syncing history
|
|
@@ -110,13 +132,9 @@ type NetworkOptions = {
|
|
|
110
132
|
*/
|
|
111
133
|
historySyncUrl?: string | null;
|
|
112
134
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
* Only valid for `testnet` and `mainnet` environments
|
|
116
|
-
*
|
|
117
|
-
* @see:https://docs.xmtp.org/fund-agents-apps/run-gateway
|
|
135
|
+
* Disable device sync
|
|
118
136
|
*/
|
|
119
|
-
|
|
137
|
+
disableDeviceSync?: boolean;
|
|
120
138
|
};
|
|
121
139
|
/**
|
|
122
140
|
* Storage options
|
|
@@ -170,21 +188,22 @@ type OtherOptions = {
|
|
|
170
188
|
* Disable automatic registration when creating a client
|
|
171
189
|
*/
|
|
172
190
|
disableAutoRegister?: boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Disable device sync
|
|
175
|
-
*/
|
|
176
|
-
disableDeviceSync?: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Custom app version
|
|
179
|
-
*/
|
|
180
|
-
appVersion?: string;
|
|
181
191
|
/**
|
|
182
192
|
* The nonce to use when generating an inbox ID
|
|
183
193
|
* (default: undefined = 1)
|
|
184
194
|
*/
|
|
185
195
|
nonce?: bigint;
|
|
196
|
+
/**
|
|
197
|
+
* Options for waiting until client registration is visible on the network.
|
|
198
|
+
*
|
|
199
|
+
* When set, `registerIdentity` will wait for the specified quorum of nodes
|
|
200
|
+
* to confirm the registration before resolving.
|
|
201
|
+
*/
|
|
202
|
+
waitForRegistrationVisible?: VisibilityConfirmationOptions;
|
|
186
203
|
};
|
|
187
|
-
type ClientOptions = NetworkOptions
|
|
204
|
+
type ClientOptions = (NetworkOptions | {
|
|
205
|
+
backend: Backend;
|
|
206
|
+
}) & DeviceSyncOptions & StorageOptions & ContentOptions & OtherOptions;
|
|
188
207
|
type EnrichedReply<T = unknown, U = unknown> = {
|
|
189
208
|
referenceId: string;
|
|
190
209
|
content: T;
|
|
@@ -194,6 +213,9 @@ type EnrichedReply<T = unknown, U = unknown> = {
|
|
|
194
213
|
type BuiltInContentTypes = string | LeaveRequest | Reaction | ReadReceipt | Attachment | RemoteAttachment | TransactionReference | WalletSendCalls | Actions | Intent | MultiRemoteAttachment | GroupUpdated | DeletedMessage;
|
|
195
214
|
type ExtractCodecContentTypes<C extends ContentCodec[] = []> = C extends readonly [] ? BuiltInContentTypes : [...C][number] extends ContentCodec<infer T> ? T | BuiltInContentTypes | EnrichedReply<T | BuiltInContentTypes, T | BuiltInContentTypes> : BuiltInContentTypes;
|
|
196
215
|
|
|
216
|
+
declare const envToString: (env: XmtpEnv$1) => XmtpEnv;
|
|
217
|
+
declare const createBackend: (options?: NetworkOptions) => Promise<Backend>;
|
|
218
|
+
|
|
197
219
|
declare class InboxReassignError extends Error {
|
|
198
220
|
constructor();
|
|
199
221
|
}
|
|
@@ -217,7 +239,7 @@ declare class StreamInvalidRetryAttemptsError extends Error {
|
|
|
217
239
|
}
|
|
218
240
|
|
|
219
241
|
declare const generateInboxId: (identifier: Identifier, nonce?: bigint) => string;
|
|
220
|
-
declare const getInboxIdForIdentifier: (
|
|
242
|
+
declare const getInboxIdForIdentifier: (backend: Backend, identifier: Identifier) => Promise<string | null>;
|
|
221
243
|
|
|
222
244
|
type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
|
|
223
245
|
type GetIdentifier = () => Promise<Identifier> | Identifier;
|
|
@@ -1141,6 +1163,12 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1141
1163
|
* Gets the app version used by the client
|
|
1142
1164
|
*/
|
|
1143
1165
|
get appVersion(): string | undefined;
|
|
1166
|
+
/**
|
|
1167
|
+
* Gets the XMTP environment the client is connected to
|
|
1168
|
+
*
|
|
1169
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
1170
|
+
*/
|
|
1171
|
+
get env(): XmtpEnv;
|
|
1144
1172
|
/**
|
|
1145
1173
|
* Gets the client options
|
|
1146
1174
|
*/
|
|
@@ -1371,10 +1399,22 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1371
1399
|
/**
|
|
1372
1400
|
* Revokes specific installations of the client's inbox without a client
|
|
1373
1401
|
*
|
|
1374
|
-
* @param env - The environment to use
|
|
1375
1402
|
* @param signer - The signer to use
|
|
1376
1403
|
* @param inboxId - The inbox ID to revoke installations for
|
|
1377
1404
|
* @param installationIds - The installation IDs to revoke
|
|
1405
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1406
|
+
*/
|
|
1407
|
+
static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], backend?: Backend): Promise<void>;
|
|
1408
|
+
/**
|
|
1409
|
+
* Revokes specific installations of the client's inbox without a client
|
|
1410
|
+
*
|
|
1411
|
+
* @param signer - The signer to use
|
|
1412
|
+
* @param inboxId - The inbox ID to revoke installations for
|
|
1413
|
+
* @param installationIds - The installation IDs to revoke
|
|
1414
|
+
* @param env - The environment to use
|
|
1415
|
+
* @param gatewayHost - Optional gateway host
|
|
1416
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1417
|
+
* of `XmtpEnv` and `gatewayHost`.
|
|
1378
1418
|
*/
|
|
1379
1419
|
static revokeInstallations(signer: Signer, inboxId: string, installationIds: Uint8Array[], env?: XmtpEnv, gatewayHost?: string): Promise<void>;
|
|
1380
1420
|
/**
|
|
@@ -1395,6 +1435,23 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1395
1435
|
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
1396
1436
|
*/
|
|
1397
1437
|
canMessage(identifiers: Identifier[]): Promise<Map<string, boolean>>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Fetches the latest inbox updates count for the specified inbox IDs
|
|
1440
|
+
*
|
|
1441
|
+
* @param inboxIds - The inbox IDs to check
|
|
1442
|
+
* @param refreshFromNetwork - Whether to refresh from the network
|
|
1443
|
+
* @returns Map of inbox IDs to their updates count
|
|
1444
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
1445
|
+
*/
|
|
1446
|
+
fetchLatestInboxUpdatesCount(inboxIds: string[], _refreshFromNetwork?: boolean): Promise<Map<string, number>>;
|
|
1447
|
+
/**
|
|
1448
|
+
* Fetches the latest inbox updates count for the client's inbox
|
|
1449
|
+
*
|
|
1450
|
+
* @param refreshFromNetwork - Whether to refresh from the network
|
|
1451
|
+
* @returns The latest inbox updates count
|
|
1452
|
+
* @throws {ClientNotInitializedError} if the client is not initialized
|
|
1453
|
+
*/
|
|
1454
|
+
fetchOwnInboxUpdatesCount(_refreshFromNetwork?: boolean): Promise<number>;
|
|
1398
1455
|
/**
|
|
1399
1456
|
* Fetches the key package statuses from the network for the specified
|
|
1400
1457
|
* installation IDs
|
|
@@ -1434,17 +1491,62 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1434
1491
|
* Fetches the inbox states for the specified inbox IDs from the network
|
|
1435
1492
|
* without a client
|
|
1436
1493
|
*
|
|
1437
|
-
* @param env - The environment to use
|
|
1438
1494
|
* @param inboxIds - The inbox IDs to get the state for
|
|
1495
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1439
1496
|
* @returns The inbox states for the specified inbox IDs
|
|
1440
1497
|
*/
|
|
1441
|
-
static fetchInboxStates(inboxIds: string[],
|
|
1498
|
+
static fetchInboxStates(inboxIds: string[], backend?: Backend): Promise<InboxState[]>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Fetches the inbox states for the specified inbox IDs from the network
|
|
1501
|
+
* without a client
|
|
1502
|
+
*
|
|
1503
|
+
* @param inboxIds - The inbox IDs to get the state for
|
|
1504
|
+
* @param env - The environment to use
|
|
1505
|
+
* @param gatewayHost - Optional gateway host
|
|
1506
|
+
* @returns The inbox states for the specified inbox IDs
|
|
1507
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1508
|
+
* of `XmtpEnv` and `gatewayHost`.
|
|
1509
|
+
*/
|
|
1510
|
+
static fetchInboxStates(inboxIds: string[], env?: XmtpEnv, gatewayHost?: string): Promise<InboxState[]>;
|
|
1511
|
+
/**
|
|
1512
|
+
* Fetches the latest inbox updates count for the specified inbox IDs
|
|
1513
|
+
* without a client
|
|
1514
|
+
*
|
|
1515
|
+
* @param inboxIds - The inbox IDs to check
|
|
1516
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1517
|
+
* @param refreshFromNetwork - Whether to refresh from the network
|
|
1518
|
+
* @returns Map of inbox IDs to their updates count
|
|
1519
|
+
*/
|
|
1520
|
+
static fetchLatestInboxUpdatesCount(inboxIds: string[], backendOrEnv?: Backend | XmtpEnv, refreshFromNetwork?: boolean): Promise<Map<string, number>>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Fetches the latest inbox updates count for the specified inbox IDs
|
|
1523
|
+
* without a client
|
|
1524
|
+
*
|
|
1525
|
+
* @param inboxIds - The inbox IDs to check
|
|
1526
|
+
* @param env - The environment to use
|
|
1527
|
+
* @param gatewayHost - Optional gateway host
|
|
1528
|
+
* @param refreshFromNetwork - Whether to refresh from the network
|
|
1529
|
+
* @returns Map of inbox IDs to their updates count
|
|
1530
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1531
|
+
* of `XmtpEnv` and `gatewayHost`.
|
|
1532
|
+
*/
|
|
1533
|
+
static fetchLatestInboxUpdatesCount(inboxIds: string[], env?: XmtpEnv, gatewayHost?: string, refreshFromNetwork?: boolean): Promise<Map<string, number>>;
|
|
1534
|
+
/**
|
|
1535
|
+
* Checks if the specified identifiers can be messaged
|
|
1536
|
+
*
|
|
1537
|
+
* @param identifiers - The identifiers to check
|
|
1538
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1539
|
+
* @returns Map of identifiers to whether they can be messaged
|
|
1540
|
+
*/
|
|
1541
|
+
static canMessage(identifiers: Identifier[], backend?: Backend): Promise<Map<string, boolean>>;
|
|
1442
1542
|
/**
|
|
1443
1543
|
* Checks if the specified identifiers can be messaged
|
|
1444
1544
|
*
|
|
1445
1545
|
* @param identifiers - The identifiers to check
|
|
1446
1546
|
* @param env - Optional XMTP environment
|
|
1447
1547
|
* @returns Map of identifiers to whether they can be messaged
|
|
1548
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1549
|
+
* of `XmtpEnv`.
|
|
1448
1550
|
*/
|
|
1449
1551
|
static canMessage(identifiers: Identifier[], env?: XmtpEnv): Promise<Map<string, boolean>>;
|
|
1450
1552
|
/**
|
|
@@ -1461,8 +1563,20 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1461
1563
|
*
|
|
1462
1564
|
* @param inboxId - The inbox ID to check
|
|
1463
1565
|
* @param address - The address to check
|
|
1464
|
-
* @param
|
|
1566
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1567
|
+
* @returns Whether the address is authorized
|
|
1568
|
+
*/
|
|
1569
|
+
static isAddressAuthorized(inboxId: string, address: string, backend?: Backend): Promise<boolean>;
|
|
1570
|
+
/**
|
|
1571
|
+
* Checks if an address is authorized for an inbox
|
|
1572
|
+
*
|
|
1573
|
+
* @param inboxId - The inbox ID to check
|
|
1574
|
+
* @param address - The address to check
|
|
1575
|
+
* @param env - The environment to use
|
|
1576
|
+
* @param gatewayHost - Optional gateway host
|
|
1465
1577
|
* @returns Whether the address is authorized
|
|
1578
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1579
|
+
* of `XmtpEnv` and `gatewayHost`.
|
|
1466
1580
|
*/
|
|
1467
1581
|
static isAddressAuthorized(inboxId: string, address: string, env?: XmtpEnv, gatewayHost?: string): Promise<boolean>;
|
|
1468
1582
|
/**
|
|
@@ -1470,17 +1584,90 @@ declare class Client<ContentTypes = ExtractCodecContentTypes> {
|
|
|
1470
1584
|
*
|
|
1471
1585
|
* @param inboxId - The inbox ID to check
|
|
1472
1586
|
* @param installation - The installation to check
|
|
1473
|
-
* @param
|
|
1587
|
+
* @param backend - Optional `Backend` instance created with `createBackend()`
|
|
1474
1588
|
* @returns Whether the installation is authorized
|
|
1475
1589
|
*/
|
|
1590
|
+
static isInstallationAuthorized(inboxId: string, installation: Uint8Array, backend?: Backend): Promise<boolean>;
|
|
1591
|
+
/**
|
|
1592
|
+
* Checks if an installation is authorized for an inbox
|
|
1593
|
+
*
|
|
1594
|
+
* @param inboxId - The inbox ID to check
|
|
1595
|
+
* @param installation - The installation to check
|
|
1596
|
+
* @param env - The environment to use
|
|
1597
|
+
* @param gatewayHost - Optional gateway host
|
|
1598
|
+
* @returns Whether the installation is authorized
|
|
1599
|
+
* @deprecated Pass a `Backend` instance created with `createBackend()` instead
|
|
1600
|
+
* of `XmtpEnv` and `gatewayHost`.
|
|
1601
|
+
*/
|
|
1476
1602
|
static isInstallationAuthorized(inboxId: string, installation: Uint8Array, env?: XmtpEnv, gatewayHost?: string): Promise<boolean>;
|
|
1477
1603
|
/**
|
|
1478
1604
|
* Send a sync request to other devices on the network
|
|
1479
1605
|
*
|
|
1606
|
+
* @param options - Archive options specifying what to sync (defaults to consent and messages)
|
|
1607
|
+
* @param serverUrl - The server URL for the sync request (defaults to environment-specific URL)
|
|
1480
1608
|
* @returns Promise that resolves when the sync request is sent
|
|
1481
1609
|
*/
|
|
1482
|
-
sendSyncRequest(): Promise<void>;
|
|
1610
|
+
sendSyncRequest(options?: ArchiveOptions, serverUrl?: string): Promise<void>;
|
|
1611
|
+
/**
|
|
1612
|
+
* Send a sync archive to the sync group
|
|
1613
|
+
*
|
|
1614
|
+
* @param pin - The pin used for reference when importing
|
|
1615
|
+
* @param options - Archive options specifying what to sync (defaults to consent and messages)
|
|
1616
|
+
* @param serverUrl - The server URL for the sync archive (defaults to environment-specific URL)
|
|
1617
|
+
* @returns Promise that resolves when the sync archive is sent
|
|
1618
|
+
*/
|
|
1619
|
+
sendSyncArchive(pin: string, options?: ArchiveOptions, serverUrl?: string): Promise<void>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Process a sync archive that matches the pin given
|
|
1622
|
+
*
|
|
1623
|
+
* @param archivePin - Optional pin to match. If not provided, processes the last archive sent
|
|
1624
|
+
* @returns Promise that resolves when the archive is processed
|
|
1625
|
+
*/
|
|
1626
|
+
processSyncArchive(archivePin?: string | null): Promise<void>;
|
|
1627
|
+
/**
|
|
1628
|
+
* List the archives available for import in the sync group
|
|
1629
|
+
*
|
|
1630
|
+
* You may need to manually sync the sync group before calling
|
|
1631
|
+
* this function to see recently uploaded archives.
|
|
1632
|
+
*
|
|
1633
|
+
* @param daysCutoff - Number of days to look back for archives
|
|
1634
|
+
* @returns Array of available archive information
|
|
1635
|
+
*/
|
|
1636
|
+
listAvailableArchives(daysCutoff: number): AvailableArchiveInfo[];
|
|
1637
|
+
/**
|
|
1638
|
+
* Archive application elements to file for later restoration
|
|
1639
|
+
*
|
|
1640
|
+
* @param path - The file path to save the archive
|
|
1641
|
+
* @param key - Encryption key for the archive
|
|
1642
|
+
* @param opts - Archive options specifying what to include (defaults to consent and messages)
|
|
1643
|
+
* @returns Promise that resolves when the archive is created
|
|
1644
|
+
*/
|
|
1645
|
+
createArchive(path: string, key: Uint8Array, opts?: ArchiveOptions): Promise<void>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Import a previous archive from a file
|
|
1648
|
+
*
|
|
1649
|
+
* @param path - The file path to the archive
|
|
1650
|
+
* @param key - Encryption key for the archive
|
|
1651
|
+
* @returns Promise that resolves when the archive is imported
|
|
1652
|
+
*/
|
|
1653
|
+
importArchive(path: string, key: Uint8Array): Promise<void>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Load the metadata for an archive to see what it contains
|
|
1656
|
+
*
|
|
1657
|
+
* Reads only the metadata without loading the entire file, so this function is quick.
|
|
1658
|
+
*
|
|
1659
|
+
* @param path - The file path to the archive
|
|
1660
|
+
* @param key - Encryption key for the archive
|
|
1661
|
+
* @returns Promise that resolves with the archive metadata
|
|
1662
|
+
*/
|
|
1663
|
+
archiveMetadata(path: string, key: Uint8Array): Promise<ArchiveMetadata>;
|
|
1664
|
+
/**
|
|
1665
|
+
* Manually sync all device sync groups
|
|
1666
|
+
*
|
|
1667
|
+
* @returns Promise that resolves with a summary of the sync operation
|
|
1668
|
+
*/
|
|
1669
|
+
syncAllDeviceSyncGroups(): Promise<GroupSyncSummary>;
|
|
1483
1670
|
}
|
|
1484
1671
|
|
|
1485
|
-
export { AccountAlreadyAssociatedError, ApiUrls, Client, ClientNotInitializedError, Conversation, Conversations, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_DELAY, DecodedMessage, Dm, Group, HistorySyncUrls, InboxReassignError, MissingContentTypeError, SignerUnavailableError, StreamFailedError, StreamInvalidRetryAttemptsError, createStream, generateInboxId, getInboxIdForIdentifier, isActions, isAttachment, isGroupUpdated, isHexString, isIntent, isLeaveRequest, isMarkdown, isMultiRemoteAttachment, isReaction, isReadReceipt, isRemoteAttachment, isReply, isText, isTextReply, isTransactionReference, isWalletSendCalls, validHex };
|
|
1486
|
-
export type { AsyncStreamProxy, BuiltInContentTypes, ClientOptions, ContentOptions, EOASigner, EnrichedReply, ExtractCodecContentTypes, HexString, NetworkOptions, OtherOptions, SCWSigner, Signer, StorageOptions, StreamCallback, StreamFunction, StreamOptions, StreamValueMutator, XmtpEnv };
|
|
1672
|
+
export { AccountAlreadyAssociatedError, ApiUrls, Client, ClientNotInitializedError, Conversation, Conversations, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_DELAY, DecodedMessage, Dm, Group, HistorySyncUrls, InboxReassignError, MissingContentTypeError, SignerUnavailableError, StreamFailedError, StreamInvalidRetryAttemptsError, createBackend, createStream, envToString, generateInboxId, getInboxIdForIdentifier, isActions, isAttachment, isGroupUpdated, isHexString, isIntent, isLeaveRequest, isMarkdown, isMultiRemoteAttachment, isReaction, isReadReceipt, isRemoteAttachment, isReply, isText, isTextReply, isTransactionReference, isWalletSendCalls, validHex };
|
|
1673
|
+
export type { AsyncStreamProxy, BuiltInContentTypes, ClientOptions, ContentOptions, DeviceSyncOptions, EOASigner, EnrichedReply, ExtractCodecContentTypes, HexString, NetworkOptions, OtherOptions, SCWSigner, Signer, StorageOptions, StreamCallback, StreamFunction, StreamOptions, StreamValueMutator, XmtpEnv };
|