repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
guidiaalo/sdk-js
src/modules/Account/Notifications.ts
import { GenericID, GenericToken } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { NotificationInfo, NotificationQuery } from "./notifications.types"; class Notifications extends TagoIOModule<Generic...
guidiaalo/sdk-js
src/modules/Migration/compose.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old COMPOSE to new COMPOSE // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.type...
guidiaalo/sdk-js
src/modules/Migration/map.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old MAP to new MAP // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; import { convertFor...
guidiaalo/sdk-js
src/modules/RunUser/SDB.ts
import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; class SDB extends TagoIOModule<GenericModuleParams> { /** * Retrieves a custom parameter of a Run user. * The Run user is identified by the token in the constructor. * @param tagoRunURL TagoIO Run url without http * @param key...
guidiaalo/sdk-js
src/common/common.types.ts
interface Metadata { color?: string; x?: string | number; y?: string | number; label?: string; file?: { url: string; md5: string; path: string; }; icon?: string; fixed_position?: { [key: string]: { color: string; icon: string; value: string; x: string; y: st...
guidiaalo/sdk-js
src/modules/Network/Network.ts
<reponame>guidiaalo/sdk-js<filename>src/modules/Network/Network.ts import TagoIOModule, { ConnectorModuleParams } from "../../common/TagoIOModule"; import { NetworkDeviceListQuery, INetworkInfo, NetworkDeviceListQueryInfo } from "./network.types"; import { GenericID, GenericToken } from "../../common/common.types"; imp...
guidiaalo/sdk-js
src/modules/Services/Attachment.ts
<reponame>guidiaalo/sdk-js import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { Base64 } from "../../common/common.types"; interface ArchiveFile { name: string; content: Base64; type: string; } class Attachment extends TagoIOModule<GenericModuleParams> { /** * Send Attac...
guidiaalo/sdk-js
src/modules/Migration/clock.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old CLOCK to new CLOCK. // ? ==================================================================================== import { WidgetInfo } from "../Account/dashb...
guidiaalo/sdk-js
src/modules/Utils/parseLorawanQRCode.ts
<reponame>guidiaalo/sdk-js import { QRCodeFormat } from "./utils.types"; /** * Parse a LoRaWAN QR Code string to JSON format. * example: * @param qr_code QR Code string, example: LW:D0:1122334455667788:AABBCCDDEEFF0011:AABB1122:OAABBCCDDEEFF:SYYWWNNNNNN:PFOOBAR:CAF2C */ function parseQRCode(qr_code: string): QRCod...
guidiaalo/sdk-js
src/modules/Account/PaymentMethods.ts
<filename>src/modules/Account/PaymentMethods.ts<gh_stars>1-10 import { GenericID, GenericToken } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; interface PaymentMethodCreateInfo { name: string; token: GenericToken; brand?: string; default_card?:...
guidiaalo/sdk-js
src/modules/Account/run.types.ts
<gh_stars>1-10 import { ExpireTimeOption, GenericID, GenericToken, Query, TagsObj } from "../../common/common.types"; import { NotificationButton, NotificationCreate } from "./notifications.types"; interface RunInfo { profile: GenericID; active: boolean; name: string; sub_title: string; url: string; email_...
guidiaalo/sdk-js
src/modules/Account/paymentHistory.types.ts
<reponame>guidiaalo/sdk-js import { GenericID } from "../../common/common.types"; interface PaymentInfo { status: boolean; result: [ { id: GenericID; stripe_id: GenericID; account: GenericID; info: string; notes: string; invoice_number: number; invoice_code: string; ...
guidiaalo/sdk-js
src/modules/Device/types.ts
<reponame>guidiaalo/sdk-js export * as Device from "./device.types";
guidiaalo/sdk-js
src/modules/Account/Run.ts
<filename>src/modules/Account/Run.ts import { GenericID, RecursivePartial } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { NotificationCreate, NotificationInfo } from "./notifications.types"; import ...
guidiaalo/sdk-js
src/modules/Utils/sendDownlink.ts
import axios from "axios"; import Account from "../Account/Account"; import { DownlinkOptions } from "./utils.types"; /** * Perform downlink to a device using official TagoIO support. * @param {Class} account TagoIO SDK Account instanced class * @param {String} device_id id of your device * @param {Object} dn_opti...
guidiaalo/sdk-js
src/modules/Account/account.types.ts
import { GenericID } from "../../common/common.types"; interface AccountCreateInfo { /** * Name of the account */ name: string; /** * Email of the account */ email: string; /** * Password of the account */ password: string; /** * Password confirmation */ cpassword: string; /**...
guidiaalo/sdk-js
__tests__/Migration/removeHttpFromUrl.ts
<gh_stars>1-10 import removeHttpFromURL from "../../src/modules/Migration/common/removeHttpFromURL"; describe("removeHttpFromURL - migration suite", () => { it("removes HTTP(s) from URLs correctly", () => { const url = "https://tago.io"; const url2 = "http://tago.io"; const url3 = "tago.io"; expect(r...
guidiaalo/sdk-js
src/modules/Utils/envToJson.ts
<gh_stars>1-10 import { AnalysisEnvironment } from "../Analysis/analysis.types"; /** * Convert Environment Array to Object * Note: It will replace duplicate keys for the last one * @param environment Array of environment items from TagoIO */ function envToJson(environment: AnalysisEnvironment[]): { [key: string]: ...
guidiaalo/sdk-js
src/modules/Migration/common/convertInterval.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Converts the OLD INTERVAL to BLUEPRINT interval // ? ==================================================================================== function convertInterval(intv: string): strin...
guidiaalo/sdk-js
src/modules/Utils/updateMultipleDropdown.ts
<reponame>guidiaalo/sdk-js import Device from "../Device/Device"; /** * Go through variables used in Multiple Dropdown variables and remove a specified value. * Then updates the variables. * @param device TagoIO Device instanced class. * @param variables variables inside the device to be verified. * @param value ...
guidiaalo/sdk-js
src/modules/Account/types.ts
export * as Account from "./account.types"; export * as Access from "./access.types"; export * as Actions from "./actions.types"; export * as Analysis from "./analysis.types"; export * as Buckets from "./buckets.types"; export * as Dashboards from "./dashboards.types"; export * as Devices from "./devices.types"; export...
guidiaalo/sdk-js
src/modules/Utils/getDevice.ts
<gh_stars>1-10 import Account from "../Account/Account"; import Device from "../Device/Device"; import getTokenByName from "./getTokenByName"; /** * Get the TagoIO Device instanced class from a device id */ async function getDevice(account: Account, device_id: string): Promise<Device> { if (!(account instanceof Ac...
guidiaalo/sdk-js
src/modules/Migration/horizontalbarchart.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old HORIZONTAL BAR CHART to new HORIZONTAL BAR CHART // ? ==================================================================================== import { WidgetInfo } from "../Account/dash...
guidiaalo/sdk-js
src/modules/Account/Dashboards.ts
<reponame>guidiaalo/sdk-js<filename>src/modules/Account/Dashboards.ts import { ExpireTimeOption, GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { InviteInfo, InviteResponse } from "./_share.types"; import Widgets from "./Dashboard.Widg...
guidiaalo/sdk-js
src/modules/Migration/common/index.ts
import chartColors from "./chartColors"; import convertDownsample from "./convertDownsample"; import convertFormula from "./convertFormula"; import convertInterval from "./convertInterval"; import convertRange from "./convertRange"; import generateWidgetItemId from "./generateWidgetItemId"; import removeHttpFromURL fro...
guidiaalo/sdk-js
src/modules/Migration/inputform.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old INPUT FORM to new INPUT FORM // ? ==================================================================================== import { WidgetInfo } from "../Accou...
guidiaalo/sdk-js
src/modules/Account/template.types.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { GenericID } from "../../common/common.types"; interface TemplateObjDashboard { dashboard: GenericID; name: string; image_logo?: string; image_main?: string; /** * Dashboard Setup Object */ setup?: any; } interface TemplateObjAnalysis { analysis: Ge...
guidiaalo/sdk-js
src/modules/Migration/common/chartColors.ts
/** * 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 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%...
guidiaalo/sdk-js
__tests__/Migration/stepbutton.ts
import { convert, isOldStructure } from "../../src/modules/Migration/stepbutton"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.stepbuttonStructure; const oldWidget2 = oldStructure.stepbuttonStructure2; describe("StepButton widget - migration suite", () => { /*...
guidiaalo/sdk-js
src/modules/Account/explore.types.ts
import { GenericID } from "../../common/common.types"; interface ExploreInfo { id: GenericID; name: string; desc_full: string; desc_short: string; main_image: string; visible: true; tags: string[]; dashboard_id: GenericID; company: { name: string; website: string; logo_url: string; }; ...
guidiaalo/sdk-js
src/modules/Device/Device.ts
<gh_stars>1-10 import chunk from "lodash.chunk"; import Batch from "../../common/BatchRequest"; import { Data, GenericID } from "../../common/common.types"; import sleep from "../../common/sleep"; import TagoIOModule from "../../common/TagoIOModule"; import { ConfigurationParams } from "../Account/devices.types"; impor...
guidiaalo/sdk-js
__tests__/Migration/inputform.ts
<reponame>guidiaalo/sdk-js import { InputFormField } from "../../src/modules/Migration/convertFields"; import { convert, isOldStructure } from "../../src/modules/Migration/inputform"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.inputformStructure; const oldWidge...
guidiaalo/sdk-js
src/modules/Utils/dateParser.ts
/** * Receive an object and a list of parameters to be parsed to Date object */ export default function dateParser<T>(target: T, parameters: (keyof T)[]): T { target = { ...target }; for (const parameter of parameters) { const value: unknown = target[parameter]; if (value && typeof value === "string" &...
guidiaalo/sdk-js
src/modules/Migration/common/generateWidgetItemId.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Generates a random unique ID for a widget item in an array. // ? ==================================================================================== import { nanoid } from "nanoid"; function gener...
guidiaalo/sdk-js
src/modules/Migration/grainbin.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old GRAINBIN to new GRAINBIN // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; export f...
guidiaalo/sdk-js
src/modules/Account/ServiceAuthorization.ts
<gh_stars>1-10 import { GenericToken, ListTokenQuery, TokenCreateResponse, TokenData, TokenDataList } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; class ServiceAuthorization extends TagoIOModule<GenericMod...
guidiaalo/sdk-js
src/modules/Account/Files.ts
<filename>src/modules/Account/Files.ts import FormData from "form-data"; import { GenericID } from "../../common/common.types"; import sleep from "../../common/sleep"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { Base64File, CopyFi...
guidiaalo/sdk-js
__tests__/Dictionary/resolveExpression.ts
import { Dictionary } from "../../src/modules"; import { enUS, ptBR } from "./__mocks__/dictionaries"; describe("resolveExpression", () => { let dictionary: Dictionary; let fn: jest.SpyInstance; beforeAll(() => { dictionary = new Dictionary({ token: "mockToken" }); // Mock the function that gets data ...
guidiaalo/sdk-js
src/common/BatchRequest.ts
<gh_stars>1-10 import TagoIOModule, { GenericModuleParams } from "./TagoIOModule"; import { Method } from "axios"; interface BatchData { method?: Method; endpoint: string; headers: {}; } class Batch extends TagoIOModule<GenericModuleParams> { /** * Send a batch commands * Examples: * ```json * [ ...
guidiaalo/sdk-js
src/modules/Utils/utils.types.ts
<gh_stars>1-10 import { GenericID, Query } from "../../common/common.types"; interface QRCodeFormat { type: string; schema_id: string; join_eui: string; dev_eui: string; profile_id: string; owner_token?: string; sn_number?: string; proprietary?: string; checksum?: string; } interface UploadFileOptio...
guidiaalo/sdk-js
src/modules/Migration/heatmap.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old HEAT MAP to new HEAT MAP // ? ==================================================================================== import { WidgetInfo } from "../Account/d...
guidiaalo/sdk-js
src/modules/Account/notifications.types.ts
import { GenericID, Query } from "../../common/common.types"; interface NotificationTriggerAnalysis { analysis_id: GenericID; } interface NotificationTriggerHTTP { url: string; method: "POST" | "GET" | "PUT" | "DELETE" | "REDIRECT"; body: { [key: string]: any }; } interface NotificationTriggerProfile { share...
guidiaalo/sdk-js
src/modules/Account/analysis.types.ts
<gh_stars>1-10 import { Base64, RunTypeOptions, GenericID, TagsObj, Query, ExpireTimeOption } from "../../common/common.types"; interface ScriptFile { name: string; content: Base64; language: RunTypeOptions; } interface AnalysisCreateInfo { name: string; description?: string | null; interval?: string; r...
guidiaalo/sdk-js
src/modules/Services/SMS.ts
import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; interface SMSData { /** * Number to send SMS, Example: +5599999999999 */ to: string; /** * Message to be send */ message: string; } class SMS extends TagoIOModule<GenericModuleParams> { /** * Send SMS to phone numb...
guidiaalo/sdk-js
src/modules/Account/_share.types.ts
<gh_stars>1-10 import { ExpireTimeOption, GenericID, PermissionOption } from "../../common/common.types"; interface InviteResponse { expire_time: ExpireTimeOption; id: GenericID; } interface InviteInfo { permission?: PermissionOption; status?: string; copy_me?: boolean; expire_time?: ExpireTimeOption; a...
guidiaalo/sdk-js
src/common/TagoIOModule.ts
<reponame>guidiaalo/sdk-js import { AxiosRequestConfig, Method } from "axios"; import qs from "qs"; import apiRequest from "../infrastructure/apiRequest"; import regions, { Regions } from "../regions"; import { RefType, GenericID } from "./common.types"; interface GenericModuleParams { token?: string; region?: Reg...
guidiaalo/sdk-js
src/infrastructure/apiSocket.ts
<gh_stars>1-10 import io from "socket.io-client"; import config from "../config"; import regions from "../regions"; import { GenericModuleParams } from "../common/TagoIOModule"; /** * TagoIO Socket Connection * In some cases you will should emit channels to subscribe/unsubscribe * example: * - socket.emit('attach...
guidiaalo/sdk-js
src/modules/Account/plan.types.ts
import { ExpireTimeOption, GenericID } from "../../common/common.types"; interface PlanSetInfo { plan: string; sms?: number; email?: number; data_records?: number; device_request?: number; analysis?: number; } interface PlanInfo extends PlanSetInfo { id: GenericID; active: number; end_date: Date | n...
guidiaalo/sdk-js
__tests__/Migration/multipleaxischart.ts
<gh_stars>1-10 import { convert, isOldStructure } from "../../src/modules/Migration/multipleaxischart"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.multipleaxischartStructure; describe("Multiple axis chart widget - migration suite", () => { /** * Tests to ...
guidiaalo/sdk-js
__tests__/Utils/analysisRouter.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { Account, Device } from "../../src/modules"; import AnalysisRouter, { RouterConstructor } from "../../src/modules/Utils/router/router"; const func = async () => { return true; }; const params: RouterConstructor = { environment: { _action_when: "create", _widget_exe...
guidiaalo/sdk-js
__tests__/Dictionary/parseExpression.ts
import { Dictionary } from "../../src/modules"; describe("parseExpression", () => { let dictionary: Dictionary; beforeAll(() => { dictionary = new Dictionary({ token: "mockToken" }); }); it("parses an expression without parameters", () => { const parsed = dictionary.parseExpression("#TEST.TEST_KEY#")...
guidiaalo/sdk-js
src/modules/Device/device.types.ts
<reponame>guidiaalo/sdk-js import { Data, GenericID, GenericToken, TagsObj } from "../../common/common.types"; import { Regions } from "../../regions"; interface DeviceInfo { id: GenericID; profile: string; bucket: { id: GenericID; name: string; }; name: string; description: string | void; visibl...
guidiaalo/sdk-js
__tests__/Utils/parseLorawanQRcode.ts
import { Account, Device, Utils } from "../../src/modules"; const func = async () => { return true; }; describe("Parse LoRaWAN QR Code", () => { test("8 Fields Success", async () => { const scope = [ { variable: "test", value: 1, origin: "", time: new Date(), serie: "123" }, { input_form_button_id...
guidiaalo/sdk-js
src/modules/Utils/types.ts
export * as Utils from "./utils.types";
guidiaalo/sdk-js
src/modules/Account/dictionaries.types.ts
import { GenericID, Query } from "../../common/common.types"; interface DictionaryCreateInfo { name: string; slug: string; fallback: string; } interface DictionaryLanguage { code: string; active: boolean; } interface DictionaryInfo extends DictionaryCreateInfo { id: GenericID; languages: DictionaryLang...
guidiaalo/sdk-js
__tests__/Migration/dynamic_table.ts
<filename>__tests__/Migration/dynamic_table.ts<gh_stars>1-10 import { dynamicTableConfig, convert, isOldStructure } from "../../src/modules/Migration/dynamic_table"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget1 = oldStructure.dynamicTableStructure; const oldWidget2 = oldStruct...
guidiaalo/sdk-js
__tests__/Dictionary/getExpressionsFromString.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { Dictionary } from "../../src/modules"; describe("getExpressionsFromString", () => { let dictionary: Dictionary; beforeAll(() => { dictionary = new Dictionary({ token: "mockToken" }); }); it("gets expressions from a well separated string", async () => { ...
guidiaalo/sdk-js
src/modules/Account/Tags.ts
<filename>src/modules/Account/Tags.ts import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; type TagTypes = "bucket" | "device" | "dashboard" | "action" | "analysis"; class Tags extends TagoIOModule<GenericModuleParams> { /** * Get all Keys from certain type of section * @param type L...
guidiaalo/sdk-js
src/modules/Analysis/Analysis.ts
import TagoIOModule from "../../common/TagoIOModule"; import ConsoleService from "../Services/Console"; import apiSocket, { channels } from "../../infrastructure/apiSocket"; import { AnalysisConstructorParams, analysisFunction, AnalysisEnvironment } from "./analysis.types"; import { JSONParseSafe } from "../../common/J...
guidiaalo/sdk-js
src/modules/Account/Integration.Networks.ts
<filename>src/modules/Account/Integration.Networks.ts<gh_stars>1-10 import { GenericID, GenericToken, ListTokenQuery, TokenCreateResponse, TokenData } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { N...
guidiaalo/sdk-js
src/common/RequestInProgress.ts
<filename>src/common/RequestInProgress.ts import { AxiosRequestConfig } from "axios"; import { generateRequestID } from "./HashGenerator"; const requestsInProgress = new Set<number>(); function addRequestInProgress(axiosObj: AxiosRequestConfig): void { requestsInProgress.add(generateRequestID(axiosObj)); } functio...
guidiaalo/sdk-js
__tests__/Migration/compose.ts
import { convert, isOldStructure } from "../../src/modules/Migration/compose"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.composeStructure; describe("Compose widget - migration suite", () => { /** * Tests to see if the root properties have been transferre...
guidiaalo/sdk-js
src/modules/Migration/note.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old NOTE to new NOTE // ? ==================================================================================== import { WidgetInfo } from "../Acc...
guidiaalo/sdk-js
src/modules/Account/Plan.ts
<gh_stars>1-10 import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { CurrentPrices, PlanInfo, PlanSetInfo, Summary } from "./plan.types"; class Plan extends TagoIOModule<GenericModuleParams> { /** * Active plan and set services limit ...
guidiaalo/sdk-js
src/modules/Utils/router/router.ts
<gh_stars>1-10 import { Data } from "../../../common/common.types"; import Account from "../../Account/Account"; import { MQTTResourceAction } from "../../Account/actions.types"; import { DeviceCreateInfo } from "../../Account/devices.types"; import { TagoContext } from "../../Analysis/analysis.types"; import Device fr...
guidiaalo/sdk-js
src/modules/Migration/statictable.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old STATIC TABLE to new STATIC TABLE // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; i...
guidiaalo/sdk-js
src/modules/Migration/common/convertDownsample.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Converts the OLD DOWNSAMPLE to new DOWNSAMPLE // ? ==================================================================================== function convertDownsample(oldWidgetDisplay: any): any { con...
guidiaalo/sdk-js
src/modules/RunUser/RunUser.ts
import { GenericID, GenericToken } from "../../common/common.types"; import TagoIOModule, { doRequestParams, GenericModuleParams } from "../../common/TagoIOModule"; import { Regions } from "../../regions"; import { NotificationInfo, NotificationQuery } from "../Account/notifications.types"; import { OTPType } from "../...
guidiaalo/sdk-js
src/modules/Migration/card.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old CARD to new CARD. // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; i...
guidiaalo/sdk-js
src/modules/Services/MQTT.ts
<gh_stars>1-10 import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { GenericID } from "../../common/common.types"; interface MQTTData { /** * Topic of the message */ topic: string; /** * Message scope */ message: string; /** * Bucket to receive message */ ...
guidiaalo/sdk-js
src/modules/Account/PaymentHistory.ts
<filename>src/modules/Account/PaymentHistory.ts import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { PaymentInfo } from "./paymentHistory.types"; class PaymentHistory extends TagoIOModule<GenericModuleParams> { /** * Get the payment History of the current account */ public ...
guidiaalo/sdk-js
src/types.ts
export * as Common from "./common/common.types"; export * as Account from "./modules/Account/types"; export * as Analysis from "./modules/Analysis/types"; export * as Device from "./modules/Device/types"; export * as Authorization from "./modules/Authorization/types"; export * as RunUser from "./modules/RunUser/types";...
guidiaalo/sdk-js
src/infrastructure/isBrowser.ts
<reponame>guidiaalo/sdk-js function checkIfItBrowser(): boolean { let isBrowser = true; if (typeof process === "object") { if (typeof process.versions === "object") { if (typeof process.versions.node !== "undefined") { isBrowser = false; } } } if (typeof window === "object") { ...
guidiaalo/sdk-js
__tests__/Migration/angular.ts
import { convert, isOldStructure } from "../../src/modules/Migration/angular"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.angularStructure; describe("angular widget - migration suite", () => { /** * Tests to see if the root properties have been transferre...
guidiaalo/sdk-js
__tests__/Migration/map.ts
import { convert, isOldStructure } from "../../src/modules/Migration/map"; import * as oldStructure from "./__mocks__/mapOldStructure.json"; const oldWidget = oldStructure.normalStructure; const oldWidgetFilterDevice = oldStructure.filterByDevice; const oldWidgetFilterValue = oldStructure.filterByValue; const oldWidge...
guidiaalo/sdk-js
__tests__/Utils/dateParser.ts
<reponame>guidiaalo/sdk-js import dateParser from "../../src/modules/Utils/dateParser"; describe("Object parameter date parser", () => { test("Should work with data string", () => { let data = { a: "2020-09-28T18:10:21.000Z", b: "test", }; data = dateParser(data, ["a"]); // @ts-ignore ...
guidiaalo/sdk-js
src/modules/Migration/pushbutton.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old PUSH BUTTON to new PUSH BUTTON // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; fu...
guidiaalo/sdk-js
src/modules/Migration/custom.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old CUSTOM to new CUSTOM // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; export funct...
guidiaalo/sdk-js
__tests__/Dictionary/getLanguagesData.ts
import express, { Express } from "express"; import http from "http"; import { AddressInfo } from "net"; import { Dictionary } from "../../src/modules"; describe("getLanguagesData", () => { let app: Express; let service: http.Server; let dictionary: Dictionary; let url: string; let body: object; const slu...
guidiaalo/sdk-js
src/modules/Migration/common/convertRange.ts
<filename>src/modules/Migration/common/convertRange.ts // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Converts the OLD RANGE to BLUEPRINT RANGE // ? ==================================================================================== const isNum...
guidiaalo/sdk-js
src/modules/Account/access.types.ts
<filename>src/modules/Account/access.types.ts import { GenericID, TagsObj, Query } from "../../common/common.types"; interface AccessCreateInfo { name: string; // TODO: permissions type permissions: []; // TODO: target type targets: []; profile?: GenericID; tags?: TagsObj[]; active?: number; } interfa...
guidiaalo/sdk-js
src/modules/Network/network.types.ts
import { Query } from "../../common/common.types"; import { DeviceInfo } from "../Device/device.types"; interface IDeviceParameters { name?: string; label?: string; type?: "text" | "dropdown" | "switch" | "number"; default?: any; group?: "default" | "main" | "advanced" | "hide"; options?: any[]; // optiona...
guidiaalo/sdk-js
src/modules/Account/Dashboard.Widgets.ts
import { Data, GenericID, GenericToken } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { EditDataModel, EditDeviceResource, EditResourceOptions, GetDataModel, PostDataModel, WidgetInfo, } from "./dashboards.types"; class Widgets exte...
guidiaalo/sdk-js
src/common/Cache.ts
<filename>src/common/Cache.ts import { AxiosRequestConfig } from "axios"; import { generateRequestID } from "./HashGenerator"; type requestID = number; type expireTimestamp = number; const cacheObj = new Map<[requestID, expireTimestamp], any>(); function clearCacheTTL() { for (const item of cacheObj.keys()) { ...
guidiaalo/sdk-js
__tests__/Dictionary/getValueFromKey.ts
<reponame>guidiaalo/sdk-js import { Dictionary } from "../../src/modules"; import { enUS, ptBR } from "./__mocks__/dictionaries"; describe("getValueFromKey", () => { let dictionary: Dictionary; let fn: jest.SpyInstance; beforeAll(() => { dictionary = new Dictionary({ token: "mockToken" }); // Mock the...
guidiaalo/sdk-js
__tests__/Device/sendData.ts
import express, { Express } from "express"; import http from "http"; import { Device } from "../../src/modules"; import { AddressInfo } from "net"; describe("Device class", () => { let app: Express; let service: http.Server; beforeEach((done) => { const startServer = () => { app = express(); app....
guidiaalo/sdk-js
src/modules/Utils/router/service.ts
<reponame>guidiaalo/sdk-js import { RouterConstructor } from "./router"; class RouterService { private serviceFunction: Function; private whenList: Function[] = []; constructor(service: Function) { this.serviceFunction = service; } private addFunc(func: Function) { this.whenList.push(func); } /*...
guidiaalo/sdk-js
src/modules/Account/Profile.ts
import { GenericID, GenericToken, ListTokenQuery, TokenCreateResponse, TokenData, TokenDataList, } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { AddonInfo, AuditLog, AuditLogFilter...
guidiaalo/sdk-js
src/modules/Account/Account.ts
import Batch from "../../common/BatchRequest"; import { GenericToken } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams, doRequestParams } from "../../common/TagoIOModule"; import Access from "./Access"; import { AccountCreateInfo, AccountInfo, LoginResponse, OTPType, TokenCreateInfo } from ...
guidiaalo/sdk-js
src/modules/Services/Console.ts
<reponame>guidiaalo/sdk-js import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; class ConsoleService extends TagoIOModule<GenericModuleParams> { /** * Log message in analysis console * @param message Log message * @param time Date of message */ public async log(message: string...
guidiaalo/sdk-js
src/modules/Migration/solid.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old SOLID to new SOLID // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; import { conver...
guidiaalo/sdk-js
src/modules.ts
export { default as Device } from "./modules/Device/Device"; export { default as Analysis } from "./modules/Analysis/Analysis"; export { default as Account } from "./modules/Account/Account"; export { default as Services } from "./modules/Services/Services"; export { default as Network } from "./modules/Network/Network...
guidiaalo/sdk-js
src/modules/Analysis/types.ts
<reponame>guidiaalo/sdk-js export * as Analysis from "./analysis.types";
guidiaalo/sdk-js
src/modules/Services/Email.ts
<filename>src/modules/Services/Email.ts import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; interface AttachmentOptions { /** * Archive itself */ archive: string; /** * Name for the archive */ filename: string; } interface TemplateOptions { /** * Template name * ...
guidiaalo/sdk-js
src/modules/Account/Buckets.ts
import { ExportOption, GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { BucketCreateInfo, BucketDeviceInfo, BucketInfo, BucketQuery, ExportBucket, ExportBucketOption, ListVari...
guidiaalo/sdk-js
src/modules/Network/types.ts
<reponame>guidiaalo/sdk-js<filename>src/modules/Network/types.ts export * as Network from "./network.types";
guidiaalo/sdk-js
src/modules/Migration/Migration.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { WidgetInfo } from "../Account/dashboards.types"; import { convert as convertAngular, isOldStructure as isOldStructureAngular } from "./angular"; import { convert as convertAreaChart, isOldStructure as isOldStructureAreaChart } from "./areachart"; import { convert as con...
guidiaalo/sdk-js
src/modules/Migration/display.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old DISPLAY to new DISPLAY // ? ==================================================================================== import { WidgetInfo } from "...
guidiaalo/sdk-js
src/modules/Migration/common/convertFormula.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Converts the OLD FORMULA to BLUEPRINT FORMULA // ? ==================================================================================== function convertFormula(oldFormula: any): any { if (!oldForm...
mattbegent/angular2-testing
app/app.component.ts
import { Component } from 'angular2/core'; import { ProductService } from './services/product.service'; import { ProductsComponent } from './products.component'; import { ProductDetailComponent } from './product-detail.component'; import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router'; ...