npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vulog/aima-user

v1.2.48

Published

User management — profiles, personal information, labels, billing groups, and service registration.

Downloads

1,383

Readme

@vulog/aima-user

User management — profiles, personal information, labels, billing groups, and service registration.

Installation

npm install @vulog/aima-user @vulog/aima-client @vulog/aima-core @vulog/aima-config

Usage

import { getUserById, createUser, findUser, getUsers } from '@vulog/aima-user';
import { getClient } from '@vulog/aima-client';

const client = getClient({ ... });

const user = await getUserById(client, 'user-uuid');

const results = await findUser(client, 'email', '[email protected]', ['PERSONAL']);

API Reference

acceptTAndC

acceptTAndC(client: Client, userId: string, cityId: string): Promise<void>

Accepts terms and conditions for a user in a given city.

| Param | Type | Description | | -------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | cityId | string | City identifier |


assignBillingGroup

assignBillingGroup(client: Client, entityId: string, billingGroupId: string): Promise<void>

Assigns an entity to a billing group.

| Param | Type | Description | | ---------------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | entityId | string | Entity identifier | | billingGroupId | string | Billing group identifier |


unassignBillingGroup

unassignBillingGroup(client: Client, entityId: string, billingGroupId: string): Promise<void>

Removes an entity from a billing group.

| Param | Type | Description | | ---------------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | entityId | string | Entity identifier | | billingGroupId | string | Billing group identifier |


createBusinessProfile

createBusinessProfile(client: Client, userId: string, businessId: string, data: { emailConsent: boolean; email: string; requestId: string; costCenterId?: string }): Promise<UserProfile>

@deprecated. Creates a business profile for a user.

| Param | Type | Description | | ------------ | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | businessId | string | Business identifier | | data | object | Profile creation data |


createUser

createUser(client: Client, user: CreateUser, option?: CreateUserOptions): Promise<User>

Creates a new user account.

| Param | Type | Description | | -------- | ------------------- | ------------------------- | | client | Client | Authenticated AIMA client | | user | CreateUser | User creation data | | option | CreateUserOptions | Creation options |


findUser

findUser(client: Client, searchType: 'email' | 'username' | 'phoneNumber', searchQuery: string, types: PersonalInformationUserType[]): Promise<ResponseFind>

Searches for users by email, username, or phone number.

| Param | Type | Description | | ------------- | ---------------------------------------- | ------------------------------ | | client | Client | Authenticated AIMA client | | searchType | 'email' \| 'username' \| 'phoneNumber' | Search field | | searchQuery | string | Value to search for | | types | PersonalInformationUserType[] | Personal info types to include |


getProfilePersonalInfoById

getProfilePersonalInfoById(client: Client, userId: string, profileId: string, types: PersonalInformationProfileType[]): Promise<PersonalInformationProfile>

Returns personal information for a user profile.

| Param | Type | Description | | ----------- | ---------------------------------- | ------------------------------ | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | profileId | string | Profile identifier | | types | PersonalInformationProfileType[] | Personal info types to include |


getRegistrationOverview

getRegistrationOverview(client: Client, userId: string): Promise<UserServiceRegistration>

Returns the service registration overview for a single user.

| Param | Type | Description | | -------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier |


getUserById

getUserById(client: Client, id: string, addAccountStatus?: boolean): Promise<User>

Fetches a user by ID. Pass addAccountStatus: true to fetch extra account status data.

| Param | Type | Description | | ------------------ | --------- | ------------------------- | | client | Client | Authenticated AIMA client | | id | string | User identifier | | addAccountStatus | boolean | Include account status |


getUserByEmail

getUserByEmail(client: Client, email: string): Promise<User>

Fetches a user by email address.

| Param | Type | Description | | -------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | email | string | User email address |


getUserPersonalInfoById

getUserPersonalInfoById(client: Client, id: string, types: PersonalInformationUserType[]): Promise<PersonalInformationUser>

Returns personal information for a user.

| Param | Type | Description | | -------- | ------------------------------- | ------------------------------ | | client | Client | Authenticated AIMA client | | id | string | User identifier | | types | PersonalInformationUserType[] | Personal info types to include |


getUsersPIByIds

getUsersPIByIds(client: Client, ids: string[], types: PersonalInformationUserType[]): Promise<PersonalInformationUser[]>

Batch-fetches personal information for multiple users.

| Param | Type | Description | | -------- | ------------------------------- | ------------------------------ | | client | Client | Authenticated AIMA client | | ids | string[] | User identifiers | | types | PersonalInformationUserType[] | Personal info types to include |


getLabelsForUser

getLabelsForUser(client: Client, userId: string): Promise<Label[]>

Returns all labels assigned to a user.

| Param | Type | Description | | -------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier |


addLabelForUser

addLabelForUser(client: Client, userId: string, labelId: number): Promise<void>

Assigns a label to a user.

