@aws-amplify/core 4.7.9-unstable.2 → 4.7.9

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/aws-amplify-core.js +673 -45
  3. package/dist/aws-amplify-core.js.map +1 -1
  4. package/dist/aws-amplify-core.min.js +4 -4
  5. package/dist/aws-amplify-core.min.js.map +1 -1
  6. package/lib/Credentials.js +1 -1
  7. package/lib/Credentials.js.map +1 -1
  8. package/lib/Util/BackgroundProcessManager.js +444 -0
  9. package/lib/Util/BackgroundProcessManager.js.map +1 -0
  10. package/lib/Util/Retry.js +76 -34
  11. package/lib/Util/Retry.js.map +1 -1
  12. package/lib/Util/index.js +1 -0
  13. package/lib/Util/index.js.map +1 -1
  14. package/lib-esm/Credentials.d.ts +1 -1
  15. package/lib-esm/Credentials.js +1 -1
  16. package/lib-esm/Credentials.js.map +1 -1
  17. package/lib-esm/Util/BackgroundProcessManager.d.ts +204 -0
  18. package/lib-esm/Util/BackgroundProcessManager.js +442 -0
  19. package/lib-esm/Util/BackgroundProcessManager.js.map +1 -0
  20. package/lib-esm/Util/Retry.d.ts +2 -2
  21. package/lib-esm/Util/Retry.js +76 -34
  22. package/lib-esm/Util/Retry.js.map +1 -1
  23. package/lib-esm/Util/index.d.ts +1 -0
  24. package/lib-esm/Util/index.js +1 -0
  25. package/lib-esm/Util/index.js.map +1 -1
  26. package/package.json +2 -2
  27. package/src/Credentials.ts +13 -14
  28. package/src/Util/BackgroundProcessManager.ts +449 -0
  29. package/src/Util/Retry.ts +66 -31
  30. package/src/Util/index.ts +1 -0
  31. package/lib/Amplify.d.ts +0 -31
  32. package/lib/ClientDevice/android.d.ts +0 -5
  33. package/lib/ClientDevice/browser.d.ts +0 -25
  34. package/lib/ClientDevice/index.d.ts +0 -27
  35. package/lib/ClientDevice/ios.d.ts +0 -7
  36. package/lib/ClientDevice/reactnative.d.ts +0 -14
  37. package/lib/Credentials.d.ts +0 -51
  38. package/lib/Errors.d.ts +0 -2
  39. package/lib/Hub.d.ts +0 -31
  40. package/lib/I18n/I18n.d.ts +0 -59
  41. package/lib/I18n/index.d.ts +0 -53
  42. package/lib/I18n/types.d.ts +0 -3
  43. package/lib/JS.d.ts +0 -56
  44. package/lib/Logger/ConsoleLogger.d.ts +0 -80
  45. package/lib/Logger/index.d.ts +0 -1
  46. package/lib/Logger/logger-interface.d.ts +0 -12
  47. package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -10
  48. package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -10
  49. package/lib/OAuthHelper/index.d.ts +0 -4
  50. package/lib/Parser.d.ts +0 -12
  51. package/lib/Platform/index.d.ts +0 -11
  52. package/lib/Platform/version.d.ts +0 -1
  53. package/lib/Providers/AWSCloudWatchProvider.d.ts +0 -34
  54. package/lib/Providers/index.d.ts +0 -1
  55. package/lib/RNComponents/index.d.ts +0 -5
  56. package/lib/RNComponents/reactnative.d.ts +0 -3
  57. package/lib/ServiceWorker/ServiceWorker.d.ts +0 -72
  58. package/lib/ServiceWorker/index.d.ts +0 -13
  59. package/lib/Signer.d.ts +0 -45
  60. package/lib/StorageHelper/index.d.ts +0 -45
  61. package/lib/StorageHelper/reactnative.d.ts +0 -17
  62. package/lib/UniversalStorage/index.d.ts +0 -23
  63. package/lib/Util/Constants.d.ts +0 -8
  64. package/lib/Util/DateUtils.d.ts +0 -7
  65. package/lib/Util/Mutex.d.ts +0 -45
  66. package/lib/Util/Reachability.d.ts +0 -13
  67. package/lib/Util/Reachability.native.d.ts +0 -11
  68. package/lib/Util/Retry.d.ts +0 -20
  69. package/lib/Util/StringUtils.d.ts +0 -2
  70. package/lib/Util/index.d.ts +0 -6
  71. package/lib/constants.d.ts +0 -6
  72. package/lib/index.d.ts +0 -30
  73. package/lib/types/index.d.ts +0 -1
  74. package/lib/types/types.d.ts +0 -43
