@xmtp/browser-sdk 6.0.0 → 6.0.1
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 +9 -9
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/types/options.ts +3 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _xmtp_wasm_bindings from '@xmtp/wasm-bindings';
|
|
2
|
-
import { ContentTypeId as ContentTypeId$1, DeliveryStatus, GroupMessageKind, Reaction, DecodedMessage as DecodedMessage$1, LeaveRequest, ReadReceipt, Attachment, RemoteAttachment, TransactionReference, WalletSendCalls, Actions, Intent, MultiRemoteAttachment, GroupUpdated,
|
|
3
|
-
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, RemoteAttachmentInfo, SendMessageOpts, SignatureRequestHandle, SortDirection, TransactionMetadata, TransactionReference, UserPreferenceUpdate, WalletCall, WalletSendCalls } from '@xmtp/wasm-bindings';
|
|
2
|
+
import { ContentTypeId as ContentTypeId$1, DeliveryStatus, GroupMessageKind, Reaction, DecodedMessage as DecodedMessage$1, LeaveRequest, ReadReceipt, Attachment, RemoteAttachment, TransactionReference, WalletSendCalls, Actions, Intent, MultiRemoteAttachment, GroupUpdated, LogLevel, Identifier, Conversations as Conversations$1, ConsentState, ListConversationsOptions, CreateGroupOptions, CreateDmOptions, Conversation as Conversation$1, ConversationType, Message, Client as Client$1, Consent, ConsentEntityType, UserPreferenceUpdate, SignatureRequestHandle, KeyPackageStatus, GroupMember, PermissionUpdateType, PermissionPolicy, MetadataField, EncodedContent, SendMessageOpts, Reply, ListMessagesOptions, MessageDisappearingSettings, HmacKey, ConversationDebugInfo, GroupPermissionsOptions, PermissionPolicySet, GroupMetadata, ApiStats, IdentityStats, InboxState, GroupSyncSummary } from '@xmtp/wasm-bindings';
|
|
3
|
+
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, RemoteAttachmentInfo, Reply, SendMessageOpts, SignatureRequestHandle, SortDirection, TransactionMetadata, TransactionReference, UserPreferenceUpdate, WalletCall, WalletSendCalls } from '@xmtp/wasm-bindings';
|
|
4
4
|
import { ContentCodec, ContentTypeId } from '@xmtp/content-type-primitives';
|
|
5
5
|
|
|
6
6
|
type ResolveValue<T> = {
|
|
@@ -242,13 +242,13 @@ type OtherOptions = {
|
|
|
242
242
|
appVersion?: string;
|
|
243
243
|
};
|
|
244
244
|
type ClientOptions = NetworkOptions & ContentOptions & StorageOptions & OtherOptions;
|
|
245
|
-
type
|
|
246
|
-
referenceId:
|
|
245
|
+
type EnrichedReply<T = unknown, U = unknown> = {
|
|
246
|
+
referenceId: string;
|
|
247
247
|
content: T;
|
|
248
248
|
inReplyTo: DecodedMessage<U> | null;
|
|
249
249
|
};
|
|
250
250
|
type BuiltInContentTypes = string | LeaveRequest | Reaction | ReadReceipt | Attachment | RemoteAttachment | TransactionReference | WalletSendCalls | Actions | Intent | MultiRemoteAttachment | GroupUpdated;
|
|
251
|
-
type ExtractCodecContentTypes<C extends ContentCodec[] = []> = C extends readonly [] ? BuiltInContentTypes : [...C][number] extends ContentCodec<infer T> ? T | BuiltInContentTypes |
|
|
251
|
+
type ExtractCodecContentTypes<C extends ContentCodec[] = []> = C extends readonly [] ? BuiltInContentTypes : [...C][number] extends ContentCodec<infer T> ? T | BuiltInContentTypes | EnrichedReply<T | BuiltInContentTypes, T | BuiltInContentTypes> : BuiltInContentTypes;
|
|
252
252
|
|
|
253
253
|
type SignMessage = (message: string) => Promise<Uint8Array> | Uint8Array;
|
|
254
254
|
type GetIdentifier = () => Promise<Identifier> | Identifier;
|
|
@@ -408,7 +408,7 @@ declare class WorkerConversation {
|
|
|
408
408
|
sendMarkdown(markdown: string, isOptimistic?: boolean): Promise<string>;
|
|
409
409
|
sendReaction(reaction: Reaction, isOptimistic?: boolean): Promise<string>;
|
|
410
410
|
sendReadReceipt(isOptimistic?: boolean): Promise<string>;
|
|
411
|
-
sendReply(reply: Reply
|
|
411
|
+
sendReply(reply: Reply, isOptimistic?: boolean): Promise<string>;
|
|
412
412
|
sendTransactionReference(transactionReference: TransactionReference, isOptimistic?: boolean): Promise<string>;
|
|
413
413
|
sendWalletSendCalls(walletSendCalls: WalletSendCalls, isOptimistic?: boolean): Promise<string>;
|
|
414
414
|
sendActions(actions: Actions, isOptimistic?: boolean): Promise<string>;
|
|
@@ -825,7 +825,7 @@ type ConversationAction = {
|
|
|
825
825
|
result: string;
|
|
826
826
|
data: {
|
|
827
827
|
id: string;
|
|
828
|
-
reply: Reply
|
|
828
|
+
reply: Reply;
|
|
829
829
|
isOptimistic?: boolean;
|
|
830
830
|
};
|
|
831
831
|
} | {
|
|
@@ -1454,7 +1454,7 @@ declare class Conversation<ContentTypes = unknown> {
|
|
|
1454
1454
|
* @param isOptimistic - Whether to send the message optimistically
|
|
1455
1455
|
* @returns Promise that resolves with the message ID after it has been sent
|
|
1456
1456
|
*/
|
|
1457
|
-
sendReply(reply: Reply
|
|
1457
|
+
sendReply(reply: Reply, isOptimistic?: boolean): Promise<string>;
|
|
1458
1458
|
/**
|
|
1459
1459
|
* Sends a transaction reference message
|
|
1460
1460
|
*
|
|
@@ -2522,4 +2522,4 @@ declare class OpfsInitializationError extends Error {
|
|
|
2522
2522
|
}
|
|
2523
2523
|
|
|
2524
2524
|
export { AccountAlreadyAssociatedError, ApiUrls, Client, ClientNotInitializedError, Conversation, Conversations, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_DELAY, DecodedMessage, Dm, Group, GroupNotFoundError, HistorySyncUrls, InboxReassignError, Opfs, OpfsInitializationError, OpfsNotInitializedError, SignerUnavailableError, StreamFailedError, StreamInvalidRetryAttemptsError, StreamNotFoundError, contentTypeActions, contentTypeAttachment, contentTypeGroupUpdated, contentTypeIntent, contentTypeLeaveRequest, contentTypeMarkdown, contentTypeMultiRemoteAttachment, contentTypeReaction, contentTypeReadReceipt, contentTypeRemoteAttachment, contentTypeReply, contentTypeText, contentTypeTransactionReference, contentTypeWalletSendCalls, createStream, decryptAttachment, encodeActions, encodeAttachment, encodeIntent, encodeMarkdown, encodeMultiRemoteAttachment, encodeReaction, encodeReadReceipt, encodeRemoteAttachment, encodeText, encodeTransactionReference, encodeWalletSendCalls, encryptAttachment, generateInboxId, getInboxIdForIdentifier, metadataFieldName, toSafeConversation, toSafeSigner };
|
|
2525
|
-
export type { AsyncStreamProxy, BuiltInContentTypes, ClientOptions, ContentOptions, EOASigner, ExtractCodecContentTypes, HmacKeys, LastReadTimes, NetworkOptions, OtherOptions,
|
|
2525
|
+
export type { AsyncStreamProxy, BuiltInContentTypes, ClientOptions, ContentOptions, EOASigner, EnrichedReply, ExtractCodecContentTypes, HmacKeys, LastReadTimes, NetworkOptions, OtherOptions, SCWSigner, SafeConversation, SafeSigner, Signer, StorageOptions, StreamCallback, StreamFunction, StreamOptions, StreamValueMutator, XmtpEnv };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/types/options.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { ContentCodec } from "@xmtp/content-type-primitives";
|
|
|
2
2
|
import type {
|
|
3
3
|
Actions,
|
|
4
4
|
Attachment,
|
|
5
|
-
EnrichedReply,
|
|
6
5
|
GroupUpdated,
|
|
7
6
|
Intent,
|
|
8
7
|
LeaveRequest,
|
|
@@ -110,8 +109,8 @@ export type ClientOptions = NetworkOptions &
|
|
|
110
109
|
StorageOptions &
|
|
111
110
|
OtherOptions;
|
|
112
111
|
|
|
113
|
-
export type
|
|
114
|
-
referenceId:
|
|
112
|
+
export type EnrichedReply<T = unknown, U = unknown> = {
|
|
113
|
+
referenceId: string;
|
|
115
114
|
content: T;
|
|
116
115
|
inReplyTo: DecodedMessage<U> | null;
|
|
117
116
|
};
|
|
@@ -137,5 +136,5 @@ export type ExtractCodecContentTypes<C extends ContentCodec[] = []> =
|
|
|
137
136
|
?
|
|
138
137
|
| T
|
|
139
138
|
| BuiltInContentTypes
|
|
140
|
-
|
|
|
139
|
+
| EnrichedReply<T | BuiltInContentTypes, T | BuiltInContentTypes>
|
|
141
140
|
: BuiltInContentTypes;
|