@xmtp/browser-sdk 0.0.4 → 0.0.6
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/README.md +46 -10
- package/dist/index.d.ts +40 -0
- 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.map +1 -1
- package/package.json +19 -19
- package/src/Client.ts +32 -6
- package/src/Conversations.ts +4 -0
- package/src/WorkerClient.ts +38 -4
- package/src/WorkerConversations.ts +4 -0
- package/src/types/clientEvents.ts +34 -0
- package/src/workers/client.ts +44 -0
- package/tsconfig.json +0 -11
package/src/workers/client.ts
CHANGED
|
@@ -70,6 +70,7 @@ self.onmessage = async (event: MessageEvent<ClientEventsClientMessageData>) => {
|
|
|
70
70
|
result: {
|
|
71
71
|
inboxId: client.inboxId,
|
|
72
72
|
installationId: client.installationId,
|
|
73
|
+
installationIdBytes: client.installationIdBytes,
|
|
73
74
|
},
|
|
74
75
|
});
|
|
75
76
|
break;
|
|
@@ -216,6 +217,40 @@ self.onmessage = async (event: MessageEvent<ClientEventsClientMessageData>) => {
|
|
|
216
217
|
});
|
|
217
218
|
break;
|
|
218
219
|
}
|
|
220
|
+
case "signWithInstallationKey": {
|
|
221
|
+
const result = client.signWithInstallationKey(data.signatureText);
|
|
222
|
+
postMessage({
|
|
223
|
+
id,
|
|
224
|
+
action,
|
|
225
|
+
result,
|
|
226
|
+
});
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
case "verifySignedWithInstallationKey": {
|
|
230
|
+
const result = client.verifySignedWithInstallationKey(
|
|
231
|
+
data.signatureText,
|
|
232
|
+
data.signatureBytes,
|
|
233
|
+
);
|
|
234
|
+
postMessage({
|
|
235
|
+
id,
|
|
236
|
+
action,
|
|
237
|
+
result,
|
|
238
|
+
});
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
case "verifySignedWithPublicKey": {
|
|
242
|
+
const result = client.verifySignedWithPublicKey(
|
|
243
|
+
data.signatureText,
|
|
244
|
+
data.signatureBytes,
|
|
245
|
+
data.publicKey,
|
|
246
|
+
);
|
|
247
|
+
postMessage({
|
|
248
|
+
id,
|
|
249
|
+
action,
|
|
250
|
+
result,
|
|
251
|
+
});
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
219
254
|
/**
|
|
220
255
|
* Conversations actions
|
|
221
256
|
*/
|
|
@@ -286,6 +321,15 @@ self.onmessage = async (event: MessageEvent<ClientEventsClientMessageData>) => {
|
|
|
286
321
|
});
|
|
287
322
|
break;
|
|
288
323
|
}
|
|
324
|
+
case "syncAllConversations": {
|
|
325
|
+
await client.conversations.syncAll();
|
|
326
|
+
postMessage({
|
|
327
|
+
id,
|
|
328
|
+
action,
|
|
329
|
+
result: undefined,
|
|
330
|
+
});
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
289
333
|
case "getConversationById": {
|
|
290
334
|
const conversation = client.conversations.getConversationById(data.id);
|
|
291
335
|
postMessage({
|
package/tsconfig.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "tsconfig/react-sdk.json",
|
|
3
|
-
"include": ["src", "test", "vite.config.ts", "rollup.config.js"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"paths": {
|
|
6
|
-
"@/*": ["./src/*"],
|
|
7
|
-
"@test/*": ["./test/*"]
|
|
8
|
-
},
|
|
9
|
-
"types": ["@vitest/browser/providers/playwright"]
|
|
10
|
-
}
|
|
11
|
-
}
|