ahmader / node-zoho Goto Github PK
View Code? Open in Web Editor NEWZoho API access for NodeJS
Zoho API access for NodeJS
ATM in project is supported only CustomModule1.
As I noticed in Zoho, user can create more custom modules, so, I think, it is inappropriate to create new copy of file for this purposes.
Maybe we should add some logic which allow create any CustomModule[N] from this file?
Now it's hardcoded to crm.zoho.com. But in Zoho isset another domains like crm.zoho.eu.
It will be nice to have possibility to setup Zoho domain on instance creation.
The grunt task is not calling coffeelint on lib/ folder
Thanks for merging my fix. Will you update the npm package soon, so that we can use the npm version rather than getting it from github ?
Thanks.
Can I Pull Request in JavaScript instead of CoffeScript ?
I noticed that method getRecordsById in crm-module.coffee doesn't work correctly cause this code
if response.data?[@name]
row = _.first(response.data?[@name])
processed = @processRecord(_.first(row.row))
response.data = processed
compiled like
if ((_ref = response.data) != null ? _ref.Events : void 0) {
row = _.first((_ref1 = response.data) != null ? _ref1.Events : void 0);
processed = _this.processRecord(_.first(row.row));
response.data = processed;
}
and not overrides in each child component to correct module name like Contacts etc
if ((_ref = response.data) != null ? _ref.Contacts : void 0) {
row = _.first((_ref1 = response.data) != null ? _ref1.Contacts : void 0);
processed = _this.processRecord(_.first(row.row));
response.data = processed;
}
Have you any idea how to fix it?
UPD: actually I see error code in node package 0.0.26. When I build it manually it compiled correctly
At this moment when I try execute downloadFile method via package I see that it happens error on response parsing stage because response tries to parse file body as XML and this caused error.
We've got content-type header in response and it is different than application/xml.
The correct expected result from this method is origin response body and parsed Content-Disposition header which easily can be done with this package
What do you think about the way of implementing this method?
Team,
Would it be possible to bump versions on the request module?
Thanks,
Paul.
As mentioned in #8
As you see there is some extra parameters which we can provide with requests.
In some methods we can't setup this options. For example I need to setup wfTrigger: true on every Zoho insert action but I have no possibility to do it via method usage.
So I propose to change this
insertRecords: (records, cb) ->
if not _.isArray(records)
throw new Error('Requires array of records')
if records.length < 1
throw new Error('Requires as least one record')
query = {
newFormat: 1,
xmlData: @build(records)
}
to this part
insertRecords: (records, _query, cb) ->
if not _.isArray(records)
throw new Error('Requires array of records')
if records.length < 1
throw new Error('Requires as least one record')
if _.isFunction(_query)
cb = _query
_query = {}
query = _.extend({
newFormat: 1,
xmlData: @build(records)
}, _query)
It works perfectly and has backward compatibility. I will post pull request and try to add extra test for this case
Is there a way setting the wfTrigger to true using this API?
The regular Zoho request containing the above is something like:
https://crm.zoho.com/crm/private/xml/Leads/insertRecords?authtoken=AuthToken&scope=crmapi&wfTrigger=true&xmlData=Your XML Data
How it can be done with this API?
Thanks !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.