NDEx JavaScript Client API Reference - v0.6.0-alpha.5
    Preparing search index...

    Class UserService

    UserService - NDEx user-related operations Handles authentication, user management, and user workspace operations

    Index

    Constructors

    Methods

    • Get authenticated user (equivalent to getSignedInUser from legacy client) Returns the current signed-in user object from NDEx server

      For basic authentication: Gets the current user using the /user endpoint For OAuth authentication: Uses the /users/signin endpoint with ID token

      Returns Promise<NDExUser>

      The authenticated user object

      When authenticating with OAuth ID token, if a user with matching email doesn't exist on the server, this function will automatically create that user and return the newly created user object.

    • Get current user profile (equivalent to getSignedInUser from legacy client) Returns the current signed-in user object from NDEx server

      Uses the /user endpoint with {valid: true} parameter for both basic and OAuth authentication. Unlike authenticate(), this function will NOT automatically create a user account for OAuth. If the OAuth ID token doesn't match an existing user, it will return an unauthorized error.

      Returns Promise<NDExUser>

      The current user object

      This function requires existing authentication and will not create new users

    • Update current user profile Uses the UUID from the userUpdate object and server validates against authenticated user

      Parameters

      Returns Promise<void>

    • Request password reset

      Parameters

      • email: string

      Returns Promise<void>

    • Reset password with user UUID (server validates UUID matches authenticated user)

      Parameters

      • userUUID: string

        User UUID (must match authenticated user)

      • newPassword: string

        New password as plain text

      Returns Promise<void>

    • Get user by account name or email (matches server getUserByAccountNameOrAuthenticatUser)

      Parameters

      • searchBy: { username: string } | { email: string }

        Search criteria - either by username OR by email, but not both

      Returns Promise<NDExUser>

      User object matching the search criteria

      If both username and email are provided, only username will be used

    • Get multiple users by their UUIDs (batch operation)

      Parameters

      • uuidList: string[]

        Array of user UUIDs to fetch

      Returns Promise<NDExUser[]>

      Array of user objects corresponding to the provided UUIDs

    • Search users (equivalent to searchUsers from legacy client)

      Parameters

      • searchTerms: string

        Search string to find users

      • Optionalstart: number

        Starting offset for pagination (optional)

      • Optionalsize: number

        Maximum number of results to return (optional)

      Returns Promise<SearchResult<NDExUser>>

      Search result containing users matching the search criteria

    • Get networks for a user's account page (equivalent to getAccountPageNetworks from legacy client)

      Parameters

      • userUUID: string

        User UUID to get networks for

      • Optionaloffset: number

        Starting offset for pagination (optional)

      • Optionallimit: number

        Maximum number of networks to return (optional)

      Returns Promise<NetworkSummaryV2[]>

      Array of V2 network summaries for the specified user

      This function requires authentication. The auth attribute must be set in the client configuration.

    • Get User's Home Content Returns the content of a user's home folder including networks, folders, and shortcuts. Shows different content based on authentication status and relationship to the user.

      Parameters

      • userUuid: string

        User UUID to get home content for

      • format: "update" | "compact" = 'update'

        Format parameter: 'update' or 'compact' (default: "update")

      Returns Promise<FileListItem[]>

      List of file items in the user's home folder

      This function requires authentication. The auth attribute must be set in the client configuration.

    • Delete user account (server validates userid matches authenticated user)

      Parameters

      • userUUID: string

        User UUID to delete (must match authenticated user)

      Returns Promise<void>

      This function requires authentication. The auth attribute must be set in the client configuration.

      The userUUID parameter must be the UUID of the currently authenticated user. The server will validate this.