(msg: any)
| 34 | * message-returning Slack tool (history, replies, thread, reader). |
| 35 | */ |
| 36 | export const mapSlackMessage = (msg: any) => ({ |
| 37 | type: msg.type ?? 'message', |
| 38 | ts: msg.ts, |
| 39 | text: msg.text ?? '', |
| 40 | user: msg.user ?? null, |
| 41 | bot_id: msg.bot_id ?? null, |
| 42 | username: msg.username ?? null, |
| 43 | channel: msg.channel ?? null, |
| 44 | team: msg.team ?? null, |
| 45 | thread_ts: msg.thread_ts ?? null, |
| 46 | parent_user_id: msg.parent_user_id ?? null, |
| 47 | reply_count: msg.reply_count ?? null, |
| 48 | reply_users_count: msg.reply_users_count ?? null, |
| 49 | latest_reply: msg.latest_reply ?? null, |
| 50 | subscribed: msg.subscribed ?? null, |
| 51 | last_read: msg.last_read ?? null, |
| 52 | unread_count: msg.unread_count ?? null, |
| 53 | subtype: msg.subtype ?? null, |
| 54 | reactions: msg.reactions ?? [], |
| 55 | is_starred: msg.is_starred ?? false, |
| 56 | pinned_to: msg.pinned_to ?? [], |
| 57 | files: (msg.files ?? []).map((f: any) => ({ |
| 58 | id: f.id, |
| 59 | name: f.name, |
| 60 | mimetype: f.mimetype, |
| 61 | size: f.size, |
| 62 | url_private: f.url_private ?? null, |
| 63 | permalink: f.permalink ?? null, |
| 64 | mode: f.mode ?? null, |
| 65 | })), |
| 66 | attachments: msg.attachments ?? [], |
| 67 | blocks: msg.blocks ?? [], |
| 68 | edited: msg.edited ?? null, |
| 69 | permalink: msg.permalink ?? null, |
| 70 | }) |
| 71 | |
| 72 | /** Maximum messages to request per page. Slack caps `conversations.*` at 999. */ |
| 73 | const SLACK_PAGE_MAX = 999 |
no outgoing calls
no test coverage detected