@photon-ai/advanced-imessage-kit 1.5.0 → 1.6.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/README.md +26 -4
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ Advanced iMessage Kit is a full-featured iMessage SDK for **reading**, **sending
|
|
|
24
24
|
| [Reply to Messages](#send-messages) | Reply inline to a specific message | `messages.sendMessage()` | [message-reply.ts](./examples/message-reply.ts) |
|
|
25
25
|
| [Message Effects](#send-messages) | Send with effects (confetti, fireworks, etc.) | `messages.sendMessage()` | [message-effects.ts](./examples/message-effects.ts) |
|
|
26
26
|
| [Unsend Messages](#unsend-messages) | Retract a sent message | `messages.unsendMessage()` | [message-unsend.ts](./examples/message-unsend.ts) |
|
|
27
|
+
| [Edit Messages](#edit-messages) | Edit a sent message | `messages.editMessage()` | [message-edit.ts](./examples/message-edit.ts) |
|
|
27
28
|
| [Send Tapbacks](#send-tapbacks) | React with ❤️ 👍 👎 😂 ‼️ ❓ | `messages.sendReaction()` | [message-reaction.ts](./examples/message-reaction.ts) |
|
|
28
29
|
| [Query Messages](#query-messages) | Search and filter message history | `messages.getMessages()` | [message-search.ts](./examples/message-search.ts) |
|
|
29
30
|
| [Message History](#get-chat-messages) | View messages, reactions, polls, stickers | `chats.getChatMessages()` | [message-history.ts](./examples/message-history.ts) |
|
|
@@ -41,7 +42,7 @@ Advanced iMessage Kit is a full-featured iMessage SDK for **reading**, **sending
|
|
|
41
42
|
| [Server Info](#get-server-info) | Get server status and config | `server.getServerInfo()` | [server-info.ts](./examples/server-info.ts) |
|
|
42
43
|
| [Message Statistics](#message-statistics) | Get message counts and analytics | `server.getMessageStats()` | [message-stats.ts](./examples/message-stats.ts) |
|
|
43
44
|
| [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-
|
|
45
|
+
| [Vote on Polls](#vote-on-polls) | Vote or unvote on poll options | `polls.vote()` | [poll-vote.ts](./examples/poll-vote.ts) |
|
|
45
46
|
| [Add Poll Options](#add-poll-options) | Add options to existing polls | `polls.addOption()` | [poll-add-option.ts](./examples/poll-add-option.ts) |
|
|
46
47
|
| [Find My Friends](#find-my-friends) _(WIP)_ | Get friends' locations | `icloud.getFindMyFriends()` | [findmy-friends.ts](./examples/findmy-friends.ts) |
|
|
47
48
|
| [Real-time Events](#real-time-events) | Listen for new messages, typing, etc. | `sdk.on()` | [listen-simple.ts](./examples/listen-simple.ts) |
|
|
@@ -128,7 +129,7 @@ interface ClientConfig {
|
|
|
128
129
|
|
|
129
130
|
## Messages
|
|
130
131
|
|
|
131
|
-
> Examples: [message-send.ts](./examples/message-send.ts) | [message-unsend.ts](./examples/message-unsend.ts) | [message-reaction.ts](./examples/message-reaction.ts) | [message-search.ts](./examples/message-search.ts)
|
|
132
|
+
> Examples: [message-send.ts](./examples/message-send.ts) | [message-unsend.ts](./examples/message-unsend.ts) | [message-edit.ts](./examples/message-edit.ts) | [message-reaction.ts](./examples/message-reaction.ts) | [message-search.ts](./examples/message-search.ts)
|
|
132
133
|
|
|
133
134
|
### Send Messages
|
|
134
135
|
|
|
@@ -215,6 +216,23 @@ await sdk.messages.unsendMessage({
|
|
|
215
216
|
|
|
216
217
|
> Example: [message-unsend.ts](./examples/message-unsend.ts)
|
|
217
218
|
|
|
219
|
+
### Edit Messages
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
const editedMessage = await sdk.messages.editMessage({
|
|
223
|
+
messageGuid: "message-guid-to-edit",
|
|
224
|
+
editedMessage: "New text content",
|
|
225
|
+
backwardsCompatibilityMessage: "New text content", // Optional, defaults to editedMessage
|
|
226
|
+
partIndex: 0, // Optional, defaults to 0
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
console.log(`Edited: ${editedMessage.guid}`);
|
|
230
|
+
console.log(`New text: ${editedMessage.text}`);
|
|
231
|
+
console.log(`Date edited: ${editedMessage.dateEdited}`);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
> Example: [message-edit.ts](./examples/message-edit.ts)
|
|
235
|
+
|
|
218
236
|
### Send Tapbacks
|
|
219
237
|
|
|
220
238
|
```typescript
|
|
@@ -599,7 +617,7 @@ const logs = await sdk.server.getServerLogs(100); // Get last 100 logs
|
|
|
599
617
|
|
|
600
618
|
## Polls
|
|
601
619
|
|
|
602
|
-
> Examples: [poll-create.ts](./examples/poll-create.ts) | [poll-add-option.ts](./examples/poll-add-option.ts)
|
|
620
|
+
> Examples: [poll-create.ts](./examples/poll-create.ts) | [poll-vote.ts](./examples/poll-vote.ts) | [poll-add-option.ts](./examples/poll-add-option.ts)
|
|
603
621
|
|
|
604
622
|
### Create Polls
|
|
605
623
|
|
|
@@ -645,6 +663,8 @@ await sdk.polls.unvote({
|
|
|
645
663
|
});
|
|
646
664
|
```
|
|
647
665
|
|
|
666
|
+
> Example: [poll-vote.ts](./examples/poll-vote.ts)
|
|
667
|
+
|
|
648
668
|
### Parse Poll Messages
|
|
649
669
|
|
|
650
670
|
Use the `poll-utils` helper functions to parse and display poll messages:
|
|
@@ -657,7 +677,7 @@ import {
|
|
|
657
677
|
parsePollVotes,
|
|
658
678
|
getPollSummary,
|
|
659
679
|
getOptionTextById,
|
|
660
|
-
} from "@photon-ai/advanced-imessage-kit
|
|
680
|
+
} from "@photon-ai/advanced-imessage-kit";
|
|
661
681
|
|
|
662
682
|
sdk.on("new-message", (message) => {
|
|
663
683
|
if (isPollMessage(message)) {
|
|
@@ -898,6 +918,7 @@ bun run examples/<filename>.ts
|
|
|
898
918
|
| ----------------------------------------------------- | ----------------- |
|
|
899
919
|
| [message-reply.ts](./examples/message-reply.ts) | Reply to messages |
|
|
900
920
|
| [message-unsend.ts](./examples/message-unsend.ts) | Unsend messages |
|
|
921
|
+
| [message-edit.ts](./examples/message-edit.ts) | Edit messages |
|
|
901
922
|
| [message-reaction.ts](./examples/message-reaction.ts) | Send Tapbacks |
|
|
902
923
|
| [message-effects.ts](./examples/message-effects.ts) | Message effects |
|
|
903
924
|
| [message-search.ts](./examples/message-search.ts) | Search messages |
|
|
@@ -933,6 +954,7 @@ bun run examples/<filename>.ts
|
|
|
933
954
|
| File | Description |
|
|
934
955
|
| --------------------------------------------------- | ---------------- |
|
|
935
956
|
| [poll-create.ts](./examples/poll-create.ts) | Create polls |
|
|
957
|
+
| [poll-vote.ts](./examples/poll-vote.ts) | Vote on polls |
|
|
936
958
|
| [poll-add-option.ts](./examples/poll-add-option.ts) | Add poll options |
|
|
937
959
|
|
|
938
960
|
### Server & Advanced
|
package/dist/index.cjs
CHANGED
|
@@ -1110,6 +1110,7 @@ exports.THEME_BACKUP_DELETED = THEME_BACKUP_DELETED;
|
|
|
1110
1110
|
exports.THEME_BACKUP_UPDATED = THEME_BACKUP_UPDATED;
|
|
1111
1111
|
exports.TYPING_INDICATOR = TYPING_INDICATOR;
|
|
1112
1112
|
exports.getLogger = getLogger;
|
|
1113
|
+
exports.getOptionTextById = getOptionTextById;
|
|
1113
1114
|
exports.getPollOneLiner = getPollOneLiner;
|
|
1114
1115
|
exports.getPollSummary = getPollSummary;
|
|
1115
1116
|
exports.isPollMessage = isPollMessage;
|
package/dist/index.d.cts
CHANGED
|
@@ -706,6 +706,7 @@ declare const NEW_FINDMY_LOCATION = "new-findmy-location";
|
|
|
706
706
|
declare const setGlobalLogLevel: (level: LogLevel) => void;
|
|
707
707
|
declare const getLogger: (tag: string) => Logger;
|
|
708
708
|
|
|
709
|
+
declare function getOptionTextById(optionId: string): string | null;
|
|
709
710
|
declare function isPollMessage(message: MessageResponse): boolean;
|
|
710
711
|
declare function isPollVote(message: MessageResponse): boolean;
|
|
711
712
|
interface ParsedPoll {
|
|
@@ -721,4 +722,4 @@ declare function parsePollVotes(message: MessageResponse): ParsedPollVote | null
|
|
|
721
722
|
declare function getPollSummary(message: MessageResponse): string;
|
|
722
723
|
declare function getPollOneLiner(message: MessageResponse): string;
|
|
723
724
|
|
|
724
|
-
export { type AddPollOptionOptions, AdvancedIMessageKit, type Attachment, type AttachmentResponse, type BackupData, CHAT_READ_STATUS_CHANGED, type Chat, type ChatResponse, type ClientConfig, type CreatePollOptions, FT_CALL_STATUS_CHANGED, type FaceTimeStatusData, type FindMyLocationItem, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, type Handle, type HandleResponse, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, type Message, type MessageData, type MessageResponse, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, type ParsedPoll, type ParsedPollVote, type PhotonEventMap, type PhotonEventName, type PollDefinition, type PollMessageResponse, type PollOption, type PollVote, type PollVoteResponse, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, type ScheduledMessageData, type SendAttachmentOptions, type SendMessageOptions, type SendStickerOptions, type ServerMetadataResponse, type ServerUpdateData, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, type TypedEventEmitter, type ValidRemoveTapback, type ValidTapback, type VotePollOptions, getLogger, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
|
725
|
+
export { type AddPollOptionOptions, AdvancedIMessageKit, type Attachment, type AttachmentResponse, type BackupData, CHAT_READ_STATUS_CHANGED, type Chat, type ChatResponse, type ClientConfig, type CreatePollOptions, FT_CALL_STATUS_CHANGED, type FaceTimeStatusData, type FindMyLocationItem, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, type Handle, type HandleResponse, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, type Message, type MessageData, type MessageResponse, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, type ParsedPoll, type ParsedPollVote, type PhotonEventMap, type PhotonEventName, type PollDefinition, type PollMessageResponse, type PollOption, type PollVote, type PollVoteResponse, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, type ScheduledMessageData, type SendAttachmentOptions, type SendMessageOptions, type SendStickerOptions, type ServerMetadataResponse, type ServerUpdateData, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, type TypedEventEmitter, type ValidRemoveTapback, type ValidTapback, type VotePollOptions, getLogger, getOptionTextById, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
package/dist/index.d.ts
CHANGED
|
@@ -706,6 +706,7 @@ declare const NEW_FINDMY_LOCATION = "new-findmy-location";
|
|
|
706
706
|
declare const setGlobalLogLevel: (level: LogLevel) => void;
|
|
707
707
|
declare const getLogger: (tag: string) => Logger;
|
|
708
708
|
|
|
709
|
+
declare function getOptionTextById(optionId: string): string | null;
|
|
709
710
|
declare function isPollMessage(message: MessageResponse): boolean;
|
|
710
711
|
declare function isPollVote(message: MessageResponse): boolean;
|
|
711
712
|
interface ParsedPoll {
|
|
@@ -721,4 +722,4 @@ declare function parsePollVotes(message: MessageResponse): ParsedPollVote | null
|
|
|
721
722
|
declare function getPollSummary(message: MessageResponse): string;
|
|
722
723
|
declare function getPollOneLiner(message: MessageResponse): string;
|
|
723
724
|
|
|
724
|
-
export { type AddPollOptionOptions, AdvancedIMessageKit, type Attachment, type AttachmentResponse, type BackupData, CHAT_READ_STATUS_CHANGED, type Chat, type ChatResponse, type ClientConfig, type CreatePollOptions, FT_CALL_STATUS_CHANGED, type FaceTimeStatusData, type FindMyLocationItem, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, type Handle, type HandleResponse, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, type Message, type MessageData, type MessageResponse, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, type ParsedPoll, type ParsedPollVote, type PhotonEventMap, type PhotonEventName, type PollDefinition, type PollMessageResponse, type PollOption, type PollVote, type PollVoteResponse, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, type ScheduledMessageData, type SendAttachmentOptions, type SendMessageOptions, type SendStickerOptions, type ServerMetadataResponse, type ServerUpdateData, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, type TypedEventEmitter, type ValidRemoveTapback, type ValidTapback, type VotePollOptions, getLogger, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
|
725
|
+
export { type AddPollOptionOptions, AdvancedIMessageKit, type Attachment, type AttachmentResponse, type BackupData, CHAT_READ_STATUS_CHANGED, type Chat, type ChatResponse, type ClientConfig, type CreatePollOptions, FT_CALL_STATUS_CHANGED, type FaceTimeStatusData, type FindMyLocationItem, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, type Handle, type HandleResponse, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, type Message, type MessageData, type MessageResponse, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, type ParsedPoll, type ParsedPollVote, type PhotonEventMap, type PhotonEventName, type PollDefinition, type PollMessageResponse, type PollOption, type PollVote, type PollVoteResponse, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, type ScheduledMessageData, type SendAttachmentOptions, type SendMessageOptions, type SendStickerOptions, type ServerMetadataResponse, type ServerUpdateData, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, type TypedEventEmitter, type ValidRemoveTapback, type ValidTapback, type VotePollOptions, getLogger, getOptionTextById, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
package/dist/index.js
CHANGED
|
@@ -1047,6 +1047,6 @@ function getPollOneLiner(message) {
|
|
|
1047
1047
|
return "[Poll]";
|
|
1048
1048
|
}
|
|
1049
1049
|
|
|
1050
|
-
export { AdvancedIMessageKit, CHAT_READ_STATUS_CHANGED, FT_CALL_STATUS_CHANGED, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, getLogger, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
|
1050
|
+
export { AdvancedIMessageKit, CHAT_READ_STATUS_CHANGED, FT_CALL_STATUS_CHANGED, GROUP_ICON_CHANGED, GROUP_ICON_REMOVED, GROUP_NAME_CHANGE, HELLO_WORLD, IMESSAGE_ALIASES_REMOVED, INCOMING_FACETIME, MESSAGE_SEND_ERROR, MESSAGE_UPDATED, NEW_FINDMY_LOCATION, NEW_MESSAGE, NEW_SERVER, PARTICIPANT_ADDED, PARTICIPANT_LEFT, PARTICIPANT_REMOVED, SCHEDULED_MESSAGE_CREATED, SCHEDULED_MESSAGE_DELETED, SCHEDULED_MESSAGE_ERROR, SCHEDULED_MESSAGE_SENT, SCHEDULED_MESSAGE_UPDATED, SDK, SERVER_UPDATE, SERVER_UPDATE_DOWNLOADING, SERVER_UPDATE_INSTALLING, SETTINGS_BACKUP_CREATED, SETTINGS_BACKUP_DELETED, SETTINGS_BACKUP_UPDATED, THEME_BACKUP_CREATED, THEME_BACKUP_DELETED, THEME_BACKUP_UPDATED, TYPING_INDICATOR, getLogger, getOptionTextById, getPollOneLiner, getPollSummary, isPollMessage, isPollVote, parsePollDefinition, parsePollVotes, setGlobalLogLevel };
|
|
1051
1051
|
//# sourceMappingURL=index.js.map
|
|
1052
1052
|
//# sourceMappingURL=index.js.map
|