@atlaskit/editor-synced-block-provider 3.30.6 → 3.31.1

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/clients/block-service/blockService.js +98 -1
  3. package/dist/cjs/clients/block-service/blockSubscription.js +48 -3
  4. package/dist/cjs/index.js +12 -33
  5. package/dist/cjs/providers/block-service/blockServiceAPI.js +509 -185
  6. package/dist/cjs/providers/syncBlockProvider.js +36 -4
  7. package/dist/cjs/store-manager/referenceSyncBlockStoreManager.js +117 -9
  8. package/dist/cjs/store-manager/syncBlockBatchFetcher.js +76 -0
  9. package/dist/cjs/store-manager/syncBlockInMemorySessionCache.js +26 -0
  10. package/dist/cjs/store-manager/syncBlockProviderFactoryManager.js +175 -0
  11. package/dist/cjs/store-manager/syncBlockSubscriptionManager.js +198 -0
  12. package/dist/es2019/clients/block-service/blockService.js +88 -0
  13. package/dist/es2019/clients/block-service/blockSubscription.js +62 -2
  14. package/dist/es2019/index.js +2 -6
  15. package/dist/es2019/providers/block-service/blockServiceAPI.js +172 -23
  16. package/dist/es2019/providers/syncBlockProvider.js +26 -0
  17. package/dist/es2019/store-manager/referenceSyncBlockStoreManager.js +93 -9
  18. package/dist/es2019/store-manager/syncBlockBatchFetcher.js +56 -0
  19. package/dist/es2019/store-manager/syncBlockInMemorySessionCache.js +24 -0
  20. package/dist/es2019/store-manager/syncBlockProviderFactoryManager.js +158 -0
  21. package/dist/es2019/store-manager/syncBlockSubscriptionManager.js +136 -0
  22. package/dist/esm/clients/block-service/blockService.js +97 -0
  23. package/dist/esm/clients/block-service/blockSubscription.js +47 -2
  24. package/dist/esm/index.js +2 -6
  25. package/dist/esm/providers/block-service/blockServiceAPI.js +513 -189
  26. package/dist/esm/providers/syncBlockProvider.js +36 -4
  27. package/dist/esm/store-manager/referenceSyncBlockStoreManager.js +117 -9
  28. package/dist/esm/store-manager/syncBlockBatchFetcher.js +69 -0
  29. package/dist/esm/store-manager/syncBlockInMemorySessionCache.js +26 -0
  30. package/dist/esm/store-manager/syncBlockProviderFactoryManager.js +168 -0
  31. package/dist/esm/store-manager/syncBlockSubscriptionManager.js +191 -0
  32. package/dist/types/clients/block-service/blockService.d.ts +36 -0
  33. package/dist/types/clients/block-service/blockSubscription.d.ts +26 -1
  34. package/dist/types/index.d.ts +2 -6
  35. package/dist/types/providers/block-service/blockServiceAPI.d.ts +15 -7
  36. package/dist/types/providers/types.d.ts +6 -0
  37. package/dist/types/store-manager/referenceSyncBlockStoreManager.d.ts +3 -0
  38. package/dist/types/store-manager/syncBlockBatchFetcher.d.ts +25 -0
  39. package/dist/types/store-manager/syncBlockInMemorySessionCache.d.ts +18 -0
  40. package/dist/types/store-manager/syncBlockProviderFactoryManager.d.ts +25 -0
  41. package/dist/types/store-manager/syncBlockSubscriptionManager.d.ts +38 -0
  42. package/dist/types-ts4.5/clients/block-service/blockService.d.ts +36 -0
  43. package/dist/types-ts4.5/clients/block-service/blockSubscription.d.ts +26 -1
  44. package/dist/types-ts4.5/index.d.ts +2 -6
  45. package/dist/types-ts4.5/providers/block-service/blockServiceAPI.d.ts +15 -7
  46. package/dist/types-ts4.5/providers/types.d.ts +6 -0
  47. package/dist/types-ts4.5/store-manager/referenceSyncBlockStoreManager.d.ts +3 -0
  48. package/dist/types-ts4.5/store-manager/syncBlockBatchFetcher.d.ts +25 -0
  49. package/dist/types-ts4.5/store-manager/syncBlockInMemorySessionCache.d.ts +18 -0
  50. package/dist/types-ts4.5/store-manager/syncBlockProviderFactoryManager.d.ts +25 -0
  51. package/dist/types-ts4.5/store-manager/syncBlockSubscriptionManager.d.ts +38 -0
  52. package/package.json +5 -3
  53. package/dist/cjs/clients/block-service/sharedSubscriptionUtils.js +0 -82
  54. package/dist/cjs/utils/__generated__/relaySubscriptionUtilsSubscription.graphql.js +0 -94
  55. package/dist/cjs/utils/relayResponseConverter.js +0 -76
  56. package/dist/cjs/utils/relaySubscriptionUtils.js +0 -130
  57. package/dist/es2019/clients/block-service/sharedSubscriptionUtils.js +0 -91
  58. package/dist/es2019/utils/__generated__/relaySubscriptionUtilsSubscription.graphql.js +0 -88
  59. package/dist/es2019/utils/relayResponseConverter.js +0 -69
  60. package/dist/es2019/utils/relaySubscriptionUtils.js +0 -125
  61. package/dist/esm/clients/block-service/sharedSubscriptionUtils.js +0 -76
  62. package/dist/esm/utils/__generated__/relaySubscriptionUtilsSubscription.graphql.js +0 -88
  63. package/dist/esm/utils/relayResponseConverter.js +0 -69
  64. package/dist/esm/utils/relaySubscriptionUtils.js +0 -123
  65. package/dist/types/clients/block-service/sharedSubscriptionUtils.d.ts +0 -61
  66. package/dist/types/utils/__generated__/relaySubscriptionUtilsSubscription.graphql.d.ts +0 -31
  67. package/dist/types/utils/relayResponseConverter.d.ts +0 -47
  68. package/dist/types/utils/relaySubscriptionUtils.d.ts +0 -61
  69. package/dist/types-ts4.5/clients/block-service/sharedSubscriptionUtils.d.ts +0 -61
  70. package/dist/types-ts4.5/utils/__generated__/relaySubscriptionUtilsSubscription.graphql.d.ts +0 -31
  71. package/dist/types-ts4.5/utils/relayResponseConverter.d.ts +0 -47
  72. package/dist/types-ts4.5/utils/relaySubscriptionUtils.d.ts +0 -61
