( payload: IIdentifyPayload, context: TrackContext )
| 256 | } |
| 257 | |
| 258 | async function handleIdentify( |
| 259 | payload: IIdentifyPayload, |
| 260 | context: TrackContext |
| 261 | ): Promise<void> { |
| 262 | const { projectId, geo, ua } = context; |
| 263 | const uaInfo = parseUserAgent(ua, payload.properties); |
| 264 | await upsertProfile({ |
| 265 | ...payload, |
| 266 | id: payload.profileId, |
| 267 | isExternal: true, |
| 268 | projectId, |
| 269 | properties: { |
| 270 | ...(payload.properties ?? {}), |
| 271 | country: geo.country, |
| 272 | city: geo.city, |
| 273 | region: geo.region, |
| 274 | longitude: geo.longitude, |
| 275 | latitude: geo.latitude, |
| 276 | os: uaInfo.os, |
| 277 | os_version: uaInfo.osVersion, |
| 278 | browser: uaInfo.browser, |
| 279 | browser_version: uaInfo.browserVersion, |
| 280 | device: uaInfo.device, |
| 281 | brand: uaInfo.brand, |
| 282 | model: uaInfo.model, |
| 283 | }, |
| 284 | }); |
| 285 | } |
| 286 | |
| 287 | async function adjustProfileProperty( |
| 288 | payload: IIncrementPayload | IDecrementPayload, |
no test coverage detected