@photon-ai/advanced-imessage-kit 1.4.0 → 1.4.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/README.md +109 -54
- package/dist/index.cjs +27 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,30 +18,34 @@ Advanced iMessage Kit is a full-featured iMessage SDK for **reading**, **sending
|
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
|
-
| Feature
|
|
22
|
-
|
|
|
23
|
-
| [Send Messages](#send-messages)
|
|
24
|
-
| [Reply to Messages](#send-messages)
|
|
25
|
-
| [Message Effects](#send-messages)
|
|
26
|
-
| [Unsend Messages](#unsend-messages)
|
|
27
|
-
| [Send Tapbacks](#send-tapbacks)
|
|
28
|
-
| [Query Messages](#query-messages)
|
|
29
|
-
| [
|
|
30
|
-
| [Send
|
|
31
|
-
| [Send
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
| [
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
43
|
-
| [
|
|
44
|
-
| [
|
|
21
|
+
| Feature | Description | Method | Example |
|
|
22
|
+
| ------- | ----------- | ------ | ------- |
|
|
23
|
+
| [Send Messages](#send-messages) | Send text messages to any contact | `messages.sendMessage()` | [message-send.ts](./examples/message-send.ts) |
|
|
24
|
+
| [Reply to Messages](#send-messages) | Reply inline to a specific message | `messages.sendMessage()` | [message-reply.ts](./examples/message-reply.ts) |
|
|
25
|
+
| [Message Effects](#send-messages) | Send with effects (confetti, fireworks, etc.) | `messages.sendMessage()` | [message-effects.ts](./examples/message-effects.ts) |
|
|
26
|
+
| [Unsend Messages](#unsend-messages) | Retract a sent message | `messages.unsendMessage()` | [message-unsend.ts](./examples/message-unsend.ts) |
|
|
27
|
+
| [Send Tapbacks](#send-tapbacks) | React with ❤️ 👍 👎 😂 ‼️ ❓ | `messages.sendReaction()` | [message-reaction.ts](./examples/message-reaction.ts) |
|
|
28
|
+
| [Query Messages](#query-messages) | Search and filter message history | `messages.getMessages()` | [message-search.ts](./examples/message-search.ts) |
|
|
29
|
+
| [Message History](#get-chat-messages) | View messages, reactions, polls, stickers | `chats.getChatMessages()` | [message-history.ts](./examples/message-history.ts) |
|
|
30
|
+
| [Send Attachments](#send-attachments) | Send images, files, documents | `attachments.sendAttachment()` | [message-attachment.ts](./examples/message-attachment.ts) |
|
|
31
|
+
| [Send Audio Messages](#send-audio-messages) | Send voice messages | `attachments.sendAttachment()` | [message-audio.ts](./examples/message-audio.ts) |
|
|
32
|
+
| [Send Stickers](#send-stickers) | Send sticker as standalone message | `attachments.sendSticker()` | [message-sticker.ts](./examples/message-sticker.ts) |
|
|
33
|
+
| [Reply Stickers](#send-stickers) | Attach sticker to a message bubble | `attachments.sendSticker()` | [message-reply-sticker.ts](./examples/message-reply-sticker.ts) |
|
|
34
|
+
| [Download Attachments](#download-attachments) | Download received files and media | `attachments.downloadAttachment()` | [attachment-download.ts](./examples/attachment-download.ts) |
|
|
35
|
+
| [Get Chats](#get-chats) | List all conversations | `chats.getChats()` | [chat-fetch.ts](./examples/chat-fetch.ts) |
|
|
36
|
+
| [Manage Group Chats](#manage-group-chats) | Add/remove members, rename groups | `chats.addParticipant()` | [chat-group.ts](./examples/chat-group.ts) |
|
|
37
|
+
| [Typing Indicators](#typing-indicators) | Show "typing..." status | `chats.startTyping()` | [message-typing.ts](./examples/message-typing.ts) |
|
|
38
|
+
| [Get Contacts](#get-contacts) | Fetch device contacts | `contacts.getContacts()` | [contact-list.ts](./examples/contact-list.ts) |
|
|
39
|
+
| [Share Contact Card](#share-contact-card) | Share your contact info in chat | `contacts.shareContactCard()` | [message-contact-card.ts](./examples/message-contact-card.ts) |
|
|
40
|
+
| [Check iMessage Availability](#check-service-availability) | Verify if contact uses iMessage | `handles.getHandleAvailability()` | [service-check.ts](./examples/service-check.ts) |
|
|
41
|
+
| [Server Info](#get-server-info) | Get server status and config | `server.getServerInfo()` | [server-info.ts](./examples/server-info.ts) |
|
|
42
|
+
| [Message Statistics](#message-statistics) | Get message counts and analytics | `server.getMessageStats()` | [message-stats.ts](./examples/message-stats.ts) |
|
|
43
|
+
| [Create Polls](#create-polls) | Create interactive polls in chat | `polls.create()` | [poll-create.ts](./examples/poll-create.ts) |
|
|
44
|
+
| [Vote on Polls](#vote-on-polls) | Vote or unvote on poll options | `polls.vote()` | [poll-create.ts](./examples/poll-create.ts) |
|
|
45
|
+
| [Add Poll Options](#add-poll-options) | Add options to existing polls | `polls.addOption()` | [poll-add-option.ts](./examples/poll-add-option.ts) |
|
|
46
|
+
| [Find My Friends](#find-my-friends) _(WIP)_ | Get friends' locations | `icloud.getFindMyFriends()` | [findmy-friends.ts](./examples/findmy-friends.ts) |
|
|
47
|
+
| [Real-time Events](#real-time-events) | Listen for new messages, typing, etc. | `sdk.on()` | [listen-simple.ts](./examples/listen-simple.ts) |
|
|
48
|
+
| [Auto Reply](#real-time-events) | Build automated reply bots | `sdk.on()` | [auto-reply-hey.ts](./examples/auto-reply-hey.ts) |
|
|
45
49
|
|
|
46
50
|
---
|
|
47
51
|
|
|
@@ -378,11 +382,31 @@ const message = await sdk.attachments.sendAttachment({
|
|
|
378
382
|
|
|
379
383
|
### Send Stickers
|
|
380
384
|
|
|
385
|
+
Stickers can be sent in two ways:
|
|
386
|
+
|
|
387
|
+
**Standalone Sticker** - Sends as its own message (like sending an image, but with sticker styling):
|
|
388
|
+
|
|
381
389
|
```typescript
|
|
382
390
|
await sdk.attachments.sendSticker({
|
|
383
391
|
chatGuid: "iMessage;-;+1234567890",
|
|
384
392
|
filePath: "/path/to/sticker.png",
|
|
385
|
-
|
|
393
|
+
});
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
> Example: [message-sticker.ts](./examples/message-sticker.ts)
|
|
397
|
+
|
|
398
|
+
**Reply Sticker (Tapback Sticker)** - Attaches to an existing message bubble:
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
await sdk.attachments.sendSticker({
|
|
402
|
+
chatGuid: "iMessage;-;+1234567890",
|
|
403
|
+
filePath: "/path/to/sticker.png",
|
|
404
|
+
selectedMessageGuid: "target-message-guid", // Required for reply sticker
|
|
405
|
+
stickerX: 0.5, // Position X (0-1), default: 0.5
|
|
406
|
+
stickerY: 0.5, // Position Y (0-1), default: 0.5
|
|
407
|
+
stickerScale: 0.75, // Scale (0-1), default: 0.75
|
|
408
|
+
stickerRotation: 0, // Rotation in radians, default: 0
|
|
409
|
+
stickerWidth: 300, // Width in pixels, default: 300
|
|
386
410
|
});
|
|
387
411
|
```
|
|
388
412
|
|
|
@@ -436,10 +460,32 @@ const contacts = await sdk.contacts.getContacts();
|
|
|
436
460
|
### Get Contact Card
|
|
437
461
|
|
|
438
462
|
```typescript
|
|
439
|
-
// Get by phone or email
|
|
463
|
+
// Get contact card by phone or email
|
|
440
464
|
const card = await sdk.contacts.getContactCard("+1234567890");
|
|
465
|
+
// {
|
|
466
|
+
// firstName: "John",
|
|
467
|
+
// lastName: "Doe",
|
|
468
|
+
// emails: ["john@example.com"],
|
|
469
|
+
// phones: ["+1234567890"],
|
|
470
|
+
// ...
|
|
471
|
+
// }
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
### Share Contact Card
|
|
475
|
+
|
|
476
|
+
Share your contact card with a chat:
|
|
477
|
+
|
|
478
|
+
```typescript
|
|
479
|
+
// Check if sharing is recommended
|
|
480
|
+
const shouldShare = await sdk.contacts.shouldShareContact("chat-guid");
|
|
481
|
+
// Returns false if you've already shared or they haven't shared theirs
|
|
482
|
+
|
|
483
|
+
// Share your contact card
|
|
484
|
+
await sdk.contacts.shareContactCard("chat-guid");
|
|
441
485
|
```
|
|
442
486
|
|
|
487
|
+
> Example: [message-contact-card.ts](./examples/message-contact-card.ts)
|
|
488
|
+
|
|
443
489
|
---
|
|
444
490
|
|
|
445
491
|
## Handles
|
|
@@ -543,18 +589,6 @@ const chatMediaStats = await sdk.server.getMediaStatisticsByChat();
|
|
|
543
589
|
const logs = await sdk.server.getServerLogs(100); // Get last 100 logs
|
|
544
590
|
```
|
|
545
591
|
|
|
546
|
-
### Alert Management
|
|
547
|
-
|
|
548
|
-
```typescript
|
|
549
|
-
// Get alerts
|
|
550
|
-
const alerts = await sdk.server.getAlerts();
|
|
551
|
-
|
|
552
|
-
// Mark alerts as read
|
|
553
|
-
await sdk.server.markAlertAsRead(["alert-id-1", "alert-id-2"]);
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
> Example: [server-info.ts](./examples/server-info.ts)
|
|
557
|
-
|
|
558
592
|
---
|
|
559
593
|
|
|
560
594
|
## Polls
|
|
@@ -587,6 +621,24 @@ await sdk.polls.addOption({
|
|
|
587
621
|
|
|
588
622
|
> Example: [poll-add-option.ts](./examples/poll-add-option.ts)
|
|
589
623
|
|
|
624
|
+
### Vote on Polls
|
|
625
|
+
|
|
626
|
+
```typescript
|
|
627
|
+
// Vote on a poll option
|
|
628
|
+
await sdk.polls.vote({
|
|
629
|
+
chatGuid: "iMessage;-;+1234567890",
|
|
630
|
+
pollMessageGuid: "poll-message-guid",
|
|
631
|
+
optionIdentifier: "option-uuid", // UUID of the option to vote for
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
// Remove your vote
|
|
635
|
+
await sdk.polls.unvote({
|
|
636
|
+
chatGuid: "iMessage;-;+1234567890",
|
|
637
|
+
pollMessageGuid: "poll-message-guid",
|
|
638
|
+
optionIdentifier: "option-uuid",
|
|
639
|
+
});
|
|
640
|
+
```
|
|
641
|
+
|
|
590
642
|
### Parse Poll Messages
|
|
591
643
|
|
|
592
644
|
Use the `poll-utils` helper functions to parse and display poll messages:
|
|
@@ -836,36 +888,39 @@ bun run examples/<filename>.ts
|
|
|
836
888
|
|
|
837
889
|
### Message Operations
|
|
838
890
|
|
|
839
|
-
| File | Description
|
|
840
|
-
| ----------------------------------------------------- |
|
|
841
|
-
| [message-reply.ts](./examples/message-reply.ts) | Reply to messages
|
|
842
|
-
| [message-unsend.ts](./examples/message-unsend.ts) | Unsend messages
|
|
843
|
-
| [message-reaction.ts](./examples/message-reaction.ts) | Send Tapbacks
|
|
844
|
-
| [message-effects.ts](./examples/message-effects.ts) | Message effects
|
|
845
|
-
| [message-search.ts](./examples/message-search.ts) | Search messages
|
|
891
|
+
| File | Description |
|
|
892
|
+
| ----------------------------------------------------- | ------------------ |
|
|
893
|
+
| [message-reply.ts](./examples/message-reply.ts) | Reply to messages |
|
|
894
|
+
| [message-unsend.ts](./examples/message-unsend.ts) | Unsend messages |
|
|
895
|
+
| [message-reaction.ts](./examples/message-reaction.ts) | Send Tapbacks |
|
|
896
|
+
| [message-effects.ts](./examples/message-effects.ts) | Message effects |
|
|
897
|
+
| [message-search.ts](./examples/message-search.ts) | Search messages |
|
|
898
|
+
| [message-history.ts](./examples/message-history.ts) | Message history |
|
|
846
899
|
|
|
847
900
|
### Chats & Groups
|
|
848
901
|
|
|
849
|
-
| File
|
|
850
|
-
|
|
|
851
|
-
| [chat-fetch.ts](./examples/chat-fetch.ts)
|
|
852
|
-
| [chat-group.ts](./examples/chat-group.ts)
|
|
853
|
-
| [message-typing.ts](./examples/message-typing.ts)
|
|
902
|
+
| File | Description |
|
|
903
|
+
| ----------------------------------------------------- | ------------------- |
|
|
904
|
+
| [chat-fetch.ts](./examples/chat-fetch.ts) | Get chat list |
|
|
905
|
+
| [chat-group.ts](./examples/chat-group.ts) | Manage groups |
|
|
906
|
+
| [message-typing.ts](./examples/message-typing.ts) | Typing indicators |
|
|
854
907
|
|
|
855
908
|
### Contacts & Services
|
|
856
909
|
|
|
857
910
|
| File | Description |
|
|
858
911
|
| --------------------------------------------------------------- | ----------------------------- |
|
|
859
912
|
| [contact-list.ts](./examples/contact-list.ts) | Get contacts |
|
|
913
|
+
| [message-contact-card.ts](./examples/message-contact-card.ts) | Share contact card |
|
|
860
914
|
| [service-check.ts](./examples/service-check.ts) | Check iMessage availability |
|
|
861
915
|
| [message-service-check.ts](./examples/message-service-check.ts) | Monitor message service types |
|
|
862
916
|
|
|
863
917
|
### Attachments & Media
|
|
864
918
|
|
|
865
|
-
| File | Description
|
|
866
|
-
| --------------------------------------------------------------- |
|
|
867
|
-
| [attachment-download.ts](./examples/attachment-download.ts) | Download attachments
|
|
868
|
-
| [message-
|
|
919
|
+
| File | Description |
|
|
920
|
+
| --------------------------------------------------------------- | ------------------------- |
|
|
921
|
+
| [attachment-download.ts](./examples/attachment-download.ts) | Download attachments |
|
|
922
|
+
| [message-sticker.ts](./examples/message-sticker.ts) | Send standalone stickers |
|
|
923
|
+
| [message-reply-sticker.ts](./examples/message-reply-sticker.ts) | Send reply stickers |
|
|
869
924
|
|
|
870
925
|
### Polls
|
|
871
926
|
|
package/dist/index.cjs
CHANGED
|
@@ -144,7 +144,7 @@ var AttachmentModule = class {
|
|
|
144
144
|
return response.data.data.total;
|
|
145
145
|
}
|
|
146
146
|
async getAttachment(guid) {
|
|
147
|
-
const response = await this.http.get(`/api/v1/attachment/${guid}`);
|
|
147
|
+
const response = await this.http.get(`/api/v1/attachment/${encodeURIComponent(guid)}`);
|
|
148
148
|
return response.data.data;
|
|
149
149
|
}
|
|
150
150
|
async downloadAttachment(guid, options) {
|
|
@@ -154,14 +154,14 @@ var AttachmentModule = class {
|
|
|
154
154
|
if (options?.height !== void 0) params.height = options.height;
|
|
155
155
|
if (options?.width !== void 0) params.width = options.width;
|
|
156
156
|
if (options?.quality !== void 0) params.quality = options.quality;
|
|
157
|
-
const response = await this.http.get(`/api/v1/attachment/${guid}/download`, {
|
|
157
|
+
const response = await this.http.get(`/api/v1/attachment/${encodeURIComponent(guid)}/download`, {
|
|
158
158
|
params,
|
|
159
159
|
responseType: "arraybuffer"
|
|
160
160
|
});
|
|
161
161
|
return Buffer.from(response.data);
|
|
162
162
|
}
|
|
163
163
|
async downloadAttachmentLive(guid) {
|
|
164
|
-
const response = await this.http.get(`/api/v1/attachment/${guid}/live`, {
|
|
164
|
+
const response = await this.http.get(`/api/v1/attachment/${encodeURIComponent(guid)}/live`, {
|
|
165
165
|
responseType: "arraybuffer"
|
|
166
166
|
});
|
|
167
167
|
return Buffer.from(response.data);
|
|
@@ -171,7 +171,7 @@ var AttachmentModule = class {
|
|
|
171
171
|
if (options?.height !== void 0) params.height = options.height;
|
|
172
172
|
if (options?.width !== void 0) params.width = options.width;
|
|
173
173
|
if (options?.quality !== void 0) params.quality = options.quality;
|
|
174
|
-
const response = await this.http.get(`/api/v1/attachment/${guid}/blurhash`, {
|
|
174
|
+
const response = await this.http.get(`/api/v1/attachment/${encodeURIComponent(guid)}/blurhash`, {
|
|
175
175
|
params
|
|
176
176
|
});
|
|
177
177
|
return response.data.data.blurhash;
|
|
@@ -238,35 +238,35 @@ var ChatModule = class {
|
|
|
238
238
|
return response.data.data;
|
|
239
239
|
}
|
|
240
240
|
async getChat(guid, options) {
|
|
241
|
-
const response = await this.http.get(`/api/v1/chat/${guid}`, {
|
|
241
|
+
const response = await this.http.get(`/api/v1/chat/${encodeURIComponent(guid)}`, {
|
|
242
242
|
params: options?.with ? { with: options.with.join(",") } : {}
|
|
243
243
|
});
|
|
244
244
|
return response.data.data;
|
|
245
245
|
}
|
|
246
246
|
async updateChat(guid, options) {
|
|
247
|
-
const response = await this.http.put(`/api/v1/chat/${guid}`, options);
|
|
247
|
+
const response = await this.http.put(`/api/v1/chat/${encodeURIComponent(guid)}`, options);
|
|
248
248
|
return response.data.data;
|
|
249
249
|
}
|
|
250
250
|
async deleteChat(guid) {
|
|
251
|
-
await this.http.delete(`/api/v1/chat/${guid}`);
|
|
251
|
+
await this.http.delete(`/api/v1/chat/${encodeURIComponent(guid)}`);
|
|
252
252
|
}
|
|
253
253
|
async markChatRead(guid) {
|
|
254
|
-
await this.http.post(`/api/v1/chat/${guid}/read`);
|
|
254
|
+
await this.http.post(`/api/v1/chat/${encodeURIComponent(guid)}/read`);
|
|
255
255
|
}
|
|
256
256
|
async markChatUnread(guid) {
|
|
257
|
-
await this.http.post(`/api/v1/chat/${guid}/unread`);
|
|
257
|
+
await this.http.post(`/api/v1/chat/${encodeURIComponent(guid)}/unread`);
|
|
258
258
|
}
|
|
259
259
|
async leaveChat(guid) {
|
|
260
|
-
await this.http.post(`/api/v1/chat/${guid}/leave`);
|
|
260
|
+
await this.http.post(`/api/v1/chat/${encodeURIComponent(guid)}/leave`);
|
|
261
261
|
}
|
|
262
262
|
async addParticipant(chatGuid, address) {
|
|
263
|
-
const response = await this.http.post(`/api/v1/chat/${chatGuid}/participant`, {
|
|
263
|
+
const response = await this.http.post(`/api/v1/chat/${encodeURIComponent(chatGuid)}/participant`, {
|
|
264
264
|
address
|
|
265
265
|
});
|
|
266
266
|
return response.data.data;
|
|
267
267
|
}
|
|
268
268
|
async removeParticipant(chatGuid, address) {
|
|
269
|
-
const response = await this.http.delete(`/api/v1/chat/${chatGuid}/participant`, {
|
|
269
|
+
const response = await this.http.delete(`/api/v1/chat/${encodeURIComponent(chatGuid)}/participant`, {
|
|
270
270
|
data: { address }
|
|
271
271
|
});
|
|
272
272
|
return response.data.data;
|
|
@@ -279,7 +279,7 @@ var ChatModule = class {
|
|
|
279
279
|
if (options?.before !== void 0) params.before = options.before;
|
|
280
280
|
if (options?.after !== void 0) params.after = options.after;
|
|
281
281
|
if (options?.with) params.with = options.with.join(",");
|
|
282
|
-
const response = await this.http.get(`/api/v1/chat/${chatGuid}/message`, {
|
|
282
|
+
const response = await this.http.get(`/api/v1/chat/${encodeURIComponent(chatGuid)}/message`, {
|
|
283
283
|
params
|
|
284
284
|
});
|
|
285
285
|
return response.data.data;
|
|
@@ -289,15 +289,15 @@ var ChatModule = class {
|
|
|
289
289
|
const fileName = path__namespace.default.basename(filePath);
|
|
290
290
|
const form = new FormData__default.default();
|
|
291
291
|
form.append("icon", fileBuffer, fileName);
|
|
292
|
-
await this.http.post(`/api/v1/chat/${chatGuid}/icon`, form, {
|
|
292
|
+
await this.http.post(`/api/v1/chat/${encodeURIComponent(chatGuid)}/icon`, form, {
|
|
293
293
|
headers: form.getHeaders()
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
async removeGroupIcon(chatGuid) {
|
|
297
|
-
await this.http.delete(`/api/v1/chat/${chatGuid}/icon`);
|
|
297
|
+
await this.http.delete(`/api/v1/chat/${encodeURIComponent(chatGuid)}/icon`);
|
|
298
298
|
}
|
|
299
299
|
async getGroupIcon(chatGuid) {
|
|
300
|
-
const response = await this.http.get(`/api/v1/chat/${chatGuid}/icon`, {
|
|
300
|
+
const response = await this.http.get(`/api/v1/chat/${encodeURIComponent(chatGuid)}/icon`, {
|
|
301
301
|
responseType: "arraybuffer"
|
|
302
302
|
});
|
|
303
303
|
return Buffer.from(response.data);
|
|
@@ -309,10 +309,10 @@ var ChatModule = class {
|
|
|
309
309
|
return response.data.data;
|
|
310
310
|
}
|
|
311
311
|
async startTyping(chatGuid) {
|
|
312
|
-
await this.http.post(`/api/v1/chat/${chatGuid}/typing`);
|
|
312
|
+
await this.http.post(`/api/v1/chat/${encodeURIComponent(chatGuid)}/typing`);
|
|
313
313
|
}
|
|
314
314
|
async stopTyping(chatGuid) {
|
|
315
|
-
await this.http.delete(`/api/v1/chat/${chatGuid}/typing`);
|
|
315
|
+
await this.http.delete(`/api/v1/chat/${encodeURIComponent(chatGuid)}/typing`);
|
|
316
316
|
}
|
|
317
317
|
async getBackground(chatGuid) {
|
|
318
318
|
const response = await this.http.get(`/api/v1/chat/${encodeURIComponent(chatGuid)}/background`);
|
|
@@ -384,7 +384,7 @@ var HandleModule = class {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
async getHandle(guid) {
|
|
387
|
-
const response = await this.http.get(`/api/v1/handle/${guid}`);
|
|
387
|
+
const response = await this.http.get(`/api/v1/handle/${encodeURIComponent(guid)}`);
|
|
388
388
|
return response.data.data;
|
|
389
389
|
}
|
|
390
390
|
async getHandleAvailability(address, type) {
|
|
@@ -394,7 +394,7 @@ var HandleModule = class {
|
|
|
394
394
|
return response.data.data.available;
|
|
395
395
|
}
|
|
396
396
|
async getHandleFocusStatus(guid) {
|
|
397
|
-
const response = await this.http.get(`/api/v1/handle/${guid}/focus`);
|
|
397
|
+
const response = await this.http.get(`/api/v1/handle/${encodeURIComponent(guid)}/focus`);
|
|
398
398
|
return response.data.data.status;
|
|
399
399
|
}
|
|
400
400
|
};
|
|
@@ -475,7 +475,7 @@ var MessageModule = class {
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
async getMessage(guid, options) {
|
|
478
|
-
const response = await this.http.get(`/api/v1/message/${guid}`, {
|
|
478
|
+
const response = await this.http.get(`/api/v1/message/${encodeURIComponent(guid)}`, {
|
|
479
479
|
params: options?.with ? { with: options.with.join(",") } : {}
|
|
480
480
|
});
|
|
481
481
|
return response.data.data;
|
|
@@ -520,7 +520,7 @@ var MessageModule = class {
|
|
|
520
520
|
}
|
|
521
521
|
async editMessage(options) {
|
|
522
522
|
return this.enqueueSend(async () => {
|
|
523
|
-
const response = await this.http.post(`/api/v1/message/${options.messageGuid}/edit`, {
|
|
523
|
+
const response = await this.http.post(`/api/v1/message/${encodeURIComponent(options.messageGuid)}/edit`, {
|
|
524
524
|
editedMessage: options.editedMessage,
|
|
525
525
|
backwardsCompatibilityMessage: options.backwardsCompatibilityMessage || options.editedMessage,
|
|
526
526
|
partIndex: options.partIndex ?? 0
|
|
@@ -541,17 +541,17 @@ var MessageModule = class {
|
|
|
541
541
|
}
|
|
542
542
|
async unsendMessage(options) {
|
|
543
543
|
return this.enqueueSend(async () => {
|
|
544
|
-
const response = await this.http.post(`/api/v1/message/${options.messageGuid}/unsend`, {
|
|
544
|
+
const response = await this.http.post(`/api/v1/message/${encodeURIComponent(options.messageGuid)}/unsend`, {
|
|
545
545
|
partIndex: options.partIndex ?? 0
|
|
546
546
|
});
|
|
547
547
|
return response.data.data;
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
async notifyMessage(guid) {
|
|
551
|
-
await this.http.post(`/api/v1/message/${guid}/notify`);
|
|
551
|
+
await this.http.post(`/api/v1/message/${encodeURIComponent(guid)}/notify`);
|
|
552
552
|
}
|
|
553
553
|
async getEmbeddedMedia(guid) {
|
|
554
|
-
const response = await this.http.get(`/api/v1/message/${guid}/embedded-media`);
|
|
554
|
+
const response = await this.http.get(`/api/v1/message/${encodeURIComponent(guid)}/embedded-media`);
|
|
555
555
|
return response.data.data;
|
|
556
556
|
}
|
|
557
557
|
async searchMessages(options) {
|
|
@@ -619,11 +619,11 @@ var ScheduledMessageModule = class {
|
|
|
619
619
|
return response.data.data;
|
|
620
620
|
}
|
|
621
621
|
async updateScheduledMessage(id, options) {
|
|
622
|
-
const response = await this.http.put(`/api/v1/message/schedule/${id}`, options);
|
|
622
|
+
const response = await this.http.put(`/api/v1/message/schedule/${encodeURIComponent(id)}`, options);
|
|
623
623
|
return response.data.data;
|
|
624
624
|
}
|
|
625
625
|
async deleteScheduledMessage(id) {
|
|
626
|
-
await this.http.delete(`/api/v1/message/schedule/${id}`);
|
|
626
|
+
await this.http.delete(`/api/v1/message/schedule/${encodeURIComponent(id)}`);
|
|
627
627
|
}
|
|
628
628
|
};
|
|
629
629
|
|