@aws-amplify/datastore 3.4.9-in-app-messaging.37 → 3.4.9-in-app-messaging.53
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 +20 -0
- package/dist/aws-amplify-datastore.js +184 -31
- package/dist/aws-amplify-datastore.js.map +1 -1
- package/dist/aws-amplify-datastore.min.js +7 -7
- package/dist/aws-amplify-datastore.min.js.map +1 -1
- package/lib/datastore/datastore.d.ts +2 -2
- package/lib/datastore/datastore.js +20 -9
- package/lib/datastore/datastore.js.map +1 -1
- package/lib/storage/adapter/AsyncStorageAdapter.js +13 -6
- package/lib/storage/adapter/AsyncStorageAdapter.js.map +1 -1
- package/lib/storage/adapter/IndexedDBAdapter.js +15 -9
- package/lib/storage/adapter/IndexedDBAdapter.js.map +1 -1
- package/lib/types.d.ts +10 -0
- package/lib/types.js +5 -0
- package/lib/types.js.map +1 -1
- package/lib/util.d.ts +23 -1
- package/lib/util.js +89 -1
- package/lib/util.js.map +1 -1
- package/lib-esm/datastore/datastore.d.ts +2 -2
- package/lib-esm/datastore/datastore.js +21 -10
- package/lib-esm/datastore/datastore.js.map +1 -1
- package/lib-esm/storage/adapter/AsyncStorageAdapter.js +13 -6
- package/lib-esm/storage/adapter/AsyncStorageAdapter.js.map +1 -1
- package/lib-esm/storage/adapter/IndexedDBAdapter.js +15 -9
- package/lib-esm/storage/adapter/IndexedDBAdapter.js.map +1 -1
- package/lib-esm/types.d.ts +10 -0
- package/lib-esm/types.js +5 -0
- package/lib-esm/types.js.map +1 -1
- package/lib-esm/util.d.ts +23 -1
- package/lib-esm/util.js +90 -2
- package/lib-esm/util.js.map +1 -1
- package/package.json +7 -7
- package/src/datastore/datastore.ts +140 -135
- package/src/storage/adapter/AsyncStorageAdapter.ts +20 -18
- package/src/storage/adapter/IndexedDBAdapter.ts +32 -26
- package/src/types.ts +26 -12
- package/src/util.ts +96 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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.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)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/datastore
|
|
9
|
+
|
|
10
|
+
# [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)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **@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))
|
|
15
|
+
|
|
16
|
+
## [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)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **@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))
|
|
21
|
+
|
|
22
|
+
### Reverts
|
|
23
|
+
|
|
24
|
+
- uuid dependency upgrade ([#9159](https://github.com/aws-amplify/amplify-js/issues/9159)) ([4ef8aa9](https://github.com/aws-amplify/amplify-js/commit/4ef8aa9c7c25dbe921fd02b6205b8defb93fbaec))
|
|
25
|
+
|
|
6
26
|
## [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
27
|
|
|
8
28
|
**Note:** Version bump only for package @aws-amplify/datastore
|
|
@@ -70356,11 +70356,6 @@ var parseMobileHubConfig = function parseMobileHubConfig(config) {
|
|
|
70356
70356
|
AmazonLocationService: config.geo['amazon_location_service']
|
|
70357
70357
|
};
|
|
70358
70358
|
}
|
|
70359
|
-
} // Notifications
|
|
70360
|
-
|
|
70361
|
-
|
|
70362
|
-
if (config.Notifications) {
|
|
70363
|
-
amplifyConfig.Notifications = Object.assign({}, config.Notifications);
|
|
70364
70359
|
}
|
|
70365
70360
|
|
|
70366
70361
|
amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
|
|
@@ -70464,7 +70459,7 @@ var getAmplifyUserAgent = function getAmplifyUserAgent() {
|
|
|
70464
70459
|
__webpack_require__.r(__webpack_exports__);
|
|
70465
70460
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
|
|
70466
70461
|
// generated by genversion
|
|
70467
|
-
var version = '4.3.
|
|
70462
|
+
var version = '4.3.7';
|
|
70468
70463
|
|
|
70469
70464
|
/***/ }),
|
|
70470
70465
|
|
|
@@ -82347,6 +82342,23 @@ function () {
|
|
|
82347
82342
|
var deletedItemIds = [];
|
|
82348
82343
|
var handle;
|
|
82349
82344
|
|
|
82345
|
+
var generateAndEmitSnapshot = function generateAndEmitSnapshot() {
|
|
82346
|
+
var snapshot = generateSnapshot();
|
|
82347
|
+
emitSnapshot(snapshot);
|
|
82348
|
+
}; // a mechanism to return data after X amount of seconds OR after the
|
|
82349
|
+
// "limit" (itemsChanged >= this.syncPageSize) has been reached, whichever comes first
|
|
82350
|
+
|
|
82351
|
+
|
|
82352
|
+
var limitTimerRace = new _util__WEBPACK_IMPORTED_MODULE_9__["DeferredCallbackResolver"]({
|
|
82353
|
+
callback: generateAndEmitSnapshot,
|
|
82354
|
+
errorHandler: observer.error,
|
|
82355
|
+
maxInterval: 2000
|
|
82356
|
+
});
|
|
82357
|
+
var sort = (options || {}).sort;
|
|
82358
|
+
var sortOptions = sort ? {
|
|
82359
|
+
sort: sort
|
|
82360
|
+
} : undefined;
|
|
82361
|
+
|
|
82350
82362
|
(function () {
|
|
82351
82363
|
return __awaiter(_this, void 0, void 0, function () {
|
|
82352
82364
|
var err_1;
|
|
@@ -82360,7 +82372,7 @@ function () {
|
|
|
82360
82372
|
|
|
82361
82373
|
return [4
|
|
82362
82374
|
/*yield*/
|
|
82363
|
-
, this.query(model, criteria,
|
|
82375
|
+
, this.query(model, criteria, sortOptions)];
|
|
82364
82376
|
|
|
82365
82377
|
case 1:
|
|
82366
82378
|
// first, query and return any locally-available records
|
|
@@ -82386,10 +82398,15 @@ function () {
|
|
|
82386
82398
|
|
|
82387
82399
|
var isSynced = _this.sync.getModelSyncedStatus(model);
|
|
82388
82400
|
|
|
82389
|
-
|
|
82390
|
-
|
|
82391
|
-
|
|
82392
|
-
|
|
82401
|
+
var limit = itemsChanged.size - deletedItemIds.length >= _this.syncPageSize;
|
|
82402
|
+
|
|
82403
|
+
if (limit || isSynced) {
|
|
82404
|
+
limitTimerRace.resolve();
|
|
82405
|
+
} // kicks off every subsequent race as results sync down
|
|
82406
|
+
|
|
82407
|
+
|
|
82408
|
+
limitTimerRace.start();
|
|
82409
|
+
}); // returns a set of initial/locally-available results
|
|
82393
82410
|
|
|
82394
82411
|
generateAndEmitSnapshot();
|
|
82395
82412
|
return [3
|
|
@@ -82444,11 +82461,6 @@ function () {
|
|
|
82444
82461
|
deletedItemIds = [];
|
|
82445
82462
|
};
|
|
82446
82463
|
|
|
82447
|
-
var generateAndEmitSnapshot = function generateAndEmitSnapshot() {
|
|
82448
|
-
var snapshot = generateSnapshot();
|
|
82449
|
-
emitSnapshot(snapshot);
|
|
82450
|
-
};
|
|
82451
|
-
|
|
82452
82464
|
var sortItems = function sortItems(itemsToSort) {
|
|
82453
82465
|
var modelDefinition = getModelDefinition(model);
|
|
82454
82466
|
|
|
@@ -82827,7 +82839,7 @@ _aws_amplify_core__WEBPACK_IMPORTED_MODULE_0__["Amplify"].register(instance);
|
|
|
82827
82839
|
/*!**************************!*\
|
|
82828
82840
|
!*** ./lib-esm/index.js ***!
|
|
82829
82841
|
\**************************/
|
|
82830
|
-
/*! exports provided: DataStore, DataStoreClass, initSchema, Predicates, ModelPredicateCreator, ModelSortPredicateCreator, utils, isSchemaModel, isAssociatedWith, isTargetNameAssociation, isModelAttributeAuth, isModelAttributeKey, isModelAttributePrimaryKey, isModelAttributeCompositeKey, ModelAttributeAuthAllow, ModelAttributeAuthProvider, GraphQLScalarType, isGraphQLScalarType, isModelFieldType, isNonModelFieldType, isEnumFieldType, OpType, isPredicateObj, isPredicateGroup, QueryOne, SortDirection, AuthModeStrategyType, ModelOperation, syncExpression, DISCARD */
|
|
82842
|
+
/*! exports provided: DataStore, DataStoreClass, initSchema, Predicates, ModelPredicateCreator, ModelSortPredicateCreator, utils, isSchemaModel, isAssociatedWith, isTargetNameAssociation, isModelAttributeAuth, isModelAttributeKey, isModelAttributePrimaryKey, isModelAttributeCompositeKey, ModelAttributeAuthAllow, ModelAttributeAuthProvider, GraphQLScalarType, isGraphQLScalarType, isModelFieldType, isNonModelFieldType, isEnumFieldType, OpType, isPredicateObj, isPredicateGroup, QueryOne, SortDirection, AuthModeStrategyType, ModelOperation, syncExpression, DISCARD, LimitTimerRaceResolvedValues */
|
|
82831
82843
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
82832
82844
|
|
|
82833
82845
|
"use strict";
|
|
@@ -82895,6 +82907,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
82895
82907
|
|
|
82896
82908
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DISCARD", function() { return _types__WEBPACK_IMPORTED_MODULE_3__["DISCARD"]; });
|
|
82897
82909
|
|
|
82910
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LimitTimerRaceResolvedValues", function() { return _types__WEBPACK_IMPORTED_MODULE_3__["LimitTimerRaceResolvedValues"]; });
|
|
82911
|
+
|
|
82898
82912
|
|
|
82899
82913
|
|
|
82900
82914
|
|
|
@@ -83609,7 +83623,7 @@ function () {
|
|
|
83609
83623
|
var e_2, _a, e_3, _b, e_4, _c;
|
|
83610
83624
|
|
|
83611
83625
|
return __awaiter(this, void 0, void 0, function () {
|
|
83612
|
-
var namespace, relations, connectionStoreNames, modelConstructor, relations_1, relations_1_1, relation, fieldName, modelName, targetName, relationType, storeName, modelConstructor_1, _d, recordItem, connectionRecord, e_3_1, recordItem, connectionRecord, e_4_1, e_2_1;
|
|
83626
|
+
var namespace, relations, connectionStoreNames, modelConstructor, relations_1, relations_1_1, relation, fieldName, modelName, targetName, relationType, storeName, modelConstructor_1, _d, recordItem, getByfield, connectionRecord, e_3_1, recordItem, connectionRecord, e_4_1, e_2_1;
|
|
83613
83627
|
|
|
83614
83628
|
var _this = this;
|
|
83615
83629
|
|
|
@@ -83692,12 +83706,13 @@ function () {
|
|
|
83692
83706
|
/*break*/
|
|
83693
83707
|
, 9];
|
|
83694
83708
|
recordItem = records_1_1.value;
|
|
83695
|
-
|
|
83709
|
+
getByfield = recordItem[targetName] ? targetName : fieldName;
|
|
83710
|
+
if (!recordItem[getByfield]) return [3
|
|
83696
83711
|
/*break*/
|
|
83697
|
-
,
|
|
83712
|
+
, 9];
|
|
83698
83713
|
return [4
|
|
83699
83714
|
/*yield*/
|
|
83700
|
-
, this.db.get(recordItem[
|
|
83715
|
+
, this.db.get(recordItem[getByfield], storeName)];
|
|
83701
83716
|
|
|
83702
83717
|
case 7:
|
|
83703
83718
|
connectionRecord = _e.sent();
|
|
@@ -84534,6 +84549,9 @@ function () {
|
|
|
84534
84549
|
hasOneIndex = index || 'byId';
|
|
84535
84550
|
hasOneCustomField = targetName in model;
|
|
84536
84551
|
value = hasOneCustomField ? model[targetName] : model.id;
|
|
84552
|
+
if (!value) return [3
|
|
84553
|
+
/*break*/
|
|
84554
|
+
, 9];
|
|
84537
84555
|
return [4
|
|
84538
84556
|
/*yield*/
|
|
84539
84557
|
, this.db.getAll(storeName)];
|
|
@@ -86727,7 +86745,7 @@ function () {
|
|
|
86727
86745
|
var e_3, _a, e_4, _b, e_5, _c;
|
|
86728
86746
|
|
|
86729
86747
|
return __awaiter(this, void 0, void 0, function () {
|
|
86730
|
-
var namespace, relations, connectionStoreNames, modelConstructor, tx, relations_1, relations_1_1, relation, fieldName, modelName, targetName, storeName, store, modelConstructor_1, _d, recordItem, connectionRecord, e_4_1, recordItem, connectionRecord, e_5_1, e_3_1;
|
|
86748
|
+
var namespace, relations, connectionStoreNames, modelConstructor, tx, relations_1, relations_1_1, relation, fieldName, modelName, targetName, storeName, store, modelConstructor_1, _d, recordItem, getByfield, connectionRecord, e_4_1, recordItem, connectionRecord, e_5_1, e_3_1;
|
|
86731
86749
|
|
|
86732
86750
|
var _this = this;
|
|
86733
86751
|
|
|
@@ -86812,12 +86830,13 @@ function () {
|
|
|
86812
86830
|
/*break*/
|
|
86813
86831
|
, 9];
|
|
86814
86832
|
recordItem = records_1_1.value;
|
|
86815
|
-
|
|
86833
|
+
getByfield = recordItem[targetName] ? targetName : fieldName;
|
|
86834
|
+
if (!recordItem[getByfield]) return [3
|
|
86816
86835
|
/*break*/
|
|
86817
|
-
,
|
|
86836
|
+
, 9];
|
|
86818
86837
|
return [4
|
|
86819
86838
|
/*yield*/
|
|
86820
|
-
, this._get(store, recordItem[
|
|
86839
|
+
, this._get(store, recordItem[getByfield])];
|
|
86821
86840
|
|
|
86822
86841
|
case 7:
|
|
86823
86842
|
connectionRecord = _e.sent();
|
|
@@ -87798,6 +87817,9 @@ function () {
|
|
|
87798
87817
|
hasOneIndex = index || 'byId';
|
|
87799
87818
|
hasOneCustomField = targetName in model;
|
|
87800
87819
|
value = hasOneCustomField ? model[targetName] : model.id;
|
|
87820
|
+
if (!value) return [3
|
|
87821
|
+
/*break*/
|
|
87822
|
+
, 9];
|
|
87801
87823
|
return [4
|
|
87802
87824
|
/*yield*/
|
|
87803
87825
|
, this.db.transaction(storeName, 'readwrite').objectStore(storeName).index(hasOneIndex).get(value)];
|
|
@@ -94605,7 +94627,7 @@ function getTokenForCustomAuth(authMode, amplifyConfig) {
|
|
|
94605
94627
|
/*!**************************!*\
|
|
94606
94628
|
!*** ./lib-esm/types.js ***!
|
|
94607
94629
|
\**************************/
|
|
94608
|
-
/*! exports provided: isSchemaModel, isAssociatedWith, isTargetNameAssociation, isModelAttributeAuth, isModelAttributeKey, isModelAttributePrimaryKey, isModelAttributeCompositeKey, ModelAttributeAuthAllow, ModelAttributeAuthProvider, GraphQLScalarType, isGraphQLScalarType, isModelFieldType, isNonModelFieldType, isEnumFieldType, OpType, isPredicateObj, isPredicateGroup, QueryOne, SortDirection, AuthModeStrategyType, ModelOperation, syncExpression, DISCARD */
|
|
94630
|
+
/*! exports provided: isSchemaModel, isAssociatedWith, isTargetNameAssociation, isModelAttributeAuth, isModelAttributeKey, isModelAttributePrimaryKey, isModelAttributeCompositeKey, ModelAttributeAuthAllow, ModelAttributeAuthProvider, GraphQLScalarType, isGraphQLScalarType, isModelFieldType, isNonModelFieldType, isEnumFieldType, OpType, isPredicateObj, isPredicateGroup, QueryOne, SortDirection, AuthModeStrategyType, ModelOperation, syncExpression, DISCARD, LimitTimerRaceResolvedValues */
|
|
94609
94631
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
94610
94632
|
|
|
94611
94633
|
"use strict";
|
|
@@ -94633,6 +94655,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
94633
94655
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModelOperation", function() { return ModelOperation; });
|
|
94634
94656
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "syncExpression", function() { return syncExpression; });
|
|
94635
94657
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DISCARD", function() { return DISCARD; });
|
|
94658
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LimitTimerRaceResolvedValues", function() { return LimitTimerRaceResolvedValues; });
|
|
94636
94659
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "./lib-esm/util.js");
|
|
94637
94660
|
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
94638
94661
|
function adopt(value) {
|
|
@@ -94983,7 +95006,13 @@ function syncExpression(modelConstructor, conditionProducer) {
|
|
|
94983
95006
|
});
|
|
94984
95007
|
});
|
|
94985
95008
|
}
|
|
94986
|
-
var DISCARD = Symbol('DISCARD');
|
|
95009
|
+
var DISCARD = Symbol('DISCARD');
|
|
95010
|
+
var LimitTimerRaceResolvedValues;
|
|
95011
|
+
|
|
95012
|
+
(function (LimitTimerRaceResolvedValues) {
|
|
95013
|
+
LimitTimerRaceResolvedValues["LIMIT"] = "LIMIT";
|
|
95014
|
+
LimitTimerRaceResolvedValues["TIMER"] = "TIMER";
|
|
95015
|
+
})(LimitTimerRaceResolvedValues || (LimitTimerRaceResolvedValues = {})); //#endregion
|
|
94987
95016
|
|
|
94988
95017
|
/***/ }),
|
|
94989
95018
|
|
|
@@ -94991,7 +95020,7 @@ var DISCARD = Symbol('DISCARD'); //#endregion
|
|
|
94991
95020
|
/*!*************************!*\
|
|
94992
95021
|
!*** ./lib-esm/util.js ***!
|
|
94993
95022
|
\*************************/
|
|
94994
|
-
/*! exports provided: exhaustiveCheck, isNullOrUndefined, validatePredicate, validatePredicateField, isModelConstructor, registerNonModelClass, isNonModelConstructor, processCompositeKeys, establishRelationAndKeys, traverseModel, getIndex, getIndexFromAssociation, NAMESPACES, USER, SYNC, STORAGE, DATASTORE, isPrivateMode, monotonicUlidFactory, getNow, sortCompareFunction, valuesEqual, isAWSDate, isAWSTime, isAWSDateTime, isAWSTimestamp, isAWSEmail, isAWSJSON, isAWSURL, isAWSPhone, isAWSIPAddress */
|
|
95023
|
+
/*! exports provided: exhaustiveCheck, isNullOrUndefined, validatePredicate, validatePredicateField, isModelConstructor, registerNonModelClass, isNonModelConstructor, processCompositeKeys, establishRelationAndKeys, traverseModel, getIndex, getIndexFromAssociation, NAMESPACES, USER, SYNC, STORAGE, DATASTORE, isPrivateMode, monotonicUlidFactory, getNow, sortCompareFunction, valuesEqual, isAWSDate, isAWSTime, isAWSDateTime, isAWSTimestamp, isAWSEmail, isAWSJSON, isAWSURL, isAWSPhone, isAWSIPAddress, DeferredPromise, DeferredCallbackResolver */
|
|
94995
95024
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
94996
95025
|
|
|
94997
95026
|
"use strict";
|
|
@@ -95027,6 +95056,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
95027
95056
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAWSURL", function() { return isAWSURL; });
|
|
95028
95057
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAWSPhone", function() { return isAWSPhone; });
|
|
95029
95058
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isAWSIPAddress", function() { return isAWSIPAddress; });
|
|
95059
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeferredPromise", function() { return DeferredPromise; });
|
|
95060
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeferredCallbackResolver", function() { return DeferredCallbackResolver; });
|
|
95030
95061
|
/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ "../../node_modules/buffer/index.js");
|
|
95031
95062
|
/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__);
|
|
95032
95063
|
/* harmony import */ var ulid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ulid */ "../../node_modules/ulid/dist/index.esm.js");
|
|
@@ -95543,15 +95574,26 @@ var traverseModel = function traverseModel(srcModelName, instance, namespace, mo
|
|
|
95543
95574
|
|
|
95544
95575
|
try {
|
|
95545
95576
|
modelInstance = modelInstanceCreator(modelConstructor, instance[rItem.fieldName]);
|
|
95546
|
-
} catch (error) {
|
|
95577
|
+
} catch (error) {
|
|
95578
|
+
// Do nothing
|
|
95579
|
+
console.log(error);
|
|
95547
95580
|
}
|
|
95548
95581
|
|
|
95549
95582
|
result.push({
|
|
95550
95583
|
modelName: rItem.modelName,
|
|
95551
95584
|
item: instance[rItem.fieldName],
|
|
95552
95585
|
instance: modelInstance
|
|
95553
|
-
});
|
|
95554
|
-
|
|
95586
|
+
}); // targetName will be defined for Has One if feature flag
|
|
95587
|
+
// https://docs.amplify.aws/cli/reference/feature-flags/#useAppsyncModelgenPlugin
|
|
95588
|
+
// is true (default as of 5/7/21)
|
|
95589
|
+
// Making this conditional for backward-compatibility
|
|
95590
|
+
|
|
95591
|
+
if (rItem.targetName) {
|
|
95592
|
+
draftInstance[rItem.targetName] = draftInstance[rItem.fieldName].id;
|
|
95593
|
+
delete draftInstance[rItem.fieldName];
|
|
95594
|
+
} else {
|
|
95595
|
+
draftInstance[rItem.fieldName] = draftInstance[rItem.fieldName].id;
|
|
95596
|
+
}
|
|
95555
95597
|
}
|
|
95556
95598
|
|
|
95557
95599
|
break;
|
|
@@ -95890,6 +95932,117 @@ var isAWSIPAddress = function isAWSIPAddress(val) {
|
|
|
95890
95932
|
return !!/((^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$)|(^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?$))$/.exec(val);
|
|
95891
95933
|
};
|
|
95892
95934
|
|
|
95935
|
+
var DeferredPromise =
|
|
95936
|
+
/** @class */
|
|
95937
|
+
function () {
|
|
95938
|
+
function DeferredPromise() {
|
|
95939
|
+
var self = this;
|
|
95940
|
+
this.promise = new Promise(function (resolve, reject) {
|
|
95941
|
+
self.resolve = resolve;
|
|
95942
|
+
self.reject = reject;
|
|
95943
|
+
});
|
|
95944
|
+
}
|
|
95945
|
+
|
|
95946
|
+
return DeferredPromise;
|
|
95947
|
+
}();
|
|
95948
|
+
|
|
95949
|
+
|
|
95950
|
+
|
|
95951
|
+
var DeferredCallbackResolver =
|
|
95952
|
+
/** @class */
|
|
95953
|
+
function () {
|
|
95954
|
+
function DeferredCallbackResolver(options) {
|
|
95955
|
+
this.limitPromise = new DeferredPromise();
|
|
95956
|
+
this.raceInFlight = false;
|
|
95957
|
+
|
|
95958
|
+
this.callback = function () {};
|
|
95959
|
+
|
|
95960
|
+
this.defaultErrorHandler = function (msg) {
|
|
95961
|
+
if (msg === void 0) {
|
|
95962
|
+
msg = 'DeferredCallbackResolver error';
|
|
95963
|
+
}
|
|
95964
|
+
|
|
95965
|
+
throw new Error(msg);
|
|
95966
|
+
};
|
|
95967
|
+
|
|
95968
|
+
this.callback = options.callback;
|
|
95969
|
+
this.errorHandler = options.errorHandler || this.defaultErrorHandler;
|
|
95970
|
+
this.maxInterval = options.maxInterval || 2000;
|
|
95971
|
+
}
|
|
95972
|
+
|
|
95973
|
+
DeferredCallbackResolver.prototype.startTimer = function () {
|
|
95974
|
+
var _this = this;
|
|
95975
|
+
|
|
95976
|
+
this.timerPromise = new Promise(function (resolve, reject) {
|
|
95977
|
+
_this.timer = setTimeout(function () {
|
|
95978
|
+
resolve(_types__WEBPACK_IMPORTED_MODULE_3__["LimitTimerRaceResolvedValues"].TIMER);
|
|
95979
|
+
}, _this.maxInterval);
|
|
95980
|
+
});
|
|
95981
|
+
};
|
|
95982
|
+
|
|
95983
|
+
DeferredCallbackResolver.prototype.racePromises = function () {
|
|
95984
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95985
|
+
var winner, err_1;
|
|
95986
|
+
return __generator(this, function (_c) {
|
|
95987
|
+
switch (_c.label) {
|
|
95988
|
+
case 0:
|
|
95989
|
+
_c.trys.push([0, 2, 3, 4]);
|
|
95990
|
+
|
|
95991
|
+
this.raceInFlight = true;
|
|
95992
|
+
this.startTimer();
|
|
95993
|
+
return [4
|
|
95994
|
+
/*yield*/
|
|
95995
|
+
, Promise.race([this.timerPromise, this.limitPromise.promise])];
|
|
95996
|
+
|
|
95997
|
+
case 1:
|
|
95998
|
+
winner = _c.sent();
|
|
95999
|
+
this.callback();
|
|
96000
|
+
return [3
|
|
96001
|
+
/*break*/
|
|
96002
|
+
, 4];
|
|
96003
|
+
|
|
96004
|
+
case 2:
|
|
96005
|
+
err_1 = _c.sent();
|
|
96006
|
+
this.errorHandler(err_1);
|
|
96007
|
+
return [3
|
|
96008
|
+
/*break*/
|
|
96009
|
+
, 4];
|
|
96010
|
+
|
|
96011
|
+
case 3:
|
|
96012
|
+
// reset for the next race
|
|
96013
|
+
this.clear();
|
|
96014
|
+
this.raceInFlight = false;
|
|
96015
|
+
this.limitPromise = new DeferredPromise();
|
|
96016
|
+
return [2
|
|
96017
|
+
/*return*/
|
|
96018
|
+
, winner];
|
|
96019
|
+
|
|
96020
|
+
case 4:
|
|
96021
|
+
return [2
|
|
96022
|
+
/*return*/
|
|
96023
|
+
];
|
|
96024
|
+
}
|
|
96025
|
+
});
|
|
96026
|
+
});
|
|
96027
|
+
};
|
|
96028
|
+
|
|
96029
|
+
DeferredCallbackResolver.prototype.start = function () {
|
|
96030
|
+
if (!this.raceInFlight) this.racePromises();
|
|
96031
|
+
};
|
|
96032
|
+
|
|
96033
|
+
DeferredCallbackResolver.prototype.clear = function () {
|
|
96034
|
+
clearTimeout(this.timer);
|
|
96035
|
+
};
|
|
96036
|
+
|
|
96037
|
+
DeferredCallbackResolver.prototype.resolve = function () {
|
|
96038
|
+
this.limitPromise.resolve(_types__WEBPACK_IMPORTED_MODULE_3__["LimitTimerRaceResolvedValues"].LIMIT);
|
|
96039
|
+
};
|
|
96040
|
+
|
|
96041
|
+
return DeferredCallbackResolver;
|
|
96042
|
+
}();
|
|
96043
|
+
|
|
96044
|
+
|
|
96045
|
+
|
|
95893
96046
|
/***/ }),
|
|
95894
96047
|
|
|
95895
96048
|
/***/ "./node_modules/immer/dist/immer.esm.js":
|