node-zendesk
Advanced tools
Comparing version 1.1.2 to 1.1.4
@@ -5,3 +5,3 @@ // client.js - node-zendesk client initialization | ||
var parts = [ | ||
'Users', 'Tickets', 'TicketAudits', 'TicketFields', 'TicketMetrics', | ||
'Users', 'Tickets', 'TicketAudits', 'TicketFields', 'TicketMetrics', 'TicketImport', 'TicketExport', | ||
'Views', 'Requests', 'UserIdentities', 'Groups', 'GroupMemberships', | ||
@@ -14,3 +14,3 @@ 'CustomAgentRoles', 'Organizations', 'Search', 'Tags', 'Forums', | ||
'OrganizationFields', 'OauthTokens', 'Triggers', 'SharingAgreement', | ||
'Brand', 'OrganizationMemberships' | ||
'Brand', 'OrganizationMemberships', 'DynamicContent' | ||
], | ||
@@ -17,0 +17,0 @@ helpcenterParts = [ |
@@ -134,7 +134,7 @@ // client.js - main client file that does most of the processing | ||
resultList.push(result); | ||
nextPage = result.next_page; | ||
nextPage = result ? result.next_page : null; | ||
async.whilst( | ||
function () { | ||
if (null !== nextPage && 'undefined' !== typeof nextPage) { | ||
if (nextPage !== null) { | ||
return nextPage; | ||
@@ -156,3 +156,3 @@ } else { | ||
resultList.push(result); | ||
nextPage = result.next_page; | ||
nextPage = result ? result.next_page : null; | ||
cb(null); | ||
@@ -159,0 +159,0 @@ }]); |
@@ -5,4 +5,4 @@ //Articles.js: Client for the zendesk help center API. | ||
var util = require('util'), | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
@@ -56,3 +56,2 @@ | ||
// ====================================== Viewing Articles | ||
Articles.prototype.show = function (articleID, cb) { | ||
@@ -62,9 +61,18 @@ this.request('GET', ['articles', articleID], cb); | ||
// ====================================== Viewing Articles By Locale | ||
Articles.prototype.showWithLocale = function(locale, articleID, cb) { | ||
this.request('GET', [locale, 'articles', articleID], cb); | ||
}; | ||
// ====================================== Creating Articles | ||
Articles.prototype.create = function (sectionID, article, cb) { | ||
this.request('POST',['sections', sectionID, 'articles'], article, cb); | ||
this.request('POST', ['sections', sectionID, 'articles'], article, cb); | ||
}; | ||
// ====================================== Creating Articles With Specified Locale | ||
Articles.prototype.createWithLocale = function (locale, sectionID, article, cb) { | ||
this.request('POST', [locale, 'sections', sectionID, 'articles'], article, cb); | ||
} | ||
// ====================================== Updating Articles | ||
Articles.prototype.update = function (articleID, article, cb) { | ||
@@ -74,8 +82,12 @@ this.request('PUT', ['articles', articleID], article, cb); | ||
// ====================================== Updating Articles by Locale | ||
Articles.prototype.updateByLocale = function (locale, articleID, article, cb) { | ||
// ====================================== Updating Articles With Specified Locale | ||
Articles.prototype.updateWithLocale = function (locale, articleID, article, cb) { | ||
this.request('PUT', [locale, 'articles', articleID], article, cb); | ||
}; | ||
// ====================================== Associating Attachments In Bulk | ||
Articles.prototype.associateAttachmentsInBulk = function (articleID, attachmentIDsInBulk, cb) { | ||
this.request('POST', ['articles', articleID, 'bulk_attachments'], attachmentIDsInBulk, cb); | ||
} | ||
// ====================================== Deleting Articles | ||
@@ -82,0 +94,0 @@ Articles.prototype.delete = function (articleID, cb) { |
@@ -5,4 +5,4 @@ //Categories.js: Client for the zendesk API. | ||
var util = require('util'), | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
@@ -39,3 +39,2 @@ | ||
// ====================================== Updating Categories | ||
Categories.prototype.update = function (categoryID, category, cb) { | ||
@@ -45,3 +44,12 @@ this.request('PUT', ['categories', categoryID], category, cb); | ||
// ====================================== Updating Categories With Specified Locale | ||
Categories.prototype.updateWithLocale = function(locale, categoryID, category, cb) { | ||
this.request('PUT', [locale, 'categories', categoryID], category, cb); | ||
} | ||
// ====================================== Updating Categories' Source Locale | ||
Categories.prototype.updateSourceLocale = function(categoryID, sourceLocale, cb) { | ||
this.request('PUT', ['categories', categoryID, 'source_locale'], sourceLocale, cb); | ||
}; | ||
// ====================================== Deleting Categories | ||
@@ -48,0 +56,0 @@ Categories.prototype.delete = function (categoryID, cb) { |
@@ -5,4 +5,4 @@ //Sections.js: Client for the zendesk API. | ||
var util = require('util'), | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
@@ -26,3 +26,2 @@ | ||
// ====================================== Listing Sections In A Category | ||
Sections.prototype.listByCategory = function (categoryID, cb) { | ||
@@ -32,4 +31,9 @@ this.requestAll('GET', ['categories', categoryID, 'sections'], cb);//all | ||
// ====================================== Listing Sections By Locale | ||
Sections.prototype.listWithLocale = function (locale, cb) { | ||
this.requestAll('GET', [locale, 'sections'], cb);//all | ||
}; | ||
// ====================================== Viewing Sections | ||
Sections.prototype.show = function (sectionID, cb) { | ||
@@ -39,2 +43,7 @@ this.request('GET', ['sections', sectionID], cb); | ||
// ====================================== Viewing Section by locale | ||
Sections.prototype.showWithLocale = function(locale, sectionID, cb) { | ||
this.request('GET', [locale, 'sections', sectionID], cb); | ||
}; | ||
// ====================================== Creating Sections | ||
@@ -45,4 +54,8 @@ Sections.prototype.create = function (categoryId, section, cb) { | ||
// ====================================== Creating Sections With Specified Locale | ||
Sections.prototype.createWithLocale = function (locale, categoryId, section, cb) { | ||
this.request('POST', [locale, 'categories', categoryId, 'sections'], section, cb); | ||
} | ||
// ====================================== Updating Sections | ||
Sections.prototype.update = function (sectionID, section, cb) { | ||
@@ -52,2 +65,12 @@ this.request('PUT', ['sections', sectionID], section, cb); | ||
// ====================================== Updating Sections By Locale | ||
Sections.prototype.updateWithLocale = function (locale, sectionID, section, cb) { | ||
this.request('PUT', [locale, 'sections', sectionID], section, cb); | ||
}; | ||
// ====================================== Updating Sections' Source Locale | ||
Sections.prototype.updateSourceLocale = function (sectionID, sourceLocale, cb) { | ||
this.request('PUT', ['sections', sectionID, 'source_locale'],sourceLocale, cb); | ||
} | ||
// ====================================== Deleting Sections | ||
@@ -54,0 +77,0 @@ Sections.prototype.delete = function (sectionID, cb) { |
@@ -5,4 +5,4 @@ //Translation.js: Client for the zendesk API. | ||
var util = require('util'), | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
Client = require('../client').Client | ||
//defaultgroups = require('./helpers').defaultgroups; | ||
@@ -79,3 +79,3 @@ | ||
// ====================================== Updating Translations For A Sectioon | ||
// ====================================== Updating Translations For A Section | ||
Translations.prototype.updateForSection = function (sectionID, locale, translation, cb) { | ||
@@ -85,5 +85,14 @@ this.request('PUT', ['sections',sectionID,'translations',locale], translation, cb); | ||
// ====================================== Updating Translations For A Category | ||
Translations.prototype.updateForCategory = function (categoryID, locale, translation, cb) { | ||
this.request('PUT', ['categories',categoryID,'translations',locale], translation, cb); | ||
}; | ||
// ====================================== Deleting Translations | ||
Translations.prototype.delete = function (translationID, cb) { | ||
this.request('DELETE', ['translations', translationID], cb); | ||
}; | ||
}; | ||
// ====================================== Listing All Enabled Locales And Default Locale | ||
Translations.prototype.listLocales = function(cb) { | ||
this.request('GET', ['locales'], cb); | ||
} |
@@ -30,6 +30,10 @@ //Macros.js: Client for the zendesk API. | ||
Macros.prototype.create = function (user, cb) { | ||
Macros.prototype.create = function (macro, cb) { | ||
this.request('POST', ['macros'], macro, cb); | ||
}; | ||
// ====================================== Updating Tickets Fields | ||
Macros.prototype.update = function (macroID, macro, cb) { | ||
this.request('PUT', ['macros', macroID], macro, cb); | ||
}; | ||
@@ -36,0 +40,0 @@ Macros.prototype.createMany = function (users, cb) { |
{ | ||
"name": "node-zendesk", | ||
"version": "1.1.2", | ||
"version": "1.1.4", | ||
"description": "zendesk API client wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
103
ReadMe.md
@@ -7,2 +7,12 @@ # node-zendesk | ||
## Table of Contents | ||
- [Example](https://github.com/blakmatrix/node-zendesk#example) | ||
- [Install](https://github.com/blakmatrix/node-zendesk#install) | ||
- [Using OAuth for Authentication](https://github.com/blakmatrix/node-zendesk#using-oauth-for-authentication) | ||
- [Command Line Options](https://github.com/blakmatrix/node-zendesk#command-line-options-for-scripts) | ||
- [Library Mode](https://github.com/blakmatrix/node-zendesk#disable-default-scripting-functionality--enable-library-only) | ||
- [Core API Methods](https://github.com/blakmatrix/node-zendesk#core-api-methods) | ||
- [Help Center API Methods](https://github.com/blakmatrix/node-zendesk#help-center-methods) | ||
- [Voice API Methods](https://github.com/blakmatrix/node-zendesk#voice-methods) | ||
- [Contributions](https://github.com/blakmatrix/node-zendesk#contributions) | ||
@@ -101,3 +111,2 @@ ## Example | ||
```js | ||
@@ -109,3 +118,4 @@ request(method, uri) | ||
## Methods | ||
## Core API Methods | ||
(See: https://developer.zendesk.com/rest_api/docs/core/introduction) | ||
@@ -138,2 +148,22 @@ ### accountsettings | ||
### dynamiccontent | ||
https://developer.zendesk.com/rest_api/docs/core/dynamic_content | ||
```js | ||
listItems(cb) | ||
listAllItems(cb) | ||
showItem(itemID, cb) | ||
createItem(item, cb) | ||
updateItem(itemID, item, cb) | ||
deleteItem(itemID, cb) | ||
listVariants(itemID, cb) | ||
listAllVariants(itemID, cb) | ||
showVariant((itemID, variantID, cb) | ||
createVariant(itemID, variant, cb) | ||
updateVariant(itemID, variantID, variant, cb) | ||
deleteVariant(itemID, variantID, cb) | ||
``` | ||
### categories | ||
@@ -472,3 +502,4 @@ | ||
## Methods For HelpCenter | ||
## Help Center API Methods | ||
(See: https://developer.zendesk.com/rest_api/docs/help_center/introduction) | ||
To enable help center client, use `-hc` or `--helpcenter` parameter. | ||
@@ -601,8 +632,70 @@ | ||
## Tests | ||
## Voice API Methods | ||
(See: https://developer.zendesk.com/rest_api/docs/voice-api/voice) | ||
To enable help center client, use `-v` or `--voice` parameter. | ||
ToDO | ||
### agentactivities | ||
```js | ||
show(cb) | ||
``` | ||
### availabilities | ||
```js | ||
update(agentID, cb) | ||
show(agentID, cb) | ||
``` | ||
### currentqueue | ||
```js | ||
show(cb) | ||
``` | ||
### greetingcategories | ||
```js | ||
list(cb) | ||
show(greetingCategoryID, cb) | ||
``` | ||
### greetings | ||
```js | ||
list(cb) | ||
show(greetingID, cb) | ||
create(greetingID, cb) | ||
update(greetingID, cb) | ||
delete(greetingID, cb) | ||
``` | ||
### historicalqueue | ||
```js | ||
show(cb) | ||
``` | ||
### phonenumbers | ||
```js | ||
search(searchTerm, cb) | ||
update(phoneID, cb) | ||
list(cb) | ||
create(cb) | ||
update(phoneID, phone_number, cb) | ||
delete(phoneID, cb) | ||
``` | ||
## Contributions | ||
If you're looking to contribute, please refer to the [API Coverage Document](https://github.com/blakmatrix/node-zendesk/blob/master/doc/api-coverage.md), open an issue, or make a PR! | ||
Tests and examples are also welcome. | ||
Zendesk's documentation can be found [here](https://developer.zendesk.com/rest_api/docs/core/introduction). | ||
## License | ||
MIT. |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
213733
86
2697
696
24
1