Hierarchy

  • Users

Properties

impersonating: boolean = false

Methods

  • Description

    enables impersonation by calling the subsequent method with the stored impersonation token

    Example

    Users.As().List() // lists Users using the impersonated users' token
    

    Returns Users

  • Create a new user. If ID is provided and an object with that ID already exists, a 409 (conflict) error is returned. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • buyerID: string

      ID of the buyer.

    • user: User<any>

      Required fields: Username, FirstName, LastName, Email, Active

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TUser>>

  • Delete a user. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Get a single user. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TUser>>

  • Get a list of users. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • buyerID: string

      ID of the buyer.

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[];
          sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[];
          userGroupID?: string;
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[]

        Comma-delimited list of fields to sort by.

      • Optional userGroupID?: string

        ID of the user group.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TUser>>>

  • Get a list of user across buyers. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • listOptions: {
          filters?: Filters;
          page?: number;
          pageSize?: number;
          search?: string;
          searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[];
          sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[];
      } = {}
      • Optional filters?: Filters

        An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

      • Optional page?: number

        Page of results to return. Default: 1. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

      • Optional pageSize?: number

        Number of results to return per page. Default: 20, max: 100.

      • Optional search?: string

        Word or phrase to search for.

      • Optional searchOn?: ("ID" | "LastName" | "FirstName" | "Username" | "Email")[]

        Comma-delimited list of fields to search on.

      • Optional sortBy?: ("ID" | "LastName" | "FirstName" | "Username" | "Email" | "DateCreated" | "!ID" | "!DateCreated" | "!FirstName" | "!LastName" | "PasswordLastSetDate" | "!Username" | "!Email" | "!PasswordLastSetDate")[]

        Comma-delimited list of fields to sort by.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredObjectDeep<ListPage<TUser>>>

  • Move a user to a different buyer. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • newBuyerID: string

      ID of the new buyer.

    • listOptions: {
          orders?: UserOrderMoveOption;
      } = {}
      • Optional orders?: UserOrderMoveOption

        Orders of the user. Possible values: None, Unsubmitted, All.

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TUser>>

  • Revoke a user tokens. Revokes all security tokens of specified buyer user. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

  • Create or update a user. If an object with the same ID already exists, it will be overwritten. Check out the docs for more info

    Type Parameters

    • TUser extends User<any, TUser>

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • user: User<any>

      Required fields: Username, FirstName, LastName, Email, Active

    • requestOptions: RequestOptions = {}

    Returns Promise<RequiredDeep<TUser>>

  • Unlock a user account. Check out the docs for more info

    Parameters

    • buyerID: string

      ID of the buyer.

    • userID: string

      ID of the user.

    • requestOptions: RequestOptions = {}

    Returns Promise<void>

Generated using TypeDoc