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

    • Averages an array of numbers

      Parameters

      • arr: number[]

        an array of numbers to average

      Returns number

      the average of the elements in the array

    • Convert a MACRO_CASE stat name to a capitalized string e.g., CONVERTED_STAT_NAME => Converted Stat Name

      Parameters

      • stat: string

      Returns string

    • Convert a date string to a title string

      Parameters

      • date: string

        The date string to convert

      Returns string

      the converted title string

    • 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
    • Filter the run stats for display

      Parameters

      • run: Run

        The run to filter

      Returns [string, string | number | boolean][]

      the filtered run stats

    • 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 full data for a run is available. Note that most browsers will show a 403 error in the console if the data is not available.

      Parameters

      • runID: number

        The ID of the run to check

      Returns Promise<boolean>

      true if the full data is available, 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<string>

    • Load the full data for a run from S3

      Parameters

      • url: string

        The URL of the full data

      • completion: (m: (string | number | boolean)[][]) => void

        The completion handler

      Returns Promise<void>

      use the completion handler and this.#fullRunData

    • Load the full data URL for a run from S3

      Parameters

      • runID: number

        The ID of the run to load

      Returns Promise<string>

      the URL of the full data

    • 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

    • Parse the configuration data from a run

      Parameters

      • run: Run

        The run to parse

      Returns [string, string | number | boolean][]

      the parsed configuration data

    • 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