@atlaskit/collab-provider 9.9.0 → 9.10.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 +12 -0
- package/dist/cjs/helpers/const.js +3 -1
- package/dist/cjs/provider/index.js +41 -24
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/helpers/const.js +3 -1
- package/dist/es2019/provider/index.js +41 -24
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/helpers/const.js +3 -1
- package/dist/esm/provider/index.js +41 -24
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/helpers/const.d.ts +22 -2
- package/dist/types-ts4.5/helpers/const.d.ts +22 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/collab-provider
|
|
2
2
|
|
|
3
|
+
## 9.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`592dcbd5756`](https://bitbucket.org/atlassian/atlassian-frontend/commits/592dcbd5756) - Adding analytics events for early provider initialization and buffering
|
|
8
|
+
|
|
9
|
+
## 9.9.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 9.9.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -20,8 +20,10 @@ var EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
|
|
|
20
20
|
EVENT_ACTION["CATCHUP_AFTER_MAX_SEND_STEPS_RETRY"] = "catchupAfterMaxSendStepsRetry";
|
|
21
21
|
EVENT_ACTION["DROPPED_STEPS"] = "droppedStepInCatchup";
|
|
22
22
|
EVENT_ACTION["WEBSOCKET_MESSAGE_VOLUME_METRIC"] = "websocketMessageVolumeMetric";
|
|
23
|
+
EVENT_ACTION["PROVIDER_INITIALIZED"] = "providerInitialized";
|
|
24
|
+
EVENT_ACTION["PROVIDER_SETUP"] = "providerSetup";
|
|
23
25
|
return EVENT_ACTION;
|
|
24
|
-
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/
|
|
26
|
+
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/54715
|
|
25
27
|
exports.EVENT_ACTION = EVENT_ACTION;
|
|
26
28
|
var EVENT_STATUS = /*#__PURE__*/function (EVENT_STATUS) {
|
|
27
29
|
EVENT_STATUS["SUCCESS"] = "SUCCESS";
|
|
@@ -26,6 +26,7 @@ var _documentService = require("../document/document-service");
|
|
|
26
26
|
var _namespaceService = require("../namespace/namespace-service");
|
|
27
27
|
var _participantsService = require("../participants/participants-service");
|
|
28
28
|
var _errorCodeMapper = require("../errors/error-code-mapper");
|
|
29
|
+
var _const = require("../helpers/const");
|
|
29
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
31
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
32
|
var logger = (0, _utils.createLogger)('Provider', 'black');
|
|
@@ -120,6 +121,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
120
121
|
}
|
|
121
122
|
// If the initial draft is already up to date, update the document with that of the initial draft
|
|
122
123
|
else {
|
|
124
|
+
var _this$analyticsHelper2;
|
|
123
125
|
var _this$initialDraft = _this.initialDraft,
|
|
124
126
|
document = _this$initialDraft.document,
|
|
125
127
|
version = _this$initialDraft.version,
|
|
@@ -141,6 +143,9 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
141
143
|
metadata: metadata
|
|
142
144
|
});
|
|
143
145
|
}
|
|
146
|
+
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendActionEvent(_const.EVENT_ACTION.PROVIDER_INITIALIZED, _const.EVENT_STATUS.INFO, {
|
|
147
|
+
isPreinitializing: _this.isPreinitializing
|
|
148
|
+
});
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
// If already initialized, `connected` means reconnected
|
|
@@ -186,13 +191,13 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
186
191
|
if (((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) === _errorTypes.NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED || ((_error$data2 = error.data) === null || _error$data2 === void 0 ? void 0 : _error$data2.code) === _errorTypes.NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS) {
|
|
187
192
|
_this.documentService.onStepRejectedError();
|
|
188
193
|
} else {
|
|
189
|
-
var _this$
|
|
190
|
-
(_this$
|
|
194
|
+
var _this$analyticsHelper3;
|
|
195
|
+
(_this$analyticsHelper3 = _this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(error, 'Error handled');
|
|
191
196
|
var mappedError = (0, _errorCodeMapper.errorCodeMapper)(error);
|
|
192
197
|
// Temporarily only emit errors to Confluence very intentionally because they will disconnect the collab provider
|
|
193
198
|
if (mappedError) {
|
|
194
|
-
var _this$
|
|
195
|
-
(_this$
|
|
199
|
+
var _this$analyticsHelper4;
|
|
200
|
+
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(mappedError, 'Error emitted');
|
|
196
201
|
_this.emitCallback('error', mappedError);
|
|
197
202
|
}
|
|
198
203
|
}
|
|
@@ -215,7 +220,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
215
220
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
216
221
|
*/
|
|
217
222
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCurrentState", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
218
|
-
var _this$
|
|
223
|
+
var _this$analyticsHelper5;
|
|
219
224
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
220
225
|
while (1) switch (_context.prev = _context.next) {
|
|
221
226
|
case 0:
|
|
@@ -227,7 +232,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
227
232
|
case 6:
|
|
228
233
|
_context.prev = 6;
|
|
229
234
|
_context.t0 = _context["catch"](0);
|
|
230
|
-
(_this$
|
|
235
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
|
|
231
236
|
throw new _errorTypes.GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
|
|
232
237
|
case 10:
|
|
233
238
|
case "end":
|
|
@@ -241,7 +246,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
241
246
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
242
247
|
*/
|
|
243
248
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFinalAcknowledgedState", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
244
|
-
var _this$
|
|
249
|
+
var _this$analyticsHelper6;
|
|
245
250
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
246
251
|
while (1) switch (_context2.prev = _context2.next) {
|
|
247
252
|
case 0:
|
|
@@ -253,7 +258,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
253
258
|
case 6:
|
|
254
259
|
_context2.prev = 6;
|
|
255
260
|
_context2.t0 = _context2["catch"](0);
|
|
256
|
-
(_this$
|
|
261
|
+
(_this$analyticsHelper6 = _this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(_context2.t0, 'Error while returning ADF version of the final draft document');
|
|
257
262
|
throw new _errorTypes.GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _context2.t0);
|
|
258
263
|
case 10:
|
|
259
264
|
case "end":
|
|
@@ -335,6 +340,13 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
335
340
|
if (!getState && this.initialDraft) {
|
|
336
341
|
this.isPreinitializing = true;
|
|
337
342
|
}
|
|
343
|
+
if (this.initialDraft) {
|
|
344
|
+
var _this$analyticsHelper7;
|
|
345
|
+
(_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendActionEvent(_const.EVENT_ACTION.PROVIDER_SETUP, _const.EVENT_STATUS.INFO, {
|
|
346
|
+
isPreinitializing: this.isPreinitializing,
|
|
347
|
+
hasState: Boolean(getState)
|
|
348
|
+
});
|
|
349
|
+
}
|
|
338
350
|
if (getState) {
|
|
339
351
|
var collabPlugin = getState().plugins.find(function (p) {
|
|
340
352
|
return p.key === 'collab$';
|
|
@@ -354,6 +366,7 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
354
366
|
if (this.isPreinitializing) {
|
|
355
367
|
this.resolveOnSetupPromise();
|
|
356
368
|
if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
|
|
369
|
+
var _this$analyticsHelper8;
|
|
357
370
|
var _this$initialDraft2 = this.initialDraft,
|
|
358
371
|
document = _this$initialDraft2.document,
|
|
359
372
|
version = _this$initialDraft2.version,
|
|
@@ -363,6 +376,10 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
363
376
|
version: version,
|
|
364
377
|
metadata: metadata
|
|
365
378
|
});
|
|
379
|
+
(_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendActionEvent(_const.EVENT_ACTION.PROVIDER_INITIALIZED, _const.EVENT_STATUS.INFO, {
|
|
380
|
+
isPreinitializing: this.isPreinitializing,
|
|
381
|
+
isBuffered: true
|
|
382
|
+
});
|
|
366
383
|
}
|
|
367
384
|
}
|
|
368
385
|
}
|
|
@@ -371,8 +388,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
371
388
|
this.isChannelInitialized = true;
|
|
372
389
|
}
|
|
373
390
|
} catch (initError) {
|
|
374
|
-
var _this$
|
|
375
|
-
(_this$
|
|
391
|
+
var _this$analyticsHelper9;
|
|
392
|
+
(_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(initError, 'Error while initialising the provider');
|
|
376
393
|
// Throw error so consumers are aware the initialisation failed when initialising themselves
|
|
377
394
|
throw new _errorTypes.ProviderInitialisationError('Provider initialisation error', initError);
|
|
378
395
|
}
|
|
@@ -382,9 +399,9 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
382
399
|
key: "checkForCookies",
|
|
383
400
|
value: function checkForCookies() {
|
|
384
401
|
if (!global.navigator.cookieEnabled) {
|
|
385
|
-
var _this$
|
|
402
|
+
var _this$analyticsHelper10;
|
|
386
403
|
var initError = new _errorTypes.ProviderInitialisationError('Cookies are not enabled. Please enable cookies to use collaborative editing.');
|
|
387
|
-
(_this$
|
|
404
|
+
(_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
|
|
388
405
|
throw new _errorTypes.ProviderInitialisationError('Provider initialisation error - cookies disabled', initError);
|
|
389
406
|
}
|
|
390
407
|
}
|
|
@@ -422,8 +439,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
422
439
|
}
|
|
423
440
|
this.documentService.send(_tr, _oldState, newState);
|
|
424
441
|
} catch (error) {
|
|
425
|
-
var _this$
|
|
426
|
-
(_this$
|
|
442
|
+
var _this$analyticsHelper11;
|
|
443
|
+
(_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while sending steps for a transaction');
|
|
427
444
|
throw new _errorTypes.SendTransactionError('Error while sending steps for a transaction', error);
|
|
428
445
|
}
|
|
429
446
|
}
|
|
@@ -451,9 +468,9 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
451
468
|
this.channel.broadcast('participant:telepointer', payload, callback);
|
|
452
469
|
}
|
|
453
470
|
} catch (error) {
|
|
454
|
-
var _this$
|
|
471
|
+
var _this$analyticsHelper12;
|
|
455
472
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
456
|
-
(_this$
|
|
473
|
+
(_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while sending message - telepointer');
|
|
457
474
|
}
|
|
458
475
|
}
|
|
459
476
|
}, {
|
|
@@ -492,8 +509,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
492
509
|
(0, _get2.default)((0, _getPrototypeOf2.default)(Provider.prototype), "unsubscribeAll", this).call(this);
|
|
493
510
|
this.channel.disconnect();
|
|
494
511
|
} catch (error) {
|
|
495
|
-
var _this$
|
|
496
|
-
(_this$
|
|
512
|
+
var _this$analyticsHelper13;
|
|
513
|
+
(_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while shutting down the collab provider');
|
|
497
514
|
throw new _errorTypes.DestroyError('Error while shutting down the collab provider', error);
|
|
498
515
|
}
|
|
499
516
|
this.clearTimers();
|
|
@@ -513,8 +530,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
513
530
|
try {
|
|
514
531
|
this.metadataService.setTitle(title, broadcast);
|
|
515
532
|
} catch (error) {
|
|
516
|
-
var _this$
|
|
517
|
-
(_this$
|
|
533
|
+
var _this$analyticsHelper14;
|
|
534
|
+
(_this$analyticsHelper14 = this.analyticsHelper) === null || _this$analyticsHelper14 === void 0 ? void 0 : _this$analyticsHelper14.sendErrorEvent(error, 'Error while setting title');
|
|
518
535
|
throw new _errorTypes.SetTitleError('Error while setting title', error);
|
|
519
536
|
}
|
|
520
537
|
}
|
|
@@ -532,8 +549,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
532
549
|
try {
|
|
533
550
|
this.metadataService.setEditorWidth(editorWidth, broadcast);
|
|
534
551
|
} catch (error) {
|
|
535
|
-
var _this$
|
|
536
|
-
(_this$
|
|
552
|
+
var _this$analyticsHelper15;
|
|
553
|
+
(_this$analyticsHelper15 = this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 ? void 0 : _this$analyticsHelper15.sendErrorEvent(error, 'Error while setting editor width');
|
|
537
554
|
throw new _errorTypes.SetEditorWidthError('Error while setting editor width', error);
|
|
538
555
|
}
|
|
539
556
|
}
|
|
@@ -549,8 +566,8 @@ var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
549
566
|
try {
|
|
550
567
|
this.metadataService.setMetadata(metadata);
|
|
551
568
|
} catch (error) {
|
|
552
|
-
var _this$
|
|
553
|
-
(_this$
|
|
569
|
+
var _this$analyticsHelper16;
|
|
570
|
+
(_this$analyticsHelper16 = this.analyticsHelper) === null || _this$analyticsHelper16 === void 0 ? void 0 : _this$analyticsHelper16.sendErrorEvent(error, 'Error while setting metadata');
|
|
554
571
|
throw new _errorTypes.SetMetadataError('Error while setting metadata', error);
|
|
555
572
|
}
|
|
556
573
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/collab-provider";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "9.
|
|
9
|
+
var version = "9.10.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -14,8 +14,10 @@ export let EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
|
|
|
14
14
|
EVENT_ACTION["CATCHUP_AFTER_MAX_SEND_STEPS_RETRY"] = "catchupAfterMaxSendStepsRetry";
|
|
15
15
|
EVENT_ACTION["DROPPED_STEPS"] = "droppedStepInCatchup";
|
|
16
16
|
EVENT_ACTION["WEBSOCKET_MESSAGE_VOLUME_METRIC"] = "websocketMessageVolumeMetric";
|
|
17
|
+
EVENT_ACTION["PROVIDER_INITIALIZED"] = "providerInitialized";
|
|
18
|
+
EVENT_ACTION["PROVIDER_SETUP"] = "providerSetup";
|
|
17
19
|
return EVENT_ACTION;
|
|
18
|
-
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/
|
|
20
|
+
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/54715
|
|
19
21
|
export let EVENT_STATUS = /*#__PURE__*/function (EVENT_STATUS) {
|
|
20
22
|
EVENT_STATUS["SUCCESS"] = "SUCCESS";
|
|
21
23
|
EVENT_STATUS["FAILURE"] = "FAILURE";
|
|
@@ -10,6 +10,7 @@ import { DocumentService } from '../document/document-service';
|
|
|
10
10
|
import { NamespaceService } from '../namespace/namespace-service';
|
|
11
11
|
import { ParticipantsService } from '../participants/participants-service';
|
|
12
12
|
import { errorCodeMapper } from '../errors/error-code-mapper';
|
|
13
|
+
import { EVENT_ACTION, EVENT_STATUS } from '../helpers/const';
|
|
13
14
|
const logger = createLogger('Provider', 'black');
|
|
14
15
|
const OUT_OF_SYNC_PERIOD = 3 * 1000; // 3 seconds
|
|
15
16
|
const PRELOAD_DRAFT_SYNC_PERIOD = 15 * 1000; // 15 seconds
|
|
@@ -97,6 +98,7 @@ export class Provider extends Emitter {
|
|
|
97
98
|
}
|
|
98
99
|
// If the initial draft is already up to date, update the document with that of the initial draft
|
|
99
100
|
else {
|
|
101
|
+
var _this$analyticsHelper2;
|
|
100
102
|
const {
|
|
101
103
|
document,
|
|
102
104
|
version,
|
|
@@ -119,6 +121,9 @@ export class Provider extends Emitter {
|
|
|
119
121
|
metadata
|
|
120
122
|
});
|
|
121
123
|
}
|
|
124
|
+
(_this$analyticsHelper2 = this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendActionEvent(EVENT_ACTION.PROVIDER_INITIALIZED, EVENT_STATUS.INFO, {
|
|
125
|
+
isPreinitializing: this.isPreinitializing
|
|
126
|
+
});
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
// If already initialized, `connected` means reconnected
|
|
@@ -163,13 +168,13 @@ export class Provider extends Emitter {
|
|
|
163
168
|
if (((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) === NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED || ((_error$data2 = error.data) === null || _error$data2 === void 0 ? void 0 : _error$data2.code) === NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS) {
|
|
164
169
|
this.documentService.onStepRejectedError();
|
|
165
170
|
} else {
|
|
166
|
-
var _this$
|
|
167
|
-
(_this$
|
|
171
|
+
var _this$analyticsHelper3;
|
|
172
|
+
(_this$analyticsHelper3 = this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(error, 'Error handled');
|
|
168
173
|
const mappedError = errorCodeMapper(error);
|
|
169
174
|
// Temporarily only emit errors to Confluence very intentionally because they will disconnect the collab provider
|
|
170
175
|
if (mappedError) {
|
|
171
|
-
var _this$
|
|
172
|
-
(_this$
|
|
176
|
+
var _this$analyticsHelper4;
|
|
177
|
+
(_this$analyticsHelper4 = this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(mappedError, 'Error emitted');
|
|
173
178
|
this.emitCallback('error', mappedError);
|
|
174
179
|
}
|
|
175
180
|
}
|
|
@@ -196,8 +201,8 @@ export class Provider extends Emitter {
|
|
|
196
201
|
try {
|
|
197
202
|
return await this.documentService.getCurrentState();
|
|
198
203
|
} catch (error) {
|
|
199
|
-
var _this$
|
|
200
|
-
(_this$
|
|
204
|
+
var _this$analyticsHelper5;
|
|
205
|
+
(_this$analyticsHelper5 = this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(error, 'Error while returning ADF version of current draft document');
|
|
201
206
|
throw new GetCurrentStateError('Error while returning the current state of the draft document', error); // Reject the promise so the consumer can react to it failing
|
|
202
207
|
}
|
|
203
208
|
});
|
|
@@ -210,8 +215,8 @@ export class Provider extends Emitter {
|
|
|
210
215
|
try {
|
|
211
216
|
return await this.documentService.getFinalAcknowledgedState();
|
|
212
217
|
} catch (error) {
|
|
213
|
-
var _this$
|
|
214
|
-
(_this$
|
|
218
|
+
var _this$analyticsHelper6;
|
|
219
|
+
(_this$analyticsHelper6 = this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(error, 'Error while returning ADF version of the final draft document');
|
|
215
220
|
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', error); // Reject the promise so the consumer can react to it failing
|
|
216
221
|
}
|
|
217
222
|
});
|
|
@@ -282,6 +287,13 @@ export class Provider extends Emitter {
|
|
|
282
287
|
if (!getState && this.initialDraft) {
|
|
283
288
|
this.isPreinitializing = true;
|
|
284
289
|
}
|
|
290
|
+
if (this.initialDraft) {
|
|
291
|
+
var _this$analyticsHelper7;
|
|
292
|
+
(_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendActionEvent(EVENT_ACTION.PROVIDER_SETUP, EVENT_STATUS.INFO, {
|
|
293
|
+
isPreinitializing: this.isPreinitializing,
|
|
294
|
+
hasState: Boolean(getState)
|
|
295
|
+
});
|
|
296
|
+
}
|
|
285
297
|
if (getState) {
|
|
286
298
|
const collabPlugin = getState().plugins.find(p => p.key === 'collab$');
|
|
287
299
|
if (collabPlugin === undefined) {
|
|
@@ -299,6 +311,7 @@ export class Provider extends Emitter {
|
|
|
299
311
|
if (this.isPreinitializing) {
|
|
300
312
|
this.resolveOnSetupPromise();
|
|
301
313
|
if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
|
|
314
|
+
var _this$analyticsHelper8;
|
|
302
315
|
const {
|
|
303
316
|
document,
|
|
304
317
|
version,
|
|
@@ -309,6 +322,10 @@ export class Provider extends Emitter {
|
|
|
309
322
|
version,
|
|
310
323
|
metadata
|
|
311
324
|
});
|
|
325
|
+
(_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendActionEvent(EVENT_ACTION.PROVIDER_INITIALIZED, EVENT_STATUS.INFO, {
|
|
326
|
+
isPreinitializing: this.isPreinitializing,
|
|
327
|
+
isBuffered: true
|
|
328
|
+
});
|
|
312
329
|
}
|
|
313
330
|
}
|
|
314
331
|
}
|
|
@@ -317,8 +334,8 @@ export class Provider extends Emitter {
|
|
|
317
334
|
this.isChannelInitialized = true;
|
|
318
335
|
}
|
|
319
336
|
} catch (initError) {
|
|
320
|
-
var _this$
|
|
321
|
-
(_this$
|
|
337
|
+
var _this$analyticsHelper9;
|
|
338
|
+
(_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(initError, 'Error while initialising the provider');
|
|
322
339
|
// Throw error so consumers are aware the initialisation failed when initialising themselves
|
|
323
340
|
throw new ProviderInitialisationError('Provider initialisation error', initError);
|
|
324
341
|
}
|
|
@@ -326,9 +343,9 @@ export class Provider extends Emitter {
|
|
|
326
343
|
}
|
|
327
344
|
checkForCookies() {
|
|
328
345
|
if (!global.navigator.cookieEnabled) {
|
|
329
|
-
var _this$
|
|
346
|
+
var _this$analyticsHelper10;
|
|
330
347
|
const initError = new ProviderInitialisationError('Cookies are not enabled. Please enable cookies to use collaborative editing.');
|
|
331
|
-
(_this$
|
|
348
|
+
(_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
|
|
332
349
|
throw new ProviderInitialisationError('Provider initialisation error - cookies disabled', initError);
|
|
333
350
|
}
|
|
334
351
|
}
|
|
@@ -362,8 +379,8 @@ export class Provider extends Emitter {
|
|
|
362
379
|
}
|
|
363
380
|
this.documentService.send(_tr, _oldState, newState);
|
|
364
381
|
} catch (error) {
|
|
365
|
-
var _this$
|
|
366
|
-
(_this$
|
|
382
|
+
var _this$analyticsHelper11;
|
|
383
|
+
(_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while sending steps for a transaction');
|
|
367
384
|
throw new SendTransactionError('Error while sending steps for a transaction', error);
|
|
368
385
|
}
|
|
369
386
|
}
|
|
@@ -388,9 +405,9 @@ export class Provider extends Emitter {
|
|
|
388
405
|
this.channel.broadcast('participant:telepointer', payload, callback);
|
|
389
406
|
}
|
|
390
407
|
} catch (error) {
|
|
391
|
-
var _this$
|
|
408
|
+
var _this$analyticsHelper12;
|
|
392
409
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
393
|
-
(_this$
|
|
410
|
+
(_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while sending message - telepointer');
|
|
394
411
|
}
|
|
395
412
|
}
|
|
396
413
|
/**
|
|
@@ -422,8 +439,8 @@ export class Provider extends Emitter {
|
|
|
422
439
|
super.unsubscribeAll();
|
|
423
440
|
this.channel.disconnect();
|
|
424
441
|
} catch (error) {
|
|
425
|
-
var _this$
|
|
426
|
-
(_this$
|
|
442
|
+
var _this$analyticsHelper13;
|
|
443
|
+
(_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while shutting down the collab provider');
|
|
427
444
|
throw new DestroyError('Error while shutting down the collab provider', error);
|
|
428
445
|
}
|
|
429
446
|
this.clearTimers();
|
|
@@ -441,8 +458,8 @@ export class Provider extends Emitter {
|
|
|
441
458
|
try {
|
|
442
459
|
this.metadataService.setTitle(title, broadcast);
|
|
443
460
|
} catch (error) {
|
|
444
|
-
var _this$
|
|
445
|
-
(_this$
|
|
461
|
+
var _this$analyticsHelper14;
|
|
462
|
+
(_this$analyticsHelper14 = this.analyticsHelper) === null || _this$analyticsHelper14 === void 0 ? void 0 : _this$analyticsHelper14.sendErrorEvent(error, 'Error while setting title');
|
|
446
463
|
throw new SetTitleError('Error while setting title', error);
|
|
447
464
|
}
|
|
448
465
|
}
|
|
@@ -458,8 +475,8 @@ export class Provider extends Emitter {
|
|
|
458
475
|
try {
|
|
459
476
|
this.metadataService.setEditorWidth(editorWidth, broadcast);
|
|
460
477
|
} catch (error) {
|
|
461
|
-
var _this$
|
|
462
|
-
(_this$
|
|
478
|
+
var _this$analyticsHelper15;
|
|
479
|
+
(_this$analyticsHelper15 = this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 ? void 0 : _this$analyticsHelper15.sendErrorEvent(error, 'Error while setting editor width');
|
|
463
480
|
throw new SetEditorWidthError('Error while setting editor width', error);
|
|
464
481
|
}
|
|
465
482
|
}
|
|
@@ -473,8 +490,8 @@ export class Provider extends Emitter {
|
|
|
473
490
|
try {
|
|
474
491
|
this.metadataService.setMetadata(metadata);
|
|
475
492
|
} catch (error) {
|
|
476
|
-
var _this$
|
|
477
|
-
(_this$
|
|
493
|
+
var _this$analyticsHelper16;
|
|
494
|
+
(_this$analyticsHelper16 = this.analyticsHelper) === null || _this$analyticsHelper16 === void 0 ? void 0 : _this$analyticsHelper16.sendErrorEvent(error, 'Error while setting metadata');
|
|
478
495
|
throw new SetMetadataError('Error while setting metadata', error);
|
|
479
496
|
}
|
|
480
497
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -14,8 +14,10 @@ export var EVENT_ACTION = /*#__PURE__*/function (EVENT_ACTION) {
|
|
|
14
14
|
EVENT_ACTION["CATCHUP_AFTER_MAX_SEND_STEPS_RETRY"] = "catchupAfterMaxSendStepsRetry";
|
|
15
15
|
EVENT_ACTION["DROPPED_STEPS"] = "droppedStepInCatchup";
|
|
16
16
|
EVENT_ACTION["WEBSOCKET_MESSAGE_VOLUME_METRIC"] = "websocketMessageVolumeMetric";
|
|
17
|
+
EVENT_ACTION["PROVIDER_INITIALIZED"] = "providerInitialized";
|
|
18
|
+
EVENT_ACTION["PROVIDER_SETUP"] = "providerSetup";
|
|
17
19
|
return EVENT_ACTION;
|
|
18
|
-
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/
|
|
20
|
+
}({}); // https://data-portal.internal.atlassian.com/analytics/registry/54715
|
|
19
21
|
export var EVENT_STATUS = /*#__PURE__*/function (EVENT_STATUS) {
|
|
20
22
|
EVENT_STATUS["SUCCESS"] = "SUCCESS";
|
|
21
23
|
EVENT_STATUS["FAILURE"] = "FAILURE";
|
|
@@ -21,6 +21,7 @@ import { DocumentService } from '../document/document-service';
|
|
|
21
21
|
import { NamespaceService } from '../namespace/namespace-service';
|
|
22
22
|
import { ParticipantsService } from '../participants/participants-service';
|
|
23
23
|
import { errorCodeMapper } from '../errors/error-code-mapper';
|
|
24
|
+
import { EVENT_ACTION, EVENT_STATUS } from '../helpers/const';
|
|
24
25
|
var logger = createLogger('Provider', 'black');
|
|
25
26
|
var OUT_OF_SYNC_PERIOD = 3 * 1000; // 3 seconds
|
|
26
27
|
var PRELOAD_DRAFT_SYNC_PERIOD = 15 * 1000; // 15 seconds
|
|
@@ -112,6 +113,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
112
113
|
}
|
|
113
114
|
// If the initial draft is already up to date, update the document with that of the initial draft
|
|
114
115
|
else {
|
|
116
|
+
var _this$analyticsHelper2;
|
|
115
117
|
var _this$initialDraft = _this.initialDraft,
|
|
116
118
|
document = _this$initialDraft.document,
|
|
117
119
|
version = _this$initialDraft.version,
|
|
@@ -133,6 +135,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
133
135
|
metadata: metadata
|
|
134
136
|
});
|
|
135
137
|
}
|
|
138
|
+
(_this$analyticsHelper2 = _this.analyticsHelper) === null || _this$analyticsHelper2 === void 0 ? void 0 : _this$analyticsHelper2.sendActionEvent(EVENT_ACTION.PROVIDER_INITIALIZED, EVENT_STATUS.INFO, {
|
|
139
|
+
isPreinitializing: _this.isPreinitializing
|
|
140
|
+
});
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
// If already initialized, `connected` means reconnected
|
|
@@ -178,13 +183,13 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
178
183
|
if (((_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.code) === NCS_ERROR_CODE.HEAD_VERSION_UPDATE_FAILED || ((_error$data2 = error.data) === null || _error$data2 === void 0 ? void 0 : _error$data2.code) === NCS_ERROR_CODE.VERSION_NUMBER_ALREADY_EXISTS) {
|
|
179
184
|
_this.documentService.onStepRejectedError();
|
|
180
185
|
} else {
|
|
181
|
-
var _this$
|
|
182
|
-
(_this$
|
|
186
|
+
var _this$analyticsHelper3;
|
|
187
|
+
(_this$analyticsHelper3 = _this.analyticsHelper) === null || _this$analyticsHelper3 === void 0 ? void 0 : _this$analyticsHelper3.sendErrorEvent(error, 'Error handled');
|
|
183
188
|
var mappedError = errorCodeMapper(error);
|
|
184
189
|
// Temporarily only emit errors to Confluence very intentionally because they will disconnect the collab provider
|
|
185
190
|
if (mappedError) {
|
|
186
|
-
var _this$
|
|
187
|
-
(_this$
|
|
191
|
+
var _this$analyticsHelper4;
|
|
192
|
+
(_this$analyticsHelper4 = _this.analyticsHelper) === null || _this$analyticsHelper4 === void 0 ? void 0 : _this$analyticsHelper4.sendErrorEvent(mappedError, 'Error emitted');
|
|
188
193
|
_this.emitCallback('error', mappedError);
|
|
189
194
|
}
|
|
190
195
|
}
|
|
@@ -207,7 +212,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
207
212
|
* @throws {GetCurrentStateError} Something went wrong while returning the current state
|
|
208
213
|
*/
|
|
209
214
|
_defineProperty(_assertThisInitialized(_this), "getCurrentState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
210
|
-
var _this$
|
|
215
|
+
var _this$analyticsHelper5;
|
|
211
216
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
212
217
|
while (1) switch (_context.prev = _context.next) {
|
|
213
218
|
case 0:
|
|
@@ -219,7 +224,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
219
224
|
case 6:
|
|
220
225
|
_context.prev = 6;
|
|
221
226
|
_context.t0 = _context["catch"](0);
|
|
222
|
-
(_this$
|
|
227
|
+
(_this$analyticsHelper5 = _this.analyticsHelper) === null || _this$analyticsHelper5 === void 0 ? void 0 : _this$analyticsHelper5.sendErrorEvent(_context.t0, 'Error while returning ADF version of current draft document');
|
|
223
228
|
throw new GetCurrentStateError('Error while returning the current state of the draft document', _context.t0);
|
|
224
229
|
case 10:
|
|
225
230
|
case "end":
|
|
@@ -233,7 +238,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
233
238
|
* @throws {GetFinalAcknowledgedStateError} Something went wrong while returning the acknowledged state
|
|
234
239
|
*/
|
|
235
240
|
_defineProperty(_assertThisInitialized(_this), "getFinalAcknowledgedState", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
236
|
-
var _this$
|
|
241
|
+
var _this$analyticsHelper6;
|
|
237
242
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
238
243
|
while (1) switch (_context2.prev = _context2.next) {
|
|
239
244
|
case 0:
|
|
@@ -245,7 +250,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
245
250
|
case 6:
|
|
246
251
|
_context2.prev = 6;
|
|
247
252
|
_context2.t0 = _context2["catch"](0);
|
|
248
|
-
(_this$
|
|
253
|
+
(_this$analyticsHelper6 = _this.analyticsHelper) === null || _this$analyticsHelper6 === void 0 ? void 0 : _this$analyticsHelper6.sendErrorEvent(_context2.t0, 'Error while returning ADF version of the final draft document');
|
|
249
254
|
throw new GetFinalAcknowledgedStateError('Error while returning the final acknowledged state of the draft document', _context2.t0);
|
|
250
255
|
case 10:
|
|
251
256
|
case "end":
|
|
@@ -327,6 +332,13 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
327
332
|
if (!getState && this.initialDraft) {
|
|
328
333
|
this.isPreinitializing = true;
|
|
329
334
|
}
|
|
335
|
+
if (this.initialDraft) {
|
|
336
|
+
var _this$analyticsHelper7;
|
|
337
|
+
(_this$analyticsHelper7 = this.analyticsHelper) === null || _this$analyticsHelper7 === void 0 ? void 0 : _this$analyticsHelper7.sendActionEvent(EVENT_ACTION.PROVIDER_SETUP, EVENT_STATUS.INFO, {
|
|
338
|
+
isPreinitializing: this.isPreinitializing,
|
|
339
|
+
hasState: Boolean(getState)
|
|
340
|
+
});
|
|
341
|
+
}
|
|
330
342
|
if (getState) {
|
|
331
343
|
var collabPlugin = getState().plugins.find(function (p) {
|
|
332
344
|
return p.key === 'collab$';
|
|
@@ -346,6 +358,7 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
346
358
|
if (this.isPreinitializing) {
|
|
347
359
|
this.resolveOnSetupPromise();
|
|
348
360
|
if (this.isBufferingEnabled && this.initialDraft && !this.isProviderInitialized) {
|
|
361
|
+
var _this$analyticsHelper8;
|
|
349
362
|
var _this$initialDraft2 = this.initialDraft,
|
|
350
363
|
document = _this$initialDraft2.document,
|
|
351
364
|
version = _this$initialDraft2.version,
|
|
@@ -355,6 +368,10 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
355
368
|
version: version,
|
|
356
369
|
metadata: metadata
|
|
357
370
|
});
|
|
371
|
+
(_this$analyticsHelper8 = this.analyticsHelper) === null || _this$analyticsHelper8 === void 0 ? void 0 : _this$analyticsHelper8.sendActionEvent(EVENT_ACTION.PROVIDER_INITIALIZED, EVENT_STATUS.INFO, {
|
|
372
|
+
isPreinitializing: this.isPreinitializing,
|
|
373
|
+
isBuffered: true
|
|
374
|
+
});
|
|
358
375
|
}
|
|
359
376
|
}
|
|
360
377
|
}
|
|
@@ -363,8 +380,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
363
380
|
this.isChannelInitialized = true;
|
|
364
381
|
}
|
|
365
382
|
} catch (initError) {
|
|
366
|
-
var _this$
|
|
367
|
-
(_this$
|
|
383
|
+
var _this$analyticsHelper9;
|
|
384
|
+
(_this$analyticsHelper9 = this.analyticsHelper) === null || _this$analyticsHelper9 === void 0 ? void 0 : _this$analyticsHelper9.sendErrorEvent(initError, 'Error while initialising the provider');
|
|
368
385
|
// Throw error so consumers are aware the initialisation failed when initialising themselves
|
|
369
386
|
throw new ProviderInitialisationError('Provider initialisation error', initError);
|
|
370
387
|
}
|
|
@@ -374,9 +391,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
374
391
|
key: "checkForCookies",
|
|
375
392
|
value: function checkForCookies() {
|
|
376
393
|
if (!global.navigator.cookieEnabled) {
|
|
377
|
-
var _this$
|
|
394
|
+
var _this$analyticsHelper10;
|
|
378
395
|
var initError = new ProviderInitialisationError('Cookies are not enabled. Please enable cookies to use collaborative editing.');
|
|
379
|
-
(_this$
|
|
396
|
+
(_this$analyticsHelper10 = this.analyticsHelper) === null || _this$analyticsHelper10 === void 0 ? void 0 : _this$analyticsHelper10.sendErrorEvent(initError, 'Error while initialising the provider - cookies disabled');
|
|
380
397
|
throw new ProviderInitialisationError('Provider initialisation error - cookies disabled', initError);
|
|
381
398
|
}
|
|
382
399
|
}
|
|
@@ -414,8 +431,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
414
431
|
}
|
|
415
432
|
this.documentService.send(_tr, _oldState, newState);
|
|
416
433
|
} catch (error) {
|
|
417
|
-
var _this$
|
|
418
|
-
(_this$
|
|
434
|
+
var _this$analyticsHelper11;
|
|
435
|
+
(_this$analyticsHelper11 = this.analyticsHelper) === null || _this$analyticsHelper11 === void 0 ? void 0 : _this$analyticsHelper11.sendErrorEvent(error, 'Error while sending steps for a transaction');
|
|
419
436
|
throw new SendTransactionError('Error while sending steps for a transaction', error);
|
|
420
437
|
}
|
|
421
438
|
}
|
|
@@ -443,9 +460,9 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
443
460
|
this.channel.broadcast('participant:telepointer', payload, callback);
|
|
444
461
|
}
|
|
445
462
|
} catch (error) {
|
|
446
|
-
var _this$
|
|
463
|
+
var _this$analyticsHelper12;
|
|
447
464
|
// We don't want to throw errors for Presence features as they tend to self-restore
|
|
448
|
-
(_this$
|
|
465
|
+
(_this$analyticsHelper12 = this.analyticsHelper) === null || _this$analyticsHelper12 === void 0 ? void 0 : _this$analyticsHelper12.sendErrorEvent(error, 'Error while sending message - telepointer');
|
|
449
466
|
}
|
|
450
467
|
}
|
|
451
468
|
}, {
|
|
@@ -484,8 +501,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
484
501
|
_get(_getPrototypeOf(Provider.prototype), "unsubscribeAll", this).call(this);
|
|
485
502
|
this.channel.disconnect();
|
|
486
503
|
} catch (error) {
|
|
487
|
-
var _this$
|
|
488
|
-
(_this$
|
|
504
|
+
var _this$analyticsHelper13;
|
|
505
|
+
(_this$analyticsHelper13 = this.analyticsHelper) === null || _this$analyticsHelper13 === void 0 ? void 0 : _this$analyticsHelper13.sendErrorEvent(error, 'Error while shutting down the collab provider');
|
|
489
506
|
throw new DestroyError('Error while shutting down the collab provider', error);
|
|
490
507
|
}
|
|
491
508
|
this.clearTimers();
|
|
@@ -505,8 +522,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
505
522
|
try {
|
|
506
523
|
this.metadataService.setTitle(title, broadcast);
|
|
507
524
|
} catch (error) {
|
|
508
|
-
var _this$
|
|
509
|
-
(_this$
|
|
525
|
+
var _this$analyticsHelper14;
|
|
526
|
+
(_this$analyticsHelper14 = this.analyticsHelper) === null || _this$analyticsHelper14 === void 0 ? void 0 : _this$analyticsHelper14.sendErrorEvent(error, 'Error while setting title');
|
|
510
527
|
throw new SetTitleError('Error while setting title', error);
|
|
511
528
|
}
|
|
512
529
|
}
|
|
@@ -524,8 +541,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
524
541
|
try {
|
|
525
542
|
this.metadataService.setEditorWidth(editorWidth, broadcast);
|
|
526
543
|
} catch (error) {
|
|
527
|
-
var _this$
|
|
528
|
-
(_this$
|
|
544
|
+
var _this$analyticsHelper15;
|
|
545
|
+
(_this$analyticsHelper15 = this.analyticsHelper) === null || _this$analyticsHelper15 === void 0 ? void 0 : _this$analyticsHelper15.sendErrorEvent(error, 'Error while setting editor width');
|
|
529
546
|
throw new SetEditorWidthError('Error while setting editor width', error);
|
|
530
547
|
}
|
|
531
548
|
}
|
|
@@ -541,8 +558,8 @@ export var Provider = /*#__PURE__*/function (_Emitter) {
|
|
|
541
558
|
try {
|
|
542
559
|
this.metadataService.setMetadata(metadata);
|
|
543
560
|
} catch (error) {
|
|
544
|
-
var _this$
|
|
545
|
-
(_this$
|
|
561
|
+
var _this$analyticsHelper16;
|
|
562
|
+
(_this$analyticsHelper16 = this.analyticsHelper) === null || _this$analyticsHelper16 === void 0 ? void 0 : _this$analyticsHelper16.sendErrorEvent(error, 'Error while setting metadata');
|
|
546
563
|
throw new SetMetadataError('Error while setting metadata', error);
|
|
547
564
|
}
|
|
548
565
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -14,7 +14,9 @@ export declare enum EVENT_ACTION {
|
|
|
14
14
|
SEND_STEPS_RETRY = "sendStepsRetry",
|
|
15
15
|
CATCHUP_AFTER_MAX_SEND_STEPS_RETRY = "catchupAfterMaxSendStepsRetry",
|
|
16
16
|
DROPPED_STEPS = "droppedStepInCatchup",
|
|
17
|
-
WEBSOCKET_MESSAGE_VOLUME_METRIC = "websocketMessageVolumeMetric"
|
|
17
|
+
WEBSOCKET_MESSAGE_VOLUME_METRIC = "websocketMessageVolumeMetric",
|
|
18
|
+
PROVIDER_INITIALIZED = "providerInitialized",
|
|
19
|
+
PROVIDER_SETUP = "providerSetup"
|
|
18
20
|
}
|
|
19
21
|
export declare enum EVENT_STATUS {
|
|
20
22
|
SUCCESS = "SUCCESS",
|
|
@@ -225,7 +227,25 @@ type WebsocketMessageVolumeMetricEvent = {
|
|
|
225
227
|
messageSize: number;
|
|
226
228
|
};
|
|
227
229
|
};
|
|
228
|
-
|
|
230
|
+
type ProviderInitializedAnalyticsEvent = {
|
|
231
|
+
eventAction: EVENT_ACTION.PROVIDER_INITIALIZED;
|
|
232
|
+
attributes: {
|
|
233
|
+
documentAri?: string;
|
|
234
|
+
eventStatus: EVENT_STATUS.INFO;
|
|
235
|
+
isPreinitializing: boolean;
|
|
236
|
+
isBuffered?: boolean;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
type ProviderSetupAnalyticsEvent = {
|
|
240
|
+
eventAction: EVENT_ACTION.PROVIDER_SETUP;
|
|
241
|
+
attributes: {
|
|
242
|
+
documentAri?: string;
|
|
243
|
+
eventStatus: EVENT_STATUS.INFO;
|
|
244
|
+
isPreinitializing: boolean;
|
|
245
|
+
hasState: boolean;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent;
|
|
229
249
|
export declare const ACK_MAX_TRY = 60;
|
|
230
250
|
export declare const CONFLUENCE = "confluence";
|
|
231
251
|
export {};
|
|
@@ -14,7 +14,9 @@ export declare enum EVENT_ACTION {
|
|
|
14
14
|
SEND_STEPS_RETRY = "sendStepsRetry",
|
|
15
15
|
CATCHUP_AFTER_MAX_SEND_STEPS_RETRY = "catchupAfterMaxSendStepsRetry",
|
|
16
16
|
DROPPED_STEPS = "droppedStepInCatchup",
|
|
17
|
-
WEBSOCKET_MESSAGE_VOLUME_METRIC = "websocketMessageVolumeMetric"
|
|
17
|
+
WEBSOCKET_MESSAGE_VOLUME_METRIC = "websocketMessageVolumeMetric",
|
|
18
|
+
PROVIDER_INITIALIZED = "providerInitialized",
|
|
19
|
+
PROVIDER_SETUP = "providerSetup"
|
|
18
20
|
}
|
|
19
21
|
export declare enum EVENT_STATUS {
|
|
20
22
|
SUCCESS = "SUCCESS",
|
|
@@ -225,7 +227,25 @@ type WebsocketMessageVolumeMetricEvent = {
|
|
|
225
227
|
messageSize: number;
|
|
226
228
|
};
|
|
227
229
|
};
|
|
228
|
-
|
|
230
|
+
type ProviderInitializedAnalyticsEvent = {
|
|
231
|
+
eventAction: EVENT_ACTION.PROVIDER_INITIALIZED;
|
|
232
|
+
attributes: {
|
|
233
|
+
documentAri?: string;
|
|
234
|
+
eventStatus: EVENT_STATUS.INFO;
|
|
235
|
+
isPreinitializing: boolean;
|
|
236
|
+
isBuffered?: boolean;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
type ProviderSetupAnalyticsEvent = {
|
|
240
|
+
eventAction: EVENT_ACTION.PROVIDER_SETUP;
|
|
241
|
+
attributes: {
|
|
242
|
+
documentAri?: string;
|
|
243
|
+
eventStatus: EVENT_STATUS.INFO;
|
|
244
|
+
isPreinitializing: boolean;
|
|
245
|
+
hasState: boolean;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
export type ActionAnalyticsEvent = AddStepsSuccessAnalyticsEvent | AddStepsFailureAnalyticsEvent | ReInitDocFailAnalyticsEvent | ReInitDocSuccessAnalyticsEvent | ConnectionSuccessAnalyticsEvent | ConnectionFailureAnalyticsEvent | CatchUpSuccessAnalyticsEvent | CatchUpFailureAnalyticsEvent | DocumentInitSuccessAnalyticsEvent | UpdateParticipantsSuccessAnalyticsEvent | CommitUnconfirmedStepsSuccessAnalyticsEvent | CommitUnconfirmedStepsFailureAnalyticsEvent | PublishPageSuccessAnalyticsEvent | PublishPageFailureAnalyticsEvent | GetCurrentStateSuccessAnalyticsEvent | GetCurrentStateFailureAnalyticsEvent | InvalidateTokenAnalyticsEvent | SendStepsRetryAnalyticsEvent | CatchupAfterMaxSendStepsRetryAnalyticsEvent | CatchUpDroppedStepsEvent | WebsocketMessageVolumeMetricEvent | ProviderInitializedAnalyticsEvent | ProviderSetupAnalyticsEvent;
|
|
229
249
|
export declare const ACK_MAX_TRY = 60;
|
|
230
250
|
export declare const CONFLUENCE = "confluence";
|
|
231
251
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/collab-provider",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.0",
|
|
4
4
|
"description": "A provider for collaborative editing.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
38
38
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
39
|
-
"@atlaskit/editor-common": "^74.
|
|
39
|
+
"@atlaskit/editor-common": "^74.44.0",
|
|
40
40
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
41
|
-
"@atlaskit/editor-prosemirror": "1.0
|
|
41
|
+
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
42
42
|
"@atlaskit/prosemirror-collab": "^0.2.0",
|
|
43
43
|
"@atlaskit/ufo": "^0.2.0",
|
|
44
44
|
"@atlaskit/util-service-support": "^6.2.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@atlaskit/adf-schema": "^
|
|
65
|
+
"@atlaskit/adf-schema": "^28.1.0",
|
|
66
66
|
"@atlaskit/analytics-listeners": "^8.7.0",
|
|
67
67
|
"@atlaskit/editor-test-helpers": "^18.10.0",
|
|
68
68
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|