@aws-amplify/datastore 3.5.2-unstable.5 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.5.1...@aws-amplify/datastore@3.5.2) (2021-11-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **@aws-amplify/datastore:** use forEach instead of map to iterate over unsubscribe callbacks ([#9146](https://github.com/aws-amplify/amplify-js/issues/9146)) ([ec6ee1c](https://github.com/aws-amplify/amplify-js/commit/ec6ee1c066a283e4e34a287db5712f2bb944e6ba))
12
+
13
+
14
+ ### Reverts
15
+
16
+ * uuid dependency upgrade ([#9159](https://github.com/aws-amplify/amplify-js/issues/9159)) ([4ef8aa9](https://github.com/aws-amplify/amplify-js/commit/4ef8aa9c7c25dbe921fd02b6205b8defb93fbaec))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [3.5.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.5.0...@aws-amplify/datastore@3.5.1) (2021-10-28)
7
23
 
8
24
  **Note:** Version bump only for package @aws-amplify/datastore
@@ -82408,13 +82408,11 @@ function () {
82408
82408
 
82409
82409
 
82410
82410
  var generateSnapshot = function generateSnapshot() {
82411
- var _a;
82412
-
82413
82411
  var isSynced = _this.sync.getModelSyncedStatus(model);
82414
82412
 
82415
82413
  var itemsArray = __spread(Array.from(items.values()), Array.from(itemsChanged.values()));
82416
82414
 
82417
- if ((_a = options) === null || _a === void 0 ? void 0 : _a.sort) {
82415
+ if (options === null || options === void 0 ? void 0 : options.sort) {
82418
82416
  sortItems(itemsArray);
82419
82417
  }
82420
82418
 
@@ -82462,12 +82460,12 @@ function () {
82462
82460
  var hubCallback = function hubCallback(_a) {
82463
82461
  var payload = _a.payload;
82464
82462
 
82465
- var _b, _c;
82463
+ var _b;
82466
82464
 
82467
82465
  var event = payload.event,
82468
82466
  data = payload.data;
82469
82467
 
82470
- if (event === _sync__WEBPACK_IMPORTED_MODULE_7__["ControlMessage"].SYNC_ENGINE_MODEL_SYNCED && ((_c = (_b = data) === null || _b === void 0 ? void 0 : _b.model) === null || _c === void 0 ? void 0 : _c.name) === model.name) {
82468
+ if (event === _sync__WEBPACK_IMPORTED_MODULE_7__["ControlMessage"].SYNC_ENGINE_MODEL_SYNCED && ((_b = data === null || data === void 0 ? void 0 : data.model) === null || _b === void 0 ? void 0 : _b.name) === model.name) {
82471
82469
  generateAndEmitSnapshot();
82472
82470
  _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Hub"].remove('api', hubCallback);
82473
82471
  }
@@ -92960,8 +92958,9 @@ function () {
92960
92958
  }
92961
92959
 
92962
92960
  var predicatesGroup = _predicates__WEBPACK_IMPORTED_MODULE_7__["ModelPredicateCreator"].getPredicates(_this.syncPredicates.get(modelDefinition), false);
92963
- var _b = opName,
92964
- record = data[_b]; // checking incoming subscription against syncPredicate.
92961
+ var _b = data,
92962
+ _c = opName,
92963
+ record = _b[_c]; // checking incoming subscription against syncPredicate.
92965
92964
  // once AppSync implements filters on subscriptions, we'll be
92966
92965
  // able to set these when establishing the subscription instead.
92967
92966
  // Until then, we'll need to filter inbound
@@ -93415,12 +93414,12 @@ function () {
93415
93414
  }
93416
93415
 
93417
93416
  return __awaiter(this, void 0, void 0, function () {
93418
- var _a, opName, query, variables, modelAuthModes, readAuthModes, authModeAttempts, _authModeRetry, data, _b, opResult, items, newNextToken, startedAt;
93417
+ var _a, opName, query, variables, modelAuthModes, readAuthModes, authModeAttempts, _authModeRetry, data, _b, _c, opResult, items, newNextToken, startedAt;
93419
93418
 
93420
93419
  var _this = this;
93421
93420
 
93422
- return __generator(this, function (_c) {
93423
- switch (_c.label) {
93421
+ return __generator(this, function (_d) {
93422
+ switch (_d.label) {
93424
93423
  case 0:
93425
93424
  _a = __read(this.typeQuery.get(modelDefinition), 2), opName = _a[0], query = _a[1];
93426
93425
  variables = {
@@ -93439,7 +93438,7 @@ function () {
93439
93438
  })];
93440
93439
 
93441
93440
  case 1:
93442
- modelAuthModes = _c.sent();
93441
+ modelAuthModes = _d.sent();
93443
93442
  readAuthModes = modelAuthModes.READ;
93444
93443
  authModeAttempts = 0;
93445
93444
 
@@ -93517,8 +93516,8 @@ function () {
93517
93516
  , _authModeRetry()];
93518
93517
 
93519
93518
  case 2:
93520
- data = _c.sent().data;
93521
- _b = opName, opResult = data[_b];
93519
+ data = _d.sent().data;
93520
+ _b = data, _c = opName, opResult = _b[_c];
93522
93521
  items = opResult.items, newNextToken = opResult.nextToken, startedAt = opResult.startedAt;
93523
93522
  return [2
93524
93523
  /*return*/