@aws-amplify/datastore 3.7.4-custom-pk.87 → 3.7.4-custom-pk.90
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/dist/aws-amplify-datastore.js +94 -136
- package/dist/aws-amplify-datastore.js.map +1 -1
- package/dist/aws-amplify-datastore.min.js +2 -2
- package/dist/aws-amplify-datastore.min.js.map +1 -1
- package/lib/datastore/datastore.js +3 -5
- package/lib/datastore/datastore.js.map +1 -1
- package/lib/storage/adapter/IndexedDBAdapter.js +71 -101
- package/lib/storage/adapter/IndexedDBAdapter.js.map +1 -1
- package/lib/util.d.ts +1 -1
- package/lib/util.js +5 -3
- package/lib/util.js.map +1 -1
- package/lib-esm/datastore/datastore.js +3 -5
- package/lib-esm/datastore/datastore.js.map +1 -1
- package/lib-esm/storage/adapter/IndexedDBAdapter.js +71 -101
- package/lib-esm/storage/adapter/IndexedDBAdapter.js.map +1 -1
- package/lib-esm/util.d.ts +1 -1
- package/lib-esm/util.js +5 -3
- package/lib-esm/util.js.map +1 -1
- package/package.json +7 -7
- package/src/datastore/datastore.ts +2 -4
- package/src/storage/adapter/IndexedDBAdapter.ts +6 -21
- package/src/util.ts +9 -4
|
@@ -82863,7 +82863,7 @@ function () {
|
|
|
82863
82863
|
|
|
82864
82864
|
this.query = function (modelConstructor, identifierOrCriteria, paginationProducer) {
|
|
82865
82865
|
return __awaiter(_this, void 0, void 0, function () {
|
|
82866
|
-
var msg, modelDefinition, keyFields, predicate, pagination, result,
|
|
82866
|
+
var msg, modelDefinition, keyFields, predicate, pagination, result, returnOne;
|
|
82867
82867
|
return __generator(this, function (_a) {
|
|
82868
82868
|
switch (_a.label) {
|
|
82869
82869
|
case 0:
|
|
@@ -82921,8 +82921,7 @@ function () {
|
|
|
82921
82921
|
|
|
82922
82922
|
case 2:
|
|
82923
82923
|
result = _a.sent();
|
|
82924
|
-
|
|
82925
|
-
returnOne = isSingleFieldIdentifier && (isQueryOne(identifierOrCriteria) || Object(_types__WEBPACK_IMPORTED_MODULE_11__["isIdentifierObject"])(identifierOrCriteria, modelDefinition));
|
|
82924
|
+
returnOne = isQueryOne(identifierOrCriteria) || Object(_types__WEBPACK_IMPORTED_MODULE_11__["isIdentifierObject"])(identifierOrCriteria, modelDefinition);
|
|
82926
82925
|
return [2
|
|
82927
82926
|
/*return*/
|
|
82928
82927
|
, returnOne ? result[0] : result];
|
|
@@ -87731,14 +87730,14 @@ function () {
|
|
|
87731
87730
|
, idb__WEBPACK_IMPORTED_MODULE_1__["openDB"](this.dbName, VERSION, {
|
|
87732
87731
|
upgrade: function upgrade(db, oldVersion, newVersion, txn) {
|
|
87733
87732
|
return __awaiter(_this, void 0, void 0, function () {
|
|
87734
|
-
var _a, _b, storeName, origStore, tmpName,
|
|
87733
|
+
var _a, _b, storeName, origStore, tmpName, _c, namespaceName, modelName, newStore, cursor, count, e_1_1, error_2;
|
|
87735
87734
|
|
|
87736
|
-
var e_1, _d
|
|
87735
|
+
var e_1, _d;
|
|
87737
87736
|
|
|
87738
87737
|
var _this = this;
|
|
87739
87738
|
|
|
87740
|
-
return __generator(this, function (
|
|
87741
|
-
switch (
|
|
87739
|
+
return __generator(this, function (_e) {
|
|
87740
|
+
switch (_e.label) {
|
|
87742
87741
|
case 0:
|
|
87743
87742
|
if (oldVersion === 0) {
|
|
87744
87743
|
Object.keys(theSchema.namespaces).forEach(function (namespaceName) {
|
|
@@ -87757,18 +87756,18 @@ function () {
|
|
|
87757
87756
|
if (!((oldVersion === 1 || oldVersion === 2) && newVersion === 3)) return [3
|
|
87758
87757
|
/*break*/
|
|
87759
87758
|
, 16];
|
|
87760
|
-
|
|
87759
|
+
_e.label = 1;
|
|
87761
87760
|
|
|
87762
87761
|
case 1:
|
|
87763
|
-
|
|
87762
|
+
_e.trys.push([1, 14,, 15]);
|
|
87764
87763
|
|
|
87765
|
-
|
|
87764
|
+
_e.label = 2;
|
|
87766
87765
|
|
|
87767
87766
|
case 2:
|
|
87768
|
-
|
|
87767
|
+
_e.trys.push([2, 11, 12, 13]);
|
|
87769
87768
|
|
|
87770
87769
|
_a = __values(txn.objectStoreNames), _b = _a.next();
|
|
87771
|
-
|
|
87770
|
+
_e.label = 3;
|
|
87772
87771
|
|
|
87773
87772
|
case 3:
|
|
87774
87773
|
if (!!_b.done) return [3
|
|
@@ -87778,52 +87777,16 @@ function () {
|
|
|
87778
87777
|
origStore = txn.objectStore(storeName);
|
|
87779
87778
|
tmpName = "tmp_" + storeName;
|
|
87780
87779
|
origStore.name = tmpName;
|
|
87781
|
-
newStore = db.createObjectStore(storeName, {
|
|
87782
|
-
keyPath: undefined,
|
|
87783
|
-
autoIncrement: true
|
|
87784
|
-
});
|
|
87785
|
-
origIndexNames = Object.values(origStore.indexNames);
|
|
87786
|
-
|
|
87787
|
-
try {
|
|
87788
|
-
for (origIndexNames_1 = (e_2 = void 0, __values(origIndexNames)), origIndexNames_1_1 = origIndexNames_1.next(); !origIndexNames_1_1.done; origIndexNames_1_1 = origIndexNames_1.next()) {
|
|
87789
|
-
idxName = origIndexNames_1_1.value;
|
|
87790
|
-
|
|
87791
|
-
if (idxName === 'byId') {
|
|
87792
|
-
// don't migrate this index. It'll be replaced with byPk
|
|
87793
|
-
continue;
|
|
87794
|
-
}
|
|
87795
|
-
|
|
87796
|
-
idx = origStore.index(idxName);
|
|
87797
|
-
keyPath_1 = idx.keyPath, unique = idx.unique;
|
|
87798
|
-
newStore.createIndex(idxName, keyPath_1, {
|
|
87799
|
-
unique: unique
|
|
87800
|
-
});
|
|
87801
|
-
}
|
|
87802
|
-
} catch (e_2_1) {
|
|
87803
|
-
e_2 = {
|
|
87804
|
-
error: e_2_1
|
|
87805
|
-
};
|
|
87806
|
-
} finally {
|
|
87807
|
-
try {
|
|
87808
|
-
if (origIndexNames_1_1 && !origIndexNames_1_1.done && (_e = origIndexNames_1["return"])) _e.call(origIndexNames_1);
|
|
87809
|
-
} finally {
|
|
87810
|
-
if (e_2) throw e_2.error;
|
|
87811
|
-
}
|
|
87812
|
-
}
|
|
87813
|
-
|
|
87814
87780
|
_c = this.getNamespaceAndModelFromStorename(storeName), namespaceName = _c.namespaceName, modelName = _c.modelName;
|
|
87815
|
-
|
|
87816
|
-
newStore.createIndex('byPk', keyPath, {
|
|
87817
|
-
unique: true
|
|
87818
|
-
});
|
|
87781
|
+
newStore = this.createObjectStoreForModel(db, namespaceName, storeName, modelName);
|
|
87819
87782
|
return [4
|
|
87820
87783
|
/*yield*/
|
|
87821
87784
|
, origStore.openCursor()];
|
|
87822
87785
|
|
|
87823
87786
|
case 4:
|
|
87824
|
-
cursor =
|
|
87787
|
+
cursor = _e.sent();
|
|
87825
87788
|
count = 0;
|
|
87826
|
-
|
|
87789
|
+
_e.label = 5;
|
|
87827
87790
|
|
|
87828
87791
|
case 5:
|
|
87829
87792
|
if (!(cursor && cursor.value)) return [3
|
|
@@ -87836,14 +87799,14 @@ function () {
|
|
|
87836
87799
|
|
|
87837
87800
|
case 6:
|
|
87838
87801
|
// we don't pass key, since they are all new entries in the new store
|
|
87839
|
-
|
|
87802
|
+
_e.sent();
|
|
87840
87803
|
|
|
87841
87804
|
return [4
|
|
87842
87805
|
/*yield*/
|
|
87843
87806
|
, cursor["continue"]()];
|
|
87844
87807
|
|
|
87845
87808
|
case 7:
|
|
87846
|
-
cursor =
|
|
87809
|
+
cursor = _e.sent();
|
|
87847
87810
|
count++;
|
|
87848
87811
|
return [3
|
|
87849
87812
|
/*break*/
|
|
@@ -87853,7 +87816,7 @@ function () {
|
|
|
87853
87816
|
// delete original
|
|
87854
87817
|
db.deleteObjectStore(tmpName);
|
|
87855
87818
|
logger.debug(count + " " + storeName + " records migrated");
|
|
87856
|
-
|
|
87819
|
+
_e.label = 9;
|
|
87857
87820
|
|
|
87858
87821
|
case 9:
|
|
87859
87822
|
_b = _a.next();
|
|
@@ -87867,7 +87830,7 @@ function () {
|
|
|
87867
87830
|
, 13];
|
|
87868
87831
|
|
|
87869
87832
|
case 11:
|
|
87870
|
-
e_1_1 =
|
|
87833
|
+
e_1_1 = _e.sent();
|
|
87871
87834
|
e_1 = {
|
|
87872
87835
|
error: e_1_1
|
|
87873
87836
|
};
|
|
@@ -87913,7 +87876,7 @@ function () {
|
|
|
87913
87876
|
, 15];
|
|
87914
87877
|
|
|
87915
87878
|
case 14:
|
|
87916
|
-
error_2 =
|
|
87879
|
+
error_2 = _e.sent();
|
|
87917
87880
|
logger.error('Error migrating IndexedDB data', error_2);
|
|
87918
87881
|
txn.abort();
|
|
87919
87882
|
throw error_2;
|
|
@@ -87988,10 +87951,10 @@ function () {
|
|
|
87988
87951
|
};
|
|
87989
87952
|
|
|
87990
87953
|
IndexedDBAdapter.prototype.save = function (model, condition) {
|
|
87991
|
-
var
|
|
87954
|
+
var e_2, _a;
|
|
87992
87955
|
|
|
87993
87956
|
return __awaiter(this, void 0, void 0, function () {
|
|
87994
|
-
var modelConstructor, storeName, namespaceName, connectedModels, set, connectionStoreNames, tx, store, keyValues, fromDB, predicates, predicateObjs, type, isValid, msg, result, connectionStoreNames_1, connectionStoreNames_1_1, resItem, storeName_1, item, instance, keys, store_1, itemKeyValues, fromDB_1, opType, modelKeyValues, keysEqual, key,
|
|
87957
|
+
var modelConstructor, storeName, namespaceName, connectedModels, set, connectionStoreNames, tx, store, keyValues, fromDB, predicates, predicateObjs, type, isValid, msg, result, connectionStoreNames_1, connectionStoreNames_1_1, resItem, storeName_1, item, instance, keys, store_1, itemKeyValues, fromDB_1, opType, modelKeyValues, keysEqual, key, e_2_1;
|
|
87995
87958
|
|
|
87996
87959
|
var _this = this;
|
|
87997
87960
|
|
|
@@ -88117,9 +88080,9 @@ function () {
|
|
|
88117
88080
|
, 17];
|
|
88118
88081
|
|
|
88119
88082
|
case 11:
|
|
88120
|
-
|
|
88121
|
-
|
|
88122
|
-
error:
|
|
88083
|
+
e_2_1 = _b.sent();
|
|
88084
|
+
e_2 = {
|
|
88085
|
+
error: e_2_1
|
|
88123
88086
|
};
|
|
88124
88087
|
return [3
|
|
88125
88088
|
/*break*/
|
|
@@ -88146,7 +88109,7 @@ function () {
|
|
|
88146
88109
|
, 16];
|
|
88147
88110
|
|
|
88148
88111
|
case 15:
|
|
88149
|
-
if (
|
|
88112
|
+
if (e_2) throw e_2.error;
|
|
88150
88113
|
return [7
|
|
88151
88114
|
/*endfinally*/
|
|
88152
88115
|
];
|
|
@@ -88175,10 +88138,10 @@ function () {
|
|
|
88175
88138
|
IndexedDBAdapter.prototype.load = function (namespaceName, srcModelName, records) {
|
|
88176
88139
|
var records_1, records_1_1, records_2, records_2_1;
|
|
88177
88140
|
|
|
88178
|
-
var
|
|
88141
|
+
var e_3, _a, e_4, _b, e_5, _c;
|
|
88179
88142
|
|
|
88180
88143
|
return __awaiter(this, void 0, void 0, function () {
|
|
88181
|
-
var namespace, relations, connectionStoreNames, modelConstructor, tx, relations_1, relations_1_1, relation, fieldName, modelName, targetName, targetNames, storeName, store, modelConstructor_1, _d, recordItem, getByFields, allPresent, keys, connectionRecord, getByfield, key, connectionRecord,
|
|
88144
|
+
var namespace, relations, connectionStoreNames, modelConstructor, tx, relations_1, relations_1_1, relation, fieldName, modelName, targetName, targetNames, storeName, store, modelConstructor_1, _d, recordItem, getByFields, allPresent, keys, connectionRecord, getByfield, key, connectionRecord, e_4_1, recordItem, allPresent, keys, connectionRecord, key, connectionRecord, e_5_1, e_3_1;
|
|
88182
88145
|
|
|
88183
88146
|
var _this = this;
|
|
88184
88147
|
|
|
@@ -88322,9 +88285,9 @@ function () {
|
|
|
88322
88285
|
, 18];
|
|
88323
88286
|
|
|
88324
88287
|
case 12:
|
|
88325
|
-
|
|
88326
|
-
|
|
88327
|
-
error:
|
|
88288
|
+
e_4_1 = _e.sent();
|
|
88289
|
+
e_4 = {
|
|
88290
|
+
error: e_4_1
|
|
88328
88291
|
};
|
|
88329
88292
|
return [3
|
|
88330
88293
|
/*break*/
|
|
@@ -88351,7 +88314,7 @@ function () {
|
|
|
88351
88314
|
, 17];
|
|
88352
88315
|
|
|
88353
88316
|
case 16:
|
|
88354
|
-
if (
|
|
88317
|
+
if (e_4) throw e_4.error;
|
|
88355
88318
|
return [7
|
|
88356
88319
|
/*endfinally*/
|
|
88357
88320
|
];
|
|
@@ -88440,9 +88403,9 @@ function () {
|
|
|
88440
88403
|
, 33];
|
|
88441
88404
|
|
|
88442
88405
|
case 27:
|
|
88443
|
-
|
|
88444
|
-
|
|
88445
|
-
error:
|
|
88406
|
+
e_5_1 = _e.sent();
|
|
88407
|
+
e_5 = {
|
|
88408
|
+
error: e_5_1
|
|
88446
88409
|
};
|
|
88447
88410
|
return [3
|
|
88448
88411
|
/*break*/
|
|
@@ -88469,7 +88432,7 @@ function () {
|
|
|
88469
88432
|
, 32];
|
|
88470
88433
|
|
|
88471
88434
|
case 31:
|
|
88472
|
-
if (
|
|
88435
|
+
if (e_5) throw e_5.error;
|
|
88473
88436
|
return [7
|
|
88474
88437
|
/*endfinally*/
|
|
88475
88438
|
];
|
|
@@ -88507,9 +88470,9 @@ function () {
|
|
|
88507
88470
|
, 44];
|
|
88508
88471
|
|
|
88509
88472
|
case 38:
|
|
88510
|
-
|
|
88511
|
-
|
|
88512
|
-
error:
|
|
88473
|
+
e_3_1 = _e.sent();
|
|
88474
|
+
e_3 = {
|
|
88475
|
+
error: e_3_1
|
|
88513
88476
|
};
|
|
88514
88477
|
return [3
|
|
88515
88478
|
/*break*/
|
|
@@ -88536,7 +88499,7 @@ function () {
|
|
|
88536
88499
|
, 43];
|
|
88537
88500
|
|
|
88538
88501
|
case 42:
|
|
88539
|
-
if (
|
|
88502
|
+
if (e_3) throw e_3.error;
|
|
88540
88503
|
return [7
|
|
88541
88504
|
/*endfinally*/
|
|
88542
88505
|
];
|
|
@@ -88698,7 +88661,7 @@ function () {
|
|
|
88698
88661
|
};
|
|
88699
88662
|
|
|
88700
88663
|
IndexedDBAdapter.prototype.keyValueFromPredicate = function (predicates, keyPath) {
|
|
88701
|
-
var
|
|
88664
|
+
var e_6, _a;
|
|
88702
88665
|
|
|
88703
88666
|
var predicateObjs = predicates.predicates;
|
|
88704
88667
|
|
|
@@ -88716,20 +88679,20 @@ function () {
|
|
|
88716
88679
|
};
|
|
88717
88680
|
|
|
88718
88681
|
try {
|
|
88719
|
-
for (var
|
|
88720
|
-
var key =
|
|
88682
|
+
for (var keyPath_1 = __values(keyPath), keyPath_1_1 = keyPath_1.next(); !keyPath_1_1.done; keyPath_1_1 = keyPath_1.next()) {
|
|
88683
|
+
var key = keyPath_1_1.value;
|
|
88721
88684
|
|
|
88722
88685
|
_loop_1(key);
|
|
88723
88686
|
}
|
|
88724
|
-
} catch (
|
|
88725
|
-
|
|
88726
|
-
error:
|
|
88687
|
+
} catch (e_6_1) {
|
|
88688
|
+
e_6 = {
|
|
88689
|
+
error: e_6_1
|
|
88727
88690
|
};
|
|
88728
88691
|
} finally {
|
|
88729
88692
|
try {
|
|
88730
|
-
if (
|
|
88693
|
+
if (keyPath_1_1 && !keyPath_1_1.done && (_a = keyPath_1["return"])) _a.call(keyPath_1);
|
|
88731
88694
|
} finally {
|
|
88732
|
-
if (
|
|
88695
|
+
if (e_6) throw e_6.error;
|
|
88733
88696
|
}
|
|
88734
88697
|
}
|
|
88735
88698
|
|
|
@@ -89078,10 +89041,10 @@ function () {
|
|
|
89078
89041
|
IndexedDBAdapter.prototype.deleteItem = function (deleteQueue) {
|
|
89079
89042
|
var deleteQueue_1, deleteQueue_1_1;
|
|
89080
89043
|
|
|
89081
|
-
var
|
|
89044
|
+
var e_7, _a, e_8, _b;
|
|
89082
89045
|
|
|
89083
89046
|
return __awaiter(this, void 0, void 0, function () {
|
|
89084
|
-
var connectionStoreNames, tx, deleteItem, storeName, items, store, items_1, items_1_1, item, key, keyValues, itemKey,
|
|
89047
|
+
var connectionStoreNames, tx, deleteItem, storeName, items, store, items_1, items_1_1, item, key, keyValues, itemKey, e_8_1, e_7_1;
|
|
89085
89048
|
return __generator(this, function (_c) {
|
|
89086
89049
|
switch (_c.label) {
|
|
89087
89050
|
case 0:
|
|
@@ -89180,9 +89143,9 @@ function () {
|
|
|
89180
89143
|
, 20];
|
|
89181
89144
|
|
|
89182
89145
|
case 14:
|
|
89183
|
-
|
|
89184
|
-
|
|
89185
|
-
error:
|
|
89146
|
+
e_8_1 = _c.sent();
|
|
89147
|
+
e_8 = {
|
|
89148
|
+
error: e_8_1
|
|
89186
89149
|
};
|
|
89187
89150
|
return [3
|
|
89188
89151
|
/*break*/
|
|
@@ -89209,7 +89172,7 @@ function () {
|
|
|
89209
89172
|
, 19];
|
|
89210
89173
|
|
|
89211
89174
|
case 18:
|
|
89212
|
-
if (
|
|
89175
|
+
if (e_8) throw e_8.error;
|
|
89213
89176
|
return [7
|
|
89214
89177
|
/*endfinally*/
|
|
89215
89178
|
];
|
|
@@ -89230,9 +89193,9 @@ function () {
|
|
|
89230
89193
|
, 28];
|
|
89231
89194
|
|
|
89232
89195
|
case 22:
|
|
89233
|
-
|
|
89234
|
-
|
|
89235
|
-
error:
|
|
89196
|
+
e_7_1 = _c.sent();
|
|
89197
|
+
e_7 = {
|
|
89198
|
+
error: e_7_1
|
|
89236
89199
|
};
|
|
89237
89200
|
return [3
|
|
89238
89201
|
/*break*/
|
|
@@ -89259,7 +89222,7 @@ function () {
|
|
|
89259
89222
|
, 27];
|
|
89260
89223
|
|
|
89261
89224
|
case 26:
|
|
89262
|
-
if (
|
|
89225
|
+
if (e_7) throw e_7.error;
|
|
89263
89226
|
return [7
|
|
89264
89227
|
/*endfinally*/
|
|
89265
89228
|
];
|
|
@@ -89281,10 +89244,10 @@ function () {
|
|
|
89281
89244
|
IndexedDBAdapter.prototype.deleteTraverse = function (relations, models, srcModel, nameSpace, deleteQueue) {
|
|
89282
89245
|
var relations_2, relations_2_1, models_1, models_1_1, models_2, models_2_1;
|
|
89283
89246
|
|
|
89284
|
-
var
|
|
89247
|
+
var e_9, _a, e_10, _b, e_11, _c;
|
|
89285
89248
|
|
|
89286
89249
|
return __awaiter(this, void 0, void 0, function () {
|
|
89287
|
-
var rel, relationType, fieldName, modelName, targetName, targetNames, storeName, index, _d, model, hasOneIndex, hasConnectedModelFields, keyValues, values, recordToDelete, hasOneIndex_1, hasOneCustomField, keyValues, value, recordToDelete,
|
|
89250
|
+
var rel, relationType, fieldName, modelName, targetName, targetNames, storeName, index, _d, model, hasOneIndex, hasConnectedModelFields, keyValues, values, recordToDelete, hasOneIndex_1, hasOneCustomField, keyValues, value, recordToDelete, e_10_1, model, keyValues, childrenArray, e_11_1, e_9_1;
|
|
89288
89251
|
|
|
89289
89252
|
var _this = this;
|
|
89290
89253
|
|
|
@@ -89425,9 +89388,9 @@ function () {
|
|
|
89425
89388
|
, 19];
|
|
89426
89389
|
|
|
89427
89390
|
case 13:
|
|
89428
|
-
|
|
89429
|
-
|
|
89430
|
-
error:
|
|
89391
|
+
e_10_1 = _e.sent();
|
|
89392
|
+
e_10 = {
|
|
89393
|
+
error: e_10_1
|
|
89431
89394
|
};
|
|
89432
89395
|
return [3
|
|
89433
89396
|
/*break*/
|
|
@@ -89454,7 +89417,7 @@ function () {
|
|
|
89454
89417
|
, 18];
|
|
89455
89418
|
|
|
89456
89419
|
case 17:
|
|
89457
|
-
if (
|
|
89420
|
+
if (e_10) throw e_10.error;
|
|
89458
89421
|
return [7
|
|
89459
89422
|
/*endfinally*/
|
|
89460
89423
|
];
|
|
@@ -89512,9 +89475,9 @@ function () {
|
|
|
89512
89475
|
, 33];
|
|
89513
89476
|
|
|
89514
89477
|
case 27:
|
|
89515
|
-
|
|
89516
|
-
|
|
89517
|
-
error:
|
|
89478
|
+
e_11_1 = _e.sent();
|
|
89479
|
+
e_11 = {
|
|
89480
|
+
error: e_11_1
|
|
89518
89481
|
};
|
|
89519
89482
|
return [3
|
|
89520
89483
|
/*break*/
|
|
@@ -89541,7 +89504,7 @@ function () {
|
|
|
89541
89504
|
, 32];
|
|
89542
89505
|
|
|
89543
89506
|
case 31:
|
|
89544
|
-
if (
|
|
89507
|
+
if (e_11) throw e_11.error;
|
|
89545
89508
|
return [7
|
|
89546
89509
|
/*endfinally*/
|
|
89547
89510
|
];
|
|
@@ -89579,9 +89542,9 @@ function () {
|
|
|
89579
89542
|
, 44];
|
|
89580
89543
|
|
|
89581
89544
|
case 38:
|
|
89582
|
-
|
|
89583
|
-
|
|
89584
|
-
error:
|
|
89545
|
+
e_9_1 = _e.sent();
|
|
89546
|
+
e_9 = {
|
|
89547
|
+
error: e_9_1
|
|
89585
89548
|
};
|
|
89586
89549
|
return [3
|
|
89587
89550
|
/*break*/
|
|
@@ -89608,7 +89571,7 @@ function () {
|
|
|
89608
89571
|
, 43];
|
|
89609
89572
|
|
|
89610
89573
|
case 42:
|
|
89611
|
-
if (
|
|
89574
|
+
if (e_9) throw e_9.error;
|
|
89612
89575
|
return [7
|
|
89613
89576
|
/*endfinally*/
|
|
89614
89577
|
];
|
|
@@ -89665,9 +89628,9 @@ function () {
|
|
|
89665
89628
|
|
|
89666
89629
|
IndexedDBAdapter.prototype.batchSave = function (modelConstructor, items) {
|
|
89667
89630
|
return __awaiter(this, void 0, void 0, function () {
|
|
89668
|
-
var result, storeName, txn, store, _loop_2, this_1, items_2, items_2_1, item,
|
|
89631
|
+
var result, storeName, txn, store, _loop_2, this_1, items_2, items_2_1, item, e_12_1;
|
|
89669
89632
|
|
|
89670
|
-
var
|
|
89633
|
+
var e_12, _a;
|
|
89671
89634
|
|
|
89672
89635
|
var _this = this;
|
|
89673
89636
|
|
|
@@ -89790,9 +89753,9 @@ function () {
|
|
|
89790
89753
|
, 9];
|
|
89791
89754
|
|
|
89792
89755
|
case 7:
|
|
89793
|
-
|
|
89794
|
-
|
|
89795
|
-
error:
|
|
89756
|
+
e_12_1 = _b.sent();
|
|
89757
|
+
e_12 = {
|
|
89758
|
+
error: e_12_1
|
|
89796
89759
|
};
|
|
89797
89760
|
return [3
|
|
89798
89761
|
/*break*/
|
|
@@ -89802,7 +89765,7 @@ function () {
|
|
|
89802
89765
|
try {
|
|
89803
89766
|
if (items_2_1 && !items_2_1.done && (_a = items_2["return"])) _a.call(items_2);
|
|
89804
89767
|
} finally {
|
|
89805
|
-
if (
|
|
89768
|
+
if (e_12) throw e_12.error;
|
|
89806
89769
|
}
|
|
89807
89770
|
|
|
89808
89771
|
return [7
|
|
@@ -89826,26 +89789,19 @@ function () {
|
|
|
89826
89789
|
};
|
|
89827
89790
|
|
|
89828
89791
|
IndexedDBAdapter.prototype.createObjectStoreForModel = function (db, namespaceName, storeName, modelName) {
|
|
89829
|
-
|
|
89830
|
-
|
|
89831
|
-
|
|
89832
|
-
|
|
89833
|
-
|
|
89834
|
-
|
|
89835
|
-
|
|
89836
|
-
|
|
89837
|
-
|
|
89838
|
-
|
|
89839
|
-
|
|
89840
|
-
options = _b[2];
|
|
89841
|
-
|
|
89842
|
-
store.createIndex(idxName, keyPath, options);
|
|
89843
|
-
});
|
|
89844
|
-
return [2
|
|
89845
|
-
/*return*/
|
|
89846
|
-
];
|
|
89847
|
-
});
|
|
89792
|
+
var store = db.createObjectStore(storeName, {
|
|
89793
|
+
autoIncrement: true
|
|
89794
|
+
});
|
|
89795
|
+
var indexes = this.schema.namespaces[namespaceName].relationships[modelName].indexes;
|
|
89796
|
+
indexes.forEach(function (_a) {
|
|
89797
|
+
var _b = __read(_a, 3),
|
|
89798
|
+
idxName = _b[0],
|
|
89799
|
+
keyPath = _b[1],
|
|
89800
|
+
options = _b[2];
|
|
89801
|
+
|
|
89802
|
+
store.createIndex(idxName, keyPath, options);
|
|
89848
89803
|
});
|
|
89804
|
+
return store;
|
|
89849
89805
|
};
|
|
89850
89806
|
|
|
89851
89807
|
return IndexedDBAdapter;
|
|
@@ -98023,13 +97979,15 @@ var traverseModel = function traverseModel(srcModelName, instance, namespace, mo
|
|
|
98023
97979
|
return result;
|
|
98024
97980
|
};
|
|
98025
97981
|
var getIndex = function getIndex(rel, src) {
|
|
98026
|
-
var
|
|
97982
|
+
var indexName;
|
|
98027
97983
|
rel.some(function (relItem) {
|
|
98028
97984
|
if (relItem.modelName === src) {
|
|
98029
|
-
|
|
97985
|
+
var targetNames = extractTargetNamesFromSrc(relItem);
|
|
97986
|
+
indexName = targetNames && indexNameFromKeys(targetNames);
|
|
97987
|
+
return true;
|
|
98030
97988
|
}
|
|
98031
97989
|
});
|
|
98032
|
-
return
|
|
97990
|
+
return indexName;
|
|
98033
97991
|
};
|
|
98034
97992
|
var getIndexFromAssociation = function getIndexFromAssociation(indexes, src) {
|
|
98035
97993
|
var indexName;
|