TagoIO SDK for JavaScript and TypeScript

Index

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AccessQuery

AccessQuery: Query<AccessInfo, "name" | "active" | "created_at" | "updated_at">

ActionQuery

ActionQuery: Query<ActionInfo, "name" | "active" | "last_triggered" | "created_at" | "updated_at">

ActionTriggerType

ActionTriggerType: { resource: "device" | "bucket" | "file" | "analysis" | "action" | "am" | "user" | "financial" | "profile"; tag_key: string; tag_value: string; when: "create" | "update" | "delete" } | { interval: string } | { cron: string; timezone: string | Date } | { device: string; is: Conditionals; second_value?: string; unlock?: boolean; value: string; value_type: "string" | "number" | "boolean" | "*"; variable: string }

ActionType

ActionType: "condition" | "resource" | "interval" | "schedule" | "mqtt_topic"

ActionTypeParams

ActionTypeParams: { script: GenericID[]; type: "script" } | { message: string; subject: string; type: "notification" } | { message: string; run_user: GenericID; subject: string; type: "notification_run" } | { message: string; subject: string; to: string; type: "email" } | { message: string; to: string; type: "sms" } | { bucket: string; payload: string; topic: string; type: "mqtt" } | { headers: {}; type: "post"; url: string }

AnalysisQuery

AnalysisQuery: Query<AnalysisInfo, "name" | "active" | "run_on" | "last_run" | "created_at" | "updated_at">

Base64

Base64: string

BucketQuery

BucketQuery: Query<BucketInfo, "name" | "visible" | "data_retention" | "created_at" | "updated_at">

Condition

Condition: "None" | "Pending" | "Accepted" | "Refused"

Conditionals

Conditionals: "<" | ">" | "=" | "!" | "><" | "*"

ConnectorQuery

ConnectorQuery: Query<ConnectorInfo, "name" | "id" | "description" | "logo_url" | "install_text" | "install_end_text" | "device_annotation" | "payload_decoder" | "networks">

DashboardQuery

DashboardQuery: Query<DashboardInfo, "name" | "label" | "active" | "created_at" | "updated_at">

DataQuery

DataQueryAggregation

DataQueryAggregation: Omit<DataQueryBase, "start_date"> & { query: "avg" | "sum"; start_date: Date | string }

DataQueryDefault

DataQueryDefault: DataQueryBase & { details?: boolean; ordination?: "descending" | "ascending"; qty?: number; query?: "default"; skip?: number }

DataQueryFirstLast

DataQueryFirstLast: DataQueryBase & { query: "last_item" | "last_value" | "last_location" | "last_insert" | "first_item" | "first_value" | "first_location" | "first_insert" }

DataQueryStreaming

DataQueryStreaming: Omit<DataQueryDefault, "qty" | "skip" | "query" | "ordination">

DataQuerySummary

DataQuerySummary: DataQueryBase & { query: "min" | "max" | "count" }

DataToSend

DataToSend: Omit<Data, "id" | "created_at" | "origin" | "time"> & { time?: Date | string }

DeviceCreateResponse

DeviceCreateResponse: { bucket_id: GenericID; device_id: GenericID; token: GenericToken }

Type declaration

DeviceListItem

DeviceListItem: Omit<DeviceInfo, "bucket"> & { bucket: GenericID }

DictionaryQuery

DictionaryQuery: Query<DictionaryInfo, "name" | "slug" | "languages" | "fallback" | "created_at" | "updated_at">

EmailWithHTML

EmailWithHTML: EmailBase & EmailHTML

EmailWithRawText

EmailWithRawText: EmailBase & EmailRawText

ExpireTimeOption

ExpireTimeOption: "never" | Date

ExportBucket

ExportBucket: { id: string; origin: string; variables: string[] }[]

ExportOption

ExportOption: "csv" | "json" | "xml"

GenericID

GenericID: string

ID used on TagoIO, string with 24 character

GenericToken

GenericToken: string

Token used on TagoIO, string with 36 characters

ListResponse

ListResponse: DeviceInfo[]

NetworkQuery

NetworkQuery: Query<NetworkInfo, "name" | "description" | "logo_url" | "icon_url" | "banner_url" | "device_parameters" | "middleware_endpoint" | "payload_encoder" | "payload_decoder" | "serial_number" | "documentation_url" | "public" | "created_at" | "updated_at">

NotificationType

NotificationType: "dashboard" | "bucket" | "analysis" | "profile" | "tago" | "limit_alert"

PermissionOption

PermissionOption: "write" | "read" | "full" | "deny"

PublicKeyResponse

PublicKeyResponse: { expire_time: ExpireTimeOption; token: GenericToken }

Type declaration

RecursivePartial

RecursivePartial<T>: {}

Type parameters

  • T

Type declaration

RefType

RefType: "dashboard"

Regions

Regions: "usa-1" | "env"

RunTypeOptions

RunTypeOptions: "node" | "python"

TagTypes

TagTypes: "bucket" | "device" | "dashboard" | "action" | "analysis"

TemplateInstallParams

ThemeOption

