Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wickrio-bot-api

Package Overview
Dependencies
Maintainers
3
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wickrio-bot-api - npm Package Compare versions

Comparing version 5.82.2 to 5.82.3

2

package.json
{
"name": "wickrio-bot-api",
"version": "5.82.2",
"version": "5.82.3",
"description": "The official Wickr IO Bot API Framework",

@@ -5,0 +5,0 @@ "main": "src/WickrIOBot.js",

@@ -143,19 +143,21 @@ const WickrIOAPI = require('wickrio_addon')

const processes = JSON.parse(fs.readFileSync('processes.json'))
const tokens = JSON.parse(process.env.tokens)
let administrators
if (tokens.ADMINISTRATORS_CHOICE && tokens.ADMINISTRATORS_CHOICE.value === 'yes' &&
tokens.ADMINISTRATORS && tokens.ADMINISTRATORS.value) {
if (tokens.ADMINISTRATORS.encrypted) {
administrators = WickrIOAPI.cmdDecryptString(
tokens.ADMINISTRATORS.value
)
} else {
administrators = tokens.ADMINISTRATORS.value
}
administrators = administrators.split(/[ ,]+/)
if (process.env.tokens !== undefined) {
const tokens = JSON.parse(process.env.tokens)
let administrators
if (tokens.ADMINISTRATORS_CHOICE && tokens.ADMINISTRATORS_CHOICE.value === 'yes' &&
tokens.ADMINISTRATORS && tokens.ADMINISTRATORS.value) {
if (tokens.ADMINISTRATORS.encrypted) {
administrators = WickrIOAPI.cmdDecryptString(
tokens.ADMINISTRATORS.value
)
} else {
administrators = tokens.ADMINISTRATORS.value
}
administrators = administrators.split(/[ ,]+/)
// Make sure there are no white spaces on the whitelisted users
for (let i = 0; i < administrators.length; i++) {
const administrator = administrators[i].trim()
const admin = myLocalAdmins.addAdmin(administrator)
// Make sure there are no white spaces on the whitelisted users
for (let i = 0; i < administrators.length; i++) {
const administrator = administrators[i].trim()
const admin = myLocalAdmins.addAdmin(administrator)
}
}

@@ -272,2 +274,5 @@ }

async encryptEnv() {
if (process.env.tokens === undefined) {
return true
}
try {

@@ -490,3 +495,8 @@ const processes = JSON.parse(fs.readFileSync('processes.json'))

parseMessage(message) {
const tokens = JSON.parse(process.env.tokens)
let tokens
if (process.env.tokens !== undefined) {
tokens = JSON.parse(process.env.tokens)
} else {
tokens = {}
}
message = JSON.parse(message)

@@ -872,2 +882,24 @@ const { edit, control, msg_ts, time, receiver, sender, ttl, bor } = message

}
/*
* copy processes.json tokens to process.env
*/
processesJsonToProcessEnv() {
console.log('Copying processes.json tokens to process.env')
// Read in the processes.json file
const processesJsonFile = path.join(process.cwd(), 'processes.json')
if (!fs.existsSync(processesJsonFile)) {
console.error(processesJsonFile + ' does not exist!')
return false
}
const processesJson = fs.readFileSync(processesJsonFile);
//console.log('processes.json=' + processesJson)
const processesJsonObject = JSON.parse(processesJson)
process.env['tokens'] = JSON.stringify(processesJsonObject.apps[0].env.tokens)
//console.log('end process.env=' + JSON.stringify(process.env))
//console.log('end process.env.tokens=' + process.env.tokens)
return true
}
}

@@ -874,0 +906,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc