roboto-js 1.4.40 → 1.4.41

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.
@@ -975,6 +975,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
975
975
  onProgress,
976
976
  onError,
977
977
  onStopped,
978
+ onWaiting,
978
979
  onDone,
979
980
  response,
980
981
  ok,
@@ -988,7 +989,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
988
989
  case 0:
989
990
  params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
990
991
  callbacks = _args18.length > 1 && _args18[1] !== undefined ? _args18[1] : {};
991
- onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onDone = callbacks.onDone;
992
+ onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onWaiting = callbacks.onWaiting, onDone = callbacks.onDone;
992
993
  _context18.prev = 3;
993
994
  _context18.next = 6;
994
995
  return this.post('/task_service/runChain', params);
@@ -1020,6 +1021,10 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1020
1021
  // Provide the current progress to the callback function
1021
1022
  onStopped(response);
1022
1023
  }
1024
+ if (status === 'WAITING' && onWaiting) {
1025
+ // Provide the current progress to the callback function
1026
+ onWaiting(response);
1027
+ }
1023
1028
  if (status === 'DONE' && onDone) {
1024
1029
  // Provide the current progress to the callback function
1025
1030
  console.log('Finish (request) ', response);
@@ -1032,8 +1037,8 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1032
1037
  message: message,
1033
1038
  output: output
1034
1039
  });
1035
- case 19:
1036
- _context18.prev = 19;
1040
+ case 20:
1041
+ _context18.prev = 20;
1037
1042
  _context18.t0 = _context18["catch"](3);
1038
1043
  if (typeof onError === 'function') {
1039
1044
  onError(_context18.t0);
@@ -1046,11 +1051,11 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
1046
1051
  status: 'ERROR',
1047
1052
  error: _context18.t0.message
1048
1053
  });
1049
- case 23:
1054
+ case 24:
1050
1055
  case "end":
1051
1056
  return _context18.stop();
1052
1057
  }
1053
- }, _callee18, this, [[3, 19]]);
1058
+ }, _callee18, this, [[3, 20]]);
1054
1059
  }));
1055
1060
  function runTask() {
1056
1061
  return _runTask.apply(this, arguments);
@@ -552,6 +552,7 @@ export default class RbtApi {
552
552
  onProgress,
553
553
  onError,
554
554
  onStopped,
555
+ onWaiting,
555
556
  onDone
556
557
  } = callbacks;
557
558
  try {
@@ -585,6 +586,10 @@ export default class RbtApi {
585
586
  // Provide the current progress to the callback function
586
587
  onStopped(response);
587
588
  }
589
+ if (status === 'WAITING' && onWaiting) {
590
+ // Provide the current progress to the callback function
591
+ onWaiting(response);
592
+ }
588
593
  if (status === 'DONE' && onDone) {
589
594
  // Provide the current progress to the callback function
590
595
  console.log('Finish (request) ', response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.4.40",
3
+ "version": "1.4.41",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/rbt_api.js CHANGED
@@ -609,7 +609,7 @@ export default class RbtApi {
609
609
  * }
610
610
  */
611
611
  async runTask(params = {}, callbacks = {}) {
612
- const { onProgress, onError, onStopped, onDone } = callbacks;
612
+ const { onProgress, onError, onStopped, onWaiting, onDone } = callbacks;
613
613
 
614
614
  try {
615
615
  const response = await this.post('/task_service/runChain', params);
@@ -636,6 +636,10 @@ export default class RbtApi {
636
636
  // Provide the current progress to the callback function
637
637
  onStopped(response);
638
638
  }
639
+ if (status === 'WAITING' && onWaiting){
640
+ // Provide the current progress to the callback function
641
+ onWaiting(response);
642
+ }
639
643
  if (status === 'DONE' && onDone){
640
644
  // Provide the current progress to the callback function
641
645
  console.log('Finish (request) ',response);