Documentation
    Preparing search index...

    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

      • Protected Members **

      Parameters

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

      Returns void

    • Averages an array of numbers

      Parameters

      • arr: number[]

        an array of numbers to average

      Returns number

      the average of the elements in the array

    • Delete many S3 files at once

      Parameters

      • fileNames: string[]

        the list of file names to delete

      Returns Promise<Error[]>

      the list of the files which had errors, if any

    • 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 device from the database

      Parameters

      • deviceID: number

        the ID of the device to delete

      Returns Promise<
          {
              __typename: "Device";
              ID: number;
              ImageURL?: string;
              Name?: string;
              Password?: string;
              RadiusRA?: number;
              RadiusRB?: number;
              RadiusRC?: number;
              RadiusRD?: number;
              SerialNumber?: string;
              SpringConstant?: number;
          },
      >

    • Delete the device authentication entity

      Parameters

      • deviceID: number

        the ID of the device to delete the authentication entity for

      Returns Promise<boolean>

      true if the entity was deleted, false otherwise

    • Delete the device key from the S3 bucket

      Parameters

      • deviceID: number

        the ID of the device to delete the key for

      Returns Promise<boolean>

      true if the key was deleted, false otherwise

    • Get the Cognito user for a device

      Parameters

      • deviceID: number

      Returns Promise<AdminGetUserResponse>

      the Cognito user

    • Initialize the Cognito service to manage device auth

      Parameters

      • deviceID: number

      Returns Promise<
          {
              cognito: CognitoIdentityServiceProvider;
              params: { Username: string; UserPoolId: string };
          },
      >

    • Load all devices from the database

      Parameters

      • teamID: number

        the ID of the team to load devices for

      Returns Promise<Device[]>

      the list of devices

    • Move a file in the S3 bucket from one location to another

      Parameters

      • source: string

        the source path of the file to move

      • destination: string

        the destination path of the file to move

      Returns Promise<boolean>

      true if the file was moved, false otherwise

    • Reauthorize the device

      Parameters

      • deviceID: number

        the ID of the device to reauthorize

      Returns Promise<boolean>

      true if the device was reauthorized, false otherwise

    • Reauthorize the device key by moving it back to the device keys folder

      Parameters

      • deviceID: number

        the ID of the device to reauthorize the key for

      Returns Promise<boolean>

      true if the key was reauthorized, false otherwise

    • Revoke the device authorization

      Parameters

      • deviceID: number

        the ID of the device to revoke authorization for

      Returns Promise<boolean>

      true if the device was revoked, false otherwise

    • Revoke the device key by moving it to the revoked keys folder

      Parameters

      • deviceID: number

        the ID of the device to revoke the key for

      Returns Promise<boolean>

      true if the key was revoked, false otherwise

    • Update the details for a device in the database

      Parameters

      Returns Promise<
          {
              __typename: "Device";
              ID: number;
              ImageURL?: string;
              Name?: string;
              Password?: string;
              RadiusRA?: number;
              RadiusRB?: number;
              RadiusRC?: number;
              RadiusRD?: number;
              SerialNumber?: string;
              SpringConstant?: number;
          },
      >