Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* eslint-disable max-nested-callbacks */
var chai = require('chai')
var expect = chai.expect,
should = chai.should,
assert = chai.assert
require('dotenv').config()
var init = require('../../../utils/init')
const name = 'Contractz'
const id = 32932398
const accId = 47776491
const options = {
queue: [420, 440],
champion: 79
}
const region = 'na'
const badConfig = {
options: {
Queue: 420 // instead of queue
}
// Only import this file once, at entrypoint
// See https://github.com/motdotla/dotenv/tree/master/examples/typescript
import { config } from 'dotenv';
const result = config();
// Only override process.env if .env file is present and valid
if (!result.error) {
Object.keys(result.parsed).forEach((key) => {
const value = result.parsed[key];
if (value) {
process.env[key] = value;
}
});
}
// Only import this file once, at entrypoint
// See https://github.com/motdotla/dotenv/tree/master/examples/typescript
import { config } from 'dotenv';
const result = config();
// Only override process.env if .env file is present and valid
if (!result.error) {
Object.keys(result.parsed).forEach((key) => {
const value = result.parsed[key];
if (value) {
process.env[key] = value;
}
});
}
var slack = require('slack'),
Q = require("q"),
async = require('async');
require('dotenv').config();
var SlackApiToken = process.env.SLACKKEY
var coffee_channel = process.env.COFFEECHANNEL
//for testing slackbottest channel
var testing_channel = process.env.TESTINGCHANNEL
exports.postBrewing = function(user_name, user_id) {
var botname = 'Coffee Bot'
var icon_emoji = ":coffeemug:"
var user_mention = '<@' + user_id + '|' + user_name +'>'
var twelveMins = 12 * 60 * 1000 // 12 minutes to brew a pot
var text = user_mention + ' just started brewing a pot :coffee:'
slack.chat.postMessage({ token:SlackApiToken, channel:coffee_channel, text:text, icon_emoji:icon_emoji, username:botname}, function(err, data) {
setTimeout(function() {
var text = 'Coffee is ready. Thanks ' + user_mention + ' for brewing it. :coffee:'
slack.chat.postMessage({ token:SlackApiToken, channel:coffee_channel, text:text, icon_emoji:icon_emoji, username:botname}, function(err, data) {
'use strict';
require('dotenv').config({path: __dirname + '/../.env'});
const NEXMO_API_KEY = process.env.NEXMO_API_KEY;
const NEXMO_API_SECRET = process.env.NEXMO_API_SECRET;
const NEXMO_PRIVATE_KEY = __dirname + "/../" + process.env.NEXMO_PRIVATE_KEY;
const NEXMO_APPLICATION_ID = process.env.NEXMO_APPLICATION_ID;
const TO_NUMBER = process.env.NEXMO_TO_NUMBER;
const FROM_NUMBER = process.env.NEXMO_FROM_NUMBER;
const app = require('express')();
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
extended: true
}));
require('dotenv').config();
module.exports = {
development: {
client: 'pg',
connection: 'postgres://localhost/into_to_knex'
},
production: {
client: 'pg',
connection: process.env.DATABASE_URL + '?ssl=true'
}
};
require('dotenv').config();
import { execSync } from 'child_process';
execSync(
`yarn run apollo schema:download src/v2/apollo/schema.json --endpoint=https://api.are.na/graphql --header='X-APP-TOKEN: ${
process.env.GRAPHQL_XAPP_TOKEN
}'`
);
import crypto from 'crypto'
import dotenv from 'dotenv'
import fs from 'fs'
import { Lexpress } from 'lexpress'
import lodash from 'lodash'
import moment from 'moment'
import passport from 'passport'
import passportGoogleOauth from 'passport-google-oauth'
import path from 'path'
import https from './middlewares/https'
import mongoDb from './middlewares/mongoDb'
import User from './models/User'
import routes from './routes'
dotenv.config()
passport.use(new passportGoogleOauth.OAuth2Strategy(
{
clientID: process.env.GOOGLE_API_KEY,
clientSecret: process.env.GOOGLE_API_SECRET,
callbackURL: `${process.env.WEBSITE_URL}/auth/callback`,
},
(accessToken, refreshToken, profile, cb) => {
User.findOne({ googleId: profile.id }, (err, user) => {
if (err !== null) {
cb(err)
return
}
if (!user) {
import dotenv from 'dotenv';
import Sequelize from 'sequelize';
import logger from '../logger';
import config from '../../config';
const { DB } = config;
const env = dotenv.config().parsed;
const USERNAME = env.EXPLORER_DB_USERNAME;
const PASSWORD = env.EXPLORER_DB_PASSWORD;
const connect = ({
database, dialect, host, password, user,
}) => {
const sequelize = new Sequelize(database, user, password, {
dialect,
host,
logging: false,
pool: {
acquire: 30000,
idle: 10000,
max: 50,
min: 0,