@docbrasil/api-systemmanager 1.2.2 → 1.2.4

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
@@ -4308,6 +4308,7 @@ Class for process, permission user
4308
4308
  * [.restart(params, session)](#Process+restart) ⇒ <code>Promise.&lt;object&gt;</code>
4309
4309
  * [.reexecute(params, session)](#Process+reexecute) ⇒ <code>Promise.&lt;object&gt;</code>
4310
4310
  * [.reexecuteTask(params, session)](#Process+reexecuteTask) ⇒ <code>Promise.&lt;object&gt;</code>
4311
+ * [.end(params, session)](#Process+end) ⇒ <code>Promise.&lt;object&gt;</code>
4311
4312
 
4312
4313
  <a name="Process+start"></a>
4313
4314
 
@@ -4739,6 +4740,22 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
4739
4740
  const result = await api.user.process.reexecuteTask(params, session);
4740
4741
  console.log(result.taskId);
4741
4742
  ```
4743
+ <a name="Process+end"></a>
4744
+
4745
+ ### process.end(params, session) ⇒ <code>Promise.&lt;object&gt;</code>
4746
+ End a running process task from a specific flow step.
4747
+
4748
+ **Kind**: instance method of [<code>Process</code>](#Process)
4749
+ **Returns**: <code>Promise.&lt;object&gt;</code> - { response: 'OK' } on success
4750
+
4751
+ | Param | Type | Description |
4752
+ | --- | --- | --- |
4753
+ | params | <code>object</code> | Params to end the process task |
4754
+ | params.processId | <code>string</code> | Process id (_id database); |
4755
+ | params.orgId | <code>string</code> | Organization id (_id database); |
4756
+ | params.flowName | <code>string</code> | The flow name of the step to end; |
4757
+ | session | <code>string</code> | Session, token JWT |
4758
+
4742
4759
  <a name="Register"></a>
4743
4760
 
4744
4761
  ## Register
package/docs/Process.html CHANGED
@@ -538,6 +538,280 @@ const result = await api.user.process.downloadDocs(params, session);</code></pre
538
538
 
539
539
 
540
540
 
541
+ </div>
542
+
543
+ <div class="member">
544
+
545
+
546
+
547
+ <h4 class="name" id="end">
548
+ <a class="href-link" href="#end">#</a>
549
+
550
+
551
+ <span class='tag'>async</span>
552
+
553
+
554
+ <span class="code-name">
555
+
556
+ end<span class="signature">(params, session)</span><span class="type-signature"> &rarr; {Promise.&lt;object>}</span>
557
+
558
+ </span>
559
+ </h4>
560
+
561
+
562
+
563
+
564
+ <div class="description">
565
+ End a running process task from a specific flow step.
566
+ </div>
567
+
568
+
569
+
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+ <h5>Parameters:</h5>
578
+
579
+ <div class="table-container">
580
+ <table class="params table">
581
+ <thead>
582
+ <tr>
583
+
584
+ <th>Name</th>
585
+
586
+
587
+ <th>Type</th>
588
+
589
+
590
+
591
+
592
+
593
+ <th class="last">Description</th>
594
+ </tr>
595
+ </thead>
596
+
597
+ <tbody>
598
+
599
+
600
+
601
+ <tr class="deep-level-0">
602
+
603
+ <td class="name"><code>params</code></td>
604
+
605
+
606
+ <td class="type">
607
+
608
+
609
+ <code class="param-type">object</code>
610
+
611
+
612
+
613
+ </td>
614
+
615
+
616
+
617
+
618
+
619
+ <td class="description last">Params to end the process task</td>
620
+ </tr>
621
+
622
+
623
+
624
+
625
+ <tr class="deep-level-1">
626
+
627
+ <td class="name"><code>processId</code></td>
628
+
629
+
630
+ <td class="type">
631
+
632
+
633
+ <code class="param-type">string</code>
634
+
635
+
636
+
637
+ </td>
638
+
639
+
640
+
641
+
642
+
643
+ <td class="description last">Process id (_id database);</td>
644
+ </tr>
645
+
646
+
647
+
648
+ <tr class="deep-level-1">
649
+
650
+ <td class="name"><code>orgId</code></td>
651
+
652
+
653
+ <td class="type">
654
+
655
+
656
+ <code class="param-type">string</code>
657
+
658
+
659
+
660
+ </td>
661
+
662
+
663
+
664
+
665
+
666
+ <td class="description last">Organization id (_id database);</td>
667
+ </tr>
668
+
669
+
670
+
671
+ <tr class="deep-level-1">
672
+
673
+ <td class="name"><code>flowName</code></td>
674
+
675
+
676
+ <td class="type">
677
+
678
+
679
+ <code class="param-type">string</code>
680
+
681
+
682
+
683
+ </td>
684
+
685
+
686
+
687
+
688
+
689
+ <td class="description last">The flow name of the step to end;</td>
690
+ </tr>
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+ <tr class="deep-level-0">
699
+
700
+ <td class="name"><code>session</code></td>
701
+
702
+
703
+ <td class="type">
704
+
705
+
706
+ <code class="param-type">string</code>
707
+
708
+
709
+
710
+ </td>
711
+
712
+
713
+
714
+
715
+
716
+ <td class="description last">Session, token JWT</td>
717
+ </tr>
718
+
719
+
720
+
721
+ </tbody>
722
+ </table>
723
+ </div>
724
+
725
+
726
+
727
+
728
+
729
+ <dl class="details">
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+ <p class="tag-source">
762
+ <a href="user_process.js.html" class="button">View Source</a>
763
+ <span>
764
+ <a href="user_process.js.html">user/process.js</a>, <a href="user_process.js.html#line717">line 717</a>
765
+ </span>
766
+ </p>
767
+
768
+ </dl>
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+
782
+
783
+
784
+
785
+
786
+
787
+ <div class='columns method-parameter'>
788
+ <div class="column is-2"><label>Returns:</label></div>
789
+ <div class="column is-10">
790
+
791
+
792
+
793
+ <div class="columns">
794
+
795
+ <div class='param-desc column is-7'>{ response: 'OK' } on success</div>
796
+
797
+
798
+ <div class='column is-5 has-text-left'>
799
+ <label>Type: </label>
800
+
801
+ <code class="param-type">Promise.&lt;object></code>
802
+
803
+
804
+ </div>
805
+
806
+ </div>
807
+
808
+
809
+ </div>
810
+ </div>
811
+
812
+
813
+
814
+
541
815
  </div>
542
816
 
543
817
  <div class="member">
@@ -792,6 +792,33 @@ class Process {
792
792
  }
793
793
  }
794
794
 
795
+ /**
796
+ * @description End a running process task from a specific flow step.
797
+ * @param {object} params Params to end the process task
798
+ * @param {string} params.processId Process id (_id database);
799
+ * @param {string} params.orgId Organization id (_id database);
800
+ * @param {string} params.flowName The flow name of the step to end;
801
+ * @param {string} session Session, token JWT
802
+ * @return {Promise&lt;object>} { response: 'OK' } on success
803
+ */
804
+ async end(params, session) {
805
+ const self = this;
806
+
807
+ try {
808
+ Joi.assert(params, Joi.object().required(), 'Params to end the process task');
809
+ Joi.assert(params.processId, Joi.string().required(), 'Process id (_id database)');
810
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
811
+ Joi.assert(params.flowName, Joi.string().required(), 'Flow name of the step');
812
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
813
+
814
+ const {processId, orgId, flowName} = params;
815
+ const apiCall = self._client.post(`/organizations/${orgId}/process/${processId}/task/${flowName}/end`, {}, self._setHeader(session));
816
+ return self._returnData(await apiCall);
817
+ } catch (ex) {
818
+ throw ex;
819
+ }
820
+ }
821
+
795
822
  async getStepHistory(params, session) {
796
823
  const self = this;
797
824
 
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.2.2",
4
+ "version": "1.2.4",
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",