Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to perform get admin api

Hierarchy

  • AdminService

Index

Constructors

Properties

accessToken: string = ''
acdSessionManager: ACDSessionManager = ...
agentIndicatorsInfo: CXoneIndicator[] = []
apiParser: ApiParser = ...
cxOneConfig: CXoneConfiguration = ...
logger: Logger = ...
maxClientDataLength: 4000 = 4000
pendingPermissionsRequest: Promise<Permissions[]> = null
internal

Deduplicates concurrent permissions fetch requests

permissionsCache: Permissions[] = null
internal

Cached permissions array, null if not yet fetched

tenantDataPromise: Promise<Tenant> = null
internal

Deduplicates concurrent tenant data fetch requests

userInfo: UserInfo = ...
utilService: HttpUtilService = ...
validationUtils: ValidationUtils = ...
singleton: AdminService

Accessors

Methods

  • extractFavoritesForLogging(clientDataJson: string): Record<string, unknown>
  • Extracts only the favorites-related keys (prefixed with CXAFav) from a client-data JSON string.

    Parameters

    • clientDataJson: string

      Raw JSON string representing the full client data object.

    Returns Record<string, unknown>

    An object containing only the CXAFav* key/value pairs, or an empty object when none exist.

  • getPermissions(forceFetch?: boolean): Promise<Permissions[]>
  • Retrieves the list of permissions for the current agent.

    throws

    {CXoneSdkError} when the API request fails.

    example
    const permissions = await service.getPermissions();
    const fresh = await service.getPermissions(true);

    Parameters

    • forceFetch: boolean = false

      When true, bypasses all caches and forces a new API call. Defaults to false.

    Returns Promise<Permissions[]>

    A promise resolving to the agent's Permissions array.

  • getScriptByName(scriptName: string): Promise<number>
  • getTenantData(): Promise<Tenant>
  • Retrieves tenant data for the current user's organization. On failure, resets the in-flight promise so subsequent calls can retry.

    throws

    {CXoneSdkError} when the API request fails.

    example

    const tenant = await getTenantData();

    Returns Promise<Tenant>

    A promise resolving to the Tenant data object.

  • Method to initialize the user details (i.e) cxoneConfig, userInfo and aceessToken

    example
    const agentSession = AdminService.instance.initialize(accessToken, config, userInfo);
    

    Parameters

    Returns void

  • resizeEventQueue(sessionId: string, throttle: boolean): Promise<void>
  • Method to resize the event queue

    example
    resizeEventQueue('12345',true)
    

    Parameters

    • sessionId: string

      session id

    • throttle: boolean

      boolean value to throttle the event queue size

    Returns Promise<void>

    • Promise that resolves when the event queue is resized
  • setAccessToken(accessToken: string): void
  • setTimeStampOffset(): Promise<number>

Generated using TypeDoc