roboto-js 1.3.9 → 1.3.10

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.
@@ -217,19 +217,38 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
217
217
  return loadCurrentUser;
218
218
  }()
219
219
  }, {
220
- key: "confirmUserEmail",
220
+ key: "getCurrentUser",
221
221
  value: function () {
222
- var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
222
+ var _getCurrentUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
223
223
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
224
224
  while (1) switch (_context7.prev = _context7.next) {
225
225
  case 0:
226
- return _context7.abrupt("return", this.api.confirmUserEmail(params));
226
+ return _context7.abrupt("return", this.api.getCurrentUser());
227
227
  case 1:
228
228
  case "end":
229
229
  return _context7.stop();
230
230
  }
231
231
  }, _callee7, this);
232
232
  }));
233
+ function getCurrentUser() {
234
+ return _getCurrentUser.apply(this, arguments);
235
+ }
236
+ return getCurrentUser;
237
+ }()
238
+ }, {
239
+ key: "confirmUserEmail",
240
+ value: function () {
241
+ var _confirmUserEmail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(params) {
242
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
243
+ while (1) switch (_context8.prev = _context8.next) {
244
+ case 0:
245
+ return _context8.abrupt("return", this.api.confirmUserEmail(params));
246
+ case 1:
247
+ case "end":
248
+ return _context8.stop();
249
+ }
250
+ }, _callee8, this);
251
+ }));
233
252
  function confirmUserEmail(_x4) {
234
253
  return _confirmUserEmail.apply(this, arguments);
235
254
  }
@@ -240,19 +259,19 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
240
259
  }, {
241
260
  key: "createFile",
242
261
  value: function () {
243
- var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
262
+ var _createFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
244
263
  var data,
245
- _args8 = arguments;
246
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
247
- while (1) switch (_context8.prev = _context8.next) {
264
+ _args9 = arguments;
265
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
266
+ while (1) switch (_context9.prev = _context9.next) {
248
267
  case 0:
249
- data = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
250
- return _context8.abrupt("return", this.api.createFile(data));
268
+ data = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
269
+ return _context9.abrupt("return", this.api.createFile(data));
251
270
  case 2:
252
271
  case "end":
253
- return _context8.stop();
272
+ return _context9.stop();
254
273
  }
255
- }, _callee8, this);
274
+ }, _callee9, this);
256
275
  }));
257
276
  function createFile() {
258
277
  return _createFile.apply(this, arguments);
@@ -264,19 +283,19 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
264
283
  }, {
265
284
  key: "create",
266
285
  value: function () {
267
- var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
286
+ var _create = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(params) {
268
287
  var data,
269
- _args9 = arguments;
270
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
271
- while (1) switch (_context9.prev = _context9.next) {
288
+ _args10 = arguments;
289
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
290
+ while (1) switch (_context10.prev = _context10.next) {
272
291
  case 0:
273
- data = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {};
274
- return _context9.abrupt("return", this.api.create(params, data));
292
+ data = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
293
+ return _context10.abrupt("return", this.api.create(params, data));
275
294
  case 2:
276
295
  case "end":
277
- return _context9.stop();
296
+ return _context10.stop();
278
297
  }
279
- }, _callee9, this);
298
+ }, _callee10, this);
280
299
  }));
281
300
  function create(_x5) {
282
301
  return _create.apply(this, arguments);
@@ -286,16 +305,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
286
305
  }, {
287
306
  key: "load",
288
307
  value: function () {
289
- var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(type, ids, options) {
290
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
291
- while (1) switch (_context10.prev = _context10.next) {
308
+ var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type, ids, options) {
309
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
310
+ while (1) switch (_context11.prev = _context11.next) {
292
311
  case 0:
293
- return _context10.abrupt("return", this.api.load(type, ids, options));
312
+ return _context11.abrupt("return", this.api.load(type, ids, options));
294
313
  case 1:
295
314
  case "end":
296
- return _context10.stop();
315
+ return _context11.stop();
297
316
  }
298
- }, _callee10, this);
317
+ }, _callee11, this);
299
318
  }));
300
319
  function load(_x6, _x7, _x8) {
301
320
  return _load.apply(this, arguments);
@@ -305,16 +324,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
305
324
  }, {
306
325
  key: "query",
307
326
  value: function () {
308
- var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type, params) {
309
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
310
- while (1) switch (_context11.prev = _context11.next) {
327
+ var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(type, params) {
328
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
329
+ while (1) switch (_context12.prev = _context12.next) {
311
330
  case 0:
312
- return _context11.abrupt("return", this.api.query(type, params));
331
+ return _context12.abrupt("return", this.api.query(type, params));
313
332
  case 1:
314
333
  case "end":
315
- return _context11.stop();
334
+ return _context12.stop();
316
335
  }
317
- }, _callee11, this);
336
+ }, _callee12, this);
318
337
  }));
