@docbrasil/api-systemmanager 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/user/help.js +10 -5
- package/dist/bundle.cjs +10 -5
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +5 -4
- package/docs/Help.html +30 -5
- package/docs/user_document.js.html +2 -2
- package/docs/user_help.js.html +10 -5
- package/package.json +1 -1
- package/tests/test_querystring.js +18 -0
package/api/user/help.js
CHANGED
|
@@ -49,7 +49,8 @@ class Help {
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @author Augusto Pissarra <abernardo.br@gmail.com>
|
|
52
|
-
* @description get
|
|
52
|
+
* @description get help topics for a user. Either by organizaiton product or by supplied filter. But always only the user language.
|
|
53
|
+
* @param {object} filter a filter to apply. if empty, null or undefined, than we will bring the help topics by organizaiton product.
|
|
53
54
|
* @param {string} session JWT token
|
|
54
55
|
* @public
|
|
55
56
|
* @async
|
|
@@ -58,15 +59,19 @@ class Help {
|
|
|
58
59
|
* const API = require('@docbrasil/api-systemmanager');
|
|
59
60
|
* const api = new API();
|
|
60
61
|
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
61
|
-
* await api.user.help.getTopics(session);
|
|
62
|
+
* await api.user.help.getTopics({}, session);
|
|
62
63
|
*/
|
|
63
|
-
async getTopics(session) {
|
|
64
|
+
async getTopics(filter = {}, session) {
|
|
64
65
|
const self = this;
|
|
65
66
|
|
|
66
67
|
try {
|
|
67
68
|
Joi.assert(session, Joi.string().required(), 'SM session (JWT) to call API');
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
let query = '';
|
|
70
|
+
if(!_.isEmpty(filter)) {
|
|
71
|
+
const queryFilter = JSON.stringify(filter);
|
|
72
|
+
query = `?filter=${queryFilter.toString('base64')}`;
|
|
73
|
+
}
|
|
74
|
+
const apiCall = self._client.get(`/help/topics${query}`, self._setHeader(session));
|
|
70
75
|
return self._returnData(await apiCall);
|
|
71
76
|
} catch (ex) {
|
|
72
77
|
throw ex;
|
package/dist/bundle.cjs
CHANGED
|
@@ -10354,7 +10354,8 @@ class Help {
|
|
|
10354
10354
|
|
|
10355
10355
|
/**
|
|
10356
10356
|
* @author Augusto Pissarra <abernardo.br@gmail.com>
|
|
10357
|
-
* @description get
|
|
10357
|
+
* @description get help topics for a user. Either by organizaiton product or by supplied filter. But always only the user language.
|
|
10358
|
+
* @param {object} filter a filter to apply. if empty, null or undefined, than we will bring the help topics by organizaiton product.
|
|
10358
10359
|
* @param {string} session JWT token
|
|
10359
10360
|
* @public
|
|
10360
10361
|
* @async
|
|
@@ -10363,15 +10364,19 @@ class Help {
|
|
|
10363
10364
|
* const API = require('@docbrasil/api-systemmanager');
|
|
10364
10365
|
* const api = new API();
|
|
10365
10366
|
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
10366
|
-
* await api.user.help.getTopics(session);
|
|
10367
|
+
* await api.user.help.getTopics({}, session);
|
|
10367
10368
|
*/
|
|
10368
|
-
async getTopics(session) {
|
|
10369
|
+
async getTopics(filter = {}, session) {
|
|
10369
10370
|
const self = this;
|
|
10370
10371
|
|
|
10371
10372
|
try {
|
|
10372
10373
|
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'SM session (JWT) to call API');
|
|
10373
|
-
|
|
10374
|
-
|
|
10374
|
+
let query = '';
|
|
10375
|
+
if(!___default["default"].isEmpty(filter)) {
|
|
10376
|
+
const queryFilter = JSON.stringify(filter);
|
|
10377
|
+
query = `?filter=${queryFilter.toString('base64')}`;
|
|
10378
|
+
}
|
|
10379
|
+
const apiCall = self._client.get(`/help/topics${query}`, self._setHeader(session));
|
|
10375
10380
|
return self._returnData(await apiCall);
|
|
10376
10381
|
} catch (ex) {
|
|
10377
10382
|
throw ex;
|