@softfault/blacketjs 0.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.js ADDED
@@ -0,0 +1,734 @@
1
+ // src/http.ts
2
+ class BlacketHttpError extends Error {
3
+ status;
4
+ body;
5
+ constructor(status, body) {
6
+ super(`Blacket request failed with status ${status}`);
7
+ this.name = "BlacketHttpError";
8
+ this.status = status;
9
+ this.body = body;
10
+ }
11
+ }
12
+
13
+ class BlacketHttp {
14
+ baseUrl;
15
+ cookie;
16
+ headers;
17
+ timeoutMs;
18
+ retry503;
19
+ fetchFn;
20
+ constructor(options = {}) {
21
+ this.baseUrl = (options.baseUrl ?? "https://blacket.org").replace(/\/+$/, "");
22
+ this.cookie = options.cookie;
23
+ this.headers = options.headers;
24
+ this.timeoutMs = options.timeoutMs ?? 1e4;
25
+ this.retry503 = options.retry503 ?? 2;
26
+ this.fetchFn = options.fetch ?? fetch;
27
+ }
28
+ async get(path) {
29
+ return this.request(path, { method: "GET" });
30
+ }
31
+ async post(path, body = {}) {
32
+ return this.request(path, { method: "POST", body });
33
+ }
34
+ async upload(path, file) {
35
+ const filename = file.name ?? "upload";
36
+ const contentType = file.type || "application/octet-stream";
37
+ const signedUpload = await this.post(path, { filename, contentType });
38
+ if (signedUpload.error || !signedUpload.data) {
39
+ return signedUpload;
40
+ }
41
+ const uploadResponse = await this.fetchFn(signedUpload.data.url, {
42
+ method: "PUT",
43
+ headers: {
44
+ "Content-Type": contentType
45
+ },
46
+ body: file
47
+ });
48
+ if (!uploadResponse.ok) {
49
+ return {
50
+ error: true,
51
+ reason: "Upload failed",
52
+ status: uploadResponse.status
53
+ };
54
+ }
55
+ return {
56
+ error: false,
57
+ url: signedUpload.data.publicUrl
58
+ };
59
+ }
60
+ socketUrl(path = "/worker/socket") {
61
+ const url = new URL(path, `${this.baseUrl}/`);
62
+ url.protocol = url.protocol === "http:" ? "ws:" : "wss:";
63
+ return url.toString();
64
+ }
65
+ socketHeaders(headers) {
66
+ const socketHeaders = new Headers(this.headers);
67
+ new Headers(headers).forEach((value, key) => {
68
+ socketHeaders.set(key, value);
69
+ });
70
+ if (this.cookie) {
71
+ socketHeaders.set("Cookie", this.cookie);
72
+ }
73
+ return socketHeaders;
74
+ }
75
+ async request(path, options) {
76
+ let attempts = 0;
77
+ while (true) {
78
+ const controller = new AbortController;
79
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
80
+ try {
81
+ const response = await this.fetchFn(this.url(path), {
82
+ method: options.method,
83
+ headers: this.requestHeaders(options),
84
+ body: options.body === undefined ? undefined : JSON.stringify(options.body),
85
+ signal: controller.signal
86
+ });
87
+ const data = await this.readBody(response);
88
+ if (response.status === 503 && attempts < this.retry503) {
89
+ attempts++;
90
+ await this.wait(2000);
91
+ continue;
92
+ }
93
+ if (!response.ok) {
94
+ if (this.isRecord(data)) {
95
+ return {
96
+ status: response.status,
97
+ ...data
98
+ };
99
+ }
100
+ throw new BlacketHttpError(response.status, data);
101
+ }
102
+ return data;
103
+ } finally {
104
+ clearTimeout(timeout);
105
+ }
106
+ }
107
+ }
108
+ requestHeaders(options) {
109
+ const headers = new Headers(this.headers);
110
+ headers.set("Accept", "application/json");
111
+ if (options.method === "POST") {
112
+ headers.set("Content-Type", "application/json");
113
+ }
114
+ new Headers(options.headers).forEach((value, key) => {
115
+ headers.set(key, value);
116
+ });
117
+ if (this.cookie) {
118
+ headers.set("Cookie", this.cookie);
119
+ }
120
+ return headers;
121
+ }
122
+ url(path) {
123
+ if (/^https?:\/\//.test(path)) {
124
+ return path;
125
+ }
126
+ return new URL(path, `${this.baseUrl}/`).toString();
127
+ }
128
+ async readBody(response) {
129
+ const text = await response.text();
130
+ if (!text) {
131
+ return {};
132
+ }
133
+ try {
134
+ return JSON.parse(text);
135
+ } catch {
136
+ return text;
137
+ }
138
+ }
139
+ isRecord(value) {
140
+ return typeof value === "object" && value !== null && !Array.isArray(value);
141
+ }
142
+ wait(ms) {
143
+ return new Promise((resolve) => setTimeout(resolve, ms));
144
+ }
145
+ }
146
+
147
+ // src/socket.ts
148
+ class BlacketSocket {
149
+ url;
150
+ listeners = new Map;
151
+ headers;
152
+ reconnect;
153
+ WebSocketImpl;
154
+ socket;
155
+ manuallyClosed = false;
156
+ constructor(url, options = {}) {
157
+ this.url = url;
158
+ this.headers = options.headers;
159
+ this.reconnect = options.reconnect ?? true;
160
+ this.WebSocketImpl = options.WebSocket ?? WebSocket;
161
+ }
162
+ connect() {
163
+ this.manuallyClosed = false;
164
+ this.socket = this.createWebSocket();
165
+ this.socket.onmessage = (event) => this.handleMessage(event.data);
166
+ this.socket.onclose = () => {
167
+ if (!this.manuallyClosed && this.reconnect) {
168
+ this.connect();
169
+ }
170
+ };
171
+ return this;
172
+ }
173
+ close(code, reason) {
174
+ this.manuallyClosed = true;
175
+ this.socket?.close(code, reason);
176
+ }
177
+ waitUntilOpen() {
178
+ if (!this.socket) {
179
+ throw new Error("Blacket socket is not created");
180
+ }
181
+ if (this.socket.readyState === this.WebSocketImpl.OPEN) {
182
+ return Promise.resolve();
183
+ }
184
+ if (this.socket.readyState !== this.WebSocketImpl.CONNECTING) {
185
+ throw new Error("Blacket socket is not connecting");
186
+ }
187
+ return new Promise((resolve, reject) => {
188
+ const socket = this.socket;
189
+ if (!socket) {
190
+ reject(new Error("Blacket socket is not created"));
191
+ return;
192
+ }
193
+ socket.addEventListener("open", () => resolve(), { once: true });
194
+ socket.addEventListener("error", () => reject(new Error("Blacket socket failed to open")), {
195
+ once: true
196
+ });
197
+ });
198
+ }
199
+ on(event, callback) {
200
+ const callbacks = this.listeners.get(event) ?? new Set;
201
+ callbacks.add(callback);
202
+ this.listeners.set(event, callbacks);
203
+ return () => this.off(event, callback);
204
+ }
205
+ off(event, callback) {
206
+ this.listeners.get(event)?.delete(callback);
207
+ }
208
+ emit(event, data) {
209
+ if (!this.socket || this.socket.readyState !== this.WebSocketImpl.OPEN) {
210
+ throw new Error("Blacket socket is not open");
211
+ }
212
+ const msg = data === undefined ? { event } : { event, data };
213
+ this.socket.send(JSON.stringify(msg));
214
+ }
215
+ handleMessage(raw) {
216
+ const message = this.parseMessage(raw);
217
+ const callbacks = this.listeners.get(message.event);
218
+ if (!callbacks) {
219
+ return;
220
+ }
221
+ for (const callback of callbacks) {
222
+ callback(message);
223
+ }
224
+ }
225
+ parseMessage(raw) {
226
+ if (typeof raw !== "string") {
227
+ throw new Error("Blacket socket received a non-string message");
228
+ }
229
+ const parsed = JSON.parse(raw);
230
+ if (!parsed.event) {
231
+ throw new Error("Blacket socket message is missing an event");
232
+ }
233
+ return {
234
+ data: {},
235
+ ...parsed,
236
+ event: parsed.event
237
+ };
238
+ }
239
+ createWebSocket() {
240
+ if (!this.headers) {
241
+ return new this.WebSocketImpl(this.url);
242
+ }
243
+ const WebSocketImpl = this.WebSocketImpl;
244
+ return new WebSocketImpl(this.url, { headers: this.headers });
245
+ }
246
+ }
247
+
248
+ // src/client.ts
249
+ var pathValue = (value) => encodeURIComponent(String(value));
250
+
251
+ class BlacketClient {
252
+ http;
253
+ data;
254
+ account;
255
+ users;
256
+ friends;
257
+ settings;
258
+ cosmetics;
259
+ store;
260
+ market;
261
+ clans;
262
+ trades;
263
+ messages;
264
+ socket;
265
+ constructor(options = {}) {
266
+ this.http = new BlacketHttp(options);
267
+ this.data = new BlacketData(this.http);
268
+ this.account = new BlacketAccount(this.http, () => this.currentSocket());
269
+ this.users = new BlacketUsers(this.http);
270
+ this.friends = new BlacketFriends(this.http, () => this.currentSocket());
271
+ this.settings = new BlacketSettings(this.http);
272
+ this.cosmetics = new BlacketCosmetics(this.http);
273
+ this.store = new BlacketStore(this.http);
274
+ this.market = new BlacketMarket(this.http, () => this.currentSocket());
275
+ this.clans = new BlacketClans(this.http, () => this.currentSocket());
276
+ this.trades = new BlacketTrades(this.http, () => this.currentSocket());
277
+ this.messages = new BlacketMessages(this.http, () => this.currentSocket());
278
+ }
279
+ get(path) {
280
+ return this.http.get(path);
281
+ }
282
+ post(path, body = {}) {
283
+ return this.http.post(path, body);
284
+ }
285
+ upload(path, file) {
286
+ return this.http.upload(path, file);
287
+ }
288
+ createSocket(options) {
289
+ this.socket = new BlacketSocket(this.http.socketUrl(), {
290
+ ...options,
291
+ headers: this.http.socketHeaders(options?.headers)
292
+ });
293
+ return this.socket;
294
+ }
295
+ connectSocket(options) {
296
+ return this.createSocket(options).connect();
297
+ }
298
+ useSocket(socket) {
299
+ this.socket = socket;
300
+ return this;
301
+ }
302
+ closeSocket(code, reason) {
303
+ this.currentSocket().close(code, reason);
304
+ }
305
+ onSocket(event, callback) {
306
+ return this.currentSocket().on(event, callback);
307
+ }
308
+ emitSocket(event, data) {
309
+ this.currentSocket().emit(event, data);
310
+ }
311
+ currentSocket() {
312
+ if (!this.socket) {
313
+ throw new Error("Blacket socket is not created. Call client.connectSocket() first");
314
+ }
315
+ return this.socket;
316
+ }
317
+ }
318
+
319
+ class BlacketData {
320
+ http;
321
+ constructor(http) {
322
+ this.http = http;
323
+ }
324
+ index() {
325
+ return this.http.get("/data/index.json");
326
+ }
327
+ emojis() {
328
+ return this.http.get("/content/emojis.json");
329
+ }
330
+ }
331
+
332
+ class BlacketAccount {
333
+ http;
334
+ socket;
335
+ constructor(http, socket) {
336
+ this.http = http;
337
+ this.socket = socket;
338
+ }
339
+ currentUser() {
340
+ return this.http.get("/worker2/user");
341
+ }
342
+ claimDaily() {
343
+ return this.http.get("/worker/claim");
344
+ }
345
+ ping() {
346
+ return this.http.get("/worker/ping");
347
+ }
348
+ giveawaysSince(since) {
349
+ return this.http.get(`/worker/giveaways/since?since=${pathValue(since)}`);
350
+ }
351
+ markInboxRead(id) {
352
+ return this.http.post("/worker/inbox/read", { id });
353
+ }
354
+ status(body) {
355
+ return this.http.post("/worker/status", body);
356
+ }
357
+ upload(file) {
358
+ return this.http.upload("/worker/upload", file);
359
+ }
360
+ heartbeat() {
361
+ this.socket().emit("heartbeat");
362
+ }
363
+ replyToHeartbeat() {
364
+ return this.onHeartbeat(() => this.heartbeat());
365
+ }
366
+ onHeartbeat(callback) {
367
+ return this.socket().on("heartbeat", callback);
368
+ }
369
+ onNotification(callback) {
370
+ return this.socket().on("notification", callback);
371
+ }
372
+ onDestroySession(callback) {
373
+ return this.socket().on("destroy-session", callback);
374
+ }
375
+ }
376
+
377
+ class BlacketUsers {
378
+ http;
379
+ constructor(http) {
380
+ this.http = http;
381
+ }
382
+ me() {
383
+ return this.http.get("/worker2/user");
384
+ }
385
+ get(user) {
386
+ return this.http.get(`/worker2/user/${pathValue(user)}`);
387
+ }
388
+ friends() {
389
+ return this.http.get("/worker2/friends");
390
+ }
391
+ }
392
+
393
+ class BlacketFriends {
394
+ http;
395
+ socket;
396
+ constructor(http, socket) {
397
+ this.http = http;
398
+ this.socket = socket;
399
+ }
400
+ request(user) {
401
+ return this.http.post("/worker/friends/request", { user });
402
+ }
403
+ remove(user) {
404
+ return this.http.post("/worker/friends/remove", { user });
405
+ }
406
+ block(user) {
407
+ return this.http.post("/worker/friends/block", { user });
408
+ }
409
+ unblock(user) {
410
+ return this.http.post("/worker/friends/unblock", { user });
411
+ }
412
+ cancel(user) {
413
+ return this.http.post("/worker/friends/cancel", { user });
414
+ }
415
+ accept(user) {
416
+ return this.http.post("/worker/friends/accept", { user });
417
+ }
418
+ decline(user) {
419
+ return this.http.post("/worker/friends/decline", { user });
420
+ }
421
+ onRequestReceived(callback) {
422
+ return this.socket().on("friends-requests-received", callback);
423
+ }
424
+ onRequestAccepted(callback) {
425
+ return this.socket().on("friends-requests-accepted", callback);
426
+ }
427
+ onRequestDeclined(callback) {
428
+ return this.socket().on("friends-requests-declined", callback);
429
+ }
430
+ onRequestCancelled(callback) {
431
+ return this.socket().on("friends-requests-cancelled", callback);
432
+ }
433
+ onRemoved(callback) {
434
+ return this.socket().on("friends-relationships-removed", callback);
435
+ }
436
+ }
437
+
438
+ class BlacketSettings {
439
+ http;
440
+ constructor(http) {
441
+ this.http = http;
442
+ }
443
+ tradeRequests(value) {
444
+ return this.http.post("/worker/settings/requests", { value });
445
+ }
446
+ friendRequests(value) {
447
+ return this.http.post("/worker/settings/friends", { value });
448
+ }
449
+ username(username, password) {
450
+ return this.http.post("/worker/settings/username", { username, password });
451
+ }
452
+ password(oldPassword, newPassword) {
453
+ return this.http.post("/worker/settings/password", { oldPassword, newPassword });
454
+ }
455
+ generateOtp() {
456
+ return this.http.get("/worker/otp/generate");
457
+ }
458
+ enableOtp(code) {
459
+ return this.http.post("/worker/otp/enable", { code });
460
+ }
461
+ disableOtp(code) {
462
+ return this.http.post("/worker/otp/disable", { code });
463
+ }
464
+ color(color) {
465
+ return this.http.post("/worker/settings/color", { color });
466
+ }
467
+ }
468
+
469
+ class BlacketCosmetics {
470
+ http;
471
+ constructor(http) {
472
+ this.http = http;
473
+ }
474
+ avatar(blook) {
475
+ return this.http.post("/worker/cosmetics/avatar", { blook });
476
+ }
477
+ banner(banner) {
478
+ return this.http.post("/worker/cosmetics/banner", { banner });
479
+ }
480
+ }
481
+
482
+ class BlacketStore {
483
+ http;
484
+ constructor(http) {
485
+ this.http = http;
486
+ }
487
+ startPurchase(item, quantity, origin) {
488
+ return this.http.post("/worker/start-purchase", { item, quantity, origin });
489
+ }
490
+ legacyPurchase(item) {
491
+ return this.http.get(`/worker/purchase?item=${pathValue(item)}`);
492
+ }
493
+ }
494
+
495
+ class BlacketMarket {
496
+ http;
497
+ socket;
498
+ constructor(http, socket) {
499
+ this.http = http;
500
+ this.socket = socket;
501
+ }
502
+ openPack(pack) {
503
+ return this.http.post("/worker3/open", { pack });
504
+ }
505
+ buyShopItem(item) {
506
+ return this.http.post("/worker/shop/buy", { item });
507
+ }
508
+ onBazaarPurchase(callback) {
509
+ return this.socket().on("bazaar-purchase", callback);
510
+ }
511
+ }
512
+
513
+ class BlacketClans {
514
+ http;
515
+ socket;
516
+ constructor(http, socket) {
517
+ this.http = http;
518
+ this.socket = socket;
519
+ }
520
+ mine() {
521
+ return this.http.get("/worker/clans");
522
+ }
523
+ discoverPage(page) {
524
+ return this.http.get(`/worker/clans/discover/page/${pathValue(page)}`);
525
+ }
526
+ discoverByName(name) {
527
+ return this.http.get(`/worker/clans/discover/name/${pathValue(name)}`);
528
+ }
529
+ pendingRequests() {
530
+ return this.http.get("/worker/clans/requests/pending");
531
+ }
532
+ myPendingRequests() {
533
+ return this.http.get("/worker/clans/requests/pending/me");
534
+ }
535
+ sendRequest(clan) {
536
+ return this.http.post("/worker/clans/requests/send", { clan });
537
+ }
538
+ join(clan) {
539
+ return this.http.post("/worker/clans/join", { clan });
540
+ }
541
+ acceptRequest(user) {
542
+ return this.http.post("/worker/clans/requests/accept", { user });
543
+ }
544
+ rejectRequest(user) {
545
+ return this.http.post("/worker/clans/requests/reject", { user });
546
+ }
547
+ create(body) {
548
+ return this.http.post("/worker/clans/create", body);
549
+ }
550
+ leave(password, code) {
551
+ return this.http.post("/worker/clans/leave", { password, code });
552
+ }
553
+ kick(user) {
554
+ return this.http.post("/worker/clans/kick", { user });
555
+ }
556
+ ongoingEvents() {
557
+ return this.http.get("/worker/clans/events/ongoing");
558
+ }
559
+ addInvestment(tokens) {
560
+ return this.http.post("/worker/clans/investments/add", { tokens });
561
+ }
562
+ removeInvestment(tokens) {
563
+ return this.http.post("/worker/clans/investments/remove", { tokens });
564
+ }
565
+ upgradeInvestment() {
566
+ return this.http.post("/worker/clans/investments/upgrade", {});
567
+ }
568
+ addInventoryItem(item) {
569
+ return this.http.post("/worker/clans/inventory/add", { item });
570
+ }
571
+ removeInventoryItem(item) {
572
+ return this.http.post("/worker/clans/inventory/remove", { item });
573
+ }
574
+ useItem(item, clan) {
575
+ return this.http.post("/worker/use", { item, clan });
576
+ }
577
+ setName(name) {
578
+ return this.http.post("/worker/clans/settings/name", { name });
579
+ }
580
+ setDescription(description) {
581
+ return this.http.post("/worker/clans/settings/description", { description });
582
+ }
583
+ setImage(image) {
584
+ return this.http.post("/worker/clans/settings/image", { image });
585
+ }
586
+ resetColor() {
587
+ return this.http.post("/worker/clans/settings/reset-color", {});
588
+ }
589
+ toggleSafeMode() {
590
+ return this.http.post("/worker/clans/settings/safe-mode", {});
591
+ }
592
+ toggleRequests() {
593
+ return this.http.post("/worker/clans/settings/requests", {});
594
+ }
595
+ transferOwnership(user, password, code) {
596
+ return this.http.post("/worker/clans/settings/transfer-ownership", {
597
+ user,
598
+ password,
599
+ code
600
+ });
601
+ }
602
+ disband(password, code) {
603
+ return this.http.post("/worker/clans/settings/disband", { password, code });
604
+ }
605
+ robAttack() {
606
+ this.socket().emit("clans-attacks-rob");
607
+ }
608
+ onAttackStarted(callback) {
609
+ return this.socket().on("clans-attacks-started", callback);
610
+ }
611
+ onAttacked(callback) {
612
+ return this.socket().on("clans-attacks-attacked", callback);
613
+ }
614
+ onAttackAttempted(callback) {
615
+ return this.socket().on("clans-attacks-attempted", callback);
616
+ }
617
+ onAttackRob(callback) {
618
+ return this.socket().on("clans-attacks-rob", callback);
619
+ }
620
+ }
621
+
622
+ class BlacketTrades {
623
+ http;
624
+ socket;
625
+ constructor(http, socket) {
626
+ this.http = http;
627
+ this.socket = socket;
628
+ }
629
+ ongoing() {
630
+ return this.http.get("/worker/trades/ongoing");
631
+ }
632
+ sendRequest(user) {
633
+ return this.http.post("/worker/trades/requests/send", { user: String(user) });
634
+ }
635
+ cancelRequest() {
636
+ return this.http.post("/worker/trades/requests/cancel", {});
637
+ }
638
+ acceptRequest() {
639
+ return this.http.post("/worker/trades/requests/accept", {});
640
+ }
641
+ declineRequest() {
642
+ return this.http.post("/worker/trades/requests/decline", {});
643
+ }
644
+ onRequestReceived(callback) {
645
+ return this.socket().on("trading-requests-received", callback);
646
+ }
647
+ onRequestAccepted(callback) {
648
+ return this.socket().on("trading-requests-accepted", callback);
649
+ }
650
+ onRequestDeclined(callback) {
651
+ return this.socket().on("trading-requests-declined", callback);
652
+ }
653
+ onRequestCancelled(callback) {
654
+ return this.socket().on("trading-requests-cancelled", callback);
655
+ }
656
+ sendBlooks(blooks) {
657
+ this.socket().emit("trading-ongoing-blooks", blooks);
658
+ }
659
+ sendTokens(tokens) {
660
+ this.socket().emit("trading-ongoing-tokens", tokens);
661
+ }
662
+ acceptOngoing() {
663
+ this.socket().emit("trading-ongoing-accept");
664
+ }
665
+ cancelOngoing() {
666
+ this.socket().emit("trading-ongoing-cancel");
667
+ }
668
+ declineOngoing() {
669
+ this.socket().emit("trading-ongoing-decline");
670
+ }
671
+ onTokens(callback) {
672
+ return this.socket().on("trading-ongoing-tokens", callback);
673
+ }
674
+ onBlooks(callback) {
675
+ return this.socket().on("trading-ongoing-blooks", callback);
676
+ }
677
+ onAccepted(callback) {
678
+ return this.socket().on("trading-ongoing-accept", callback);
679
+ }
680
+ onCancelled(callback) {
681
+ return this.socket().on("trading-ongoing-cancel", callback);
682
+ }
683
+ onDeclined(callback) {
684
+ return this.socket().on("trading-ongoing-decline", callback);
685
+ }
686
+ onComplete(callback) {
687
+ return this.socket().on("trading-ongoing-complete", callback);
688
+ }
689
+ }
690
+
691
+ class BlacketMessages {
692
+ http;
693
+ socket;
694
+ constructor(http, socket) {
695
+ this.http = http;
696
+ this.socket = socket;
697
+ }
698
+ list(room, limit = 100) {
699
+ return this.http.get(`/worker2/messages/${pathValue(room)}?limit=${pathValue(limit)}`);
700
+ }
701
+ edit(message, content) {
702
+ return this.http.post(`/worker/messages/${pathValue(message)}/edit`, { content });
703
+ }
704
+ delete(message) {
705
+ return this.http.post(`/worker/messages/${pathValue(message)}/delete`, {});
706
+ }
707
+ reportMessage(message, reason) {
708
+ return this.http.post(`/worker/reports/messages/${pathValue(message)}/create`, {
709
+ reason
710
+ });
711
+ }
712
+ reportUser(user, reason) {
713
+ return this.http.post(`/worker/reports/users/${pathValue(user)}/create`, { reason });
714
+ }
715
+ async send(room, content) {
716
+ await this.socket().waitUntilOpen();
717
+ this.socket().emit("messages-create", { room, content });
718
+ }
719
+ onCreate(callback) {
720
+ return this.socket().on("messages-create", callback);
721
+ }
722
+ onEdit(callback) {
723
+ return this.socket().on("messages-edit", callback);
724
+ }
725
+ onDelete(callback) {
726
+ return this.socket().on("messages-delete", callback);
727
+ }
728
+ }
729
+ export {
730
+ BlacketSocket,
731
+ BlacketHttpError,
732
+ BlacketHttp,
733
+ BlacketClient
734
+ };