Skip to content

Commit 30db8dc

Browse files
committed
Add API Version management
1 parent 66780e3 commit 30db8dc

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# <img src="https://public.gavignon.io/images/sfdc-generate-data-dictionary-title.png" height="32">
2-
![version](https://img.shields.io/badge/version-1.2.6-blue)
2+
![version](https://img.shields.io/badge/version-1.2.7-blue)
33

44
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.
55

@@ -33,6 +33,7 @@ $ sgd -h
3333
-u, --username [username] salesforce username
3434
-p, --password [password] salesforce password
3535
-l, --loginUrl [loginUrl] salesforce login URL [https://login.salesforce.com]
36+
-a, --apiVersion [apiVersion] salesforce API Version [48.0]
3637
-c, --customObjects [customObjects] retrieve all custom objects [true]
3738
-lc, --lucidchart [lucidchart] generate ERD file for Lucidchart [true]
3839
-s, --standardObjects [standardObjects] standard sObjects to retrieve separated with commas

bin/cli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ program
1111
.option('-u, --username [username]', 'salesforce username')
1212
.option('-p, --password [password]', 'salesforce password')
1313
.option('-l, --loginUrl [loginUrl]', 'salesforce login URL [https://login.salesforce.com]', 'https://login.salesforce.com')
14+
.option('-a, --apiVersion [apiVersion]', 'salesforce API Version [48.0]', '48.0')
1415
.option('-c, --customObjects [customObjects]', 'retrieve all custom objects [true]', true)
1516
.option('-lc, --lucidchart [lucidchart]', 'generate ERD file for Lucidchart [true]', true)
1617
.option('-s, --standardObjects [standardObjects]', 'standard sObjects to retrieve separated with commas')

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ module.exports = (config, logger) => {
1515
if (typeof config.loginUrl === 'undefined' || config.loginUrl === null) {
1616
config.loginUrl = 'https://login.salesforce.com';
1717
}
18+
if (typeof config.apiVersion === 'undefined' || config.apiVersion === null) {
19+
config.apiVersion = '48.0';
20+
}
1821
if (typeof config.output === 'undefined' || config.output === null) {
1922
config.output = '.';
2023
}
@@ -95,7 +98,8 @@ module.exports = (config, logger) => {
9598
const promise = new Promise((resolve, reject) => {
9699

97100
const conn = new jsforce.Connection({
98-
loginUrl: config.loginUrl
101+
loginUrl: config.loginUrl,
102+
version: config.apiVersion
99103
});
100104

101105
// Salesforce connection

lib/downloader.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ module.exports = class Downloader {
2222
const stats = fs.statSync(filePath);
2323

2424
resolve(stats.size);
25+
}).catch(function(err) {
26+
console.log(err);
27+
console.log(err.stack);
2528
});
2629
});
2730
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sfdc-generate-data-dictionary",
3-
"version": "1.2.5",
3+
"version": "1.2.7",
44
"description": "Generate data dictionary from a Salesforce Org",
55
"main": "index.js",
66
"bin": {

0 commit comments

Comments
 (0)