repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
wyqydsyq/unicycle
src/client/index.ts
import { setup } from '@cycle/run' import { makeHTTPDriver } from '@cycle/http' import { makeDOMDriver } from '@cycle/dom' import { makeHistoryDriver } from '@cycle/history' import { timeDriver } from '@cycle/time' import ClientRoutes from './routes' import Main from './main' // register ServiceWorker require('offlin...
wyqydsyq/unicycle
src/client/main.ts
<gh_stars>1-10 import xs from 'xstream' import switchPath from 'switch-path' import { div } from '@cycle/dom' import ClientRoutes from './routes' export default function Main(sources) { // define routes const route$ = sources.History.map(route => { const {path, value: Page} = switchPath(route.pathname, Clien...
wyqydsyq/unicycle
src/client/components/helloTimer/index.ts
import xs from 'xstream' import { div } from '@cycle/dom' import { classes, Styles as GlobalStyles } from '../../styles' export const HelloTimer = (sources) => ({ DOM: sources.Time.periodic(1000) .startWith(0) .map(elapsed => div({class: classes(GlobalStyles.Hero)}, `🕐 ${elapsed} seconds have elapsed.`)) }...
wyqydsyq/unicycle
src/server/index.ts
import * as koa from 'koa' import * as send from 'koa-send' import * as serve from 'koa-static' import * as mount from 'koa-mount' import { run } from '@cycle/run' import { makeHTTPDriver } from '@cycle/http' import { makeHTMLDriver } from '@cycle/html' import { makeServerHistoryDriver } from '@cycle/history' import { ...
mgubaidullin/karavan-vscode
webview/prerender.tsx
<reponame>mgubaidullin/karavan-vscode<filename>webview/prerender.tsx import * as React from "react"; import { renderToString } from "react-dom/server"; import App from "./App"; export default () => { const html = renderToString(<App></App>); return ` <!DOCTYPE html> <html lang="en"> <head> <...
mgubaidullin/karavan-vscode
webview/model/DslMetaModel.tsx
export class DslMetaModel { name: string = '' uri?: string title: string = '' description: string = '' label: string = '' javaType: string = '' properties: any; public constructor(init?: Partial<DslMetaModel>) { Object.assign(this, init); } } export class DslProperty { ...
mgubaidullin/karavan-vscode
webview/model/CamelModel.tsx
/** * Generated by karavan build tools - do NOT edit this file! */ import {v4 as uuidv4} from 'uuid' import {CamelApi} from "../api/CamelApi"; export class Metadata { name: string = ''; public constructor(init?: Partial<Metadata>) { Object.assign(this, init); } } export class Spec { flows: ...
mgubaidullin/karavan-vscode
webview/App.tsx
import * as React from "react"; import { Page, } from "@patternfly/react-core"; import {CamelElement, Integration} from "./model/CamelModel"; import {DesignerPage} from "./designer/DesignerPage"; import vscode from "./vscode"; import {KameletApi} from "./api/KameletApi"; interface Props { } interface State { name...
mgubaidullin/karavan-vscode
webview/api/EventBus.tsx
import {Subject} from 'rxjs'; import {CamelElement} from "../model/CamelModel"; import {InOut} from "../model/ConnectionModels"; const positions = new Subject<DslPosition>(); export class DslPosition { step: CamelElement = new CamelElement("") rect: DOMRect = new DOMRect() constructor(step: CamelElement,...
mgubaidullin/karavan-vscode
webview/designer/DslElement.tsx
import React from 'react'; import { Text, Tooltip, } from '@patternfly/react-core'; import '../karavan.css'; import AddIcon from "@patternfly/react-icons/dist/js/icons/plus-circle-icon"; import DeleteIcon from "@patternfly/react-icons/dist/js/icons/times-icon"; import {CamelElement, Otherwise, ProcessorStep, WhenSt...
samolevich/OMDb
src/app/input/input.component.ts
<filename>src/app/input/input.component.ts import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-input', templateUrl: './input.component.html', styleUrls: ['./input.component.scss'], }) export class InputComponent { movieTitle = '' results = false movies = [] dynamicSearch() { ...
binerdy/denote-kit
@0.1.2/io/read.ts
<reponame>binerdy/denote-kit<gh_stars>0 import { existsSync } from "https://deno.land/std/fs/mod.ts"; import { SourceFolderEmptyError, SourceFolderMissingError } from "./errors.ts"; import { DenoteConfig } from "../config.ts"; function loadSourceFilePaths(sourceConfig: DenoteConfig): string[] { const sourceFolderPat...
binerdy/denote-kit
@0.1.2/io/errors.ts
export class SourceFolderEmptyError extends Error { constructor(filePath: string, fileExtension: string) { super("Source folder is empty."); this.message = `${this.message}\nPath: ${filePath}\nExtension: ${fileExtension}\nStacktrace:`; } } export class SourceFolderMissingError extends Error { const...
binerdy/denote-kit
@0.1.2/denote_kit.ts
import { compile } from "./compiler/compiler.ts"; import { write } from "./io/write.ts"; import { getTemplate, loadSourceFileContents } from "./io/read.ts"; import { DenoteConfig, IDenoteConfig } from "./config.ts"; export function denote(config: IDenoteConfig): void { console.time("compiling finished"); const so...
binerdy/denote-kit
@0.1.2/compiler/errors.ts
export class ArticleParseError extends Error { constructor(variable: string) { super("Error while parsing article."); this.message = `${this.message}\n${variable} is undefined.\nFile format should be\ndate\ntitle\nauthor\nsummary\ncontent.`; } }
binerdy/denote-kit
@0.1.2/config.ts
import * as path from "https://deno.land/std@0.76.0/path/mod.ts"; export interface IDenoteConfig { basePath: string; fileExtension: string; sourceFolderName: string; outputFolderName: string; outputFileName: string; templateFileName: string; } export class DenoteConfig { constructor(public values: IDeno...
binerdy/denote-kit
@0.1.2/io/write.ts
import { existsSync } from "https://deno.land/std/fs/mod.ts"; import { DenoteConfig } from "../config.ts"; export function write(output: string, sourceConfig: DenoteConfig): void { const outputFolderPath = sourceConfig.getOutputFolderPath(); console.log("outputFolderPath", outputFolderPath); createOutputFolderIf...
binerdy/denote-kit
@0.1.2/compiler/compiler.ts
<reponame>binerdy/denote-kit import { denote } from "https://raw.githubusercontent.com/binerdy/denote/master/@0.2.0/denote.ts"; import { IArticle } from "./article.ts"; import { ArticleParseError } from "./errors.ts"; function parseArticle(lines: string[]): IArticle { let date: string; let title: string; let aut...
akmittal/extended-web
index.ts
<reponame>akmittal/extended-web<filename>index.ts export { EwCarousel } from './components/EwCarousel.js';
akmittal/extended-web
components/EwCarousel.ts
import { html, css, LitElement, property, customElement, query, } from 'lit-element'; @customElement('ew-carousel') export class EwCarousel extends LitElement { @query('.chevron.left') left!: HTMLDivElement; @query('.qem-carousel') parent!: HTMLDivElement; @query('.chevron.right') right!: HTMLDivEl...
akmittal/extended-web
stories/index.stories.ts
import { html, TemplateResult } from 'lit-html'; import '../components/EwCarousel.js'; export default { title: 'EwCarousel', component: 'ew-carousel', argTypes: { textColor: { control: 'color' }, children: {control:'slot'} }, }; interface Story<T> { (args: T): TemplateResult; args?: Partial<T>; ...
alexeiaccio/electron-accio
graphql-server/src/index.spec.ts
import server from './index' import 'jest' describe('server', () => { it('should be server', async () => { const res = await server expect(res).toBeDefined() return res.stop() }) })
alexeiaccio/electron-accio
app/src/main-process/main.ts
/* eslint-disable no-sync */ /// <reference path="../../globals.d.ts" /> import { app } from 'electron' import { AppWindow } from './app-window' let mainWindow: AppWindow | null = null let preventQuit = false type OnDidLoadFn = (window: AppWindow) => void /** See the `onDidLoad` function. */ let onDidLoadFns: Arra...
alexeiaccio/electron-accio
app/webpack.development.ts
<filename>app/webpack.development.ts import * as common from './webpack.common' import * as webpack from 'webpack' import * as merge from 'webpack-merge' const config: webpack.Configuration = { mode: 'development', devtool: 'source-map', } const mainConfig = merge({}, common.main, config) // TODO: // if we have...
alexeiaccio/electron-accio
app/webpack.common.ts
<gh_stars>0 import * as path from 'path' import * as HtmlWebpackPlugin from 'html-webpack-plugin' // import * as CleanWebpackPlugin from 'clean-webpack-plugin' import * as webpack from 'webpack' import * as merge from 'webpack-merge' import { getReplacements } from './app-info' export const externals = ['7zip'] if (...
alexeiaccio/electron-accio
graphql-server/src/resolvers.ts
<reponame>alexeiaccio/electron-accio import loki from 'lokijs' const db = new loki('../data/config.json', { autosave: true, }) let config: any db.loadDatabase({}, err => { if (err) { console.log('Error: ' + err) } else { console.log(`Database ${db.filename} loaded`) config = db.getCollection('conf...
alexeiaccio/electron-accio
graphql-server/src/index.ts
import { ApolloServer, makeExecutableSchema } from 'apollo-server' import typeDefs from './schema' import { resolvers } from './resolvers' const schema = makeExecutableSchema({typeDefs, resolvers}) const server = new ApolloServer({ schema, subscriptions: '/subscriptions', playground: { endpoint: '/playgrou...
alexeiaccio/electron-accio
app/app-info.ts
const s = JSON.stringify export function getReplacements() { return { __DARWIN__: process.platform === 'darwin', __WIN32__: process.platform === 'win32', __LINUX__: process.platform === 'linux', __DEV__: s(process.env.NODE_ENV || 'development'), 'process.platform': s(process.platform), 'proce...
alexeiaccio/electron-accio
graphql-server/src/types.ts
<filename>graphql-server/src/types.ts<gh_stars>0 export type Maybe<T> = T | null /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string String: string Boolean: boolean Int: number Float: number /** The `Upload` scalar type represents a file upload. */ Uplo...
alexeiaccio/electron-accio
react-app/src/App.tsx
import React from 'react'; import { useQuery, useMutation } from 'urql'; import logo from './logo.svg'; import './App.css'; const getConfig = ` query GetConfig { config { filename repos { id name } } } `; const addRepo = ` mutation MutationCofig($name: String!) { ...
alexeiaccio/electron-accio
app/webpack.production.ts
import * as common from './webpack.common' import * as webpack from 'webpack' import * as merge from 'webpack-merge' import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer' const MinifyPlugin = require('babel-minify-webpack-plugin') const config: webpack.Configuration = { mode: 'production', devtool: 'sour...
alexeiaccio/electron-accio
app/src/ui/index.tsx
import * as React from 'react' import * as ReactDOM from 'react-dom' // import { ipcRenderer } from 'electron' import { App } from './app' const startTime = performance.now() // ipcRenderer.on('focus', () => { // }) ReactDOM.render( <App startTime={startTime} />, document.getElementById('desktop-app-cont...
alexeiaccio/electron-accio
graphql-server/src/schema/config.ts
import { gql } from 'apollo-server' export default gql` type Config { filename: String! repos: [Repo] } type Repo { id: String name: String } type Query { config: Config allRepos: [Repo] repo(id: String!): Repo } type Mutation { addRepo(name: String!): Repo } `
alexeiaccio/electron-accio
graphql-server/src/schema/index.ts
import ConfigSchema from './config' export default [ ConfigSchema, ]
alexeiaccio/electron-accio
app/src/ui/app.tsx
<filename>app/src/ui/app.tsx<gh_stars>0 import * as React from 'react' export const App = (props: { startTime: number }): JSX.Element => { return <h1>{`${props.startTime}`}</h1> }
alexeiaccio/electron-accio
app/globals.d.ts
<filename>app/globals.d.ts /* eslint-disable @typescript-eslint/interface-name-prefix */ /** Is the app running in dev mode? */ declare const __DEV__: boolean /** The OAuth client id the app should use */ declare const __OAUTH_CLIENT_ID__: string | undefined /** The OAuth secret the app should use. */ declare const _...
OpenStopCovid/react-native-dp3t
src/index.tsx
import { useCallback, useEffect, useMemo, useState } from 'react'; import { EmitterSubscription, NativeEventEmitter, NativeModules, PermissionsAndroid, Platform, Rationale, } from 'react-native'; const Dp3t = NativeModules.Dp3t; const dp3tEmitter = new NativeEventEmitter(Dp3t); /** * Name of the event th...
OpenStopCovid/react-native-dp3t
example/src/navigation/NavigationButtons.tsx
import * as React from 'react'; import { Animated, Image, LayoutAnimation, ViewProps } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { RouteComponentProps, withRouter } from 'react-router-native'; import { TouchableRipple } from '../common'; interface NavigationButtonProps ext...
OpenStopCovid/react-native-dp3t
example/src/common/format.tsx
<reponame>OpenStopCovid/react-native-dp3t import React, { FunctionComponent } from 'react'; import { Text, TextProps } from 'react-native'; const longDateWithTimeFormatter = new Intl.DateTimeFormat(['en'], { year: 'numeric', month: 'long', day: '2-digit', hour: '2-digit', hour12: false, minute: '2-digit', ...
OpenStopCovid/react-native-dp3t
example/src/init/Init.tsx
import React, { FunctionComponent, useCallback, useState } from 'react'; import { Button, Text } from 'react-native'; import { initManually, initWithDiscovery } from 'react-native-dp3t'; import Icon from 'react-native-vector-icons/MaterialIcons'; import { Route, RouteComponentProps, Switch } from 'react-router'; import...
nsaicharan/html-dom
client/posts/get-the-document-height-and-width/index.tsx
<filename>client/posts/get-the-document-height-and-width/index.tsx import React from 'react'; import Markdown from '../../components/Markdown'; export default () => { return ( <Markdown content={` ## Get the document height ~~~ javascript // Full height, including the scroll part const fullHeight = Math.max(...
guidiaalo/sdk-js
src/modules/Account/buckets.types.ts
<gh_stars>1-10 import { GenericID, TagsObj, Query } from "../../common/common.types"; type ExportBucket = { id: string; origin: string; variables: string[]; }[]; interface ExportBucketOption { start_date?: Date; end_date?: Date; } interface BucketCreateInfo { /** * A name for the bucket. */ name:...
guidiaalo/sdk-js
src/modules/Authorization/types.ts
export * as Device from "./authorization.types";
guidiaalo/sdk-js
src/modules/Authorization/authorization.types.ts
import { PermissionOption, ExpireTimeOption, GenericID } from "../../common/common.types"; interface AuthorizationInfo { name: string; type: string; permission: PermissionOption; serie_number: string | null; last_authorization: Date | null; verification_code: string; expire_time: ExpireTimeOption; ref_...
guidiaalo/sdk-js
__tests__/Migration/inputcontrol.ts
<reponame>guidiaalo/sdk-js import { convert, isOldStructure } from "../../src/modules/Migration/inputcontrol"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.inputcontrolStructure; describe("Input control widget - migration suite", () => { /** * Tests to see ...
guidiaalo/sdk-js
src/modules/RunUser/runUser.types.ts
<reponame>guidiaalo/sdk-js import { ExpireTimeOption, GenericID, GenericToken } from "../../common/common.types"; import { OTPType } from "../Account/account.types"; interface UserOptions { decimal_separator?: string; thousand_separator?: string; date_format?: string; time_format?: string; show_last_updated_...
guidiaalo/sdk-js
src/regions.ts
<gh_stars>1-10 /** * @internal */ let noRegionWarning = false; interface RegionsObj { api: string; realtime: string; } /** * Object of Regions Definition * @internal */ const regionsDefinition = { "usa-1": { api: "https://api.tago.io", realtime: "wss://realtime.tago.io", }, env: undefined as vo...
guidiaalo/sdk-js
src/modules/Account/Analyses.ts
<filename>src/modules/Account/Analyses.ts import { GenericID, GenericToken } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { AnalysisCreateInfo, AnalysisInfo, AnalysisQuery, ScriptFile } from "./analy...
guidiaalo/sdk-js
src/modules/Migration/convertFields.ts
import { generateWidgetItemId } from "./common"; export enum InputFormField { "Text" = "text", "Address" = "address", "Barcode" = "barcode", "Calendar" = "calendar", "Capture user" = "user", "Checkbox" = "checkbox", "Clock Set" = "clock-set", "Device" = "device", "Dropdown" = "dropdown", "Dropdown M...
guidiaalo/sdk-js
src/modules/RunUser/types.ts
export * as Device from "./runUser.types";
guidiaalo/sdk-js
src/modules/Migration/image.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old IMAGE to new IMAGE // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; function conve...
guidiaalo/sdk-js
src/modules/Dictionary/Dictionary.ts
import * as Papa from "papaparse"; import TagoIOModule from "../../common/TagoIOModule"; import { IDictionaryModuleParams, IParsedExpression, IResolveExpressionParams, IApplyToStringOptions, IDictionaryModuleParamsAnonymous, } from "./dictionary.types"; import { LanguageData } from "../Account/dictionaries.t...
guidiaalo/sdk-js
src/modules/Account/Dictionaries.ts
import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { DictionaryCreateInfo, DictionaryInfo, DictionaryQuery, LanguageData, LanguageEditData, LanguageInfoQuery, } from "./di...
guidiaalo/sdk-js
src/modules/Migration/dynamic_table.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old DYNAMIC_TABLE to new DYNAMIC_TABLE // ? ==================================================================================== import { WidgetInfo } from "../Account/da...
guidiaalo/sdk-js
src/modules/Migration/tile.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old TILE to new TILE // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; im...
guidiaalo/sdk-js
__tests__/Migration/icon.ts
<gh_stars>1-10 import { convert, isOldStructure } from "../../src/modules/Migration/icon"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.iconStructure; describe("Icon widget - migration suite", () => { /** * Tests to see if the root properties have been tran...
guidiaalo/sdk-js
src/modules/Account/integration.connectors.types.ts
<reponame>guidiaalo/sdk-js import { GenericID, Query, TokenData } from "../../common/common.types"; interface IDeviceParameters { name?: string; label?: string; type?: "text" | "dropdown" | "switch" | "number"; default?: any; group?: "default" | "main" | "advanced" | "hide"; options?: any[]; // optional, o...
guidiaalo/sdk-js
src/modules/Migration/video.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old VIDEO to new VIDEO // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; function conve...
guidiaalo/sdk-js
__tests__/Dictionary/applyToString.ts
import { Dictionary } from "../../src/modules"; import { enUS, ptBR } from "./__mocks__/dictionaries"; describe("applyToString", () => { let dictionary: Dictionary; let options: Object; let fn: jest.SpyInstance; beforeAll(() => { dictionary = new Dictionary({ token: "mockToken" }); options = { langua...
guidiaalo/sdk-js
src/modules/Analysis/analysis.types.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { Regions } from "../../regions"; type analysisFunction = (context: any, data: any) => any; interface AnalysisConstructorParams { token?: string; region?: Regions; // options?: any; /** * Auto Start analysis after instance the class * If turn it off, you c...
guidiaalo/sdk-js
src/modules/Account/_Share.ts
import { ExpireTimeOption, GenericID, PermissionOption } from "../../common/common.types"; import TagoIOModule, { ShareModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { InviteInfo, InviteResponse } from "./_share.types"; class _Share extends TagoIOModule<ShareModul...
guidiaalo/sdk-js
src/modules/Services/Notification.ts
<reponame>guidiaalo/sdk-js import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { GenericID } from "../../common/common.types"; import { NotificationCreate } from "../Account/notifications.types"; class Notification extends TagoIOModule<GenericModuleParams> { /** * Send Notificati...
guidiaalo/sdk-js
src/modules/Account/Explore.ts
import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import { ExploreInfo } from "./explore.types"; class Explore extends TagoIOModule<GenericModuleParams> { /** * Add item of explore in your account * @param exploreID Explore ide...
guidiaalo/sdk-js
src/modules/Account/profile.types.ts
<filename>src/modules/Account/profile.types.ts import { GenericID } from "../../common/common.types"; interface ProfileListInfo { id: GenericID; name: string; logo_url: string | null; } interface ProfileLimit { profile: string; updated_at: Date; input: number; output: number; sms: number; email: num...
guidiaalo/sdk-js
src/modules/Dictionary/types.ts
export * as Dictionary from "./dictionary.types";
guidiaalo/sdk-js
src/modules/Utils/uploadFile.ts
import Account from "../Account/Account"; import { UploadFileOptions } from "./utils.types"; import path from "path"; type FileURL = string; /** * Upload a file and return it's URL. */ async function uploadFile(account: Account, options: UploadFileOptions): Promise<FileURL> { if (!(account instanceof Account)) { ...
guidiaalo/sdk-js
__tests__/Utils/envToJson.ts
import envToJson from "../../src/modules/Utils/envToJson"; describe("TagoIO Env to JSON", () => { test("Transform with success", () => { const envMock = [ { key: "test", value: "valueTest" }, { key: "test2", value: "valueTest2" }, ]; const result = envToJson(envMock); expect(result.test)....
guidiaalo/sdk-js
src/modules/Migration/imagemarker.ts
<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old IMAGE MARKER to new IMAGE MARKER // ? ==================================================================================== import { WidgetInfo } from "../Account/dashb...
guidiaalo/sdk-js
src/modules/Authorization/Authorization.ts
import TagoIOModule, { AuthorizationModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { AuthorizationInfo } from "./authorization.types"; class Authorization extends TagoIOModule<AuthorizationModuleParams> { /** * Get information about the current Authorization ...
guidiaalo/sdk-js
src/modules/Utils/getTokenByName.ts
import Account from "../Account/Account"; /** * * @param account Account instance * @param deviceID Id of device * @param names Array of names of the token, if null will return the first token found */ async function getTokenByName(account: Account, deviceID: string, names?: string[] | string): Promise<string> { ...
guidiaalo/sdk-js
__tests__/Authorization/info.ts
import express, { Express } from "express"; import http from "http"; import { Authorization } from "../../src/modules"; import { AddressInfo } from "net"; describe("Authorization class", () => { let app: Express; let service: http.Server; beforeEach((done) => { const startServer = () => { app = express...
guidiaalo/sdk-js
src/modules/Migration/semidonut.ts
// ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old SEMIDONUT to new SEMIDONUT // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboards.types"; import ...
guidiaalo/sdk-js
src/modules/Account/Integration.Connectors.ts
import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { ConnectorCreateInfo, ConnectorInfo, ConnectorQuery } from "./integration.connectors.types"; class Connectors extends TagoIOModule<...
guidiaalo/sdk-js
src/modules/Account/Integration.ts
import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import Connectors from "./Integration.Connectors"; import Networks from "./Integration.Networks"; class Integration extends TagoIOModule<GenericModuleParams> { public connectors = new Connectors(this.params); public networks = new Netw...
guidiaalo/sdk-js
src/modules/Account/devices.types.ts
<reponame>guidiaalo/sdk-js<filename>src/modules/Account/devices.types.ts import { GenericID, GenericToken, Query, TagsObj, PermissionOption, ExpireTimeOption } from "../../common/common.types"; interface DeviceQuery extends Query< DeviceInfo, "name" | "visible" | "active" | "last_input" | "last_output" | "cr...
guidiaalo/sdk-js
src/common/sleep.ts
<reponame>guidiaalo/sdk-js /** * Make the async function wait * @internal * @param timerMS Time to wait */ const sleep = (timerMS: number) => new Promise((resolve) => setTimeout(resolve, timerMS)); export default sleep;
guidiaalo/sdk-js
__tests__/Migration/pie.ts
<filename>__tests__/Migration/pie.ts import { convert, isOldStructure } from "../../src/modules/Migration/pie"; import * as oldStructure from "./__mocks__/widgetsOldStructure.json"; const oldWidget = oldStructure.pieStructure; describe("Pie widget - migration suite", () => { /** * Tests to see if the root proper...
guidiaalo/sdk-js
src/modules/Services/Services.ts
import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import ConsoleService from "./Console"; import SMS from "./SMS"; import Email from "./Email"; import MQTT from "./MQTT"; import Notification from "./Notification"; import Attachment from "./Attachment"; class Services extends TagoIOModule<G...
guidiaalo/sdk-js
src/modules/Account/actions.types.ts
<reponame>guidiaalo/sdk-js<gh_stars>1-10 import { GenericID, Conditionals, TagsObj, Query, ExpireTimeOption } from "../../common/common.types"; type ActionType = "condition" | "resource" | "interval" | "schedule" | "mqtt_topic"; type ActionTypeParams = | { script: GenericID[]; type: "script"; } | ...
guidiaalo/sdk-js
src/modules/Utils/getAPIVersion.ts
<gh_stars>1-10 import TagoIOModule, { GenericModuleParams, doRequestParams } from "../../common/TagoIOModule"; import { Regions } from "../../regions"; class GetAPIVersion extends TagoIOModule<GenericModuleParams> { public static async getVersion(region?: Regions): Promise<string> { const params: doRequestParams...
guidiaalo/sdk-js
src/modules/Account/Access.ts
<gh_stars>1-10 import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { AccessCreateInfo, AccessInfo, AccessQuery } from "./access.types"; class Access extends TagoIOModule<GenericModuleP...
guidiaalo/sdk-js
src/modules/Utils/Utils.ts
<reponame>guidiaalo/sdk-js import envToJson from "./envToJson"; import getAPIVersion from "./getAPIVersion"; import getTokenByName from "./getTokenByName"; import AnalysisRouter from "./router/router"; import getDevice from "./getDevice"; import uploadFile from "./uploadFile"; import sendDownlink from "./sendDownlink";...
guidiaalo/sdk-js
src/modules/Migration/inputcontrol.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old INPUT CONTROL to new INPUT CONTROL // ? ==================================================================================== import { WidgetInfo } from ".....
guidiaalo/sdk-js
src/modules/Account/files.types.ts
interface FileQuery { path?: string; paginationToken?: string; quantity?: number; } interface FileListInfo { files: { filename: string; size: number; last_modified: Date | null; }[]; folders: string[]; } interface Base64File { /** * Name of file */ filename: string; /** * String...
guidiaalo/sdk-js
src/modules/Account/dashboards.types.ts
import { Data, ExpireTimeOption, GenericID, GenericToken, Query, TagsObj } from "../../common/common.types"; import { BucketDeviceInfo } from "./buckets.types"; interface Arrangement { widget_id: string; x: number; y: number; width: number; height: number; tab?: string | null; } interface DashboardCreateI...
guidiaalo/sdk-js
src/modules/Migration/common/removeHttpFromURL.ts
<filename>src/modules/Migration/common/removeHttpFromURL.ts<gh_stars>1-10 /** * Remove HTTP and HTTPS from the URL on links to media and other assets. * Return an empty string if the value is not a string. */ export default function removeHttpFromURL(url: any): string { if (typeof url !== "string") { return ""...
guidiaalo/sdk-js
src/modules/Migration/keypad.ts
<filename>src/modules/Migration/keypad.ts<gh_stars>1-10 // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old KEYPAD to new KEYPAD // ? ==================================================================================== import { Widget...
guidiaalo/sdk-js
src/modules/Account/integration.networks.types.ts
<filename>src/modules/Account/integration.networks.types.ts import { GenericID, Query, TokenData } from "../../common/common.types"; interface IDeviceParameters { name?: string; label?: string; type?: "text" | "dropdown" | "switch" | "number"; default?: any; group?: "default" | "main" | "advanced" | "hide"; ...
guidiaalo/sdk-js
src/modules/Dictionary/dictionary.types.ts
<gh_stars>1-10 import { GenericModuleParams } from "../../common/TagoIOModule"; import { Regions } from "../../regions"; interface IDictionaryModuleParams extends GenericModuleParams { token: string; region?: Regions; language?: string; options?: object; } interface IDictionaryModuleParamsAnonymous extends Ge...
guidiaalo/sdk-js
src/modules/Account/Devices.ts
import { GenericID, GenericToken, TokenCreateResponse, TokenData } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { ConfigurationParams, DeviceCreateInfo, DeviceCreateResponse, DeviceInfo, De...
guidiaalo/sdk-js
src/modules/Account/Actions.ts
<filename>src/modules/Account/Actions.ts<gh_stars>1-10 import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { ActionCreateInfo, ActionInfo, ActionQuery } from "./actions.types"; class A...
guidiaalo/sdk-js
__tests__/Connector/resolveToken.ts
import express, { Express } from "express"; import http from "http"; import { Network } from "../../src/modules"; import { AddressInfo } from "net"; describe("Network class", () => { let app: Express; let service: http.Server; beforeEach((done) => { const startServer = () => { app = express(); ap...
guidiaalo/sdk-js
__tests__/Dictionary/__mocks__/dictionaries.ts
<reponame>guidiaalo/sdk-js import { LanguageData } from "../../../src/modules/Account/dictionaries.types"; interface IMockLanguageData { [slug: string]: LanguageData; } const enUS: IMockLanguageData = { TEST: { STRING_WITH_PARAMETER: "This string has $0 as parameter", STRING_WITH_TWO_PARAMETERS: "This str...
guidiaalo/sdk-js
src/config.ts
/** * Default configuration for SDK * @internal */ const config = { requestAttempts: Number(process.env.TAGOIO_REQUEST_ATTEMPTS) || 5, requestTimeout: 60000, socketOpts: { reconnectionDelay: 10000, reconnection: true, transports: ["websocket"], }, }; export default config;
guidiaalo/sdk-js
src/modules/Account/Template.ts
import { GenericID } from "../../common/common.types"; import TagoIOModule, { GenericModuleParams } from "../../common/TagoIOModule"; import dateParser from "../Utils/dateParser"; import { TemplateObjDashboard, TemplateObjAnalysis, TemplateInstallDashboard, TemplateInstallAnalysis, TemplateObj, TemplateInst...
guidiaalo/sdk-js
src/common/HashGenerator.ts
<gh_stars>1-10 import { AxiosRequestConfig } from "axios"; function hashGenerator(obj: any): number { const objString = JSON.stringify(obj); let hash = 0; let chr; if (objString.length === 0) { return hash; } for (let i = 0; i < objString.length; i += 1) { chr = objString.charCodeAt(i); hash...
guidiaalo/sdk-js
src/infrastructure/apiRequest.ts
import axios, { AxiosRequestConfig, AxiosResponse } from "axios"; import config from "../config"; import sleep from "../common/sleep"; import isBrowser from "./isBrowser"; import envParams from "./envParams.json"; import { addRequestInProgress, isRequestInProgress, removeRequestInProgress } from "../common/RequestInPro...
guidiaalo/sdk-js
src/common/JSONParseSafe.ts
function JSONParseSafe(jsonString: string, defaultValue: any = {}) { if (!jsonString) { return defaultValue; } try { return JSON.parse(jsonString); } catch (error) { return defaultValue; } } export { JSONParseSafe };
guidiaalo/sdk-js
src/modules/Migration/stepbutton.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old STEP BUTTON to new STEP BUTTON // ? ==================================================================================== import { WidgetInfo } from "../Acc...
guidiaalo/sdk-js
src/modules/Migration/icon.ts
<reponame>guidiaalo/sdk-js // ? ==================================== (c) TagoIO ==================================== // * What is this file? // Migration of old ICON to new ICON // ? ==================================================================================== import { WidgetInfo } from "../Account/dashboard...