@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/doc/api.md CHANGED
@@ -2329,6 +2329,7 @@ Class for user registration in a user
2329
2329
  * [Help](#Help)
2330
2330
  * [.getTopics(filter, session)](#Help+getTopics)
2331
2331
  * [.get(params, session)](#Help+get) ⇒ <code>promise</code>
2332
+ * [.listExternalUrls(session)](#Help+listExternalUrls) ⇒ <code>promise.&lt;Array&gt;</code>
2332
2333
 
2333
2334
  <a name="Help+getTopics"></a>
2334
2335
 
@@ -2376,6 +2377,38 @@ const params = {
2376
2377
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2377
2378
  await api.user.help.get(params, session);
2378
2379
  ```
2380
+ <a name="Help+listExternalUrls"></a>
2381
+
2382
+ ### help.listExternalUrls(session) ⇒ <code>promise.&lt;Array&gt;</code>
2383
+ Get list of external URL help pages available for the logged user.
2384
+ Returns help pages where the user has permission based on their groups or user ID.
2385
+
2386
+ **Kind**: instance method of [<code>Help</code>](#Help)
2387
+ **Returns**: <code>promise.&lt;Array&gt;</code> - Array of external URL help pages with permissions
2388
+ **Access**: public
2389
+ **Author**: Myndware <augusto.pissarra@myndware.com>
2390
+
2391
+ | Param | Type | Description |
2392
+ | --- | --- | --- |
2393
+ | session | <code>string</code> | Session, token JWT |
2394
+
2395
+ **Example**
2396
+ ```js
2397
+ const API = require('@docbrasil/api-systemmanager');
2398
+ const api = new API();
2399
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2400
+ const externalUrls = await api.user.help.listExternalUrls(session);
2401
+ // Returns:
2402
+ // [
2403
+ // {
2404
+ // _id: '...',
2405
+ // title: 'Help Page Title',
2406
+ // permissions: ['VIEW', 'CREATE_EXTERNAL_URL'],
2407
+ // showPoweredBy: true,
2408
+ // showCreatedBy: false
2409
+ // }
2410
+ // ]
2411
+ ```
2379
2412
  <a name="Users"></a>
2380
2413
 
2381
2414
  ## Users
package/docs/Help.html CHANGED
@@ -658,6 +658,211 @@ await api.user.help.getTopics({}, session);</code></pre>
658
658
 
659
659
 
660
660
 
661
+ </div>
662
+
663
+ <div class="member">
664
+
665
+
666
+
667
+ <h4 class="name" id="listExternalUrls">
668
+ <a class="href-link" href="#listExternalUrls">#</a>
669
+
670
+
671
+ <span class='tag'>async</span>
672
+
673
+
674
+ <span class="code-name">
675
+
676
+ listExternalUrls<span class="signature">(session)</span><span class="type-signature"> &rarr; {promise.&lt;Array>}</span>
677
+
678
+ </span>
679
+ </h4>
680
+
681
+
682
+
683
+
684
+ <div class="description">
685
+ Get list of external URL help pages available for the logged user.
686
+ Returns help pages where the user has permission based on their groups or user ID.
687
+ </div>
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+ <h5>Parameters:</h5>
699
+
700
+ <div class="table-container">
701
+ <table class="params table">
702
+ <thead>
703
+ <tr>
704
+
705
+ <th>Name</th>
706
+
707
+
708
+ <th>Type</th>
709
+
710
+
711
+
712
+
713
+
714
+ <th class="last">Description</th>
715
+ </tr>
716
+ </thead>
717
+
718
+ <tbody>
719
+
720
+
721
+
722
+ <tr class="deep-level-0">
723
+
724
+ <td class="name"><code>session</code></td>
725
+
726
+
727
+ <td class="type">
728
+
729
+
730
+ <code class="param-type">string</code>
731
+
732
+
733
+
734
+ </td>
735
+
736
+
737
+
738
+
739
+
740
+ <td class="description last">Session, token JWT</td>
741
+ </tr>
742
+
743
+
744
+
745
+ </tbody>
746
+ </table>
747
+ </div>
748
+
749
+
750
+
751
+
752
+
753
+ <dl class="details">
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+ <dt class="tag-author">Author:</dt>
773
+ <dd class="tag-author">
774
+ <ul>
775
+ <li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
776
+ </ul>
777
+ </dd>
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+
788
+
789
+
790
+
791
+
792
+ <p class="tag-source">
793
+ <a href="user_help.js.html" class="button">View Source</a>
794
+ <span>
795
+ <a href="user_help.js.html">user/help.js</a>, <a href="user_help.js.html#line140">line 140</a>
796
+ </span>
797
+ </p>
798
+
799
+ </dl>
800
+
801
+
802
+
803
+
804
+
805
+
806
+
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+ <div class='columns method-parameter'>
819
+ <div class="column is-2"><label>Returns:</label></div>
820
+ <div class="column is-10">
821
+
822
+
823
+
824
+ <div class="columns">
825
+
826
+ <div class='param-desc column is-7'>Array of external URL help pages with permissions</div>
827
+
828
+
829
+ <div class='column is-5 has-text-left'>
830
+ <label>Type: </label>
831
+
832
+ <code class="param-type">promise.&lt;Array></code>
833
+
834
+
835
+ </div>
836
+
837
+ </div>
838
+
839
+
840
+ </div>
841
+ </div>
842
+
843
+
844
+
845
+
846
+ <h5>Example</h5>
847
+
848
+
849
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
850
+ const api = new API();
851
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
852
+ const externalUrls = await api.user.help.listExternalUrls(session);
853
+ // Returns:
854
+ // [
855
+ // {
856
+ // _id: '...',
857
+ // title: 'Help Page Title',
858
+ // permissions: ['VIEW', 'CREATE_EXTERNAL_URL'],
859
+ // showPoweredBy: true,
860
+ // showCreatedBy: false
861
+ // }
862
+ // ]</code></pre>
863
+
864
+
865
+
661
866
  </div>
662
867
 
663
868
  </div>
@@ -200,6 +200,43 @@ class Help {
200
200
  }
201
201
  }
202
202
 
203
+ /**
204
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
205
+ * @description Get list of external URL help pages available for the logged user.
206
+ * Returns help pages where the user has permission based on their groups or user ID.
207
+ * @param {string} session Session, token JWT
208
+ * @returns {promise&lt;Array>} Array of external URL help pages with permissions
209
+ * @public
210
+ * @example
211
+ *
212
+ * const API = require('@docbrasil/api-systemmanager');
213
+ * const api = new API();
214
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
215
+ * const externalUrls = await api.user.help.listExternalUrls(session);
216
+ * // Returns:
217
+ * // [
218
+ * // {
219
+ * // _id: '...',
220
+ * // title: 'Help Page Title',
221
+ * // permissions: ['VIEW', 'CREATE_EXTERNAL_URL'],
222
+ * // showPoweredBy: true,
223
+ * // showCreatedBy: false
224
+ * // }
225
+ * // ]
226
+ */
227
+ async listExternalUrls(session) {
228
+ const self = this;
229
+
230
+ try {
231
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
232
+
233
+ const apiCall = self._client.get('/help/external-urls', self._setHeader(session));
234
+ return self._returnData(await apiCall, []);
235
+ } catch (ex) {
236
+ throw ex;
237
+ }
238
+ }
239
+
203
240
  }
204
241
 
205
242
  export default Help;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@docbrasil/api-systemmanager",
3
3
  "description": "Module API System Manager",
4
- "version": "1.1.74",
4
+ "version": "1.1.75",
5
5
  "scripts": {
6
6
  "htmldoc": "rm -rf docs && jsdoc api/** -d docs -t ./node_modules/better-docs",
7
7
  "doc": "rm -rf doc && mkdir doc && jsdoc2md api/**/* api/* > doc/api.md",