MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / transformProfile

Function transformProfile

packages/db/src/services/profile.service.ts:309–332  ·  view source on GitHub ↗
({
  created_at,
  last_seen_at,
  first_name,
  last_name,
  ...profile
}: IClickhouseProfile)

Source from the content-addressed store, hash-verified

307}
308
309export function transformProfile({
310 created_at,
311 last_seen_at,
312 first_name,
313 last_name,
314 ...profile
315}: IClickhouseProfile): IServiceProfile {
316 const createdAtJs = convertClickhouseDateToJs(created_at);
317 return {
318 firstName: first_name,
319 lastName: last_name,
320 isExternal: profile.is_external,
321 properties: toObject(profile.properties),
322 createdAt: createdAtJs,
323 lastSeenAt: last_seen_at
324 ? convertClickhouseDateToJs(last_seen_at)
325 : createdAtJs,
326 projectId: profile.project_id,
327 id: profile.id,
328 email: profile.email,
329 avatar: profile.avatar,
330 groups: profile.groups ?? [],
331 };
332}
333
334export function upsertProfile(
335 {

Callers 1

getProfileByIdFunction · 0.85

Calls 2

toObjectFunction · 0.90

Tested by

no test coverage detected