Options
All
  • Public
  • Public/Protected
  • All
Menu

dauville-server

Index

Type aliases

Abstract

Abstract<T>: Function & { prototype: T }

Type parameters

  • T

Class

Class<T>: Abstract<T> | Constructor<T>

Type parameters

  • T

Constructor

Constructor<T>: new (...args: any[]) => T

Type parameters

  • T

Type declaration

    • new (...args: any[]): T
    • Parameters

      • Rest ...args: any[]

      Returns T

Endpoint

Complete endpoint interface

EndpointPath

EndpointPath: string

Endpoint path are just basic strings

EndpointType

Complete endpoint type interface

HTTPEndpointHandler

HTTPEndpointHandler: RequestHandler

Endpoint handler for http endpoints

HTTPEndpointType

HTTPEndpointType: "HTTP"

Endpoint type definition for http endpoints

IORElement

IORElement: Model<IORElementSchema>

IORModule

IORModule: Model<IORModuleSchema>

IORRate

IORRate: Model<IORRateSchema>

IORUnit

IORUnit: Model<IORUnitSchema>

SocketEndpointHandler

SocketEndpointHandler: (path: EndpointPath, data: any[], socket: Socket) => any

Endpoint handler for socket endpoints

Type declaration

    • Parameters

      Returns any

SocketEndpointType

SocketEndpointType: "Socket"

Endpoint type definition for socket endpoints

TaskAction

TaskAction: (task: Task) => Promise<any>

Type declaration

    • (task: Task): Promise<any>
    • Parameters

      Returns Promise<any>

TaskSchedule

TaskSchedule: string | Moment | Date

Variables

Const FarmbotLogs

FarmbotLogs: IFarmbotLogs = ...

Const FarmbotSchema

FarmbotSchema: Schema<IFarmbotSchema, Model<IFarmbotSchema, {}>, undefined> = ...

Const Measure

Measure: IMeasure = ...

Const MeasureSchema

MeasureSchema: Schema<IMeasureSchema, Model<IMeasureSchema, {}>, undefined> = ...

Const ORElement

ORElement: IORElement = ...

Const ORElementSchema

ORElementSchema: Schema<IORElementSchema, Model<IORElementSchema, {}>, undefined> = ...

Const ORModule

ORModule: IORModule = ...

Const ORModuleSchema

ORModuleSchema: Schema<IORModuleSchema, Model<IORModuleSchema, {}>, undefined> = ...

Const ORRate

ORRate: IORRate = ...

Const ORRateSchema

ORRateSchema: Schema<IORRateSchema, Model<IORRateSchema, {}>, undefined> = ...

Const ORUnit

ORUnit: IORUnit = ...

Const ORUnitSchema

ORUnitSchema: Schema<IORUnitSchema, Model<IORUnitSchema, {}>, undefined> = ...

Const User

User: IUser = ...

Const UserSchema

UserSchema: Schema<IUserSchema, Model<IUserSchema, {}>, undefined> = ...

Functions

defaultEnv

  • defaultEnv(envKey: string, defaultValue: string): string
  • Check if a key is in the environment variables, then return its value, otherwise return the default value

    Parameters

    • envKey: string

      Key to check in the env variables

    • defaultValue: string

      Default value to return if the key is missing

    Returns string

    The value of env variable or the default value is the key is missing

    defaultEnv('MONGO_URL', 'mongodb+srv://localhost:27017')
    // -> value of the env, if MONGO_URL is set to env, will return the
    // -> 'mongodb+srv://localhost:27017', otherwise
    

devProdEnv

  • devProdEnv(devKey: string, prodKey: string, defaultValue: string): string
  • Same as defaultEnv but will check if the environment is dev or prod to use different keys

    Parameters

    • devKey: string

      Key to use while in development mode

    • prodKey: string

      Key to use while in production mode

    • defaultValue: string

      Default value to use if the key is missing

    Returns string

    The value of the env variables or the default value is the key is missing

    devProdEnv('PORT_DEV', 'PORT', '3000')
    // -> value of the PORT_DEV env field, if the mode is development
    // -> value of the PORT env field, if the mode is production
    // -> '3000', if the env field is not defined
    

Generated using TypeDoc