@docbrasil/api-systemmanager 1.1.68 → 1.1.69

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
@@ -3458,6 +3458,7 @@ Class for process, permission user
3458
3458
  * [.getOrgDocTypes(params, session)](#Process+getOrgDocTypes) ⇒ <code>Promise</code>
3459
3459
  * [.getOrgGroups(params, session)](#Process+getOrgGroups) ⇒ <code>Promise</code>
3460
3460
  * [.getOrgUsers(params, session)](#Process+getOrgUsers) ⇒ <code>Promise</code>
3461
+ * [.getStepHistory(params, session)](#Process+getStepHistory) ⇒ <code>Promise.&lt;Array&gt;</code>
3461
3462
 
3462
3463
  <a name="Process+start"></a>
3463
3464
 
@@ -3794,6 +3795,36 @@ const params = {
3794
3795
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3795
3796
  await api.user.process.getOrgUsers(params, session);
3796
3797
  ```
3798
+ <a name="Process+getStepHistory"></a>
3799
+
3800
+ ### process.getStepHistory(params, session) ⇒ <code>Promise.&lt;Array&gt;</code>
3801
+ Get step history of a process flow
3802
+
3803
+ **Kind**: instance method of [<code>Process</code>](#Process)
3804
+ **Returns**: <code>Promise.&lt;Array&gt;</code> - Array of step history entries
3805
+ **Access**: public
3806
+ **Author**: Myndware <augusto.pissarra@myndware.com>
3807
+
3808
+ | Param | Type | Description |
3809
+ | --- | --- | --- |
3810
+ | params | <code>object</code> | Params to get step history |
3811
+ | params.orgId | <code>string</code> | Organization id (_id database); |
3812
+ | params.processId | <code>string</code> | Process id (_id database); |
3813
+ | params.flowId | <code>string</code> | Flow id; |
3814
+ | session | <code>string</code> | Session, token JWT |
3815
+
3816
+ **Example**
3817
+ ```js
3818
+ const API = require('@docbrasil/api-systemmanager');
3819
+ const api = new API();
3820
+ const params = {
3821
+ orgId: '5edd11c46b6ce9729c2c297c',
3822
+ processId: '5dadd01dc4af3941d42f8c5c',
3823
+ flowId: 'Task_18v1xx7'
3824
+ }
3825
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3826
+ const stepHistory = await api.user.process.getStepHistory(params, session);
3827
+ ```
3797
3828
  <a name="Register"></a>
3798
3829
 
3799
3830
  ## Register
package/docs/Process.html CHANGED
@@ -2795,6 +2795,302 @@ await api.user.process.getProcessProperties(params, session);</code></pre>
2795
2795
 
2796
2796
 
2797
2797
 
2798
+ </div>
2799
+
2800
+ <div class="member">
2801
+
2802
+
2803
+
2804
+ <h4 class="name" id="getStepHistory">
2805
+ <a class="href-link" href="#getStepHistory">#</a>
2806
+
2807
+
2808
+ <span class='tag'>async</span>
2809
+
2810
+
2811
+ <span class="code-name">
2812
+
2813
+ getStepHistory<span class="signature">(params, session)</span><span class="type-signature"> &rarr; {Promise.&lt;Array>}</span>
2814
+
2815
+ </span>
2816
+ </h4>
2817
+
2818
+
2819
+
2820
+
2821
+ <div class="description">
2822
+ Get step history of a process flow
2823
+ </div>
2824
+
2825
+
2826
+
2827
+
2828
+
2829
+
2830
+
2831
+
2832
+
2833
+
2834
+ <h5>Parameters:</h5>
2835
+
2836
+ <div class="table-container">
2837
+ <table class="params table">
2838
+ <thead>
2839
+ <tr>
2840
+
2841
+ <th>Name</th>
2842
+
2843
+
2844
+ <th>Type</th>
2845
+
2846
+
2847
+
2848
+
2849
+
2850
+ <th class="last">Description</th>
2851
+ </tr>
2852
+ </thead>
2853
+
2854
+ <tbody>
2855
+
2856
+
2857
+
2858
+ <tr class="deep-level-0">
2859
+
2860
+ <td class="name"><code>params</code></td>
2861
+
2862
+
2863
+ <td class="type">
2864
+
2865
+
2866
+ <code class="param-type">object</code>
2867
+
2868
+
2869
+
2870
+ </td>
2871
+
2872
+
2873
+
2874
+
2875
+
2876
+ <td class="description last">Params to get step history</td>
2877
+ </tr>
2878
+
2879
+
2880
+
2881
+
2882
+ <tr class="deep-level-1">
2883
+
2884
+ <td class="name"><code>orgId</code></td>
2885
+
2886
+
2887
+ <td class="type">
2888
+
2889
+
2890
+ <code class="param-type">string</code>
2891
+
2892
+
2893
+
2894
+ </td>
2895
+
2896
+
2897
+
2898
+
2899
+
2900
+ <td class="description last">Organization id (_id database);</td>
2901
+ </tr>
2902
+
2903
+
2904
+
2905
+ <tr class="deep-level-1">
2906
+
2907
+ <td class="name"><code>processId</code></td>
2908
+
2909
+
2910
+ <td class="type">
2911
+
2912
+
2913
+ <code class="param-type">string</code>
2914
+
2915
+
2916
+
2917
+ </td>
2918
+
2919
+
2920
+
2921
+
2922
+
2923
+ <td class="description last">Process id (_id database);</td>
2924
+ </tr>
2925
+
2926
+
2927
+
2928
+ <tr class="deep-level-1">
2929
+
2930
+ <td class="name"><code>flowId</code></td>
2931
+
2932
+
2933
+ <td class="type">
2934
+
2935
+
2936
+ <code class="param-type">string</code>
2937
+
2938
+
2939
+
2940
+ </td>
2941
+
2942
+
2943
+
2944
+
2945
+
2946
+ <td class="description last">Flow id;</td>
2947
+ </tr>
2948
+
2949
+
2950
+
2951
+
2952
+
2953
+
2954
+
2955
+ <tr class="deep-level-0">
2956
+
2957
+ <td class="name"><code>session</code></td>
2958
+
2959
+
2960
+ <td class="type">
2961
+
2962
+
2963
+ <code class="param-type">string</code>
2964
+
2965
+
2966
+
2967
+ </td>
2968
+
2969
+
2970
+
2971
+
2972
+
2973
+ <td class="description last">Session, token JWT</td>
2974
+ </tr>
2975
+
2976
+
2977
+
2978
+ </tbody>
2979
+ </table>
2980
+ </div>
2981
+
2982
+
2983
+
2984
+
2985
+
2986
+ <dl class="details">
2987
+
2988
+
2989
+
2990
+
2991
+
2992
+
2993
+
2994
+
2995
+
2996
+
2997
+
2998
+
2999
+
3000
+
3001
+
3002
+
3003
+
3004
+
3005
+ <dt class="tag-author">Author:</dt>
3006
+ <dd class="tag-author">
3007
+ <ul>
3008
+ <li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
3009
+ </ul>
3010
+ </dd>
3011
+
3012
+
3013
+
3014
+
3015
+
3016
+
3017
+
3018
+
3019
+
3020
+
3021
+
3022
+
3023
+
3024
+
3025
+ <p class="tag-source">
3026
+ <a href="user_process.js.html" class="button">View Source</a>
3027
+ <span>
3028
+ <a href="user_process.js.html">user/process.js</a>, <a href="user_process.js.html#line580">line 580</a>
3029
+ </span>
3030
+ </p>
3031
+
3032
+ </dl>
3033
+
3034
+
3035
+
3036
+
3037
+
3038
+
3039
+
3040
+
3041
+
3042
+
3043
+
3044
+
3045
+
3046
+
3047
+
3048
+
3049
+
3050
+
3051
+ <div class='columns method-parameter'>
3052
+ <div class="column is-2"><label>Returns:</label></div>
3053
+ <div class="column is-10">
3054
+
3055
+
3056
+
3057
+ <div class="columns">
3058
+
3059
+ <div class='param-desc column is-7'>Array of step history entries</div>
3060
+
3061
+
3062
+ <div class='column is-5 has-text-left'>
3063
+ <label>Type: </label>
3064
+
3065
+ <code class="param-type">Promise.&lt;Array></code>
3066
+
3067
+
3068
+ </div>
3069
+
3070
+ </div>
3071
+
3072
+
3073
+ </div>
3074
+ </div>
3075
+
3076
+
3077
+
3078
+
3079
+ <h5>Example</h5>
3080
+
3081
+
3082
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
3083
+ const api = new API();
3084
+ const params = {
3085
+ orgId: '5edd11c46b6ce9729c2c297c',
3086
+ processId: '5dadd01dc4af3941d42f8c5c',
3087
+ flowId: 'Task_18v1xx7'
3088
+ }
3089
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3090
+ const stepHistory = await api.user.process.getStepHistory(params, session);</code></pre>
3091
+
3092
+
3093
+
2798
3094
  </div>
2799
3095
 
2800
3096
  <div class="member">
@@ -640,6 +640,47 @@ class Process {
640
640
  throw ex;
641
641
  }
642
642
  }
643
+
644
+ /**
645
+ * @author Myndware &lt;augusto.pissarra@myndware.com>
646
+ * @description Get step history of a process flow
647
+ * @param {object} params Params to get step history
648
+ * @param {string} params.orgId Organization id (_id database);
649
+ * @param {string} params.processId Process id (_id database);
650
+ * @param {string} params.flowId Flow id;
651
+ * @param {string} session Session, token JWT
652
+ * @return {Promise&lt;Array>} Array of step history entries
653
+ * @public
654
+ * @async
655
+ * @example
656
+ *
657
+ * const API = require('@docbrasil/api-systemmanager');
658
+ * const api = new API();
659
+ * const params = {
660
+ * orgId: '5edd11c46b6ce9729c2c297c',
661
+ * processId: '5dadd01dc4af3941d42f8c5c',
662
+ * flowId: 'Task_18v1xx7'
663
+ * }
664
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
665
+ * const stepHistory = await api.user.process.getStepHistory(params, session);
666
+ */
667
+ async getStepHistory(params, session) {
668
+ const self = this;
669
+
670
+ try {
671
+ Joi.assert(params, Joi.object().required());
672
+ Joi.assert(params.orgId, Joi.string().required());
673
+ Joi.assert(params.processId, Joi.string().required());
674
+ Joi.assert(params.flowId, Joi.string().required());
675
+ Joi.assert(session, Joi.string().required());
676
+
677
+ const {orgId, processId, flowId} = params;
678
+ const apiCall = self._client.get(`/organizations/${orgId}/process/${processId}/flow/${flowId}/history`, self._setHeader(session));
679
+ return self._returnData(await apiCall, []);
680
+ } catch (ex) {
681
+ throw ex;
682
+ }
683
+ }
643
684
  }
644
685
 
645
686
  export default Process;
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.68",
4
+ "version": "1.1.69",
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",