Skip to content

Commit 92ca1d0

Browse files
authored
Merge pull request #6 from zoho/beta
4.0.0
2 parents 172207e + 018b50e commit 92ca1d0

File tree

2,040 files changed

+216130
-969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,040 files changed

+216130
-969
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ License
2525

2626
## Latest Version
2727

28+
- [4.0.0](/versions/4.0.0/README.md)
29+
30+
- Handled FileStore save and update token method issue.
31+
- Update CADataCenter Accounts URL.
32+
2833
- [3.0.0](/versions/3.0.0/README.md)
2934

3035
> **_NOTE:_** We have updated the ***[Node.js SDK API package name](/versions/3.0.0/Package.md)*** as part of this release. Please review the updated package name and make the necessary adjustments to your codebase to ensure compatibility with the latest version of the SDK.
@@ -121,7 +126,7 @@ For older versions, please [refer](https://github.com/zoho/zohocrm-nodejs-sdk-7.
121126
## Including the SDK in your project
122127
You can include the SDK to your project using:
123128

124-
For including the latest [version](https://github.com/zoho/zohocrm-nodejs-sdk-7.0/releases/tag/3.0.0) using npm
129+
For including the latest [version](https://github.com/zoho/zohocrm-nodejs-sdk-7.0/releases/tag/4.0.0) using npm
125130

126131
- Install **Node** from [nodejs.org](https://nodejs.org/en/download/) (if not installed).
127132

@@ -179,4 +184,4 @@ For example, if you generate the tokens for your Sandbox environment in the CN d
179184
> - For **Mass Convert API**, you will need to provide the **ZohoCRM.settings.fields.ALL** scope along with the **ZohoCRM.mass_convert.leads.CREATE** and **ZohoCRM.mass_convert.leads.READ** scope while generating the OAuthtoken. Otherwise, the system returns the **OAUTH-SCOPE-MISMATCH** error.
180185

181186
---
182-
For more details, kindly refer [here](/versions/3.0.0/README.md).
187+
For more details, kindly refer [here](/versions/4.0.0/README.md).

lib/models/authenticator/store/file_store.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class FileStore extends TokenStore {
8080
let oauthToken = token;
8181
var csvReader = fs.readFileSync(this.filePath, 'utf-8').toString().split("\n");
8282
let isRowPresent = false;
83+
csvReader = csvReader.filter(line => line.trim() !== "");
8384
for (var index = 1; index < csvReader.length; index++) {
8485
var allcontents = csvReader[index];
8586
let nextRecord = allcontents.split(",");
@@ -116,9 +117,11 @@ class FileStore extends TokenStore {
116117
}
117118
// csvReader.push("\n");
118119
csvReader.push((await this.setToken(oauthToken)).join(","))
120+
csvReader = csvReader.filter(line => line.trim() !== "");
119121
fs.writeFileSync(this.filePath, csvReader.join("\n"));
120122
}
121123
if (isRowPresent) {
124+
csvReader = csvReader.filter(line => line.trim() !== "");
122125
fs.writeFileSync(this.filePath, csvReader.join("\n"));
123126
}
124127
} catch (err) {
@@ -168,6 +171,7 @@ class FileStore extends TokenStore {
168171
try {
169172
var tokens = [];
170173
var csvReader = fs.readFileSync(this.filePath, 'utf-8').toString().split("\n");
174+
csvReader = csvReader.filter(line => line.trim() !== "");
171175
for (var i = 1; i < csvReader.length; i++) {
172176
let allContents = csvReader[i];
173177
let nextRecord = allContents.split(",");
@@ -307,8 +311,9 @@ class FileStore extends TokenStore {
307311
async generateID(allcontents) {
308312
let maxValue = 0;
309313
if (allcontents.length > 1) {
310-
for (var i = 1; i < allcontents.length; i++) {
311-
let nextRecord = allcontents[i];
314+
let allContentsArray = allcontents.map(line => line.split(','));
315+
for (var i = 1; i < allContentsArray.length; i++) {
316+
let nextRecord = allContentsArray[i];
312317
if (nextRecord.length > 1 && nextRecord[0] != null && nextRecord[0]) {
313318
if (maxValue < parseInt(nextRecord[0])) {
314319
maxValue = parseInt(nextRecord[0]);

lib/routes/dc/ca_data_center.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class CADataCenter extends DataCenter {
4444
}
4545

4646
getIAMUrl() {
47-
return "https://accounts.zoho.ca/oauth/v2/token";
47+
return "https://accounts.zohocloud.ca/oauth/v2/token";
4848
}
4949

5050
getFileUploadUrl() {
51-
return "https://content.zohoapis.ca"
51+
return "https://upload.zohocloud.ca"
5252
}
5353
}
5454
export {

0 commit comments

Comments
 (0)