Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

1.3 KB
Raw Blame
import { PersonMessage } from '~/common/persons/person-message'
import { InternalPerson } from '~/types'

export type MoveDistinctIdsResult =
    | { readonly success: true; readonly messages: PersonMessage[]; readonly distinctIdsMoved: string[] }
    | { readonly success: false; readonly error: 'TargetNotFound' }
    | { readonly success: false; readonly error: 'SourceNotFound' }

export type CreatePersonResult =
    | {
          readonly success: true
          readonly person: InternalPerson
          readonly messages: PersonMessage[]
          readonly created: true
      }
    | {
          readonly success: true
          readonly person: InternalPerson
          readonly messages: PersonMessage[]
          readonly created: false
      }
    | {
          readonly success: false
          readonly error: 'CreationConflict'
          readonly distinctIds: string[]
          // The person that already holds this (team_id, uuid), when we could read it back.
          // Absent means the holder disappeared between the failed write and the lookup.
          readonly conflictingPerson?: InternalPerson
      }
    | { readonly success: false; readonly error: 'PropertiesSizeViolation'; readonly distinctIds: string[] }

export interface PersonPropertiesSize {
    total_props_bytes: number
}