@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
package/dist/esm/api/api.js
CHANGED
|
@@ -40,8 +40,8 @@ export var Api = /*#__PURE__*/function () {
|
|
|
40
40
|
_classCallCheck(this, Api);
|
|
41
41
|
_defineProperty(this, "submitComment", /*#__PURE__*/function () {
|
|
42
42
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(steps, version) {
|
|
43
|
-
var reqBody, url, tracingHeaders, fetchOptions;
|
|
44
|
-
return _regeneratorRuntime.wrap(function
|
|
43
|
+
var reqBody, url, tracingHeaders, fetchOptions, _t, _t2, _t3, _t4, _t5, _t6, _t7;
|
|
44
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
45
45
|
while (1) switch (_context.prev = _context.next) {
|
|
46
46
|
case 0:
|
|
47
47
|
reqBody = JSON.stringify({
|
|
@@ -52,47 +52,42 @@ export var Api = /*#__PURE__*/function () {
|
|
|
52
52
|
url = "".concat(_this2.config.url, "/document/").concat(encodeURIComponent(_this2.config.documentAri), "/comment");
|
|
53
53
|
logger("Request url: ", url);
|
|
54
54
|
tracingHeaders = getActiveTraceHttpRequestHeaders(url);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
_t = _objectSpread;
|
|
56
|
+
_t2 = _objectSpread;
|
|
57
|
+
_t3 = {};
|
|
58
58
|
if (!_this2.config.permissionTokenRefresh) {
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 2;
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
|
-
_context.next =
|
|
62
|
+
_context.next = 1;
|
|
63
63
|
return _this2.channel.getChannelToken();
|
|
64
|
-
case
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'x-token':
|
|
64
|
+
case 1:
|
|
65
|
+
_t5 = _context.sent;
|
|
66
|
+
_t4 = {
|
|
67
|
+
'x-token': _t5
|
|
68
68
|
};
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 3;
|
|
70
70
|
break;
|
|
71
|
-
case
|
|
72
|
-
|
|
73
|
-
case
|
|
74
|
-
|
|
75
|
-
_context.t6 = (0, _context.t1)(_context.t2, _context.t5);
|
|
76
|
-
_context.t7 = {};
|
|
77
|
-
_context.t8 = {
|
|
71
|
+
case 2:
|
|
72
|
+
_t4 = {};
|
|
73
|
+
case 3:
|
|
74
|
+
_t6 = _t(_t2(_t3, _t4), {}, {
|
|
78
75
|
'x-product': getProduct(_this2.config.productInfo),
|
|
79
76
|
'x-subproduct': getSubProduct(_this2.config.productInfo),
|
|
80
77
|
'Content-Type': 'application/json'
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
_context.t10 = (0, _context.t0)(_context.t6, _context.t7, _context.t8, _context.t9);
|
|
84
|
-
_context.t11 = reqBody;
|
|
78
|
+
}, tracingHeaders);
|
|
79
|
+
_t7 = reqBody;
|
|
85
80
|
fetchOptions = {
|
|
86
81
|
credentials: 'include',
|
|
87
|
-
headers:
|
|
82
|
+
headers: _t6,
|
|
88
83
|
method: 'POST',
|
|
89
|
-
body:
|
|
84
|
+
body: _t7
|
|
90
85
|
};
|
|
91
|
-
_context.next =
|
|
86
|
+
_context.next = 4;
|
|
92
87
|
return fetch(url, fetchOptions);
|
|
93
|
-
case
|
|
88
|
+
case 4:
|
|
94
89
|
return _context.abrupt("return", _context.sent);
|
|
95
|
-
case
|
|
90
|
+
case 5:
|
|
96
91
|
case "end":
|
|
97
92
|
return _context.stop();
|
|
98
93
|
}
|
|
@@ -110,56 +105,56 @@ export var Api = /*#__PURE__*/function () {
|
|
|
110
105
|
key: "addComment",
|
|
111
106
|
value: function () {
|
|
112
107
|
var _addComment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(steps) {
|
|
113
|
-
var stepVersion, response, status, _yield$response$json, message, meta;
|
|
114
|
-
return _regeneratorRuntime.wrap(function
|
|
108
|
+
var stepVersion, response, status, _yield$response$json, message, meta, _t8;
|
|
109
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
115
110
|
while (1) switch (_context2.prev = _context2.next) {
|
|
116
111
|
case 0:
|
|
117
112
|
stepVersion = this.documentService.getCurrentPmVersion();
|
|
118
113
|
_context2.prev = 1;
|
|
119
|
-
_context2.next =
|
|
114
|
+
_context2.next = 2;
|
|
120
115
|
return this.submitComment(steps, stepVersion);
|
|
121
|
-
case
|
|
116
|
+
case 2:
|
|
122
117
|
response = _context2.sent;
|
|
123
118
|
status = response.status;
|
|
124
|
-
_context2.next =
|
|
119
|
+
_context2.next = 3;
|
|
125
120
|
return response.json();
|
|
126
|
-
case
|
|
121
|
+
case 3:
|
|
127
122
|
_yield$response$json = _context2.sent;
|
|
128
123
|
message = _yield$response$json.message;
|
|
129
124
|
meta = _yield$response$json.meta;
|
|
130
125
|
if (!(status === 201)) {
|
|
131
|
-
_context2.next =
|
|
126
|
+
_context2.next = 4;
|
|
132
127
|
break;
|
|
133
128
|
}
|
|
134
129
|
logger("NCS response: ".concat(message));
|
|
135
130
|
return _context2.abrupt("return", {
|
|
136
131
|
message: message
|
|
137
132
|
});
|
|
138
|
-
case
|
|
133
|
+
case 4:
|
|
139
134
|
if (!(status >= 400 && status <= 499)) {
|
|
140
|
-
_context2.next =
|
|
135
|
+
_context2.next = 5;
|
|
141
136
|
break;
|
|
142
137
|
}
|
|
143
138
|
logger("NCS error meta: ".concat(JSON.stringify(meta)));
|
|
144
139
|
// Include details in error response
|
|
145
140
|
throw new AddCommentError("Failed to add comment - Client error: ".concat(message), status, JSON.stringify(meta));
|
|
146
|
-
case
|
|
141
|
+
case 5:
|
|
147
142
|
throw new AddCommentError("Failed to add comment - Server error", status);
|
|
148
|
-
case
|
|
149
|
-
_context2.prev =
|
|
150
|
-
|
|
151
|
-
if (!(
|
|
152
|
-
_context2.next =
|
|
143
|
+
case 6:
|
|
144
|
+
_context2.prev = 6;
|
|
145
|
+
_t8 = _context2["catch"](1);
|
|
146
|
+
if (!(_t8 instanceof AddCommentError)) {
|
|
147
|
+
_context2.next = 7;
|
|
153
148
|
break;
|
|
154
149
|
}
|
|
155
|
-
throw
|
|
156
|
-
case
|
|
157
|
-
throw new Error("Error submitting comment: ".concat(
|
|
158
|
-
case
|
|
150
|
+
throw _t8;
|
|
151
|
+
case 7:
|
|
152
|
+
throw new Error("Error submitting comment: ".concat(_t8));
|
|
153
|
+
case 8:
|
|
159
154
|
case "end":
|
|
160
155
|
return _context2.stop();
|
|
161
156
|
}
|
|
162
|
-
}, _callee2, this, [[1,
|
|
157
|
+
}, _callee2, this, [[1, 6]]);
|
|
163
158
|
}));
|
|
164
159
|
function addComment(_x3) {
|
|
165
160
|
return _addComment.apply(this, arguments);
|
package/dist/esm/api/null-api.js
CHANGED
|
@@ -13,7 +13,7 @@ export var NullApi = /*#__PURE__*/function () {
|
|
|
13
13
|
// eslint-disable-next-line require-await
|
|
14
14
|
function () {
|
|
15
15
|
var _addComment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
16
|
-
return _regeneratorRuntime.wrap(function
|
|
16
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
19
|
return _context.abrupt("return");
|