@xmtp/browser-sdk 2.0.12 → 2.1.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 +910 -735
- 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/utils.js +1 -1
- package/dist/workers/utils.js.map +1 -1
- package/package.json +9 -11
- package/src/AsyncStream.ts +3 -1
- package/src/Client.ts +71 -31
- package/src/ClientWorkerClass.ts +62 -19
- package/src/Conversation.ts +60 -33
- package/src/Conversations.ts +96 -48
- package/src/DecodedMessage.ts +8 -5
- package/src/Dm.ts +14 -4
- package/src/Group.ts +27 -20
- package/src/Preferences.ts +21 -10
- package/src/Utils.ts +2 -2
- package/src/UtilsWorkerClass.ts +56 -15
- package/src/WorkerClient.ts +25 -3
- package/src/WorkerConversation.ts +11 -2
- package/src/WorkerConversations.ts +19 -4
- package/src/WorkerPreferences.ts +4 -0
- package/src/index.ts +4 -1
- package/src/types/actions/client.ts +181 -0
- package/src/types/actions/conversation.ts +146 -0
- package/src/types/actions/conversations.ts +146 -0
- package/src/types/actions/dm.ts +19 -0
- package/src/types/actions/group.ts +161 -0
- package/src/types/actions/preferences.ts +68 -0
- package/src/types/actions/streams.ts +44 -0
- package/src/types/actions/utils.ts +29 -0
- package/src/types/actions.ts +75 -0
- package/src/types/options.ts +18 -0
- package/src/utils/conversions.ts +60 -0
- package/src/utils/createClient.ts +6 -1
- package/src/utils/errors.ts +3 -1
- package/src/workers/client.ts +243 -190
- package/src/workers/utils.ts +25 -29
- package/src/types/clientEvents.ts +0 -693
- package/src/types/clientStreamEvents.ts +0 -45
- package/src/types/index.ts +0 -4
- package/src/types/utils.ts +0 -72
- package/src/types/utilsEvents.ts +0 -60
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { Identifier, SignatureRequestType } from "@xmtp/wasm-bindings";
|
|
2
|
+
import type { ClientOptions } from "@/types/options";
|
|
3
|
+
import type {
|
|
4
|
+
SafeApiStats,
|
|
5
|
+
SafeIdentityStats,
|
|
6
|
+
SafeKeyPackageStatus,
|
|
7
|
+
} from "@/utils/conversions";
|
|
8
|
+
|
|
9
|
+
export type ClientAction =
|
|
10
|
+
| {
|
|
11
|
+
action: "client.init";
|
|
12
|
+
id: string;
|
|
13
|
+
result: {
|
|
14
|
+
inboxId: string;
|
|
15
|
+
installationId: string;
|
|
16
|
+
installationIdBytes: Uint8Array;
|
|
17
|
+
};
|
|
18
|
+
data: {
|
|
19
|
+
identifier: Identifier;
|
|
20
|
+
options?: ClientOptions;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
| {
|
|
24
|
+
action: "client.createInboxSignatureText";
|
|
25
|
+
id: string;
|
|
26
|
+
result: string | undefined;
|
|
27
|
+
data: undefined;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
action: "client.addAccountSignatureText";
|
|
31
|
+
id: string;
|
|
32
|
+
result: string | undefined;
|
|
33
|
+
data: {
|
|
34
|
+
newIdentifier: Identifier;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
action: "client.removeAccountSignatureText";
|
|
39
|
+
id: string;
|
|
40
|
+
result: string | undefined;
|
|
41
|
+
data: {
|
|
42
|
+
identifier: Identifier;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
| {
|
|
46
|
+
action: "client.revokeAllOtherInstallationsSignatureText";
|
|
47
|
+
id: string;
|
|
48
|
+
result: string | undefined;
|
|
49
|
+
data: undefined;
|
|
50
|
+
}
|
|
51
|
+
| {
|
|
52
|
+
action: "client.revokeInstallationsSignatureText";
|
|
53
|
+
id: string;
|
|
54
|
+
result: string | undefined;
|
|
55
|
+
data: {
|
|
56
|
+
installationIds: Uint8Array[];
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
| {
|
|
60
|
+
action: "client.changeRecoveryIdentifierSignatureText";
|
|
61
|
+
id: string;
|
|
62
|
+
result: string | undefined;
|
|
63
|
+
data: {
|
|
64
|
+
identifier: Identifier;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
| {
|
|
68
|
+
action: "client.addEcdsaSignature";
|
|
69
|
+
id: string;
|
|
70
|
+
result: undefined;
|
|
71
|
+
data: {
|
|
72
|
+
type: SignatureRequestType;
|
|
73
|
+
bytes: Uint8Array;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
| {
|
|
77
|
+
action: "client.addScwSignature";
|
|
78
|
+
id: string;
|
|
79
|
+
result: undefined;
|
|
80
|
+
data: {
|
|
81
|
+
type: SignatureRequestType;
|
|
82
|
+
bytes: Uint8Array;
|
|
83
|
+
chainId: bigint;
|
|
84
|
+
blockNumber?: bigint;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
| {
|
|
88
|
+
action: "client.applySignatures";
|
|
89
|
+
id: string;
|
|
90
|
+
result: undefined;
|
|
91
|
+
data: undefined;
|
|
92
|
+
}
|
|
93
|
+
| {
|
|
94
|
+
action: "client.registerIdentity";
|
|
95
|
+
id: string;
|
|
96
|
+
result: undefined;
|
|
97
|
+
data: undefined;
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
action: "client.isRegistered";
|
|
101
|
+
id: string;
|
|
102
|
+
result: boolean;
|
|
103
|
+
data: undefined;
|
|
104
|
+
}
|
|
105
|
+
| {
|
|
106
|
+
action: "client.canMessage";
|
|
107
|
+
id: string;
|
|
108
|
+
result: Map<string, boolean>;
|
|
109
|
+
data: {
|
|
110
|
+
identifiers: Identifier[];
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
| {
|
|
114
|
+
action: "client.findInboxIdByIdentifier";
|
|
115
|
+
id: string;
|
|
116
|
+
result: string | undefined;
|
|
117
|
+
data: {
|
|
118
|
+
identifier: Identifier;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
| {
|
|
122
|
+
action: "client.signWithInstallationKey";
|
|
123
|
+
id: string;
|
|
124
|
+
result: Uint8Array;
|
|
125
|
+
data: {
|
|
126
|
+
signatureText: string;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
| {
|
|
130
|
+
action: "client.verifySignedWithInstallationKey";
|
|
131
|
+
id: string;
|
|
132
|
+
result: boolean;
|
|
133
|
+
data: {
|
|
134
|
+
signatureText: string;
|
|
135
|
+
signatureBytes: Uint8Array;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
| {
|
|
139
|
+
action: "client.verifySignedWithPublicKey";
|
|
140
|
+
id: string;
|
|
141
|
+
result: boolean;
|
|
142
|
+
data: {
|
|
143
|
+
signatureText: string;
|
|
144
|
+
signatureBytes: Uint8Array;
|
|
145
|
+
publicKey: Uint8Array;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
| {
|
|
149
|
+
action: "client.getKeyPackageStatusesForInstallationIds";
|
|
150
|
+
id: string;
|
|
151
|
+
result: Map<string, SafeKeyPackageStatus>;
|
|
152
|
+
data: {
|
|
153
|
+
installationIds: string[];
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
| {
|
|
157
|
+
action: "client.apiStatistics";
|
|
158
|
+
id: string;
|
|
159
|
+
result: SafeApiStats;
|
|
160
|
+
data: undefined;
|
|
161
|
+
}
|
|
162
|
+
| {
|
|
163
|
+
action: "client.apiIdentityStatistics";
|
|
164
|
+
id: string;
|
|
165
|
+
result: SafeIdentityStats;
|
|
166
|
+
data: undefined;
|
|
167
|
+
}
|
|
168
|
+
| {
|
|
169
|
+
action: "client.apiAggregateStatistics";
|
|
170
|
+
id: string;
|
|
171
|
+
result: string;
|
|
172
|
+
data: undefined;
|
|
173
|
+
}
|
|
174
|
+
| {
|
|
175
|
+
action: "client.uploadDebugArchive";
|
|
176
|
+
id: string;
|
|
177
|
+
result: string;
|
|
178
|
+
data: {
|
|
179
|
+
serverUrl?: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ConsentState } from "@xmtp/wasm-bindings";
|
|
2
|
+
import type {
|
|
3
|
+
SafeConversation,
|
|
4
|
+
SafeConversationDebugInfo,
|
|
5
|
+
SafeEncodedContent,
|
|
6
|
+
SafeGroupMember,
|
|
7
|
+
SafeHmacKey,
|
|
8
|
+
SafeListMessagesOptions,
|
|
9
|
+
SafeMessage,
|
|
10
|
+
SafeMessageDisappearingSettings,
|
|
11
|
+
} from "@/utils/conversions";
|
|
12
|
+
|
|
13
|
+
export type ConversationAction =
|
|
14
|
+
| {
|
|
15
|
+
action: "conversation.sync";
|
|
16
|
+
id: string;
|
|
17
|
+
result: SafeConversation;
|
|
18
|
+
data: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
action: "conversation.send";
|
|
24
|
+
id: string;
|
|
25
|
+
result: string;
|
|
26
|
+
data: {
|
|
27
|
+
id: string;
|
|
28
|
+
content: SafeEncodedContent;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
action: "conversation.sendOptimistic";
|
|
33
|
+
id: string;
|
|
34
|
+
result: string;
|
|
35
|
+
data: {
|
|
36
|
+
id: string;
|
|
37
|
+
content: SafeEncodedContent;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
action: "conversation.publishMessages";
|
|
42
|
+
id: string;
|
|
43
|
+
result: undefined;
|
|
44
|
+
data: {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
action: "conversation.messages";
|
|
50
|
+
id: string;
|
|
51
|
+
result: SafeMessage[];
|
|
52
|
+
data: {
|
|
53
|
+
id: string;
|
|
54
|
+
options?: SafeListMessagesOptions;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
| {
|
|
58
|
+
action: "conversation.members";
|
|
59
|
+
id: string;
|
|
60
|
+
result: SafeGroupMember[];
|
|
61
|
+
data: {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
| {
|
|
66
|
+
action: "conversation.messageDisappearingSettings";
|
|
67
|
+
id: string;
|
|
68
|
+
result: SafeMessageDisappearingSettings | undefined;
|
|
69
|
+
data: {
|
|
70
|
+
id: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
| {
|
|
74
|
+
action: "conversation.updateMessageDisappearingSettings";
|
|
75
|
+
id: string;
|
|
76
|
+
result: undefined;
|
|
77
|
+
data: SafeMessageDisappearingSettings & {
|
|
78
|
+
id: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
| {
|
|
82
|
+
action: "conversation.removeMessageDisappearingSettings";
|
|
83
|
+
id: string;
|
|
84
|
+
result: undefined;
|
|
85
|
+
data: {
|
|
86
|
+
id: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
| {
|
|
90
|
+
action: "conversation.isMessageDisappearingEnabled";
|
|
91
|
+
id: string;
|
|
92
|
+
result: boolean;
|
|
93
|
+
data: {
|
|
94
|
+
id: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
| {
|
|
98
|
+
action: "conversation.stream";
|
|
99
|
+
id: string;
|
|
100
|
+
result: undefined;
|
|
101
|
+
data: {
|
|
102
|
+
groupId: string;
|
|
103
|
+
streamId: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
| {
|
|
107
|
+
action: "conversation.pausedForVersion";
|
|
108
|
+
id: string;
|
|
109
|
+
result: string | undefined;
|
|
110
|
+
data: {
|
|
111
|
+
id: string;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
| {
|
|
115
|
+
action: "conversation.getHmacKeys";
|
|
116
|
+
id: string;
|
|
117
|
+
result: Map<string, SafeHmacKey[]>;
|
|
118
|
+
data: {
|
|
119
|
+
id: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
| {
|
|
123
|
+
action: "conversation.debugInfo";
|
|
124
|
+
id: string;
|
|
125
|
+
result: SafeConversationDebugInfo;
|
|
126
|
+
data: {
|
|
127
|
+
id: string;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
| {
|
|
131
|
+
action: "conversation.consentState";
|
|
132
|
+
id: string;
|
|
133
|
+
result: ConsentState;
|
|
134
|
+
data: {
|
|
135
|
+
id: string;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
| {
|
|
139
|
+
action: "conversation.updateConsentState";
|
|
140
|
+
id: string;
|
|
141
|
+
result: undefined;
|
|
142
|
+
data: {
|
|
143
|
+
id: string;
|
|
144
|
+
state: ConsentState;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ConsentState,
|
|
3
|
+
ConversationType,
|
|
4
|
+
Identifier,
|
|
5
|
+
} from "@xmtp/wasm-bindings";
|
|
6
|
+
import type {
|
|
7
|
+
SafeConversation,
|
|
8
|
+
SafeCreateDmOptions,
|
|
9
|
+
SafeCreateGroupOptions,
|
|
10
|
+
SafeHmacKeys,
|
|
11
|
+
SafeListConversationsOptions,
|
|
12
|
+
SafeMessage,
|
|
13
|
+
} from "@/utils/conversions";
|
|
14
|
+
|
|
15
|
+
export type ConversationsAction =
|
|
16
|
+
| {
|
|
17
|
+
action: "conversations.getConversationById";
|
|
18
|
+
id: string;
|
|
19
|
+
result: SafeConversation | undefined;
|
|
20
|
+
data: {
|
|
21
|
+
id: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
action: "conversations.getMessageById";
|
|
26
|
+
id: string;
|
|
27
|
+
result: SafeMessage | undefined;
|
|
28
|
+
data: {
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
action: "conversations.getDmByInboxId";
|
|
34
|
+
id: string;
|
|
35
|
+
result: SafeConversation | undefined;
|
|
36
|
+
data: {
|
|
37
|
+
inboxId: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
action: "conversations.list";
|
|
42
|
+
id: string;
|
|
43
|
+
result: SafeConversation[];
|
|
44
|
+
data: {
|
|
45
|
+
options?: SafeListConversationsOptions;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
| {
|
|
49
|
+
action: "conversations.listGroups";
|
|
50
|
+
id: string;
|
|
51
|
+
result: SafeConversation[];
|
|
52
|
+
data: {
|
|
53
|
+
options?: Omit<SafeListConversationsOptions, "conversation_type">;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
| {
|
|
57
|
+
action: "conversations.listDms";
|
|
58
|
+
id: string;
|
|
59
|
+
result: SafeConversation[];
|
|
60
|
+
data: {
|
|
61
|
+
options?: Omit<SafeListConversationsOptions, "conversation_type">;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
| {
|
|
65
|
+
action: "conversations.newGroupOptimistic";
|
|
66
|
+
id: string;
|
|
67
|
+
result: SafeConversation;
|
|
68
|
+
data: {
|
|
69
|
+
options?: SafeCreateGroupOptions;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
| {
|
|
73
|
+
action: "conversations.newGroupWithIdentifiers";
|
|
74
|
+
id: string;
|
|
75
|
+
result: SafeConversation;
|
|
76
|
+
data: {
|
|
77
|
+
identifiers: Identifier[];
|
|
78
|
+
options?: SafeCreateGroupOptions;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
| {
|
|
82
|
+
action: "conversations.newGroup";
|
|
83
|
+
id: string;
|
|
84
|
+
result: SafeConversation;
|
|
85
|
+
data: {
|
|
86
|
+
inboxIds: string[];
|
|
87
|
+
options?: SafeCreateGroupOptions;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
action: "conversations.newDmWithIdentifier";
|
|
92
|
+
id: string;
|
|
93
|
+
result: SafeConversation;
|
|
94
|
+
data: {
|
|
95
|
+
identifier: Identifier;
|
|
96
|
+
options?: SafeCreateDmOptions;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
| {
|
|
100
|
+
action: "conversations.newDm";
|
|
101
|
+
id: string;
|
|
102
|
+
result: SafeConversation;
|
|
103
|
+
data: {
|
|
104
|
+
inboxId: string;
|
|
105
|
+
options?: SafeCreateDmOptions;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
| {
|
|
109
|
+
action: "conversations.sync";
|
|
110
|
+
id: string;
|
|
111
|
+
result: undefined;
|
|
112
|
+
data: undefined;
|
|
113
|
+
}
|
|
114
|
+
| {
|
|
115
|
+
action: "conversations.syncAll";
|
|
116
|
+
id: string;
|
|
117
|
+
result: undefined;
|
|
118
|
+
data: {
|
|
119
|
+
consentStates?: ConsentState[];
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
| {
|
|
123
|
+
action: "conversations.getHmacKeys";
|
|
124
|
+
id: string;
|
|
125
|
+
result: SafeHmacKeys;
|
|
126
|
+
data: undefined;
|
|
127
|
+
}
|
|
128
|
+
| {
|
|
129
|
+
action: "conversations.stream";
|
|
130
|
+
id: string;
|
|
131
|
+
result: undefined;
|
|
132
|
+
data: {
|
|
133
|
+
streamId: string;
|
|
134
|
+
conversationType?: ConversationType;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
| {
|
|
138
|
+
action: "conversations.streamAllMessages";
|
|
139
|
+
id: string;
|
|
140
|
+
result: undefined;
|
|
141
|
+
data: {
|
|
142
|
+
streamId: string;
|
|
143
|
+
conversationType?: ConversationType;
|
|
144
|
+
consentStates?: ConsentState[];
|
|
145
|
+
};
|
|
146
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SafeConversation } from "@/utils/conversions";
|
|
2
|
+
|
|
3
|
+
export type DmAction =
|
|
4
|
+
| {
|
|
5
|
+
action: "dm.peerInboxId";
|
|
6
|
+
id: string;
|
|
7
|
+
result: string;
|
|
8
|
+
data: {
|
|
9
|
+
id: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
| {
|
|
13
|
+
action: "dm.getDuplicateDms";
|
|
14
|
+
id: string;
|
|
15
|
+
result: SafeConversation[];
|
|
16
|
+
data: {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Identifier,
|
|
3
|
+
MetadataField,
|
|
4
|
+
PermissionPolicy,
|
|
5
|
+
PermissionUpdateType,
|
|
6
|
+
} from "@xmtp/wasm-bindings";
|
|
7
|
+
import type { SafeConversation } from "@/utils/conversions";
|
|
8
|
+
|
|
9
|
+
export type GroupAction =
|
|
10
|
+
| {
|
|
11
|
+
action: "group.listAdmins";
|
|
12
|
+
id: string;
|
|
13
|
+
result: string[];
|
|
14
|
+
data: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
| {
|
|
19
|
+
action: "group.listSuperAdmins";
|
|
20
|
+
id: string;
|
|
21
|
+
result: string[];
|
|
22
|
+
data: {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
action: "group.isAdmin";
|
|
28
|
+
id: string;
|
|
29
|
+
result: boolean;
|
|
30
|
+
data: {
|
|
31
|
+
id: string;
|
|
32
|
+
inboxId: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
action: "group.isSuperAdmin";
|
|
37
|
+
id: string;
|
|
38
|
+
result: boolean;
|
|
39
|
+
data: {
|
|
40
|
+
id: string;
|
|
41
|
+
inboxId: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
action: "group.addMembersByIdentifiers";
|
|
46
|
+
id: string;
|
|
47
|
+
result: undefined;
|
|
48
|
+
data: {
|
|
49
|
+
id: string;
|
|
50
|
+
identifiers: Identifier[];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
action: "group.removeMembersByIdentifiers";
|
|
55
|
+
id: string;
|
|
56
|
+
result: undefined;
|
|
57
|
+
data: {
|
|
58
|
+
id: string;
|
|
59
|
+
identifiers: Identifier[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
| {
|
|
63
|
+
action: "group.addMembers";
|
|
64
|
+
id: string;
|
|
65
|
+
result: undefined;
|
|
66
|
+
data: {
|
|
67
|
+
id: string;
|
|
68
|
+
inboxIds: string[];
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
| {
|
|
72
|
+
action: "group.removeMembers";
|
|
73
|
+
id: string;
|
|
74
|
+
result: undefined;
|
|
75
|
+
data: {
|
|
76
|
+
id: string;
|
|
77
|
+
inboxIds: string[];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
| {
|
|
81
|
+
action: "group.addAdmin";
|
|
82
|
+
id: string;
|
|
83
|
+
result: undefined;
|
|
84
|
+
data: {
|
|
85
|
+
id: string;
|
|
86
|
+
inboxId: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
| {
|
|
90
|
+
action: "group.removeAdmin";
|
|
91
|
+
id: string;
|
|
92
|
+
result: undefined;
|
|
93
|
+
data: {
|
|
94
|
+
id: string;
|
|
95
|
+
inboxId: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
| {
|
|
99
|
+
action: "group.addSuperAdmin";
|
|
100
|
+
id: string;
|
|
101
|
+
result: undefined;
|
|
102
|
+
data: {
|
|
103
|
+
id: string;
|
|
104
|
+
inboxId: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
|
+
action: "group.removeSuperAdmin";
|
|
109
|
+
id: string;
|
|
110
|
+
result: undefined;
|
|
111
|
+
data: {
|
|
112
|
+
id: string;
|
|
113
|
+
inboxId: string;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
action: "group.updateName";
|
|
118
|
+
id: string;
|
|
119
|
+
result: undefined;
|
|
120
|
+
data: {
|
|
121
|
+
id: string;
|
|
122
|
+
name: string;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
| {
|
|
126
|
+
action: "group.updateDescription";
|
|
127
|
+
id: string;
|
|
128
|
+
result: undefined;
|
|
129
|
+
data: {
|
|
130
|
+
id: string;
|
|
131
|
+
description: string;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
| {
|
|
135
|
+
action: "group.updateImageUrl";
|
|
136
|
+
id: string;
|
|
137
|
+
result: undefined;
|
|
138
|
+
data: {
|
|
139
|
+
id: string;
|
|
140
|
+
imageUrl: string;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
| {
|
|
144
|
+
action: "group.updatePermission";
|
|
145
|
+
id: string;
|
|
146
|
+
result: undefined;
|
|
147
|
+
data: {
|
|
148
|
+
id: string;
|
|
149
|
+
permissionType: PermissionUpdateType;
|
|
150
|
+
policy: PermissionPolicy;
|
|
151
|
+
metadataField?: MetadataField;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
| {
|
|
155
|
+
action: "group.permissions";
|
|
156
|
+
id: string;
|
|
157
|
+
result: SafeConversation["permissions"];
|
|
158
|
+
data: {
|
|
159
|
+
id: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ConsentEntityType, ConsentState } from "@xmtp/wasm-bindings";
|
|
2
|
+
import type { SafeConsent, SafeInboxState } from "@/utils/conversions";
|
|
3
|
+
|
|
4
|
+
export type PreferencesAction =
|
|
5
|
+
| {
|
|
6
|
+
action: "preferences.inboxState";
|
|
7
|
+
id: string;
|
|
8
|
+
result: SafeInboxState;
|
|
9
|
+
data: {
|
|
10
|
+
refreshFromNetwork: boolean;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
| {
|
|
14
|
+
action: "preferences.inboxStateFromInboxIds";
|
|
15
|
+
id: string;
|
|
16
|
+
result: SafeInboxState[];
|
|
17
|
+
data: {
|
|
18
|
+
inboxIds: string[];
|
|
19
|
+
refreshFromNetwork: boolean;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
| {
|
|
23
|
+
action: "preferences.getLatestInboxState";
|
|
24
|
+
id: string;
|
|
25
|
+
result: SafeInboxState;
|
|
26
|
+
data: {
|
|
27
|
+
inboxId: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
| {
|
|
31
|
+
action: "preferences.setConsentStates";
|
|
32
|
+
id: string;
|
|
33
|
+
result: undefined;
|
|
34
|
+
data: {
|
|
35
|
+
records: SafeConsent[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
| {
|
|
39
|
+
action: "preferences.getConsentState";
|
|
40
|
+
id: string;
|
|
41
|
+
result: ConsentState;
|
|
42
|
+
data: {
|
|
43
|
+
entityType: ConsentEntityType;
|
|
44
|
+
entity: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
action: "preferences.sync";
|
|
49
|
+
id: string;
|
|
50
|
+
result: number;
|
|
51
|
+
data: undefined;
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
action: "preferences.streamConsent";
|
|
55
|
+
id: string;
|
|
56
|
+
result: undefined;
|
|
57
|
+
data: {
|
|
58
|
+
streamId: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
| {
|
|
62
|
+
action: "preferences.streamPreferences";
|
|
63
|
+
id: string;
|
|
64
|
+
result: undefined;
|
|
65
|
+
data: {
|
|
66
|
+
streamId: string;
|
|
67
|
+
};
|
|
68
|
+
};
|