@aws-amplify/core 6.0.1-console-preview.11cf989.0 → 6.0.1-console-preview.4ae78ed.0
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/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +2 -1
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +2 -1
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -2
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +3 -2
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -2
- package/lib/Cache/AsyncStorageCache.d.ts +1 -1
- package/lib/Cache/AsyncStorageCache.js +20 -22
- package/lib/Platform/types.d.ts +3 -2
- package/lib/Platform/types.js +3 -2
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Reachability/Reachability.native.d.ts +2 -2
- package/lib/clients/handlers/fetch.js +2 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -1
- package/lib/clients/middleware/signing/signer/signatureV4/index.native.js +2 -1
- package/lib/clients/types/http.d.ts +17 -1
- package/lib/libraryUtils.d.ts +2 -1
- package/lib/libraryUtils.js +4 -1
- package/lib/parseAWSExports.js +24 -8
- package/lib/providers/kinesis/types/index.d.ts +1 -0
- package/lib/providers/kinesis/types/index.js +19 -0
- package/lib/providers/kinesis/types/kinesis.d.ts +9 -0
- package/lib/providers/kinesis/types/kinesis.js +4 -0
- package/lib/providers/kinesis-firehose/types/index.d.ts +1 -0
- package/lib/providers/kinesis-firehose/types/index.js +4 -0
- package/lib/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
- package/lib/providers/kinesis-firehose/types/kinesis-firehose.js +4 -0
- package/lib/providers/personalize/types/index.d.ts +1 -0
- package/lib/providers/personalize/types/index.js +4 -0
- package/lib/providers/personalize/types/personalize.d.ts +8 -0
- package/lib/providers/personalize/types/personalize.js +4 -0
- package/lib/providers/pinpoint/apis/flushEvents.d.ts +2 -0
- package/lib/providers/pinpoint/apis/flushEvents.js +21 -0
- package/lib/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib/providers/pinpoint/apis/index.js +3 -1
- package/lib/providers/pinpoint/types/pinpoint.d.ts +1 -1
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +3 -0
- package/lib/singleton/API/types.d.ts +66 -29
- package/lib/singleton/Analytics/types.d.ts +4 -1
- package/lib/singleton/Auth/utils/index.js +1 -1
- package/lib/storage/DefaultStorage.native.d.ts +2 -2
- package/lib/storage/DefaultStorage.native.js +3 -24
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/globalHelpers/index.native.d.ts +0 -1
- package/lib/utils/globalHelpers/index.native.js +2 -1
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +2 -1
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +2 -1
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -2
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +3 -2
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -2
- package/lib-esm/Cache/AsyncStorageCache.d.ts +1 -1
- package/lib-esm/Cache/AsyncStorageCache.js +2 -1
- package/lib-esm/Platform/types.d.ts +3 -2
- package/lib-esm/Platform/types.js +3 -2
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Reachability/Reachability.native.d.ts +2 -2
- package/lib-esm/clients/handlers/fetch.js +2 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.d.ts +0 -1
- package/lib-esm/clients/middleware/signing/signer/signatureV4/index.native.js +2 -1
- package/lib-esm/clients/types/http.d.ts +17 -1
- package/lib-esm/libraryUtils.d.ts +2 -1
- package/lib-esm/libraryUtils.js +2 -0
- package/lib-esm/parseAWSExports.js +24 -8
- package/lib-esm/providers/kinesis/types/index.d.ts +1 -0
- package/lib-esm/providers/kinesis/types/index.js +3 -0
- package/lib-esm/providers/kinesis/types/kinesis.d.ts +9 -0
- package/lib-esm/providers/kinesis/types/kinesis.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/index.d.ts +1 -0
- package/lib-esm/providers/kinesis-firehose/types/index.js +3 -0
- package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.d.ts +9 -0
- package/lib-esm/providers/kinesis-firehose/types/kinesis-firehose.js +3 -0
- package/lib-esm/providers/personalize/types/index.d.ts +1 -0
- package/lib-esm/providers/personalize/types/index.js +3 -0
- package/lib-esm/providers/personalize/types/personalize.d.ts +8 -0
- package/lib-esm/providers/personalize/types/personalize.js +3 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.d.ts +2 -0
- package/lib-esm/providers/pinpoint/apis/flushEvents.js +17 -0
- package/lib-esm/providers/pinpoint/apis/index.d.ts +1 -0
- package/lib-esm/providers/pinpoint/apis/index.js +1 -0
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +1 -1
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.d.ts +1 -0
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +3 -0
- package/lib-esm/singleton/API/types.d.ts +66 -29
- package/lib-esm/singleton/Analytics/types.d.ts +4 -1
- package/lib-esm/singleton/Auth/utils/index.js +1 -1
- package/lib-esm/storage/DefaultStorage.native.d.ts +2 -2
- package/lib-esm/storage/DefaultStorage.native.js +3 -24
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/utils/globalHelpers/index.native.d.ts +0 -1
- package/lib-esm/utils/globalHelpers/index.native.js +2 -1
- package/package.json +4 -10
- package/src/Cache/AsyncStorageCache.ts +2 -1
- package/src/Hub/index.ts +1 -0
- package/src/Platform/types.ts +3 -2
- package/src/Platform/version.ts +1 -1
- package/src/Reachability/Reachability.native.ts +4 -2
- package/src/Signer/DateUtils.ts +1 -1
- package/src/clients/handlers/fetch.ts +5 -1
- package/src/clients/middleware/signing/signer/signatureV4/index.native.ts +3 -1
- package/src/clients/types/http.ts +19 -1
- package/src/libraryUtils.ts +4 -1
- package/src/parseAWSExports.ts +38 -7
- package/src/providers/kinesis/types/index.ts +4 -0
- package/src/providers/kinesis/types/kinesis.ts +12 -0
- package/src/providers/kinesis-firehose/types/index.ts +4 -0
- package/src/providers/kinesis-firehose/types/kinesis-firehose.ts +12 -0
- package/src/providers/personalize/types/index.ts +4 -0
- package/src/providers/personalize/types/personalize.ts +11 -0
- package/src/providers/pinpoint/apis/flushEvents.ts +31 -0
- package/src/providers/pinpoint/apis/index.ts +1 -0
- package/src/providers/pinpoint/types/pinpoint.ts +1 -1
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +4 -0
- package/src/singleton/API/types.ts +77 -26
- package/src/singleton/Analytics/types.ts +7 -1
- package/src/singleton/Auth/utils/index.ts +1 -1
- package/src/storage/DefaultStorage.native.ts +6 -26
- package/src/utils/globalHelpers/index.native.ts +3 -1
- package/polyfills/URL/index.ts +0 -14
- package/polyfills/URL/tsconfig.json +0 -10
- package/polyfills/URL/webpack.config.js +0 -43
|
@@ -36,14 +36,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
import {
|
|
40
|
-
var ASYNC_STORAGE_MODULE = '@react-native-async-storage/async-storage';
|
|
39
|
+
import { loadAsyncStorage } from '@aws-amplify/react-native';
|
|
41
40
|
var MEMORY_KEY_PREFIX = '@MemoryStorage:';
|
|
42
41
|
/**
|
|
43
42
|
* @internal
|
|
44
43
|
*/
|
|
45
44
|
var DefaultStorage = /** @class */ (function () {
|
|
46
45
|
function DefaultStorage() {
|
|
46
|
+
this.asyncStorage = loadAsyncStorage();
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* This is used to set a specific item in storage
|
|
@@ -52,7 +52,6 @@ var DefaultStorage = /** @class */ (function () {
|
|
|
52
52
|
* @returns {string} value that was set
|
|
53
53
|
*/
|
|
54
54
|
DefaultStorage.prototype.setItem = function (key, value) {
|
|
55
|
-
this.assertModule(this.asyncStorage);
|
|
56
55
|
return this.asyncStorage.setItem("".concat(MEMORY_KEY_PREFIX).concat(key), value);
|
|
57
56
|
};
|
|
58
57
|
/**
|
|
@@ -62,7 +61,6 @@ var DefaultStorage = /** @class */ (function () {
|
|
|
62
61
|
* @returns {string} the data item
|
|
63
62
|
*/
|
|
64
63
|
DefaultStorage.prototype.getItem = function (key) {
|
|
65
|
-
this.assertModule(this.asyncStorage);
|
|
66
64
|
return this.asyncStorage.getItem("".concat(MEMORY_KEY_PREFIX).concat(key));
|
|
67
65
|
};
|
|
68
66
|
/**
|
|
@@ -71,7 +69,6 @@ var DefaultStorage = /** @class */ (function () {
|
|
|
71
69
|
* @returns {string} value - value that was deleted
|
|
72
70
|
*/
|
|
73
71
|
DefaultStorage.prototype.removeItem = function (key) {
|
|
74
|
-
this.assertModule(this.asyncStorage);
|
|
75
72
|
return this.asyncStorage.removeItem("".concat(MEMORY_KEY_PREFIX).concat(key));
|
|
76
73
|
};
|
|
77
74
|
/**
|
|
@@ -83,9 +80,7 @@ var DefaultStorage = /** @class */ (function () {
|
|
|
83
80
|
var allKeys;
|
|
84
81
|
return __generator(this, function (_a) {
|
|
85
82
|
switch (_a.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
this.assertModule(this.asyncStorage);
|
|
88
|
-
return [4 /*yield*/, this.asyncStorage.getAllKeys()];
|
|
83
|
+
case 0: return [4 /*yield*/, this.asyncStorage.getAllKeys()];
|
|
89
84
|
case 1:
|
|
90
85
|
allKeys = _a.sent();
|
|
91
86
|
return [2 /*return*/, this.asyncStorage.multiRemove(allKeys.filter(function (key) { return key.startsWith(MEMORY_KEY_PREFIX); }))];
|
|
@@ -93,22 +88,6 @@ var DefaultStorage = /** @class */ (function () {
|
|
|
93
88
|
});
|
|
94
89
|
});
|
|
95
90
|
};
|
|
96
|
-
DefaultStorage.prototype.assertModule = function (asyncStorage) {
|
|
97
|
-
if (!!asyncStorage) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
try {
|
|
101
|
-
this.asyncStorage = require(ASYNC_STORAGE_MODULE)
|
|
102
|
-
.default;
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
throw new AmplifyError({
|
|
106
|
-
name: 'NativeModuleException',
|
|
107
|
-
message: "Unable to find ".concat(ASYNC_STORAGE_MODULE),
|
|
108
|
-
recoverySuggestion: "Make sure to install ".concat(ASYNC_STORAGE_MODULE),
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
91
|
return DefaultStorage;
|
|
113
92
|
}());
|
|
114
93
|
export { DefaultStorage };
|