@@ -0,0 +1,442 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ var __generator = (this && this.__generator) || function (thisArg, body) {
24
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
+ function verb(n) { return function (v) { return step([n, v]); }; }
27
+ function step(op) {
28
+ if (f) throw new TypeError("Generator is already executing.");
29
+ while (_) try {
30
+ 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;
31
+ if (y = 0, t) op = [op[0] & 2, t.value];
32
+ switch (op[0]) {
33
+ case 0: case 1: t = op; break;
34
+ case 4: _.label++; return { value: op[1], done: false };
35
+ case 5: _.label++; y = op[1]; op = [0]; continue;
36
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
+ default:
38
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
+ if (t[2]) _.ops.pop();
43
+ _.trys.pop(); continue;
44
+ }
45
+ op = body.call(thisArg, _);
46
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
+ }
49
+ };
50
+ var __values = (this && this.__values) || function(o) {
51
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
52
+ if (m) return m.call(o);
53
+ if (o && typeof o.length === "number") return {
54
+ next: function () {
55
+ if (o && i >= o.length) o = void 0;
56
+ return { value: o && o[i++], done: !o };
57
+ }
58
+ };
59
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
60
+ };
61
+ /**
62
+ * @private For internal Amplify use.
63
+ *
64
+ * Creates a new scope for promises, observables, and other types of work or
65
+ * processes that may be running in the background. This manager provides
66
+ * an singular entrypoint to request termination and await completion.
67
+ *
68
+ * As work completes on its own prior to close, the manager removes them
69
+ * from the registry to avoid holding references to completed jobs.
70
+ */
71
+ var BackgroundProcessManager = /** @class */ (function () {
72
+ /**
73
+ * Creates a new manager for promises, observables, and other types
74
+ * of work that may be running in the background. This manager provides
75
+ * a centralized mechanism to request termination and await completion.
76
+ */
77
+ function BackgroundProcessManager() {
78
+ /**
79
+ * A string indicating whether the manager is accepting new work ("Open"),
80
+ * waiting for work to complete ("Closing"), or fully done with all
81
+ * submitted work and *not* accepting new jobs ("Closed").
82
+ */
83
+ this._state = BackgroundProcessManagerState.Open;
84
+ /**
85
+ * The list of outstanding jobs we'll need to wait for upon `close()`
86
+ */
87
+ this.jobs = new Set();
88
+ }
89
+ BackgroundProcessManager.prototype.add = function (jobOrDescription, optionalDescription) {
90
+ var job;
91
+ var description;
92
+ if (typeof jobOrDescription === 'string') {
93
+ job = undefined;
94
+ description = jobOrDescription;
95
+ }
96
+ else {
97
+ job = jobOrDescription;
98
+ description = optionalDescription;
99
+ }
100
+ var error = this.closedFailure(description);
101
+ if (error)
102
+ return error;
103
+ if (job === undefined) {
104
+ return this.addHook(description);
105
+ }
106
+ else if (typeof job === 'function') {
107
+ return this.addFunction(job, description);
108
+ }
109
+ else if (job instanceof BackgroundProcessManager) {
110
+ return this.addManager(job, description);
111
+ }
112
+ else {
113
+ throw new Error('If `job` is provided, it must be an Observable, Function, or BackgroundProcessManager.');
114
+ }
115
+ };
116
+ /**
117
+ * Adds a **cleaner** function that doesn't immediately get executed.
118
+ * Instead, the caller gets a **terminate** function back. The *cleaner* is
119
+ * invoked only once the mananger *closes* or the returned **terminate**
120
+ * function is called.
121
+ *
122
+ * @param clean The cleanup function.
123
+ * @param description Optional description to help identify pending jobs.
124
+ * @returns A terminate function.
125
+ */
126
+ BackgroundProcessManager.prototype.addCleaner = function (clean, description) {
127
+ var _this = this;
128
+ var _a = this.addHook(description), resolve = _a.resolve, onTerminate = _a.onTerminate;
129
+ var proxy = function () { return __awaiter(_this, void 0, void 0, function () {
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0: return [4 /*yield*/, clean()];
133
+ case 1:
134
+ _a.sent();
135
+ resolve();
136
+ return [2 /*return*/];
137
+ }
138
+ });
139
+ }); };
140
+ onTerminate.then(proxy);
141
+ return proxy;
142
+ };
143
+ BackgroundProcessManager.prototype.addFunction = function (job, description) {
144
+ // the function we call when we want to try to terminate this job.
145
+ var terminate;
146
+ // the promise the job can opt into listening to for termination.
147
+ var onTerminate = new Promise(function (resolve) {
148
+ terminate = resolve;
149
+ });
150
+ // finally! start the job.
151
+ var jobResult = job(onTerminate);
152
+ // depending on what the job gives back, register the result
153
+ // so we can monitor for completion.
154
+ if (typeof (jobResult === null || jobResult === void 0 ? void 0 : jobResult.then) === 'function') {
155
+ this.registerPromise(jobResult, terminate, description);
156
+ }
157
+ // At the end of the day, or you know, method call, it doesn't matter
158
+ // what the return value is at all; we just pass it through to the
159
+ // caller.
160
+ return jobResult;
161
+ };
162
+ BackgroundProcessManager.prototype.addManager = function (manager, description) {
163
+ var _this = this;
164
+ this.addCleaner(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
165
+ switch (_a.label) {
166
+ case 0: return [4 /*yield*/, manager.close()];
167
+ case 1: return [2 /*return*/, _a.sent()];
168
+ }
169
+ }); }); }, description);
170
+ };
171
+ /**
172
+ * Creates and registers a fabricated job for processes that need to operate
173
+ * with callbacks/hooks. The returned `resolve` and `reject`
174
+ * functions can be used to signal the job is done successfully or not.
175
+ * The returned `onTerminate` is a promise that will resolve when the
176
+ * manager is requesting the termination of the job.
177
+ *
178
+ * @param description Optional description to help identify pending jobs.
179
+ * @returns `{ resolve, reject, onTerminate }`
180
+ */
181
+ BackgroundProcessManager.prototype.addHook = function (description) {
182
+ // the resolve/reject functions we'll provide to the caller to signal
183
+ // the state of the job.
184
+ var resolve;
185
+ var reject;
186
+ // the underlying promise we'll use to manage it, pretty much like
187
+ // any other promise.
188
+ var promise = new Promise(function (res, rej) {
189
+ resolve = res;
190
+ reject = rej;
191
+ });
192
+ // the function we call when we want to try to terminate this job.
193
+ var terminate;
194
+ // the promise the job can opt into listening to for termination.
195
+ var onTerminate = new Promise(function (resolveTerminate) {
196
+ terminate = resolveTerminate;
197
+ });
198
+ this.registerPromise(promise, terminate, description);
199
+ return {
200
+ resolve: resolve,
201
+ reject: reject,
202
+ onTerminate: onTerminate,
203
+ };
204
+ };
205
+ /**
206
+ * Adds a Promise based job to the list of jobs for monitoring and listens
207
+ * for either a success or failure, upon which the job is considered "done"
208
+ * and removed from the registry.
209
+ *
210
+ * @param promise A promise that is on its way to being returned to a
211
+ * caller, which needs to be tracked as a background job.
212
+ * @param terminate The termination function to register, which can be
213
+ * invoked to request the job stop.
214
+ * @param description Optional description to help identify pending jobs.
215
+ */
216
+ BackgroundProcessManager.prototype.registerPromise = function (promise, terminate, description) {
217
+ var _this = this;
218
+ var jobEntry = { promise: promise, terminate: terminate, description: description };
219
+ this.jobs.add(jobEntry);
220
+ // in all of my testing, it is safe to multi-subscribe to a promise.
221
+ // so, rather than create another layer of promising, we're just going
222
+ // to hook into the promise we already have, and when it's done
223
+ // (successfully or not), we no longer need to wait for it upon close.
224
+ //
225
+ // sorry this is a bit hand-wavy:
226
+ //
227
+ // i believe we use `.then` and `.catch` instead of `.finally` because
228
+ // `.finally` is invoked in a different order in the sequence, and this
229
+ // breaks assumptions throughout and causes failures.
230
+ promise
231
+ .then(function () {
232
+ _this.jobs.delete(jobEntry);
233
+ })
234
+ .catch(function () {
235
+ _this.jobs.delete(jobEntry);
236
+ });
237
+ };
238
+ Object.defineProperty(BackgroundProcessManager.prototype, "length", {
239
+ /**
240
+ * The number of jobs being waited on.
241
+ *
242
+ * We don't use this for anything. It's just informational for the caller,
243
+ * and can be used in logging and testing.
244
+ *
245
+ * @returns the number of jobs.
246
+ */
247
+ get: function () {
248
+ return this.jobs.size;
249
+ },
250
+ enumerable: true,
251
+ configurable: true
252
+ });
253
+ Object.defineProperty(BackgroundProcessManager.prototype, "state", {
254
+ /**
255
+ * The execution state of the manager. One of:
256
+ *
257
+ * 1. "Open" -> Accepting new jobs
258
+ * 1. "Closing" -> Not accepting new work. Waiting for jobs to complete.
259
+ * 1. "Closed" -> Not accepting new work. All submitted jobs are complete.
260
+ */
261
+ get: function () {
262
+ return this._state;
263
+ },
264
+ enumerable: true,
265
+ configurable: true
266
+ });
267
+ Object.defineProperty(BackgroundProcessManager.prototype, "pending", {
268
+ /**
269
+ * The registered `description` of all still-pending jobs.
270
+ *
271
+ * @returns descriptions as an array.
272
+ */
273
+ get: function () {
274
+ return Array.from(this.jobs).map(function (job) { return job.description; });
275
+ },
276
+ enumerable: true,
277
+ configurable: true
278
+ });
279
+ Object.defineProperty(BackgroundProcessManager.prototype, "isOpen", {
280
+ /**
281
+ * Whether the manager is accepting new jobs.
282
+ */
283
+ get: function () {
284
+ return this._state === BackgroundProcessManagerState.Open;
285
+ },
286
+ enumerable: true,
287
+ configurable: true
288
+ });
289
+ Object.defineProperty(BackgroundProcessManager.prototype, "isClosing", {
290
+ /**
291
+ * Whether the manager is rejecting new work, but still waiting for
292
+ * submitted work to complete.
293
+ */
294
+ get: function () {
295
+ return this._state === BackgroundProcessManagerState.Closing;
296
+ },
297
+ enumerable: true,
298
+ configurable: true
299
+ });
300
+ Object.defineProperty(BackgroundProcessManager.prototype, "isClosed", {
301
+ /**
302
+ * Whether the manager is rejecting work and done waiting for submitted
303
+ * work to complete.
304
+ */
305
+ get: function () {
306
+ return this._state === BackgroundProcessManagerState.Closed;
307
+ },
308
+ enumerable: true,
309
+ configurable: true
310
+ });
311
+ BackgroundProcessManager.prototype.closedFailure = function (description) {
312
+ if (!this.isOpen) {
313
+ return Promise.reject(new BackgroundManagerNotOpenError([
314
+ "The manager is " + this.state + ".",
315
+ "You tried to add \"" + description + "\".",
316
+ "Pending jobs: [\n" + this.pending
317
+ .map(function (t) { return ' ' + t; })
318
+ .join(',\n') + "\n]",
319
+ ].join('\n')));
320
+ }
321
+ };
322
+ /**
323
+ * Signals jobs to stop (for those that accept interruptions) and waits
324
+ * for confirmation that jobs have stopped.
325
+ *
326
+ * This immediately puts the manager into a closing state and just begins
327
+ * to reject new work. After all work in the manager is complete, the
328
+ * manager goes into a `Completed` state and `close()` returns.
329
+ *
330
+ * This call is idempotent.
331
+ *
332
+ * If the manager is already closing or closed, `finalCleaup` is not executed.
333
+ *
334
+ * @param onClosed
335
+ * @returns The settled results of each still-running job's promise. If the
336
+ * manager is already closed, this will contain the results as of when the
337
+ * manager's `close()` was called in an `Open` state.
338
+ */
339
+ BackgroundProcessManager.prototype.close = function () {
340
+ return __awaiter(this, void 0, void 0, function () {
341
+ var _a, _b, job;
342
+ var e_1, _c;
343
+ return __generator(this, function (_d) {
344
+ switch (_d.label) {
345
+ case 0:
346
+ if (!this.isOpen) return [3 /*break*/, 2];
347
+ this._state = BackgroundProcessManagerState.Closing;
348
+ try {
349
+ for (_a = __values(Array.from(this.jobs)), _b = _a.next(); !_b.done; _b = _a.next()) {
350
+ job = _b.value;
351
+ try {
352
+ job.terminate();
353
+ }
354
+ catch (error) {
355
+ // Due to potential races with a job's natural completion, it's
356
+ // reasonable to expect the termination call to fail. Hence,
357
+ // not logging as an error.
358
+ console.warn("Failed to send termination signal to job. Error: " + error.message, job);
359
+ }
360
+ }
361
+ }
362
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
363
+ finally {
364
+ try {
365
+ if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
366
+ }
367
+ finally { if (e_1) throw e_1.error; }
368
+ }
369
+ // Use `allSettled()` because we want to wait for all to finish. We do
370
+ // not want to stop waiting if there is a failure.
371
+ this._closingPromise = Promise.allSettled(Array.from(this.jobs).map(function (j) { return j.promise; }));
372
+ return [4 /*yield*/, this._closingPromise];
373
+ case 1:
374
+ _d.sent();
375
+ this._state = BackgroundProcessManagerState.Closed;
376
+ _d.label = 2;
377
+ case 2: return [2 /*return*/, this._closingPromise];
378
+ }
379
+ });
380
+ });
381
+ };
382
+ /**
383
+ * Signals the manager to start accepting work (again) and returns once
384
+ * the manager is ready to do so.
385
+ *
386
+ * If the state is already `Open`, this call is a no-op.
387
+ *
388
+ * If the state is `Closed`, this call simply updates state and returns.
389
+ *
390
+ * If the state is `Closing`, this call waits for completion before it
391
+ * updates the state and returns.
392
+ */
393
+ BackgroundProcessManager.prototype.open = function () {
394
+ return __awaiter(this, void 0, void 0, function () {
395
+ return __generator(this, function (_a) {
396
+ switch (_a.label) {
397
+ case 0:
398
+ if (!this.isClosing) return [3 /*break*/, 2];
399
+ return [4 /*yield*/, this.close()];
400
+ case 1:
401
+ _a.sent();
402
+ _a.label = 2;
403
+ case 2:
404
+ this._state = BackgroundProcessManagerState.Open;
405
+ return [2 /*return*/];
406
+ }
407
+ });
408
+ });
409
+ };
410
+ return BackgroundProcessManager;
411
+ }());
412
+ export { BackgroundProcessManager };
413
+ /**
414
+ *
415
+ */
416
+ var BackgroundManagerNotOpenError = /** @class */ (function (_super) {
417
+ __extends(BackgroundManagerNotOpenError, _super);
418
+ function BackgroundManagerNotOpenError(message) {
419
+ return _super.call(this, "BackgroundManagerNotOpenError: " + message) || this;
420
+ }
421
+ return BackgroundManagerNotOpenError;
422
+ }(Error));
423
+ export { BackgroundManagerNotOpenError };
424
+ /**
425
+ * All possible states a `BackgroundProcessManager` instance can be in.
426
+ */
427
+ export var BackgroundProcessManagerState;
428
+ (function (BackgroundProcessManagerState) {
429
+ /**
430
+ * Accepting new jobs.
431
+ */
432
+ BackgroundProcessManagerState["Open"] = "Open";
433
+ /**
434
+ * Not accepting new jobs. Waiting for submitted jobs to complete.
435
+ */
436
+ BackgroundProcessManagerState["Closing"] = "Closing";
437
+ /**
438
+ * Not accepting new jobs. All submitted jobs are complete.
439
+ */
440
+ BackgroundProcessManagerState["Closed"] = "Closed";
441
+ })(BackgroundProcessManagerState || (BackgroundProcessManagerState = {}));
442
+ //# sourceMappingURL=BackgroundProcessManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackgroundProcessManager.js","sourceRoot":"","sources":["../../src/Util/BackgroundProcessManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH;IAeC;;;;OAIG;IACH;QAnBA;;;;WAIG;QACK,WAAM,GAAG,6BAA6B,CAAC,IAAI,CAAC;QAIpD;;WAEG;QACK,SAAI,GAAG,IAAI,GAAG,EAAY,CAAC;IAOpB,CAAC;IAyDhB,sCAAG,GAAH,UAAI,gBAAiB,EAAE,mBAAoB;QAC1C,IAAI,GAAG,CAAC;QACR,I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AAS,CAAC,CACzC,CAAC;wBAEF,qBAAM,IAAI,CAAC,eAAe,EAAA;;wBAA1B,SAA0B,CAAC;wBAC3B,IAAI,CAAC,MAAM,GAAG,6BAA6B,CAAC,MAAM,CAAC;;4BAGpD,sBAAO,IAAI,CAAC,eAAe,EAAC;;;;KAC5B;IAED;;;;;;;;;;OAUG;IACG,uCAAI,GAAV;;;;;6BACK,IAAI,CAAC,SAAS,EAAd,wBAAc;wBACjB,qBAAM,IAAI,CAAC,KAAK,EAAE,EAAA;;wBAAlB,SAAkB,CAAC;;;wBAGpB,IAAI,CAAC,MAAM,GAAG,6BAA6B,CAAC,IAAI,CAAC;;;;;KACjD;IACF,+BAAC;AAAD,CAAC,AA9XD,IA8XC;;AAED;;GAEG;AACH;IAAmD,iDAAK;IACvD,uCAAY,OAAe;eAC1B,kBAAM,oCAAkC,OAAS,CAAC;IACnD,CAAC;IACF,oCAAC;AAAD,CAAC,AAJD,CAAmD,KAAK,GAIvD;;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,6BAeX;AAfD,WAAY,6BAA6B;IACxC;;OAEG;IACH,8CAAa,CAAA;IAEb;;OAEG;IACH,oDAAmB,CAAA;IAEnB;;OAEG;IACH,kDAAiB,CAAA;AAClB,CAAC,EAfW,6BAA6B,KAA7B,6BAA6B,QAexC"}
@@ -7,7 +7,7 @@ export declare class NonRetryableError extends Error {
7
7
  * @private
8
8
  * Internal use of Amplify only
9
9
  */
10
- export declare function retry(functionToRetry: Function, args: any[], delayFn: DelayFunction, attempt?: number): any;
10
+ export declare function retry<T>(functionToRetry: (...args: any[]) => T, args: any[], delayFn: DelayFunction, onTerminate?: Promise<void>): Promise<T>;
11
11
  /**
12
12
  * @private
13
13
  * Internal use of Amplify only
@@ -17,4 +17,4 @@ export declare function jitteredBackoff(maxDelayMs?: number): DelayFunction;
17
17
  * @private
18
18
  * Internal use of Amplify only
19
19
  */
20
- export declare const jitteredExponentialRetry: (functionToRetry: Function, args: any[], maxDelayMs?: number) => any;
20
+ export declare const jitteredExponentialRetry: <T>(functionToRetry: (...args: any[]) => T, args: any[], maxDelayMs?: number, onTerminate?: Promise<void>) => Promise<T>;
@@ -87,41 +87,83 @@ var isNonRetryableError = function (obj) {
87
87
  * @private
88
88
  * Internal use of Amplify only
89
89
  */
90
- export function retry(functionToRetry, args, delayFn, attempt) {
91
- if (attempt === void 0) { attempt = 1; }
90
+ export function retry(functionToRetry, args, delayFn, onTerminate) {
92
91
  return __awaiter(this, void 0, void 0, function () {
93
- var err_1, retryIn_1;
92
+ var _this = this;
94
93
  return __generator(this, function (_a) {
95
- switch (_a.label) {
96
- case 0:
97
- if (typeof functionToRetry !== 'function') {
98
- throw Error('functionToRetry must be a function');
99
- }
100
- logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
101
- _a.label = 1;
102
- case 1:
103
- _a.trys.push([1, 3, , 8]);
104
- return [4 /*yield*/, functionToRetry.apply(void 0, __spread(args))];
105
- case 2: return [2 /*return*/, _a.sent()];
106
- case 3:
107
- err_1 = _a.sent();
108
- logger.debug("error on " + functionToRetry.name, err_1);
109
- if (isNonRetryableError(err_1)) {
110
- logger.debug(functionToRetry.name + " non retryable error", err_1);
111
- throw err_1;
112
- }
113
- retryIn_1 = delayFn(attempt, args, err_1);
114
- logger.debug(functionToRetry.name + " retrying in " + retryIn_1 + " ms");
115
- if (!(retryIn_1 !== false)) return [3 /*break*/, 6];
116
- return [4 /*yield*/, new Promise(function (res) { return setTimeout(res, retryIn_1); })];
117
- case 4:
118
- _a.sent();
119
- return [4 /*yield*/, retry(functionToRetry, args, delayFn, attempt + 1)];
120
- case 5: return [2 /*return*/, _a.sent()];
121
- case 6: throw err_1;
122
- case 7: return [3 /*break*/, 8];
123
- case 8: return [2 /*return*/];
94
+ if (typeof functionToRetry !== 'function') {
95
+ throw Error('functionToRetry must be a function');
124
96
  }
97
+ return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
98
+ var attempt, terminated, timeout, wakeUp, lastError, _loop_1, state_1;
99
+ return __generator(this, function (_a) {
100
+ switch (_a.label) {
101
+ case 0:
102
+ attempt = 0;
103
+ terminated = false;
104
+ wakeUp = function () { };
105
+ onTerminate &&
106
+ onTerminate.then(function () {
107
+ // signal not to try anymore.
108
+ terminated = true;
109
+ // stop sleeping if we're sleeping.
110
+ clearTimeout(timeout);
111
+ wakeUp();
112
+ });
113
+ _loop_1 = function () {
114
+ var _a, _b, err_1, retryIn_1;
115
+ return __generator(this, function (_c) {
116
+ switch (_c.label) {
117
+ case 0:
118
+ attempt++;
119
+ logger.debug(functionToRetry.name + " attempt #" + attempt + " with this vars: " + JSON.stringify(args));
120
+ _c.label = 1;
121
+ case 1:
122
+ _c.trys.push([1, 3, , 7]);
123
+ _a = {};
124
+ _b = resolve;
125
+ return [4 /*yield*/, functionToRetry.apply(void 0, __spread(args))];
126
+ case 2: return [2 /*return*/, (_a.value = _b.apply(void 0, [_c.sent()]), _a)];
127
+ case 3:
128
+ err_1 = _c.sent();
129
+ lastError = err_1;
130
+ logger.debug("error on " + functionToRetry.name, err_1);
131
+ if (isNonRetryableError(err_1)) {
132
+ logger.debug(functionToRetry.name + " non retryable error", err_1);
133
+ return [2 /*return*/, { value: reject(err_1) }];
134
+ }
135
+ retryIn_1 = delayFn(attempt, args, err_1);
136
+ logger.debug(functionToRetry.name + " retrying in " + retryIn_1 + " ms");
137
+ if (!(retryIn_1 === false || terminated)) return [3 /*break*/, 4];
138
+ return [2 /*return*/, { value: reject(err_1) }];
139
+ case 4: return [4 /*yield*/, new Promise(function (r) {
140
+ wakeUp = r; // export wakeUp for onTerminate handling
141
+ timeout = setTimeout(wakeUp, retryIn_1);
142
+ })];
143
+ case 5:
144
+ _c.sent();
145
+ _c.label = 6;
146
+ case 6: return [3 /*break*/, 7];
147
+ case 7: return [2 /*return*/];
148
+ }
149
+ });
150
+ };
151
+ _a.label = 1;
152
+ case 1:
153
+ if (!!terminated) return [3 /*break*/, 3];
154
+ return [5 /*yield**/, _loop_1()];
155
+ case 2:
156
+ state_1 = _a.sent();
157
+ if (typeof state_1 === "object")
158
+ return [2 /*return*/, state_1.value];
159
+ return [3 /*break*/, 1];
160
+ case 3:
161
+ // reached if terminated while waiting for a timer.
162
+ reject(lastError);
163
+ return [2 /*return*/];
164
+ }
165
+ });
166
+ }); })];
125
167
  });
126
168
  });
