Hiyve Components - v1.0.0
    Preparing search index...

    Class AdminClient

    Index

    Constructors

    Methods

    • Add a sign-in alias to an identity user. The alias is live at once: the caller attests that the person owns the address.

      Fails with status 409 when the address is the account's own email, already one of its aliases, or in use by another account in the organization.

      Parameters

      • userId: string

        Identity user ID

      • email: string

        The address to add

      • brandOrgId: string

        Organization ID

      Returns Promise<IdentityUser>

      The updated identity user

    • Add a role to a user profile. Idempotent — if the role is already present, the profile is returned unchanged without an update call. Preserves all other roles.

      Parameters

      • profileId: string

        Profile ID

      • role: string

        Role string to add (e.g. 'public-files')

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<UserProfile>

      The updated profile (or the original, unchanged, if the role was already present).

      Implemented as read-modify-write against the underlying profile endpoint, which is not atomic. Concurrent addRole/removeRole calls on the same profile can race and lose updates. Callers should serialize role mutations per profile (typical sign-up / admin flows already do this naturally).

    • Deactivate (soft-delete) a user profile.

      Parameters

      • profileId: string

        Profile ID

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<{ message: string; profile: UserProfile }>

    • Find the identity user that signs in with an address — the canonical email or one of its aliases. Exact, case-insensitive, one request (not a page of listIdentityUsers, whose search cannot see aliases). Returns null when no account in the organization uses the address.

      Parameters

      • email: string

        Any address the account signs in with

      • brandOrgId: string

        Organization ID

      Returns Promise<IdentityUser | null>

    • Get a single user profile by ID.

      Parameters

      • profileId: string

        Profile ID

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<UserProfile>

    • Permanently purge a user profile (GDPR hard delete).

      Unlike deactivateProfile, this REMOVES the profile, its identity user, sessions, trusted devices, and access tokens outright — it cannot be undone. The server refuses org/tenant owners, and the endpoint is disabled server-side unless the identity service has purging enabled (a disabled server responds 404).

      Parameters

      • profileId: string

        Profile ID

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<{ counts: Record<string, number>; message: string }>

      Per-store deletion counts

    • Remove a sign-in alias. If it was the contact address, mail returns to the account's email. The account's email itself cannot be removed (status 409); an address that is not one of the account's aliases is status 404 — the same status as an unknown user, so check the account exists first if you need to tell the two apart.

      Parameters

      • userId: string

        Identity user ID

      • email: string

        The alias to remove

      • brandOrgId: string

        Organization ID

      Returns Promise<IdentityUser>

      The updated identity user

    • Remove a role from a user profile. Idempotent — if the role is not present, the profile is returned unchanged without an update call. Preserves all other roles.

      Parameters

      • profileId: string

        Profile ID

      • role: string

        Role string to remove

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<UserProfile>

      The updated profile (or the original, unchanged, if the role was absent).

      Implemented as read-modify-write against the underlying profile endpoint, which is not atomic. Concurrent addRole/removeRole calls on the same profile can race and lose updates. Callers should serialize role mutations per profile.

    • Choose where an identity user's mail goes: the account's email or one of its verified aliases (status 400 otherwise).

      Parameters

      • userId: string

        Identity user ID

      • email: string

        The contact address

      • brandOrgId: string

        Organization ID

      Returns Promise<IdentityUser>

      The updated identity user

    • Update a user profile's core fields.

      Roles are stripped defensively — they cannot be set via this method. Use addRole / removeRole for role changes.

      Parameters

      • profileId: string

        Profile ID

      • updates: UpdateProfileData

        Fields to update

      • OptionalbrandOrgId: string

        Organization ID. If omitted, defaults to the org associated with the API key.

      Returns Promise<UserProfile>