@avaya/infinity-agent-sdk - v1.0.0
    Preparing search index...

    Represents a queue assigned to the agent for receiving interactions.

    Obtained from User.getAssignedQueues or refreshed via User.refreshAssignedQueues. An agent must log into a queue before the platform routes interactions to them from it. Multiple queues can be logged into simultaneously.

    1. Retrieve assigned queues via User.getAssignedQueues.
    2. Check isLoggedIn to determine the current login state for each queue.
    3. Call login to start receiving interactions from a queue.
    4. Call logout with a ReasonCode of type LOGOUT when the agent is done.
    Area Key members
    Identity queueId, queueName, queueType
    Status isLoggedIn, loggedInAt, isAutoLogin
    Actions canLogin, login, canLogout, logout
    Events subscribe, unsubscribe
    const queues = user.getAssignedQueues();
    const queue = queues.find(q => q.queueName === "Support");

    if (queue && !queue.isLoggedIn) {
    await queue.login();
    console.log("Logged into:", queue.queueName, "at", queue.loggedInAt);
    }

    // Log out with a logout reason code
    const reasons = await user.getAssignableReasonCodes();
    const logoutReason = reasons.find(r => r.type === ReasonType.LOGOUT);
    if (logoutReason) {
    await queue.logout(logoutReason);
    }

    Implements

    Index

    Constructors

    Actions

    • Whether the agent can log into this queue right now.

      Returns true when the platform rules allow login (e.g. the agent is logged into CX, has access to the queue, and is not already logged in). Returns false otherwise.

      Returns boolean

      if (queue.canLogin()) {
      await queue.login();
      }
    • Logs the agent into this queue so the platform can start routing interactions to them.

      Returns Promise<void>

      A promise that resolves when the agent is successfully logged into the queue.

      AvayaInfinityAgentSdkError If the login request fails. * *

      * if (!queue.isLoggedIn) {
      * await queue.login();
      * console.log("Now receiving interactions from:", queue.queueName);
      * }
      *
      *
    • Whether the agent can log out of this queue right now.

      Returns true when the platform rules allow logout (e.g. the agent is logged into CX, has access to the queue, and is currently logged in). Returns false otherwise.

      Returns boolean

      if (queue.canLogout()) {
      const reasons = await user.getAssignableReasonCodes();
      const logoutReason = reasons.find(r => r.type === ReasonType.LOGOUT);
      if (logoutReason) await queue.logout(logoutReason);
      }
    • Logs the agent out of this queue so the platform stops routing interactions to them.

      The reasonCode must be a ReasonCode with type LOGOUT from User.getAssignableReasonCodes.

      Parameters

      • reasonCode: ReasonCode

        The logout reason code. Must have type equal to ReasonType.LOGOUT.

      Returns Promise<void>

      A promise that resolves when the agent is successfully logged out of the queue.

      AvayaInfinityAgentSdkError If the logout request fails. * *

      * const reasons = await user.getAssignableReasonCodes();
      * const logoutReason = reasons.find(r => r.type === ReasonType.LOGOUT);
      * if (logoutReason) {
      * await queue.logout(logoutReason);
      * }
      *
      *

    Events

    Identity

    • get queueId(): string

      The unique identifier of the queue.

      Returns string

    • get queueName(): string

      The display name of the queue as configured in the contact center platform.

      Returns string

    • get queueType(): QueueType

      The category of the queue.

      GENERAL and HYBRID queues support explicit login / logout; PERSONAL queues do not — the platform manages them automatically. UNKNOWN indicates the backend did not send the type field (typically an older backend version); the SDK does not gate login/logout for UNKNOWN — any server-side restriction surfaces via the server's rejection response instead.

      Returns QueueType

      const loggable = user.getAssignedQueues()
      .filter(q => q.queueType !== QueueType.PERSONAL);

    Status

    • get isLoggedIn(): boolean

      Whether the agent is currently logged into this queue and eligible to receive interactions from it.

      Returns boolean

    • get loggedInAt(): Date | undefined

      The timestamp when the agent last logged into this queue. undefined if the agent is not currently logged in.

      Returns Date | undefined

    • get isAutoLogin(): boolean

      Whether the platform automatically logs the agent into this queue upon logging into CX.

      Returns boolean