127
169
  }
@@ -143,8 +185,8 @@ export function jitteredBackoff(maxDelayMs) {
143
185
  * @private
144
186
  * Internal use of Amplify only
145
187
  */
146
- export var jitteredExponentialRetry = function (functionToRetry, args, maxDelayMs) {
188
+ export var jitteredExponentialRetry = function (functionToRetry, args, maxDelayMs, onTerminate) {
147
189
  if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }
148
- return retry(functionToRetry, args, jitteredBackoff(maxDelayMs));
190
+ return retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);
149
191
  };
150
192
  //# sourceMappingURL=Retry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Retry.js","sourceRoot":"","sources":["../../src/Util/Retry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAClE,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;AAElC;IAAuC,qCAAK;IAE3C,2BAAY,OAAe;QAA3B,YACC,kBAAM,OAAO,CAAC,SACd;QAHe,kBAAY,GAAG,IAAI,CAAC;;IAGpC,CAAC;IACF,wBAAC;AAAD,CAAC,AALD,CAAuC,KAAK,GAK3C;;AAED,IAAM,mBAAmB,GAAG,UAAC,GAAQ;IACpC,IAAM,GAAG,GAA4B,cAAc,CAAC;IACpD,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF;;;GAGG;A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AAI,UAAU,CAAA,EAA/B,wBAA+B;+EAC3B,MAAM,CAAC,KAAG,CAAC;oDAElB,qBAAM,IAAI,OAAO,CAAC,UAAA,CAAC;oDAClB,MAAM,GAAG,CAAC,CAAC,CAAC,yCAAyC;oDACrD,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,SAAO,CAAC,CAAC;gDACvC,CAAC,CAAC,EAAA;;gDAHF,SAGE,CAAC;;;;;;;;;qCA/BC,CAAC,UAAU;;;;;;;;gCAoClB,mDAAmD;gCACnD,MAAM,CAAC,SAAS,CAAC,CAAC;;;;qBAClB,CAAC,EAAC;;;CACH;AAED,IAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC9B,UAAiC;IAAjC,2BAAA,EAAA,yBAAiC;IAEjC,IAAM,YAAY,GAAG,GAAG,CAAC;IACzB,IAAM,aAAa,GAAG,GAAG,CAAC;IAE1B,OAAO,UAAA,OAAO;QACb,IAAM,KAAK,GAAG,SAAA,CAAC,EAAI,OAAO,CAAA,GAAG,YAAY,GAAG,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1E,OAAO,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,IAAM,wBAAwB,GAAG,UACvC,eAAsC,EACtC,IAAW,EACX,UAAiC,EACjC,WAA2B;IAD3B,2BAAA,EAAA,yBAAiC;IAGjC,OAAA,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;AAAtE,CAAsE,CAAC"}
@@ -4,3 +4,4 @@ export { default as Reachability } from './Reachability';
4
4
  export * from './DateUtils';
5
5
  export * from './StringUtils';
6
6
  export * from './Constants';
7
+ export * from './BackgroundProcessManager';
@@ -4,4 +4,5 @@ export { default as Reachability } from './Reachability';
4
4
  export * from './DateUtils';
5
5
  export * from './StringUtils';
6
6
  export * from './Constants';
7
+ export * from './BackgroundProcessManager';
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Util/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Util/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "4.7.9-unstable.2+89bdeb1e4",
3
+ "version": "4.7.9",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -108,5 +108,5 @@
108
108
  "lib-esm"
109
109
  ]
110
110
  },
111
- "gitHead": "89bdeb1e4ec45c1a34e7dfe960b341de99906ed3"
111
+ "gitHead": "be5bf2dc68c9c011c3876f003c14bc98b392c82d"
112
112
  }