roboto-js 1.4.42 → 1.4.43
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/dist/cjs/rbt_api.cjs +7 -3
- package/dist/esm/rbt_api.js +5 -0
- package/package.json +1 -1
- package/src/rbt_api.js +5 -1
package/dist/cjs/rbt_api.cjs
CHANGED
|
@@ -1117,11 +1117,11 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
1117
1117
|
value: (function () {
|
|
1118
1118
|
var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(jobId, callbacks) {
|
|
1119
1119
|
var _this3 = this;
|
|
1120
|
-
var onProgress, onError, onStopped, onDone, checkProgress;
|
|
1120
|
+
var onProgress, onError, onStopped, onWaiting, onDone, checkProgress;
|
|
1121
1121
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1122
1122
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1123
1123
|
case 0:
|
|
1124
|
-
onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onDone = callbacks.onDone;
|
|
1124
|
+
onProgress = callbacks.onProgress, onError = callbacks.onError, onStopped = callbacks.onStopped, onWaiting = callbacks.onWaiting, onDone = callbacks.onDone;
|
|
1125
1125
|
_context21.prev = 1;
|
|
1126
1126
|
checkProgress = /*#__PURE__*/function () {
|
|
1127
1127
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
@@ -1149,6 +1149,10 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
1149
1149
|
// Provide the current progress to the callback function
|
|
1150
1150
|
onStopped(response);
|
|
1151
1151
|
}
|
|
1152
|
+
if (response.status === 'WAITING' && onWaiting) {
|
|
1153
|
+
// Provide the current progress to the callback function
|
|
1154
|
+
onWaiting(response);
|
|
1155
|
+
}
|
|
1152
1156
|
|
|
1153
1157
|
// Provide the current progress to the callback function
|
|
1154
1158
|
if (response.status == 'RUNNING') {
|
|
@@ -1159,7 +1163,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
1159
1163
|
if (['RUNNING', 'STOPPING'].includes(response.status)) {
|
|
1160
1164
|
setTimeout(checkProgress, 2000); // Poll every 2 seconds
|
|
1161
1165
|
}
|
|
1162
|
-
case
|
|
1166
|
+
case 9:
|
|
1163
1167
|
case "end":
|
|
1164
1168
|
return _context20.stop();
|
|
1165
1169
|
}
|
package/dist/esm/rbt_api.js
CHANGED
|
@@ -644,6 +644,7 @@ export default class RbtApi {
|
|
|
644
644
|
onProgress,
|
|
645
645
|
onError,
|
|
646
646
|
onStopped,
|
|
647
|
+
onWaiting,
|
|
647
648
|
onDone
|
|
648
649
|
} = callbacks;
|
|
649
650
|
try {
|
|
@@ -666,6 +667,10 @@ export default class RbtApi {
|
|
|
666
667
|
// Provide the current progress to the callback function
|
|
667
668
|
onStopped(response);
|
|
668
669
|
}
|
|
670
|
+
if (response.status === 'WAITING' && onWaiting) {
|
|
671
|
+
// Provide the current progress to the callback function
|
|
672
|
+
onWaiting(response);
|
|
673
|
+
}
|
|
669
674
|
|
|
670
675
|
// Provide the current progress to the callback function
|
|
671
676
|
if (response.status == 'RUNNING') {
|
package/package.json
CHANGED
package/src/rbt_api.js
CHANGED
|
@@ -689,7 +689,7 @@ export default class RbtApi {
|
|
|
689
689
|
* the task is completed or an error occurs.
|
|
690
690
|
*/
|
|
691
691
|
async pollTaskProgress(jobId, callbacks) {
|
|
692
|
-
const { onProgress, onError, onStopped, onDone } = callbacks;
|
|
692
|
+
const { onProgress, onError, onStopped, onWaiting, onDone } = callbacks;
|
|
693
693
|
try {
|
|
694
694
|
const checkProgress = async () => {
|
|
695
695
|
const response = await this.get(`/task_service/pollChainProgress`, { jobId: jobId });
|
|
@@ -708,6 +708,10 @@ export default class RbtApi {
|
|
|
708
708
|
// Provide the current progress to the callback function
|
|
709
709
|
onStopped(response);
|
|
710
710
|
}
|
|
711
|
+
if (response.status === 'WAITING' && onWaiting){
|
|
712
|
+
// Provide the current progress to the callback function
|
|
713
|
+
onWaiting(response);
|
|
714
|
+
}
|
|
711
715
|
|
|
712
716
|
// Provide the current progress to the callback function
|
|
713
717
|
if(response.status == 'RUNNING'){
|