Documentation
    Preparing search index...

    A class that contains methods for interacting with the Amplify API

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    ctx

    Accessors

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

      Parameters

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

      Returns void

    Methods

    • Parameters

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

      Returns Promise<any>

    • 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
    • Delete the corridor csv file from S3

      Parameters

      • c: "f1" | "f2"

        The corridor to delete

      Returns Promise<boolean>

      true if the file was deleted, false otherwise

    • Parameters

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

            Parameters

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

            Returns 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

      Returns string[]

      The names of the f1 corridor files

    • Getter for the f2 corridor file names

      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

    • Parameters

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

            Parameters

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

            Returns void

      Returns Promise<string>

    • 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

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

            Parameters

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

            Returns void

      Returns Promise<string>

    • Load runs from the database

      Parameters

      • fieldID: number = 0

        The ID of the field 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]: number } = undefined

      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

      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