Skip to content

Commit

Permalink
Merge pull request #6 from zoho/beta
Browse files Browse the repository at this point in the history
4.0.0
  • Loading branch information
tharunpargi authored Feb 7, 2025
2 parents 172207e + 018b50e commit 92ca1d0
Show file tree
Hide file tree
Showing 2,040 changed files with 216,130 additions and 969 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ License

## Latest Version

- [4.0.0](/versions/4.0.0/README.md)

- Handled FileStore save and update token method issue.
- Update CADataCenter Accounts URL.

- [3.0.0](/versions/3.0.0/README.md)

> **_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.
Expand Down Expand Up @@ -121,7 +126,7 @@ For older versions, please [refer](https://github.com/zoho/zohocrm-nodejs-sdk-7.
## Including the SDK in your project
You can include the SDK to your project using:

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

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

Expand Down Expand Up @@ -179,4 +184,4 @@ For example, if you generate the tokens for your Sandbox environment in the CN d
> - 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.

---
For more details, kindly refer [here](/versions/3.0.0/README.md).
For more details, kindly refer [here](/versions/4.0.0/README.md).
9 changes: 7 additions & 2 deletions lib/models/authenticator/store/file_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class FileStore extends TokenStore {
let oauthToken = token;
var csvReader = fs.readFileSync(this.filePath, 'utf-8').toString().split("\n");
let isRowPresent = false;
csvReader = csvReader.filter(line => line.trim() !== "");
for (var index = 1; index < csvReader.length; index++) {
var allcontents = csvReader[index];
let nextRecord = allcontents.split(",");
Expand Down Expand Up @@ -116,9 +117,11 @@ class FileStore extends TokenStore {
}
// csvReader.push("\n");
csvReader.push((await this.setToken(oauthToken)).join(","))
csvReader = csvReader.filter(line => line.trim() !== "");
fs.writeFileSync(this.filePath, csvReader.join("\n"));
}
if (isRowPresent) {
csvReader = csvReader.filter(line => line.trim() !== "");
fs.writeFileSync(this.filePath, csvReader.join("\n"));
}
} catch (err) {
Expand Down Expand Up @@ -168,6 +171,7 @@ class FileStore extends TokenStore {
try {
var tokens = [];
var csvReader = fs.readFileSync(this.filePath, 'utf-8').toString().split("\n");
csvReader = csvReader.filter(line => line.trim() !== "");
for (var i = 1; i < csvReader.length; i++) {
let allContents = csvReader[i];
let nextRecord = allContents.split(",");
Expand Down Expand Up @@ -307,8 +311,9 @@ class FileStore extends TokenStore {
async generateID(allcontents) {
let maxValue = 0;
if (allcontents.length > 1) {
for (var i = 1; i < allcontents.length; i++) {
let nextRecord = allcontents[i];
let allContentsArray = allcontents.map(line => line.split(','));
for (var i = 1; i < allContentsArray.length; i++) {
let nextRecord = allContentsArray[i];
if (nextRecord.length > 1 && nextRecord[0] != null && nextRecord[0]) {
if (maxValue < parseInt(nextRecord[0])) {
maxValue = parseInt(nextRecord[0]);
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/dc/ca_data_center.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class CADataCenter extends DataCenter {
}

getIAMUrl() {
return "https://accounts.zoho.ca/oauth/v2/token";
return "https://accounts.zohocloud.ca/oauth/v2/token";
}

getFileUploadUrl() {
return "https://content.zohoapis.ca"
return "https://upload.zohocloud.ca"
}
}
export {
Expand Down
Loading

0 comments on commit 92ca1d0

Please sign in to comment.