319
338
  function query(_x9, _x10) {
320
339
  return _query.apply(this, arguments);
@@ -326,16 +345,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
326
345
  }, {
327
346
  key: "runTask",
328
347
  value: function () {
329
- var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(params, callbacks) {
330
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
331
- while (1) switch (_context12.prev = _context12.next) {
348
+ var _runTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params, callbacks) {
349
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
350
+ while (1) switch (_context13.prev = _context13.next) {
332
351
  case 0:
333
- return _context12.abrupt("return", this.api.runTask(params, callbacks));
352
+ return _context13.abrupt("return", this.api.runTask(params, callbacks));
334
353
  case 1:
335
354
  case "end":
336
- return _context12.stop();
355
+ return _context13.stop();
337
356
  }
338
- }, _callee12, this);
357
+ }, _callee13, this);
339
358
  }));
340
359
  function runTask(_x11, _x12) {
341
360
  return _runTask.apply(this, arguments);
@@ -345,16 +364,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
345
364
  }, {
346
365
  key: "pollTaskProgress",
347
366
  value: function () {
348
- var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params) {
349
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
350
- while (1) switch (_context13.prev = _context13.next) {
367
+ var _pollTaskProgress = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
368
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
369
+ while (1) switch (_context14.prev = _context14.next) {
351
370
  case 0:
352
- return _context13.abrupt("return", this.api.pollTaskProgress(params));
371
+ return _context14.abrupt("return", this.api.pollTaskProgress(params));
353
372
  case 1:
354
373
  case "end":
355
- return _context13.stop();
374
+ return _context14.stop();
356
375
  }
357
- }, _callee13, this);
376
+ }, _callee14, this);
358
377
  }));
359
378
  function pollTaskProgress(_x13) {
360
379
  return _pollTaskProgress.apply(this, arguments);
@@ -366,16 +385,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
366
385
  }, {
367
386
  key: "get",
368
387
  value: function () {
369
- var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(endpoint, params) {
370
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
371
- while (1) switch (_context14.prev = _context14.next) {
388
+ var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(endpoint, params) {
389
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
390
+ while (1) switch (_context15.prev = _context15.next) {
372
391
  case 0:
373
- return _context14.abrupt("return", this.api.get(endpoint, params));
392
+ return _context15.abrupt("return", this.api.get(endpoint, params));
374
393
  case 1:
375
394
  case "end":
376
- return _context14.stop();
395
+ return _context15.stop();
377
396
  }
378
- }, _callee14, this);
397
+ }, _callee15, this);
379
398
  }));
380
399
  function get(_x14, _x15) {
381
400
  return _get.apply(this, arguments);
@@ -385,16 +404,16 @@ var Roboto = exports["default"] = /*#__PURE__*/function () {
385
404
  }, {
386
405
  key: "post",
387
406
  value: function () {
388
- var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(endpoint, data) {
389
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
390
- while (1) switch (_context15.prev = _context15.next) {
407
+ var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(endpoint, data) {
408
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
409
+ while (1) switch (_context16.prev = _context16.next) {
391
410
  case 0:
392
- return _context15.abrupt("return", this.api.post(endpoint, data));
411
+ return _context16.abrupt("return", this.api.post(endpoint, data));
393
412
  case 1:
394
413
  case "end":
395
- return _context15.stop();
414
+ return _context16.stop();
396
415
  }
397
- }, _callee15, this);
416
+ }, _callee16, this);
398
417
  }));
399
418
  function post(_x16, _x17) {
400
419
  return _post.apply(this, arguments);
@@ -240,6 +240,13 @@ var RbtApi = exports["default"] = /*#__PURE__*/function () {
240
240
  }
241
241
  return logout;
242
242
  }()
243
+ }, {
244
+ key: "getCurrentUser",
245
+ value: function getCurrentUser() {
246
+ if (this.currentUser) {
247
+ return this.currentUser;
248
+ }
249
+ }
243
250
  }, {
244
251
  key: "loadCurrentUser",
245
252
  value: function () {
package/dist/esm/index.js CHANGED
@@ -83,6 +83,9 @@ export default class Roboto {
83
83
  async loadCurrentUser() {
84
84
  return this.api.loadCurrentUser();
85
85
  }
86
+ async getCurrentUser() {
87
+ return this.api.getCurrentUser();
88
+ }
86
89
  async confirmUserEmail(params) {
87
90
  return this.api.confirmUserEmail(params);
88
91
  }
@@ -120,6 +120,11 @@ export default class RbtApi {
120
120
  this._handleError(e);
121
121
  }
122
122
  }
123
+ getCurrentUser() {
124
+ if (this.currentUser) {
125
+ return this.currentUser;
126
+ }
127
+ }
123
128
  async loadCurrentUser() {
124
129
  try {
125
130
  if (this.currentUser) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/index.js CHANGED
@@ -97,6 +97,9 @@ export default class Roboto{
97
97
  async loadCurrentUser(){
98
98
  return this.api.loadCurrentUser();
99
99
  }
100
+ async getCurrentUser(){
101
+ return this.api.getCurrentUser();
102
+ }
100
103
  async confirmUserEmail(params){
101
104
  return this.api.confirmUserEmail(params);
102
105
  }
package/src/rbt_api.js CHANGED
@@ -139,6 +139,14 @@ export default class RbtApi {
139
139
  }
140
140
  }
141
141
 
142
+ getCurrentUser(){
143
+
144
+ if(this.currentUser){
145
+ return this.currentUser;
146
+ }
147
+
148
+ }
149
+
142
150
  async loadCurrentUser(){
143
151
 
144
152
  try {