@atlaskit/collab-provider 19.0.4 → 19.0.6

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/collab-provider
2
2
 
3
+ ## 19.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 19.0.4
4
16
 
5
17
  ### Patch Changes
@@ -142,30 +142,31 @@ var AnalyticsHelper = exports.default = /*#__PURE__*/function () {
142
142
  key: "sendEvent",
143
143
  value: function () {
144
144
  var _sendEvent = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
145
- return _regenerator.default.wrap(function _callee$(_context) {
145
+ var _t;
146
+ return _regenerator.default.wrap(function (_context) {
146
147
  while (1) switch (_context.prev = _context.next) {
147
148
  case 0:
148
149
  if (!(this.getAnalyticsClient && !this.analyticsClient)) {
149
- _context.next = 9;
150
+ _context.next = 4;
150
151
  break;
151
152
  }
152
153
  _context.prev = 1;
153
- _context.next = 4;
154
+ _context.next = 2;
154
155
  return this.getAnalyticsClient;
155
- case 4:
156
+ case 2:
156
157
  this.analyticsClient = _context.sent;
157
- _context.next = 9;
158
+ _context.next = 4;
158
159
  break;
159
- case 7:
160
- _context.prev = 7;
161
- _context.t0 = _context["catch"](1);
162
- case 9:
160
+ case 3:
161
+ _context.prev = 3;
162
+ _t = _context["catch"](1);
163
+ case 4:
163
164
  triggerAnalyticsEvent(event, this.analyticsClient);
164
- case 10:
165
+ case 5:
165
166
  case "end":
166
167
  return _context.stop();
167
168
  }
168
- }, _callee, this, [[1, 7]]);
169
+ }, _callee, this, [[1, 3]]);
169
170
  }));
