├── .gitignore ├── Procfile ├── README.md ├── app.json ├── config.js ├── config.json ├── index.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node index.js -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jsforce-sample 2 | 3 | This is a simple interactive demonstration of how to use Salesforce with Node.js via a library called jsforce. jsforce can be run via command line or used with server side solutions like express. 4 | 5 | Node is required, obviously: https://nodejs.org/en/ 6 | 7 | You will also want a Developer Edition org (which are free and do not have a fixed expiration): https://developer.salesforce.com/signup 8 | 9 | Then to install and run: 10 | 11 | 1. Clone or download this repository 12 | 2. In the repository directory run **npm install -local** 13 | 3. Modify config.json with the username and password for your Developer Edition. 14 | 4. Run **node index.js displayContactsSOQL** to see a list of contacts from your instance. 15 | 16 | index.js will accept: 17 | * displayContactsSOQL 18 | * displayContactsEventMethod 19 | * displayContactsMethodChain 20 | * createContact 21 | * updateContact 22 | * deleteContact 23 | 24 | In config.json, you can also set "deployToWeb" to be true to see a sample API call via express at /contacts. 25 | 26 | If you are using a scratch org or sandbox, add "production" to config.json and set it to false. 27 | 28 | All variables can be handled as environment variables as well, which will override config.json. 29 | 30 | Comments within index.js point to specifics about the code. Full documentation for jsforce can be found on the project site: https://jsforce.github.io/ 31 | 32 | To learn more about developing on the Salesforce Platform, see the Beginner Developer trail on Trailhead: https://trailhead.salesforce.com/content/learn/trails/force_com_dev_beginner 33 | 34 | ## Deploying to Heroku via CLI 35 | 36 | 1. Sign up and install Heroku: [https://signup.heroku.com/](https://signup.heroku.com/) 37 | 1. Clone this repo. 38 | 1. Login via command line: **heroku login**. 39 | 1. In the repo directory (**cd jsforce-sameple**), run **heroku create**. 40 | 1. Run **git push heroku master**. 41 | 1. Run **herou open**. 42 | 43 | ## Deploying to Heroku via Deploy Button 44 | 45 | 1. Make sure you are logged in to the [Heroku Dashboard](https://dashboard.heroku.com/) 46 | 1. Click the button below to deploy on Heroku: 47 | 48 | [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsforce sample", 3 | "description": "Sample applications using jsforce", 4 | "env": { 5 | "username": { 6 | "description": "Username for your Salesforce instance. Leave blank if using web based OAuth and Connected App.", 7 | "value":"", 8 | "required":false 9 | }, 10 | "password": { 11 | "description": "Password for your Salesforce instance. Leave blank if using web based OAuth and Connected App.", 12 | "value":"", 13 | "required":false 14 | }, 15 | "production": { 16 | "description": "Set true for production / developer instances, false for scratch or sandbox.", 17 | "value":"true", 18 | "required":true 19 | }, 20 | "deployToWeb": { 21 | "description": "Set true for express web app, false for CLI only.", 22 | "value":"true", 23 | "required":true 24 | }, 25 | "publicKey": { 26 | "description": "Public key of connected app. Leave blank if using username / password.", 27 | "value":"", 28 | "required":false 29 | }, 30 | "privateKey": { 31 | "description": "Private key of connected app. Leave blank if using username / password.", 32 | "value":"", 33 | "required":false 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var path = require("path"); 3 | var configpath = path.normalize("./"); 4 | var content = fs.readFileSync(configpath + "config.json"); 5 | var config = JSON.parse(content); 6 | module.exports = config; -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "username": null, 3 | "password": null, 4 | "deployToWeb": true 5 | } -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var jsforce = require("jsforce"); 2 | var path = require("path"); 3 | var configpath = path.normalize("./"); 4 | var config = require(configpath+"config.js"); 5 | var conn = new jsforce.Connection(); 6 | var loggedIn = false; 7 | 8 | //Sign up for a free Developer Edition at https://developer.salesforce.com/signup 9 | 10 | //For username / password flow 11 | var username = process.env.username || config.username || null; 12 | var password = process.env.password || config.password || null; 13 | 14 | var production = process.env.production || config.production || true; //for sandbox and scratch orgs, set to false 15 | if(production === "true" || production === "false") { production = (production === "true"); } 16 | 17 | var deployToWeb = process.env.deployToWeb || config.deployToWeb ||true; 18 | if(deployToWeb === "true" || deployToWeb === "false") { deployToWeb = (deployToWeb === "true"); } 19 | 20 | 21 | /* 22 | 23 | Commented code below can be used to set up a web based oauth flow instead 24 | of username and password. Doing so will require a connected app and a user 25 | with the correct IP permissions. 26 | 27 | Learn more here: 28 | https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_authentication.htm 29 | 30 | */ 31 | 32 | if(deployToWeb) { 33 | var port = process.env.PORT || 8675; 34 | var express = require('express'); 35 | var app = express(); 36 | 37 | var oauth2 = null; 38 | var publicKey = process.env.publicKey || config.publicKey || null; 39 | var privateKey = process.env.privateKey || config.privateKey || null; 40 | 41 | 42 | if(publicKey && privateKey) { 43 | var oauth2 = new jsforce.OAuth2({ 44 | // you can change loginUrl to connect to sandbox or prerelease env. 45 | // loginUrl : 'https://test.salesforce.com', 46 | clientId : publicKey, 47 | clientSecret : privateKey, 48 | redirectUri : '/oauth2/auth' 49 | }); 50 | 51 | // 52 | // Get authorization url and redirect to it. 53 | // 54 | 55 | app.get('/oauth2/auth', function(req, res) { 56 | res.redirect(oauth2.getAuthorizationUrl({ scope : 'api id web' })); 57 | }); 58 | } 59 | 60 | app.get('/', function(req, res) { 61 | res.json({"status":"online"}); 62 | }); 63 | 64 | app.get('/contacts/', function(req, res) { 65 | conn.query("SELECT Id, Name, CreatedDate FROM Contact", function(err, result) { 66 | if (err) { res.json(err); } 67 | console.log("total : " + result.totalSize); 68 | res.json(result); 69 | }); 70 | }); 71 | 72 | //setup actual server 73 | var server = app.listen(port, function () { 74 | 75 | console.log('jsforce sample running on '+port); 76 | }); 77 | } 78 | 79 | 80 | 81 | 82 | 83 | 84 | //Log in using username and password, set loggedIn to true and handle a callback 85 | // 86 | function login(callback) { 87 | if(!production) { conn.loginUrl = 'https://test.salesforce.com'; } 88 | if(username && password) { 89 | conn.login(username, password, function(err, res) { 90 | if (err) { return console.error(err); } 91 | else { 92 | loggedIn = true; 93 | console.log("Succcessfully logged into Salesforce."); 94 | console.log(res); 95 | if(callback){callback();} 96 | } 97 | }); 98 | } 99 | else { 100 | console.log("Username and password not setup.") 101 | } 102 | } 103 | 104 | /* 105 | 106 | Below are three different styles of querying records that jsforce supports 107 | For more on data modeling in Salesforce: https://trailhead.salesforce.com/en/content/learn/modules/data_modeling 108 | 109 | */ 110 | 111 | //find contacts using plain SOQL 112 | //More on SOQL here: https://trailhead.salesforce.com/en/content/learn/modules/apex_database 113 | function displayContactsSOQL() { 114 | conn.query("SELECT Id, Name, CreatedDate FROM Contact", function(err, result) { 115 | if (err) { return console.error(err); } 116 | console.log("total : " + result.totalSize); 117 | for (var i=0; i=0.9.1", 307 | "tough-cookie": "*", 308 | "tunnel-agent": "*" 309 | } 310 | }, 311 | "faye-websocket": { 312 | "version": "0.11.1", 313 | "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", 314 | "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", 315 | "requires": { 316 | "websocket-driver": ">=0.5.1" 317 | } 318 | }, 319 | "finalhandler": { 320 | "version": "1.1.1", 321 | "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", 322 | "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", 323 | "requires": { 324 | "debug": "2.6.9", 325 | "encodeurl": "~1.0.2", 326 | "escape-html": "~1.0.3", 327 | "on-finished": "~2.3.0", 328 | "parseurl": "~1.3.2", 329 | "statuses": "~1.4.0", 330 | "unpipe": "~1.0.0" 331 | } 332 | }, 333 | "forever-agent": { 334 | "version": "0.6.1", 335 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 336 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 337 | }, 338 | "form-data": { 339 | "version": "2.3.3", 340 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 341 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 342 | "requires": { 343 | "asynckit": "^0.4.0", 344 | "combined-stream": "^1.0.6", 345 | "mime-types": "^2.1.12" 346 | } 347 | }, 348 | "forwarded": { 349 | "version": "0.1.2", 350 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 351 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 352 | }, 353 | "fresh": { 354 | "version": "0.5.2", 355 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 356 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 357 | }, 358 | "getpass": { 359 | "version": "0.1.7", 360 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 361 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 362 | "requires": { 363 | "assert-plus": "^1.0.0" 364 | } 365 | }, 366 | "har-schema": { 367 | "version": "2.0.0", 368 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 369 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 370 | }, 371 | "har-validator": { 372 | "version": "5.1.0", 373 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", 374 | "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", 375 | "requires": { 376 | "ajv": "^5.3.0", 377 | "har-schema": "^2.0.0" 378 | } 379 | }, 380 | "http-errors": { 381 | "version": "1.6.3", 382 | "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 383 | "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 384 | "requires": { 385 | "depd": "~1.1.2", 386 | "inherits": "2.0.3", 387 | "setprototypeof": "1.1.0", 388 | "statuses": ">= 1.4.0 < 2" 389 | } 390 | }, 391 | "http-parser-js": { 392 | "version": "0.5.0", 393 | "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.0.tgz", 394 | "integrity": "sha512-cZdEF7r4gfRIq7ezX9J0T+kQmJNOub71dWbgAXVHDct80TKP4MCETtZQ31xyv38UwgzkWPYF/Xc0ge55dW9Z9w==" 395 | }, 396 | "http-signature": { 397 | "version": "1.2.0", 398 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 399 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 400 | "requires": { 401 | "assert-plus": "^1.0.0", 402 | "jsprim": "^1.2.2", 403 | "sshpk": "^1.7.0" 404 | } 405 | }, 406 | "iconv-lite": { 407 | "version": "0.4.23", 408 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", 409 | "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", 410 | "requires": { 411 | "safer-buffer": ">= 2.1.2 < 3" 412 | } 413 | }, 414 | "inherits": { 415 | "version": "2.0.3", 416 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 417 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 418 | }, 419 | "ipaddr.js": { 420 | "version": "1.8.0", 421 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", 422 | "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" 423 | }, 424 | "is-typedarray": { 425 | "version": "1.0.0", 426 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 427 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 428 | }, 429 | "is-wsl": { 430 | "version": "1.1.0", 431 | "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", 432 | "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" 433 | }, 434 | "isarray": { 435 | "version": "1.0.0", 436 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 437 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 438 | }, 439 | "isstream": { 440 | "version": "0.1.2", 441 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 442 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 443 | }, 444 | "jsbn": { 445 | "version": "0.1.1", 446 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 447 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 448 | }, 449 | "jsforce": { 450 | "version": "1.9.1", 451 | "resolved": "https://registry.npmjs.org/jsforce/-/jsforce-1.9.1.tgz", 452 | "integrity": "sha512-AP4wVnz8guvF8zvHdk2xA2DZxvOq3MGbLNPu7tPVOyO38D1qt+psWpYmHgncjkmy9LoSk58K+dU56YE38zqMlg==", 453 | "requires": { 454 | "base64-url": "^2.2.0", 455 | "co-prompt": "^1.0.0", 456 | "coffeescript": "^1.10.0", 457 | "commander": "^2.9.0", 458 | "csv-parse": "^1.1.1", 459 | "csv-stringify": "^1.0.4", 460 | "faye": "^1.2.0", 461 | "inherits": "^2.0.1", 462 | "lodash": "^4.11.1", 463 | "multistream": "^2.0.5", 464 | "opn": "^5.3.0", 465 | "promise": "^7.1.1", 466 | "readable-stream": "^2.1.0", 467 | "request": "^2.72.0", 468 | "xml2js": "^0.4.16" 469 | } 470 | }, 471 | "json-schema": { 472 | "version": "0.2.3", 473 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", 474 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 475 | }, 476 | "json-schema-traverse": { 477 | "version": "0.3.1", 478 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", 479 | "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" 480 | }, 481 | "json-stringify-safe": { 482 | "version": "5.0.1", 483 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 484 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 485 | }, 486 | "jsprim": { 487 | "version": "1.4.1", 488 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", 489 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 490 | "requires": { 491 | "assert-plus": "1.0.0", 492 | "extsprintf": "1.3.0", 493 | "json-schema": "0.2.3", 494 | "verror": "1.10.0" 495 | } 496 | }, 497 | "keypress": { 498 | "version": "0.2.1", 499 | "resolved": "https://registry.npmjs.org/keypress/-/keypress-0.2.1.tgz", 500 | "integrity": "sha1-HoBFQlABjbrUw/6USX1uZ7YmnHc=" 501 | }, 502 | "lodash": { 503 | "version": "4.17.11", 504 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", 505 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" 506 | }, 507 | "lodash.get": { 508 | "version": "4.4.2", 509 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 510 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" 511 | }, 512 | "media-typer": { 513 | "version": "0.3.0", 514 | "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 515 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 516 | }, 517 | "merge-descriptors": { 518 | "version": "1.0.1", 519 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 520 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 521 | }, 522 | "methods": { 523 | "version": "1.1.2", 524 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 525 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 526 | }, 527 | "mime": { 528 | "version": "1.4.1", 529 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", 530 | "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" 531 | }, 532 | "mime-db": { 533 | "version": "1.37.0", 534 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", 535 | "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" 536 | }, 537 | "mime-types": { 538 | "version": "2.1.21", 539 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", 540 | "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", 541 | "requires": { 542 | "mime-db": "~1.37.0" 543 | } 544 | }, 545 | "ms": { 546 | "version": "2.0.0", 547 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 548 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 549 | }, 550 | "multistream": { 551 | "version": "2.1.1", 552 | "resolved": "https://registry.npmjs.org/multistream/-/multistream-2.1.1.tgz", 553 | "integrity": "sha512-xasv76hl6nr1dEy3lPvy7Ej7K/Lx3O/FCvwge8PeVJpciPPoNCbaANcNiBug3IpdvTveZUcAV0DJzdnUDMesNQ==", 554 | "requires": { 555 | "inherits": "^2.0.1", 556 | "readable-stream": "^2.0.5" 557 | } 558 | }, 559 | "negotiator": { 560 | "version": "0.6.1", 561 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", 562 | "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" 563 | }, 564 | "oauth-sign": { 565 | "version": "0.9.0", 566 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 567 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 568 | }, 569 | "on-finished": { 570 | "version": "2.3.0", 571 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 572 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 573 | "requires": { 574 | "ee-first": "1.1.1" 575 | } 576 | }, 577 | "opn": { 578 | "version": "5.4.0", 579 | "resolved": "https://registry.npmjs.org/opn/-/opn-5.4.0.tgz", 580 | "integrity": "sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==", 581 | "requires": { 582 | "is-wsl": "^1.1.0" 583 | } 584 | }, 585 | "parseurl": { 586 | "version": "1.3.2", 587 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", 588 | "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" 589 | }, 590 | "path-to-regexp": { 591 | "version": "0.1.7", 592 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 593 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 594 | }, 595 | "performance-now": { 596 | "version": "2.1.0", 597 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 598 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 599 | }, 600 | "process-nextick-args": { 601 | "version": "2.0.0", 602 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", 603 | "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" 604 | }, 605 | "promise": { 606 | "version": "7.3.1", 607 | "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", 608 | "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", 609 | "requires": { 610 | "asap": "~2.0.3" 611 | } 612 | }, 613 | "proxy-addr": { 614 | "version": "2.0.4", 615 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", 616 | "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", 617 | "requires": { 618 | "forwarded": "~0.1.2", 619 | "ipaddr.js": "1.8.0" 620 | } 621 | }, 622 | "psl": { 623 | "version": "1.1.29", 624 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", 625 | "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" 626 | }, 627 | "punycode": { 628 | "version": "1.4.1", 629 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 630 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 631 | }, 632 | "qs": { 633 | "version": "6.5.2", 634 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 635 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 636 | }, 637 | "range-parser": { 638 | "version": "1.2.0", 639 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", 640 | "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" 641 | }, 642 | "raw-body": { 643 | "version": "2.3.3", 644 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", 645 | "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", 646 | "requires": { 647 | "bytes": "3.0.0", 648 | "http-errors": "1.6.3", 649 | "iconv-lite": "0.4.23", 650 | "unpipe": "1.0.0" 651 | } 652 | }, 653 | "readable-stream": { 654 | "version": "2.3.6", 655 | "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 656 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 657 | "requires": { 658 | "core-util-is": "~1.0.0", 659 | "inherits": "~2.0.3", 660 | "isarray": "~1.0.0", 661 | "process-nextick-args": "~2.0.0", 662 | "safe-buffer": "~5.1.1", 663 | "string_decoder": "~1.1.1", 664 | "util-deprecate": "~1.0.1" 665 | } 666 | }, 667 | "request": { 668 | "version": "2.88.0", 669 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 670 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 671 | "requires": { 672 | "aws-sign2": "~0.7.0", 673 | "aws4": "^1.8.0", 674 | "caseless": "~0.12.0", 675 | "combined-stream": "~1.0.6", 676 | "extend": "~3.0.2", 677 | "forever-agent": "~0.6.1", 678 | "form-data": "~2.3.2", 679 | "har-validator": "~5.1.0", 680 | "http-signature": "~1.2.0", 681 | "is-typedarray": "~1.0.0", 682 | "isstream": "~0.1.2", 683 | "json-stringify-safe": "~5.0.1", 684 | "mime-types": "~2.1.19", 685 | "oauth-sign": "~0.9.0", 686 | "performance-now": "^2.1.0", 687 | "qs": "~6.5.2", 688 | "safe-buffer": "^5.1.2", 689 | "tough-cookie": "~2.4.3", 690 | "tunnel-agent": "^0.6.0", 691 | "uuid": "^3.3.2" 692 | } 693 | }, 694 | "safe-buffer": { 695 | "version": "5.1.2", 696 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 697 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 698 | }, 699 | "safer-buffer": { 700 | "version": "2.1.2", 701 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 702 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 703 | }, 704 | "sax": { 705 | "version": "1.2.4", 706 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 707 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 708 | }, 709 | "send": { 710 | "version": "0.16.2", 711 | "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", 712 | "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", 713 | "requires": { 714 | "debug": "2.6.9", 715 | "depd": "~1.1.2", 716 | "destroy": "~1.0.4", 717 | "encodeurl": "~1.0.2", 718 | "escape-html": "~1.0.3", 719 | "etag": "~1.8.1", 720 | "fresh": "0.5.2", 721 | "http-errors": "~1.6.2", 722 | "mime": "1.4.1", 723 | "ms": "2.0.0", 724 | "on-finished": "~2.3.0", 725 | "range-parser": "~1.2.0", 726 | "statuses": "~1.4.0" 727 | } 728 | }, 729 | "sequin": { 730 | "version": "0.1.1", 731 | "resolved": "https://registry.npmjs.org/sequin/-/sequin-0.1.1.tgz", 732 | "integrity": "sha1-XC04nWajg3NOqvvEXt6ywcsb5wE=" 733 | }, 734 | "serve-static": { 735 | "version": "1.13.2", 736 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", 737 | "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", 738 | "requires": { 739 | "encodeurl": "~1.0.2", 740 | "escape-html": "~1.0.3", 741 | "parseurl": "~1.3.2", 742 | "send": "0.16.2" 743 | } 744 | }, 745 | "setprototypeof": { 746 | "version": "1.1.0", 747 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 748 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 749 | }, 750 | "sshpk": { 751 | "version": "1.15.2", 752 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", 753 | "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", 754 | "requires": { 755 | "asn1": "~0.2.3", 756 | "assert-plus": "^1.0.0", 757 | "bcrypt-pbkdf": "^1.0.0", 758 | "dashdash": "^1.12.0", 759 | "ecc-jsbn": "~0.1.1", 760 | "getpass": "^0.1.1", 761 | "jsbn": "~0.1.0", 762 | "safer-buffer": "^2.0.2", 763 | "tweetnacl": "~0.14.0" 764 | } 765 | }, 766 | "statuses": { 767 | "version": "1.4.0", 768 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", 769 | "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" 770 | }, 771 | "string_decoder": { 772 | "version": "1.1.1", 773 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 774 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 775 | "requires": { 776 | "safe-buffer": "~5.1.0" 777 | } 778 | }, 779 | "tough-cookie": { 780 | "version": "2.4.3", 781 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 782 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 783 | "requires": { 784 | "psl": "^1.1.24", 785 | "punycode": "^1.4.1" 786 | } 787 | }, 788 | "tunnel-agent": { 789 | "version": "0.6.0", 790 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 791 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 792 | "requires": { 793 | "safe-buffer": "^5.0.1" 794 | } 795 | }, 796 | "tweetnacl": { 797 | "version": "0.14.5", 798 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 799 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 800 | }, 801 | "type-is": { 802 | "version": "1.6.16", 803 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", 804 | "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", 805 | "requires": { 806 | "media-typer": "0.3.0", 807 | "mime-types": "~2.1.18" 808 | } 809 | }, 810 | "unpipe": { 811 | "version": "1.0.0", 812 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 813 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 814 | }, 815 | "util-deprecate": { 816 | "version": "1.0.2", 817 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 818 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 819 | }, 820 | "utils-merge": { 821 | "version": "1.0.1", 822 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 823 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 824 | }, 825 | "uuid": { 826 | "version": "3.3.2", 827 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 828 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 829 | }, 830 | "vary": { 831 | "version": "1.1.2", 832 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 833 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 834 | }, 835 | "verror": { 836 | "version": "1.10.0", 837 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 838 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 839 | "requires": { 840 | "assert-plus": "^1.0.0", 841 | "core-util-is": "1.0.2", 842 | "extsprintf": "^1.2.0" 843 | } 844 | }, 845 | "websocket-driver": { 846 | "version": "0.7.0", 847 | "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", 848 | "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", 849 | "requires": { 850 | "http-parser-js": ">=0.4.0", 851 | "websocket-extensions": ">=0.1.1" 852 | } 853 | }, 854 | "websocket-extensions": { 855 | "version": "0.1.3", 856 | "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", 857 | "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==" 858 | }, 859 | "xml2js": { 860 | "version": "0.4.19", 861 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", 862 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", 863 | "requires": { 864 | "sax": ">=0.6.0", 865 | "xmlbuilder": "~9.0.1" 866 | } 867 | }, 868 | "xmlbuilder": { 869 | "version": "9.0.7", 870 | "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", 871 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" 872 | } 873 | } 874 | } 875 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jsforce-sfdc-sample", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "jsforce": "1.9.1", 13 | "express": "*" 14 | } 15 | } 16 | --------------------------------------------------------------------------------