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

    • get analyzedStats(): (string | number | boolean)[][]

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

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

      Parameters

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

      Returns void

      • Protected Methods **

      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

    • Uses the RunDataTools Lambda to average data for a set of runs

      Parameters

      • runIDs: number[]
      • graphNames: string[] = ...

      Returns Promise<any>

      the result of the averaging

    • Averages an array of numbers

      Parameters

      • arr: number[]

        an array of numbers to average

      Returns number

      the average of the elements in the array

    • Compare the two arrays f1 and f2 on (a=1, b). Uses the min length of the arrays for b.

      Returns boolean

      • true if f2 strictly greater than f1 on the interval (a,b)
    • Check if the corridor files exist in S3

      Parameters

      • corridorFileNames: string[]

        The names of the corridor files to check

      Returns Promise<{ key: string }[]>

      • An array of S3 paths for the corridor files which exist
    • 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 the corridor csv file from S3

      Parameters

      Returns Promise<boolean>

      true if the file 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
    • Getter for the f1 corridor file names

      Parameters

      • graphNames: string[] = ...

      Returns string[]

      The names of the f1 corridor files

    • Getter for the f2 corridor file names

      Parameters

      • graphNames: string[] = ...

      Returns string[]

      The names of the f1 corridor files

    • 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

    • Check if the averages exist for the given run IDs

      Parameters

      • runIDs2D: number[][]

        A 2D array of run IDs to check for averages

      Returns Promise<string[]>

      sha256 digests of the run IDs which have averages

    • Parameters

      • runIDs: number[]

      Returns Promise<string>

    • 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

    • Makes a graph using the backend functions.

      Parameters

      • graphTitle: string

        The title of the graph

      • avgs: string[]

        The average hashes of run groups to graph

      • runNames: string[]

        The names of the run groups to graph

      • graphNames: string[] = ...

        The names of the graphs to make

      • dontGraphCorridors: boolean = false

        If true, don't graph the corridors

      • legendStats: { [key: string]: string | number } = undefined
      • showCorridorBands: boolean = false

        If true, show the corridor bands. Only applies if dontGraphCorridors is false.

      Returns Promise<string[]>

      An array of S3 path names for generated graphs

    • Process a corridor csv file and set the f1 or f2 array based on the fx argument. This is a synchronous function that uses callbacks after processing the data to validate f1 or f2. Returns a recognized format for Amplify FileUploader.

      Parameters

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

        The f1, f2 object to process

      • fx: "f1" | "f2"

        Either process the file as the f1 or f2 corridor

      • saveCorridorNames: boolean = true
      • graphName: CorridorGraphName = ...

      Returns { file: File; key: string }

      • The file object with the key set to the new name
    • 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

    • Save the corridor names to S3 if they are set.

      Returns Promise<void>