170
171
  function sendEvent(_x) {
171
172
  return _sendEvent.apply(this, arguments);
@@ -47,8 +47,8 @@ var Api = exports.Api = /*#__PURE__*/function () {
47
47
  (0, _classCallCheck2.default)(this, Api);
48
48
  (0, _defineProperty2.default)(this, "submitComment", /*#__PURE__*/function () {
49
49
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(steps, version) {
50
- var reqBody, url, tracingHeaders, fetchOptions;
51
- return _regenerator.default.wrap(function _callee$(_context) {
50
+ var reqBody, url, tracingHeaders, fetchOptions, _t, _t2, _t3, _t4, _t5, _t6, _t7;
51
+ return _regenerator.default.wrap(function (_context) {
52
52
  while (1) switch (_context.prev = _context.next) {
53
53
  case 0:
54
54
  reqBody = JSON.stringify({
@@ -59,47 +59,42 @@ var Api = exports.Api = /*#__PURE__*/function () {
59
59
  url = "".concat(_this2.config.url, "/document/").concat(encodeURIComponent(_this2.config.documentAri), "/comment");
60
60
  logger("Request url: ", url);
61
61
  tracingHeaders = (0, _experienceTraceIdContext.getActiveTraceHttpRequestHeaders)(url);
62
- _context.t0 = _objectSpread;
63
- _context.t1 = _objectSpread;
64
- _context.t2 = {};
62
+ _t = _objectSpread;
63
+ _t2 = _objectSpread;
64
+ _t3 = {};
65
65
  if (!_this2.config.permissionTokenRefresh) {
66
- _context.next = 14;
66
+ _context.next = 2;
67
67
  break;
68
68
  }
69
- _context.next = 10;
69
+ _context.next = 1;
70
70
  return _this2.channel.getChannelToken();
71
- case 10:
72
- _context.t4 = _context.sent;
73
- _context.t3 = {
74
- 'x-token': _context.t4
71
+ case 1:
72
+ _t5 = _context.sent;
73
+ _t4 = {
74
+ 'x-token': _t5
75
75
  };
76
- _context.next = 15;
76
+ _context.next = 3;
77
77
  break;
78
- case 14:
79
- _context.t3 = {};
80
- case 15:
81
- _context.t5 = _context.t3;
82
- _context.t6 = (0, _context.t1)(_context.t2, _context.t5);
83
- _context.t7 = {};
84
- _context.t8 = {
78
+ case 2:
79
+ _t4 = {};
80
+ case 3:
81
+ _t6 = _t(_t2(_t3, _t4), {}, {
85
82
  'x-product': (0, _utils.getProduct)(_this2.config.productInfo),
86
83
  'x-subproduct': (0, _utils.getSubProduct)(_this2.config.productInfo),
87
84
  'Content-Type': 'application/json'
88
- };
89
- _context.t9 = tracingHeaders;
90
- _context.t10 = (0, _context.t0)(_context.t6, _context.t7, _context.t8, _context.t9);
91
- _context.t11 = reqBody;
85
+ }, tracingHeaders);
86
+ _t7 = reqBody;
92
87
  fetchOptions = {
93
88
  credentials: 'include',
94
- headers: _context.t10,
89
+ headers: _t6,
95
90
  method: 'POST',
96
- body: _context.t11
91
+ body: _t7
97
92
  };
98
- _context.next = 25;
93
+ _context.next = 4;
99
94
  return fetch(url, fetchOptions);
100
- case 25:
95
+ case 4:
101
96
  return _context.abrupt("return", _context.sent);
102
- case 26:
97
+ case 5:
103
98
  case "end":
104
99
  return _context.stop();
105
100
  }
@@ -117,56 +112,56 @@ var Api = exports.Api = /*#__PURE__*/function () {
117
112
  key: "addComment",
118
113
  value: function () {
119
114
  var _addComment = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(steps) {
120
- var stepVersion, response, status, _yield$response$json, message, meta;
121
- return _regenerator.default.wrap(function _callee2$(_context2) {
115
+ var stepVersion, response, status, _yield$response$json, message, meta, _t8;
116
+ return _regenerator.default.wrap(function (_context2) {
122
117
  while (1) switch (_context2.prev = _context2.next) {
123
118
  case 0:
124
119
  stepVersion = this.documentService.getCurrentPmVersion();
125
120
  _context2.prev = 1;
126
- _context2.next = 4;
121
+ _context2.next = 2;
127
122
  return this.submitComment(steps, stepVersion);
128
- case 4:
123
+ case 2:
129
124
  response = _context2.sent;
130
125
  status = response.status;
131
- _context2.next = 8;
126
+ _context2.next = 3;
132
127
  return response.json();
133
- case 8:
128
+ case 3:
134
129
  _yield$response$json = _context2.sent;
135
130
  message = _yield$response$json.message;
136
131
  meta = _yield$response$json.meta;
137
132
  if (!(status === 201)) {
138
- _context2.next = 14;
133
+ _context2.next = 4;
139
134
  break;
140
135
  }
141
136
  logger("NCS response: ".concat(message));
142
137
  return _context2.abrupt("return", {
143
138
  message: message
144
139
  });
145
- case 14:
140
+ case 4:
146
141
  if (!(status >= 400 && status <= 499)) {
147
- _context2.next = 17;
142
+ _context2.next = 5;
148
143
  break;
149
144
  }
150
145
  logger("NCS error meta: ".concat(JSON.stringify(meta)));
151
146
  // Include details in error response
152
147
  throw new AddCommentError("Failed to add comment - Client error: ".concat(message), status, JSON.stringify(meta));
153
- case 17:
148
+ case 5:
154
149
  throw new AddCommentError("Failed to add comment - Server error", status);
155
- case 20:
156
- _context2.prev = 20;
157
- _context2.t0 = _context2["catch"](1);
158
- if (!(_context2.t0 instanceof AddCommentError)) {
159
- _context2.next = 26;
150
+ case 6:
151
+ _context2.prev = 6;
152
+ _t8 = _context2["catch"](1);
153
+ if (!(_t8 instanceof AddCommentError)) {
154
+ _context2.next = 7;
160
155
  break;
161
156
  }
162
- throw _context2.t0;
163
- case 26:
164
- throw new Error("Error submitting comment: ".concat(_context2.t0));
165
- case 27:
157
+ throw _t8;
158
+ case 7:
159
+ throw new Error("Error submitting comment: ".concat(_t8));
160
+ case 8:
166
161
  case "end":
167
162
  return _context2.stop();
168
163
  }
169
- }, _callee2, this, [[1, 20]]);
164
+ }, _callee2, this, [[1, 6]]);
170
165
  }));
171
166
  function addComment(_x3) {
172
167
  return _addComment.apply(this, arguments);
@@ -20,7 +20,7 @@ var NullApi = exports.NullApi = /*#__PURE__*/function () {
20
20
  // eslint-disable-next-line require-await
21
21
  function () {
22
22
  var _addComment = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
23
- return _regenerator.default.wrap(function _callee$(_context) {
23
+ return _regenerator.default.wrap(function (_context) {
24
24
  while (1) switch (_context.prev = _context.next) {
25
25
  case 0:
26
26
  return _context.abrupt("return");