| Param | Type | Description | | --------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | labelId | number | Label identifier |


removeLabelForUser

removeLabelForUser(client: Client, userId: string, labelId: number): Promise<void>

Removes a label from a user.

| Param | Type | Description | | --------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | labelId | number | Label identifier |


setServicesStatus

setServicesStatus(client: Client, profileId: string, servicesUpdate: ServicesUpdate): Promise<void>

Updates service statuses for a profile.

| Param | Type | Description | | ---------------- | ---------------- | ------------------------- | | client | Client | Authenticated AIMA client | | profileId | string | Profile identifier | | servicesUpdate | ServicesUpdate | Service status changes |


registerUserToService

registerUserToService(client: Client, entityId: string, serviceId: string): Promise<void>

Registers an entity to a service. Required for private services; optional for public ones.

| Param | Type | Description | | ----------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | entityId | string | Entity identifier | | serviceId | string | Service identifier |


updateProfilePersonalInfo

updateProfilePersonalInfo(client: Client, userId: string, profileId: string, actions: PatchAction<ProfilePaths>[]): Promise<void>

Updates profile personal information using JSON Patch format.

| Param | Type | Description | | ----------- | ----------------------------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | profileId | string | Profile identifier | | actions | PatchAction<ProfilePaths>[] | JSON Patch operations |


updateUser

updateUser(client: Client, id: string, user: UserUpdateBody): Promise<User>

Updates user account fields. Accepted fields: locale, accountStatus, dataPrivacyConsent, marketingConsent, surveyConsent, shareDataConsent, profilingConsent, membershipNumber.

| Param | Type | Description | | -------- | ---------------- | ------------------------- | | client | Client | Authenticated AIMA client | | id | string | User identifier | | user | UserUpdateBody | Fields to update |


updateUserPersonalInfo

updateUserPersonalInfo(client: Client, userId: string, actions: PatchAction<UserPaths>[]): Promise<void>

Updates user personal information via JSON Patch on /phoneNumber, /email, or /idNumber.

| Param | Type | Description | | --------- | ------------------------- | ------------------------- | | client | Client | Authenticated AIMA client | | userId | string | User identifier | | actions | PatchAction<UserPaths>[]| JSON Patch operations |


getEntity

getEntity(client: Client, entityId: string): Promise<Entity>

Returns a user entity by ID.

| Param | Type | Description | | ---------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | entityId | string | Entity identifier |


getFleetBillingGroups

getFleetBillingGroups(client: Client, options?: PaginableOptions): Promise<PaginableResponse<BillingGroup>>

Returns paginated billing groups for the fleet.

| Param | Type | Description | | --------- | ----------------- | ------------------------- | | client | Client | Authenticated AIMA client | | options | PaginableOptions| Pagination options |


getUsersByIds

getUsersByIds(client: Client, ids: string[]): Promise<User[]>

Batch-fetches users by their IDs.

| Param | Type | Description | | -------- | ---------- | ------------------------- | | client | Client | Authenticated AIMA client | | ids | string[] | User identifiers |


getUsers

getUsers(client: Client, options?: PaginableOptions<UserFilters, UserSort>): Promise<PaginableResponse<UserStatus>>

Returns a paginated list of users with optional filters and sort.

| Param | Type | Description | | --------- | ----------------------------------------- | ------------------------- | | client | Client | Authenticated AIMA client | | options | PaginableOptions<UserFilters, UserSort> | Pagination, filters, sort |


getServiceRegistrationOverview

getServiceRegistrationOverview(client: Client, userIds: string[]): Promise<UserServiceRegistrationOverview[]>

Batch-fetches service registration status for multiple users.

| Param | Type | Description | | --------- | ---------- | ------------------------- | | client | Client | Authenticated AIMA client | | userIds | string[] | User identifiers |


requestServiceRegistration

requestServiceRegistration(client: Client, profileId: string, serviceId: string): Promise<string>

Requests service registration for a profile. Returns the registration request ID.

| Param | Type | Description | | ----------- | -------- | ------------------------- | | client | Client | Authenticated AIMA client | | profileId | string | Profile identifier | | serviceId | string | Service identifier |

Types

User

Key fields: fleetId, id, registrationDate, agreements[], profiles[], dataPrivacyConsent, marketingConsent.

BillingGroup

{
    id: string;
    fleetId: string;
    name: string;
    discount: number;
    overMileageCap: number;
    overMileageRate: number;
}

ServicesUpdate

{
    disableEmailNotification: boolean;
    operatorProfileId: string;
    actions: {
        reasonForChange: string;
        serviceId: string;
        status: string;
    }[];
}

Other exported types

UserProfile, Entity, Label, PersonalInformationUser, PersonalInformationProfile, UserServiceRegistration, UserServiceRegistrationOverview, UserFilters, UserSort, UserStatus, ResponseFind, CreateUser, CreateUserOptions, UserUpdateBody.