Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils

Functions

appendExtraResponseAttributes

  • appendExtraResponseAttributes(response: any, extraResponseAttributes: ExtraResponseAttributes[]): Promise<object>

asyncForEach

  • asyncForEach(array: any[], callback: any): Promise<void>

Const compareTimestamps

Const convertToCSV

  • convertToCSV(data: any): string
  • Converts the given JSON object array to a CSV string.

    Parameters

    • data: any

      the array of JSON objects to convert.

    Returns string

Const createAxiosInstance

  • createAxiosInstance(baseURL: string, httpsAgent?: https.Agent): AxiosInstance

Const delay

  • delay(ms: number): Promise<unknown>

Const fetchLog

  • fetchLog(requestClient: RequestClient, accessToken: string, logUrl: string, start: number, end: number): Promise<string>
  • Fetches a section of the log file delineated by start and end lines

    Parameters

    • requestClient: RequestClient

      client object of Request Client.

    • accessToken: string

      an access token for an authorized user.

    • logUrl: string

      url of the log file.

    • start: number

      the line at which to start fetching the log.

    • end: number

      the line at which to stop fetching the log.

    Returns Promise<string>

    an string containing log lines.

Const fetchLogByChunks

  • fetchLogByChunks(requestClient: RequestClient, accessToken: string, logUrl: string, logCount: number): Promise<string>
  • Fetches content of the log file

    Parameters

    • requestClient: RequestClient

      client object of Request Client.

    • accessToken: string

      an access token for an authorized user.

    • logUrl: string

      url of the log file.

    • logCount: number

    Returns Promise<string>

    an string containing log lines.

Const formatDataForRequest

  • formatDataForRequest(data: any): any

Const getValidJson

  • getValidJson(str: string | object): any
  • if string passed then parse the string to json else if throw error for all other types unless it is not a valid json object.

    Parameters

    • str: string | object

      string to check.

    Returns any

isIEorEdgeOrOldFirefox

  • isIEorEdgeOrOldFirefox(): boolean

Const isNode

  • isNode(): boolean

Const isRelativePath

  • isRelativePath(uri: string): boolean

Const isUri

  • isUri(str: string): boolean
  • Checks if string is in URI format.

    Parameters

    • str: string

      string to check.

    Returns boolean

Const isUrl

  • isUrl(str: string): boolean
  • Checks if string is in URL format.

    Parameters

    • str: string

      string to check.

    Returns boolean

Const needsRetry

  • needsRetry(responseText: string): boolean

Const parseGeneratedCode

  • parseGeneratedCode(log: string): string

Const parseSasViyaDebugResponse

  • parseSasViyaDebugResponse(response: string, requestClient: RequestClient, serverUrl: string): Promise<any>
  • When querying a Viya job using the Web approach (as opposed to using the APIs) with _DEBUG enabled, the first response contains the log with the content in an iframe. Therefore when debug is enabled, and the serverType is VIYA, and useComputeApi is null (WEB), we call this function to extract the (_webout) content from the iframe.

    Parameters

    • response: string

      first response from viya job

    • requestClient: RequestClient
    • serverUrl: string

    Returns Promise<any>

Const parseSasViyaLog

  • parseSasViyaLog(logResponse: object): string | object

Const parseSourceCode

  • parseSourceCode(log: string): string

Const parseWeboutResponse

  • parseWeboutResponse(response: string, url?: undefined | string): string

Const serialize

  • serialize(obj: any): string

Const splitChunks

  • splitChunks(content: string): any[]

Generated using TypeDoc