Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var path = require('path');
var jsforce = require('jsforce');
var archiver = require('archiver');
var Promise = jsforce.Promise;
var connect = require('./connect');
var DEPLOY_OPTIONS =
"allowMissingFiles,autoUpdatePackage,checkOnly,ignoreWarnings,performRetrieve,purgeOnDelete,rollbackOnError,runAllTests,runTests,singlePackage,testLevel".split(',');
/* @private */
function noop() {}
/**
*
*/
function deployFromZipStream(zipStream, options) {
var logger = options.logger || { log: noop };
return connect(options).then(function(conn) {
logger.log('Deploying to server...');
conn.metadata.pollTimeout = options.pollTimeout || 60*1000; // timeout in 60 sec by default
'use strict';
var decompress = require('decompress');
var fs = require('fs');
var fstream = require('fstream');
var path = require('path');
var stream = require('readable-stream');
var jsforce = require('jsforce');
var archiver = require('archiver');
var xml2js = require('xml2js');
var Promise = jsforce.Promise;
var connect = require('./connect');
var RETRIEVE_OPTIONS =
"apiVersion,packageNames,singlePackage,specificFiles,unpackaged".split(',');
/* @private */
function noop() {}
/**
*
*/
function retrieve(options) {
var logger = options.logger || { log: noop };
return connect(options).then(function(conn) {
logger.log('Retrieving from server...');
conn.metadata.pollTimeout = options.pollTimeout || 60*1000; // timeout in 60 sec by default
'use strict';
var jsforce = require('jsforce');
var Promise = jsforce.Promise;
var CONNECTION_CONFIG_PROPS =
"loginUrl,accessToken,instanceUrl,refreshToken,clientId,clientSecret,redirectUri,logLevel,version".split(',');
/**
*
*/
function connect(options) {
var conn;
return Promise.resolve().then(function() {
if (options.connection) {
conn = jsforce.registry.getConnection(options.connection);
if (!conn) {
throw new Error('No connection named "' + options.connection + '" in registry');
}
} else if (options.username && options.password) {
var fs = require('fs');
var path = require('path');
var commander = require('commander');
var jsforce = require('jsforce');
var tools = require('./index');
var pkg = require('../package.json');
var Promise = jsforce.Promise;
function acceptConnectionOptions(program) {
program.option('-u, --username [username]', 'Salesforce username')
.option('-p, --password [password]', 'Salesforce password (and security token, if available)')
.option('-c, --connection [connection]', 'Connection name stored in connection registry')
.option('-l, --loginUrl [loginUrl]', 'Salesforce login url')
.option('--sandbox', 'Login to Salesforce sandbox');
}
function acceptCommonOptions(program) {
program.option('--verbose', 'Output execution detail log')
.version(pkg.version);
}
function readOptions(program) {
var options = {};