@atlaskit/collab-provider 19.0.4 → 19.0.5
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/CHANGELOG.md +6 -0
- package/dist/cjs/analytics/analytics-helper.js +12 -11
- package/dist/cjs/api/api.js +43 -48
- package/dist/cjs/api/null-api.js +1 -1
- package/dist/cjs/channel.js +145 -159
- package/dist/cjs/document/catchupv2.js +23 -23
- package/dist/cjs/document/document-service.js +100 -100
- package/dist/cjs/helpers/utils.js +20 -20
- package/dist/cjs/namespace/namespace-service.js +4 -4
- package/dist/cjs/participants/participants-helper.js +10 -10
- package/dist/cjs/participants/participants-service.js +87 -87
- package/dist/cjs/provider/index.js +33 -33
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/analytics/analytics-helper.js +12 -11
- package/dist/esm/api/api.js +43 -48
- package/dist/esm/api/null-api.js +1 -1
- package/dist/esm/channel.js +145 -159
- package/dist/esm/document/catchupv2.js +23 -23
- package/dist/esm/document/document-service.js +100 -100
- package/dist/esm/helpers/utils.js +20 -20
- package/dist/esm/namespace/namespace-service.js +4 -4
- package/dist/esm/participants/participants-helper.js +10 -10
- package/dist/esm/participants/participants-service.js +87 -87
- package/dist/esm/provider/index.js +33 -33
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +7 -7
|
@@ -114,31 +114,31 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
114
114
|
(0, _defineProperty2.default)(this, "handleAnonymousUser", /*#__PURE__*/function () {
|
|
115
115
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(payload) {
|
|
116
116
|
var _previousParticipant$, _ref2, _previousParticipant$2, _asset2;
|
|
117
|
-
var sessionId, previousParticipant, asset, name, _asset$name, _asset, _this$analyticsHelper, participant;
|
|
118
|
-
return _regenerator.default.wrap(function
|
|
117
|
+
var sessionId, previousParticipant, asset, name, _asset$name, _asset, _this$analyticsHelper, participant, _t;
|
|
118
|
+
return _regenerator.default.wrap(function (_context) {
|
|
119
119
|
while (1) switch (_context.prev = _context.next) {
|
|
120
120
|
case 0:
|
|
121
121
|
sessionId = payload.sessionId;
|
|
122
122
|
previousParticipant = _this.participantsState.getBySessionId(sessionId);
|
|
123
123
|
name = (_previousParticipant$ = previousParticipant === null || previousParticipant === void 0 ? void 0 : previousParticipant.name) !== null && _previousParticipant$ !== void 0 ? _previousParticipant$ : '';
|
|
124
124
|
if (!(!previousParticipant && _this.fetchAnonymousAsset)) {
|
|
125
|
-
_context.next =
|
|
125
|
+
_context.next = 5;
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
|
-
_context.prev =
|
|
129
|
-
_context.next =
|
|
128
|
+
_context.prev = 1;
|
|
129
|
+
_context.next = 2;
|
|
130
130
|
return _this.fetchAnonymousAsset(payload.presenceId);
|
|
131
|
-
case
|
|
131
|
+
case 2:
|
|
132
132
|
asset = _context.sent;
|
|
133
|
-
_context.next =
|
|
133
|
+
_context.next = 4;
|
|
134
134
|
break;
|
|
135
|
-
case
|
|
136
|
-
_context.prev =
|
|
137
|
-
|
|
138
|
-
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 || _this$analyticsHelper.sendErrorEvent(
|
|
139
|
-
case
|
|
135
|
+
case 3:
|
|
136
|
+
_context.prev = 3;
|
|
137
|
+
_t = _context["catch"](1);
|
|
138
|
+
(_this$analyticsHelper = _this.analyticsHelper) === null || _this$analyticsHelper === void 0 || _this$analyticsHelper.sendErrorEvent(_t, 'Error while fetching anonymous assets');
|
|
139
|
+
case 4:
|
|
140
140
|
name = (_asset$name = (_asset = asset) === null || _asset === void 0 ? void 0 : _asset.name) !== null && _asset$name !== void 0 ? _asset$name : name;
|
|
141
|
-
case
|
|
141
|
+
case 5:
|
|
142
142
|
participant = _objectSpread(_objectSpread({}, payload), {}, {
|
|
143
143
|
lastActive: payload.timestamp,
|
|
144
144
|
name: name,
|
|
@@ -151,11 +151,11 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
151
151
|
_this.emitPresence({
|
|
152
152
|
joined: [participant]
|
|
153
153
|
}, 'handling updated anonymous participant');
|
|
154
|
-
case
|
|
154
|
+
case 6:
|
|
155
155
|
case "end":
|
|
156
156
|
return _context.stop();
|
|
157
157
|
}
|
|
158
|
-
}, _callee, null, [[
|
|
158
|
+
}, _callee, null, [[1, 3]]);
|
|
159
159
|
}));
|
|
160
160
|
return function (_x) {
|
|
161
161
|
return _ref.apply(this, arguments);
|
|
@@ -168,46 +168,46 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
168
168
|
*/
|
|
169
169
|
(0, _defineProperty2.default)(this, "updateParticipantEager", /*#__PURE__*/function () {
|
|
170
170
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(payload) {
|
|
171
|
-
var userId, participant, _this$analyticsHelper2, previousParticipant;
|
|
172
|
-
return _regenerator.default.wrap(function
|
|
171
|
+
var userId, participant, _this$analyticsHelper2, previousParticipant, _t2;
|
|
172
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
173
173
|
while (1) switch (_context2.prev = _context2.next) {
|
|
174
174
|
case 0:
|
|
175
175
|
userId = payload.userId;
|
|
176
176
|
if (!(!userId || userId === UNIDENTIFIED)) {
|
|
177
|
-
_context2.next =
|
|
177
|
+
_context2.next = 2;
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
|
-
_context2.next =
|
|
180
|
+
_context2.next = 1;
|
|
181
181
|
return _this.handleAnonymousUser(payload);
|
|
182
|
-
case
|
|
182
|
+
case 1:
|
|
183
183
|
return _context2.abrupt("return");
|
|
184
|
-
case
|
|
185
|
-
_context2.prev =
|
|
186
|
-
_context2.next =
|
|
184
|
+
case 2:
|
|
185
|
+
_context2.prev = 2;
|
|
186
|
+
_context2.next = 3;
|
|
187
187
|
return (0, _participantsHelper.createParticipantFromPayload)( // userId _must_ be defined, this lets the compiler know
|
|
188
188
|
_objectSpread(_objectSpread({}, payload), {}, {
|
|
189
189
|
userId: userId
|
|
190
190
|
}), _this.getUser);
|
|
191
|
-
case
|
|
191
|
+
case 3:
|
|
192
192
|
participant = _context2.sent;
|
|
193
|
-
_context2.next =
|
|
193
|
+
_context2.next = 5;
|
|
194
194
|
break;
|
|
195
|
-
case
|
|
196
|
-
_context2.prev =
|
|
197
|
-
|
|
195
|
+
case 4:
|
|
196
|
+
_context2.prev = 4;
|
|
197
|
+
_t2 = _context2["catch"](2);
|
|
198
198
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
199
|
-
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 || _this$analyticsHelper2.sendErrorEvent(
|
|
200
|
-
case
|
|
199
|
+
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 || _this$analyticsHelper2.sendErrorEvent(_t2, 'Error while enriching participant');
|
|
200
|
+
case 5:
|
|
201
201
|
if (participant) {
|
|
202
|
-
_context2.next =
|
|
202
|
+
_context2.next = 6;
|
|
203
203
|
break;
|
|
204
204
|
}
|
|
205
205
|
return _context2.abrupt("return");
|
|
206
|
-
case
|
|
206
|
+
case 6:
|
|
207
207
|
previousParticipant = _this.participantsState.getBySessionId(participant.sessionId);
|
|
208
208
|
_this.participantsState.setBySessionId(participant.sessionId, participant);
|
|
209
209
|
if (!previousParticipant) {
|
|
210
|
-
_context2.next =
|
|
210
|
+
_context2.next = 7;
|
|
211
211
|
break;
|
|
212
212
|
}
|
|
213
213
|
if (_this.hasPresenceActivityChanged(previousParticipant, participant)) {
|
|
@@ -217,16 +217,16 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
217
217
|
}, 'handling participant activity changed event');
|
|
218
218
|
}
|
|
219
219
|
return _context2.abrupt("return");
|
|
220
|
-
case
|
|
220
|
+
case 7:
|
|
221
221
|
// Only emit the joined presence event if this is a new participant
|
|
222
222
|
_this.emitPresence({
|
|
223
223
|
joined: [participant]
|
|
224
224
|
}, 'handling participant updated event');
|
|
225
|
-
case
|
|
225
|
+
case 8:
|
|
226
226
|
case "end":
|
|
227
227
|
return _context2.stop();
|
|
228
228
|
}
|
|
229
|
-
}, _callee2, null, [[
|
|
229
|
+
}, _callee2, null, [[2, 4]]);
|
|
230
230
|
}));
|
|
231
231
|
return function (_x2) {
|
|
232
232
|
return _ref3.apply(this, arguments);
|
|
@@ -246,24 +246,24 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
246
246
|
(0, _defineProperty2.default)(this, "updateParticipantLazy", /*#__PURE__*/function () {
|
|
247
247
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(payload) {
|
|
248
248
|
var userId, sessionId, previousParticipant, _this$batchProps, _participant, participant;
|
|
249
|
-
return _regenerator.default.wrap(function
|
|
249
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
250
250
|
while (1) switch (_context3.prev = _context3.next) {
|
|
251
251
|
case 0:
|
|
252
252
|
userId = payload.userId, sessionId = payload.sessionId; // anonymous users always skip hydration but are marked as hydrated since we don't want to attempt to fetch data
|
|
253
253
|
// this can cause interesting behavior if batchProps.participantsLimit exists
|
|
254
254
|
// for example if limit = 5 and we've hydrated 5 real users and 2 anonymous users join, it'll look like we've hydrated 7 users
|
|
255
255
|
if (!(!userId || userId === UNIDENTIFIED)) {
|
|
256
|
-
_context3.next =
|
|
256
|
+
_context3.next = 2;
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
|
-
_context3.next =
|
|
259
|
+
_context3.next = 1;
|
|
260
260
|
return _this.handleAnonymousUser(payload);
|
|
261
|
-
case
|
|
261
|
+
case 1:
|
|
262
262
|
return _context3.abrupt("return");
|
|
263
|
-
case
|
|
263
|
+
case 2:
|
|
264
264
|
previousParticipant = _this.participantsState.getBySessionId(sessionId);
|
|
265
265
|
if (previousParticipant) {
|
|
266
|
-
_context3.next =
|
|
266
|
+
_context3.next = 4;
|
|
267
267
|
break;
|
|
268
268
|
}
|
|
269
269
|
_participant = _objectSpread(_objectSpread({}, payload), {}, {
|
|
@@ -275,14 +275,14 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
275
275
|
});
|
|
276
276
|
_this.participantsState.setBySessionId(sessionId, _participant);
|
|
277
277
|
if (!(0, _utils.isAIProviderID)(userId)) {
|
|
278
|
-
_context3.next =
|
|
278
|
+
_context3.next = 3;
|
|
279
279
|
break;
|
|
280
280
|
}
|
|
281
281
|
_this.emitPresence({
|
|
282
282
|
joined: [_participant]
|
|
283
283
|
}, 'handling updated new agent lazy');
|
|
284
284
|
return _context3.abrupt("return");
|
|
285
|
-
case
|
|
285
|
+
case 3:
|
|
286
286
|
// prevent running multiple debounces concurrently
|
|
287
287
|
if (!_this.currentlyPollingFetchUsers) {
|
|
288
288
|
void _this.batchFetchUsers();
|
|
@@ -298,7 +298,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
298
298
|
}, 'handling updated new participant lazy');
|
|
299
299
|
}
|
|
300
300
|
return _context3.abrupt("return");
|
|
301
|
-
case
|
|
301
|
+
case 4:
|
|
302
302
|
// would handle activity and lastActive changes
|
|
303
303
|
participant = _objectSpread(_objectSpread({}, previousParticipant), {}, {
|
|
304
304
|
presenceActivity: payload.presenceActivity,
|
|
@@ -312,7 +312,7 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
312
312
|
}, 'handling participant activity changed event');
|
|
313
313
|
}
|
|
314
314
|
return _context3.abrupt("return");
|
|
315
|
-
case
|
|
315
|
+
case 5:
|
|
316
316
|
case "end":
|
|
317
317
|
return _context3.stop();
|
|
318
318
|
}
|
|
@@ -324,20 +324,20 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
324
324
|
}());
|
|
325
325
|
(0, _defineProperty2.default)(this, "onParticipantUpdated", /*#__PURE__*/function () {
|
|
326
326
|
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(payload) {
|
|
327
|
-
return _regenerator.default.wrap(function
|
|
327
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
328
328
|
while (1) switch (_context4.prev = _context4.next) {
|
|
329
329
|
case 0:
|
|
330
330
|
if (!_this.batchProps) {
|
|
331
|
-
_context4.next =
|
|
331
|
+
_context4.next = 1;
|
|
332
332
|
break;
|
|
333
333
|
}
|
|
334
334
|
_this.updateParticipantLazy(payload);
|
|
335
|
-
_context4.next =
|
|
335
|
+
_context4.next = 2;
|
|
336
336
|
break;
|
|
337
|
-
case
|
|
338
|
-
_context4.next =
|
|
337
|
+
case 1:
|
|
338
|
+
_context4.next = 2;
|
|
339
339
|
return _this.updateParticipantEager(payload);
|
|
340
|
-
case
|
|
340
|
+
case 2:
|
|
341
341
|
case "end":
|
|
342
342
|
return _context4.stop();
|
|
343
343
|
}
|
|
@@ -460,33 +460,33 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
460
460
|
});
|
|
461
461
|
(0, _defineProperty2.default)(this, "enrichParticipants", /*#__PURE__*/function () {
|
|
462
462
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(props) {
|
|
463
|
-
var participants, _props$onError, _this$analyticsHelper5;
|
|
464
|
-
return _regenerator.default.wrap(function
|
|
463
|
+
var participants, _props$onError, _this$analyticsHelper5, _t3;
|
|
464
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
465
465
|
while (1) switch (_context5.prev = _context5.next) {
|
|
466
466
|
case 0:
|
|
467
467
|
_context5.prev = 0;
|
|
468
|
-
_context5.next =
|
|
468
|
+
_context5.next = 1;
|
|
469
469
|
return (0, _participantsHelper.fetchParticipants)(_this.participantsState, props);
|
|
470
|
-
case
|
|
470
|
+
case 1:
|
|
471
471
|
participants = _context5.sent;
|
|
472
472
|
if (participants.length) {
|
|
473
473
|
_this.emitPresence({
|
|
474
474
|
joined: participants
|
|
475
475
|
}, 'handling participant updated event');
|
|
476
476
|
}
|
|
477
|
-
_context5.next =
|
|
477
|
+
_context5.next = 3;
|
|
478
478
|
break;
|
|
479
|
-
case
|
|
480
|
-
_context5.prev =
|
|
481
|
-
|
|
482
|
-
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props,
|
|
479
|
+
case 2:
|
|
480
|
+
_context5.prev = 2;
|
|
481
|
+
_t3 = _context5["catch"](0);
|
|
482
|
+
(_props$onError = props.onError) === null || _props$onError === void 0 || _props$onError.call(props, _t3);
|
|
483
483
|
_this.hasBatchFetchError = true;
|
|
484
|
-
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(
|
|
485
|
-
case
|
|
484
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(_t3, 'Failed while fetching participants');
|
|
485
|
+
case 3:
|
|
486
486
|
case "end":
|
|
487
487
|
return _context5.stop();
|
|
488
488
|
}
|
|
489
|
-
}, _callee5, null, [[0,
|
|
489
|
+
}, _callee5, null, [[0, 2]]);
|
|
490
490
|
}));
|
|
491
491
|
return function (_x5) {
|
|
492
492
|
return _ref6.apply(this, arguments);
|
|
@@ -506,67 +506,67 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
506
506
|
*/
|
|
507
507
|
(0, _defineProperty2.default)(this, "batchFetchUsers", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
508
508
|
var _this$batchProps2, debounceTime, participantsLimit, size;
|
|
509
|
-
return _regenerator.default.wrap(function
|
|
509
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
510
510
|
while (1) switch (_context6.prev = _context6.next) {
|
|
511
511
|
case 0:
|
|
512
512
|
if (_this.batchProps) {
|
|
513
|
-
_context6.next =
|
|
513
|
+
_context6.next = 1;
|
|
514
514
|
break;
|
|
515
515
|
}
|
|
516
516
|
return _context6.abrupt("return");
|
|
517
|
-
case
|
|
517
|
+
case 1:
|
|
518
518
|
if (!_this.hasBatchFetchError) {
|
|
519
|
-
_context6.next =
|
|
519
|
+
_context6.next = 2;
|
|
520
520
|
break;
|
|
521
521
|
}
|
|
522
522
|
// no retry logic yet
|
|
523
523
|
logger('Cannot continue to fetch users due to fetch error');
|
|
524
524
|
clearTimeout(_this.presenceFetchTimeout);
|
|
525
525
|
return _context6.abrupt("return");
|
|
526
|
-
case
|
|
526
|
+
case 2:
|
|
527
527
|
_this.currentlyPollingFetchUsers = true;
|
|
528
528
|
clearTimeout(_this.presenceFetchTimeout);
|
|
529
529
|
_this$batchProps2 = _this.batchProps, debounceTime = _this$batchProps2.debounceTime, participantsLimit = _this$batchProps2.participantsLimit;
|
|
530
530
|
if (!participantsLimit) {
|
|
531
|
-
_context6.next =
|
|
531
|
+
_context6.next = 6;
|
|
532
532
|
break;
|
|
533
533
|
}
|
|
534
534
|
size = _this.participantsState.getUniqueParticipants({
|
|
535
535
|
isHydrated: true
|
|
536
536
|
}).length;
|
|
537
537
|
if (!(size < participantsLimit)) {
|
|
538
|
-
_context6.next =
|
|
538
|
+
_context6.next = 4;
|
|
539
539
|
break;
|
|
540
540
|
}
|
|
541
|
-
_context6.next =
|
|
541
|
+
_context6.next = 3;
|
|
542
542
|
return _this.enrichParticipants(_objectSpread(_objectSpread({}, _this.batchProps), {}, {
|
|
543
543
|
batchSize: participantsLimit
|
|
544
544
|
}));
|
|
545
|
-
case
|
|
545
|
+
case 3:
|
|
546
546
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
547
|
-
_context6.next =
|
|
547
|
+
_context6.next = 5;
|
|
548
548
|
break;
|
|
549
|
-
case
|
|
549
|
+
case 4:
|
|
550
550
|
_this.currentlyPollingFetchUsers = false;
|
|
551
|
-
case
|
|
552
|
-
_context6.next =
|
|
551
|
+
case 5:
|
|
552
|
+
_context6.next = 8;
|
|
553
553
|
break;
|
|
554
|
-
case
|
|
554
|
+
case 6:
|
|
555
555
|
if (participantsLimit) {
|
|
556
|
-
_context6.next =
|
|
556
|
+
_context6.next = 8;
|
|
557
557
|
break;
|
|
558
558
|
}
|
|
559
|
-
_context6.next =
|
|
559
|
+
_context6.next = 7;
|
|
560
560
|
return _this.enrichParticipants(_this.batchProps);
|
|
561
|
-
case
|
|
561
|
+
case 7:
|
|
562
562
|
_this.currentlyPollingFetchUsers = _this.participantsState.hasMoreParticipantsToHydrate();
|
|
563
|
-
case
|
|
563
|
+
case 8:
|
|
564
564
|
if (_this.currentlyPollingFetchUsers) {
|
|
565
565
|
_this.presenceFetchTimeout = window.setTimeout(function () {
|
|
566
566
|
return _this.batchFetchUsers();
|
|
567
567
|
}, debounceTime !== null && debounceTime !== void 0 ? debounceTime : DEFAULT_FETCH_USERS_INTERVAL);
|
|
568
568
|
}
|
|
569
|
-
case
|
|
569
|
+
case 9:
|
|
570
570
|
case "end":
|
|
571
571
|
return _context6.stop();
|
|
572
572
|
}
|
|
@@ -578,17 +578,17 @@ var ParticipantsService = exports.ParticipantsService = /*#__PURE__*/function ()
|
|
|
578
578
|
* @example
|
|
579
579
|
*/
|
|
580
580
|
(0, _defineProperty2.default)(this, "initializeFirstBatchFetchUsers", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
581
|
-
return _regenerator.default.wrap(function
|
|
581
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
582
582
|
while (1) switch (_context7.prev = _context7.next) {
|
|
583
583
|
case 0:
|
|
584
|
-
_context7.next =
|
|
584
|
+
_context7.next = 1;
|
|
585
585
|
return new Promise(function (r) {
|
|
586
586
|
var _this$batchProps$debo, _this$batchProps3;
|
|
587
587
|
return window.setTimeout(r, (_this$batchProps$debo = (_this$batchProps3 = _this.batchProps) === null || _this$batchProps3 === void 0 ? void 0 : _this$batchProps3.debounceTime) !== null && _this$batchProps$debo !== void 0 ? _this$batchProps$debo : DEFAULT_FETCH_USERS_INTERVAL);
|
|
588
588
|
});
|
|
589
|
-
case
|
|
589
|
+
case 1:
|
|
590
590
|
void _this.batchFetchUsers();
|
|
591
|
-
case
|
|
591
|
+
case 2:
|
|
592
592
|
case "end":
|
|
593
593
|
return _context7.stop();
|
|
594
594
|
}
|
|
@@ -198,17 +198,17 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
198
198
|
}).on('presence:joined', _this.participantsService.onPresenceJoined).on('presence', _this.participantsService.onPresence).on('participant:left', _this.participantsService.onParticipantLeft).on('participant:updated', _this.participantsService.onParticipantUpdated).on('disconnect', _this.onDisconnected.bind(_this)).on('error', _this.onErrorHandled).on('status', /*#__PURE__*/function () {
|
|
199
199
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(status) {
|
|
200
200
|
var isLocked;
|
|
201
|
-
return _regenerator.default.wrap(function
|
|
201
|
+
return _regenerator.default.wrap(function (_context) {
|
|
202
202
|
while (1) switch (_context.prev = _context.next) {
|
|
203
203
|
case 0:
|
|
204
|
-
_context.next =
|
|
204
|
+
_context.next = 1;
|
|
205
205
|
return _this.namespaceService.onNamespaceStatusChanged(status);
|
|
206
|
-
case
|
|
206
|
+
case 1:
|
|
207
207
|
isLocked = _this.namespaceService.getIsNamespaceLocked();
|
|
208
208
|
_this.emit('namespace-lock:check', {
|
|
209
209
|
isLocked: isLocked
|
|
210
210
|
});
|
|
211
|
-
case
|
|
211
|
+
case 2:
|
|
212
212
|
case "end":
|
|
213
213
|
return _context.stop();
|
|
214
214
|
}
|
|
@@ -301,25 +301,25 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
301
301
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
302
302
|
*/
|
|
303
303
|
(0, _defineProperty2.default)(_this, "getCurrentState", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
304
|
-
var _this$analyticsHelper4;
|
|
305
|
-
return _regenerator.default.wrap(function
|
|
304
|
+
var _this$analyticsHelper4, _t;
|
|
305
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
306
306
|
while (1) switch (_context2.prev = _context2.next) {
|
|
307
307
|
case 0:
|
|
308
308
|
_context2.prev = 0;
|
|
309
|
-
_context2.next =
|
|
309
|
+
_context2.next = 1;
|
|
310
310
|
return _this.documentService.getCurrentState();
|
|
311
|
-
case
|
|
311
|
+
case 1:
|
|
312
312
|
return _context2.abrupt("return", _context2.sent);
|
|
313
|
-
case
|
|
314
|
-
_context2.prev =
|
|
315
|
-
|
|
316
|
-
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(
|
|
317
|
-
throw new _customErrors.GetCurrentStateError('Error while returning the current state of the draft document',
|
|
318
|
-
case
|
|
313
|
+
case 2:
|
|
314
|
+
_context2.prev = 2;
|
|
315
|
+
_t = _context2["catch"](0);
|
|
316
|
+
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 || _this$analyticsHelper4.sendErrorEvent(_t, 'Error while returning ADF version of current draft document');
|
|
317
|
+
throw new _customErrors.GetCurrentStateError('Error while returning the current state of the draft document', _t);
|
|
318
|
+
case 3:
|
|
319
319
|
case "end":
|
|
320
320
|
return _context2.stop();
|
|
321
321
|
}
|
|
322
|
-
}, _callee2, null, [[0,
|
|
322
|
+
}, _callee2, null, [[0, 2]]);
|
|
323
323
|
})));
|
|
324
324
|
/**
|
|
325
325
|
* Return the final acknowledged (by NCS) ADF version of the current draft document, together with it's title and the current step version.
|
|
@@ -328,25 +328,25 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
328
328
|
*/
|
|
329
329
|
(0, _defineProperty2.default)(_this, "getFinalAcknowledgedState", /*#__PURE__*/function () {
|
|
330
330
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(reason) {
|
|
331
|
-
var _this$analyticsHelper5;
|
|
332
|
-
return _regenerator.default.wrap(function
|
|
331
|
+
var _this$analyticsHelper5, _t2;
|
|
332
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
333
333
|
while (1) switch (_context3.prev = _context3.next) {
|
|
334
334
|
case 0:
|
|
335
335
|
_context3.prev = 0;
|
|
336
|
-
_context3.next =
|
|
336
|
+
_context3.next = 1;
|
|
337
337
|
return _this.documentService.getFinalAcknowledgedState(reason);
|
|
338
|
-
case
|
|
338
|
+
case 1:
|
|
339
339
|
return _context3.abrupt("return", _context3.sent);
|
|
340
|
-
case
|
|
341
|
-
_context3.prev =
|
|
342
|
-
|
|
343
|
-
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(
|
|
344
|
-
throw new _customErrors.GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document',
|
|
345
|
-
case
|
|
340
|
+
case 2:
|
|
341
|
+
_context3.prev = 2;
|
|
342
|
+
_t2 = _context3["catch"](0);
|
|
343
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 || _this$analyticsHelper5.sendErrorEvent(_t2, 'Error while returning ADF version of the final draft document');
|
|
344
|
+
throw new _customErrors.GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _t2);
|
|
345
|
+
case 3:
|
|
346
346
|
case "end":
|
|
347
347
|
return _context3.stop();
|
|
348
348
|
}
|
|
349
|
-
}, _callee3, null, [[0,
|
|
349
|
+
}, _callee3, null, [[0, 2]]);
|
|
350
350
|
}));
|
|
351
351
|
return function (_x2) {
|
|
352
352
|
return _ref7.apply(this, arguments);
|
|
@@ -392,23 +392,23 @@ var Provider = exports.Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
392
392
|
(0, _defineProperty2.default)(_this, "fetchMore", /*#__PURE__*/function () {
|
|
393
393
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(props) {
|
|
394
394
|
var _props$fetchSize;
|
|
395
|
-
return _regenerator.default.wrap(function
|
|
395
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
396
396
|
while (1) switch (_context4.prev = _context4.next) {
|
|
397
397
|
case 0:
|
|
398
398
|
if (!_this.config.batchProps) {
|
|
399
|
-
_context4.next =
|
|
399
|
+
_context4.next = 2;
|
|
400
400
|
break;
|
|
401
401
|
}
|
|
402
|
-
_context4.next =
|
|
402
|
+
_context4.next = 1;
|
|
403
403
|
return _this.participantsService.enrichParticipants(_objectSpread(_objectSpread({}, _this.config.batchProps), {}, {
|
|
404
404
|
batchSize: (_props$fetchSize = props === null || props === void 0 ? void 0 : props.fetchSize) !== null && _props$fetchSize !== void 0 ? _props$fetchSize : _this.config.batchProps.batchSize
|
|
405
405
|
}));
|
|
406
|
-
case
|
|
407
|
-
_context4.next =
|
|
406
|
+
case 1:
|
|
407
|
+
_context4.next = 3;
|
|
408
408
|
break;
|
|
409
|
-
case
|
|
409
|
+
case 2:
|
|
410
410
|
throw new Error('Must provide batch properties to use fetchMore');
|
|
411
|
-
case
|
|
411
|
+
case 3:
|
|
412
412
|
case "end":
|
|
413
413
|
return _context4.stop();
|
|
414
414
|
}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/collab-provider";
|
|
8
|
-
var version = exports.version = "19.0.
|
|
8
|
+
var version = exports.version = "19.0.4";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -135,30 +135,31 @@ var AnalyticsHelper = /*#__PURE__*/function () {
|
|
|
135
135
|
key: "sendEvent",
|
|
136
136
|
value: function () {
|
|
137
137
|
var _sendEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
138
|
-
|
|
138
|
+
var _t;
|
|
139
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
139
140
|
while (1) switch (_context.prev = _context.next) {
|
|
140
141
|
case 0:
|
|
141
142
|
if (!(this.getAnalyticsClient && !this.analyticsClient)) {
|
|
142
|
-
_context.next =
|
|
143
|
+
_context.next = 4;
|
|
143
144
|
break;
|
|
144
145
|
}
|
|
145
146
|
_context.prev = 1;
|
|
146
|
-
_context.next =
|
|
147
|
+
_context.next = 2;
|
|
147
148
|
return this.getAnalyticsClient;
|
|
148
|
-
case
|
|
149
|
+
case 2:
|
|
149
150
|
this.analyticsClient = _context.sent;
|
|
150
|
-
_context.next =
|
|
151
|
+
_context.next = 4;
|
|
151
152
|
break;
|
|
152
|
-
case
|
|
153
|
-
_context.prev =
|
|
154
|
-
|
|
155
|
-
case
|
|
153
|
+
case 3:
|
|
154
|
+
_context.prev = 3;
|
|
155
|
+
_t = _context["catch"](1);
|
|
156
|
+
case 4:
|
|
156
157
|
triggerAnalyticsEvent(event, this.analyticsClient);
|
|
157
|
-
case
|
|
158
|
+
case 5:
|
|
158
159
|
case "end":
|
|
159
160
|
return _context.stop();
|
|
160
161
|
}
|
|
161
|
-
}, _callee, this, [[1,
|
|
162
|
+
}, _callee, this, [[1, 3]]);
|
|
162
163
|
}));
|
|
163
164
|
function sendEvent(_x) {
|
|
164
165
|
return _sendEvent.apply(this, arguments);
|