Skip to content

Commit

Permalink
Add API Version management
Browse files Browse the repository at this point in the history
  • Loading branch information
gavignon committed Jun 25, 2020
1 parent 66780e3 commit 30db8dc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# <img src="https://public.gavignon.io/images/sfdc-generate-data-dictionary-title.png" height="32">
![version](https://img.shields.io/badge/version-1.2.6-blue)
![version](https://img.shields.io/badge/version-1.2.7-blue)

Generate data dictionary from a Salesforce Org. This tool can also generate a file that can be imported in Lucidchart to define entities and relationships.

Expand Down Expand Up @@ -33,6 +33,7 @@ $ sgd -h
-u, --username [username] salesforce username
-p, --password [password] salesforce password
-l, --loginUrl [loginUrl] salesforce login URL [https://login.salesforce.com]
-a, --apiVersion [apiVersion] salesforce API Version [48.0]
-c, --customObjects [customObjects] retrieve all custom objects [true]
-lc, --lucidchart [lucidchart] generate ERD file for Lucidchart [true]
-s, --standardObjects [standardObjects] standard sObjects to retrieve separated with commas
Expand Down
1 change: 1 addition & 0 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ program
.option('-u, --username [username]', 'salesforce username')
.option('-p, --password [password]', 'salesforce password')
.option('-l, --loginUrl [loginUrl]', 'salesforce login URL [https://login.salesforce.com]', 'https://login.salesforce.com')
.option('-a, --apiVersion [apiVersion]', 'salesforce API Version [48.0]', '48.0')
.option('-c, --customObjects [customObjects]', 'retrieve all custom objects [true]', true)
.option('-lc, --lucidchart [lucidchart]', 'generate ERD file for Lucidchart [true]', true)
.option('-s, --standardObjects [standardObjects]', 'standard sObjects to retrieve separated with commas')
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ module.exports = (config, logger) => {
if (typeof config.loginUrl === 'undefined' || config.loginUrl === null) {
config.loginUrl = 'https://login.salesforce.com';
}
if (typeof config.apiVersion === 'undefined' || config.apiVersion === null) {
config.apiVersion = '48.0';
}
if (typeof config.output === 'undefined' || config.output === null) {
config.output = '.';
}
Expand Down Expand Up @@ -95,7 +98,8 @@ module.exports = (config, logger) => {
const promise = new Promise((resolve, reject) => {

const conn = new jsforce.Connection({
loginUrl: config.loginUrl
loginUrl: config.loginUrl,
version: config.apiVersion
});

// Salesforce connection
Expand Down
3 changes: 3 additions & 0 deletions lib/downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ module.exports = class Downloader {
const stats = fs.statSync(filePath);

resolve(stats.size);
}).catch(function(err) {
console.log(err);
console.log(err.stack);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sfdc-generate-data-dictionary",
"version": "1.2.5",
"version": "1.2.7",
"description": "Generate data dictionary from a Salesforce Org",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit 30db8dc

Please sign in to comment.