flexadminportal
    Preparing search index...

    A class that contains methods for interacting with the Amplify API

    Hierarchy (View Summary)

    Index

    ctx

    _errorFunction: (errors: string[] | number[] | object[]) => void = console.error
    • get amplify(): Client

      Returns Client

    • set amplify(amplify: Client): void

      Parameters

      • amplify: Client

      Returns void

    • set errorFunction(error: (errors: string[] | number[] | object[]) => void): void

      Parameters

      • error: (errors: string[] | number[] | object[]) => void

      Returns void

    • Parameters

      • errors: string[] | number[] | object[]

      Returns void

    • Analyze the runs and display the modal window

      Parameters

      • selectedIDs: number[]

        The indices of the selected runs

      Returns Promise<boolean>

      selectedIDs - The indices of the selected runs

    • Averages an array of numbers

      Parameters

      • arr: number[]

        an array of numbers to average

      Returns number

      the average of the elements in the array

    • Uses the RunDataTools Lambda to calculate irregularity for a set of runs

      Parameters

      • runIDs: number[]
      • average: boolean = false

      Returns LambdaResponse

      the result of the irregularity calculation and run IDs

    • Generate a random string of characters to be used as a unique id

      Returns string | number[]

      the result of the call to the uuid function

    • Delete a run by ID

      Parameters

      • runID: number

        The ID of the run to delete

      Returns Promise<boolean>

      true if the run was deleted, false otherwise

    • Parameters

      • path: string
      • handleError: (errors: string[] | number[] | object[]) => void = ...

      Returns Promise<boolean>

    • Executes a lambda function

      Parameters

      • functionName: string

        The name of the lambda function to execute

      • functionArgs: any

        The arguments to pass to the lambda function

      Returns Promise<{ logs: string; result: string }>

      • The API response or error
    • Generate stats on run data (similar to column stats on desktop)

      Parameters

      • data: Run[]

        the runs to be analyzed

      Returns (string | number | boolean)[][]

      the statistics for each column

    • Get all the parameters for a lambda function

      Parameters

      • functionName: string

        The name of the lambda function to execute

      Returns Promise<{ logs: string; result: string }>

      this.executeLambda

    • Parameters

      • path: string
      • handleError: (errors: string[] | number[] | object[]) => void = ...

      Returns Promise<string>

    • Parameters

      • teamFieldID: number
      • fileList: FileList

      Returns Promise<boolean>

    • Loads a text file from S3

      Parameters

      • path: string

        The S3 path to the file

      • handleError: (error: string | number | object) => void = ...

        The error handler

      Returns Promise<string>

      • The file contents
    • Load runs from the database

      Parameters

      • fieldID: number = 0

        The ID of the field to filter by

      • groupID: number = null

        The ID of the group to filter by

      • teamFieldID: number = 0

        The ID of the team field to filter by

      • deviceID: number = 0

        The ID of the device to filter by

      Returns Promise<RunConnection>

      the list of runs

    • Parameters

      • fileObject: { file: File; key: string }

      Returns Promise<{ file: File; key: string }>

    • Check if runs have been loaded for the current page

      Parameters

      • page: number

        The current page

      • itemsPerPage: number

        The number of items per page

      Returns boolean

      true if the runs have been loaded, false otherwise