MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / saveUsers

Function saveUsers

apps/web/services/slack/api/fetch_all_conversations.ts:155–176  ·  view source on GitHub ↗
(users: any[], accountId: string)

Source from the content-addressed store, hash-verified

153};
154
155export 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
178export const listUsers = async (
179 token: string,

Callers

nothing calls this directly

Calls 3

generateRandomWordSlugFunction · 0.90
createManyUsersFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected