TagoIO SDK for JavaScript and TypeScript

Index

Enumerations

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 }

AnalysisID

AnalysisID: string

AnalysisQuery

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

AnalysisToken

AnalysisToken: string

Base64

Base64: string

BucketQuery

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

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 }

DeviceResourceView

DeviceResourceView: ResourceTag | ResourceParam | "name" | "id" | "bucket_name" | "network_name" | "connector_name" | "connector" | "network" | "bucket" | "last_input" | "created_at" | "active"

DictionaryQuery

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

EditDataModel

EditDataModel: PostDataModel & { id: GenericID }

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"

FileURL

FileURL: string

GenericID

GenericID: string

ID used on TagoIO, string with 24 character

GenericToken

GenericToken: string

Token used on TagoIO, string with 36 characters

HexColor

HexColor: string

HexadecimalPayload

HexadecimalPayload: string

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">

NotificationInfo

NotificationInfo: { created_at: Date; id: GenericID } & Required<NotificationCreate>

NotificationQuery

NotificationQuery: Query<{ read: boolean }, "created_at">

OTPType

OTPType: "sms" | "email" | "authenticator"

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"

ResourceParam

ResourceParam: `param.${string}`

ResourceTag

ResourceTag: `tags.${string}`

RunTypeOptions

RunTypeOptions: "node" | "python"

Scope

Scope: (Data | DeviceCreateInfo | { input_form_button_id: string } | MQTTResourceAction)[]

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 chartColors

chartColors: string[] = ["hsl(210, 71%, 70%)","hsl(240, 4%, 27%)","hsl(110, 76%, 71%)","hsl(26, 87%, 61%)","hsl(237, 70%, 71%)","hsl(346, 84%, 65%)","hsl(53, 73%, 61%)","hsl(179, 54%, 37%)","hsl(0, 87%, 66%)","hsl(175, 65%, 74%)","hsl(0, 100%, 28%)","hsl(191, 78%, 45%)","hsl(267, 46%, 30%)","hsl(217, 68%, 68%)","hsl(0, 68%, 46%)","hsl(82, 47%, 60%)",]

These are the default line colors, once one is used the next one will be used and then the next one, then the next...

Const layoutMatrix

layoutMatrix: number[][] = [[1, 2, 3],[4, 5, 6],[7, 8, 9],]

Const requestsInProgress

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

Functions

JSONParseSafe

  • JSONParseSafe(jsonString: string, defaultValue?: any): any

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

convert

convertDefaultValue

  • convertDefaultValue(useCurrentValue: string): string

convertDownsample

  • convertDownsample(oldWidgetDisplay: any): any

convertField

  • convertField(field: any, showMap?: any): any

convertFieldAddress

  • convertFieldAddress(field: any, showMap?: any): any

convertFieldBarCode

  • convertFieldBarCode(field: any): any

convertFieldCalendar

  • convertFieldCalendar(field: any): any

convertFieldCaptureUser

  • convertFieldCaptureUser(field: any): any

convertFieldCheckbox

  • convertFieldCheckbox(field: any): any

convertFieldClockSet

  • convertFieldClockSet(field: any): any

convertFieldDevice

  • convertFieldDevice(field: any): any

convertFieldDropdown

  • convertFieldDropdown(field: any): any

convertFieldDropdownMultiple

  • convertFieldDropdownMultiple(field: any): any

convertFieldEmail

  • convertFieldEmail(field: any): any

convertFieldFileUpload

  • convertFieldFileUpload(field: any): any

convertFieldFilteredVariables

  • convertFieldFilteredVariables(field: any): any

convertFieldHidden

  • convertFieldHidden(field: any): any

convertFieldImageVideoSelect

  • convertFieldImageVideoSelect(field: any): any

convertFieldIncrementalSteps

  • convertFieldIncrementalSteps(field: any): any

convertFieldNumber

  • convertFieldNumber(field: any): any

convertFieldPassword

  • convertFieldPassword(field: any): any

convertFieldQrCode

  • convertFieldQrCode(field: any): any

convertFieldRadio

  • convertFieldRadio(field: any): any

convertFieldText

  • convertFieldText(field: any): any

convertFieldValidation

  • convertFieldValidation(field: any): any

convertFilterBy

  • convertFilterBy(filterBy: string): string

convertFilterVariables

  • convertFilterVariables(filterVariable: any): any

convertFormField

  • convertFormField(field: any): any

convertFormula

  • convertFormula(oldFormula: any): any

convertGeofence

  • convertGeofence(oldDisplay: any): any

convertGroupBy

  • convertGroupBy(oldGroupBy: string): string

convertInterval

  • convertInterval(intv: string): string

convertLayerData

  • convertLayerData(widget: any, oldWidgetData: any): any[]

convertRange

  • convertRange(oldWidgetDisplay: any): any

convertSource

  • convertSource(oldDisplay: any): { static_image: any; type: string } | { conditions: any; type: string }
  • Parameters

    • oldDisplay: any

    Returns { static_image: any; type: string } | { conditions: any; type: string }

convertState

  • convertState(oldState: any): any

convertSubmitButton

  • convertSubmitButton(oldDisplay: any, runAnalysis: string): Object

convertVisualField

  • convertVisualField(field: any): any

createEditObject

  • createEditObject(formField: any): any

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

generateWidgetItemID

  • generateWidgetItemID(): string

getCache

  • getCache(axiosObj: AxiosRequestConfig): any

getDevice

  • getDevice(account: Account, device_id: string): Promise<Device>

getTokenByName

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

    • account: Account

      Account instance

    • 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

Const isNumber

  • isNumber(s: any): boolean

isOldStructure

  • isOldStructure(widget: any): boolean
  • The note has the OLD structure if the display contains a TEXT property.

    Parameters

    • widget: any

    Returns boolean

isRequestInProgress

  • isRequestInProgress(axiosObj: AxiosRequestConfig): boolean

isValidMode

  • isValidMode(mode: string): boolean

parseQRCode

  • Parse a LoRaWAN QR Code string to JSON format. example:

    Parameters

    • qr_code: string

      QR Code string, example: LW:D0:1122334455667788:AABBCCDDEEFF0011:AABB1122:OAABBCCDDEEFF:SYYWWNNNNNN:PFOOBAR:CAF2C

    Returns QRCodeFormat

parserIcon

  • parserIcon(cssClass: string): string

removeHttpFromURL

  • removeHttpFromURL(url: any): string

removeRequestInProgress

  • removeRequestInProgress(axiosObj: AxiosRequestConfig): void

sendDownlink

  • Perform downlink to a device using official TagoIO support.

    Parameters

    • account: Account

      TagoIO SDK Account instanced class

    • device_id: string

      id of your device

    • dn_options: DownlinkOptions

      downlink parameter options.

    Returns Promise<string>

updateMultipleDropdown

  • updateMultipleDropdown(device: Device, variables: string | string[], values: string | string[]): Promise<void>
  • Go through variables used in Multiple Dropdown variables and remove a specified value. Then updates the variables.

    Parameters

    • device: Device

      TagoIO Device instanced class.

    • variables: string | string[]

      variables inside the device to be verified.

    • values: string | string[]

    Returns Promise<void>

uploadFile

Object literals

Const Utils

Utils: object

AnalysisRouter

AnalysisRouter: AnalysisRouter

envToJson

envToJson: envToJson

getAPIVersion

getAPIVersion: getVersion

getDevice

getDevice: getDevice

getTokenByName

getTokenByName: getTokenByName

parseLorawanQRCode

parseLorawanQRCode: parseQRCode

sendDownlink

sendDownlink: sendDownlink

updateMultipleDropdown

updateMultipleDropdown: updateMultipleDropdown

uploadFile

uploadFile: uploadFile

Const dynamicTableConfig

dynamicTableConfig: object

cellFilterHeight

cellFilterHeight: number = 56

cellHeight

cellHeight: number = 28

defaultControlColumn

defaultControlColumn: object

alias

alias: string = "Controls"

alignment

alignment: string = "center"

delete_cancel_text

delete_cancel_text: string = "Cancel"

delete_confirm_text

delete_confirm_text: string = "Yes, delete row"

delete_message

delete_message: string = "Do you really want to delete this row?"

delete_title

delete_title: string = "Delete row"

fixed_width

fixed_width: number = 33

id

id: string = "control"

is_control

is_control: boolean = true

overflow_behavior

overflow_behavior: string = "stretch"

show_delete

show_delete: boolean = true

show_edit

show_edit: boolean = true

size

size: string = "fixed"

defaultDateColumn

defaultDateColumn: object

alias

alias: string = "Date and Time"

allow_resize

allow_resize: boolean = true

fixed_width

fixed_width: number = 100

id

id: string = "date"

is_date

is_date: boolean = true

overflow_behavior

overflow_behavior: string = "stretch"

size

size: string = "auto"