@aws-amplify/datastore 3.8.0 → 3.8.1-geo.11

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
@@ -16,143 +16,79 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
16
16
 
17
17
  ## [3.7.9](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.8...@aws-amplify/datastore@3.7.9) (2022-03-22)
18
18
 
19
-
20
19
  ### Bug Fixes
21
20
 
22
- * **@aws-amplify/datastore:** fix mutations to retry indefinitely on network error ([#9724](https://github.com/aws-amplify/amplify-js/issues/9724)) ([5371380](https://github.com/aws-amplify/amplify-js/commit/53713804b79df9c69ac29b75ffc576b4c2002507))
23
-
24
-
25
-
26
-
21
+ - **@aws-amplify/datastore:** fix mutations to retry indefinitely on network error ([#9724](https://github.com/aws-amplify/amplify-js/issues/9724)) ([5371380](https://github.com/aws-amplify/amplify-js/commit/53713804b79df9c69ac29b75ffc576b4c2002507))
27
22
 
28
23
  ## [3.7.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.7...@aws-amplify/datastore@3.7.8) (2022-03-10)
29
24
 
30
25
  **Note:** Version bump only for package @aws-amplify/datastore
31
26
 
32
-
33
-
34
-
35
-
36
27
  ## [3.7.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.6...@aws-amplify/datastore@3.7.7) (2022-02-28)
37
28
 
38
29
  **Note:** Version bump only for package @aws-amplify/datastore
39
30
 
40
-
41
-
42
-
43
-
44
31
  ## [3.7.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.5...@aws-amplify/datastore@3.7.6) (2022-02-03)
45
32
 
46
-
47
33
  ### Bug Fixes
48
34
 
49
- * **datastore:** correctly apply config values ([#9542](https://github.com/aws-amplify/amplify-js/issues/9542)) ([3f8b838](https://github.com/aws-amplify/amplify-js/commit/3f8b83869becf5f9963d61e6f7cfe695badb3b53))
50
-
51
-
52
-
53
-
35
+ - **datastore:** correctly apply config values ([#9542](https://github.com/aws-amplify/amplify-js/issues/9542)) ([3f8b838](https://github.com/aws-amplify/amplify-js/commit/3f8b83869becf5f9963d61e6f7cfe695badb3b53))
54
36
 
55
37
  ## [3.7.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.4...@aws-amplify/datastore@3.7.5) (2022-01-27)
56
38
 
57
39
  **Note:** Version bump only for package @aws-amplify/datastore
58
40
 
59
-
60
-
61
-
62
-
63
41
  ## [3.7.4](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.3...@aws-amplify/datastore@3.7.4) (2022-01-07)
64
42
 
65
43
  **Note:** Version bump only for package @aws-amplify/datastore
66
44
 
67
-
68
-
69
-
70
-
71
45
  ## [3.7.3](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.2...@aws-amplify/datastore@3.7.3) (2021-12-16)
72
46
 
73
-
74
47
  ### Bug Fixes
75
48
 
76
- * **@aws-amplify/datastore:** fixes observeQuery in local-only mode ([#9300](https://github.com/aws-amplify/amplify-js/issues/9300)) ([b0b57fb](https://github.com/aws-amplify/amplify-js/commit/b0b57fb1ba81d8ad190c4e67efb878ef4c6a2344))
77
-
78
-
79
-
80
-
49
+ - **@aws-amplify/datastore:** fixes observeQuery in local-only mode ([#9300](https://github.com/aws-amplify/amplify-js/issues/9300)) ([b0b57fb](https://github.com/aws-amplify/amplify-js/commit/b0b57fb1ba81d8ad190c4e67efb878ef4c6a2344))
81
50
 
82
51
  ## [3.7.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.1...@aws-amplify/datastore@3.7.2) (2021-12-03)
83
52
 
84
53
  **Note:** Version bump only for package @aws-amplify/datastore
85
54
 
86
-
87
-
88
-
89
-
90
55
  ## [3.7.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.7.0...@aws-amplify/datastore@3.7.1) (2021-12-02)
91
56
 
92
-
93
57
  ### Bug Fixes
94
58
 
95
- * **@aws-amplify/datastore:** belongsTo bug ([#9268](https://github.com/aws-amplify/amplify-js/issues/9268)) ([5106639](https://github.com/aws-amplify/amplify-js/commit/510663981a32443b79dd065ca075b664ca8bdff6))
96
- * **@aws-amplify/datastore:** consecutive saves with timestamps ([#9298](https://github.com/aws-amplify/amplify-js/issues/9298)) ([807dea0](https://github.com/aws-amplify/amplify-js/commit/807dea0acae8389854560ca73b035ecbf220d040))
97
-
98
-
99
-
100
-
59
+ - **@aws-amplify/datastore:** belongsTo bug ([#9268](https://github.com/aws-amplify/amplify-js/issues/9268)) ([5106639](https://github.com/aws-amplify/amplify-js/commit/510663981a32443b79dd065ca075b664ca8bdff6))
60
+ - **@aws-amplify/datastore:** consecutive saves with timestamps ([#9298](https://github.com/aws-amplify/amplify-js/issues/9298)) ([807dea0](https://github.com/aws-amplify/amplify-js/commit/807dea0acae8389854560ca73b035ecbf220d040))
101
61
 
102
62
  # [3.7.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.6.1...@aws-amplify/datastore@3.7.0) (2021-11-18)
103
63
 
104
-
105
64
  ### Features
106
65
 
107
- * **@aws-amplify/datastore:** hasOne CRUD improvements ([#9239](https://github.com/aws-amplify/amplify-js/issues/9239)) ([d521d17](https://github.com/aws-amplify/amplify-js/commit/d521d17c45a246c63c02a29e103e8a3db374c11e))
108
-
109
-
110
-
111
-
66
+ - **@aws-amplify/datastore:** hasOne CRUD improvements ([#9239](https://github.com/aws-amplify/amplify-js/issues/9239)) ([d521d17](https://github.com/aws-amplify/amplify-js/commit/d521d17c45a246c63c02a29e103e8a3db374c11e))
112
67
 
113
68
  ## [3.6.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.6.0...@aws-amplify/datastore@3.6.1) (2021-11-16)
114
69
 
115
70
  **Note:** Version bump only for package @aws-amplify/datastore
116
71
 
117
-
118
-
119
-
120
-
121
72
  # [3.6.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.5.2...@aws-amplify/datastore@3.6.0) (2021-11-12)
122
73
 
123
-
124
74
  ### Features
125
75
 
126
- * **@aws-amplify/datastore:** ObserveQuery performance and type enhancements ([#9141](https://github.com/aws-amplify/amplify-js/issues/9141)) ([755ce09](https://github.com/aws-amplify/amplify-js/commit/755ce09f5152c54d215f023089f30b2c98ace33a))
127
-
128
-
129
-
130
-
76
+ - **@aws-amplify/datastore:** ObserveQuery performance and type enhancements ([#9141](https://github.com/aws-amplify/amplify-js/issues/9141)) ([755ce09](https://github.com/aws-amplify/amplify-js/commit/755ce09f5152c54d215f023089f30b2c98ace33a))
131
77
 
132
78
  ## [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)
133
79
 
134
-
135
80
  ### Bug Fixes
136
81
 
137
- * **@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))
138
-
82
+ - **@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))
139
83
 
140
84
  ### Reverts
141
85
 
142
- * uuid dependency upgrade ([#9159](https://github.com/aws-amplify/amplify-js/issues/9159)) ([4ef8aa9](https://github.com/aws-amplify/amplify-js/commit/4ef8aa9c7c25dbe921fd02b6205b8defb93fbaec))
143
-
144
-
145
-
146
-
86
+ - uuid dependency upgrade ([#9159](https://github.com/aws-amplify/amplify-js/issues/9159)) ([4ef8aa9](https://github.com/aws-amplify/amplify-js/commit/4ef8aa9c7c25dbe921fd02b6205b8defb93fbaec))
147
87
 
148
88
  ## [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)
149
89
 
150
90
  **Note:** Version bump only for package @aws-amplify/datastore
151
91
 
152
-
153
-
154
-
155
-
156
92
  # [3.5.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@3.4.8...@aws-amplify/datastore@3.5.0) (2021-10-21)
157
93
 
158
94
  ### Features
@@ -71106,7 +71106,7 @@ var getAmplifyUserAgent = function getAmplifyUserAgent() {
71106
71106
  __webpack_require__.r(__webpack_exports__);
71107
71107
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
71108
71108
  // generated by genversion
71109
- var version = '4.4.2';
71109
+ var version = '4.5.0';
71110
71110
 
71111
71111
  /***/ }),
71112
71112
 
@@ -82951,11 +82951,30 @@ function () {
82951
82951
  , this.start()];
82952
82952
 
82953
82953
  case 1:
82954
- _a.sent();
82954
+ _a.sent(); // Filter the events returned by Storage according to namespace,
82955
+ // append original element data, and subscribe to the observable
82956
+
82955
82957
 
82956
82958
  handle = this.storage.observe(modelConstructor, predicate).filter(function (_a) {
82957
82959
  var model = _a.model;
82958
82960
  return namespaceResolver(model) === _util__WEBPACK_IMPORTED_MODULE_9__["USER"];
82961
+ }).map(function (event) {
82962
+ // The `element` returned by storage only contains updated fields.
82963
+ // Intercept the event to send the `savedElement` so that the first
82964
+ // snapshot returned to the consumer contains all fields.
82965
+ // In the event of a delete we return `element`, as `savedElement`
82966
+ // here is undefined.
82967
+ var opType = event.opType,
82968
+ model = event.model,
82969
+ condition = event.condition,
82970
+ element = event.element,
82971
+ savedElement = event.savedElement;
82972
+ return {
82973
+ opType: opType,
82974
+ element: savedElement || element,
82975
+ model: model,
82976
+ condition: condition
82977
+ };
82959
82978
  }).subscribe(observer);
82960
82979
  return [2
82961
82980
  /*return*/
@@ -89235,7 +89254,7 @@ function () {
89235
89254
  result = _a.sent();
89236
89255
  result.forEach(function (r) {
89237
89256
  var _a = __read(r, 2),
89238
- originalElement = _a[0],
89257
+ savedElement = _a[0],
89239
89258
  opType = _a[1]; // truthy when save is called by the Merger
89240
89259
 
89241
89260
 
@@ -89244,7 +89263,7 @@ function () {
89244
89263
  // is called by Merger, i.e., when processing an AppSync response
89245
89264
 
89246
89265
  if (opType === _types__WEBPACK_IMPORTED_MODULE_3__["OpType"].UPDATE && !syncResponse) {
89247
- updateMutationInput = _this.getUpdateMutationInput(model, originalElement, patchesTuple); // // an update without changed user fields
89266
+ updateMutationInput = _this.getUpdateMutationInput(model, savedElement, patchesTuple); // // an update without changed user fields
89248
89267
  // => don't create mutationEvent
89249
89268
 
89250
89269
  if (updateMutationInput === null) {
@@ -89252,15 +89271,16 @@ function () {
89252
89271
  }
89253
89272
  }
89254
89273
 
89255
- var element = updateMutationInput || originalElement;
89256
- var modelConstructor = Object.getPrototypeOf(originalElement).constructor;
89274
+ var element = updateMutationInput || savedElement;
89275
+ var modelConstructor = Object.getPrototypeOf(savedElement).constructor;
89257
89276
 
89258
89277
  _this.pushStream.next({
89259
89278
  model: modelConstructor,
89260
89279
  opType: opType,
89261
89280
  element: element,
89262
89281
  mutator: mutator,
89263
- condition: _predicates__WEBPACK_IMPORTED_MODULE_2__["ModelPredicateCreator"].getPredicates(condition, false)
89282
+ condition: _predicates__WEBPACK_IMPORTED_MODULE_2__["ModelPredicateCreator"].getPredicates(condition, false),
89283
+ savedElement: savedElement
89264
89284
  });
89265
89285
  });
89266
89286
  return [2