roboto-js 1.1.11 → 1.1.12

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.
@@ -656,7 +656,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
656
656
  onProgress = callbacks.onProgress, onError = callbacks.onError, onFinish = callbacks.onFinish;
657
657
  _context13.prev = 3;
658
658
  _context13.next = 6;
659
- return this.post('http://localhost:3004/runChain', params);
659
+ return this.post('/task_service/runChain', params);
660
660
  case 6:
661
661
  response = _context13.sent;
662
662
  if (response) {
@@ -725,7 +725,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
725
725
  * @param {function} onProgress - Callback function that receives progress updates.
726
726
  *
727
727
  * The function periodically sends GET requests to check the task's progress
728
- * and reports back via the provided callback function. The polling stops when
728
+ * and reports back via the provided callback function . The polling stops when
729
729
  * the task is completed or an error occurs.
730
730
  */
731
731
  )
@@ -747,7 +747,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
747
747
  while (1) switch (_context14.prev = _context14.next) {
748
748
  case 0:
749
749
  _context14.next = 2;
750
- return _this2.get("http://localhost:3004/pollChainProgress", {
750
+ return _this2.get("/task_service/pollChainProgress", {
751
751
  jobId: jobId
752
752
  });
753
753
  case 2:
@@ -931,6 +931,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
931
931
  if (res) return;
932
932
  }
933
933
  if (_lodash["default"].isObject(err) && _lodash["default"].get(err, 'response')) {
934
+ console.log('RbtAPI handleError', err);
934
935
  var msg = _lodash["default"].get(err, 'response.data.message', 'Error in API response');
935
936
  if (msg.key) {
936
937
  throw new Error(msg.key);
@@ -342,7 +342,7 @@ export default class RbtApi {
342
342
  onFinish
343
343
  } = callbacks;
344
344
  try {
345
- const response = await this.post('http://localhost:3004/runChain', params);
345
+ const response = await this.post('/task_service/runChain', params);
346
346
  // Check if response and response.data are defined
347
347
  if (!response) {
348
348
  throw new Error('Invalid server response');
@@ -402,7 +402,7 @@ export default class RbtApi {
402
402
  * @param {function} onProgress - Callback function that receives progress updates.
403
403
  *
404
404
  * The function periodically sends GET requests to check the task's progress
405
- * and reports back via the provided callback function. The polling stops when
405
+ * and reports back via the provided callback function . The polling stops when
406
406
  * the task is completed or an error occurs.
407
407
  */
408
408
  async pollTaskProgress(jobId, callbacks) {
@@ -413,7 +413,7 @@ export default class RbtApi {
413
413
  } = callbacks;
414
414
  try {
415
415
  const checkProgress = async () => {
416
- const response = await this.get(`http://localhost:3004/pollChainProgress`, {
416
+ const response = await this.get(`/task_service/pollChainProgress`, {
417
417
  jobId: jobId
418
418
  });
419
419
 
@@ -529,6 +529,7 @@ export default class RbtApi {
529
529
  if (res) return;
530
530
  }
531
531
  if (_.isObject(err) && _.get(err, 'response')) {
532
+ console.log('RbtAPI handleError', err);
532
533
  const msg = _.get(err, 'response.data.message', 'Error in API response');
533
534
  if (msg.key) {
534
535
  throw new Error(msg.key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
@@ -9,6 +9,7 @@
9
9
  "require": "./dist/cjs/index.cjs"
10
10
  },
11
11
  "scripts": {
12
+ "clean": "rm -rf node_modules; rm package-lock.json; npm install",
12
13
  "build": "npm run build:cjs && npm run build:esm",
13
14
  "build:cjs": "babel src --out-dir dist/cjs --presets=@babel/preset-env --extensions \".js,.jsx\" --out-file-extension .cjs && npm run postbuild:cjs",
14
15
  "build:esm": "babel src --out-dir dist/esm",
package/src/rbt_api.js CHANGED
@@ -25,7 +25,6 @@ export default class RbtApi {
25
25
  this.authtoken = authTokenToUse;
26
26
  this.appServiceHost = null;
27
27
 
28
-
29
28
  }
30
29
 
31
30
  async initLocalDb(){
@@ -369,7 +368,7 @@ export default class RbtApi {
369
368
  const { onProgress, onError, onFinish } = callbacks;
370
369
 
371
370
  try {
372
- const response = await this.post('http://localhost:3004/runChain', params);
371
+ const response = await this.post('/task_service/runChain', params);
373
372
  // Check if response and response.data are defined
374
373
  if (!response) {
375
374
  throw new Error('Invalid server response');
@@ -417,14 +416,14 @@ export default class RbtApi {
417
416
  * @param {function} onProgress - Callback function that receives progress updates.
418
417
  *
419
418
  * The function periodically sends GET requests to check the task's progress
420
- * and reports back via the provided callback function. The polling stops when
419
+ * and reports back via the provided callback function . The polling stops when
421
420
  * the task is completed or an error occurs.
422
421
  */
423
422
  async pollTaskProgress(jobId, callbacks) {
424
423
  const { onProgress, onError, onFinish } = callbacks;
425
424
  try {
426
425
  const checkProgress = async () => {
427
- const response = await this.get(`http://localhost:3004/pollChainProgress`, { jobId: jobId });
426
+ const response = await this.get(`/task_service/pollChainProgress`, { jobId: jobId });
428
427
 
429
428
  // If the task is still in progress, start polling for updates
430
429
  if (response.status === 'DONE' && onFinish){
@@ -543,6 +542,9 @@ export default class RbtApi {
543
542
  }
544
543
 
545
544
  if (_.isObject(err) && _.get(err, 'response')) {
545
+
546
+ console.log('RbtAPI handleError', err);
547
+
546
548
  const msg = _.get(err, 'response.data.message', 'Error in API response');
547
549
 
548
550
  if(msg.key){