@@ -12,12 +12,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
12
12
  /* eslint-disable require-unicode-regexp */
13
13
  import { useMemo } from 'react';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
- import { generateBlockAri, generateBlockAriFromReference } from '../../clients/block-service/ari';
16
- import { batchRetrieveSyncedBlocks, BlockError, createSyncedBlock, deleteSyncedBlock, getReferenceSyncedBlocks, getReferenceSyncedBlocksByBlockAri, getSyncedBlockContent, updateReferenceSyncedBlockOnDocument, updateSyncedBlock } from '../../clients/block-service/blockService';
15
+ import { generateBlockAri as _generateBlockAri, generateBlockAriFromReference } from '../../clients/block-service/ari';
16
+ import { batchRetrieveSyncedBlocks, BlockError, createSyncedBlock, deleteSyncedBlock, getReferenceSyncedBlocks, getReferenceSyncedBlocksByBlockAri, getSyncedBlockContent, updateReferenceSyncedBlockOnDocument, updateSyncedBlock, updateSyncedBlocks } from '../../clients/block-service/blockService';
17
17
  import { subscribeToBlockUpdates as subscribeToBlockUpdatesWS } from '../../clients/block-service/blockSubscription';
18
18
  import { SyncBlockError } from '../../common/types';
19
19
  import { stringifyError } from '../../utils/errorHandling';
20
- import { createRelaySubscriptionFunction } from '../../utils/relaySubscriptionUtils';
21
20
  import { createResourceIdForReference } from '../../utils/resourceId';
22
21
  import { convertContentUpdatedAt } from '../../utils/utils';
23
22
  var mapBlockError = function mapBlockError(error) {
@@ -416,19 +415,181 @@ var _batchFetchData = /*#__PURE__*/function () {
416
415
  return _ref3.apply(this, arguments);
417
416
  };
418
417
  }();
418
+
419
+ /**
420
+ * Batch writes multiple synced blocks.
421
+ * @param cloudId - The cloudId of the block. E.G the cloudId of the confluence page, or the cloudId of the Jira instance
422
+ * @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
423
+ * @param parentId - The parentId of the block. E.G the pageId for a confluence page, or the issueId for a Jira work item
424
+ * @param product - The product of the block. E.G 'confluence-page', 'jira-work-item'
425
+ * @param data - Array of SyncBlockData to write
426
+ * @param stepVersion - Optional version number
427
+ * @returns Array of WriteSyncBlockResult results
428
+ */
419
429
  export { _batchFetchData as batchFetchData };
430
+ export var writeDataBatch = /*#__PURE__*/function () {
431
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(cloudId, parentAri, parentId, product, data, stepVersion) {
432
+ var blockAriToResourceIdMap, blocks, response, results, successResourceIds, _iterator4, _step4, block, errorResourceIds, _iterator5, _step5, _loop;
433
+ return _regeneratorRuntime.wrap(function _callee3$(_context4) {
434
+ while (1) switch (_context4.prev = _context4.next) {
435
+ case 0:
436
+ if (!(!parentAri || !parentId)) {
437
+ _context4.next = 2;
438
+ break;
439
+ }
440
+ return _context4.abrupt("return", data.map(function (block) {
441
+ return {
442
+ error: SyncBlockError.Errored,
443
+ resourceId: block.resourceId
444
+ };
445
+ }));
446
+ case 2:
447
+ _context4.prev = 2;
448
+ // Create a map from blockAri to original resourceId for matching responses
449
+ blockAriToResourceIdMap = new Map();
450
+ blocks = data.map(function (block) {
451
+ var blockAri = _generateBlockAri({
452
+ cloudId: cloudId,
453
+ parentId: parentId,
454
+ product: product,
455
+ resourceId: block.resourceId
456
+ });
457
+ blockAriToResourceIdMap.set(blockAri, block.resourceId);
458
+ return {
459
+ blockAri: blockAri,
460
+ content: JSON.stringify(block.content),
461
+ status: block.status,
462
+ stepVersion: stepVersion
463
+ };
464
+ });
465
+ _context4.next = 7;
466
+ return updateSyncedBlocks({
467
+ blocks: blocks
468
+ });
469
+ case 7:
470
+ response = _context4.sent;
471
+ results = []; // Process successful updates
472
+ if (response.success) {
473
+ successResourceIds = new Set(response.success.map(function (block) {
474
+ return blockAriToResourceIdMap.get(block.blockAri);
475
+ }));
476
+ _iterator4 = _createForOfIteratorHelper(data);
477
+ try {
478
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
479
+ block = _step4.value;
480
+ if (successResourceIds.has(block.resourceId)) {
481
+ results.push({
482
+ resourceId: block.resourceId
483
+ });
484
+ }
485
+ }
486
+ } catch (err) {
487
+ _iterator4.e(err);
488
+ } finally {
489
+ _iterator4.f();
490
+ }
491
+ }
492
+ if (!response.error) {
493
+ _context4.next = 28;
494
+ break;
495
+ }
496
+ errorResourceIds = new Map(response.error.map(function (err) {
497
+ return [
498
+ // Use the map to get the original resourceId
499
+ blockAriToResourceIdMap.get(err.blockAri) || '', mapErrorResponseCode(err.code)];
500
+ }));
501
+ _iterator5 = _createForOfIteratorHelper(data);
502
+ _context4.prev = 13;
503
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
504
+ var block, error;
505
+ return _regeneratorRuntime.wrap(function _loop$(_context3) {
506
+ while (1) switch (_context3.prev = _context3.next) {
507
+ case 0:
508
+ block = _step5.value;
509
+ error = errorResourceIds.get(block.resourceId);
510
+ if (error) {
511
+ results.push({
512
+ error: error,
513
+ resourceId: block.resourceId
514
+ });
515
+ } else if (!results.some(function (r) {
516
+ return r.resourceId === block.resourceId;
517
+ })) {
518
+ // If not in success or error lists, mark as errored
519
+ results.push({
520
+ error: SyncBlockError.Errored,
521
+ resourceId: block.resourceId
522
+ });
523
+ }
524
+ case 3:
525
+ case "end":
526
+ return _context3.stop();
527
+ }
528
+ }, _loop);
529
+ });
530
+ _iterator5.s();
531
+ case 16:
532
+ if ((_step5 = _iterator5.n()).done) {
533
+ _context4.next = 20;
534
+ break;
535
+ }
536
+ return _context4.delegateYield(_loop(), "t0", 18);
537
+ case 18:
538
+ _context4.next = 16;
539
+ break;
540
+ case 20:
541
+ _context4.next = 25;
542
+ break;
543
+ case 22:
544
+ _context4.prev = 22;
545
+ _context4.t1 = _context4["catch"](13);
546
+ _iterator5.e(_context4.t1);
547
+ case 25:
548
+ _context4.prev = 25;
549
+ _iterator5.f();
550
+ return _context4.finish(25);
551
+ case 28:
552
+ return _context4.abrupt("return", results);
553
+ case 31:
554
+ _context4.prev = 31;
555
+ _context4.t2 = _context4["catch"](2);
556
+ if (!(_context4.t2 instanceof BlockError)) {
557
+ _context4.next = 35;
558
+ break;
559
+ }
560
+ return _context4.abrupt("return", data.map(function (block) {
561
+ return {
562
+ error: mapBlockError(_context4.t2),
563
+ resourceId: block.resourceId
564
+ };
565
+ }));
566
+ case 35:
567
+ return _context4.abrupt("return", data.map(function (block) {
568
+ return {
569
+ error: stringifyError(_context4.t2),
570
+ resourceId: block.resourceId
571
+ };
572
+ }));
573
+ case 36:
574
+ case "end":
575
+ return _context4.stop();
576
+ }
577
+ }, _callee3, null, [[2, 31], [13, 22, 25, 28]]);
578
+ }));
579
+ return function writeDataBatch(_x5, _x6, _x7, _x8, _x9, _x0) {
580
+ return _ref4.apply(this, arguments);
581
+ };
582
+ }();
420
583
  /**
421
584
  * ADFFetchProvider implementation that fetches synced block data from Block Service API
422
585
  */
423
586
  var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
424
- function BlockServiceADFFetchProvider(_ref4) {
425
- var cloudId = _ref4.cloudId,
426
- parentAri = _ref4.parentAri,
427
- relayEnvironment = _ref4.relayEnvironment;
587
+ function BlockServiceADFFetchProvider(_ref5) {
588
+ var cloudId = _ref5.cloudId,
589
+ parentAri = _ref5.parentAri;
428
590
  _classCallCheck(this, BlockServiceADFFetchProvider);
429
591
  this.cloudId = cloudId;
430
592
  this.parentAri = parentAri;
431
- this.relayEnvironment = relayEnvironment;
432
593
  }
433
594
 
434
595
  // resourceId of the reference synced block.
@@ -436,28 +597,28 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
436
597
  return _createClass(BlockServiceADFFetchProvider, [{
437
598
  key: "fetchData",
438
599
  value: function () {
439
- var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(resourceId) {
600
+ var _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(resourceId) {
440
601
  var blockAri, blockContentResponse, content, sourceAri, deletionReason, blockInstanceId, contentUpdatedAt, product, status, syncedBlockData;
441
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
442
- while (1) switch (_context3.prev = _context3.next) {
602
+ return _regeneratorRuntime.wrap(function _callee4$(_context5) {
603
+ while (1) switch (_context5.prev = _context5.next) {
443
604
  case 0:
444
605
  blockAri = generateBlockAriFromReference({
445
606
  cloudId: this.cloudId,
446
607
  resourceId: resourceId
447
608
  });
448
- _context3.prev = 1;
449
- _context3.next = 4;
609
+ _context5.prev = 1;
610
+ _context5.next = 4;
450
611
  return getSyncedBlockContent({
451
612
  blockAri: blockAri
452
613
  });
453
614
  case 4:
454
- blockContentResponse = _context3.sent;
615
+ blockContentResponse = _context5.sent;
455
616
  content = blockContentResponse.content, sourceAri = blockContentResponse.sourceAri, deletionReason = blockContentResponse.deletionReason, blockInstanceId = blockContentResponse.blockInstanceId, contentUpdatedAt = blockContentResponse.contentUpdatedAt, product = blockContentResponse.product, status = blockContentResponse.status;
456
617
  if (content) {
457
- _context3.next = 8;
618
+ _context5.next = 8;
458
619
  break;
459
620
  }
460
- return _context3.abrupt("return", {
621
+ return _context5.abrupt("return", {
461
622
  error: {
462
623
  type: SyncBlockError.NotFound,
463
624
  reason: deletionReason,
@@ -468,7 +629,7 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
468
629
  case 8:
469
630
  // Parse the synced block content from the response's content
470
631
  syncedBlockData = JSON.parse(content);
471
- return _context3.abrupt("return", {
632
+ return _context5.abrupt("return", {
472
633
  data: {
473
634
  content: syncedBlockData,
474
635
  resourceId: blockAri,
@@ -483,26 +644,26 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
483
644
  resourceId: resourceId
484
645
  });
485
646
  case 12:
486
- _context3.prev = 12;
487
- _context3.t0 = _context3["catch"](1);
488
- if (!(_context3.t0 instanceof BlockError)) {
489
- _context3.next = 16;
647
+ _context5.prev = 12;
648
+ _context5.t0 = _context5["catch"](1);
649
+ if (!(_context5.t0 instanceof BlockError)) {
650
+ _context5.next = 16;
490
651
  break;
491
652
  }
492
- return _context3.abrupt("return", {
653
+ return _context5.abrupt("return", {
493
654
  error: fg('platform_synced_block_patch_3') ? {
494
- type: mapBlockError(_context3.t0),
495
- reason: _context3.t0.message
655
+ type: mapBlockError(_context5.t0),
656
+ reason: _context5.t0.message
496
657
  } : {
497
- type: mapBlockError(_context3.t0)
658
+ type: mapBlockError(_context5.t0)
498
659
  },
499
660
  resourceId: resourceId
500
661
  });
501
662
  case 16:
502
- return _context3.abrupt("return", {
663
+ return _context5.abrupt("return", {
503
664
  error: fg('platform_synced_block_patch_3') ? {
504
665
  type: SyncBlockError.Errored,
505
- reason: _context3.t0.message
666
+ reason: _context5.t0.message
506
667
  } : {
507
668
  type: SyncBlockError.Errored
508
669
  },
@@ -510,11 +671,11 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
510
671
  });
511
672
  case 17:
512
673
  case "end":
513
- return _context3.stop();
674
+ return _context5.stop();
514
675
  }
515
- }, _callee3, this, [[1, 12]]);
676
+ }, _callee4, this, [[1, 12]]);
516
677
  }));
517
- function fetchData(_x5) {
678
+ function fetchData(_x1) {
518
679
  return _fetchData.apply(this, arguments);
519
680
  }
520
681
  return fetchData;
@@ -522,23 +683,23 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
522
683
  }, {
523
684
  key: "fetchReferences",
524
685
  value: function () {
525
- var _fetchReferences = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(referenceResourceId) {
686
+ var _fetchReferences = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(referenceResourceId) {
526
687
  var _this = this;
527
688
  var blockAri, response, references;
528
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
529
- while (1) switch (_context4.prev = _context4.next) {
689
+ return _regeneratorRuntime.wrap(function _callee5$(_context6) {
690
+ while (1) switch (_context6.prev = _context6.next) {
530
691
  case 0:
531
- _context4.prev = 0;
692
+ _context6.prev = 0;
532
693
  blockAri = generateBlockAriFromReference({
533
694
  cloudId: this.cloudId,
534
695
  resourceId: referenceResourceId
535
696
  });
536
- _context4.next = 4;
697
+ _context6.next = 4;
537
698
  return getReferenceSyncedBlocksByBlockAri({
538
699
  blockAri: blockAri
539
700
  });
540
701
  case 4:
541
- response = _context4.sent;
702
+ response = _context6.sent;
542
703
  references = [];
543
704
  response.references.forEach(function (reference) {
544
705
  references.push(_objectSpread(_objectSpread({}, reference), {}, {
@@ -556,30 +717,30 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
556
717
  });
557
718
  }
558
719
  });
559
- return _context4.abrupt("return", {
720
+ return _context6.abrupt("return", {
560
721
  references: references
561
722
  });
562
723
  case 11:
563
- _context4.prev = 11;
564
- _context4.t0 = _context4["catch"](0);
565
- if (!(_context4.t0 instanceof BlockError)) {
566
- _context4.next = 15;
724
+ _context6.prev = 11;
725
+ _context6.t0 = _context6["catch"](0);
726
+ if (!(_context6.t0 instanceof BlockError)) {
727
+ _context6.next = 15;
567
728
  break;
568
729
  }
569
- return _context4.abrupt("return", {
570
- error: mapBlockError(_context4.t0)
730
+ return _context6.abrupt("return", {
731
+ error: mapBlockError(_context6.t0)
571
732
  });
572
733
  case 15:
573
- return _context4.abrupt("return", {
734
+ return _context6.abrupt("return", {
574
735
  error: SyncBlockError.Errored
575
736
  });
576
737
  case 16:
577
738
  case "end":
578
- return _context4.stop();
739
+ return _context6.stop();
579
740
  }
580
- }, _callee4, this, [[0, 11]]);
741
+ }, _callee5, this, [[0, 11]]);
581
742
  }));
582
- function fetchReferences(_x6) {
743
+ function fetchReferences(_x10) {
583
744
  return _fetchReferences.apply(this, arguments);
584
745
  }
585
746
  return fetchReferences;
@@ -592,28 +753,27 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
592
753
  }, {
593
754
  key: "batchFetchData",
594
755
  value: (function () {
595
- var _batchFetchData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(blockNodeIdentifiers) {
596
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
597
- while (1) switch (_context5.prev = _context5.next) {
756
+ var _batchFetchData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(blockNodeIdentifiers) {
757
+ return _regeneratorRuntime.wrap(function _callee6$(_context7) {
758
+ while (1) switch (_context7.prev = _context7.next) {
598
759
  case 0:
599
- _context5.next = 2;
760
+ _context7.next = 2;
600
761
  return _batchFetchData(this.cloudId, this.parentAri, blockNodeIdentifiers);
601
762
  case 2:
602
- return _context5.abrupt("return", _context5.sent);
763
+ return _context7.abrupt("return", _context7.sent);
603
764
  case 3:
604
765
  case "end":
605
- return _context5.stop();
766
+ return _context7.stop();
606
767
  }
607
- }, _callee5, this);
768
+ }, _callee6, this);
608
769
  }));
609
- function batchFetchData(_x7) {
770
+ function batchFetchData(_x11) {
610
771
  return _batchFetchData2.apply(this, arguments);
611
772
  }
612
773
  return batchFetchData;
613
774
  }()
614
775
  /**
615
776
  * Subscribes to real-time updates for a specific block using GraphQL WebSocket subscriptions.
616
- * If a Relay environment is provided, uses Relay subscriptions; otherwise falls back to WebSocket.
617
777
  * @param resourceId - The resource ID of the block to subscribe to
618
778
  * @param onUpdate - Callback function invoked when the block is updated
619
779
  * @param onError - Optional callback function invoked on subscription errors
@@ -627,14 +787,6 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
627
787
  cloudId: this.cloudId,
628
788
  resourceId: resourceId
629
789
  });
630
-
631
- // If Relay environment is available, use Relay subscriptions
632
- if (this.relayEnvironment && fg('platform_synced_block_patch_3')) {
633
- var relaySubscribeToBlockUpdates = createRelaySubscriptionFunction(this.cloudId, this.relayEnvironment);
634
- return relaySubscribeToBlockUpdates(resourceId, onUpdate, onError);
635
- }
636
-
637
- // Fall back to WebSocket subscriptions
638
790
  return subscribeToBlockUpdatesWS(blockAri, function (parsedData) {
639
791
  // Convert ParsedBlockSubscriptionData to SyncBlockInstance
640
792
  var syncBlockInstance = {
@@ -660,12 +812,12 @@ var BlockServiceADFFetchProvider = /*#__PURE__*/function () {
660
812
  * ADFWriteProvider implementation that writes synced block data to Block Service API
661
813
  */
662
814
  var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
663
- function BlockServiceADFWriteProvider(_ref5) {
664
- var cloudId = _ref5.cloudId,
665
- parentAri = _ref5.parentAri,
666
- parentId = _ref5.parentId,
667
- product = _ref5.product,
668
- getVersion = _ref5.getVersion;
815
+ function BlockServiceADFWriteProvider(_ref6) {
816
+ var cloudId = _ref6.cloudId,
817
+ parentAri = _ref6.parentAri,
818
+ parentId = _ref6.parentId,
819
+ product = _ref6.product,
820
+ getVersion = _ref6.getVersion;
669
821
  _classCallCheck(this, BlockServiceADFWriteProvider);
670
822
  this.cloudId = cloudId;
671
823
  this.parentAri = parentAri;
@@ -678,43 +830,43 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
678
830
  return _createClass(BlockServiceADFWriteProvider, [{
679
831
  key: "writeData",
680
832
  value: function () {
681
- var _writeData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
833
+ var _writeData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
682
834
  var resourceId, blockAri, stepVersion, status;
683
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
684
- while (1) switch (_context6.prev = _context6.next) {
835
+ return _regeneratorRuntime.wrap(function _callee7$(_context8) {
836
+ while (1) switch (_context8.prev = _context8.next) {
685
837
  case 0:
686
838
  if (!(!this.parentAri || !this.parentId)) {
687
- _context6.next = 2;
839
+ _context8.next = 2;
688
840
  break;
689
841
  }
690
- return _context6.abrupt("return", {
842
+ return _context8.abrupt("return", {
691
843
  error: SyncBlockError.Errored
692
844
  });
693
845
  case 2:
694
846
  resourceId = data.resourceId;
695
- blockAri = generateBlockAri({
847
+ blockAri = _generateBlockAri({
696
848
  cloudId: this.cloudId,
697
849
  parentId: this.parentId,
698
850
  product: this.product,
699
851
  resourceId: resourceId
700
852
  });
701
853
  if (!this.getVersion) {
702
- _context6.next = 10;
854
+ _context8.next = 10;
703
855
  break;
704
856
  }
705
- _context6.next = 7;
857
+ _context8.next = 7;
706
858
  return this.getVersion();
707
859
  case 7:
708
- _context6.t0 = _context6.sent;
709
- _context6.next = 11;
860
+ _context8.t0 = _context8.sent;
861
+ _context8.next = 11;
710
862
  break;
711
863
  case 10:
712
- _context6.t0 = undefined;
864
+ _context8.t0 = undefined;
713
865
  case 11:
714
- stepVersion = _context6.t0;
715
- _context6.prev = 12;
866
+ stepVersion = _context8.t0;
867
+ _context8.prev = 12;
716
868
  status = data.status;
717
- _context6.next = 16;
869
+ _context8.next = 16;
718
870
  return updateSyncedBlock({
719
871
  blockAri: blockAri,
720
872
  content: JSON.stringify(data.content),
@@ -722,32 +874,32 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
722
874
  status: status
723
875
  });
724
876
  case 16:
725
- return _context6.abrupt("return", {
877
+ return _context8.abrupt("return", {
726
878
  resourceId: resourceId
727
879
  });
728
880
  case 19:
729
- _context6.prev = 19;
730
- _context6.t1 = _context6["catch"](12);
731
- if (!(_context6.t1 instanceof BlockError)) {
732
- _context6.next = 23;
881
+ _context8.prev = 19;
882
+ _context8.t1 = _context8["catch"](12);
883
+ if (!(_context8.t1 instanceof BlockError)) {
884
+ _context8.next = 23;
733
885
  break;
734
886
  }
735
- return _context6.abrupt("return", {
736
- error: mapBlockError(_context6.t1),
887
+ return _context8.abrupt("return", {
888
+ error: mapBlockError(_context8.t1),
737
889
  resourceId: resourceId
738
890
  });
739
891
  case 23:
740
- return _context6.abrupt("return", {
741
- error: stringifyError(_context6.t1),
892
+ return _context8.abrupt("return", {
893
+ error: stringifyError(_context8.t1),
742
894
  resourceId: resourceId
743
895
  });
744
896
  case 24:
745
897
  case "end":
746
- return _context6.stop();
898
+ return _context8.stop();
747
899
  }
748
- }, _callee6, this, [[12, 19]]);
900
+ }, _callee7, this, [[12, 19]]);
749
901
  }));
750
- function writeData(_x8) {
902
+ function writeData(_x12) {
751
903
  return _writeData.apply(this, arguments);
752
904
  }
753
905
  return writeData;
@@ -755,43 +907,43 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
755
907
  }, {
756
908
  key: "createData",
757
909
  value: function () {
758
- var _createData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
910
+ var _createData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
759
911
  var resourceId, blockAri, stepVersion, status;
760
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
761
- while (1) switch (_context7.prev = _context7.next) {
912
+ return _regeneratorRuntime.wrap(function _callee8$(_context9) {
913
+ while (1) switch (_context9.prev = _context9.next) {
762
914
  case 0:
763
915
  if (!(!this.parentAri || !this.parentId)) {
764
- _context7.next = 2;
916
+ _context9.next = 2;
765
917
  break;
766
918
  }
767
- return _context7.abrupt("return", {
919
+ return _context9.abrupt("return", {
768
920
  error: SyncBlockError.Errored
769
921
  });
770
922
  case 2:
771
923
  resourceId = data.resourceId;
772
- blockAri = generateBlockAri({
924
+ blockAri = _generateBlockAri({
773
925
  cloudId: this.cloudId,
774
926
  parentId: this.parentId,
775
927
  product: this.product,
776
928
  resourceId: resourceId
777
929
  });
778
930
  if (!this.getVersion) {
779
- _context7.next = 10;
931
+ _context9.next = 10;
780
932
  break;
781
933
  }
782
- _context7.next = 7;
934
+ _context9.next = 7;
783
935
  return this.getVersion();
784
936
  case 7:
785
- _context7.t0 = _context7.sent;
786
- _context7.next = 11;
937
+ _context9.t0 = _context9.sent;
938
+ _context9.next = 11;
787
939
  break;
788
940
  case 10:
789
- _context7.t0 = undefined;
941
+ _context9.t0 = undefined;
790
942
  case 11:
791
- stepVersion = _context7.t0;
943
+ stepVersion = _context9.t0;
792
944
  status = 'unpublished';
793
- _context7.prev = 13;
794
- _context7.next = 16;
945
+ _context9.prev = 13;
946
+ _context9.next = 16;
795
947
  return createSyncedBlock({
796
948
  blockAri: blockAri,
797
949
  blockInstanceId: data.blockInstanceId,
@@ -802,32 +954,32 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
802
954
  status: status
803
955
  });
804
956
  case 16:
805
- return _context7.abrupt("return", {
957
+ return _context9.abrupt("return", {
806
958
  resourceId: resourceId
807
959
  });
808
960
  case 19:
809
- _context7.prev = 19;
810
- _context7.t1 = _context7["catch"](13);
811
- if (!(_context7.t1 instanceof BlockError)) {
812
- _context7.next = 23;
961
+ _context9.prev = 19;
962
+ _context9.t1 = _context9["catch"](13);
963
+ if (!(_context9.t1 instanceof BlockError)) {
964
+ _context9.next = 23;
813
965
  break;
814
966
  }
815
- return _context7.abrupt("return", {
816
- error: mapBlockError(_context7.t1),
967
+ return _context9.abrupt("return", {
968
+ error: mapBlockError(_context9.t1),
817
969
  resourceId: resourceId
818
970
  });
819
971
  case 23:
820
- return _context7.abrupt("return", {
821
- error: stringifyError(_context7.t1),
972
+ return _context9.abrupt("return", {
973
+ error: stringifyError(_context9.t1),
822
974
  resourceId: resourceId
823
975
  });
824
976
  case 24:
825
977
  case "end":
826
- return _context7.stop();
978
+ return _context9.stop();
827
979
  }
828
- }, _callee7, this, [[13, 19]]);
980
+ }, _callee8, this, [[13, 19]]);
829
981
  }));
830
- function createData(_x9) {
982
+ function createData(_x13) {
831
983
  return _createData.apply(this, arguments);
832
984
  }
833
985
  return createData;
@@ -835,73 +987,73 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
835
987
  }, {
836
988
  key: "deleteData",
837
989
  value: function () {
838
- var _deleteData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(resourceId, deleteReason) {
990
+ var _deleteData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(resourceId, deleteReason) {
839
991
  var blockAri;
840
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
841
- while (1) switch (_context8.prev = _context8.next) {
992
+ return _regeneratorRuntime.wrap(function _callee9$(_context0) {
993
+ while (1) switch (_context0.prev = _context0.next) {
842
994
  case 0:
843
995
  if (this.parentId) {
844
- _context8.next = 2;
996
+ _context0.next = 2;
845
997
  break;
846
998
  }
847
- return _context8.abrupt("return", {
999
+ return _context0.abrupt("return", {
848
1000
  resourceId: resourceId,
849
1001
  success: false,
850
1002
  error: SyncBlockError.Errored
851
1003
  });
852
1004
  case 2:
853
- blockAri = generateBlockAri({
1005
+ blockAri = _generateBlockAri({
854
1006
  cloudId: this.cloudId,
855
1007
  parentId: this.parentId,
856
1008
  product: this.product,
857
1009
  resourceId: resourceId
858
1010
  });
859
- _context8.prev = 3;
860
- _context8.next = 6;
1011
+ _context0.prev = 3;
1012
+ _context0.next = 6;
861
1013
  return deleteSyncedBlock({
862
1014
  blockAri: blockAri,
863
1015
  deleteReason: deleteReason
864
1016
  });
865
1017
  case 6:
866
- return _context8.abrupt("return", {
1018
+ return _context0.abrupt("return", {
867
1019
  resourceId: resourceId,
868
1020
  success: true,
869
1021
  error: undefined
870
1022
  });
871
1023
  case 9:
872
- _context8.prev = 9;
873
- _context8.t0 = _context8["catch"](3);
874
- if (!(_context8.t0 instanceof BlockError)) {
875
- _context8.next = 15;
1024
+ _context0.prev = 9;
1025
+ _context0.t0 = _context0["catch"](3);
1026
+ if (!(_context0.t0 instanceof BlockError)) {
1027
+ _context0.next = 15;
876
1028
  break;
877
1029
  }
878
- if (!(_context8.t0.status === 404)) {
879
- _context8.next = 14;
1030
+ if (!(_context0.t0.status === 404)) {
1031
+ _context0.next = 14;
880
1032
  break;
881
1033
  }
882
- return _context8.abrupt("return", {
1034
+ return _context0.abrupt("return", {
883
1035
  resourceId: resourceId,
884
1036
  success: true
885
1037
  });
886
1038
  case 14:
887
- return _context8.abrupt("return", {
1039
+ return _context0.abrupt("return", {
888
1040
  resourceId: resourceId,
889
1041
  success: false,
890
- error: mapBlockError(_context8.t0)
1042
+ error: mapBlockError(_context0.t0)
891
1043
  });
892
1044
  case 15:
893
- return _context8.abrupt("return", {
1045
+ return _context0.abrupt("return", {
894
1046
  resourceId: resourceId,
895
1047
  success: false,
896
- error: stringifyError(_context8.t0)
1048
+ error: stringifyError(_context0.t0)
897
1049
  });
898
1050
  case 16:
899
1051
  case "end":
900
- return _context8.stop();
1052
+ return _context0.stop();
901
1053
  }
902
- }, _callee8, this, [[3, 9]]);
1054
+ }, _callee9, this, [[3, 9]]);
903
1055
  }));
904
- function deleteData(_x0, _x1) {
1056
+ function deleteData(_x14, _x15) {
905
1057
  return _deleteData.apply(this, arguments);
906
1058
  }
907
1059
  return deleteData;
@@ -916,25 +1068,35 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
916
1068
  value: function generateResourceId() {
917
1069
  return crypto.randomUUID();
918
1070
  }
1071
+ }, {
1072
+ key: "generateBlockAri",
1073
+ value: function generateBlockAri(resourceId) {
1074
+ return _generateBlockAri({
1075
+ cloudId: this.cloudId,
1076
+ parentId: this.parentId || '',
1077
+ product: this.product,
1078
+ resourceId: resourceId
1079
+ });
1080
+ }
919
1081
  }, {
920
1082
  key: "updateReferenceData",
921
1083
  value: function () {
922
- var _updateReferenceData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(blocks, noContent) {
1084
+ var _updateReferenceData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee0(blocks, noContent) {
923
1085
  var _this2 = this;
924
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
925
- while (1) switch (_context9.prev = _context9.next) {
1086
+ return _regeneratorRuntime.wrap(function _callee0$(_context1) {
1087
+ while (1) switch (_context1.prev = _context1.next) {
926
1088
  case 0:
927
1089
  if (this.parentAri) {
928
- _context9.next = 2;
1090
+ _context1.next = 2;
929
1091
  break;
930
1092
  }
931
- return _context9.abrupt("return", {
1093
+ return _context1.abrupt("return", {
932
1094
  success: false,
933
1095
  error: SyncBlockError.Errored
934
1096
  });
935
1097
  case 2:
936
- _context9.prev = 2;
937
- _context9.next = 5;
1098
+ _context1.prev = 2;
1099
+ _context1.next = 5;
938
1100
  return updateReferenceSyncedBlockOnDocument({
939
1101
  documentAri: this.parentAri,
940
1102
  blocks: blocks.map(function (block) {
@@ -949,50 +1111,214 @@ var BlockServiceADFWriteProvider = /*#__PURE__*/function () {
949
1111
  noContent: noContent
950
1112
  });
951
1113
  case 5:
952
- return _context9.abrupt("return", {
1114
+ return _context1.abrupt("return", {
953
1115
  success: true
954
1116
  });
955
1117
  case 8:
956
- _context9.prev = 8;
957
- _context9.t0 = _context9["catch"](2);
958
- if (!(_context9.t0 instanceof BlockError)) {
959
- _context9.next = 12;
1118
+ _context1.prev = 8;
1119
+ _context1.t0 = _context1["catch"](2);
1120
+ if (!(_context1.t0 instanceof BlockError)) {
1121
+ _context1.next = 12;
960
1122
  break;
961
1123
  }
962
- return _context9.abrupt("return", {
1124
+ return _context1.abrupt("return", {
963
1125
  success: false,
964
- error: mapBlockError(_context9.t0)
1126
+ error: mapBlockError(_context1.t0)
965
1127
  });
966
1128
  case 12:
967
- return _context9.abrupt("return", {
1129
+ return _context1.abrupt("return", {
968
1130
  success: false,
969
- error: stringifyError(_context9.t0)
1131
+ error: stringifyError(_context1.t0)
970
1132
  });
971
1133
  case 13:
972
1134
  case "end":
973
- return _context9.stop();
1135
+ return _context1.stop();
974
1136
  }
975
- }, _callee9, this, [[2, 8]]);
1137
+ }, _callee0, this, [[2, 8]]);
976
1138
  }));
977
- function updateReferenceData(_x10, _x11) {
1139
+ function updateReferenceData(_x16, _x17) {
978
1140
  return _updateReferenceData.apply(this, arguments);
979
1141
  }
980
1142
  return updateReferenceData;
981
1143
  }()
1144
+ }, {
1145
+ key: "writeDataBatch",
1146
+ value: function () {
1147
+ var _writeDataBatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee1(data) {
1148
+ var _this3 = this;
1149
+ var stepVersion, blockAriToResourceIdMap, blocks, response, results, successResourceIds, _iterator6, _step6, block, errorResourceIds, _iterator7, _step7, _loop2;
1150
+ return _regeneratorRuntime.wrap(function _callee1$(_context11) {
1151
+ while (1) switch (_context11.prev = _context11.next) {
1152
+ case 0:
1153
+ if (!(!this.parentAri || !this.parentId)) {
1154
+ _context11.next = 2;
1155
+ break;
1156
+ }
1157
+ return _context11.abrupt("return", data.map(function (block) {
1158
+ return {
1159
+ error: SyncBlockError.Errored,
1160
+ resourceId: block.resourceId
1161
+ };
1162
+ }));
1163
+ case 2:
1164
+ if (!this.getVersion) {
1165
+ _context11.next = 8;
1166
+ break;
1167
+ }
1168
+ _context11.next = 5;
1169
+ return this.getVersion();
1170
+ case 5:
1171
+ _context11.t0 = _context11.sent;
1172
+ _context11.next = 9;
1173
+ break;
1174
+ case 8:
1175
+ _context11.t0 = undefined;
1176
+ case 9:
1177
+ stepVersion = _context11.t0;
1178
+ _context11.prev = 10;
1179
+ // Create a map from blockAri to original resourceId for matching responses
1180
+ blockAriToResourceIdMap = new Map();
1181
+ blocks = data.map(function (block) {
1182
+ var blockAri = _this3.generateBlockAri(block.resourceId);
1183
+ blockAriToResourceIdMap.set(blockAri, block.resourceId);
1184
+ return {
1185
+ blockAri: blockAri,
1186
+ content: JSON.stringify(block.content),
1187
+ status: block.status,
1188
+ stepVersion: stepVersion
1189
+ };
1190
+ });
1191
+ _context11.next = 15;
1192
+ return updateSyncedBlocks({
1193
+ blocks: blocks
1194
+ });
1195
+ case 15:
1196
+ response = _context11.sent;
1197
+ results = []; // Process successful updates
1198
+ if (response.success) {
1199
+ successResourceIds = new Set(response.success.map(function (block) {
1200
+ return blockAriToResourceIdMap.get(block.blockAri);
1201
+ }));
1202
+ _iterator6 = _createForOfIteratorHelper(data);
1203
+ try {
1204
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1205
+ block = _step6.value;
1206
+ if (successResourceIds.has(block.resourceId)) {
1207
+ results.push({
1208
+ resourceId: block.resourceId
1209
+ });
1210
+ }
1211
+ }
1212
+ } catch (err) {
1213
+ _iterator6.e(err);
1214
+ } finally {
1215
+ _iterator6.f();
1216
+ }
1217
+ }
1218
+ if (!response.error) {
1219
+ _context11.next = 36;
1220
+ break;
1221
+ }
1222
+ errorResourceIds = new Map(response.error.map(function (err) {
1223
+ return [
1224
+ // Use the map to get the original resourceId
1225
+ blockAriToResourceIdMap.get(err.blockAri) || '', mapErrorResponseCode(err.code)];
1226
+ }));
1227
+ _iterator7 = _createForOfIteratorHelper(data);
1228
+ _context11.prev = 21;
1229
+ _loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
1230
+ var block, error;
1231
+ return _regeneratorRuntime.wrap(function _loop2$(_context10) {
1232
+ while (1) switch (_context10.prev = _context10.next) {
1233
+ case 0:
1234
+ block = _step7.value;
1235
+ error = errorResourceIds.get(block.resourceId);
1236
+ if (error) {
1237
+ results.push({
1238
+ error: error,
1239
+ resourceId: block.resourceId
1240
+ });
1241
+ } else if (!results.some(function (r) {
1242
+ return r.resourceId === block.resourceId;
1243
+ })) {
1244
+ // If not in success or error lists, mark as errored
1245
+ results.push({
1246
+ error: SyncBlockError.Errored,
1247
+ resourceId: block.resourceId
1248
+ });
1249
+ }
1250
+ case 3:
1251
+ case "end":
1252
+ return _context10.stop();
1253
+ }
1254
+ }, _loop2);
1255
+ });
1256
+ _iterator7.s();
1257
+ case 24:
1258
+ if ((_step7 = _iterator7.n()).done) {
1259
+ _context11.next = 28;
1260
+ break;
1261
+ }
1262
+ return _context11.delegateYield(_loop2(), "t1", 26);
1263
+ case 26:
1264
+ _context11.next = 24;
1265
+ break;
1266
+ case 28:
1267
+ _context11.next = 33;
1268
+ break;
1269
+ case 30:
1270
+ _context11.prev = 30;
1271
+ _context11.t2 = _context11["catch"](21);
1272
+ _iterator7.e(_context11.t2);
1273
+ case 33:
1274
+ _context11.prev = 33;
1275
+ _iterator7.f();
1276
+ return _context11.finish(33);
1277
+ case 36:
1278
+ return _context11.abrupt("return", results);
1279
+ case 39:
1280
+ _context11.prev = 39;
1281
+ _context11.t3 = _context11["catch"](10);
1282
+ if (!(_context11.t3 instanceof BlockError)) {
1283
+ _context11.next = 43;
1284
+ break;
1285
+ }
1286
+ return _context11.abrupt("return", data.map(function (block) {
1287
+ return {
1288
+ error: mapBlockError(_context11.t3),
1289
+ resourceId: block.resourceId
1290
+ };
1291
+ }));
1292
+ case 43:
1293
+ return _context11.abrupt("return", data.map(function (block) {
1294
+ return {
1295
+ error: stringifyError(_context11.t3),
1296
+ resourceId: block.resourceId
1297
+ };
1298
+ }));
1299
+ case 44:
1300
+ case "end":
1301
+ return _context11.stop();
1302
+ }
1303
+ }, _callee1, this, [[10, 39], [21, 30, 33, 36]]);
1304
+ }));
1305
+ function writeDataBatch(_x18) {
1306
+ return _writeDataBatch.apply(this, arguments);
1307
+ }
1308
+ return writeDataBatch;
1309
+ }()
982
1310
  }]);
983
1311
  }();
984
- var createBlockServiceAPIProviders = function createBlockServiceAPIProviders(_ref6) {
985
- var cloudId = _ref6.cloudId,
986
- parentAri = _ref6.parentAri,
987
- parentId = _ref6.parentId,
988
- product = _ref6.product,
989
- getVersion = _ref6.getVersion,
990
- relayEnvironment = _ref6.relayEnvironment;
1312
+ var createBlockServiceAPIProviders = function createBlockServiceAPIProviders(_ref7) {
1313
+ var cloudId = _ref7.cloudId,
1314
+ parentAri = _ref7.parentAri,
1315
+ parentId = _ref7.parentId,
1316
+ product = _ref7.product,
1317
+ getVersion = _ref7.getVersion;
991
1318
  return {
992
1319
  fetchProvider: new BlockServiceADFFetchProvider({
993
1320
  cloudId: cloudId,
994
- parentAri: parentAri,
995
- relayEnvironment: relayEnvironment
1321
+ parentAri: parentAri
996
1322
  }),
997
1323
  writeProvider: new BlockServiceADFWriteProvider({
998
1324
  cloudId: cloudId,
@@ -1003,27 +1329,25 @@ var createBlockServiceAPIProviders = function createBlockServiceAPIProviders(_re
1003
1329
  })
1004
1330
  };
1005
1331
  };
1006
- export var useMemoizedBlockServiceAPIProviders = function useMemoizedBlockServiceAPIProviders(_ref7) {
1007
- var cloudId = _ref7.cloudId,
1008
- parentAri = _ref7.parentAri,
1009
- parentId = _ref7.parentId,
1010
- product = _ref7.product,
1011
- getVersion = _ref7.getVersion,
1012
- relayEnvironment = _ref7.relayEnvironment;
1332
+ export var useMemoizedBlockServiceAPIProviders = function useMemoizedBlockServiceAPIProviders(_ref8) {
1333
+ var cloudId = _ref8.cloudId,
1334
+ parentAri = _ref8.parentAri,
1335
+ parentId = _ref8.parentId,
1336
+ product = _ref8.product,
1337
+ getVersion = _ref8.getVersion;
1013
1338
  return useMemo(function () {
1014
1339
  return createBlockServiceAPIProviders({
1015
1340
  cloudId: cloudId,
1016
1341
  parentAri: parentAri,
1017
1342
  parentId: parentId,
1018
1343
  product: product,
1019
- getVersion: getVersion,
1020
- relayEnvironment: relayEnvironment
1344
+ getVersion: getVersion
1021
1345
  });
1022
- }, [cloudId, parentAri, parentId, product, getVersion, relayEnvironment]);
1346
+ }, [cloudId, parentAri, parentId, product, getVersion]);
1023
1347
  };
1024
- var createBlockServiceFetchOnlyAPIProvider = function createBlockServiceFetchOnlyAPIProvider(_ref8) {
1025
- var cloudId = _ref8.cloudId,
1026
- parentAri = _ref8.parentAri;
1348
+ var createBlockServiceFetchOnlyAPIProvider = function createBlockServiceFetchOnlyAPIProvider(_ref9) {
1349
+ var cloudId = _ref9.cloudId,
1350
+ parentAri = _ref9.parentAri;
1027
1351
  return {
1028
1352
  fetchProvider: new BlockServiceADFFetchProvider({
1029
1353
  cloudId: cloudId,
@@ -1036,9 +1360,9 @@ var createBlockServiceFetchOnlyAPIProvider = function createBlockServiceFetchOnl
1036
1360
  /**
1037
1361
  * If the parentAri is not a valid ARI, pass in an empty string.
1038
1362
  */
1039
- export var useMemoizedBlockServiceFetchOnlyAPIProvider = function useMemoizedBlockServiceFetchOnlyAPIProvider(_ref9) {
1040
- var cloudId = _ref9.cloudId,
1041
- parentAri = _ref9.parentAri;
1363
+ export var useMemoizedBlockServiceFetchOnlyAPIProvider = function useMemoizedBlockServiceFetchOnlyAPIProvider(_ref0) {
1364
+ var cloudId = _ref0.cloudId,
1365
+ parentAri = _ref0.parentAri;
1042
1366
  return useMemo(function () {
1043
1367
  return createBlockServiceFetchOnlyAPIProvider({
1044
1368
  cloudId: cloudId,