roboto-js 1.4.5 → 1.4.7
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/index.cjs +131 -112
- package/dist/cjs/rbt_api.cjs +292 -244
- package/dist/esm/index.js +3 -0
- package/dist/esm/rbt_api.js +21 -1
- package/package.json +1 -1
- package/src/index.js +3 -0
- package/src/rbt_api.js +30 -1
package/dist/cjs/rbt_api.cjs
CHANGED
|
@@ -176,7 +176,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
176
176
|
_context3.next = 14;
|
|
177
177
|
return this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
|
|
178
178
|
case 14:
|
|
179
|
-
return _context3.abrupt("return",
|
|
179
|
+
return _context3.abrupt("return", response.data);
|
|
180
180
|
case 17:
|
|
181
181
|
_context3.prev = 17;
|
|
182
182
|
_context3.t0 = _context3["catch"](0);
|
|
@@ -193,23 +193,71 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
193
193
|
return login;
|
|
194
194
|
}())
|
|
195
195
|
}, {
|
|
196
|
-
key: "
|
|
196
|
+
key: "loginWithOauth",
|
|
197
197
|
value: function () {
|
|
198
|
-
var
|
|
198
|
+
var _loginWithOauth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(userData) {
|
|
199
199
|
var response;
|
|
200
200
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
201
201
|
while (1) switch (_context4.prev = _context4.next) {
|
|
202
202
|
case 0:
|
|
203
203
|
_context4.prev = 0;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
debugger;
|
|
205
|
+
_context4.next = 4;
|
|
206
|
+
return this.post('/registerOrSigninOauth', userData);
|
|
207
|
+
case 4:
|
|
207
208
|
response = _context4.sent;
|
|
208
209
|
if (!(response.data.ok === false)) {
|
|
209
|
-
_context4.next =
|
|
210
|
+
_context4.next = 7;
|
|
210
211
|
break;
|
|
211
212
|
}
|
|
212
213
|
return _context4.abrupt("return", this._handleError(response));
|
|
214
|
+
case 7:
|
|
215
|
+
this.iac_session = response.data;
|
|
216
|
+
this.currentUser = this.iac_session ? new _rbt_user["default"](this.iac_session.user, this.axios) : null;
|
|
217
|
+
// update axios instance headers with authtoken
|
|
218
|
+
this.axios.defaults.headers.common['authtoken'] = response.data.authToken;
|
|
219
|
+
this.authtoken = response.data.authToken;
|
|
220
|
+
if (!this.localStorageAdaptor) {
|
|
221
|
+
_context4.next = 14;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
_context4.next = 14;
|
|
225
|
+
return this.localStorageAdaptor.setItem('authtoken', response.data.authToken);
|
|
226
|
+
case 14:
|
|
227
|
+
return _context4.abrupt("return", response.data);
|
|
228
|
+
case 17:
|
|
229
|
+
_context4.prev = 17;
|
|
230
|
+
_context4.t0 = _context4["catch"](0);
|
|
231
|
+
this._handleError(_context4.t0);
|
|
232
|
+
case 20:
|
|
233
|
+
case "end":
|
|
234
|
+
return _context4.stop();
|
|
235
|
+
}
|
|
236
|
+
}, _callee4, this, [[0, 17]]);
|
|
237
|
+
}));
|
|
238
|
+
function loginWithOauth(_x3) {
|
|
239
|
+
return _loginWithOauth.apply(this, arguments);
|
|
240
|
+
}
|
|
241
|
+
return loginWithOauth;
|
|
242
|
+
}()
|
|
243
|
+
}, {
|
|
244
|
+
key: "logout",
|
|
245
|
+
value: function () {
|
|
246
|
+
var _logout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
247
|
+
var response;
|
|
248
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
249
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
250
|
+
case 0:
|
|
251
|
+
_context5.prev = 0;
|
|
252
|
+
_context5.next = 3;
|
|
253
|
+
return this.axios.post('/user_service/logoutUser');
|
|
254
|
+
case 3:
|
|
255
|
+
response = _context5.sent;
|
|
256
|
+
if (!(response.data.ok === false)) {
|
|
257
|
+
_context5.next = 6;
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
return _context5.abrupt("return", this._handleError(response));
|
|
213
261
|
case 6:
|
|
214
262
|
// Clear the iac_session and remove the auth token from axios headers
|
|
215
263
|
this.iac_session = null;
|
|
@@ -221,22 +269,22 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
221
269
|
|
|
222
270
|
// Clear localStorage if it's being used
|
|
223
271
|
if (!this.localStorageAdaptor) {
|
|
224
|
-
|
|
272
|
+
_context5.next = 13;
|
|
225
273
|
break;
|
|
226
274
|
}
|
|
227
|
-
|
|
275
|
+
_context5.next = 13;
|
|
228
276
|
return this.localStorageAdaptor.removeItem('authtoken');
|
|
229
277
|
case 13:
|
|
230
|
-
return
|
|
278
|
+
return _context5.abrupt("return", response.data);
|
|
231
279
|
case 16:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
this._handleError(
|
|
280
|
+
_context5.prev = 16;
|
|
281
|
+
_context5.t0 = _context5["catch"](0);
|
|
282
|
+
this._handleError(_context5.t0);
|
|
235
283
|
case 19:
|
|
236
284
|
case "end":
|
|
237
|
-
return
|
|
285
|
+
return _context5.stop();
|
|
238
286
|
}
|
|
239
|
-
},
|
|
287
|
+
}, _callee5, this, [[0, 16]]);
|
|
240
288
|
}));
|
|
241
289
|
function logout() {
|
|
242
290
|
return _logout.apply(this, arguments);
|
|
@@ -253,43 +301,43 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
253
301
|
}, {
|
|
254
302
|
key: "loadCurrentUser",
|
|
255
303
|
value: function () {
|
|
256
|
-
var _loadCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
304
|
+
var _loadCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
257
305
|
var response;
|
|
258
|
-
return _regeneratorRuntime().wrap(function
|
|
259
|
-
while (1) switch (
|
|
306
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
307
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
260
308
|
case 0:
|
|
261
|
-
|
|
309
|
+
_context6.prev = 0;
|
|
262
310
|
if (!this.currentUser) {
|
|
263
|
-
|
|
311
|
+
_context6.next = 3;
|
|
264
312
|
break;
|
|
265
313
|
}
|
|
266
|
-
return
|
|
314
|
+
return _context6.abrupt("return", this.currentUser);
|
|
267
315
|
case 3:
|
|
268
316
|
if (!this.authtoken) {
|
|
269
|
-
|
|
317
|
+
_context6.next = 10;
|
|
270
318
|
break;
|
|
271
319
|
}
|
|
272
|
-
|
|
320
|
+
_context6.next = 6;
|
|
273
321
|
return this.refreshAuthToken(this.authtoken);
|
|
274
322
|
case 6:
|
|
275
|
-
response =
|
|
323
|
+
response = _context6.sent;
|
|
276
324
|
this.currentUser = new _rbt_user["default"]({
|
|
277
325
|
id: response.user.id
|
|
278
326
|
}, this.axios);
|
|
279
327
|
this.currentUser.setData(response.user);
|
|
280
|
-
return
|
|
328
|
+
return _context6.abrupt("return", this.currentUser);
|
|
281
329
|
case 10:
|
|
282
330
|
this.currentUser = null;
|
|
283
|
-
return
|
|
331
|
+
return _context6.abrupt("return", null);
|
|
284
332
|
case 14:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
return
|
|
333
|
+
_context6.prev = 14;
|
|
334
|
+
_context6.t0 = _context6["catch"](0);
|
|
335
|
+
return _context6.abrupt("return", this._handleError(_context6.t0));
|
|
288
336
|
case 17:
|
|
289
337
|
case "end":
|
|
290
|
-
return
|
|
338
|
+
return _context6.stop();
|
|
291
339
|
}
|
|
292
|
-
},
|
|
340
|
+
}, _callee6, this, [[0, 14]]);
|
|
293
341
|
}));
|
|
294
342
|
function loadCurrentUser() {
|
|
295
343
|
return _loadCurrentUser.apply(this, arguments);
|
|
@@ -299,37 +347,37 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
299
347
|
}, {
|
|
300
348
|
key: "confirmUserEmail",
|
|
301
349
|
value: function () {
|
|
302
|
-
var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
350
|
+
var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(confirmCode) {
|
|
303
351
|
var params, response;
|
|
304
|
-
return _regeneratorRuntime().wrap(function
|
|
305
|
-
while (1) switch (
|
|
352
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
353
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
306
354
|
case 0:
|
|
307
355
|
params = {
|
|
308
356
|
emailConfirmCode: confirmCode
|
|
309
357
|
};
|
|
310
|
-
|
|
311
|
-
|
|
358
|
+
_context7.prev = 1;
|
|
359
|
+
_context7.next = 4;
|
|
312
360
|
return this.axios.post('/user_service/confirmUserEmail', [params]);
|
|
313
361
|
case 4:
|
|
314
|
-
response =
|
|
362
|
+
response = _context7.sent;
|
|
315
363
|
if (!(response.data.ok === false)) {
|
|
316
|
-
|
|
364
|
+
_context7.next = 7;
|
|
317
365
|
break;
|
|
318
366
|
}
|
|
319
|
-
return
|
|
367
|
+
return _context7.abrupt("return", this._handleError(response));
|
|
320
368
|
case 7:
|
|
321
|
-
return
|
|
369
|
+
return _context7.abrupt("return", response.data);
|
|
322
370
|
case 10:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
return
|
|
371
|
+
_context7.prev = 10;
|
|
372
|
+
_context7.t0 = _context7["catch"](1);
|
|
373
|
+
return _context7.abrupt("return", this._handleError(_context7.t0));
|
|
326
374
|
case 13:
|
|
327
375
|
case "end":
|
|
328
|
-
return
|
|
376
|
+
return _context7.stop();
|
|
329
377
|
}
|
|
330
|
-
},
|
|
378
|
+
}, _callee7, this, [[1, 10]]);
|
|
331
379
|
}));
|
|
332
|
-
function confirmUserEmail(
|
|
380
|
+
function confirmUserEmail(_x4) {
|
|
333
381
|
return _confirmUserEmail.apply(this, arguments);
|
|
334
382
|
}
|
|
335
383
|
return confirmUserEmail;
|
|
@@ -337,21 +385,21 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
337
385
|
}, {
|
|
338
386
|
key: "loadCurrentUserExtended",
|
|
339
387
|
value: function () {
|
|
340
|
-
var _loadCurrentUserExtended = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
388
|
+
var _loadCurrentUserExtended = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
341
389
|
var currentUser;
|
|
342
|
-
return _regeneratorRuntime().wrap(function
|
|
343
|
-
while (1) switch (
|
|
390
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
391
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
344
392
|
case 0:
|
|
345
|
-
|
|
393
|
+
_context8.next = 2;
|
|
346
394
|
return this.loadCurrentUser();
|
|
347
395
|
case 2:
|
|
348
|
-
currentUser =
|
|
349
|
-
return
|
|
396
|
+
currentUser = _context8.sent;
|
|
397
|
+
return _context8.abrupt("return", this.loadUser(currentUser.id));
|
|
350
398
|
case 4:
|
|
351
399
|
case "end":
|
|
352
|
-
return
|
|
400
|
+
return _context8.stop();
|
|
353
401
|
}
|
|
354
|
-
},
|
|
402
|
+
}, _callee8, this);
|
|
355
403
|
}));
|
|
356
404
|
function loadCurrentUserExtended() {
|
|
357
405
|
return _loadCurrentUserExtended.apply(this, arguments);
|
|
@@ -361,36 +409,36 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
361
409
|
}, {
|
|
362
410
|
key: "loadUser",
|
|
363
411
|
value: function () {
|
|
364
|
-
var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
412
|
+
var _loadUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(userId) {
|
|
365
413
|
var params, _response$data, response, userData, User;
|
|
366
|
-
return _regeneratorRuntime().wrap(function
|
|
367
|
-
while (1) switch (
|
|
414
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
415
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
368
416
|
case 0:
|
|
369
417
|
params = {
|
|
370
418
|
id: userId
|
|
371
419
|
};
|
|
372
|
-
|
|
373
|
-
|
|
420
|
+
_context9.prev = 1;
|
|
421
|
+
_context9.next = 4;
|
|
374
422
|
return this.axios.post('/user_service/loadUser', [params]);
|
|
375
423
|
case 4:
|
|
376
|
-
response =
|
|
424
|
+
response = _context9.sent;
|
|
377
425
|
userData = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.user;
|
|
378
426
|
User = new _rbt_user["default"]({
|
|
379
427
|
id: userData.id
|
|
380
428
|
}, this.axios);
|
|
381
429
|
User.setData(userData);
|
|
382
|
-
return
|
|
430
|
+
return _context9.abrupt("return", User);
|
|
383
431
|
case 11:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
return
|
|
432
|
+
_context9.prev = 11;
|
|
433
|
+
_context9.t0 = _context9["catch"](1);
|
|
434
|
+
return _context9.abrupt("return", this._handleError(_context9.t0));
|
|
387
435
|
case 14:
|
|
388
436
|
case "end":
|
|
389
|
-
return
|
|
437
|
+
return _context9.stop();
|
|
390
438
|
}
|
|
391
|
-
},
|
|
439
|
+
}, _callee9, this, [[1, 11]]);
|
|
392
440
|
}));
|
|
393
|
-
function loadUser(
|
|
441
|
+
function loadUser(_x5) {
|
|
394
442
|
return _loadUser.apply(this, arguments);
|
|
395
443
|
}
|
|
396
444
|
return loadUser;
|
|
@@ -398,29 +446,29 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
398
446
|
}, {
|
|
399
447
|
key: "refreshAuthToken",
|
|
400
448
|
value: function () {
|
|
401
|
-
var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
449
|
+
var _refreshAuthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(authtoken) {
|
|
402
450
|
var response;
|
|
403
|
-
return _regeneratorRuntime().wrap(function
|
|
404
|
-
while (1) switch (
|
|
451
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
452
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
405
453
|
case 0:
|
|
406
|
-
|
|
407
|
-
|
|
454
|
+
_context10.prev = 0;
|
|
455
|
+
_context10.next = 3;
|
|
408
456
|
return this.axios.post('/user_service/refreshAuthToken', [authtoken]);
|
|
409
457
|
case 3:
|
|
410
|
-
response =
|
|
458
|
+
response = _context10.sent;
|
|
411
459
|
debugger;
|
|
412
|
-
return
|
|
460
|
+
return _context10.abrupt("return", response.data);
|
|
413
461
|
case 8:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
this._handleError(
|
|
462
|
+
_context10.prev = 8;
|
|
463
|
+
_context10.t0 = _context10["catch"](0);
|
|
464
|
+
this._handleError(_context10.t0);
|
|
417
465
|
case 11:
|
|
418
466
|
case "end":
|
|
419
|
-
return
|
|
467
|
+
return _context10.stop();
|
|
420
468
|
}
|
|
421
|
-
},
|
|
469
|
+
}, _callee10, this, [[0, 8]]);
|
|
422
470
|
}));
|
|
423
|
-
function refreshAuthToken(
|
|
471
|
+
function refreshAuthToken(_x6) {
|
|
424
472
|
return _refreshAuthToken.apply(this, arguments);
|
|
425
473
|
}
|
|
426
474
|
return refreshAuthToken;
|
|
@@ -435,32 +483,32 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
435
483
|
}, {
|
|
436
484
|
key: "registerUser",
|
|
437
485
|
value: (function () {
|
|
438
|
-
var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
486
|
+
var _registerUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
439
487
|
var dataHash,
|
|
440
488
|
response,
|
|
441
489
|
record,
|
|
442
|
-
|
|
443
|
-
return _regeneratorRuntime().wrap(function
|
|
444
|
-
while (1) switch (
|
|
490
|
+
_args11 = arguments;
|
|
491
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
492
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
445
493
|
case 0:
|
|
446
|
-
dataHash =
|
|
447
|
-
|
|
448
|
-
|
|
494
|
+
dataHash = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
|
|
495
|
+
_context11.prev = 1;
|
|
496
|
+
_context11.next = 4;
|
|
449
497
|
return this.axios.post('/user_service/registerUser', [dataHash]);
|
|
450
498
|
case 4:
|
|
451
|
-
response =
|
|
499
|
+
response = _context11.sent;
|
|
452
500
|
record = response.data;
|
|
453
|
-
return
|
|
501
|
+
return _context11.abrupt("return", new _rbt_user["default"](record, this.axios));
|
|
454
502
|
case 9:
|
|
455
|
-
|
|
456
|
-
|
|
503
|
+
_context11.prev = 9;
|
|
504
|
+
_context11.t0 = _context11["catch"](1);
|
|
457
505
|
debugger;
|
|
458
|
-
return
|
|
506
|
+
return _context11.abrupt("return", this._handleError(_context11.t0));
|
|
459
507
|
case 13:
|
|
460
508
|
case "end":
|
|
461
|
-
return
|
|
509
|
+
return _context11.stop();
|
|
462
510
|
}
|
|
463
|
-
},
|
|
511
|
+
}, _callee11, this, [[1, 9]]);
|
|
464
512
|
}));
|
|
465
513
|
function registerUser() {
|
|
466
514
|
return _registerUser.apply(this, arguments);
|
|
@@ -478,32 +526,32 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
478
526
|
}, {
|
|
479
527
|
key: "createFile",
|
|
480
528
|
value: (function () {
|
|
481
|
-
var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
529
|
+
var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(dataHash) {
|
|
482
530
|
var response, record;
|
|
483
|
-
return _regeneratorRuntime().wrap(function
|
|
484
|
-
while (1) switch (
|
|
531
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
532
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
485
533
|
case 0:
|
|
486
|
-
|
|
487
|
-
|
|
534
|
+
_context12.prev = 0;
|
|
535
|
+
_context12.next = 3;
|
|
488
536
|
return this.axios.post('/object_service/createObject', ['<@filekit.file>', dataHash]);
|
|
489
537
|
case 3:
|
|
490
|
-
response =
|
|
538
|
+
response = _context12.sent;
|
|
491
539
|
record = response.data;
|
|
492
540
|
if (dataHash) {
|
|
493
541
|
record.data = dataHash;
|
|
494
542
|
}
|
|
495
|
-
return
|
|
543
|
+
return _context12.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
|
|
496
544
|
case 9:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
return
|
|
545
|
+
_context12.prev = 9;
|
|
546
|
+
_context12.t0 = _context12["catch"](0);
|
|
547
|
+
return _context12.abrupt("return", this._handleError(_context12.t0));
|
|
500
548
|
case 12:
|
|
501
549
|
case "end":
|
|
502
|
-
return
|
|
550
|
+
return _context12.stop();
|
|
503
551
|
}
|
|
504
|
-
},
|
|
552
|
+
}, _callee12, this, [[0, 9]]);
|
|
505
553
|
}));
|
|
506
|
-
function createFile(
|
|
554
|
+
function createFile(_x7) {
|
|
507
555
|
return _createFile.apply(this, arguments);
|
|
508
556
|
}
|
|
509
557
|
return createFile;
|
|
@@ -511,35 +559,35 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
511
559
|
}, {
|
|
512
560
|
key: "loadFile",
|
|
513
561
|
value: function () {
|
|
514
|
-
var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
562
|
+
var _loadFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(id) {
|
|
515
563
|
var response, record;
|
|
516
|
-
return _regeneratorRuntime().wrap(function
|
|
517
|
-
while (1) switch (
|
|
564
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
565
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
518
566
|
case 0:
|
|
519
|
-
|
|
520
|
-
|
|
567
|
+
_context13.prev = 0;
|
|
568
|
+
_context13.next = 3;
|
|
521
569
|
return this.load('<@filekit.file>', id);
|
|
522
570
|
case 3:
|
|
523
|
-
response =
|
|
571
|
+
response = _context13.sent;
|
|
524
572
|
if (response) {
|
|
525
|
-
|
|
573
|
+
_context13.next = 6;
|
|
526
574
|
break;
|
|
527
575
|
}
|
|
528
|
-
return
|
|
576
|
+
return _context13.abrupt("return", null);
|
|
529
577
|
case 6:
|
|
530
578
|
record = response.toRecord();
|
|
531
|
-
return
|
|
579
|
+
return _context13.abrupt("return", new _rbt_file["default"](record, this.axios, this.localDb));
|
|
532
580
|
case 10:
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return
|
|
581
|
+
_context13.prev = 10;
|
|
582
|
+
_context13.t0 = _context13["catch"](0);
|
|
583
|
+
return _context13.abrupt("return", this._handleError(_context13.t0));
|
|
536
584
|
case 13:
|
|
537
585
|
case "end":
|
|
538
|
-
return
|
|
586
|
+
return _context13.stop();
|
|
539
587
|
}
|
|
540
|
-
},
|
|
588
|
+
}, _callee13, this, [[0, 10]]);
|
|
541
589
|
}));
|
|
542
|
-
function loadFile(
|
|
590
|
+
function loadFile(_x8) {
|
|
543
591
|
return _loadFile.apply(this, arguments);
|
|
544
592
|
}
|
|
545
593
|
return loadFile;
|
|
@@ -554,38 +602,38 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
554
602
|
}, {
|
|
555
603
|
key: "create",
|
|
556
604
|
value: (function () {
|
|
557
|
-
var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
605
|
+
var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(type) {
|
|
558
606
|
var dataHash,
|
|
559
607
|
response,
|
|
560
608
|
record,
|
|
561
|
-
|
|
562
|
-
return _regeneratorRuntime().wrap(function
|
|
563
|
-
while (1) switch (
|
|
609
|
+
_args14 = arguments;
|
|
610
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
611
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
564
612
|
case 0:
|
|
565
|
-
dataHash =
|
|
566
|
-
|
|
567
|
-
|
|
613
|
+
dataHash = _args14.length > 1 && _args14[1] !== undefined ? _args14[1] : {};
|
|
614
|
+
_context14.prev = 1;
|
|
615
|
+
_context14.next = 4;
|
|
568
616
|
return this.axios.post('/object_service/createObject', [type, dataHash]);
|
|
569
617
|
case 4:
|
|
570
|
-
response =
|
|
618
|
+
response = _context14.sent;
|
|
571
619
|
record = response.data;
|
|
572
620
|
if (dataHash) {
|
|
573
621
|
record.data = dataHash;
|
|
574
622
|
}
|
|
575
|
-
return
|
|
623
|
+
return _context14.abrupt("return", new _rbt_object["default"](record, this.axios, {
|
|
576
624
|
isNew: true
|
|
577
625
|
}));
|
|
578
626
|
case 10:
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
return
|
|
627
|
+
_context14.prev = 10;
|
|
628
|
+
_context14.t0 = _context14["catch"](1);
|
|
629
|
+
return _context14.abrupt("return", this._handleError(_context14.t0));
|
|
582
630
|
case 13:
|
|
583
631
|
case "end":
|
|
584
|
-
return
|
|
632
|
+
return _context14.stop();
|
|
585
633
|
}
|
|
586
|
-
},
|
|
634
|
+
}, _callee14, this, [[1, 10]]);
|
|
587
635
|
}));
|
|
588
|
-
function create(
|
|
636
|
+
function create(_x9) {
|
|
589
637
|
return _create.apply(this, arguments);
|
|
590
638
|
}
|
|
591
639
|
return create;
|
|
@@ -622,19 +670,19 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
622
670
|
}, {
|
|
623
671
|
key: "query",
|
|
624
672
|
value: (function () {
|
|
625
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
673
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(type) {
|
|
626
674
|
var _this = this;
|
|
627
675
|
var params,
|
|
628
676
|
defaultOrderBy,
|
|
629
677
|
defaultLimit,
|
|
630
678
|
mergedParams,
|
|
631
679
|
response,
|
|
632
|
-
|
|
633
|
-
return _regeneratorRuntime().wrap(function
|
|
634
|
-
while (1) switch (
|
|
680
|
+
_args15 = arguments;
|
|
681
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
682
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
635
683
|
case 0:
|
|
636
|
-
params =
|
|
637
|
-
|
|
684
|
+
params = _args15.length > 1 && _args15[1] !== undefined ? _args15[1] : {};
|
|
685
|
+
_context15.prev = 1;
|
|
638
686
|
params.type = type;
|
|
639
687
|
|
|
640
688
|
// Default ordering and pagination
|
|
@@ -651,15 +699,15 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
651
699
|
}
|
|
652
700
|
}; // Merge defaults with provided params
|
|
653
701
|
mergedParams = _objectSpread(_objectSpread(_objectSpread({}, defaultOrderBy), defaultLimit), params);
|
|
654
|
-
|
|
702
|
+
_context15.next = 8;
|
|
655
703
|
return this.axios.post('/object_service/queryObjects', [mergedParams]);
|
|
656
704
|
case 8:
|
|
657
|
-
response =
|
|
705
|
+
response = _context15.sent;
|
|
658
706
|
if (!(response.data.ok === false)) {
|
|
659
|
-
|
|
707
|
+
_context15.next = 11;
|
|
660
708
|
break;
|
|
661
709
|
}
|
|
662
|
-
return
|
|
710
|
+
return _context15.abrupt("return", this._handleError(response));
|
|
663
711
|
case 11:
|
|
664
712
|
// Process items into RbtObject instances
|
|
665
713
|
if (Array.isArray(response.data.items)) {
|
|
@@ -669,18 +717,18 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
669
717
|
});
|
|
670
718
|
});
|
|
671
719
|
}
|
|
672
|
-
return
|
|
720
|
+
return _context15.abrupt("return", response.data.items);
|
|
673
721
|
case 15:
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
return
|
|
722
|
+
_context15.prev = 15;
|
|
723
|
+
_context15.t0 = _context15["catch"](1);
|
|
724
|
+
return _context15.abrupt("return", this._handleError(_context15.t0));
|
|
677
725
|
case 18:
|
|
678
726
|
case "end":
|
|
679
|
-
return
|
|
727
|
+
return _context15.stop();
|
|
680
728
|
}
|
|
681
|
-
},
|
|
729
|
+
}, _callee15, this, [[1, 15]]);
|
|
682
730
|
}));
|
|
683
|
-
function query(
|
|
731
|
+
function query(_x10) {
|
|
684
732
|
return _query.apply(this, arguments);
|
|
685
733
|
}
|
|
686
734
|
return query;
|
|
@@ -697,47 +745,47 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
697
745
|
}, {
|
|
698
746
|
key: "load",
|
|
699
747
|
value: (function () {
|
|
700
|
-
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
748
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(type, ids) {
|
|
701
749
|
var params,
|
|
702
750
|
mergedParams,
|
|
703
751
|
res,
|
|
704
|
-
|
|
705
|
-
return _regeneratorRuntime().wrap(function
|
|
706
|
-
while (1) switch (
|
|
752
|
+
_args16 = arguments;
|
|
753
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
754
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
707
755
|
case 0:
|
|
708
|
-
params =
|
|
709
|
-
|
|
756
|
+
params = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
|
|
757
|
+
_context16.prev = 1;
|
|
710
758
|
if (!Array.isArray(ids)) {
|
|
711
|
-
|
|
759
|
+
_context16.next = 7;
|
|
712
760
|
break;
|
|
713
761
|
}
|
|
714
762
|
mergedParams = _objectSpread(_objectSpread({}, params), {}, {
|
|
715
763
|
where: "id IN (" + ids.join(',') + ")"
|
|
716
764
|
});
|
|
717
|
-
return
|
|
765
|
+
return _context16.abrupt("return", this.query(type, mergedParams));
|
|
718
766
|
case 7:
|
|
719
767
|
mergedParams = _objectSpread(_objectSpread({}, params), {}, {
|
|
720
768
|
where: "id=" + ids
|
|
721
769
|
});
|
|
722
|
-
|
|
770
|
+
_context16.next = 10;
|
|
723
771
|
return this.query(type, mergedParams);
|
|
724
772
|
case 10:
|
|
725
|
-
res =
|
|
726
|
-
return
|
|
773
|
+
res = _context16.sent;
|
|
774
|
+
return _context16.abrupt("return", res[0]);
|
|
727
775
|
case 12:
|
|
728
|
-
|
|
776
|
+
_context16.next = 17;
|
|
729
777
|
break;
|
|
730
778
|
case 14:
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
return
|
|
779
|
+
_context16.prev = 14;
|
|
780
|
+
_context16.t0 = _context16["catch"](1);
|
|
781
|
+
return _context16.abrupt("return", this._handleError(_context16.t0));
|
|
734
782
|
case 17:
|
|
735
783
|
case "end":
|
|
736
|
-
return
|
|
784
|
+
return _context16.stop();
|
|
737
785
|
}
|
|
738
|
-
},
|
|
786
|
+
}, _callee16, this, [[1, 14]]);
|
|
739
787
|
}));
|
|
740
|
-
function load(
|
|
788
|
+
function load(_x11, _x12) {
|
|
741
789
|
return _load.apply(this, arguments);
|
|
742
790
|
}
|
|
743
791
|
return load;
|
|
@@ -759,7 +807,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
759
807
|
}, {
|
|
760
808
|
key: "runTask",
|
|
761
809
|
value: (function () {
|
|
762
|
-
var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
810
|
+
var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
763
811
|
var params,
|
|
764
812
|
callbacks,
|
|
765
813
|
onProgress,
|
|
@@ -771,20 +819,20 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
771
819
|
status,
|
|
772
820
|
message,
|
|
773
821
|
output,
|
|
774
|
-
|
|
775
|
-
return _regeneratorRuntime().wrap(function
|
|
776
|
-
while (1) switch (
|
|
822
|
+
_args17 = arguments;
|
|
823
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
824
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
777
825
|
case 0:
|
|
778
|
-
params =
|
|
779
|
-
callbacks =
|
|
826
|
+
params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
|
|
827
|
+
callbacks = _args17.length > 1 && _args17[1] !== undefined ? _args17[1] : {};
|
|
780
828
|
onProgress = callbacks.onProgress, onError = callbacks.onError, onFinish = callbacks.onFinish;
|
|
781
|
-
|
|
782
|
-
|
|
829
|
+
_context17.prev = 3;
|
|
830
|
+
_context17.next = 6;
|
|
783
831
|
return this.post('/task_service/runChain', params);
|
|
784
832
|
case 6:
|
|
785
|
-
response =
|
|
833
|
+
response = _context17.sent;
|
|
786
834
|
if (response) {
|
|
787
|
-
|
|
835
|
+
_context17.next = 9;
|
|
788
836
|
break;
|
|
789
837
|
}
|
|
790
838
|
throw new Error('Invalid server response');
|
|
@@ -792,7 +840,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
792
840
|
// Validate response structure
|
|
793
841
|
ok = response.ok, jobId = response.jobId, status = response.status, message = response.message, output = response.output;
|
|
794
842
|
if (!(!ok || typeof jobId !== 'string' || typeof status !== 'string')) {
|
|
795
|
-
|
|
843
|
+
_context17.next = 12;
|
|
796
844
|
break;
|
|
797
845
|
}
|
|
798
846
|
throw new Error('Invalid response structure');
|
|
@@ -810,7 +858,7 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
810
858
|
console.log('Finish (request) ', response);
|
|
811
859
|
onFinish(response);
|
|
812
860
|
}
|
|
813
|
-
return
|
|
861
|
+
return _context17.abrupt("return", {
|
|
814
862
|
ok: ok,
|
|
815
863
|
jobId: jobId,
|
|
816
864
|
status: status,
|
|
@@ -818,24 +866,24 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
818
866
|
output: output
|
|
819
867
|
});
|
|
820
868
|
case 18:
|
|
821
|
-
|
|
822
|
-
|
|
869
|
+
_context17.prev = 18;
|
|
870
|
+
_context17.t0 = _context17["catch"](3);
|
|
823
871
|
if (typeof onError === 'function') {
|
|
824
|
-
onError(
|
|
872
|
+
onError(_context17.t0);
|
|
825
873
|
} else {
|
|
826
|
-
console.error('Error in runTask:',
|
|
874
|
+
console.error('Error in runTask:', _context17.t0);
|
|
827
875
|
}
|
|
828
|
-
return
|
|
876
|
+
return _context17.abrupt("return", {
|
|
829
877
|
ok: false,
|
|
830
878
|
jobId: null,
|
|
831
879
|
status: 'ERROR',
|
|
832
|
-
error:
|
|
880
|
+
error: _context17.t0.message
|
|
833
881
|
});
|
|
834
882
|
case 22:
|
|
835
883
|
case "end":
|
|
836
|
-
return
|
|
884
|
+
return _context17.stop();
|
|
837
885
|
}
|
|
838
|
-
},
|
|
886
|
+
}, _callee17, this, [[3, 18]]);
|
|
839
887
|
}));
|
|
840
888
|
function runTask() {
|
|
841
889
|
return _runTask.apply(this, arguments);
|
|
@@ -856,26 +904,26 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
856
904
|
}, {
|
|
857
905
|
key: "pollTaskProgress",
|
|
858
906
|
value: (function () {
|
|
859
|
-
var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
907
|
+
var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(jobId, callbacks) {
|
|
860
908
|
var _this2 = this;
|
|
861
909
|
var onProgress, onError, onFinish, checkProgress;
|
|
862
|
-
return _regeneratorRuntime().wrap(function
|
|
863
|
-
while (1) switch (
|
|
910
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
911
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
864
912
|
case 0:
|
|
865
913
|
onProgress = callbacks.onProgress, onError = callbacks.onError, onFinish = callbacks.onFinish;
|
|
866
|
-
|
|
914
|
+
_context19.prev = 1;
|
|
867
915
|
checkProgress = /*#__PURE__*/function () {
|
|
868
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
916
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
869
917
|
var response;
|
|
870
|
-
return _regeneratorRuntime().wrap(function
|
|
871
|
-
while (1) switch (
|
|
918
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
919
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
872
920
|
case 0:
|
|
873
|
-
|
|
921
|
+
_context18.next = 2;
|
|
874
922
|
return _this2.get("/task_service/pollChainProgress", {
|
|
875
923
|
jobId: jobId
|
|
876
924
|
});
|
|
877
925
|
case 2:
|
|
878
|
-
response =
|
|
926
|
+
response = _context18.sent;
|
|
879
927
|
// If the task is still in progress, start polling for updates
|
|
880
928
|
if (response.status === 'DONE' && onFinish) {
|
|
881
929
|
// Provide the current progress to the callback function
|
|
@@ -898,28 +946,28 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
898
946
|
}
|
|
899
947
|
case 7:
|
|
900
948
|
case "end":
|
|
901
|
-
return
|
|
949
|
+
return _context18.stop();
|
|
902
950
|
}
|
|
903
|
-
},
|
|
951
|
+
}, _callee18);
|
|
904
952
|
}));
|
|
905
953
|
return function checkProgress() {
|
|
906
954
|
return _ref2.apply(this, arguments);
|
|
907
955
|
};
|
|
908
956
|
}();
|
|
909
957
|
checkProgress();
|
|
910
|
-
|
|
958
|
+
_context19.next = 9;
|
|
911
959
|
break;
|
|
912
960
|
case 6:
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
return
|
|
961
|
+
_context19.prev = 6;
|
|
962
|
+
_context19.t0 = _context19["catch"](1);
|
|
963
|
+
return _context19.abrupt("return", this._handleError(_context19.t0));
|
|
916
964
|
case 9:
|
|
917
965
|
case "end":
|
|
918
|
-
return
|
|
966
|
+
return _context19.stop();
|
|
919
967
|
}
|
|
920
|
-
},
|
|
968
|
+
}, _callee19, this, [[1, 6]]);
|
|
921
969
|
}));
|
|
922
|
-
function pollTaskProgress(
|
|
970
|
+
function pollTaskProgress(_x13, _x14) {
|
|
923
971
|
return _pollTaskProgress.apply(this, arguments);
|
|
924
972
|
}
|
|
925
973
|
return pollTaskProgress;
|
|
@@ -939,46 +987,46 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
939
987
|
}, {
|
|
940
988
|
key: "get",
|
|
941
989
|
value: (function () {
|
|
942
|
-
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
990
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(endpoint) {
|
|
943
991
|
var params,
|
|
944
992
|
headers,
|
|
945
993
|
response,
|
|
946
|
-
|
|
947
|
-
return _regeneratorRuntime().wrap(function
|
|
948
|
-
while (1) switch (
|
|
994
|
+
_args20 = arguments;
|
|
995
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
996
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
949
997
|
case 0:
|
|
950
|
-
params =
|
|
998
|
+
params = _args20.length > 1 && _args20[1] !== undefined ? _args20[1] : {};
|
|
951
999
|
debugger;
|
|
952
|
-
|
|
1000
|
+
_context20.prev = 2;
|
|
953
1001
|
// Add the authToken to the headers
|
|
954
1002
|
headers = {
|
|
955
1003
|
authtoken: this.authtoken
|
|
956
1004
|
}; // Make the GET request using Axios
|
|
957
|
-
|
|
1005
|
+
_context20.next = 6;
|
|
958
1006
|
return this.axios.get(endpoint, {
|
|
959
1007
|
params: params,
|
|
960
1008
|
headers: headers
|
|
961
1009
|
});
|
|
962
1010
|
case 6:
|
|
963
|
-
response =
|
|
1011
|
+
response = _context20.sent;
|
|
964
1012
|
if (!(response.data.ok === false)) {
|
|
965
|
-
|
|
1013
|
+
_context20.next = 9;
|
|
966
1014
|
break;
|
|
967
1015
|
}
|
|
968
|
-
return
|
|
1016
|
+
return _context20.abrupt("return", this._handleError(response));
|
|
969
1017
|
case 9:
|
|
970
|
-
return
|
|
1018
|
+
return _context20.abrupt("return", response.data);
|
|
971
1019
|
case 12:
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
return
|
|
1020
|
+
_context20.prev = 12;
|
|
1021
|
+
_context20.t0 = _context20["catch"](2);
|
|
1022
|
+
return _context20.abrupt("return", this._handleError(_context20.t0));
|
|
975
1023
|
case 15:
|
|
976
1024
|
case "end":
|
|
977
|
-
return
|
|
1025
|
+
return _context20.stop();
|
|
978
1026
|
}
|
|
979
|
-
},
|
|
1027
|
+
}, _callee20, this, [[2, 12]]);
|
|
980
1028
|
}));
|
|
981
|
-
function get(
|
|
1029
|
+
function get(_x15) {
|
|
982
1030
|
return _get.apply(this, arguments);
|
|
983
1031
|
}
|
|
984
1032
|
return get;
|
|
@@ -999,44 +1047,44 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
999
1047
|
}, {
|
|
1000
1048
|
key: "post",
|
|
1001
1049
|
value: (function () {
|
|
1002
|
-
var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1050
|
+
var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(endpoint) {
|
|
1003
1051
|
var data,
|
|
1004
1052
|
headers,
|
|
1005
1053
|
response,
|
|
1006
|
-
|
|
1007
|
-
return _regeneratorRuntime().wrap(function
|
|
1008
|
-
while (1) switch (
|
|
1054
|
+
_args21 = arguments;
|
|
1055
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1056
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1009
1057
|
case 0:
|
|
1010
|
-
data =
|
|
1011
|
-
|
|
1058
|
+
data = _args21.length > 1 && _args21[1] !== undefined ? _args21[1] : {};
|
|
1059
|
+
_context21.prev = 1;
|
|
1012
1060
|
// Add the authToken to the headers
|
|
1013
1061
|
headers = {
|
|
1014
1062
|
authtoken: this.authtoken
|
|
1015
1063
|
}; // Make the POST request using Axios
|
|
1016
|
-
|
|
1064
|
+
_context21.next = 5;
|
|
1017
1065
|
return this.axios.post(endpoint, data, {
|
|
1018
1066
|
headers: headers
|
|
1019
1067
|
});
|
|
1020
1068
|
case 5:
|
|
1021
|
-
response =
|
|
1069
|
+
response = _context21.sent;
|
|
1022
1070
|
if (!(response.data.ok === false)) {
|
|
1023
|
-
|
|
1071
|
+
_context21.next = 8;
|
|
1024
1072
|
break;
|
|
1025
1073
|
}
|
|
1026
|
-
return
|
|
1074
|
+
return _context21.abrupt("return", this._handleError(response));
|
|
1027
1075
|
case 8:
|
|
1028
|
-
return
|
|
1076
|
+
return _context21.abrupt("return", response.data);
|
|
1029
1077
|
case 11:
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
return
|
|
1078
|
+
_context21.prev = 11;
|
|
1079
|
+
_context21.t0 = _context21["catch"](1);
|
|
1080
|
+
return _context21.abrupt("return", this._handleError(_context21.t0));
|
|
1033
1081
|
case 14:
|
|
1034
1082
|
case "end":
|
|
1035
|
-
return
|
|
1083
|
+
return _context21.stop();
|
|
1036
1084
|
}
|
|
1037
|
-
},
|
|
1085
|
+
}, _callee21, this, [[1, 11]]);
|
|
1038
1086
|
}));
|
|
1039
|
-
function post(
|
|
1087
|
+
function post(_x16) {
|
|
1040
1088
|
return _post.apply(this, arguments);
|
|
1041
1089
|
}
|
|
1042
1090
|
return post;
|