ibm-connections-blogs
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -53,3 +53,16 @@ 'use strict'; | ||
const getBlogPosts = (handle, query, options, callback) => { | ||
/** | ||
* [getBlogPosts description] | ||
* @method getBlogPosts | ||
* @param {Object} query [description] | ||
* @param {String} query.handle The Blog handle you want to get entries from. | ||
* A handle is specified when a blog is first created and is used in the construction of | ||
* web addresses used to query the entries in a blog. | ||
* The handle can be the Community Uuid. | ||
* @param {Object} options Any options you want to pass to `httpClient.makeRequest()` | ||
* https://github.com/request/request#requestoptions-callback | ||
* @param {Function} [callback] [description] | ||
* @return {Promise} If no callback is provided, this method returns a Promise | ||
*/ | ||
const getBlogPosts = (query, options, callback) => { | ||
const qsValidParameters = ['page', 'ps', 'search', 'sortBy', 'sortOrder', 'tags']; | ||
@@ -61,3 +74,5 @@ | ||
qs: { | ||
page: 1, | ||
// despite the fact that the documentation for IBM Connections Cloud Blogs (6.0.0) says default value would be "1", it only works with "0" | ||
// https://www-10.lotus.com/ldd/appdevwiki.nsf/xpAPIViewer.xsp?lookupName=API+Reference#action=openDocument&res_title=Getting_a_feed_of_recent_posts_for_a_blog_ic50&content=apicontent | ||
page: 0, | ||
ps: 10, // max is 50 | ||
@@ -67,3 +82,2 @@ lang: 'en_us', | ||
}, omitDefaultRequestParams(options), { | ||
handle, | ||
qs: _.pick(query, qsValidParameters), | ||
@@ -74,3 +88,3 @@ headers: { | ||
ttl: params.ttl.blogPosts, | ||
uri: '{ authType }/{ handle }/feed/entries/atom', | ||
uri: `{ authType }/${query.handle}/feed/entries/atom`, | ||
}); | ||
@@ -77,0 +91,0 @@ |
{ | ||
"name": "ibm-connections-blogs", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "An IBM Connections Blogs API Wrapper", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12050
219