@xmtp/browser-sdk 5.2.0 → 6.0.0
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 +587 -670
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/workers/client.js +1 -1
- package/dist/workers/client.js.map +1 -1
- package/dist/workers/opfs.js +2 -0
- package/dist/workers/opfs.js.map +1 -0
- package/package.json +12 -16
- package/src/Client.ts +92 -219
- package/src/CodecRegistry.ts +27 -0
- package/src/Conversation.ts +275 -104
- package/src/Conversations.ts +188 -99
- package/src/DebugInformation.ts +10 -27
- package/src/DecodedMessage.ts +155 -58
- package/src/Dm.ts +25 -9
- package/src/Group.ts +69 -26
- package/src/Opfs.ts +63 -0
- package/src/Preferences.ts +68 -52
- package/src/WorkerClient.ts +5 -5
- package/src/WorkerConversation.ts +119 -44
- package/src/WorkerConversations.ts +35 -74
- package/src/WorkerDebugInformation.ts +1 -12
- package/src/WorkerPreferences.ts +6 -14
- package/src/index.ts +53 -24
- package/src/types/actions/client.ts +6 -17
- package/src/types/actions/conversation.ts +160 -31
- package/src/types/actions/conversations.ts +21 -24
- package/src/types/actions/debugInformation.ts +3 -11
- package/src/types/actions/dm.ts +1 -1
- package/src/types/actions/group.ts +25 -0
- package/src/types/actions/opfs.ts +66 -0
- package/src/types/actions/preferences.ts +6 -13
- package/src/types/actions/streams.ts +8 -8
- package/src/types/actions.ts +11 -9
- package/src/types/options.ts +47 -6
- package/src/{ClientWorkerClass.ts → utils/WorkerBridge.ts} +35 -45
- package/src/utils/contentTypes.ts +77 -0
- package/src/utils/conversions.ts +18 -588
- package/src/utils/createClient.ts +16 -11
- package/src/utils/errors.ts +13 -19
- package/src/utils/inboxId.ts +46 -0
- package/src/utils/inboxState.ts +23 -0
- package/src/utils/installations.ts +95 -0
- package/src/utils/metadata.ts +15 -0
- package/src/utils/signer.ts +4 -4
- package/src/utils/uuid.ts +8 -0
- package/src/workers/client.ts +191 -132
- package/src/workers/opfs.ts +127 -0
- package/dist/workers/utils.js +0 -2
- package/dist/workers/utils.js.map +0 -1
- package/src/Utils.ts +0 -143
- package/src/UtilsWorkerClass.ts +0 -121
- package/src/types/actions/utils.ts +0 -69
- package/src/workers/utils.ts +0 -155
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { Client } from "@xmtp/wasm-bindings";
|
|
2
|
-
import { HistorySyncUrls } from "@/constants";
|
|
3
|
-
import type { ClientOptions } from "@/types/options";
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Debug information helpers for the client
|
|
@@ -9,11 +7,9 @@ import type { ClientOptions } from "@/types/options";
|
|
|
9
7
|
*/
|
|
10
8
|
export class WorkerDebugInformation {
|
|
11
9
|
#client: Client;
|
|
12
|
-
#options?: ClientOptions;
|
|
13
10
|
|
|
14
|
-
constructor(client: Client
|
|
11
|
+
constructor(client: Client) {
|
|
15
12
|
this.#client = client;
|
|
16
|
-
this.#options = options;
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
apiStatistics() {
|
|
@@ -31,11 +27,4 @@ export class WorkerDebugInformation {
|
|
|
31
27
|
clearAllStatistics() {
|
|
32
28
|
this.#client.clearAllStatistics();
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
uploadDebugArchive(serverUrl?: string) {
|
|
36
|
-
const env = this.#options?.env || "dev";
|
|
37
|
-
const historySyncUrl =
|
|
38
|
-
this.#options?.historySyncUrl || HistorySyncUrls[env];
|
|
39
|
-
return this.#client.uploadDebugArchive(serverUrl || historySyncUrl);
|
|
40
|
-
}
|
|
41
30
|
}
|
package/src/WorkerPreferences.ts
CHANGED
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
type Consent,
|
|
4
4
|
type ConsentEntityType,
|
|
5
5
|
type Conversations,
|
|
6
|
-
type
|
|
6
|
+
type UserPreferenceUpdate,
|
|
7
7
|
} from "@xmtp/wasm-bindings";
|
|
8
|
-
import { fromSafeConsent, type SafeConsent } from "@/utils/conversions";
|
|
9
8
|
import type { StreamCallback } from "@/utils/streams";
|
|
10
9
|
|
|
11
10
|
export class WorkerPreferences {
|
|
@@ -25,22 +24,15 @@ export class WorkerPreferences {
|
|
|
25
24
|
return this.#client.inboxState(refreshFromNetwork);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
async
|
|
29
|
-
inboxIds: string[],
|
|
30
|
-
refreshFromNetwork?: boolean,
|
|
31
|
-
) {
|
|
27
|
+
async getInboxStates(inboxIds: string[], refreshFromNetwork?: boolean) {
|
|
32
28
|
return this.#client.inboxStateFromInboxIds(
|
|
33
29
|
inboxIds,
|
|
34
30
|
refreshFromNetwork ?? false,
|
|
35
31
|
);
|
|
36
32
|
}
|
|
37
33
|
|
|
38
|
-
async
|
|
39
|
-
return this.#client.
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async setConsentStates(records: SafeConsent[]) {
|
|
43
|
-
return this.#client.setConsentStates(records.map(fromSafeConsent));
|
|
34
|
+
async setConsentStates(records: Consent[]) {
|
|
35
|
+
return this.#client.setConsentStates(records);
|
|
44
36
|
}
|
|
45
37
|
|
|
46
38
|
async getConsentState(entityType: ConsentEntityType, entity: string) {
|
|
@@ -65,10 +57,10 @@ export class WorkerPreferences {
|
|
|
65
57
|
}
|
|
66
58
|
|
|
67
59
|
streamPreferences(
|
|
68
|
-
callback: StreamCallback<
|
|
60
|
+
callback: StreamCallback<UserPreferenceUpdate[]>,
|
|
69
61
|
onFail: () => void,
|
|
70
62
|
) {
|
|
71
|
-
const on_user_preference_update = (preferences:
|
|
63
|
+
const on_user_preference_update = (preferences: UserPreferenceUpdate[]) => {
|
|
72
64
|
callback(null, preferences);
|
|
73
65
|
};
|
|
74
66
|
const on_error = (error: Error | null) => {
|
package/src/index.ts
CHANGED
|
@@ -1,57 +1,86 @@
|
|
|
1
1
|
export { Client } from "./Client";
|
|
2
|
-
export
|
|
2
|
+
export { Opfs } from "./Opfs";
|
|
3
3
|
export { Conversations } from "./Conversations";
|
|
4
4
|
export { Conversation } from "./Conversation";
|
|
5
5
|
export { Dm } from "./Dm";
|
|
6
6
|
export { Group } from "./Group";
|
|
7
|
-
export type { MessageDeliveryStatus, MessageKind } from "./DecodedMessage";
|
|
8
7
|
export { DecodedMessage } from "./DecodedMessage";
|
|
9
|
-
export {
|
|
8
|
+
export { generateInboxId, getInboxIdForIdentifier } from "./utils/inboxId";
|
|
9
|
+
export { metadataFieldName } from "./utils/metadata";
|
|
10
10
|
export { ApiUrls, HistorySyncUrls } from "./constants";
|
|
11
11
|
export type * from "./types/options";
|
|
12
12
|
export * from "./utils/conversions";
|
|
13
|
+
export * from "./utils/contentTypes";
|
|
13
14
|
export type { AsyncStreamProxy } from "./AsyncStream";
|
|
14
15
|
export type {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} from "@xmtp/wasm-bindings";
|
|
20
|
-
export {
|
|
16
|
+
Action,
|
|
17
|
+
Actions,
|
|
18
|
+
ApiStats,
|
|
19
|
+
Attachment,
|
|
21
20
|
Consent,
|
|
22
|
-
|
|
23
|
-
ConsentState,
|
|
24
|
-
ContentType,
|
|
25
|
-
ContentTypeId,
|
|
21
|
+
ConversationDebugInfo,
|
|
26
22
|
ConversationListItem,
|
|
27
|
-
|
|
28
|
-
CreateDMOptions,
|
|
23
|
+
CreateDmOptions,
|
|
29
24
|
CreateGroupOptions,
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
Cursor,
|
|
26
|
+
EncryptedAttachment,
|
|
32
27
|
GroupMember,
|
|
33
|
-
GroupMembershipState,
|
|
34
|
-
GroupMessageKind,
|
|
35
28
|
GroupMetadata,
|
|
36
29
|
GroupPermissions,
|
|
37
|
-
|
|
30
|
+
GroupSyncSummary,
|
|
31
|
+
GroupUpdated,
|
|
38
32
|
HmacKey,
|
|
33
|
+
Identifier,
|
|
34
|
+
IdentityStats,
|
|
35
|
+
Inbox,
|
|
39
36
|
InboxState,
|
|
40
37
|
Installation,
|
|
38
|
+
Intent,
|
|
39
|
+
KeyPackageStatus,
|
|
40
|
+
LeaveRequest,
|
|
41
|
+
Lifetime,
|
|
41
42
|
ListConversationsOptions,
|
|
42
43
|
ListMessagesOptions,
|
|
43
44
|
LogOptions,
|
|
44
45
|
Message,
|
|
45
46
|
MessageDisappearingSettings,
|
|
47
|
+
MetadataFieldChange,
|
|
48
|
+
MultiRemoteAttachment,
|
|
49
|
+
PermissionPolicySet,
|
|
50
|
+
Reaction,
|
|
51
|
+
ReadReceipt,
|
|
52
|
+
RemoteAttachment,
|
|
53
|
+
RemoteAttachmentInfo,
|
|
54
|
+
SendMessageOpts,
|
|
55
|
+
SignatureRequestHandle,
|
|
56
|
+
TransactionMetadata,
|
|
57
|
+
TransactionReference,
|
|
58
|
+
UserPreferenceUpdate,
|
|
59
|
+
WalletCall,
|
|
60
|
+
WalletSendCalls,
|
|
61
|
+
} from "@xmtp/wasm-bindings";
|
|
62
|
+
export {
|
|
63
|
+
ActionStyle,
|
|
64
|
+
ConsentEntityType,
|
|
65
|
+
ConsentState,
|
|
66
|
+
ContentType,
|
|
67
|
+
ConversationType,
|
|
68
|
+
DeliveryStatus,
|
|
69
|
+
GroupMembershipState,
|
|
70
|
+
GroupMessageKind,
|
|
71
|
+
GroupPermissionsOptions,
|
|
72
|
+
IdentifierKind,
|
|
73
|
+
ListConversationsOrderBy,
|
|
74
|
+
LogLevel,
|
|
75
|
+
MessageSortBy,
|
|
46
76
|
MetadataField,
|
|
47
77
|
PermissionLevel,
|
|
48
78
|
PermissionPolicy,
|
|
49
|
-
PermissionPolicySet,
|
|
50
79
|
PermissionUpdateType,
|
|
51
|
-
|
|
80
|
+
ReactionAction,
|
|
81
|
+
ReactionSchema,
|
|
52
82
|
SortDirection,
|
|
53
83
|
} from "@xmtp/wasm-bindings";
|
|
54
|
-
export
|
|
55
|
-
export { toSafeSigner } from "./utils/signer";
|
|
84
|
+
export * from "./utils/signer";
|
|
56
85
|
export * from "./utils/errors";
|
|
57
86
|
export type * from "./utils/streams";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Identifier } from "@xmtp/wasm-bindings";
|
|
1
|
+
import type { Identifier, KeyPackageStatus } from "@xmtp/wasm-bindings";
|
|
2
2
|
import type { ClientOptions } from "@/types/options";
|
|
3
|
-
import type { SafeKeyPackageStatus } from "@/utils/conversions";
|
|
4
3
|
import type { SafeSigner } from "@/utils/signer";
|
|
5
4
|
|
|
6
5
|
export type ClientAction =
|
|
@@ -8,9 +7,11 @@ export type ClientAction =
|
|
|
8
7
|
action: "client.init";
|
|
9
8
|
id: string;
|
|
10
9
|
result: {
|
|
10
|
+
appVersion: string;
|
|
11
11
|
inboxId: string;
|
|
12
12
|
installationId: string;
|
|
13
13
|
installationIdBytes: Uint8Array;
|
|
14
|
+
libxmtpVersion: string;
|
|
14
15
|
};
|
|
15
16
|
data: {
|
|
16
17
|
identifier: Identifier;
|
|
@@ -169,7 +170,7 @@ export type ClientAction =
|
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
172
|
| {
|
|
172
|
-
action: "client.
|
|
173
|
+
action: "client.getInboxIdByIdentifier";
|
|
173
174
|
id: string;
|
|
174
175
|
result: string | undefined;
|
|
175
176
|
data: {
|
|
@@ -204,22 +205,10 @@ export type ClientAction =
|
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
207
|
| {
|
|
207
|
-
action: "client.
|
|
208
|
+
action: "client.fetchKeyPackageStatuses";
|
|
208
209
|
id: string;
|
|
209
|
-
result: Map<string,
|
|
210
|
+
result: Map<string, KeyPackageStatus>;
|
|
210
211
|
data: {
|
|
211
212
|
installationIds: string[];
|
|
212
213
|
};
|
|
213
|
-
}
|
|
214
|
-
| {
|
|
215
|
-
action: "client.libxmtpVersion";
|
|
216
|
-
id: string;
|
|
217
|
-
result: string;
|
|
218
|
-
data: undefined;
|
|
219
|
-
}
|
|
220
|
-
| {
|
|
221
|
-
action: "client.appVersion";
|
|
222
|
-
id: string;
|
|
223
|
-
result: string;
|
|
224
|
-
data: undefined;
|
|
225
214
|
};
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import type { ConsentState } from "@xmtp/wasm-bindings";
|
|
2
1
|
import type {
|
|
2
|
+
Actions,
|
|
3
|
+
Attachment,
|
|
4
|
+
ConsentState,
|
|
5
|
+
ConversationDebugInfo,
|
|
6
|
+
DecodedMessage,
|
|
7
|
+
EncodedContent,
|
|
8
|
+
GroupMember,
|
|
9
|
+
Intent,
|
|
10
|
+
ListMessagesOptions,
|
|
11
|
+
MessageDisappearingSettings,
|
|
12
|
+
MultiRemoteAttachment,
|
|
13
|
+
Reaction,
|
|
14
|
+
RemoteAttachment,
|
|
15
|
+
Reply,
|
|
16
|
+
SendMessageOpts,
|
|
17
|
+
TransactionReference,
|
|
18
|
+
WalletSendCalls,
|
|
19
|
+
} from "@xmtp/wasm-bindings";
|
|
20
|
+
import type {
|
|
21
|
+
HmacKeys,
|
|
22
|
+
LastReadTimes,
|
|
3
23
|
SafeConversation,
|
|
4
|
-
SafeConversationDebugInfo,
|
|
5
|
-
SafeEncodedContent,
|
|
6
|
-
SafeGroupMember,
|
|
7
|
-
SafeHmacKey,
|
|
8
|
-
SafeListMessagesOptions,
|
|
9
|
-
SafeMessage,
|
|
10
|
-
SafeMessageDisappearingSettings,
|
|
11
|
-
SafeSendMessageOpts,
|
|
12
24
|
} from "@/utils/conversions";
|
|
13
25
|
|
|
14
26
|
export type ConversationAction =
|
|
@@ -26,18 +38,8 @@ export type ConversationAction =
|
|
|
26
38
|
result: string;
|
|
27
39
|
data: {
|
|
28
40
|
id: string;
|
|
29
|
-
content:
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
| {
|
|
34
|
-
action: "conversation.sendOptimistic";
|
|
35
|
-
id: string;
|
|
36
|
-
result: string;
|
|
37
|
-
data: {
|
|
38
|
-
id: string;
|
|
39
|
-
content: SafeEncodedContent;
|
|
40
|
-
sendOptions: SafeSendMessageOpts;
|
|
41
|
+
content: EncodedContent;
|
|
42
|
+
options?: SendMessageOpts;
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
45
|
| {
|
|
@@ -51,10 +53,10 @@ export type ConversationAction =
|
|
|
51
53
|
| {
|
|
52
54
|
action: "conversation.messages";
|
|
53
55
|
id: string;
|
|
54
|
-
result:
|
|
56
|
+
result: DecodedMessage[];
|
|
55
57
|
data: {
|
|
56
58
|
id: string;
|
|
57
|
-
options?:
|
|
59
|
+
options?: ListMessagesOptions;
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
| {
|
|
@@ -63,13 +65,13 @@ export type ConversationAction =
|
|
|
63
65
|
result: bigint;
|
|
64
66
|
data: {
|
|
65
67
|
id: string;
|
|
66
|
-
options?: Omit<
|
|
68
|
+
options?: Omit<ListMessagesOptions, "limit" | "direction">;
|
|
67
69
|
};
|
|
68
70
|
}
|
|
69
71
|
| {
|
|
70
72
|
action: "conversation.members";
|
|
71
73
|
id: string;
|
|
72
|
-
result:
|
|
74
|
+
result: GroupMember[];
|
|
73
75
|
data: {
|
|
74
76
|
id: string;
|
|
75
77
|
};
|
|
@@ -77,7 +79,7 @@ export type ConversationAction =
|
|
|
77
79
|
| {
|
|
78
80
|
action: "conversation.messageDisappearingSettings";
|
|
79
81
|
id: string;
|
|
80
|
-
result:
|
|
82
|
+
result: MessageDisappearingSettings | undefined;
|
|
81
83
|
data: {
|
|
82
84
|
id: string;
|
|
83
85
|
};
|
|
@@ -86,7 +88,7 @@ export type ConversationAction =
|
|
|
86
88
|
action: "conversation.updateMessageDisappearingSettings";
|
|
87
89
|
id: string;
|
|
88
90
|
result: undefined;
|
|
89
|
-
data:
|
|
91
|
+
data: MessageDisappearingSettings & {
|
|
90
92
|
id: string;
|
|
91
93
|
};
|
|
92
94
|
}
|
|
@@ -124,9 +126,9 @@ export type ConversationAction =
|
|
|
124
126
|
};
|
|
125
127
|
}
|
|
126
128
|
| {
|
|
127
|
-
action: "conversation.
|
|
129
|
+
action: "conversation.hmacKeys";
|
|
128
130
|
id: string;
|
|
129
|
-
result:
|
|
131
|
+
result: HmacKeys;
|
|
130
132
|
data: {
|
|
131
133
|
id: string;
|
|
132
134
|
};
|
|
@@ -134,7 +136,7 @@ export type ConversationAction =
|
|
|
134
136
|
| {
|
|
135
137
|
action: "conversation.debugInfo";
|
|
136
138
|
id: string;
|
|
137
|
-
result:
|
|
139
|
+
result: ConversationDebugInfo;
|
|
138
140
|
data: {
|
|
139
141
|
id: string;
|
|
140
142
|
};
|
|
@@ -159,7 +161,7 @@ export type ConversationAction =
|
|
|
159
161
|
| {
|
|
160
162
|
action: "conversation.lastMessage";
|
|
161
163
|
id: string;
|
|
162
|
-
result:
|
|
164
|
+
result: DecodedMessage | undefined;
|
|
163
165
|
data: {
|
|
164
166
|
id: string;
|
|
165
167
|
};
|
|
@@ -171,4 +173,131 @@ export type ConversationAction =
|
|
|
171
173
|
data: {
|
|
172
174
|
id: string;
|
|
173
175
|
};
|
|
176
|
+
}
|
|
177
|
+
| {
|
|
178
|
+
action: "conversation.lastReadTimes";
|
|
179
|
+
id: string;
|
|
180
|
+
result: LastReadTimes;
|
|
181
|
+
data: {
|
|
182
|
+
id: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
| {
|
|
186
|
+
action: "conversation.sendText";
|
|
187
|
+
id: string;
|
|
188
|
+
result: string;
|
|
189
|
+
data: {
|
|
190
|
+
id: string;
|
|
191
|
+
text: string;
|
|
192
|
+
isOptimistic?: boolean;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
| {
|
|
196
|
+
action: "conversation.sendMarkdown";
|
|
197
|
+
id: string;
|
|
198
|
+
result: string;
|
|
199
|
+
data: {
|
|
200
|
+
id: string;
|
|
201
|
+
markdown: string;
|
|
202
|
+
isOptimistic?: boolean;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
| {
|
|
206
|
+
action: "conversation.sendReaction";
|
|
207
|
+
id: string;
|
|
208
|
+
result: string;
|
|
209
|
+
data: {
|
|
210
|
+
id: string;
|
|
211
|
+
reaction: Reaction;
|
|
212
|
+
isOptimistic?: boolean;
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
| {
|
|
216
|
+
action: "conversation.sendReadReceipt";
|
|
217
|
+
id: string;
|
|
218
|
+
result: string;
|
|
219
|
+
data: {
|
|
220
|
+
id: string;
|
|
221
|
+
isOptimistic?: boolean;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
| {
|
|
225
|
+
action: "conversation.sendReply";
|
|
226
|
+
id: string;
|
|
227
|
+
result: string;
|
|
228
|
+
data: {
|
|
229
|
+
id: string;
|
|
230
|
+
reply: Reply;
|
|
231
|
+
isOptimistic?: boolean;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
| {
|
|
235
|
+
action: "conversation.sendTransactionReference";
|
|
236
|
+
id: string;
|
|
237
|
+
result: string;
|
|
238
|
+
data: {
|
|
239
|
+
id: string;
|
|
240
|
+
transactionReference: TransactionReference;
|
|
241
|
+
isOptimistic?: boolean;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
| {
|
|
245
|
+
action: "conversation.sendWalletSendCalls";
|
|
246
|
+
id: string;
|
|
247
|
+
result: string;
|
|
248
|
+
data: {
|
|
249
|
+
id: string;
|
|
250
|
+
walletSendCalls: WalletSendCalls;
|
|
251
|
+
isOptimistic?: boolean;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
| {
|
|
255
|
+
action: "conversation.sendActions";
|
|
256
|
+
id: string;
|
|
257
|
+
result: string;
|
|
258
|
+
data: {
|
|
259
|
+
id: string;
|
|
260
|
+
actions: Actions;
|
|
261
|
+
isOptimistic?: boolean;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
| {
|
|
265
|
+
action: "conversation.sendIntent";
|
|
266
|
+
id: string;
|
|
267
|
+
result: string;
|
|
268
|
+
data: {
|
|
269
|
+
id: string;
|
|
270
|
+
intent: Intent;
|
|
271
|
+
isOptimistic?: boolean;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
| {
|
|
275
|
+
action: "conversation.sendAttachment";
|
|
276
|
+
id: string;
|
|
277
|
+
result: string;
|
|
278
|
+
data: {
|
|
279
|
+
id: string;
|
|
280
|
+
attachment: Attachment;
|
|
281
|
+
isOptimistic?: boolean;
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
| {
|
|
285
|
+
action: "conversation.sendMultiRemoteAttachment";
|
|
286
|
+
id: string;
|
|
287
|
+
result: string;
|
|
288
|
+
data: {
|
|
289
|
+
id: string;
|
|
290
|
+
multiRemoteAttachment: MultiRemoteAttachment;
|
|
291
|
+
isOptimistic?: boolean;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
| {
|
|
295
|
+
action: "conversation.sendRemoteAttachment";
|
|
296
|
+
id: string;
|
|
297
|
+
result: string;
|
|
298
|
+
data: {
|
|
299
|
+
id: string;
|
|
300
|
+
remoteAttachment: RemoteAttachment;
|
|
301
|
+
isOptimistic?: boolean;
|
|
302
|
+
};
|
|
174
303
|
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ConsentState,
|
|
3
3
|
ConversationType,
|
|
4
|
+
CreateDmOptions,
|
|
5
|
+
CreateGroupOptions,
|
|
6
|
+
DecodedMessage,
|
|
4
7
|
Identifier,
|
|
8
|
+
ListConversationsOptions,
|
|
5
9
|
} from "@xmtp/wasm-bindings";
|
|
6
|
-
import type {
|
|
7
|
-
SafeConversation,
|
|
8
|
-
SafeCreateDmOptions,
|
|
9
|
-
SafeCreateGroupOptions,
|
|
10
|
-
SafeHmacKeys,
|
|
11
|
-
SafeListConversationsOptions,
|
|
12
|
-
SafeMessage,
|
|
13
|
-
} from "@/utils/conversions";
|
|
10
|
+
import type { HmacKeys, SafeConversation } from "@/utils/conversions";
|
|
14
11
|
|
|
15
12
|
export type ConversationsAction =
|
|
16
13
|
| {
|
|
@@ -24,7 +21,7 @@ export type ConversationsAction =
|
|
|
24
21
|
| {
|
|
25
22
|
action: "conversations.getMessageById";
|
|
26
23
|
id: string;
|
|
27
|
-
result:
|
|
24
|
+
result: DecodedMessage | undefined;
|
|
28
25
|
data: {
|
|
29
26
|
id: string;
|
|
30
27
|
};
|
|
@@ -42,7 +39,7 @@ export type ConversationsAction =
|
|
|
42
39
|
id: string;
|
|
43
40
|
result: SafeConversation[];
|
|
44
41
|
data: {
|
|
45
|
-
options?:
|
|
42
|
+
options?: ListConversationsOptions;
|
|
46
43
|
};
|
|
47
44
|
}
|
|
48
45
|
| {
|
|
@@ -50,7 +47,7 @@ export type ConversationsAction =
|
|
|
50
47
|
id: string;
|
|
51
48
|
result: SafeConversation[];
|
|
52
49
|
data: {
|
|
53
|
-
options?: Omit<
|
|
50
|
+
options?: Omit<ListConversationsOptions, "conversationType">;
|
|
54
51
|
};
|
|
55
52
|
}
|
|
56
53
|
| {
|
|
@@ -58,51 +55,51 @@ export type ConversationsAction =
|
|
|
58
55
|
id: string;
|
|
59
56
|
result: SafeConversation[];
|
|
60
57
|
data: {
|
|
61
|
-
options?: Omit<
|
|
58
|
+
options?: Omit<ListConversationsOptions, "conversationType">;
|
|
62
59
|
};
|
|
63
60
|
}
|
|
64
61
|
| {
|
|
65
|
-
action: "conversations.
|
|
62
|
+
action: "conversations.createGroupOptimistic";
|
|
66
63
|
id: string;
|
|
67
64
|
result: SafeConversation;
|
|
68
65
|
data: {
|
|
69
|
-
options?:
|
|
66
|
+
options?: CreateGroupOptions;
|
|
70
67
|
};
|
|
71
68
|
}
|
|
72
69
|
| {
|
|
73
|
-
action: "conversations.
|
|
70
|
+
action: "conversations.createGroupWithIdentifiers";
|
|
74
71
|
id: string;
|
|
75
72
|
result: SafeConversation;
|
|
76
73
|
data: {
|
|
77
74
|
identifiers: Identifier[];
|
|
78
|
-
options?:
|
|
75
|
+
options?: CreateGroupOptions;
|
|
79
76
|
};
|
|
80
77
|
}
|
|
81
78
|
| {
|
|
82
|
-
action: "conversations.
|
|
79
|
+
action: "conversations.createGroup";
|
|
83
80
|
id: string;
|
|
84
81
|
result: SafeConversation;
|
|
85
82
|
data: {
|
|
86
83
|
inboxIds: string[];
|
|
87
|
-
options?:
|
|
84
|
+
options?: CreateGroupOptions;
|
|
88
85
|
};
|
|
89
86
|
}
|
|
90
87
|
| {
|
|
91
|
-
action: "conversations.
|
|
88
|
+
action: "conversations.createDmWithIdentifier";
|
|
92
89
|
id: string;
|
|
93
90
|
result: SafeConversation;
|
|
94
91
|
data: {
|
|
95
92
|
identifier: Identifier;
|
|
96
|
-
options?:
|
|
93
|
+
options?: CreateDmOptions;
|
|
97
94
|
};
|
|
98
95
|
}
|
|
99
96
|
| {
|
|
100
|
-
action: "conversations.
|
|
97
|
+
action: "conversations.createDm";
|
|
101
98
|
id: string;
|
|
102
99
|
result: SafeConversation;
|
|
103
100
|
data: {
|
|
104
101
|
inboxId: string;
|
|
105
|
-
options?:
|
|
102
|
+
options?: CreateDmOptions;
|
|
106
103
|
};
|
|
107
104
|
}
|
|
108
105
|
| {
|
|
@@ -120,9 +117,9 @@ export type ConversationsAction =
|
|
|
120
117
|
};
|
|
121
118
|
}
|
|
122
119
|
| {
|
|
123
|
-
action: "conversations.
|
|
120
|
+
action: "conversations.hmacKeys";
|
|
124
121
|
id: string;
|
|
125
|
-
result:
|
|
122
|
+
result: HmacKeys;
|
|
126
123
|
data: undefined;
|
|
127
124
|
}
|
|
128
125
|
| {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiStats, IdentityStats } from "@xmtp/wasm-bindings";
|
|
2
2
|
|
|
3
3
|
export type DebugInformationAction =
|
|
4
4
|
| {
|
|
5
5
|
action: "debugInformation.apiStatistics";
|
|
6
6
|
id: string;
|
|
7
|
-
result:
|
|
7
|
+
result: ApiStats;
|
|
8
8
|
data: undefined;
|
|
9
9
|
}
|
|
10
10
|
| {
|
|
11
11
|
action: "debugInformation.apiIdentityStatistics";
|
|
12
12
|
id: string;
|
|
13
|
-
result:
|
|
13
|
+
result: IdentityStats;
|
|
14
14
|
data: undefined;
|
|
15
15
|
}
|
|
16
16
|
| {
|
|
@@ -24,12 +24,4 @@ export type DebugInformationAction =
|
|
|
24
24
|
id: string;
|
|
25
25
|
result: undefined;
|
|
26
26
|
data: undefined;
|
|
27
|
-
}
|
|
28
|
-
| {
|
|
29
|
-
action: "debugInformation.uploadDebugArchive";
|
|
30
|
-
id: string;
|
|
31
|
-
result: string;
|
|
32
|
-
data: {
|
|
33
|
-
serverUrl?: string;
|
|
34
|
-
};
|
|
35
27
|
};
|