@atlaskit/collab-provider 7.5.1 → 7.6.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.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/analytics/index.js +2 -1
- package/dist/cjs/channel.js +6 -3
- package/dist/cjs/helpers/const.js +10 -1
- package/dist/cjs/provider/index.js +22 -6
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/index.js +2 -1
- package/dist/es2019/channel.js +6 -3
- package/dist/es2019/helpers/const.js +8 -0
- package/dist/es2019/provider/index.js +21 -6
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/index.js +3 -2
- package/dist/esm/channel.js +6 -3
- package/dist/esm/helpers/const.js +8 -0
- package/dist/esm/provider/index.js +22 -6
- package/dist/esm/version.json +1 -1
- package/dist/types/helpers/const.d.ts +9 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 7.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5bd58e91664`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bd58e91664) - [ESS-2513] Add tracking for number of participants in analytics
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 7.5.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -43,7 +43,8 @@ var triggerCollabAnalyticsEvent = function triggerCollabAnalyticsEvent(analytics
|
|
|
43
43
|
actionSubject: _const.EVENT_SUBJECT,
|
|
44
44
|
source: 'unknown',
|
|
45
45
|
attributes: _objectSpread({
|
|
46
|
-
packageName: _const.ATTRIBUTES_PACKAGE
|
|
46
|
+
packageName: _const.ATTRIBUTES_PACKAGE,
|
|
47
|
+
collabService: _const.COLLAB_SERVICE.NCS
|
|
47
48
|
}, analyticsEvent.attributes)
|
|
48
49
|
};
|
|
49
50
|
fireAnalyticsEvent(analyticsClient, payload);
|
package/dist/cjs/channel.js
CHANGED
|
@@ -79,7 +79,8 @@ var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
79
79
|
eventAction: _const.EVENT_ACTION.CONNECTION,
|
|
80
80
|
attributes: {
|
|
81
81
|
eventStatus: _const.EVENT_STATUS.SUCCESS,
|
|
82
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
82
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
83
|
+
documentAri: _this.config.documentAri
|
|
83
84
|
}
|
|
84
85
|
}, _this.analyticsClient);
|
|
85
86
|
|
|
@@ -100,7 +101,8 @@ var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
100
101
|
attributes: {
|
|
101
102
|
eventStatus: _const.EVENT_STATUS.SUCCESS,
|
|
102
103
|
// TODO: detect when document init fails and fire corresponding event for it
|
|
103
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
104
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
105
|
+
documentAri: _this.config.documentAri
|
|
104
106
|
}
|
|
105
107
|
}, _this.analyticsClient);
|
|
106
108
|
var doc = data.doc,
|
|
@@ -257,7 +259,8 @@ var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
257
259
|
attributes: {
|
|
258
260
|
eventStatus: _const.EVENT_STATUS.FAILURE,
|
|
259
261
|
error: error,
|
|
260
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
262
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
263
|
+
documentAri: _this2.config.documentAri
|
|
261
264
|
}
|
|
262
265
|
}, _this2.analyticsClient); // If error received with `data`, it means the connection is rejected
|
|
263
266
|
// by the server on purpose for example no permission, so no need to
|
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.EVENT_SUBJECT = exports.EVENT_STATUS = exports.EVENT_ACTION = exports.ATTRIBUTES_PACKAGE = exports.ACK_MAX_TRY = void 0;
|
|
6
|
+
exports.EVENT_SUBJECT = exports.EVENT_STATUS = exports.EVENT_ACTION = exports.COLLAB_SERVICE = exports.ATTRIBUTES_PACKAGE = exports.ACK_MAX_TRY = void 0;
|
|
7
7
|
var ATTRIBUTES_PACKAGE = 'collabProvider';
|
|
8
8
|
exports.ATTRIBUTES_PACKAGE = ATTRIBUTES_PACKAGE;
|
|
9
9
|
var EVENT_SUBJECT = 'collab';
|
|
10
10
|
exports.EVENT_SUBJECT = EVENT_SUBJECT;
|
|
11
|
+
var COLLAB_SERVICE;
|
|
12
|
+
exports.COLLAB_SERVICE = COLLAB_SERVICE;
|
|
13
|
+
|
|
14
|
+
(function (COLLAB_SERVICE) {
|
|
15
|
+
COLLAB_SERVICE["NCS"] = "ncs";
|
|
16
|
+
COLLAB_SERVICE["SYNCHRONY"] = "synchrony";
|
|
17
|
+
})(COLLAB_SERVICE || (exports.COLLAB_SERVICE = COLLAB_SERVICE = {}));
|
|
18
|
+
|
|
11
19
|
var EVENT_ACTION;
|
|
12
20
|
exports.EVENT_ACTION = EVENT_ACTION;
|
|
13
21
|
|
|
@@ -17,6 +25,7 @@ exports.EVENT_ACTION = EVENT_ACTION;
|
|
|
17
25
|
EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
|
|
18
26
|
EVENT_ACTION["ADD_STEPS"] = "addSteps";
|
|
19
27
|
EVENT_ACTION["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
28
|
+
EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
|
|
20
29
|
})(EVENT_ACTION || (exports.EVENT_ACTION = EVENT_ACTION = {}));
|
|
21
30
|
|
|
22
31
|
var EVENT_STATUS;
|
|
@@ -263,7 +263,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
263
263
|
eventAction: _const.EVENT_ACTION.CATCHUP,
|
|
264
264
|
attributes: {
|
|
265
265
|
eventStatus: _const.EVENT_STATUS.SUCCESS,
|
|
266
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
266
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
267
|
+
documentAri: _this.config.documentAri
|
|
267
268
|
}
|
|
268
269
|
}, _this.analyticsClient);
|
|
269
270
|
_context.next = 17;
|
|
@@ -278,7 +279,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
278
279
|
attributes: {
|
|
279
280
|
eventStatus: _const.EVENT_STATUS.FAILURE,
|
|
280
281
|
error: _context.t0,
|
|
281
|
-
latency: _measure === null || _measure === void 0 ? void 0 : _measure.duration
|
|
282
|
+
latency: _measure === null || _measure === void 0 ? void 0 : _measure.duration,
|
|
283
|
+
documentAri: _this.config.documentAri
|
|
282
284
|
}
|
|
283
285
|
}, _this.analyticsClient);
|
|
284
286
|
logger("Catch-Up Failed:", _context.t0.message);
|
|
@@ -308,7 +310,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
308
310
|
eventAction: _const.EVENT_ACTION.ADD_STEPS,
|
|
309
311
|
attributes: {
|
|
310
312
|
eventStatus: _const.EVENT_STATUS.FAILURE,
|
|
311
|
-
error: error
|
|
313
|
+
error: error,
|
|
314
|
+
documentAri: _this.config.documentAri
|
|
312
315
|
}
|
|
313
316
|
}, _this.analyticsClient);
|
|
314
317
|
_this.stepRejectCounter++;
|
|
@@ -515,6 +518,16 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
515
518
|
});
|
|
516
519
|
|
|
517
520
|
if (joined.length || left.length) {
|
|
521
|
+
var _this$participants$si;
|
|
522
|
+
|
|
523
|
+
(0, _analytics.triggerCollabAnalyticsEvent)({
|
|
524
|
+
eventAction: _const.EVENT_ACTION.UPDATE_PARTICIPANTS,
|
|
525
|
+
attributes: {
|
|
526
|
+
participants: (_this$participants$si = _this.participants.size) !== null && _this$participants$si !== void 0 ? _this$participants$si : 1,
|
|
527
|
+
documentAri: _this.config.documentAri
|
|
528
|
+
}
|
|
529
|
+
}, _this.analyticsClient);
|
|
530
|
+
|
|
518
531
|
_this.emit('presence', _objectSpread(_objectSpread({}, joined.length ? {
|
|
519
532
|
joined: joined
|
|
520
533
|
} : {}), left.length ? {
|
|
@@ -663,7 +676,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
663
676
|
eventAction: _const.EVENT_ACTION.CONVERT_PM_TO_ADF,
|
|
664
677
|
attributes: {
|
|
665
678
|
eventStatus: _const.EVENT_STATUS.SUCCESS,
|
|
666
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
679
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
680
|
+
documentAri: _this.config.documentAri
|
|
667
681
|
}
|
|
668
682
|
}, _this.analyticsClient);
|
|
669
683
|
} catch (error) {
|
|
@@ -673,7 +687,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
673
687
|
attributes: {
|
|
674
688
|
eventStatus: _const.EVENT_STATUS.FAILURE,
|
|
675
689
|
latency: _measure2 === null || _measure2 === void 0 ? void 0 : _measure2.duration,
|
|
676
|
-
error: error
|
|
690
|
+
error: error,
|
|
691
|
+
documentAri: _this.config.documentAri
|
|
677
692
|
}
|
|
678
693
|
}, _this.analyticsClient);
|
|
679
694
|
logger("Error when converting PM document to ADF: ", error);
|
|
@@ -843,7 +858,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
843
858
|
(0, _analytics.triggerCollabAnalyticsEvent)({
|
|
844
859
|
eventAction: _const.EVENT_ACTION.ADD_STEPS,
|
|
845
860
|
attributes: {
|
|
846
|
-
eventStatus: _const.EVENT_STATUS.SUCCESS
|
|
861
|
+
eventStatus: _const.EVENT_STATUS.SUCCESS,
|
|
862
|
+
documentAri: this.config.documentAri
|
|
847
863
|
}
|
|
848
864
|
}, this.analyticsClient);
|
|
849
865
|
this.emitTelepointersFromSteps(steps); // Resend local steps if none of the received steps originated with us!
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ATTRIBUTES_PACKAGE, EVENT_SUBJECT } from '../helpers/const';
|
|
1
|
+
import { ATTRIBUTES_PACKAGE, EVENT_SUBJECT, COLLAB_SERVICE } from '../helpers/const';
|
|
2
2
|
export const fireAnalyticsEvent = (analyticsClient, payload) => {
|
|
3
3
|
if (!analyticsClient || !payload) {
|
|
4
4
|
return;
|
|
@@ -25,6 +25,7 @@ export const triggerCollabAnalyticsEvent = (analyticsEvent, analyticsClient) =>
|
|
|
25
25
|
source: 'unknown',
|
|
26
26
|
attributes: {
|
|
27
27
|
packageName: ATTRIBUTES_PACKAGE,
|
|
28
|
+
collabService: COLLAB_SERVICE.NCS,
|
|
28
29
|
...analyticsEvent.attributes
|
|
29
30
|
}
|
|
30
31
|
};
|
package/dist/es2019/channel.js
CHANGED
|
@@ -32,7 +32,8 @@ export class Channel extends Emitter {
|
|
|
32
32
|
eventAction: EVENT_ACTION.CONNECTION,
|
|
33
33
|
attributes: {
|
|
34
34
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
35
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
35
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
36
|
+
documentAri: this.config.documentAri
|
|
36
37
|
}
|
|
37
38
|
}, this.analyticsClient);
|
|
38
39
|
this.emit('connected', {
|
|
@@ -53,7 +54,8 @@ export class Channel extends Emitter {
|
|
|
53
54
|
attributes: {
|
|
54
55
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
55
56
|
// TODO: detect when document init fails and fire corresponding event for it
|
|
56
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
57
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
58
|
+
documentAri: this.config.documentAri
|
|
57
59
|
}
|
|
58
60
|
}, this.analyticsClient);
|
|
59
61
|
const {
|
|
@@ -193,7 +195,8 @@ export class Channel extends Emitter {
|
|
|
193
195
|
attributes: {
|
|
194
196
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
195
197
|
error: error,
|
|
196
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
198
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
199
|
+
documentAri: this.config.documentAri
|
|
197
200
|
}
|
|
198
201
|
}, this.analyticsClient); // If error received with `data`, it means the connection is rejected
|
|
199
202
|
// by the server on purpose for example no permission, so no need to
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export const ATTRIBUTES_PACKAGE = 'collabProvider';
|
|
2
2
|
export const EVENT_SUBJECT = 'collab';
|
|
3
|
+
export let COLLAB_SERVICE;
|
|
4
|
+
|
|
5
|
+
(function (COLLAB_SERVICE) {
|
|
6
|
+
COLLAB_SERVICE["NCS"] = "ncs";
|
|
7
|
+
COLLAB_SERVICE["SYNCHRONY"] = "synchrony";
|
|
8
|
+
})(COLLAB_SERVICE || (COLLAB_SERVICE = {}));
|
|
9
|
+
|
|
3
10
|
export let EVENT_ACTION;
|
|
4
11
|
|
|
5
12
|
(function (EVENT_ACTION) {
|
|
@@ -8,6 +15,7 @@ export let EVENT_ACTION;
|
|
|
8
15
|
EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
|
|
9
16
|
EVENT_ACTION["ADD_STEPS"] = "addSteps";
|
|
10
17
|
EVENT_ACTION["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
18
|
+
EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
|
|
11
19
|
})(EVENT_ACTION || (EVENT_ACTION = {}));
|
|
12
20
|
|
|
13
21
|
export let EVENT_STATUS;
|
|
@@ -189,7 +189,8 @@ export class Provider extends Emitter {
|
|
|
189
189
|
eventAction: EVENT_ACTION.CATCHUP,
|
|
190
190
|
attributes: {
|
|
191
191
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
192
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
192
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
193
|
+
documentAri: this.config.documentAri
|
|
193
194
|
}
|
|
194
195
|
}, this.analyticsClient);
|
|
195
196
|
} catch (error) {
|
|
@@ -199,7 +200,8 @@ export class Provider extends Emitter {
|
|
|
199
200
|
attributes: {
|
|
200
201
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
201
202
|
error: error,
|
|
202
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
203
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
204
|
+
documentAri: this.config.documentAri
|
|
203
205
|
}
|
|
204
206
|
}, this.analyticsClient);
|
|
205
207
|
logger(`Catch-Up Failed:`, error.message);
|
|
@@ -218,7 +220,8 @@ export class Provider extends Emitter {
|
|
|
218
220
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
219
221
|
attributes: {
|
|
220
222
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
221
|
-
error
|
|
223
|
+
error,
|
|
224
|
+
documentAri: this.config.documentAri
|
|
222
225
|
}
|
|
223
226
|
}, this.analyticsClient);
|
|
224
227
|
this.stepRejectCounter++;
|
|
@@ -396,6 +399,15 @@ export class Provider extends Emitter {
|
|
|
396
399
|
left.forEach(p => this.participants.delete(p.sessionId));
|
|
397
400
|
|
|
398
401
|
if (joined.length || left.length) {
|
|
402
|
+
var _this$participants$si;
|
|
403
|
+
|
|
404
|
+
triggerCollabAnalyticsEvent({
|
|
405
|
+
eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS,
|
|
406
|
+
attributes: {
|
|
407
|
+
participants: (_this$participants$si = this.participants.size) !== null && _this$participants$si !== void 0 ? _this$participants$si : 1,
|
|
408
|
+
documentAri: this.config.documentAri
|
|
409
|
+
}
|
|
410
|
+
}, this.analyticsClient);
|
|
399
411
|
this.emit('presence', { ...(joined.length ? {
|
|
400
412
|
joined
|
|
401
413
|
} : {}),
|
|
@@ -505,7 +517,8 @@ export class Provider extends Emitter {
|
|
|
505
517
|
eventAction: EVENT_ACTION.CONVERT_PM_TO_ADF,
|
|
506
518
|
attributes: {
|
|
507
519
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
508
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
520
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
521
|
+
documentAri: this.config.documentAri
|
|
509
522
|
}
|
|
510
523
|
}, this.analyticsClient);
|
|
511
524
|
} catch (error) {
|
|
@@ -515,7 +528,8 @@ export class Provider extends Emitter {
|
|
|
515
528
|
attributes: {
|
|
516
529
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
517
530
|
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
518
|
-
error: error
|
|
531
|
+
error: error,
|
|
532
|
+
documentAri: this.config.documentAri
|
|
519
533
|
}
|
|
520
534
|
}, this.analyticsClient);
|
|
521
535
|
logger(`Error when converting PM document to ADF: `, error);
|
|
@@ -666,7 +680,8 @@ export class Provider extends Emitter {
|
|
|
666
680
|
triggerCollabAnalyticsEvent({
|
|
667
681
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
668
682
|
attributes: {
|
|
669
|
-
eventStatus: EVENT_STATUS.SUCCESS
|
|
683
|
+
eventStatus: EVENT_STATUS.SUCCESS,
|
|
684
|
+
documentAri: this.config.documentAri
|
|
670
685
|
}
|
|
671
686
|
}, this.analyticsClient);
|
|
672
687
|
this.emitTelepointersFromSteps(steps); // Resend local steps if none of the received steps originated with us!
|
package/dist/es2019/version.json
CHANGED
|
@@ -4,7 +4,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
6
|
|
|
7
|
-
import { ATTRIBUTES_PACKAGE, EVENT_SUBJECT } from '../helpers/const';
|
|
7
|
+
import { ATTRIBUTES_PACKAGE, EVENT_SUBJECT, COLLAB_SERVICE } from '../helpers/const';
|
|
8
8
|
export var fireAnalyticsEvent = function fireAnalyticsEvent(analyticsClient, payload) {
|
|
9
9
|
if (!analyticsClient || !payload) {
|
|
10
10
|
return;
|
|
@@ -30,7 +30,8 @@ export var triggerCollabAnalyticsEvent = function triggerCollabAnalyticsEvent(an
|
|
|
30
30
|
actionSubject: EVENT_SUBJECT,
|
|
31
31
|
source: 'unknown',
|
|
32
32
|
attributes: _objectSpread({
|
|
33
|
-
packageName: ATTRIBUTES_PACKAGE
|
|
33
|
+
packageName: ATTRIBUTES_PACKAGE,
|
|
34
|
+
collabService: COLLAB_SERVICE.NCS
|
|
34
35
|
}, analyticsEvent.attributes)
|
|
35
36
|
};
|
|
36
37
|
fireAnalyticsEvent(analyticsClient, payload);
|
package/dist/esm/channel.js
CHANGED
|
@@ -63,7 +63,8 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
63
63
|
eventAction: EVENT_ACTION.CONNECTION,
|
|
64
64
|
attributes: {
|
|
65
65
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
66
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
66
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
67
|
+
documentAri: _this.config.documentAri
|
|
67
68
|
}
|
|
68
69
|
}, _this.analyticsClient);
|
|
69
70
|
|
|
@@ -85,7 +86,8 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
85
86
|
attributes: {
|
|
86
87
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
87
88
|
// TODO: detect when document init fails and fire corresponding event for it
|
|
88
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
89
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
90
|
+
documentAri: _this.config.documentAri
|
|
89
91
|
}
|
|
90
92
|
}, _this.analyticsClient);
|
|
91
93
|
var doc = data.doc,
|
|
@@ -243,7 +245,8 @@ export var Channel = /*#__PURE__*/function (_Emitter) {
|
|
|
243
245
|
attributes: {
|
|
244
246
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
245
247
|
error: error,
|
|
246
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
248
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
249
|
+
documentAri: _this2.config.documentAri
|
|
247
250
|
}
|
|
248
251
|
}, _this2.analyticsClient); // If error received with `data`, it means the connection is rejected
|
|
249
252
|
// by the server on purpose for example no permission, so no need to
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export var ATTRIBUTES_PACKAGE = 'collabProvider';
|
|
2
2
|
export var EVENT_SUBJECT = 'collab';
|
|
3
|
+
export var COLLAB_SERVICE;
|
|
4
|
+
|
|
5
|
+
(function (COLLAB_SERVICE) {
|
|
6
|
+
COLLAB_SERVICE["NCS"] = "ncs";
|
|
7
|
+
COLLAB_SERVICE["SYNCHRONY"] = "synchrony";
|
|
8
|
+
})(COLLAB_SERVICE || (COLLAB_SERVICE = {}));
|
|
9
|
+
|
|
3
10
|
export var EVENT_ACTION;
|
|
4
11
|
|
|
5
12
|
(function (EVENT_ACTION) {
|
|
@@ -8,6 +15,7 @@ export var EVENT_ACTION;
|
|
|
8
15
|
EVENT_ACTION["DOCUMENT_INIT"] = "documentInit";
|
|
9
16
|
EVENT_ACTION["ADD_STEPS"] = "addSteps";
|
|
10
17
|
EVENT_ACTION["CONVERT_PM_TO_ADF"] = "convertPMToADF";
|
|
18
|
+
EVENT_ACTION["UPDATE_PARTICIPANTS"] = "updateParticipants";
|
|
11
19
|
})(EVENT_ACTION || (EVENT_ACTION = {}));
|
|
12
20
|
|
|
13
21
|
export var EVENT_STATUS;
|
|
@@ -239,7 +239,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
239
239
|
eventAction: EVENT_ACTION.CATCHUP,
|
|
240
240
|
attributes: {
|
|
241
241
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
242
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
242
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
243
|
+
documentAri: _this.config.documentAri
|
|
243
244
|
}
|
|
244
245
|
}, _this.analyticsClient);
|
|
245
246
|
_context.next = 17;
|
|
@@ -254,7 +255,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
254
255
|
attributes: {
|
|
255
256
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
256
257
|
error: _context.t0,
|
|
257
|
-
latency: _measure === null || _measure === void 0 ? void 0 : _measure.duration
|
|
258
|
+
latency: _measure === null || _measure === void 0 ? void 0 : _measure.duration,
|
|
259
|
+
documentAri: _this.config.documentAri
|
|
258
260
|
}
|
|
259
261
|
}, _this.analyticsClient);
|
|
260
262
|
logger("Catch-Up Failed:", _context.t0.message);
|
|
@@ -285,7 +287,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
285
287
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
286
288
|
attributes: {
|
|
287
289
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
288
|
-
error: error
|
|
290
|
+
error: error,
|
|
291
|
+
documentAri: _this.config.documentAri
|
|
289
292
|
}
|
|
290
293
|
}, _this.analyticsClient);
|
|
291
294
|
_this.stepRejectCounter++;
|
|
@@ -502,6 +505,16 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
502
505
|
});
|
|
503
506
|
|
|
504
507
|
if (joined.length || left.length) {
|
|
508
|
+
var _this$participants$si;
|
|
509
|
+
|
|
510
|
+
triggerCollabAnalyticsEvent({
|
|
511
|
+
eventAction: EVENT_ACTION.UPDATE_PARTICIPANTS,
|
|
512
|
+
attributes: {
|
|
513
|
+
participants: (_this$participants$si = _this.participants.size) !== null && _this$participants$si !== void 0 ? _this$participants$si : 1,
|
|
514
|
+
documentAri: _this.config.documentAri
|
|
515
|
+
}
|
|
516
|
+
}, _this.analyticsClient);
|
|
517
|
+
|
|
505
518
|
_this.emit('presence', _objectSpread(_objectSpread({}, joined.length ? {
|
|
506
519
|
joined: joined
|
|
507
520
|
} : {}), left.length ? {
|
|
@@ -653,7 +666,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
653
666
|
eventAction: EVENT_ACTION.CONVERT_PM_TO_ADF,
|
|
654
667
|
attributes: {
|
|
655
668
|
eventStatus: EVENT_STATUS.SUCCESS,
|
|
656
|
-
latency: measure === null || measure === void 0 ? void 0 : measure.duration
|
|
669
|
+
latency: measure === null || measure === void 0 ? void 0 : measure.duration,
|
|
670
|
+
documentAri: _this.config.documentAri
|
|
657
671
|
}
|
|
658
672
|
}, _this.analyticsClient);
|
|
659
673
|
} catch (error) {
|
|
@@ -663,7 +677,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
663
677
|
attributes: {
|
|
664
678
|
eventStatus: EVENT_STATUS.FAILURE,
|
|
665
679
|
latency: _measure2 === null || _measure2 === void 0 ? void 0 : _measure2.duration,
|
|
666
|
-
error: error
|
|
680
|
+
error: error,
|
|
681
|
+
documentAri: _this.config.documentAri
|
|
667
682
|
}
|
|
668
683
|
}, _this.analyticsClient);
|
|
669
684
|
logger("Error when converting PM document to ADF: ", error);
|
|
@@ -834,7 +849,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
834
849
|
triggerCollabAnalyticsEvent({
|
|
835
850
|
eventAction: EVENT_ACTION.ADD_STEPS,
|
|
836
851
|
attributes: {
|
|
837
|
-
eventStatus: EVENT_STATUS.SUCCESS
|
|
852
|
+
eventStatus: EVENT_STATUS.SUCCESS,
|
|
853
|
+
documentAri: this.config.documentAri
|
|
838
854
|
}
|
|
839
855
|
}, this.analyticsClient);
|
|
840
856
|
this.emitTelepointersFromSteps(steps); // Resend local steps if none of the received steps originated with us!
|
package/dist/esm/version.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { ErrorPayload } from '../types';
|
|
2
2
|
export declare const ATTRIBUTES_PACKAGE = "collabProvider";
|
|
3
3
|
export declare const EVENT_SUBJECT = "collab";
|
|
4
|
+
export declare enum COLLAB_SERVICE {
|
|
5
|
+
NCS = "ncs",
|
|
6
|
+
SYNCHRONY = "synchrony"
|
|
7
|
+
}
|
|
4
8
|
export declare enum EVENT_ACTION {
|
|
5
9
|
CONNECTION = "connection",
|
|
6
10
|
CATCHUP = "catchup",
|
|
7
11
|
DOCUMENT_INIT = "documentInit",
|
|
8
12
|
ADD_STEPS = "addSteps",
|
|
9
|
-
CONVERT_PM_TO_ADF = "convertPMToADF"
|
|
13
|
+
CONVERT_PM_TO_ADF = "convertPMToADF",
|
|
14
|
+
UPDATE_PARTICIPANTS = "updateParticipants"
|
|
10
15
|
}
|
|
11
16
|
export declare enum EVENT_STATUS {
|
|
12
17
|
SUCCESS = "SUCCESS",
|
|
@@ -15,10 +20,12 @@ export declare enum EVENT_STATUS {
|
|
|
15
20
|
export declare type AnalyticsEvent = {
|
|
16
21
|
eventAction: EVENT_ACTION;
|
|
17
22
|
attributes: {
|
|
18
|
-
|
|
23
|
+
documentAri?: string;
|
|
24
|
+
eventStatus?: EVENT_STATUS;
|
|
19
25
|
meetsSLO?: boolean;
|
|
20
26
|
latency?: number;
|
|
21
27
|
error?: ErrorPayload;
|
|
28
|
+
participants?: number;
|
|
22
29
|
};
|
|
23
30
|
};
|
|
24
31
|
export declare const ACK_MAX_TRY = 10;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/analytics-gas-types": "5.0.8",
|
|
25
25
|
"@atlaskit/analytics-listeners": "^8.3.0",
|
|
26
|
-
"@atlaskit/editor-common": "^69.
|
|
27
|
-
"@atlaskit/editor-json-transformer": "^8.
|
|
26
|
+
"@atlaskit/editor-common": "^69.2.0",
|
|
27
|
+
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
28
28
|
"@atlaskit/util-service-support": "^6.1.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0",
|
|
30
30
|
"eventemitter2": "^4.1.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@atlaskit/adf-schema": "^
|
|
47
|
+
"@atlaskit/adf-schema": "^24.0.0",
|
|
48
48
|
"@atlaskit/editor-test-helpers": "^17.1.0",
|
|
49
49
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
50
50
|
"@types/prosemirror-collab": "^1.1.1",
|