@atlaskit/editor-synced-block-provider 3.14.1 → 3.14.3
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 +22 -0
- package/dist/cjs/clients/block-service/blockService.js +21 -16
- package/dist/cjs/hooks/useFetchSyncBlockData.js +3 -1
- package/dist/cjs/providers/block-service/blockServiceAPI.js +75 -36
- package/dist/cjs/providers/syncBlockProvider.js +10 -6
- package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +65 -26
- package/dist/cjs/store-manager/sourceSyncBlockStoreManager.js +68 -28
- package/dist/cjs/store-manager/syncBlockStoreManager.js +54 -23
- package/dist/cjs/utils/experienceTracking.js +18 -1
- package/dist/cjs/utils/resolveSyncBlockInstance.js +2 -1
- package/dist/es2019/clients/block-service/blockService.js +10 -3
- package/dist/es2019/hooks/useFetchSyncBlockData.js +3 -1
- package/dist/es2019/providers/block-service/blockServiceAPI.js +62 -23
- package/dist/es2019/providers/syncBlockProvider.js +8 -4
- package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +71 -36
- package/dist/es2019/store-manager/sourceSyncBlockStoreManager.js +55 -17
- package/dist/es2019/store-manager/syncBlockStoreManager.js +37 -3
- package/dist/es2019/utils/experienceTracking.js +17 -0
- package/dist/es2019/utils/resolveSyncBlockInstance.js +2 -1
- package/dist/esm/clients/block-service/blockService.js +21 -16
- package/dist/esm/hooks/useFetchSyncBlockData.js +3 -1
- package/dist/esm/providers/block-service/blockServiceAPI.js +75 -36
- package/dist/esm/providers/syncBlockProvider.js +10 -6
- package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +65 -26
- package/dist/esm/store-manager/sourceSyncBlockStoreManager.js +70 -30
- package/dist/esm/store-manager/syncBlockStoreManager.js +54 -23
- package/dist/esm/utils/experienceTracking.js +17 -0
- package/dist/esm/utils/resolveSyncBlockInstance.js +2 -1
- package/dist/types/clients/block-service/blockService.d.ts +7 -4
- package/dist/types/common/types.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/providers/block-service/blockServiceAPI.d.ts +6 -3
- package/dist/types/providers/syncBlockProvider.d.ts +2 -2
- package/dist/types/providers/types.d.ts +8 -4
- package/dist/types/store-manager/referenceSyncBlockStoreManager.d.ts +9 -0
- package/dist/types/store-manager/sourceSyncBlockStoreManager.d.ts +5 -3
- package/dist/types/store-manager/syncBlockStoreManager.d.ts +2 -0
- package/dist/types/utils/experienceTracking.d.ts +8 -0
- package/dist/types-ts4.5/clients/block-service/blockService.d.ts +7 -4
- package/dist/types-ts4.5/common/types.d.ts +4 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +6 -3
- package/dist/types-ts4.5/providers/syncBlockProvider.d.ts +2 -2
- package/dist/types-ts4.5/providers/types.d.ts +8 -4
- package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +9 -0
- package/dist/types-ts4.5/store-manager/sourceSyncBlockStoreManager.d.ts +5 -3
- package/dist/types-ts4.5/store-manager/syncBlockStoreManager.d.ts +2 -0
- package/dist/types-ts4.5/utils/experienceTracking.d.ts +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.14.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7702ea47c5329`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7702ea47c5329) -
|
|
8
|
+
[ux] Show editor flag when unpublished sync block is pasted
|
|
9
|
+
- [`2a9dfb4b326e6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2a9dfb4b326e6) -
|
|
10
|
+
EDITOR-4698 add missing analytics for fetch references, graphql subsciption update, reference sync
|
|
11
|
+
block insert and delete success
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 3.14.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`28434cbe03f1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28434cbe03f1e) -
|
|
19
|
+
[ux] [EDITOR-2851]
|
|
20
|
+
- Implement unsync feature for source sync block
|
|
21
|
+
- Update deletion confirmation modal and reference block UI after source deletion
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 3.14.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
15
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _retry = require("../../utils/retry");
|
|
17
18
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
18
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -225,24 +226,25 @@ var batchRetrieveSyncedBlocks = exports.batchRetrieveSyncedBlocks = /*#__PURE__*
|
|
|
225
226
|
}();
|
|
226
227
|
var deleteSyncedBlock = exports.deleteSyncedBlock = /*#__PURE__*/function () {
|
|
227
228
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref6) {
|
|
228
|
-
var blockAri, response;
|
|
229
|
+
var blockAri, deleteReason, url, response;
|
|
229
230
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
230
231
|
while (1) switch (_context4.prev = _context4.next) {
|
|
231
232
|
case 0:
|
|
232
|
-
blockAri = _ref6.blockAri;
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
blockAri = _ref6.blockAri, deleteReason = _ref6.deleteReason;
|
|
234
|
+
url = deleteReason && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? "".concat(BLOCK_SERVICE_API_URL, "/block/").concat(encodeURIComponent(blockAri), "?deletionReason=").concat(encodeURIComponent(deleteReason)) : "".concat(BLOCK_SERVICE_API_URL, "/block/").concat(encodeURIComponent(blockAri));
|
|
235
|
+
_context4.next = 4;
|
|
236
|
+
return (0, _retry.fetchWithRetry)(url, {
|
|
235
237
|
method: 'DELETE',
|
|
236
238
|
headers: COMMON_HEADERS
|
|
237
239
|
});
|
|
238
|
-
case
|
|
240
|
+
case 4:
|
|
239
241
|
response = _context4.sent;
|
|
240
242
|
if (response.ok) {
|
|
241
|
-
_context4.next =
|
|
243
|
+
_context4.next = 7;
|
|
242
244
|
break;
|
|
243
245
|
}
|
|
244
246
|
throw new BlockError(response.status);
|
|
245
|
-
case
|
|
247
|
+
case 7:
|
|
246
248
|
case "end":
|
|
247
249
|
return _context4.stop();
|
|
248
250
|
}
|
|
@@ -290,11 +292,11 @@ var updateSyncedBlock = exports.updateSyncedBlock = /*#__PURE__*/function () {
|
|
|
290
292
|
}();
|
|
291
293
|
var createSyncedBlock = exports.createSyncedBlock = /*#__PURE__*/function () {
|
|
292
294
|
var _ref1 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref0) {
|
|
293
|
-
var blockAri, blockInstanceId, sourceAri, product, content, stepVersion, requestBody, response;
|
|
295
|
+
var blockAri, blockInstanceId, sourceAri, product, content, stepVersion, status, requestBody, response;
|
|
294
296
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
295
297
|
while (1) switch (_context6.prev = _context6.next) {
|
|
296
298
|
case 0:
|
|
297
|
-
blockAri = _ref0.blockAri, blockInstanceId = _ref0.blockInstanceId, sourceAri = _ref0.sourceAri, product = _ref0.product, content = _ref0.content, stepVersion = _ref0.stepVersion;
|
|
299
|
+
blockAri = _ref0.blockAri, blockInstanceId = _ref0.blockInstanceId, sourceAri = _ref0.sourceAri, product = _ref0.product, content = _ref0.content, stepVersion = _ref0.stepVersion, status = _ref0.status;
|
|
298
300
|
requestBody = {
|
|
299
301
|
blockAri: blockAri,
|
|
300
302
|
blockInstanceId: blockInstanceId,
|
|
@@ -305,25 +307,28 @@ var createSyncedBlock = exports.createSyncedBlock = /*#__PURE__*/function () {
|
|
|
305
307
|
if (stepVersion !== undefined) {
|
|
306
308
|
requestBody.stepVersion = stepVersion;
|
|
307
309
|
}
|
|
308
|
-
|
|
310
|
+
if (status !== undefined && (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding')) {
|
|
311
|
+
requestBody.status = status;
|
|
312
|
+
}
|
|
313
|
+
_context6.next = 6;
|
|
309
314
|
return (0, _retry.fetchWithRetry)("".concat(BLOCK_SERVICE_API_URL, "/block"), {
|
|
310
315
|
method: 'POST',
|
|
311
316
|
headers: COMMON_HEADERS,
|
|
312
317
|
body: JSON.stringify(requestBody)
|
|
313
318
|
});
|
|
314
|
-
case
|
|
319
|
+
case 6:
|
|
315
320
|
response = _context6.sent;
|
|
316
321
|
if (response.ok) {
|
|
317
|
-
_context6.next =
|
|
322
|
+
_context6.next = 9;
|
|
318
323
|
break;
|
|
319
324
|
}
|
|
320
325
|
throw new BlockError(response.status);
|
|
321
|
-
case
|
|
322
|
-
_context6.next =
|
|
326
|
+
case 9:
|
|
327
|
+
_context6.next = 11;
|
|
323
328
|
return response.json();
|
|
324
|
-
case 10:
|
|
325
|
-
return _context6.abrupt("return", _context6.sent);
|
|
326
329
|
case 11:
|
|
330
|
+
return _context6.abrupt("return", _context6.sent);
|
|
331
|
+
case 12:
|
|
327
332
|
case "end":
|
|
328
333
|
return _context6.stop();
|
|
329
334
|
}
|
|
@@ -90,7 +90,9 @@ var useFetchSyncBlockData = exports.useFetchSyncBlockData = function useFetchSyn
|
|
|
90
90
|
setFetchState({
|
|
91
91
|
syncBlockInstance: {
|
|
92
92
|
resourceId: resourceId || '',
|
|
93
|
-
error:
|
|
93
|
+
error: {
|
|
94
|
+
type: _types.SyncBlockError.Errored
|
|
95
|
+
}
|
|
94
96
|
},
|
|
95
97
|
isLoading: false
|
|
96
98
|
});
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
14
|
var _react = require("react");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _ari = require("../../clients/block-service/ari");
|
|
16
17
|
var _blockService = require("../../clients/block-service/blockService");
|
|
17
18
|
var _blockSubscription = require("../../clients/block-service/blockSubscription");
|
|
@@ -153,7 +154,9 @@ var fetchReferences = exports.fetchReferences = /*#__PURE__*/function () {
|
|
|
153
154
|
if (!resourceId) {
|
|
154
155
|
// could not extract resourceId from blockAri, return InvalidContent error
|
|
155
156
|
return {
|
|
156
|
-
error:
|
|
157
|
+
error: {
|
|
158
|
+
type: _types.SyncBlockError.InvalidContent
|
|
159
|
+
},
|
|
157
160
|
resourceId: blockContentResponse.blockAri
|
|
158
161
|
};
|
|
159
162
|
}
|
|
@@ -164,14 +167,18 @@ var fetchReferences = exports.fetchReferences = /*#__PURE__*/function () {
|
|
|
164
167
|
} catch (_unused2) {
|
|
165
168
|
// JSON parsing error, return InvalidContent error
|
|
166
169
|
return {
|
|
167
|
-
error:
|
|
170
|
+
error: {
|
|
171
|
+
type: _types.SyncBlockError.InvalidContent
|
|
172
|
+
},
|
|
168
173
|
resourceId: blockContentResponse.blockAri
|
|
169
174
|
};
|
|
170
175
|
}
|
|
171
176
|
});
|
|
172
177
|
errorInstances = (errors || []).map(function (errorBlock) {
|
|
173
178
|
return {
|
|
174
|
-
error:
|
|
179
|
+
error: {
|
|
180
|
+
type: _types.SyncBlockError.Errored
|
|
181
|
+
},
|
|
175
182
|
resourceId: errorBlock.blockAri
|
|
176
183
|
};
|
|
177
184
|
});
|
|
@@ -226,7 +233,10 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
226
233
|
break;
|
|
227
234
|
}
|
|
228
235
|
return _context2.abrupt("return", {
|
|
229
|
-
error:
|
|
236
|
+
error: {
|
|
237
|
+
type: _types.SyncBlockError.NotFound,
|
|
238
|
+
reason: blockContentResponse.deletionReason
|
|
239
|
+
},
|
|
230
240
|
resourceId: resourceId
|
|
231
241
|
});
|
|
232
242
|
case 8:
|
|
@@ -241,7 +251,8 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
241
251
|
contentUpdatedAt: (0, _utils.convertContentUpdatedAt)(blockContentResponse.contentUpdatedAt),
|
|
242
252
|
sourceAri: blockContentResponse.sourceAri,
|
|
243
253
|
product: blockContentResponse.product,
|
|
244
|
-
status: blockContentResponse.status
|
|
254
|
+
status: blockContentResponse.status,
|
|
255
|
+
deletionReason: blockContentResponse.deletionReason
|
|
245
256
|
},
|
|
246
257
|
resourceId: resourceId
|
|
247
258
|
});
|
|
@@ -253,12 +264,16 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
253
264
|
break;
|
|
254
265
|
}
|
|
255
266
|
return _context2.abrupt("return", {
|
|
256
|
-
error:
|
|
267
|
+
error: {
|
|
268
|
+
type: mapBlockError(_context2.t0)
|
|
269
|
+
},
|
|
257
270
|
resourceId: resourceId
|
|
258
271
|
});
|
|
259
272
|
case 16:
|
|
260
273
|
return _context2.abrupt("return", {
|
|
261
|
-
error:
|
|
274
|
+
error: {
|
|
275
|
+
type: _types.SyncBlockError.Errored
|
|
276
|
+
},
|
|
262
277
|
resourceId: resourceId
|
|
263
278
|
});
|
|
264
279
|
case 17:
|
|
@@ -381,7 +396,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
381
396
|
}
|
|
382
397
|
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
383
398
|
return {
|
|
384
|
-
error:
|
|
399
|
+
error: {
|
|
400
|
+
type: _types.SyncBlockError.Errored
|
|
401
|
+
},
|
|
385
402
|
resourceId: blockNodeIdentifier.resourceId
|
|
386
403
|
};
|
|
387
404
|
}));
|
|
@@ -423,7 +440,10 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
423
440
|
break;
|
|
424
441
|
}
|
|
425
442
|
results.push({
|
|
426
|
-
error:
|
|
443
|
+
error: {
|
|
444
|
+
type: _types.SyncBlockError.NotFound,
|
|
445
|
+
reason: blockContentResponse.deletionReason
|
|
446
|
+
},
|
|
427
447
|
resourceId: resourceId
|
|
428
448
|
});
|
|
429
449
|
return _context4.abrupt("continue", 25);
|
|
@@ -438,13 +458,16 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
438
458
|
blockInstanceId: blockContentResponse.blockInstanceId,
|
|
439
459
|
sourceAri: blockContentResponse.sourceAri,
|
|
440
460
|
product: blockContentResponse.product,
|
|
441
|
-
status: blockContentResponse.status
|
|
461
|
+
status: blockContentResponse.status,
|
|
462
|
+
deletionReason: blockContentResponse.deletionReason
|
|
442
463
|
},
|
|
443
464
|
resourceId: resourceId
|
|
444
465
|
});
|
|
445
466
|
} catch (_unused3) {
|
|
446
467
|
results.push({
|
|
447
|
-
error:
|
|
468
|
+
error: {
|
|
469
|
+
type: _types.SyncBlockError.Errored
|
|
470
|
+
},
|
|
448
471
|
resourceId: resourceId
|
|
449
472
|
});
|
|
450
473
|
}
|
|
@@ -486,7 +509,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
486
509
|
case 44:
|
|
487
510
|
processedResourceIds.add(_resourceId);
|
|
488
511
|
results.push({
|
|
489
|
-
error:
|
|
512
|
+
error: {
|
|
513
|
+
type: mapErrorResponseCode(errorResponse.code)
|
|
514
|
+
},
|
|
490
515
|
resourceId: _resourceId
|
|
491
516
|
});
|
|
492
517
|
case 46:
|
|
@@ -511,7 +536,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
511
536
|
blockNodeIdentifier = _step3.value;
|
|
512
537
|
if (!processedResourceIds.has(blockNodeIdentifier.resourceId)) {
|
|
513
538
|
results.push({
|
|
514
|
-
error:
|
|
539
|
+
error: {
|
|
540
|
+
type: _types.SyncBlockError.NotFound
|
|
541
|
+
},
|
|
515
542
|
resourceId: blockNodeIdentifier.resourceId
|
|
516
543
|
});
|
|
517
544
|
}
|
|
@@ -527,7 +554,9 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
527
554
|
_context4.t2 = _context4["catch"](5);
|
|
528
555
|
return _context4.abrupt("return", blockNodeIdentifiers.map(function (blockNodeIdentifier) {
|
|
529
556
|
return {
|
|
530
|
-
error:
|
|
557
|
+
error: {
|
|
558
|
+
type: _context4.t2 instanceof _blockService.BlockError ? mapBlockError(_context4.t2) : _types.SyncBlockError.Errored
|
|
559
|
+
},
|
|
531
560
|
resourceId: blockNodeIdentifier.resourceId
|
|
532
561
|
};
|
|
533
562
|
}));
|
|
@@ -587,13 +616,15 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
587
616
|
parentAri = _ref4.parentAri,
|
|
588
617
|
parentId = _ref4.parentId,
|
|
589
618
|
product = _ref4.product,
|
|
590
|
-
getVersion = _ref4.getVersion
|
|
619
|
+
getVersion = _ref4.getVersion,
|
|
620
|
+
isParentUnpublished = _ref4.isParentUnpublished;
|
|
591
621
|
(0, _classCallCheck2.default)(this, BlockServiceADFWriteProvider);
|
|
592
622
|
this.cloudId = cloudId;
|
|
593
623
|
this.parentAri = parentAri;
|
|
594
624
|
this.parentId = parentId;
|
|
595
625
|
this.product = product;
|
|
596
626
|
this.getVersion = getVersion;
|
|
627
|
+
this.isParentUnpublished = isParentUnpublished;
|
|
597
628
|
}
|
|
598
629
|
|
|
599
630
|
// it will first try to update and if it can't (404) then it will try to create
|
|
@@ -663,7 +694,8 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
663
694
|
key: "createData",
|
|
664
695
|
value: function () {
|
|
665
696
|
var _createData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(data) {
|
|
666
|
-
var
|
|
697
|
+
var _this$isParentUnpubli;
|
|
698
|
+
var resourceId, blockAri, stepVersion, status;
|
|
667
699
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
668
700
|
while (1) switch (_context6.prev = _context6.next) {
|
|
669
701
|
case 0:
|
|
@@ -683,41 +715,43 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
683
715
|
resourceId: resourceId
|
|
684
716
|
});
|
|
685
717
|
stepVersion = this.getVersion ? this.getVersion() : undefined;
|
|
686
|
-
|
|
687
|
-
_context6.
|
|
718
|
+
status = (0, _platformFeatureFlags.fg)('platform_synced_block_dogfooding') ? (_this$isParentUnpubli = this.isParentUnpublished) !== null && _this$isParentUnpubli !== void 0 && _this$isParentUnpubli.call(this) ? 'unpublished' : data.status || 'active' : undefined;
|
|
719
|
+
_context6.prev = 6;
|
|
720
|
+
_context6.next = 9;
|
|
688
721
|
return (0, _blockService.createSyncedBlock)({
|
|
689
722
|
blockAri: blockAri,
|
|
690
723
|
blockInstanceId: data.blockInstanceId,
|
|
691
724
|
sourceAri: this.parentAri,
|
|
692
725
|
product: this.product,
|
|
693
726
|
content: JSON.stringify(data.content),
|
|
694
|
-
stepVersion: stepVersion
|
|
727
|
+
stepVersion: stepVersion,
|
|
728
|
+
status: status
|
|
695
729
|
});
|
|
696
|
-
case
|
|
730
|
+
case 9:
|
|
697
731
|
return _context6.abrupt("return", {
|
|
698
732
|
resourceId: resourceId
|
|
699
733
|
});
|
|
700
|
-
case
|
|
701
|
-
_context6.prev =
|
|
702
|
-
_context6.t0 = _context6["catch"](
|
|
734
|
+
case 12:
|
|
735
|
+
_context6.prev = 12;
|
|
736
|
+
_context6.t0 = _context6["catch"](6);
|
|
703
737
|
if (!(_context6.t0 instanceof _blockService.BlockError)) {
|
|
704
|
-
_context6.next =
|
|
738
|
+
_context6.next = 16;
|
|
705
739
|
break;
|
|
706
740
|
}
|
|
707
741
|
return _context6.abrupt("return", {
|
|
708
742
|
error: mapBlockError(_context6.t0),
|
|
709
743
|
resourceId: resourceId
|
|
710
744
|
});
|
|
711
|
-
case
|
|
745
|
+
case 16:
|
|
712
746
|
return _context6.abrupt("return", {
|
|
713
747
|
error: (0, _errorHandling.stringifyError)(_context6.t0),
|
|
714
748
|
resourceId: resourceId
|
|
715
749
|
});
|
|
716
|
-
case
|
|
750
|
+
case 17:
|
|
717
751
|
case "end":
|
|
718
752
|
return _context6.stop();
|
|
719
753
|
}
|
|
720
|
-
}, _callee6, this, [[
|
|
754
|
+
}, _callee6, this, [[6, 12]]);
|
|
721
755
|
}));
|
|
722
756
|
function createData(_x6) {
|
|
723
757
|
return _createData.apply(this, arguments);
|
|
@@ -727,7 +761,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
727
761
|
}, {
|
|
728
762
|
key: "deleteData",
|
|
729
763
|
value: function () {
|
|
730
|
-
var _deleteData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(resourceId) {
|
|
764
|
+
var _deleteData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(resourceId, deleteReason) {
|
|
731
765
|
var blockAri;
|
|
732
766
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
733
767
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -751,7 +785,8 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
751
785
|
_context7.prev = 3;
|
|
752
786
|
_context7.next = 6;
|
|
753
787
|
return (0, _blockService.deleteSyncedBlock)({
|
|
754
|
-
blockAri: blockAri
|
|
788
|
+
blockAri: blockAri,
|
|
789
|
+
deleteReason: deleteReason
|
|
755
790
|
});
|
|
756
791
|
case 6:
|
|
757
792
|
return _context7.abrupt("return", {
|
|
@@ -792,7 +827,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
792
827
|
}
|
|
793
828
|
}, _callee7, this, [[3, 9]]);
|
|
794
829
|
}));
|
|
795
|
-
function deleteData(_x7) {
|
|
830
|
+
function deleteData(_x7, _x8) {
|
|
796
831
|
return _deleteData.apply(this, arguments);
|
|
797
832
|
}
|
|
798
833
|
return deleteData;
|
|
@@ -865,7 +900,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
865
900
|
}
|
|
866
901
|
}, _callee8, this, [[2, 8]]);
|
|
867
902
|
}));
|
|
868
|
-
function updateReferenceData(
|
|
903
|
+
function updateReferenceData(_x9, _x0) {
|
|
869
904
|
return _updateReferenceData.apply(this, arguments);
|
|
870
905
|
}
|
|
871
906
|
return updateReferenceData;
|
|
@@ -877,7 +912,8 @@ var createBlockServiceAPIProviders = function createBlockServiceAPIProviders(_re
|
|
|
877
912
|
parentAri = _ref5.parentAri,
|
|
878
913
|
parentId = _ref5.parentId,
|
|
879
914
|
product = _ref5.product,
|
|
880
|
-
getVersion = _ref5.getVersion
|
|
915
|
+
getVersion = _ref5.getVersion,
|
|
916
|
+
isParentUnpublished = _ref5.isParentUnpublished;
|
|
881
917
|
return {
|
|
882
918
|
fetchProvider: new BlockServiceADFFetchProvider({
|
|
883
919
|
cloudId: cloudId,
|
|
@@ -888,7 +924,8 @@ var createBlockServiceAPIProviders = function createBlockServiceAPIProviders(_re
|
|
|
888
924
|
parentAri: parentAri,
|
|
889
925
|
parentId: parentId,
|
|
890
926
|
product: product,
|
|
891
|
-
getVersion: getVersion
|
|
927
|
+
getVersion: getVersion,
|
|
928
|
+
isParentUnpublished: isParentUnpublished
|
|
892
929
|
})
|
|
893
930
|
};
|
|
894
931
|
};
|
|
@@ -897,16 +934,18 @@ var useMemoizedBlockServiceAPIProviders = exports.useMemoizedBlockServiceAPIProv
|
|
|
897
934
|
parentAri = _ref6.parentAri,
|
|
898
935
|
parentId = _ref6.parentId,
|
|
899
936
|
product = _ref6.product,
|
|
900
|
-
getVersion = _ref6.getVersion
|
|
937
|
+
getVersion = _ref6.getVersion,
|
|
938
|
+
isParentUnpublished = _ref6.isParentUnpublished;
|
|
901
939
|
return (0, _react.useMemo)(function () {
|
|
902
940
|
return createBlockServiceAPIProviders({
|
|
903
941
|
cloudId: cloudId,
|
|
904
942
|
parentAri: parentAri,
|
|
905
943
|
parentId: parentId,
|
|
906
944
|
product: product,
|
|
907
|
-
getVersion: getVersion
|
|
945
|
+
getVersion: getVersion,
|
|
946
|
+
isParentUnpublished: isParentUnpublished
|
|
908
947
|
});
|
|
909
|
-
}, [cloudId, parentAri, parentId, product, getVersion]);
|
|
948
|
+
}, [cloudId, parentAri, parentId, product, getVersion, isParentUnpublished]);
|
|
910
949
|
};
|
|
911
950
|
var createBlockServiceFetchOnlyAPIProvider = function createBlockServiceFetchOnlyAPIProvider(_ref7) {
|
|
912
951
|
var cloudId = _ref7.cloudId,
|
|
@@ -121,7 +121,9 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
121
121
|
return data;
|
|
122
122
|
}, function () {
|
|
123
123
|
return {
|
|
124
|
-
error:
|
|
124
|
+
error: {
|
|
125
|
+
type: _types.SyncBlockError.Errored
|
|
126
|
+
},
|
|
125
127
|
resourceId: blockIdentifier.resourceId
|
|
126
128
|
};
|
|
127
129
|
});
|
|
@@ -141,7 +143,9 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
141
143
|
return data;
|
|
142
144
|
}, function () {
|
|
143
145
|
return {
|
|
144
|
-
error:
|
|
146
|
+
error: {
|
|
147
|
+
type: _types.SyncBlockError.Errored
|
|
148
|
+
},
|
|
145
149
|
resourceId: blockIdentifier.resourceId
|
|
146
150
|
};
|
|
147
151
|
});
|
|
@@ -246,7 +250,7 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
246
250
|
}, {
|
|
247
251
|
key: "deleteNodesData",
|
|
248
252
|
value: (function () {
|
|
249
|
-
var _deleteNodesData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resourceIds) {
|
|
253
|
+
var _deleteNodesData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(resourceIds, deletionReason) {
|
|
250
254
|
var _this4 = this;
|
|
251
255
|
var results;
|
|
252
256
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
@@ -263,7 +267,7 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
263
267
|
if (!_this4.writeProvider) {
|
|
264
268
|
return Promise.reject('Write provider not set');
|
|
265
269
|
}
|
|
266
|
-
return _this4.writeProvider.deleteData(resourceId);
|
|
270
|
+
return _this4.writeProvider.deleteData(resourceId, deletionReason);
|
|
267
271
|
}));
|
|
268
272
|
case 4:
|
|
269
273
|
results = _context3.sent;
|
|
@@ -284,7 +288,7 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
284
288
|
}
|
|
285
289
|
}, _callee3, this);
|
|
286
290
|
}));
|
|
287
|
-
function deleteNodesData(_x4) {
|
|
291
|
+
function deleteNodesData(_x4, _x5) {
|
|
288
292
|
return _deleteNodesData.apply(this, arguments);
|
|
289
293
|
}
|
|
290
294
|
return deleteNodesData;
|
|
@@ -382,7 +386,7 @@ var SyncBlockProvider = exports.SyncBlockProvider = /*#__PURE__*/function (_Sync
|
|
|
382
386
|
}
|
|
383
387
|
}, _callee4, this);
|
|
384
388
|
}));
|
|
385
|
-
function fetchSyncBlockSourceInfo(
|
|
389
|
+
function fetchSyncBlockSourceInfo(_x6, _x7, _x8, _x9) {
|
|
386
390
|
return _fetchSyncBlockSourceInfo.apply(this, arguments);
|
|
387
391
|
}
|
|
388
392
|
return fetchSyncBlockSourceInfo;
|