a cache for slack profile pictures and emojis
at main 2.8 kB view raw
1/** 2 * Response from Slack's users.info API endpoint 3 */ 4export interface SlackUserInfoResponse { 5 /** Whether the request was successful */ 6 ok: boolean; 7 /** The user information if found */ 8 user?: SlackUser; 9 /** Error message if request failed */ 10 error?: string; 11} 12 13/** 14 * Response from Slack's emoji.list API endpoint 15 */ 16export interface SlackEmojiListResponse { 17 /** Whether the request was successful */ 18 ok: boolean; 19 /** Map of emoji names to their image URLs */ 20 emoji?: Record<string, string>; 21 /** Error message if request failed */ 22 error?: string; 23} 24 25/** 26 * A Slack user's information 27 */ 28export interface SlackUser { 29 /** Unique identifier for the user */ 30 id: string; 31 /** ID of the team the user belongs to */ 32 team_id: string; 33 /** Username */ 34 name: string; 35 /** Whether the user has been deactivated */ 36 deleted: boolean; 37 /** User's color preference */ 38 color: string; 39 /** User's full name */ 40 real_name: string; 41 /** User's timezone identifier */ 42 tz: string; 43 /** Display label for the timezone */ 44 tz_label: string; 45 /** Timezone offset in seconds */ 46 tz_offset: number; 47 /** Extended profile information */ 48 profile: SlackUserProfile; 49 /** Whether user is a workspace admin */ 50 is_admin: boolean; 51 /** Whether user is a workspace owner */ 52 is_owner: boolean; 53 /** Whether user is the primary workspace owner */ 54 is_primary_owner: boolean; 55 /** Whether user has restricted access */ 56 is_restricted: boolean; 57 /** Whether user has ultra restricted access */ 58 is_ultra_restricted: boolean; 59 /** Whether user is a bot */ 60 is_bot: boolean; 61 /** Timestamp of last update to user info */ 62 updated: number; 63 /** Whether user is an app user */ 64 is_app_user: boolean; 65 /** Whether user has two-factor auth enabled */ 66 has_2fa: boolean; 67} 68 69/** 70 * Extended profile information for a Slack user 71 */ 72export interface SlackUserProfile { 73 /** Hash of user's profile picture */ 74 avatar_hash: string; 75 /** User's status text */ 76 status_text: string; 77 /** Emoji shown in user's status */ 78 status_emoji: string; 79 /** User's full name */ 80 real_name: string; 81 /** User's display name */ 82 display_name: string; 83 /** Normalized version of real name */ 84 real_name_normalized: string; 85 /** Normalized version of display name */ 86 display_name_normalized: string; 87 /** User's email address */ 88 email: string; 89 /** User's pronouns */ 90 pronouns: string; 91 /** Original size profile image URL */ 92 image_original: string; 93 /** 24x24 profile image URL */ 94 image_24: string; 95 /** 32x32 profile image URL */ 96 image_32: string; 97 /** 48x48 profile image URL */ 98 image_48: string; 99 /** 72x72 profile image URL */ 100 image_72: string; 101 /** 192x192 profile image URL */ 102 image_192: string; 103 /** 512x512 profile image URL */ 104 image_512: string; 105 /** Team ID the profile belongs to */ 106 team: string; 107}