@aws-amplify/cache 4.0.50-unstable.4 → 4.0.51-size-improvement.21
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 +8 -0
- package/dist/aws-amplify-cache.js +290 -115
- package/dist/aws-amplify-cache.js.map +1 -1
- package/dist/aws-amplify-cache.min.js +15 -1
- package/dist/aws-amplify-cache.min.js.map +1 -1
- package/lib-esm/AsyncStorageCache.js +1 -49
- package/lib-esm/AsyncStorageCache.js.map +1 -1
- package/lib-esm/BrowserStorageCache.js +1 -13
- package/lib-esm/BrowserStorageCache.js.map +1 -1
- package/lib-esm/InMemoryCache.js +1 -24
- package/lib-esm/InMemoryCache.js.map +1 -1
- package/lib-esm/Utils/CacheList.js +1 -11
- package/lib-esm/Utils/CacheList.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [4.0.50](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@4.0.49...@aws-amplify/cache@4.0.50) (2022-08-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/cache
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.0.49](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@4.0.48...@aws-amplify/cache@4.0.49) (2022-07-28)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @aws-amplify/cache
|
|
@@ -96,6 +96,260 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
96
96
|
/************************************************************************/
|
|
97
97
|
/******/ ({
|
|
98
98
|
|
|
99
|
+
/***/ "../../node_modules/tslib/tslib.es6.js":
|
|
100
|
+
/*!********************************************************!*\
|
|
101
|
+
!*** /root/amplify-js/node_modules/tslib/tslib.es6.js ***!
|
|
102
|
+
\********************************************************/
|
|
103
|
+
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
|
|
104
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
105
|
+
|
|
106
|
+
"use strict";
|
|
107
|
+
__webpack_require__.r(__webpack_exports__);
|
|
108
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; });
|
|
109
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; });
|
|
110
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; });
|
|
111
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; });
|
|
112
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; });
|
|
113
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; });
|
|
114
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; });
|
|
115
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; });
|
|
116
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; });
|
|
117
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; });
|
|
118
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; });
|
|
119
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; });
|
|
120
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; });
|
|
121
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; });
|
|
122
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; });
|
|
123
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; });
|
|
124
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; });
|
|
125
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; });
|
|
126
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; });
|
|
127
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; });
|
|
128
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
|
|
129
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
|
|
130
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
|
|
131
|
+
/*! *****************************************************************************
|
|
132
|
+
Copyright (c) Microsoft Corporation.
|
|
133
|
+
|
|
134
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
135
|
+
purpose with or without fee is hereby granted.
|
|
136
|
+
|
|
137
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
138
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
139
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
140
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
141
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
142
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
143
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
144
|
+
***************************************************************************** */
|
|
145
|
+
/* global Reflect, Promise */
|
|
146
|
+
|
|
147
|
+
var extendStatics = function(d, b) {
|
|
148
|
+
extendStatics = Object.setPrototypeOf ||
|
|
149
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
150
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
151
|
+
return extendStatics(d, b);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
function __extends(d, b) {
|
|
155
|
+
extendStatics(d, b);
|
|
156
|
+
function __() { this.constructor = d; }
|
|
157
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
var __assign = function() {
|
|
161
|
+
__assign = Object.assign || function __assign(t) {
|
|
162
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
163
|
+
s = arguments[i];
|
|
164
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
165
|
+
}
|
|
166
|
+
return t;
|
|
167
|
+
}
|
|
168
|
+
return __assign.apply(this, arguments);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function __rest(s, e) {
|
|
172
|
+
var t = {};
|
|
173
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
174
|
+
t[p] = s[p];
|
|
175
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
176
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
177
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
178
|
+
t[p[i]] = s[p[i]];
|
|
179
|
+
}
|
|
180
|
+
return t;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function __decorate(decorators, target, key, desc) {
|
|
184
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
185
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
186
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
187
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function __param(paramIndex, decorator) {
|
|
191
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function __metadata(metadataKey, metadataValue) {
|
|
195
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
199
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
200
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
201
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
202
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
203
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
204
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function __generator(thisArg, body) {
|
|
209
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
210
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
211
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
212
|
+
function step(op) {
|
|
213
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
214
|
+
while (_) try {
|
|
215
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
216
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
217
|
+
switch (op[0]) {
|
|
218
|
+
case 0: case 1: t = op; break;
|
|
219
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
220
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
221
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
222
|
+
default:
|
|
223
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
224
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
225
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
226
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
227
|
+
if (t[2]) _.ops.pop();
|
|
228
|
+
_.trys.pop(); continue;
|
|
229
|
+
}
|
|
230
|
+
op = body.call(thisArg, _);
|
|
231
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
232
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function __createBinding(o, m, k, k2) {
|
|
237
|
+
if (k2 === undefined) k2 = k;
|
|
238
|
+
o[k2] = m[k];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function __exportStar(m, exports) {
|
|
242
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function __values(o) {
|
|
246
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
247
|
+
if (m) return m.call(o);
|
|
248
|
+
if (o && typeof o.length === "number") return {
|
|
249
|
+
next: function () {
|
|
250
|
+
if (o && i >= o.length) o = void 0;
|
|
251
|
+
return { value: o && o[i++], done: !o };
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function __read(o, n) {
|
|
258
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
259
|
+
if (!m) return o;
|
|
260
|
+
var i = m.call(o), r, ar = [], e;
|
|
261
|
+
try {
|
|
262
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
263
|
+
}
|
|
264
|
+
catch (error) { e = { error: error }; }
|
|
265
|
+
finally {
|
|
266
|
+
try {
|
|
267
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
268
|
+
}
|
|
269
|
+
finally { if (e) throw e.error; }
|
|
270
|
+
}
|
|
271
|
+
return ar;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function __spread() {
|
|
275
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
276
|
+
ar = ar.concat(__read(arguments[i]));
|
|
277
|
+
return ar;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function __spreadArrays() {
|
|
281
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
282
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
283
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
284
|
+
r[k] = a[j];
|
|
285
|
+
return r;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
function __await(v) {
|
|
289
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
293
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
294
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
295
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
296
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
297
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
298
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
299
|
+
function fulfill(value) { resume("next", value); }
|
|
300
|
+
function reject(value) { resume("throw", value); }
|
|
301
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function __asyncDelegator(o) {
|
|
305
|
+
var i, p;
|
|
306
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
307
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function __asyncValues(o) {
|
|
311
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
312
|
+
var m = o[Symbol.asyncIterator], i;
|
|
313
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
314
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
315
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function __makeTemplateObject(cooked, raw) {
|
|
319
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
320
|
+
return cooked;
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
function __importStar(mod) {
|
|
324
|
+
if (mod && mod.__esModule) return mod;
|
|
325
|
+
var result = {};
|
|
326
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
327
|
+
result.default = mod;
|
|
328
|
+
return result;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function __importDefault(mod) {
|
|
332
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
function __classPrivateFieldGet(receiver, privateMap) {
|
|
336
|
+
if (!privateMap.has(receiver)) {
|
|
337
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
338
|
+
}
|
|
339
|
+
return privateMap.get(receiver);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function __classPrivateFieldSet(receiver, privateMap, value) {
|
|
343
|
+
if (!privateMap.has(receiver)) {
|
|
344
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
345
|
+
}
|
|
346
|
+
privateMap.set(receiver, value);
|
|
347
|
+
return value;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
/***/ }),
|
|
352
|
+
|
|
99
353
|
/***/ "./lib-esm/BrowserStorageCache.js":
|
|
100
354
|
/*!****************************************!*\
|
|
101
355
|
!*** ./lib-esm/BrowserStorageCache.js ***!
|
|
@@ -107,10 +361,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
107
361
|
__webpack_require__.r(__webpack_exports__);
|
|
108
362
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserStorageCacheClass", function() { return BrowserStorageCacheClass; });
|
|
109
363
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserStorageCache", function() { return BrowserStorageCache; });
|
|
110
|
-
/* harmony import */ var
|
|
111
|
-
/* harmony import */ var
|
|
112
|
-
/* harmony import */ var
|
|
113
|
-
/* harmony import */ var
|
|
364
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
365
|
+
/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
|
|
366
|
+
/* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
|
|
367
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
368
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
114
369
|
/*
|
|
115
370
|
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
116
371
|
*
|
|
@@ -123,36 +378,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
123
378
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
124
379
|
* and limitations under the License.
|
|
125
380
|
*/
|
|
126
|
-
var __extends = undefined && undefined.__extends || function () {
|
|
127
|
-
var _extendStatics = function extendStatics(d, b) {
|
|
128
|
-
_extendStatics = Object.setPrototypeOf || {
|
|
129
|
-
__proto__: []
|
|
130
|
-
} instanceof Array && function (d, b) {
|
|
131
|
-
d.__proto__ = b;
|
|
132
|
-
} || function (d, b) {
|
|
133
|
-
for (var p in b) {
|
|
134
|
-
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
return _extendStatics(d, b);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
return function (d, b) {
|
|
142
|
-
_extendStatics(d, b);
|
|
143
|
-
|
|
144
|
-
function __() {
|
|
145
|
-
this.constructor = d;
|
|
146
|
-
}
|
|
147
381
|
|
|
148
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
149
|
-
};
|
|
150
|
-
}();
|
|
151
382
|
|
|
152
383
|
|
|
153
384
|
|
|
154
|
-
|
|
155
|
-
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]('Cache');
|
|
385
|
+
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]('Cache');
|
|
156
386
|
/**
|
|
157
387
|
* Customized storage based on the SessionStorage or LocalStorage with LRU implemented
|
|
158
388
|
*/
|
|
@@ -160,7 +390,7 @@ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]
|
|
|
160
390
|
var BrowserStorageCacheClass =
|
|
161
391
|
/** @class */
|
|
162
392
|
function (_super) {
|
|
163
|
-
__extends(BrowserStorageCacheClass, _super);
|
|
393
|
+
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(BrowserStorageCacheClass, _super);
|
|
164
394
|
/**
|
|
165
395
|
* initialize the cache
|
|
166
396
|
* @param config - the configuration of the cache
|
|
@@ -170,7 +400,7 @@ function (_super) {
|
|
|
170
400
|
function BrowserStorageCacheClass(config) {
|
|
171
401
|
var _this = this;
|
|
172
402
|
|
|
173
|
-
var cacheConfig = config ? Object.assign({},
|
|
403
|
+
var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"];
|
|
174
404
|
_this = _super.call(this, cacheConfig) || this;
|
|
175
405
|
_this.config.storage = cacheConfig.storage;
|
|
176
406
|
_this.getItem = _this.getItem.bind(_this);
|
|
@@ -214,7 +444,7 @@ function (_super) {
|
|
|
214
444
|
|
|
215
445
|
|
|
216
446
|
BrowserStorageCacheClass.prototype._refreshItem = function (item, prefixedKey) {
|
|
217
|
-
item.visitedTime = Object(
|
|
447
|
+
item.visitedTime = Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])();
|
|
218
448
|
this.config.storage.setItem(prefixedKey, JSON.stringify(item));
|
|
219
449
|
return item;
|
|
220
450
|
};
|
|
@@ -232,7 +462,7 @@ function (_super) {
|
|
|
232
462
|
var text = this.config.storage.getItem(key);
|
|
233
463
|
var item = JSON.parse(text);
|
|
234
464
|
|
|
235
|
-
if (Object(
|
|
465
|
+
if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])() >= item.expires) {
|
|
236
466
|
return true;
|
|
237
467
|
}
|
|
238
468
|
|
|
@@ -422,7 +652,7 @@ function (_super) {
|
|
|
422
652
|
|
|
423
653
|
var cacheItemOptions = {
|
|
424
654
|
priority: options && options.priority !== undefined ? options.priority : this.config.defaultPriority,
|
|
425
|
-
expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(
|
|
655
|
+
expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])()
|
|
426
656
|
};
|
|
427
657
|
|
|
428
658
|
if (cacheItemOptions.priority < 1 || cacheItemOptions.priority > 5) {
|
|
@@ -623,16 +853,16 @@ function (_super) {
|
|
|
623
853
|
|
|
624
854
|
|
|
625
855
|
BrowserStorageCacheClass.prototype.createInstance = function (config) {
|
|
626
|
-
if (!config.keyPrefix || config.keyPrefix ===
|
|
856
|
+
if (!config.keyPrefix || config.keyPrefix === _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"].keyPrefix) {
|
|
627
857
|
logger.error('invalid keyPrefix, setting keyPrefix with timeStamp');
|
|
628
|
-
config.keyPrefix =
|
|
858
|
+
config.keyPrefix = _Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"].toString();
|
|
629
859
|
}
|
|
630
860
|
|
|
631
861
|
return new BrowserStorageCacheClass(config);
|
|
632
862
|
};
|
|
633
863
|
|
|
634
864
|
return BrowserStorageCacheClass;
|
|
635
|
-
}(
|
|
865
|
+
}(_StorageCache__WEBPACK_IMPORTED_MODULE_2__["StorageCache"]);
|
|
636
866
|
|
|
637
867
|
|
|
638
868
|
var BrowserStorageCache = new BrowserStorageCacheClass();
|
|
@@ -655,10 +885,11 @@ var BrowserStorageCache = new BrowserStorageCacheClass();
|
|
|
655
885
|
__webpack_require__.r(__webpack_exports__);
|
|
656
886
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryCacheClass", function() { return InMemoryCacheClass; });
|
|
657
887
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InMemoryCache", function() { return InMemoryCache; });
|
|
658
|
-
/* harmony import */ var
|
|
659
|
-
/* harmony import */ var
|
|
660
|
-
/* harmony import */ var
|
|
661
|
-
/* harmony import */ var
|
|
888
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
889
|
+
/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "./lib-esm/Utils/index.js");
|
|
890
|
+
/* harmony import */ var _StorageCache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./StorageCache */ "./lib-esm/StorageCache.js");
|
|
891
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @aws-amplify/core */ "@aws-amplify/core");
|
|
892
|
+
/* harmony import */ var _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__);
|
|
662
893
|
/*
|
|
663
894
|
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
664
895
|
*
|
|
@@ -671,53 +902,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
671
902
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
672
903
|
* and limitations under the License.
|
|
673
904
|
*/
|
|
674
|
-
var __extends = undefined && undefined.__extends || function () {
|
|
675
|
-
var _extendStatics = function extendStatics(d, b) {
|
|
676
|
-
_extendStatics = Object.setPrototypeOf || {
|
|
677
|
-
__proto__: []
|
|
678
|
-
} instanceof Array && function (d, b) {
|
|
679
|
-
d.__proto__ = b;
|
|
680
|
-
} || function (d, b) {
|
|
681
|
-
for (var p in b) {
|
|
682
|
-
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
683
|
-
}
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
return _extendStatics(d, b);
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
return function (d, b) {
|
|
690
|
-
_extendStatics(d, b);
|
|
691
|
-
|
|
692
|
-
function __() {
|
|
693
|
-
this.constructor = d;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
697
|
-
};
|
|
698
|
-
}();
|
|
699
|
-
|
|
700
|
-
var __values = undefined && undefined.__values || function (o) {
|
|
701
|
-
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
702
|
-
m = s && o[s],
|
|
703
|
-
i = 0;
|
|
704
|
-
if (m) return m.call(o);
|
|
705
|
-
if (o && typeof o.length === "number") return {
|
|
706
|
-
next: function next() {
|
|
707
|
-
if (o && i >= o.length) o = void 0;
|
|
708
|
-
return {
|
|
709
|
-
value: o && o[i++],
|
|
710
|
-
done: !o
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
715
|
-
};
|
|
716
905
|
|
|
717
906
|
|
|
718
907
|
|
|
719
908
|
|
|
720
|
-
var logger = new
|
|
909
|
+
var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_3__["ConsoleLogger"]('InMemoryCache');
|
|
721
910
|
/**
|
|
722
911
|
* Customized in-memory cache with LRU implemented
|
|
723
912
|
* @member cacheObj - object which store items
|
|
@@ -730,7 +919,7 @@ var logger = new _aws_amplify_core__WEBPACK_IMPORTED_MODULE_2__["ConsoleLogger"]
|
|
|
730
919
|
var InMemoryCacheClass =
|
|
731
920
|
/** @class */
|
|
732
921
|
function (_super) {
|
|
733
|
-
__extends(InMemoryCacheClass, _super);
|
|
922
|
+
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(InMemoryCacheClass, _super);
|
|
734
923
|
/**
|
|
735
924
|
* initialize the cache
|
|
736
925
|
*
|
|
@@ -741,7 +930,7 @@ function (_super) {
|
|
|
741
930
|
function InMemoryCacheClass(config) {
|
|
742
931
|
var _this = this;
|
|
743
932
|
|
|
744
|
-
var cacheConfig = config ? Object.assign({},
|
|
933
|
+
var cacheConfig = config ? Object.assign({}, _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"], config) : _Utils__WEBPACK_IMPORTED_MODULE_1__["defaultConfig"];
|
|
745
934
|
_this = _super.call(this, cacheConfig) || this;
|
|
746
935
|
logger.debug('now we start!');
|
|
747
936
|
_this.cacheList = [];
|
|
@@ -752,7 +941,7 @@ function (_super) {
|
|
|
752
941
|
_this.removeItem = _this.removeItem.bind(_this); // initialize list for every priority
|
|
753
942
|
|
|
754
943
|
for (var i = 0; i < _this.maxPriority; i += 1) {
|
|
755
|
-
_this.cacheList[i] = new
|
|
944
|
+
_this.cacheList[i] = new _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheList"]();
|
|
756
945
|
}
|
|
757
946
|
|
|
758
947
|
return _this;
|
|
@@ -787,10 +976,10 @@ function (_super) {
|
|
|
787
976
|
|
|
788
977
|
|
|
789
978
|
InMemoryCacheClass.prototype._isExpired = function (key) {
|
|
790
|
-
var text =
|
|
979
|
+
var text = _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(key);
|
|
791
980
|
var item = JSON.parse(text);
|
|
792
981
|
|
|
793
|
-
if (Object(
|
|
982
|
+
if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])() >= item.expires) {
|
|
794
983
|
return true;
|
|
795
984
|
}
|
|
796
985
|
|
|
@@ -808,10 +997,10 @@ function (_super) {
|
|
|
808
997
|
// delete the key from the list
|
|
809
998
|
this.cacheList[listIdx].removeItem(prefixedKey); // decrease the current size of the cache
|
|
810
999
|
|
|
811
|
-
this._decreaseCurSizeInBytes(JSON.parse(
|
|
1000
|
+
this._decreaseCurSizeInBytes(JSON.parse(_Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(prefixedKey)).byteSize); // finally remove the item from memory
|
|
812
1001
|
|
|
813
1002
|
|
|
814
|
-
|
|
1003
|
+
_Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].removeItem(prefixedKey);
|
|
815
1004
|
};
|
|
816
1005
|
/**
|
|
817
1006
|
* put item into cache
|
|
@@ -830,7 +1019,7 @@ function (_super) {
|
|
|
830
1019
|
this._increaseCurSizeInBytes(item.byteSize); // finally add the item into memory
|
|
831
1020
|
|
|
832
1021
|
|
|
833
|
-
|
|
1022
|
+
_Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].setItem(prefixedKey, JSON.stringify(item));
|
|
834
1023
|
};
|
|
835
1024
|
/**
|
|
836
1025
|
* see whether cache is full
|
|
@@ -898,7 +1087,7 @@ function (_super) {
|
|
|
898
1087
|
|
|
899
1088
|
var cacheItemOptions = {
|
|
900
1089
|
priority: options && options.priority !== undefined ? options.priority : this.config.defaultPriority,
|
|
901
|
-
expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(
|
|
1090
|
+
expires: options && options.expires !== undefined ? options.expires : this.config.defaultTTL + Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["getCurrTime"])()
|
|
902
1091
|
};
|
|
903
1092
|
|
|
904
1093
|
if (cacheItemOptions.priority < 1 || cacheItemOptions.priority > 5) {
|
|
@@ -968,7 +1157,7 @@ function (_super) {
|
|
|
968
1157
|
this._removeItem(prefixedKey, presentKeyPrio - 1);
|
|
969
1158
|
} else {
|
|
970
1159
|
// if not expired, great, return the value and refresh it
|
|
971
|
-
ret =
|
|
1160
|
+
ret = _Utils__WEBPACK_IMPORTED_MODULE_1__["CacheObject"].getItem(prefixedKey);
|
|
972
1161
|
var item = JSON.parse(ret);
|
|
973
1162
|
this.cacheList[item.priority - 1].refresh(prefixedKey);
|
|
974
1163
|
return item.data;
|
|
@@ -1013,7 +1202,7 @@ function (_super) {
|
|
|
1013
1202
|
|
|
1014
1203
|
for (var i = 0; i < this.maxPriority; i += 1) {
|
|
1015
1204
|
try {
|
|
1016
|
-
for (var _b = (e_1 = void 0, __values(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1205
|
+
for (var _b = (e_1 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1017
1206
|
var key = _c.value;
|
|
1018
1207
|
|
|
1019
1208
|
this._removeItem(key, i);
|
|
@@ -1043,7 +1232,7 @@ function (_super) {
|
|
|
1043
1232
|
|
|
1044
1233
|
for (var i = 0; i < this.maxPriority; i += 1) {
|
|
1045
1234
|
try {
|
|
1046
|
-
for (var _b = (e_2 = void 0, __values(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1235
|
+
for (var _b = (e_2 = void 0, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(this.cacheList[i].getKeys())), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1047
1236
|
var key = _c.value;
|
|
1048
1237
|
keys.push(key.substring(this.config.keyPrefix.length));
|
|
1049
1238
|
}
|
|
@@ -1083,7 +1272,7 @@ function (_super) {
|
|
|
1083
1272
|
};
|
|
1084
1273
|
|
|
1085
1274
|
return InMemoryCacheClass;
|
|
1086
|
-
}(
|
|
1275
|
+
}(_StorageCache__WEBPACK_IMPORTED_MODULE_2__["StorageCache"]);
|
|
1087
1276
|
|
|
1088
1277
|
|
|
1089
1278
|
var InMemoryCache = new InMemoryCacheClass();
|
|
@@ -1269,6 +1458,7 @@ function () {
|
|
|
1269
1458
|
|
|
1270
1459
|
"use strict";
|
|
1271
1460
|
__webpack_require__.r(__webpack_exports__);
|
|
1461
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
|
|
1272
1462
|
/*
|
|
1273
1463
|
* Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
1274
1464
|
*
|
|
@@ -1281,22 +1471,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1281
1471
|
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
1282
1472
|
* and limitations under the License.
|
|
1283
1473
|
*/
|
|
1284
|
-
|
|
1285
|
-
var s = typeof Symbol === "function" && Symbol.iterator,
|
|
1286
|
-
m = s && o[s],
|
|
1287
|
-
i = 0;
|
|
1288
|
-
if (m) return m.call(o);
|
|
1289
|
-
if (o && typeof o.length === "number") return {
|
|
1290
|
-
next: function next() {
|
|
1291
|
-
if (o && i >= o.length) o = void 0;
|
|
1292
|
-
return {
|
|
1293
|
-
value: o && o[i++],
|
|
1294
|
-
done: !o
|
|
1295
|
-
};
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1299
|
-
};
|
|
1474
|
+
|
|
1300
1475
|
|
|
1301
1476
|
var DoubleLinkedNode =
|
|
1302
1477
|
/** @class */
|
|
@@ -1442,7 +1617,7 @@ function () {
|
|
|
1442
1617
|
var e_1, _a;
|
|
1443
1618
|
|
|
1444
1619
|
try {
|
|
1445
|
-
for (var _b = __values(Object.keys(this.hashtable)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1620
|
+
for (var _b = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(Object.keys(this.hashtable)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1446
1621
|
var key = _c.value;
|
|
1447
1622
|
|
|
1448
1623
|
if (this.hashtable.hasOwnProperty(key)) {
|