qiscus-sdk-core 2.14.2 → 2.15.0

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.
@@ -46,7 +46,7 @@ function synchronizeFactory(getHttp, getInterval, getSync, getId, logger) {
46
46
  function _generator() {
47
47
  _generator = (0, _wrapAsyncGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
48
48
  var accumulatedInterval, interval, shouldSync;
49
- return _regenerator["default"].wrap(function _callee$(_context) {
49
+ return _regenerator["default"].wrap(function (_context) {
50
50
  while (1) switch (_context.prev = _context.next) {
51
51
  case 0:
52
52
  accumulatedInterval = 0;
@@ -54,26 +54,26 @@ function synchronizeFactory(getHttp, getInterval, getSync, getId, logger) {
54
54
  shouldSync = function shouldSync() {
55
55
  return getHttp() != null && getSync();
56
56
  };
57
- case 3:
57
+ case 1:
58
58
  if (!true) {
59
- _context.next = 13;
59
+ _context.next = 4;
60
60
  break;
61
61
  }
62
62
  accumulatedInterval += interval;
63
63
  if (!(accumulatedInterval >= getInterval() && shouldSync())) {
64
- _context.next = 9;
64
+ _context.next = 2;
65
65
  break;
66
66
  }
67
67
  accumulatedInterval = 0;
68
- _context.next = 9;
68
+ _context.next = 2;
69
69
  return synchronize(getId());
70
- case 9:
71
- _context.next = 11;
72
- return (0, _awaitAsyncGenerator2["default"])(sleep(interval));
73
- case 11:
70
+ case 2:
74
71
  _context.next = 3;
72
+ return (0, _awaitAsyncGenerator2["default"])(sleep(interval));
73
+ case 3:
74
+ _context.next = 1;
75
75
  break;
76
- case 13:
76
+ case 4:
77
77
  case "end":
78
78
  return _context.stop();
79
79
  }
@@ -93,20 +93,20 @@ function synchronizeFactory(getHttp, getInterval, getSync, getId, logger) {
93
93
  },
94
94
  run: function run() {
95
95
  return (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
96
- var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, result, messageId, messages;
97
- return _regenerator["default"].wrap(function _callee2$(_context2) {
96
+ var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, result, messageId, messages, _t;
97
+ return _regenerator["default"].wrap(function (_context2) {
98
98
  while (1) switch (_context2.prev = _context2.next) {
99
99
  case 0:
100
100
  _iteratorAbruptCompletion = false;
101
101
  _didIteratorError = false;
102
- _context2.prev = 2;
102
+ _context2.prev = 1;
103
103
  _iterator = _asyncIterator(generator());
104
- case 4:
105
- _context2.next = 6;
104
+ case 2:
105
+ _context2.next = 3;
106
106
  return _iterator.next();
107
- case 6:
107
+ case 3:
108
108
  if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
109
- _context2.next = 12;
109
+ _context2.next = 5;
110
110
  break;
111
111
  }
112
112
  result = _step.value;
@@ -126,43 +126,43 @@ function synchronizeFactory(getHttp, getInterval, getSync, getId, logger) {
126
126
  logger('error when sync', e.message);
127
127
  console.log('error when sync', e);
128
128
  }
129
- case 9:
129
+ case 4:
130
130
  _iteratorAbruptCompletion = false;
131
- _context2.next = 4;
131
+ _context2.next = 2;
132
132
  break;
133
- case 12:
134
- _context2.next = 18;
133
+ case 5:
134
+ _context2.next = 7;
135
135
  break;
136
- case 14:
137
- _context2.prev = 14;
138
- _context2.t0 = _context2["catch"](2);
136
+ case 6:
137
+ _context2.prev = 6;
138
+ _t = _context2["catch"](1);
139
139
  _didIteratorError = true;
140
- _iteratorError = _context2.t0;
141
- case 18:
142
- _context2.prev = 18;
143
- _context2.prev = 19;
140
+ _iteratorError = _t;
141
+ case 7:
142
+ _context2.prev = 7;
143
+ _context2.prev = 8;
144
144
  if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
145
- _context2.next = 23;
145
+ _context2.next = 9;
146
146
  break;
147
147
  }
148
- _context2.next = 23;
148
+ _context2.next = 9;
149
149
  return _iterator["return"]();
150
- case 23:
151
- _context2.prev = 23;
150
+ case 9:
151
+ _context2.prev = 9;
152
152
  if (!_didIteratorError) {
153
- _context2.next = 26;
153
+ _context2.next = 10;
154
154
  break;
155
155
  }
156
156
  throw _iteratorError;
157
- case 26:
158
- return _context2.finish(23);
159
- case 27:
160
- return _context2.finish(18);
161
- case 28:
157
+ case 10:
158
+ return _context2.finish(9);
159
+ case 11:
160
+ return _context2.finish(7);
161
+ case 12:
162
162
  case "end":
163
163
  return _context2.stop();
164
164
  }
165
- }, _callee2, null, [[2, 14, 18, 28], [19,, 23, 27]]);
165
+ }, _callee2, null, [[1, 6, 7, 12], [8,, 9, 11]]);
166
166
  }))();
167
167
  }
168
168
  };
@@ -214,7 +214,7 @@ function synchronizeEventFactory(getHttp, getInterval, getSync, getId, logger) {
214
214
  function _generator2() {
215
215
  _generator2 = (0, _wrapAsyncGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
216
216
  var accumulatedInterval, interval, shouldSync;
217
- return _regenerator["default"].wrap(function _callee3$(_context3) {
217
+ return _regenerator["default"].wrap(function (_context3) {
218
218
  while (1) switch (_context3.prev = _context3.next) {
219
219
  case 0:
220
220
  accumulatedInterval = 0;
@@ -222,26 +222,26 @@ function synchronizeEventFactory(getHttp, getInterval, getSync, getId, logger) {
222
222
  shouldSync = function shouldSync() {
223
223
  return getHttp() != null && getSync();
224
224
  };
225
- case 3:
225
+ case 1:
226
226
  if (!true) {
227
- _context3.next = 13;
227
+ _context3.next = 4;
228
228
  break;
229
229
  }
230
230
  accumulatedInterval += interval;
231
231
  if (!(accumulatedInterval >= getInterval() && shouldSync())) {
232
- _context3.next = 9;
232
+ _context3.next = 2;
233
233
  break;
234
234
  }
235
235
  accumulatedInterval = 0;
236
- _context3.next = 9;
236
+ _context3.next = 2;
237
237
  return synchronize(getId());
238
- case 9:
239
- _context3.next = 11;
240
- return (0, _awaitAsyncGenerator2["default"])(sleep(interval));
241
- case 11:
238
+ case 2:
242
239
  _context3.next = 3;
240
+ return (0, _awaitAsyncGenerator2["default"])(sleep(interval));
241
+ case 3:
242
+ _context3.next = 1;
243
243
  break;
244
- case 13:
244
+ case 4:
245
245
  case "end":
246
246
  return _context3.stop();
247
247
  }
@@ -261,20 +261,20 @@ function synchronizeEventFactory(getHttp, getInterval, getSync, getId, logger) {
261
261
  },
262
262
  run: function run() {
263
263
  return (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
264
- var _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, result, eventId;
265
- return _regenerator["default"].wrap(function _callee4$(_context4) {
264
+ var _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, result, eventId, _t2;
265
+ return _regenerator["default"].wrap(function (_context4) {
266
266
  while (1) switch (_context4.prev = _context4.next) {
267
267
  case 0:
268
268
  _iteratorAbruptCompletion2 = false;
269
269
  _didIteratorError2 = false;
270
- _context4.prev = 2;
270
+ _context4.prev = 1;
271
271
  _iterator2 = _asyncIterator(generator());
272
- case 4:
273
- _context4.next = 6;
272
+ case 2:
273
+ _context4.next = 3;
274
274
  return _iterator2.next();
275
- case 6:
275
+ case 3:
276
276
  if (!(_iteratorAbruptCompletion2 = !(_step2 = _context4.sent).done)) {
277
- _context4.next = 12;
277
+ _context4.next = 5;
278
278
  break;
279
279
  }
280
280
  result = _step2.value;
@@ -298,43 +298,43 @@ function synchronizeEventFactory(getHttp, getInterval, getSync, getId, logger) {
298
298
  } catch (e) {
299
299
  logger('error when sync event', e.message);
300
300
  }
301
- case 9:
301
+ case 4:
302
302
  _iteratorAbruptCompletion2 = false;
303
- _context4.next = 4;
303
+ _context4.next = 2;
304
304
  break;
305
- case 12:
306
- _context4.next = 18;
305
+ case 5:
306
+ _context4.next = 7;
307
307
  break;
308
- case 14:
309
- _context4.prev = 14;
310
- _context4.t0 = _context4["catch"](2);
308
+ case 6:
309
+ _context4.prev = 6;
310
+ _t2 = _context4["catch"](1);
311
311
  _didIteratorError2 = true;
312
- _iteratorError2 = _context4.t0;
313
- case 18:
314
- _context4.prev = 18;
315
- _context4.prev = 19;
312
+ _iteratorError2 = _t2;
313
+ case 7:
314
+ _context4.prev = 7;
315
+ _context4.prev = 8;
316
316
  if (!(_iteratorAbruptCompletion2 && _iterator2["return"] != null)) {
317
- _context4.next = 23;
317
+ _context4.next = 9;
318
318
  break;
319
319
  }
320
- _context4.next = 23;
320
+ _context4.next = 9;
321
321
  return _iterator2["return"]();
322
- case 23:
323
- _context4.prev = 23;
322
+ case 9:
323
+ _context4.prev = 9;
324
324
  if (!_didIteratorError2) {
325
- _context4.next = 26;
325
+ _context4.next = 10;
326
326
  break;
327
327
  }
328
328
  throw _iteratorError2;
329
- case 26:
330
- return _context4.finish(23);
331
- case 27:
332
- return _context4.finish(18);
333
- case 28:
329
+ case 10:
330
+ return _context4.finish(9);
331
+ case 11:
332
+ return _context4.finish(7);
333
+ case 12:
334
334
  case "end":
335
335
  return _context4.stop();
336
336
  }
337
- }, _callee4, null, [[2, 14, 18, 28], [19,, 23, 27]]);
337
+ }, _callee4, null, [[1, 6, 7, 12], [8,, 9, 11]]);
338
338
  }))();
339
339
  }
340
340
  };
@@ -423,13 +423,13 @@ function SyncAdapter(getHttpAdapter, _ref) {
423
423
  return (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
424
424
  var _result$messages, _result$lastMessageId;
425
425
  var id, result, messages, lastMessageId, _iterator3, _step3, message;
426
- return _regenerator["default"].wrap(function _callee5$(_context5) {
426
+ return _regenerator["default"].wrap(function (_context5) {
427
427
  while (1) switch (_context5.prev = _context5.next) {
428
428
  case 0:
429
429
  id = lastCommentId();
430
- _context5.next = 3;
430
+ _context5.next = 1;
431
431
  return syncFactory.synchronize(id);
432
- case 3:
432
+ case 1:
433
433
  result = _context5.sent;
434
434
  messages = (_result$messages = result === null || result === void 0 ? void 0 : result.messages) !== null && _result$messages !== void 0 ? _result$messages : [];
435
435
  lastMessageId = (_result$lastMessageId = result === null || result === void 0 ? void 0 : result.lastMessageId) !== null && _result$lastMessageId !== void 0 ? _result$lastMessageId : -1;
@@ -447,7 +447,7 @@ function SyncAdapter(getHttpAdapter, _ref) {
447
447
  if (lastMessageId > 0) {
448
448
  emitter.emit('last-message-id.new', lastMessageId);
449
449
  }
450
- case 9:
450
+ case 2:
451
451
  case "end":
452
452
  return _context5.stop();
453
453
  }
@@ -457,12 +457,12 @@ function SyncAdapter(getHttpAdapter, _ref) {
457
457
  synchronizeEvent: function synchronizeEvent() {
458
458
  return (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
459
459
  var result, eventId;
460
- return _regenerator["default"].wrap(function _callee6$(_context6) {
460
+ return _regenerator["default"].wrap(function (_context6) {
461
461
  while (1) switch (_context6.prev = _context6.next) {
462
462
  case 0:
463
- _context6.next = 2;
463
+ _context6.next = 1;
464
464
  return syncEventFactory.synchronize(lastEventId);
465
- case 2:
465
+ case 1:
466
466
  result = _context6.sent;
467
467
  try {
468
468
  eventId = result.lastId;
@@ -484,7 +484,7 @@ function SyncAdapter(getHttpAdapter, _ref) {
484
484
  } catch (e) {
485
485
  logger('error when sync event', e.message);
486
486
  }
487
- case 4:
487
+ case 2:
488
488
  case "end":
489
489
  return _context6.stop();
490
490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qiscus-sdk-core",
3
- "version": "2.14.2",
3
+ "version": "2.15.0",
4
4
  "description": "Qiscus Web SDK Core",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -28,7 +28,8 @@
28
28
  "prepublishOnly": "npm-run-all clean build",
29
29
  "serve": "http-server -p 1234 -c-1 dist",
30
30
  "dev:serve": "run-p serve watch",
31
- "release:patch": "np patch --any-branch --yolo"
31
+ "release:patch": "np patch --any-branch --yolo",
32
+ "release:minor": "np minor --any-branch --yolo"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@babel/cli": "^7.10.5",
@@ -95,5 +96,5 @@
95
96
  "engines": {
96
97
  "node": "16.15.1"
97
98
  },
98
- "packageManager": "pnpm@8.15.9"
99
+ "packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be"
99
100
  }