@docbrasil/api-systemmanager 1.1.74 → 1.1.75
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 +37 -0
- package/dist/bundle.cjs +37 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +33 -0
- package/docs/Help.html +205 -0
- package/docs/user_help.js.html +37 -0
- package/package.json +1 -1
package/api/user/help.js
CHANGED
|
@@ -113,6 +113,43 @@ class Help {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
118
|
+
* @description Get list of external URL help pages available for the logged user.
|
|
119
|
+
* Returns help pages where the user has permission based on their groups or user ID.
|
|
120
|
+
* @param {string} session Session, token JWT
|
|
121
|
+
* @returns {promise<Array>} Array of external URL help pages with permissions
|
|
122
|
+
* @public
|
|
123
|
+
* @example
|
|
124
|
+
*
|
|
125
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
126
|
+
* const api = new API();
|
|
127
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
128
|
+
* const externalUrls = await api.user.help.listExternalUrls(session);
|
|
129
|
+
* // Returns:
|
|
130
|
+
* // [
|
|
131
|
+
* // {
|
|
132
|
+
* // _id: '...',
|
|
133
|
+
* // title: 'Help Page Title',
|
|
134
|
+
* // permissions: ['VIEW', 'CREATE_EXTERNAL_URL'],
|
|
135
|
+
* // showPoweredBy: true,
|
|
136
|
+
* // showCreatedBy: false
|
|
137
|
+
* // }
|
|
138
|
+
* // ]
|
|
139
|
+
*/
|
|
140
|
+
async listExternalUrls(session) {
|
|
141
|
+
const self = this;
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
145
|
+
|
|
146
|
+
const apiCall = self._client.get('/help/external-urls', self._setHeader(session));
|
|
147
|
+
return self._returnData(await apiCall, []);
|
|
148
|
+
} catch (ex) {
|
|
149
|
+
throw ex;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
116
153
|
}
|
|
117
154
|
|
|
118
155
|
export default Help;
|
package/dist/bundle.cjs
CHANGED
|
@@ -11444,6 +11444,43 @@ class Help {
|
|
|
11444
11444
|
}
|
|
11445
11445
|
}
|
|
11446
11446
|
|
|
11447
|
+
/**
|
|
11448
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
11449
|
+
* @description Get list of external URL help pages available for the logged user.
|
|
11450
|
+
* Returns help pages where the user has permission based on their groups or user ID.
|
|
11451
|
+
* @param {string} session Session, token JWT
|
|
11452
|
+
* @returns {promise<Array>} Array of external URL help pages with permissions
|
|
11453
|
+
* @public
|
|
11454
|
+
* @example
|
|
11455
|
+
*
|
|
11456
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
11457
|
+
* const api = new API();
|
|
11458
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
11459
|
+
* const externalUrls = await api.user.help.listExternalUrls(session);
|
|
11460
|
+
* // Returns:
|
|
11461
|
+
* // [
|
|
11462
|
+
* // {
|
|
11463
|
+
* // _id: '...',
|
|
11464
|
+
* // title: 'Help Page Title',
|
|
11465
|
+
* // permissions: ['VIEW', 'CREATE_EXTERNAL_URL'],
|
|
11466
|
+
* // showPoweredBy: true,
|
|
11467
|
+
* // showCreatedBy: false
|
|
11468
|
+
* // }
|
|
11469
|
+
* // ]
|
|
11470
|
+
*/
|
|
11471
|
+
async listExternalUrls(session) {
|
|
11472
|
+
const self = this;
|
|
11473
|
+
|
|
11474
|
+
try {
|
|
11475
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
11476
|
+
|
|
11477
|
+
const apiCall = self._client.get('/help/external-urls', self._setHeader(session));
|
|
11478
|
+
return self._returnData(await apiCall, []);
|
|
11479
|
+
} catch (ex) {
|
|
11480
|
+
throw ex;
|
|
11481
|
+
}
|
|
11482
|
+
}
|
|
11483
|
+
|
|
11447
11484
|
}
|
|
11448
11485
|
|
|
11449
11486
|
/**
|