Frodo Library - v5.0.0-47
    Preparing search index...

    Type Alias User

    type User = {
        countUsers(filter?: string): Promise<number>;
        createUserExportTemplate(): UserExportInterface;
        createUserGroupExportTemplate(): UserGroupExportInterface;
        exportUser(userId: string): Promise<UserExportInterface>;
        exportUserGroup(groupId: string): Promise<UserGroupExportInterface>;
        exportUserGroups(): Promise<UserGroupExportInterface>;
        exportUsers(): Promise<UserExportInterface>;
        importUserGroups(
            importData: UserGroupExportInterface,
            groupId?: string,
            resultCallback?: ResultCallback<UserGroupSkeleton>,
        ): Promise<UserGroupSkeleton[]>;
        importUsers(
            importData: UserExportInterface,
            userId?: string,
            resultCallback?: ResultCallback<UserExportSkeleton>,
        ): Promise<UserExportSkeleton[]>;
        readUser(userId: string): Promise<UserSkeleton>;
        readUserGroup(groupId: string): Promise<UserGroupSkeleton>;
        readUserGroups(): Promise<UserGroupSkeleton[]>;
        readUsers(filter?: string, fields?: string[]): Promise<UserSkeleton[]>;
    }
    Index
    • Count the users of the active realm, all of them or those matching a filter.

      Parameters

      • Optionalfilter: string

        CREST query filter on the AM user attributes, e.g. username sw "a". Default: all users.

      Returns Promise<number>

      exact count when supported by the backing API. AM stops counting at the maximum results of the realm's data store (1000 by default), so a count of exactly that size means "at least".

    • Export a single user by id. The response can be saved to file as is.

      Parameters

      • userId: string

        User id

      Returns Promise<UserExportInterface>

      Promise resolving to a UserExportInterface object.

    • Import user groups. Every user group is tried: a user group that cannot be imported does not stop the others.

      Parameters

      • importData: UserGroupExportInterface

        user group import data

      • OptionalgroupId: string

        Optional user group id. If supplied, only the group of that id is imported.

      • OptionalresultCallback: ResultCallback<UserGroupSkeleton>

        Optional callback to process individual results. When given, the outcome of every user group is passed to it as it happens (a failed user group as an error that names it, with the cause nested) and a failed user group does not throw: the user groups that could be imported are returned. Without it, the failures are collected and thrown as one error after every user group was tried.

      Returns Promise<UserGroupSkeleton[]>

      the imported user groups

    • Import users and their config. Every user is tried: a user that cannot be imported does not stop the others.

      Parameters

      • importData: UserExportInterface

        user import data

      • OptionaluserId: string

        Optional user id. If supplied, only the user of that id is imported.

      • OptionalresultCallback: ResultCallback<UserExportSkeleton>

        Optional callback to process individual results. When given, the outcome of every user is passed to it as it happens (a failed user as an error that names it, with the cause nested) and a failed user does not throw: the users that could be imported are returned. A user whose config could not be written is a failed user, although the user itself may have been written. Without a callback, the failures are collected and thrown as one error after every user was tried.

      Returns Promise<UserExportSkeleton[]>

      the imported users

    • Read the users of the active realm, all of them or those matching a filter.

      Parameters

      • Optionalfilter: string

        CREST query filter on the AM user attributes, e.g. username sw "a" or sn sw "a". Default: all users.

      • Optionalfields: string[]

        attributes to return, e.g. ['username', 'givenName', 'sn', 'mail']. Default: the attributes AM returns by default.

      Returns Promise<UserSkeleton[]>

      a promise that resolves to an array of user objects. AM returns at most the maximum results of the realm's data store (1000 by default), so a list of exactly that size may be cut short: narrow it with a filter.