@atlaskit/editor-synced-block-provider 3.31.3 → 3.32.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 +11 -0
- package/dist/cjs/clients/block-service/blockService.js +1 -0
- package/dist/cjs/providers/block-service/blockServiceAPI.js +17 -14
- package/dist/cjs/providers/types.js +3 -0
- package/dist/es2019/clients/block-service/blockService.js +1 -0
- package/dist/es2019/providers/block-service/blockServiceAPI.js +7 -4
- package/dist/es2019/providers/types.js +4 -0
- package/dist/esm/clients/block-service/blockService.js +1 -0
- package/dist/esm/providers/block-service/blockServiceAPI.js +17 -14
- package/dist/esm/providers/types.js +4 -0
- package/dist/types/clients/block-service/blockService.d.ts +3 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/providers/block-service/blockServiceAPI.d.ts +5 -3
- package/dist/types/providers/types.d.ts +12 -1
- package/dist/types-ts4.5/clients/block-service/blockService.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +5 -3
- package/dist/types-ts4.5/providers/types.d.ts +12 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-synced-block-provider
|
|
2
2
|
|
|
3
|
+
## 3.32.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`81f25f25198cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81f25f25198cc) -
|
|
8
|
+
EDITOR-5802 Define BatchFetchConfig type & update core batch APIs
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 3.31.3
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -288,6 +288,7 @@ var getSyncedBlockContent = exports.getSyncedBlockContent = /*#__PURE__*/functio
|
|
|
288
288
|
* Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
|
|
289
289
|
*
|
|
290
290
|
* @param blockIdentifiers - Array of block identifiers to retrieve
|
|
291
|
+
* @param config - Optional batch fetch configuration (e.g. timeout)
|
|
291
292
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
292
293
|
*/
|
|
293
294
|
var batchRetrieveSyncedBlocks = exports.batchRetrieveSyncedBlocks = /*#__PURE__*/function () {
|
|
@@ -205,10 +205,11 @@ var extractResourceIdFromBlockAri = exports.extractResourceIdFromBlockAri = func
|
|
|
205
205
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
206
206
|
* @param parentAri - The ARI of the parent of the block. E.G the ARI of the confluence page, or the ARI of the Jira work item
|
|
207
207
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
208
|
+
* @param config - Optional batch fetch configuration
|
|
208
209
|
* @returns Array of SyncBlockInstance results
|
|
209
210
|
*/
|
|
210
211
|
var _batchFetchData = exports.batchFetchData = /*#__PURE__*/function () {
|
|
211
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId, parentAri, blockNodeIdentifiers) {
|
|
212
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(cloudId, parentAri, blockNodeIdentifiers, config) {
|
|
212
213
|
var blockIdentifiers, validResourceIds, processedResourceIds, response, results, _iterator, _step, blockContentResponse, resourceId, content, deletionReason, sourceAri, blockAri, contentUpdatedAt, blockInstanceId, product, status, syncedBlockData, _iterator2, _step2, errorResponse, _resourceId, _iterator3, _step3, blockNodeIdentifier;
|
|
213
214
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
214
215
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -242,7 +243,8 @@ var _batchFetchData = exports.batchFetchData = /*#__PURE__*/function () {
|
|
|
242
243
|
_context2.prev = 5;
|
|
243
244
|
_context2.next = 8;
|
|
244
245
|
return (0, _blockService.batchRetrieveSyncedBlocks)({
|
|
245
|
-
blockIdentifiers: blockIdentifiers
|
|
246
|
+
blockIdentifiers: blockIdentifiers,
|
|
247
|
+
config: config
|
|
246
248
|
});
|
|
247
249
|
case 8:
|
|
248
250
|
response = _context2.sent;
|
|
@@ -405,7 +407,7 @@ var _batchFetchData = exports.batchFetchData = /*#__PURE__*/function () {
|
|
|
405
407
|
}
|
|
406
408
|
}, _callee2, null, [[5, 61], [12, 29, 32, 35], [37, 50, 53, 56]]);
|
|
407
409
|
}));
|
|
408
|
-
return function batchFetchData(_x2, _x3, _x4) {
|
|
410
|
+
return function batchFetchData(_x2, _x3, _x4, _x5) {
|
|
409
411
|
return _ref3.apply(this, arguments);
|
|
410
412
|
};
|
|
411
413
|
}();
|
|
@@ -569,7 +571,7 @@ var writeDataBatch = exports.writeDataBatch = /*#__PURE__*/function () {
|
|
|
569
571
|
}
|
|
570
572
|
}, _callee3, null, [[2, 31], [13, 22, 25, 28]]);
|
|
571
573
|
}));
|
|
572
|
-
return function writeDataBatch(
|
|
574
|
+
return function writeDataBatch(_x6, _x7, _x8, _x9, _x0, _x1) {
|
|
573
575
|
return _ref4.apply(this, arguments);
|
|
574
576
|
};
|
|
575
577
|
}();
|
|
@@ -664,7 +666,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
664
666
|
}
|
|
665
667
|
}, _callee4, this, [[1, 12]]);
|
|
666
668
|
}));
|
|
667
|
-
function fetchData(
|
|
669
|
+
function fetchData(_x10) {
|
|
668
670
|
return _fetchData.apply(this, arguments);
|
|
669
671
|
}
|
|
670
672
|
return fetchData;
|
|
@@ -729,7 +731,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
729
731
|
}
|
|
730
732
|
}, _callee5, this, [[0, 11]]);
|
|
731
733
|
}));
|
|
732
|
-
function fetchReferences(
|
|
734
|
+
function fetchReferences(_x11) {
|
|
733
735
|
return _fetchReferences.apply(this, arguments);
|
|
734
736
|
}
|
|
735
737
|
return fetchReferences;
|
|
@@ -737,17 +739,18 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
737
739
|
/**
|
|
738
740
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
739
741
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
742
|
+
* @param config - Optional batch fetch configuration
|
|
740
743
|
* @returns Array of SyncBlockInstance results
|
|
741
744
|
*/
|
|
742
745
|
}, {
|
|
743
746
|
key: "batchFetchData",
|
|
744
747
|
value: (function () {
|
|
745
|
-
var _batchFetchData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(blockNodeIdentifiers) {
|
|
748
|
+
var _batchFetchData2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(blockNodeIdentifiers, config) {
|
|
746
749
|
return _regenerator.default.wrap(function _callee6$(_context7) {
|
|
747
750
|
while (1) switch (_context7.prev = _context7.next) {
|
|
748
751
|
case 0:
|
|
749
752
|
_context7.next = 2;
|
|
750
|
-
return _batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers);
|
|
753
|
+
return _batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers, config);
|
|
751
754
|
case 2:
|
|
752
755
|
return _context7.abrupt("return", _context7.sent);
|
|
753
756
|
case 3:
|
|
@@ -756,7 +759,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
756
759
|
}
|
|
757
760
|
}, _callee6, this);
|
|
758
761
|
}));
|
|
759
|
-
function batchFetchData(
|
|
762
|
+
function batchFetchData(_x12, _x13) {
|
|
760
763
|
return _batchFetchData2.apply(this, arguments);
|
|
761
764
|
}
|
|
762
765
|
return batchFetchData;
|
|
@@ -888,7 +891,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
888
891
|
}
|
|
889
892
|
}, _callee7, this, [[12, 19]]);
|
|
890
893
|
}));
|
|
891
|
-
function writeData(
|
|
894
|
+
function writeData(_x14) {
|
|
892
895
|
return _writeData.apply(this, arguments);
|
|
893
896
|
}
|
|
894
897
|
return writeData;
|
|
@@ -968,7 +971,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
968
971
|
}
|
|
969
972
|
}, _callee8, this, [[13, 19]]);
|
|
970
973
|
}));
|
|
971
|
-
function createData(
|
|
974
|
+
function createData(_x15) {
|
|
972
975
|
return _createData.apply(this, arguments);
|
|
973
976
|
}
|
|
974
977
|
return createData;
|
|
@@ -1042,7 +1045,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1042
1045
|
}
|
|
1043
1046
|
}, _callee9, this, [[3, 9]]);
|
|
1044
1047
|
}));
|
|
1045
|
-
function deleteData(
|
|
1048
|
+
function deleteData(_x16, _x17) {
|
|
1046
1049
|
return _deleteData.apply(this, arguments);
|
|
1047
1050
|
}
|
|
1048
1051
|
return deleteData;
|
|
@@ -1125,7 +1128,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1125
1128
|
}
|
|
1126
1129
|
}, _callee0, this, [[2, 8]]);
|
|
1127
1130
|
}));
|
|
1128
|
-
function updateReferenceData(
|
|
1131
|
+
function updateReferenceData(_x18, _x19) {
|
|
1129
1132
|
return _updateReferenceData.apply(this, arguments);
|
|
1130
1133
|
}
|
|
1131
1134
|
return updateReferenceData;
|
|
@@ -1291,7 +1294,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1291
1294
|
}
|
|
1292
1295
|
}, _callee1, this, [[10, 39], [21, 30, 33, 36]]);
|
|
1293
1296
|
}));
|
|
1294
|
-
function writeDataBatch(
|
|
1297
|
+
function writeDataBatch(_x20) {
|
|
1295
1298
|
return _writeDataBatch.apply(this, arguments);
|
|
1296
1299
|
}
|
|
1297
1300
|
return writeDataBatch;
|
|
@@ -18,6 +18,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
18
18
|
* Mainly used for representing the state of a sync block after fetching from a data provider.
|
|
19
19
|
* This will be used in both data processing and rendering contexts.
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* Configuration options for batch fetch operations
|
|
23
|
+
*/
|
|
21
24
|
var SyncBlockDataProviderInterface = exports.SyncBlockDataProviderInterface = /*#__PURE__*/function (_NodeDataProvider) {
|
|
22
25
|
function SyncBlockDataProviderInterface() {
|
|
23
26
|
(0, _classCallCheck2.default)(this, SyncBlockDataProviderInterface);
|
|
@@ -330,6 +330,7 @@ export const getSyncedBlockContent = async ({
|
|
|
330
330
|
* Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
|
|
331
331
|
*
|
|
332
332
|
* @param blockIdentifiers - Array of block identifiers to retrieve
|
|
333
|
+
* @param config - Optional batch fetch configuration (e.g. timeout)
|
|
333
334
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
334
335
|
*/
|
|
335
336
|
export const batchRetrieveSyncedBlocks = async ({
|
|
@@ -166,9 +166,10 @@ export const extractResourceIdFromBlockAri = blockAri => {
|
|
|
166
166
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
167
167
|
* @param parentAri - The ARI of the parent of the block. E.G the ARI of the confluence page, or the ARI of the Jira work item
|
|
168
168
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
169
|
+
* @param config - Optional batch fetch configuration
|
|
169
170
|
* @returns Array of SyncBlockInstance results
|
|
170
171
|
*/
|
|
171
|
-
export const batchFetchData = async (cloudId, parentAri, blockNodeIdentifiers) => {
|
|
172
|
+
export const batchFetchData = async (cloudId, parentAri, blockNodeIdentifiers, config) => {
|
|
172
173
|
const blockIdentifiers = blockNodeIdentifiers.map(blockIdentifier => ({
|
|
173
174
|
blockAri: generateBlockAriFromReference({
|
|
174
175
|
cloudId,
|
|
@@ -192,7 +193,8 @@ export const batchFetchData = async (cloudId, parentAri, blockNodeIdentifiers) =
|
|
|
192
193
|
}
|
|
193
194
|
try {
|
|
194
195
|
const response = await batchRetrieveSyncedBlocks({
|
|
195
|
-
blockIdentifiers
|
|
196
|
+
blockIdentifiers,
|
|
197
|
+
config
|
|
196
198
|
});
|
|
197
199
|
const results = [];
|
|
198
200
|
|
|
@@ -504,10 +506,11 @@ class BlockServiceADFFetchProvider {
|
|
|
504
506
|
/**
|
|
505
507
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
506
508
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
509
|
+
* @param config - Optional batch fetch configuration
|
|
507
510
|
* @returns Array of SyncBlockInstance results
|
|
508
511
|
*/
|
|
509
|
-
async batchFetchData(blockNodeIdentifiers) {
|
|
510
|
-
return await batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers);
|
|
512
|
+
async batchFetchData(blockNodeIdentifiers, config) {
|
|
513
|
+
return await batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers, config);
|
|
511
514
|
}
|
|
512
515
|
|
|
513
516
|
/**
|
|
@@ -6,4 +6,8 @@ import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
|
6
6
|
* This will be used in both data processing and rendering contexts.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Configuration options for batch fetch operations
|
|
11
|
+
*/
|
|
12
|
+
|
|
9
13
|
export class SyncBlockDataProviderInterface extends NodeDataProvider {}
|
|
@@ -281,6 +281,7 @@ export var getSyncedBlockContent = /*#__PURE__*/function () {
|
|
|
281
281
|
* Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
|
|
282
282
|
*
|
|
283
283
|
* @param blockIdentifiers - Array of block identifiers to retrieve
|
|
284
|
+
* @param config - Optional batch fetch configuration (e.g. timeout)
|
|
284
285
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
285
286
|
*/
|
|
286
287
|
export var batchRetrieveSyncedBlocks = /*#__PURE__*/function () {
|
|
@@ -199,10 +199,11 @@ export var extractResourceIdFromBlockAri = function extractResourceIdFromBlockAr
|
|
|
199
199
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
200
200
|
* @param parentAri - The ARI of the parent of the block. E.G the ARI of the confluence page, or the ARI of the Jira work item
|
|
201
201
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
202
|
+
* @param config - Optional batch fetch configuration
|
|
202
203
|
* @returns Array of SyncBlockInstance results
|
|
203
204
|
*/
|
|
204
205
|
var _batchFetchData = /*#__PURE__*/function () {
|
|
205
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId, parentAri, blockNodeIdentifiers) {
|
|
206
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(cloudId, parentAri, blockNodeIdentifiers, config) {
|
|
206
207
|
var blockIdentifiers, validResourceIds, processedResourceIds, response, results, _iterator, _step, blockContentResponse, resourceId, content, deletionReason, sourceAri, blockAri, contentUpdatedAt, blockInstanceId, product, status, syncedBlockData, _iterator2, _step2, errorResponse, _resourceId, _iterator3, _step3, blockNodeIdentifier;
|
|
207
208
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
208
209
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -236,7 +237,8 @@ var _batchFetchData = /*#__PURE__*/function () {
|
|
|
236
237
|
_context2.prev = 5;
|
|
237
238
|
_context2.next = 8;
|
|
238
239
|
return batchRetrieveSyncedBlocks({
|
|
239
|
-
blockIdentifiers: blockIdentifiers
|
|
240
|
+
blockIdentifiers: blockIdentifiers,
|
|
241
|
+
config: config
|
|
240
242
|
});
|
|
241
243
|
case 8:
|
|
242
244
|
response = _context2.sent;
|
|
@@ -399,7 +401,7 @@ var _batchFetchData = /*#__PURE__*/function () {
|
|
|
399
401
|
}
|
|
400
402
|
}, _callee2, null, [[5, 61], [12, 29, 32, 35], [37, 50, 53, 56]]);
|
|
401
403
|
}));
|
|
402
|
-
return function batchFetchData(_x2, _x3, _x4) {
|
|
404
|
+
return function batchFetchData(_x2, _x3, _x4, _x5) {
|
|
403
405
|
return _ref3.apply(this, arguments);
|
|
404
406
|
};
|
|
405
407
|
}();
|
|
@@ -564,7 +566,7 @@ export var writeDataBatch = /*#__PURE__*/function () {
|
|
|
564
566
|
}
|
|
565
567
|
}, _callee3, null, [[2, 31], [13, 22, 25, 28]]);
|
|
566
568
|
}));
|
|
567
|
-
return function writeDataBatch(
|
|
569
|
+
return function writeDataBatch(_x6, _x7, _x8, _x9, _x0, _x1) {
|
|
568
570
|
return _ref4.apply(this, arguments);
|
|
569
571
|
};
|
|
570
572
|
}();
|
|
@@ -659,7 +661,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
659
661
|
}
|
|
660
662
|
}, _callee4, this, [[1, 12]]);
|
|
661
663
|
}));
|
|
662
|
-
function fetchData(
|
|
664
|
+
function fetchData(_x10) {
|
|
663
665
|
return _fetchData.apply(this, arguments);
|
|
664
666
|
}
|
|
665
667
|
return fetchData;
|
|
@@ -724,7 +726,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
724
726
|
}
|
|
725
727
|
}, _callee5, this, [[0, 11]]);
|
|
726
728
|
}));
|
|
727
|
-
function fetchReferences(
|
|
729
|
+
function fetchReferences(_x11) {
|
|
728
730
|
return _fetchReferences.apply(this, arguments);
|
|
729
731
|
}
|
|
730
732
|
return fetchReferences;
|
|
@@ -732,17 +734,18 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
732
734
|
/**
|
|
733
735
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
734
736
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
737
|
+
* @param config - Optional batch fetch configuration
|
|
735
738
|
* @returns Array of SyncBlockInstance results
|
|
736
739
|
*/
|
|
737
740
|
}, {
|
|
738
741
|
key: "batchFetchData",
|
|
739
742
|
value: (function () {
|
|
740
|
-
var _batchFetchData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(blockNodeIdentifiers) {
|
|
743
|
+
var _batchFetchData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(blockNodeIdentifiers, config) {
|
|
741
744
|
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
742
745
|
while (1) switch (_context7.prev = _context7.next) {
|
|
743
746
|
case 0:
|
|
744
747
|
_context7.next = 2;
|
|
745
|
-
return _batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers);
|
|
748
|
+
return _batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers, config);
|
|
746
749
|
case 2:
|
|
747
750
|
return _context7.abrupt("return", _context7.sent);
|
|
748
751
|
case 3:
|
|
@@ -751,7 +754,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
|
|
|
751
754
|
}
|
|
752
755
|
}, _callee6, this);
|
|
753
756
|
}));
|
|
754
|
-
function batchFetchData(
|
|
757
|
+
function batchFetchData(_x12, _x13) {
|
|
755
758
|
return _batchFetchData2.apply(this, arguments);
|
|
756
759
|
}
|
|
757
760
|
return batchFetchData;
|
|
@@ -883,7 +886,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
883
886
|
}
|
|
884
887
|
}, _callee7, this, [[12, 19]]);
|
|
885
888
|
}));
|
|
886
|
-
function writeData(
|
|
889
|
+
function writeData(_x14) {
|
|
887
890
|
return _writeData.apply(this, arguments);
|
|
888
891
|
}
|
|
889
892
|
return writeData;
|
|
@@ -963,7 +966,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
963
966
|
}
|
|
964
967
|
}, _callee8, this, [[13, 19]]);
|
|
965
968
|
}));
|
|
966
|
-
function createData(
|
|
969
|
+
function createData(_x15) {
|
|
967
970
|
return _createData.apply(this, arguments);
|
|
968
971
|
}
|
|
969
972
|
return createData;
|
|
@@ -1037,7 +1040,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1037
1040
|
}
|
|
1038
1041
|
}, _callee9, this, [[3, 9]]);
|
|
1039
1042
|
}));
|
|
1040
|
-
function deleteData(
|
|
1043
|
+
function deleteData(_x16, _x17) {
|
|
1041
1044
|
return _deleteData.apply(this, arguments);
|
|
1042
1045
|
}
|
|
1043
1046
|
return deleteData;
|
|
@@ -1120,7 +1123,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1120
1123
|
}
|
|
1121
1124
|
}, _callee0, this, [[2, 8]]);
|
|
1122
1125
|
}));
|
|
1123
|
-
function updateReferenceData(
|
|
1126
|
+
function updateReferenceData(_x18, _x19) {
|
|
1124
1127
|
return _updateReferenceData.apply(this, arguments);
|
|
1125
1128
|
}
|
|
1126
1129
|
return updateReferenceData;
|
|
@@ -1286,7 +1289,7 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
|
|
|
1286
1289
|
}
|
|
1287
1290
|
}, _callee1, this, [[10, 39], [21, 30, 33, 36]]);
|
|
1288
1291
|
}));
|
|
1289
|
-
function writeDataBatch(
|
|
1292
|
+
function writeDataBatch(_x20) {
|
|
1290
1293
|
return _writeDataBatch.apply(this, arguments);
|
|
1291
1294
|
}
|
|
1292
1295
|
return writeDataBatch;
|
|
@@ -13,6 +13,10 @@ import { NodeDataProvider } from '@atlaskit/node-data-provider';
|
|
|
13
13
|
* This will be used in both data processing and rendering contexts.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Configuration options for batch fetch operations
|
|
18
|
+
*/
|
|
19
|
+
|
|
16
20
|
export var SyncBlockDataProviderInterface = /*#__PURE__*/function (_NodeDataProvider) {
|
|
17
21
|
function SyncBlockDataProviderInterface() {
|
|
18
22
|
_classCallCheck(this, SyncBlockDataProviderInterface);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReferenceSyncBlockResponse, SyncBlockProduct, SyncBlockStatus, DeletionReason } from '../../common/types';
|
|
2
|
+
import type { BatchFetchConfig } from '../../providers/types';
|
|
2
3
|
export type BlockContentResponse = {
|
|
3
4
|
blockAri: string;
|
|
4
5
|
blockInstanceId: string;
|
|
@@ -111,6 +112,7 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
|
|
|
111
112
|
};
|
|
112
113
|
export type BatchRetrieveSyncedBlocksRequest = {
|
|
113
114
|
blockIdentifiers: BlockIdentifier[];
|
|
115
|
+
config?: BatchFetchConfig;
|
|
114
116
|
};
|
|
115
117
|
type BlockIdentifier = {
|
|
116
118
|
blockAri: string;
|
|
@@ -139,6 +141,7 @@ export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockConten
|
|
|
139
141
|
* Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
|
|
140
142
|
*
|
|
141
143
|
* @param blockIdentifiers - Array of block identifiers to retrieve
|
|
144
|
+
* @param config - Optional batch fetch configuration (e.g. timeout)
|
|
142
145
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
143
146
|
*/
|
|
144
147
|
export declare const batchRetrieveSyncedBlocks: ({ blockIdentifiers, }: BatchRetrieveSyncedBlocksRequest) => Promise<BatchRetrieveSyncedBlocksResponse>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari
|
|
|
13
13
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, fetchReferences, batchFetchData, writeDataBatch, blockAriToResourceId, convertToSyncBlockData, extractResourceIdFromBlockAri, } from './providers/block-service/blockServiceAPI';
|
|
14
14
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
|
15
15
|
export { SyncedBlockProvider, useMemoizedSyncedBlockProvider } from './providers/syncBlockProvider';
|
|
16
|
-
export type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
16
|
+
export type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
17
17
|
export { ReferenceSyncBlockStoreManager } from './store-manager/referenceSyncBlockStoreManager';
|
|
18
18
|
export { SyncBlockInMemorySessionCache, syncBlockInMemorySessionCache, } from './store-manager/syncBlockInMemorySessionCache';
|
|
19
19
|
export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from './store-manager/syncBlockStoreManager';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BlockContentResponse } from '../../clients/block-service/blockService';
|
|
2
2
|
import { SyncBlockError, type ReferenceSyncBlockData, type ResourceId, type SyncBlockAttrs, type SyncBlockData, type SyncBlockProduct } from '../../common/types';
|
|
3
|
-
import type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
3
|
+
import type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
6
6
|
*
|
|
@@ -30,9 +30,10 @@ export declare const extractResourceIdFromBlockAri: (blockAri: string) => string
|
|
|
30
30
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
31
31
|
* @param parentAri - The ARI of the parent of the block. E.G the ARI of the confluence page, or the ARI of the Jira work item
|
|
32
32
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
33
|
+
* @param config - Optional batch fetch configuration
|
|
33
34
|
* @returns Array of SyncBlockInstance results
|
|
34
35
|
*/
|
|
35
|
-
export declare const batchFetchData: (cloudId: string, parentAri: string | undefined, blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
36
|
+
export declare const batchFetchData: (cloudId: string, parentAri: string | undefined, blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig) => Promise<SyncBlockInstance[]>;
|
|
36
37
|
/**
|
|
37
38
|
* Batch writes multiple synced blocks.
|
|
38
39
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
@@ -60,9 +61,10 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
|
|
|
60
61
|
/**
|
|
61
62
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
62
63
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
64
|
+
* @param config - Optional batch fetch configuration
|
|
63
65
|
* @returns Array of SyncBlockInstance results
|
|
64
66
|
*/
|
|
65
|
-
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
|
|
67
|
+
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig): Promise<SyncBlockInstance[]>;
|
|
66
68
|
/**
|
|
67
69
|
* Subscribes to real-time updates for a specific block using GraphQL WebSocket subscriptions.
|
|
68
70
|
* @param resourceId - The resource ID of the block to subscribe to
|
|
@@ -60,11 +60,22 @@ export type BlockNodeIdentifiers = {
|
|
|
60
60
|
blockInstanceId: string;
|
|
61
61
|
resourceId: string;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Configuration options for batch fetch operations
|
|
65
|
+
*/
|
|
66
|
+
export type BatchFetchConfig = {
|
|
67
|
+
/** Whether the batch fetch is being performed in a server-side rendering context */
|
|
68
|
+
isSSR?: boolean;
|
|
69
|
+
/** Maximum number of blocks to fetch in a single batch request */
|
|
70
|
+
maxBatchSize?: number;
|
|
71
|
+
/** Timeout in milliseconds for batch fetch requests */
|
|
72
|
+
timeoutMs?: number;
|
|
73
|
+
};
|
|
63
74
|
export type BlockUpdateCallback = (data: SyncBlockInstance) => void;
|
|
64
75
|
export type BlockSubscriptionErrorCallback = (error: Error) => void;
|
|
65
76
|
export type Unsubscribe = () => void;
|
|
66
77
|
export interface ADFFetchProvider {
|
|
67
|
-
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
78
|
+
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig) => Promise<SyncBlockInstance[]>;
|
|
68
79
|
fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
|
|
69
80
|
fetchReferences: (referenceResourceId: string) => Promise<ReferenceSyncBlockData>;
|
|
70
81
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReferenceSyncBlockResponse, SyncBlockProduct, SyncBlockStatus, DeletionReason } from '../../common/types';
|
|
2
|
+
import type { BatchFetchConfig } from '../../providers/types';
|
|
2
3
|
export type BlockContentResponse = {
|
|
3
4
|
blockAri: string;
|
|
4
5
|
blockInstanceId: string;
|
|
@@ -111,6 +112,7 @@ type UpdateReferenceSyncedBlockOnDocumentRequest = {
|
|
|
111
112
|
};
|
|
112
113
|
export type BatchRetrieveSyncedBlocksRequest = {
|
|
113
114
|
blockIdentifiers: BlockIdentifier[];
|
|
115
|
+
config?: BatchFetchConfig;
|
|
114
116
|
};
|
|
115
117
|
type BlockIdentifier = {
|
|
116
118
|
blockAri: string;
|
|
@@ -139,6 +141,7 @@ export declare const getSyncedBlockContent: ({ blockAri, }: GetSyncedBlockConten
|
|
|
139
141
|
* Calls the Block Service GraphQL API: `blockService_batchRetrieveBlocks`
|
|
140
142
|
*
|
|
141
143
|
* @param blockIdentifiers - Array of block identifiers to retrieve
|
|
144
|
+
* @param config - Optional batch fetch configuration (e.g. timeout)
|
|
142
145
|
* @returns A promise containing arrays of successfully fetched blocks and any errors encountered
|
|
143
146
|
*/
|
|
144
147
|
export declare const batchRetrieveSyncedBlocks: ({ blockIdentifiers, }: BatchRetrieveSyncedBlocksRequest) => Promise<BatchRetrieveSyncedBlocksResponse>;
|
|
@@ -13,7 +13,7 @@ export { getJiraWorkItemAri, getJiraWorkItemIdFromAri } from './clients/jira/ari
|
|
|
13
13
|
export { useMemoizedBlockServiceAPIProviders, useMemoizedBlockServiceFetchOnlyAPIProvider, fetchReferences, batchFetchData, writeDataBatch, blockAriToResourceId, convertToSyncBlockData, extractResourceIdFromBlockAri, } from './providers/block-service/blockServiceAPI';
|
|
14
14
|
export { fetchConfluencePageInfo } from './clients/confluence/sourceInfo';
|
|
15
15
|
export { SyncedBlockProvider, useMemoizedSyncedBlockProvider } from './providers/syncBlockProvider';
|
|
16
|
-
export type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
16
|
+
export type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, BlockSubscriptionErrorCallback, BlockUpdateCallback, SyncBlockDataProviderInterface, SyncBlockInstance, MediaEmojiProviderOptions, SyncedBlockRendererProviderOptions, SyncBlockRendererProviderCreator, SyncedBlockRendererDataProviders, Unsubscribe, UpdateReferenceSyncBlockResult, WriteSyncBlockResult, SyncBlockParentInfo, SyncBlockSourceInfo, } from './providers/types';
|
|
17
17
|
export { ReferenceSyncBlockStoreManager } from './store-manager/referenceSyncBlockStoreManager';
|
|
18
18
|
export { SyncBlockInMemorySessionCache, syncBlockInMemorySessionCache, } from './store-manager/syncBlockInMemorySessionCache';
|
|
19
19
|
export { SyncBlockStoreManager, useMemoizedSyncBlockStoreManager, } from './store-manager/syncBlockStoreManager';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type BlockContentResponse } from '../../clients/block-service/blockService';
|
|
2
2
|
import { SyncBlockError, type ReferenceSyncBlockData, type ResourceId, type SyncBlockAttrs, type SyncBlockData, type SyncBlockProduct } from '../../common/types';
|
|
3
|
-
import type { ADFFetchProvider, ADFWriteProvider, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
3
|
+
import type { ADFFetchProvider, ADFWriteProvider, BatchFetchConfig, BlockNodeIdentifiers, DeleteSyncBlockResult, SyncBlockInstance, UpdateReferenceSyncBlockResult, WriteSyncBlockResult } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the ResourceId from a block ARI by returning the full path after synced-block/.
|
|
6
6
|
*
|
|
@@ -30,9 +30,10 @@ export declare const extractResourceIdFromBlockAri: (blockAri: string) => string
|
|
|
30
30
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
31
31
|
* @param parentAri - The ARI of the parent of the block. E.G the ARI of the confluence page, or the ARI of the Jira work item
|
|
32
32
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
33
|
+
* @param config - Optional batch fetch configuration
|
|
33
34
|
* @returns Array of SyncBlockInstance results
|
|
34
35
|
*/
|
|
35
|
-
export declare const batchFetchData: (cloudId: string, parentAri: string | undefined, blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
36
|
+
export declare const batchFetchData: (cloudId: string, parentAri: string | undefined, blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig) => Promise<SyncBlockInstance[]>;
|
|
36
37
|
/**
|
|
37
38
|
* Batch writes multiple synced blocks.
|
|
38
39
|
* @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
|
|
@@ -60,9 +61,10 @@ declare class BlockServiceADFFetchProvider implements ADFFetchProvider {
|
|
|
60
61
|
/**
|
|
61
62
|
* Batch fetches multiple synced blocks by their resource IDs.
|
|
62
63
|
* @param blockNodeIdentifiers - Array of block node identifiers to fetch
|
|
64
|
+
* @param config - Optional batch fetch configuration
|
|
63
65
|
* @returns Array of SyncBlockInstance results
|
|
64
66
|
*/
|
|
65
|
-
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[]): Promise<SyncBlockInstance[]>;
|
|
67
|
+
batchFetchData(blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig): Promise<SyncBlockInstance[]>;
|
|
66
68
|
/**
|
|
67
69
|
* Subscribes to real-time updates for a specific block using GraphQL WebSocket subscriptions.
|
|
68
70
|
* @param resourceId - The resource ID of the block to subscribe to
|
|
@@ -60,11 +60,22 @@ export type BlockNodeIdentifiers = {
|
|
|
60
60
|
blockInstanceId: string;
|
|
61
61
|
resourceId: string;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Configuration options for batch fetch operations
|
|
65
|
+
*/
|
|
66
|
+
export type BatchFetchConfig = {
|
|
67
|
+
/** Whether the batch fetch is being performed in a server-side rendering context */
|
|
68
|
+
isSSR?: boolean;
|
|
69
|
+
/** Maximum number of blocks to fetch in a single batch request */
|
|
70
|
+
maxBatchSize?: number;
|
|
71
|
+
/** Timeout in milliseconds for batch fetch requests */
|
|
72
|
+
timeoutMs?: number;
|
|
73
|
+
};
|
|
63
74
|
export type BlockUpdateCallback = (data: SyncBlockInstance) => void;
|
|
64
75
|
export type BlockSubscriptionErrorCallback = (error: Error) => void;
|
|
65
76
|
export type Unsubscribe = () => void;
|
|
66
77
|
export interface ADFFetchProvider {
|
|
67
|
-
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[]) => Promise<SyncBlockInstance[]>;
|
|
78
|
+
batchFetchData: (blockNodeIdentifiers: BlockNodeIdentifiers[], config?: BatchFetchConfig) => Promise<SyncBlockInstance[]>;
|
|
68
79
|
fetchData: (resourceId: ResourceId) => Promise<SyncBlockInstance>;
|
|
69
80
|
fetchReferences: (referenceResourceId: string) => Promise<ReferenceSyncBlockData>;
|
|
70
81
|
/**
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"uuid": "^3.1.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@atlaskit/editor-common": "^111.
|
|
40
|
+
"@atlaskit/editor-common": "^111.30.0",
|
|
41
41
|
"react": "^18.2.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"name": "@atlaskit/editor-synced-block-provider",
|
|
83
|
-
"version": "3.
|
|
83
|
+
"version": "3.32.0",
|
|
84
84
|
"description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
|
|
85
85
|
"author": "Atlassian Pty Ltd",
|
|
86
86
|
"license": "Apache-2.0",
|