(users: any[], accountId: string)
| 153 | }; |
| 154 | |
| 155 | export const saveUsers = async (users: any[], accountId: string) => { |
| 156 | const params = users.map((user) => { |
| 157 | const profile = user.profile; |
| 158 | const name = |
| 159 | profile.display_name || |
| 160 | profile.display_name_normalized || |
| 161 | profile.real_name || |
| 162 | profile.real_name_normalized; |
| 163 | const profileImageUrl = profile.image_original; |
| 164 | return { |
| 165 | displayName: name, |
| 166 | externalUserId: user.id, |
| 167 | profileImageUrl, |
| 168 | accountsId: accountId, |
| 169 | isBot: user.is_bot, |
| 170 | isAdmin: user.is_admin || false, |
| 171 | anonymousAlias: generateRandomWordSlug(), |
| 172 | }; |
| 173 | }); |
| 174 | |
| 175 | const result = await createManyUsers({ data: params, skipDuplicates: true }); |
| 176 | }; |
| 177 | |
| 178 | export const listUsers = async ( |
| 179 | token: string, |
nothing calls this directly
no test coverage detected