ThemeOption: "actionSchedule" | "actionTriggerByData" | "actionTriggerByResource" | "actionTriggerByMQTT" | "alertDangerBackground" | "alertInfoBackground" | "alertWarningBackground" | "analysisExternal" | "analysisInternal" | "buttonDanger" | "buttonDangerText" | "buttonDefault" | "buttonDefaultText" | "buttonDisabled" | "buttonDisabledText" | "buttonIconLabel" | "buttonPrimary" | "buttonPrimaryText" | "buttonSuccess" | "buttonSuccessText" | "buttonWarning" | "buttonWarningText" | "deviceInputOutput1Day" | "deviceInputOutput3Days" | "deviceInputOutput3Hours" | "deviceInputOutput6Hours" | "deviceInputOutputRest" | "dottedBorder" | "dropdownAccent" | "dropdownBackground" | "floatingSidebarTitle" | "footerBackground" | "formControlBorder" | "gaugeEmpty" | "gaugeFill" | "gaugePrimaryText" | "gaugeSecondaryText" | "iconRadioSelected" | "iconRadioSubTitle" | "informationIcon" | "inputBackground" | "inputBackgroundReadOnly" | "inputError" | "inputForeground" | "inputForegroundReadOnly" | "lightBorder" | "limitAlert" | "link" | "listNavColor" | "listTitleLabel" | "loading" | "loginButton" | "loginButtonText" | "loginForeground" | "loginForm" | "modalContainer" | "modalOverlay" | "navbar" | "navbarBetaDeveloperBorder" | "navbarButton" | "navbarDropdownBorder" | "navbarDropdownOption" | "navbarDropdownOptionBorder" | "navbarText" | "navDescription" | "notificationButtonAmount" | "notificationButtonAmountText" | "notificationFilterBackground" | "notificationFooter" | "notificationItemBorder" | "notificationItemDate" | "notificationItemTextAccepted" | "notificationItemUnread" | "primary" | "publicPageNavigationBar" | "sidebarAccessSelected" | "sidebarAccountSelected" | "sidebarActionSelected" | "sidebarAnalysisSelected" | "sidebarBackground" | "sidebarBillingSelected" | "sidebarBucketSelected" | "sidebarDashboardSelected" | "sidebarDeviceSelected" | "sidebarExploreSelected" | "sidebarFileSelected" | "sidebarForegroundIcon" | "sidebarForegroundText" | "sidebarHomeSelected" | "sidebarItem" | "sidebarRibbon" | "sidebarRunSelected" | "sidebarSeparator" | "sidebarSeparatorForeground" | "sidebarUserSelected" | "snakeButtonOutline" | "svgTagoFont" | "svgTagoIOHole" | "switchDisabledBackground" | "switchSlider" | "tabBackground" | "tabLabelBorder" | "tooltipContainer" | "tooltipText" | "verticalTabItem" | "verticalTabItemBorder" | "widgetCardBackground" | "widgetIconsAccent" | "widgetIconsBackground" | "widgetIconsColor" | "widgetIconsFooterBasic" | "widgetIconsFooterPremium" | "auth_bg_opacity" | "auth_bg_src" | "auth_bg_type" | "auth_form_opacity"

TokenCreateResponse

TokenCreateResponse: { expire_date: ExpireTimeOption; permission: PermissionOption; token: GenericToken }

Type declaration

UserQuery

UserQuery: Query<UserInfo, "name" | "active" | "last_login" | "created_at" | "updated_at">

analysisFunction

analysisFunction: (context: any, data: any) => any

Type declaration

    • (context: any, data: any): any
    • Parameters

      • context: any
      • data: any

      Returns any

expireTimestamp

expireTimestamp: number

requestID

requestID: number

valuesTypes

valuesTypes: string | number | boolean | void

widgetOverwrite

widgetOverwrite: {}

Type declaration

widgetOverwriteOptions

widgetOverwriteOptions: "start_date" | "end_date" | "timezone"

Variables

Const RE_MATCH_EXPRESSION

RE_MATCH_EXPRESSION: RegExp = /#([A-Z0-9]+)\.([A-Z0-9_]+(?:,(?:[^,#"]+|\"[^\"]+\")+)*)#/

Const RE_SPLIT_EXPRESSION

RE_SPLIT_EXPRESSION: RegExp = /(#[A-Z0-9]+\.[A-Z0-9_]+(?:,(?:[^,#"]+|\"[^\"]+\")+)*#)/

Const cacheObj

cacheObj: Map<[number, number], any> = new Map<[requestID, expireTimestamp], any>()

Const requestsInProgress

requestsInProgress: Set<number> = new Set<number>()

Functions

addCache

  • addCache(axiosObj: AxiosRequestConfig, obj: any, ttlMS?: number): void
  • Parameters

    • axiosObj: AxiosRequestConfig
    • obj: any
    • Default value ttlMS: number = 5000

    Returns void

addRequestInProgress

  • addRequestInProgress(axiosObj: AxiosRequestConfig): void

checkIfItBrowser

  • checkIfItBrowser(): boolean

clearCache

  • clearCache(): void

clearCacheTTL

  • clearCacheTTL(): void

dateParser

  • dateParser<T>(target: T, parameters: keyof T[]): T
  • Receive an object and a list of parameters to be parsed to Date object

    Type parameters

    • T

    Parameters

    • target: T
    • parameters: keyof T[]

    Returns T

envToJson

  • Convert Environment Array to Object Note: It will replace duplicate keys for the last one

    Parameters

    Returns {}

    • [key: string]: string

generateRequestID

  • generateRequestID(axiosObj: AxiosRequestConfig): number

getCache

  • getCache(axiosObj: AxiosRequestConfig): any

getTokenByName

  • getTokenByName(Account: Account, deviceID: string, names?: string[] | string): Promise<string>
  • Parameters

    • Account: Account
    • deviceID: string

      Id of device

    • Optional names: string[] | string

      Array of names of the token, if null will return the first token found

    Returns Promise<string>

hashGenerator

  • hashGenerator(obj: any): number

isRequestInProgress

  • isRequestInProgress(axiosObj: AxiosRequestConfig): boolean

removeRequestInProgress

  • removeRequestInProgress(axiosObj: AxiosRequestConfig): void

Object literals

Const Utils

Utils: object

envToJson

envToJson: envToJson

getAPIVersion

getAPIVersion: getVersion

getTokenByName

getTokenByName: getTokenByName