@aws-amplify/core 6.0.1-console-preview.814dea6.0 → 6.0.1-console-preview.047a1dd.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/base.d.ts +12 -4
- package/lib/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib/Cache/Utils/CacheUtils.js +2 -4
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/ServiceWorker/ServiceWorker.js +1 -1
- package/lib/Util/JS.d.ts +1 -4
- package/lib/Util/JS.js +4 -11
- package/lib/Util/Reachability.js +0 -3
- package/lib/clients/handlers/authenticated.d.ts +1 -1
- package/lib/clients/handlers/fetch.d.ts +0 -1
- package/lib/clients/handlers/fetch.js +2 -2
- package/lib/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib/clients/types/aws.d.ts +1 -5
- package/lib/clients/types/http.d.ts +8 -0
- package/lib/clients/types/index.d.ts +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +6 -10
- package/lib/libraryUtils.d.ts +3 -3
- package/lib/libraryUtils.js +5 -10
- package/lib/parseAWSExports.js +20 -1
- package/lib/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib/providers/pinpoint/apis/record.js +3 -3
- package/lib/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib/providers/pinpoint/utils/PinpointEventBuffer.js +7 -5
- package/lib/providers/pinpoint/utils/isAppInForeground.d.ts +1 -0
- package/lib/{RNComponents → providers/pinpoint/utils}/isAppInForeground.js +1 -4
- package/lib/providers/pinpoint/utils/isAppInForeground.native.d.ts +1 -0
- package/lib/providers/pinpoint/utils/isAppInForeground.native.js +9 -0
- package/lib/singleton/API/types.d.ts +34 -0
- package/lib/singleton/API/types.js +2 -0
- package/lib/singleton/Amplify.d.ts +2 -2
- package/lib/singleton/Amplify.js +9 -1
- package/lib/singleton/Auth/index.d.ts +2 -1
- package/lib/singleton/Auth/index.js +22 -12
- package/lib/singleton/Auth/utils/index.js +3 -3
- package/lib/singleton/Storage/types.d.ts +5 -0
- package/lib/singleton/types.d.ts +10 -1
- package/lib/{StorageHelper/cookieStorage.d.ts → storage/CookieStorage.d.ts} +4 -3
- package/lib/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +35 -83
- package/lib/storage/CookieStorage.native.d.ts +7 -0
- package/lib/storage/CookieStorage.native.js +32 -0
- package/lib/storage/DefaultStorage.d.ts +7 -0
- package/lib/storage/DefaultStorage.js +33 -0
- package/{lib-esm/StorageHelper/localStorage.d.ts → lib/storage/DefaultStorage.native.d.ts} +7 -6
- package/lib/{StorageHelper/sessionStorage.js → storage/DefaultStorage.native.js} +46 -43
- package/lib/storage/InMemoryStorage.d.ts +12 -0
- package/lib/storage/InMemoryStorage.js +41 -0
- package/lib/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/lib/{StorageHelper/localStorage.js → storage/KeyValueStorage.js} +13 -15
- package/lib/storage/SessionStorage.d.ts +7 -0
- package/lib/storage/SessionStorage.js +33 -0
- package/lib/storage/index.d.ts +7 -0
- package/lib/storage/index.js +14 -0
- package/lib/storage/utils.d.ts +10 -0
- package/lib/storage/utils.js +26 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/storage.d.ts +3 -0
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +12 -4
- package/lib-esm/AwsClients/CognitoIdentity/base.js +1 -0
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +15 -3
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +15 -3
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +10 -2
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +17 -3
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +17 -3
- package/lib-esm/Cache/Utils/CacheUtils.js +2 -4
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/ServiceWorker/ServiceWorker.js +2 -2
- package/lib-esm/Util/JS.d.ts +1 -4
- package/lib-esm/Util/JS.js +2 -9
- package/lib-esm/Util/Reachability.js +1 -4
- package/lib-esm/clients/handlers/authenticated.d.ts +1 -1
- package/lib-esm/clients/handlers/fetch.d.ts +0 -1
- package/lib-esm/clients/handlers/fetch.js +2 -2
- package/lib-esm/clients/handlers/unauthenticated.d.ts +1 -1
- package/lib-esm/clients/internal/composeServiceApi.d.ts +5 -3
- package/lib-esm/clients/types/aws.d.ts +1 -5
- package/lib-esm/clients/types/http.d.ts +8 -0
- package/lib-esm/clients/types/index.d.ts +1 -1
- package/lib-esm/index.d.ts +1 -2
- package/lib-esm/index.js +1 -2
- package/lib-esm/libraryUtils.d.ts +3 -3
- package/lib-esm/libraryUtils.js +2 -3
- package/lib-esm/parseAWSExports.js +20 -1
- package/lib-esm/providers/pinpoint/apis/record.d.ts +2 -2
- package/lib-esm/providers/pinpoint/apis/record.js +3 -3
- package/lib-esm/providers/pinpoint/apis/updateEndpoint.d.ts +2 -2
- package/lib-esm/providers/pinpoint/types/buffer.d.ts +1 -1
- package/lib-esm/providers/pinpoint/types/pinpoint.d.ts +3 -3
- package/lib-esm/providers/pinpoint/utils/PinpointEventBuffer.js +7 -5
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.js +3 -0
- package/lib-esm/providers/pinpoint/utils/isAppInForeground.native.js +5 -0
- package/lib-esm/singleton/API/types.d.ts +34 -0
- package/lib-esm/singleton/API/types.js +1 -0
- package/lib-esm/singleton/Amplify.d.ts +2 -2
- package/lib-esm/singleton/Amplify.js +9 -1
- package/lib-esm/singleton/Auth/index.d.ts +2 -1
- package/lib-esm/singleton/Auth/index.js +22 -12
- package/lib-esm/singleton/Auth/utils/index.js +3 -3
- package/lib-esm/singleton/Storage/types.d.ts +5 -0
- package/lib-esm/singleton/types.d.ts +10 -1
- package/lib-esm/{StorageHelper/cookieStorage.d.ts → storage/CookieStorage.d.ts} +4 -3
- package/lib-esm/{StorageHelper/cookieStorage.js → storage/CookieStorage.js} +36 -61
- package/lib-esm/storage/CookieStorage.native.d.ts +7 -0
- package/lib-esm/storage/CookieStorage.native.js +29 -0
- package/lib-esm/storage/DefaultStorage.d.ts +7 -0
- package/lib-esm/storage/DefaultStorage.js +30 -0
- package/{lib/StorageHelper/localStorage.d.ts → lib-esm/storage/DefaultStorage.native.d.ts} +7 -6
- package/lib-esm/{StorageHelper/sessionStorage.js → storage/DefaultStorage.native.js} +45 -42
- package/lib-esm/storage/InMemoryStorage.d.ts +12 -0
- package/lib-esm/storage/InMemoryStorage.js +38 -0
- package/lib-esm/{StorageHelper/sessionStorage.d.ts → storage/KeyValueStorage.d.ts} +5 -4
- package/lib-esm/{StorageHelper/localStorage.js → storage/KeyValueStorage.js} +12 -14
- package/lib-esm/storage/SessionStorage.d.ts +7 -0
- package/lib-esm/storage/SessionStorage.js +30 -0
- package/lib-esm/storage/index.d.ts +7 -0
- package/lib-esm/storage/index.js +10 -0
- package/lib-esm/storage/utils.d.ts +10 -0
- package/lib-esm/storage/utils.js +21 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/storage.d.ts +3 -0
- package/package.json +3 -6
- package/src/AwsClients/CognitoIdentity/base.ts +2 -2
- package/src/AwsClients/Pinpoint/base.ts +2 -6
- package/src/Cache/Utils/CacheUtils.ts +2 -4
- package/src/Platform/version.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +2 -2
- package/src/Util/JS.ts +2 -13
- package/src/Util/Reachability.ts +1 -5
- package/src/clients/handlers/authenticated.ts +2 -1
- package/src/clients/handlers/fetch.ts +2 -2
- package/src/clients/handlers/unauthenticated.ts +2 -1
- package/src/clients/internal/composeServiceApi.ts +10 -3
- package/src/clients/types/aws.ts +4 -11
- package/src/clients/types/http.ts +8 -0
- package/src/clients/types/index.ts +0 -1
- package/src/index.ts +4 -8
- package/src/libraryUtils.ts +3 -4
- package/src/parseAWSExports.ts +26 -0
- package/src/providers/pinpoint/apis/record.ts +8 -8
- package/src/providers/pinpoint/apis/updateEndpoint.ts +2 -2
- package/src/providers/pinpoint/types/buffer.ts +1 -1
- package/src/providers/pinpoint/types/pinpoint.ts +8 -7
- package/src/providers/pinpoint/utils/PinpointEventBuffer.ts +16 -12
- package/src/providers/pinpoint/utils/isAppInForeground.native.ts +7 -0
- package/src/providers/pinpoint/utils/isAppInForeground.ts +4 -0
- package/src/singleton/API/types.ts +31 -0
- package/src/singleton/Amplify.ts +12 -3
- package/src/singleton/Auth/index.ts +9 -2
- package/src/singleton/Auth/utils/index.ts +3 -3
- package/src/singleton/Storage/types.ts +6 -2
- package/src/singleton/types.ts +11 -1
- package/src/storage/CookieStorage.native.ts +13 -0
- package/src/storage/CookieStorage.ts +72 -0
- package/src/storage/DefaultStorage.native.ts +78 -0
- package/src/storage/DefaultStorage.ts +14 -0
- package/src/storage/InMemoryStorage.ts +36 -0
- package/src/{StorageHelper/sessionStorage.ts → storage/KeyValueStorage.ts} +10 -13
- package/src/storage/SessionStorage.ts +14 -0
- package/src/storage/index.ts +13 -0
- package/src/storage/utils.ts +22 -0
- package/src/types/storage.ts +4 -0
- package/lib/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib/OAuthHelper/FacebookOAuth.js +0 -124
- package/lib/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib/OAuthHelper/GoogleOAuth.js +0 -134
- package/lib/OAuthHelper/index.d.ts +0 -4
- package/lib/OAuthHelper/index.js +0 -9
- package/lib/RNComponents/index.d.ts +0 -6
- package/lib/RNComponents/index.js +0 -16
- package/lib/RNComponents/reactnative.d.ts +0 -3
- package/lib/RNComponents/reactnative.js +0 -14
- package/lib/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib/StorageHelper/inMemoryStorage.js +0 -82
- package/lib/StorageHelper/index.d.ts +0 -45
- package/lib/StorageHelper/index.js +0 -83
- package/lib/StorageHelper/reactnative.d.ts +0 -83
- package/lib/StorageHelper/reactnative.js +0 -250
- package/lib-esm/OAuthHelper/FacebookOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/FacebookOAuth.js +0 -121
- package/lib-esm/OAuthHelper/GoogleOAuth.d.ts +0 -6
- package/lib-esm/OAuthHelper/GoogleOAuth.js +0 -131
- package/lib-esm/OAuthHelper/index.d.ts +0 -4
- package/lib-esm/OAuthHelper/index.js +0 -6
- package/lib-esm/RNComponents/index.d.ts +0 -6
- package/lib-esm/RNComponents/index.js +0 -13
- package/lib-esm/RNComponents/isAppInForeground.js +0 -6
- package/lib-esm/RNComponents/reactnative.d.ts +0 -3
- package/lib-esm/RNComponents/reactnative.js +0 -6
- package/lib-esm/StorageHelper/inMemoryStorage.d.ts +0 -10
- package/lib-esm/StorageHelper/inMemoryStorage.js +0 -79
- package/lib-esm/StorageHelper/index.d.ts +0 -45
- package/lib-esm/StorageHelper/index.js +0 -76
- package/lib-esm/StorageHelper/reactnative.d.ts +0 -83
- package/lib-esm/StorageHelper/reactnative.js +0 -244
- package/src/OAuthHelper/FacebookOAuth.ts +0 -83
- package/src/OAuthHelper/GoogleOAuth.ts +0 -97
- package/src/OAuthHelper/index.ts +0 -7
- package/src/RNComponents/index.ts +0 -16
- package/src/RNComponents/isAppInForeground.ts +0 -8
- package/src/RNComponents/reactnative.ts +0 -6
- package/src/StorageHelper/cookieStorage.ts +0 -99
- package/src/StorageHelper/inMemoryStorage.ts +0 -32
- package/src/StorageHelper/index.ts +0 -78
- package/src/StorageHelper/localStorage.ts +0 -60
- package/src/StorageHelper/reactnative.ts +0 -182
- /package/lib-esm/{RNComponents → providers/pinpoint/utils}/isAppInForeground.d.ts +0 -0
- /package/{lib/RNComponents/isAppInForeground.d.ts → lib-esm/providers/pinpoint/utils/isAppInForeground.native.d.ts} +0 -0
|
@@ -57,20 +57,19 @@ var AuthClass = /** @class */ (function () {
|
|
|
57
57
|
this.authOptions = authOptions;
|
|
58
58
|
};
|
|
59
59
|
AuthClass.prototype.fetchAuthSession = function (options) {
|
|
60
|
-
var _a, _b, _c, _d, _e, _f
|
|
60
|
+
var _a, _b, _c, _d, _e, _f;
|
|
61
61
|
if (options === void 0) { options = {}; }
|
|
62
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
63
|
var tokens, credentialsAndIdentityId, userSub;
|
|
64
|
-
return __generator(this, function (
|
|
65
|
-
switch (
|
|
66
|
-
case 0: return [4 /*yield*/,
|
|
64
|
+
return __generator(this, function (_g) {
|
|
65
|
+
switch (_g.label) {
|
|
66
|
+
case 0: return [4 /*yield*/, this.getTokens(options)];
|
|
67
67
|
case 1:
|
|
68
68
|
// Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
|
|
69
|
-
tokens =
|
|
70
|
-
(_c = (_k.sent())) !== null && _c !== void 0 ? _c : undefined;
|
|
69
|
+
tokens = _g.sent();
|
|
71
70
|
if (!tokens) return [3 /*break*/, 3];
|
|
72
|
-
userSub = (
|
|
73
|
-
return [4 /*yield*/, ((
|
|
71
|
+
userSub = (_b = (_a = tokens.accessToken) === null || _a === void 0 ? void 0 : _a.payload) === null || _b === void 0 ? void 0 : _b.sub;
|
|
72
|
+
return [4 /*yield*/, ((_d = (_c = this.authOptions) === null || _c === void 0 ? void 0 : _c.credentialsProvider) === null || _d === void 0 ? void 0 : _d.getCredentialsAndIdentityId({
|
|
74
73
|
authConfig: this.authConfig,
|
|
75
74
|
tokens: tokens,
|
|
76
75
|
authenticated: true,
|
|
@@ -79,9 +78,9 @@ var AuthClass = /** @class */ (function () {
|
|
|
79
78
|
case 2:
|
|
80
79
|
// getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
|
|
81
80
|
credentialsAndIdentityId =
|
|
82
|
-
|
|
81
|
+
_g.sent();
|
|
83
82
|
return [3 /*break*/, 5];
|
|
84
|
-
case 3: return [4 /*yield*/, ((
|
|
83
|
+
case 3: return [4 /*yield*/, ((_f = (_e = this.authOptions) === null || _e === void 0 ? void 0 : _e.credentialsProvider) === null || _f === void 0 ? void 0 : _f.getCredentialsAndIdentityId({
|
|
85
84
|
authConfig: this.authConfig,
|
|
86
85
|
authenticated: false,
|
|
87
86
|
forceRefresh: options.forceRefresh,
|
|
@@ -89,8 +88,8 @@ var AuthClass = /** @class */ (function () {
|
|
|
89
88
|
case 4:
|
|
90
89
|
// getCredentialsAndIdentityId will throw if cannot get credentials (network or service error)
|
|
91
90
|
credentialsAndIdentityId =
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
_g.sent();
|
|
92
|
+
_g.label = 5;
|
|
94
93
|
case 5: return [2 /*return*/, {
|
|
95
94
|
tokens: tokens,
|
|
96
95
|
credentials: credentialsAndIdentityId === null || credentialsAndIdentityId === void 0 ? void 0 : credentialsAndIdentityId.credentials,
|
|
@@ -115,6 +114,17 @@ var AuthClass = /** @class */ (function () {
|
|
|
115
114
|
});
|
|
116
115
|
});
|
|
117
116
|
};
|
|
117
|
+
AuthClass.prototype.getTokens = function (options) {
|
|
118
|
+
var _a, _b, _c;
|
|
119
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
120
|
+
return __generator(this, function (_d) {
|
|
121
|
+
switch (_d.label) {
|
|
122
|
+
case 0: return [4 /*yield*/, ((_b = (_a = this.authOptions) === null || _a === void 0 ? void 0 : _a.tokenProvider) === null || _b === void 0 ? void 0 : _b.getTokens(options))];
|
|
123
|
+
case 1: return [2 /*return*/, ((_c = (_d.sent())) !== null && _c !== void 0 ? _c : undefined)];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
118
128
|
return AuthClass;
|
|
119
129
|
}());
|
|
120
130
|
export { AuthClass };
|
|
@@ -31,9 +31,9 @@ export function assertOAuthConfig(cognitoConfig) {
|
|
|
31
31
|
export function assertIdentityPooIdConfig(cognitoConfig) {
|
|
32
32
|
var validConfig = !!(cognitoConfig === null || cognitoConfig === void 0 ? void 0 : cognitoConfig.identityPoolId);
|
|
33
33
|
return asserts(validConfig, {
|
|
34
|
-
name: '
|
|
35
|
-
message: '
|
|
36
|
-
recoverySuggestion: 'Make sure
|
|
34
|
+
name: 'InvalidIdentityPoolIdException',
|
|
35
|
+
message: 'Invalid identity pool id provided.',
|
|
36
|
+
recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
function assertUserPoolAndIdentityPooConfig(authConfig) {
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
import { APIConfig, LibraryAPIOptions } from './API/types';
|
|
1
2
|
import { AnalyticsConfig } from './Analytics/types';
|
|
2
3
|
import { AuthConfig, LibraryAuthOptions, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, CognitoIdentityPoolConfig } from './Auth/types';
|
|
3
4
|
import { LibraryStorageOptions, StorageAccessLevel, StorageConfig } from './Storage/types';
|
|
5
|
+
export type LegacyConfig = {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated The field should not be used.
|
|
8
|
+
*/
|
|
9
|
+
aws_project_region?: string;
|
|
10
|
+
};
|
|
4
11
|
export type ResourcesConfig = {
|
|
12
|
+
API?: APIConfig;
|
|
5
13
|
Analytics?: AnalyticsConfig;
|
|
6
14
|
Auth?: AuthConfig;
|
|
7
15
|
Storage?: StorageConfig;
|
|
8
16
|
};
|
|
9
17
|
export type LibraryOptions = {
|
|
18
|
+
API?: LibraryAPIOptions;
|
|
10
19
|
Auth?: LibraryAuthOptions;
|
|
11
20
|
Storage?: LibraryStorageOptions;
|
|
12
21
|
ssr?: boolean;
|
|
13
22
|
};
|
|
14
|
-
export { AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, };
|
|
23
|
+
export { APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig, AuthUserPoolAndIdentityPoolConfig, GetCredentialsOptions, StorageAccessLevel, StorageConfig, AnalyticsConfig, CognitoIdentityPoolConfig, };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { CookieStorageData, KeyValueStorageInterface, SameSite } from '../types';
|
|
2
2
|
export declare class CookieStorage implements KeyValueStorageInterface {
|
|
3
|
-
domain?: string;
|
|
4
3
|
path: string;
|
|
4
|
+
domain?: string;
|
|
5
5
|
expires?: number;
|
|
6
|
-
secure?: boolean;
|
|
7
6
|
sameSite?: SameSite;
|
|
7
|
+
secure?: boolean;
|
|
8
8
|
constructor(data?: CookieStorageData);
|
|
9
9
|
setItem(key: string, value: string): Promise<void>;
|
|
10
|
-
getItem(key: string): Promise<string>;
|
|
10
|
+
getItem(key: string): Promise<string | null>;
|
|
11
11
|
removeItem(key: string): Promise<void>;
|
|
12
12
|
clear(): Promise<void>;
|
|
13
|
+
private getData;
|
|
13
14
|
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
1
14
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
15
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
16
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -34,101 +47,60 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
47
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
48
|
}
|
|
36
49
|
};
|
|
37
|
-
|
|
38
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
import * as Cookies from 'js-cookie';
|
|
50
|
+
import { get as getJsCookie, remove as removeJsCookie, set as setJsCookie, } from 'js-cookie';
|
|
41
51
|
var CookieStorage = /** @class */ (function () {
|
|
42
52
|
function CookieStorage(data) {
|
|
43
53
|
if (data === void 0) { data = {}; }
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.path = '/';
|
|
52
|
-
}
|
|
53
|
-
if (Object.prototype.hasOwnProperty.call(data, 'expires')) {
|
|
54
|
-
this.expires = data.expires;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.expires = 365;
|
|
58
|
-
}
|
|
59
|
-
if (Object.prototype.hasOwnProperty.call(data, 'secure')) {
|
|
60
|
-
this.secure = data.secure;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
this.secure = true;
|
|
64
|
-
}
|
|
54
|
+
var path = data.path, domain = data.domain, expires = data.expires, sameSite = data.sameSite, secure = data.secure;
|
|
55
|
+
this.domain = domain;
|
|
56
|
+
this.path = path ? path : '/';
|
|
57
|
+
this.expires = data.hasOwnProperty('expires') ? expires : 365;
|
|
58
|
+
this.secure = data.hasOwnProperty('secure') ? secure : true;
|
|
65
59
|
if (data.hasOwnProperty('sameSite')) {
|
|
66
|
-
if (!
|
|
67
|
-
!['strict', 'lax', 'none'].includes(data.sameSite)) {
|
|
60
|
+
if (!sameSite || !['strict', 'lax', 'none'].includes(sameSite)) {
|
|
68
61
|
throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');
|
|
69
62
|
}
|
|
70
|
-
if (
|
|
63
|
+
if (sameSite === 'none' && !this.secure) {
|
|
71
64
|
throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');
|
|
72
65
|
}
|
|
73
|
-
this.sameSite =
|
|
66
|
+
this.sameSite = sameSite;
|
|
74
67
|
}
|
|
75
68
|
}
|
|
76
69
|
CookieStorage.prototype.setItem = function (key, value) {
|
|
77
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var options;
|
|
79
71
|
return __generator(this, function (_a) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
expires: this.expires,
|
|
83
|
-
domain: this.domain,
|
|
84
|
-
secure: this.secure,
|
|
85
|
-
};
|
|
86
|
-
if (this.sameSite) {
|
|
87
|
-
options.sameSite = this.sameSite;
|
|
88
|
-
}
|
|
89
|
-
Cookies.set(key, value, options);
|
|
90
|
-
return [2 /*return*/, Cookies.get(key)];
|
|
72
|
+
setJsCookie(key, value, this.getData());
|
|
73
|
+
return [2 /*return*/];
|
|
91
74
|
});
|
|
92
75
|
});
|
|
93
76
|
};
|
|
94
77
|
CookieStorage.prototype.getItem = function (key) {
|
|
95
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
var item;
|
|
96
80
|
return __generator(this, function (_a) {
|
|
97
|
-
|
|
81
|
+
item = getJsCookie(key);
|
|
82
|
+
return [2 /*return*/, item !== null && item !== void 0 ? item : null];
|
|
98
83
|
});
|
|
99
84
|
});
|
|
100
85
|
};
|
|
101
86
|
CookieStorage.prototype.removeItem = function (key) {
|
|
102
87
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
var options;
|
|
104
88
|
return __generator(this, function (_a) {
|
|
105
|
-
|
|
106
|
-
path: this.path,
|
|
107
|
-
expires: this.expires,
|
|
108
|
-
domain: this.domain,
|
|
109
|
-
secure: this.secure,
|
|
110
|
-
};
|
|
111
|
-
if (this.sameSite) {
|
|
112
|
-
options.sameSite = this.sameSite;
|
|
113
|
-
}
|
|
114
|
-
Cookies.remove(key, options);
|
|
89
|
+
removeJsCookie(key, this.getData());
|
|
115
90
|
return [2 /*return*/];
|
|
116
91
|
});
|
|
117
92
|
});
|
|
118
93
|
};
|
|
119
94
|
CookieStorage.prototype.clear = function () {
|
|
120
95
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
-
var
|
|
96
|
+
var cookie, promises;
|
|
97
|
+
var _this = this;
|
|
122
98
|
return __generator(this, function (_a) {
|
|
123
99
|
switch (_a.label) {
|
|
124
100
|
case 0:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
for (index = 0; index < numKeys; ++index) {
|
|
129
|
-
promiseArray.push(this.removeItem(Object.keys(cookies)[index]));
|
|
130
|
-
}
|
|
131
|
-
return [4 /*yield*/, Promise.all(promiseArray)];
|
|
101
|
+
cookie = getJsCookie();
|
|
102
|
+
promises = Object.keys(cookie).map(function (key) { return _this.removeItem(key); });
|
|
103
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
132
104
|
case 1:
|
|
133
105
|
_a.sent();
|
|
134
106
|
return [2 /*return*/];
|
|
@@ -136,6 +108,9 @@ var CookieStorage = /** @class */ (function () {
|
|
|
136
108
|
});
|
|
137
109
|
});
|
|
138
110
|
};
|
|
111
|
+
CookieStorage.prototype.getData = function () {
|
|
112
|
+
return __assign({ path: this.path, expires: this.expires, domain: this.domain, secure: this.secure }, (this.sameSite && { sameSite: this.sameSite }));
|
|
113
|
+
};
|
|
139
114
|
return CookieStorage;
|
|
140
115
|
}());
|
|
141
116
|
export { CookieStorage };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4
|
+
var extendStatics = function (d, b) {
|
|
5
|
+
extendStatics = Object.setPrototypeOf ||
|
|
6
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
+
return extendStatics(d, b);
|
|
9
|
+
};
|
|
10
|
+
return function (d, b) {
|
|
11
|
+
if (typeof b !== "function" && b !== null)
|
|
12
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
+
extendStatics(d, b);
|
|
14
|
+
function __() { this.constructor = d; }
|
|
15
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
18
|
+
import { KeyValueStorage } from './KeyValueStorage';
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
var CookieStorage = /** @class */ (function (_super) {
|
|
23
|
+
__extends(CookieStorage, _super);
|
|
24
|
+
function CookieStorage() {
|
|
25
|
+
return _super.call(this) || this;
|
|
26
|
+
}
|
|
27
|
+
return CookieStorage;
|
|
28
|
+
}(KeyValueStorage));
|
|
29
|
+
export { CookieStorage };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
var __extends = (this && this.__extends) || (function () {
|
|
4
|
+
var extendStatics = function (d, b) {
|
|
5
|
+
extendStatics = Object.setPrototypeOf ||
|
|
6
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
8
|
+
return extendStatics(d, b);
|
|
9
|
+
};
|
|
10
|
+
return function (d, b) {
|
|
11
|
+
if (typeof b !== "function" && b !== null)
|
|
12
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
13
|
+
extendStatics(d, b);
|
|
14
|
+
function __() { this.constructor = d; }
|
|
15
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
18
|
+
import { KeyValueStorage } from './KeyValueStorage';
|
|
19
|
+
import { getDefaultStorageWithFallback } from './utils';
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
var DefaultStorage = /** @class */ (function (_super) {
|
|
24
|
+
__extends(DefaultStorage, _super);
|
|
25
|
+
function DefaultStorage() {
|
|
26
|
+
return _super.call(this, getDefaultStorageWithFallback()) || this;
|
|
27
|
+
}
|
|
28
|
+
return DefaultStorage;
|
|
29
|
+
}(KeyValueStorage));
|
|
30
|
+
export { DefaultStorage };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { KeyValueStorageInterface } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { KeyValueStorageInterface } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class DefaultStorage implements KeyValueStorageInterface {
|
|
6
|
+
private asyncStorage?;
|
|
5
7
|
/**
|
|
6
8
|
* This is used to set a specific item in storage
|
|
7
9
|
* @param {string} key - the key for the item
|
|
@@ -27,6 +29,5 @@ declare class LocalStorageClass implements KeyValueStorageInterface {
|
|
|
27
29
|
* @returns {string} nothing
|
|
28
30
|
*/
|
|
29
31
|
clear(): Promise<void>;
|
|
32
|
+
private assertModule;
|
|
30
33
|
}
|
|
31
|
-
export declare const LocalStorage: LocalStorageClass;
|
|
32
|
-
export {};
|
|
@@ -36,15 +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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
39
|
+
import { AmplifyError } from '../libraryUtils';
|
|
40
|
+
var ASYNC_STORAGE_MODULE = '@react-native-async-storage/async-storage';
|
|
41
|
+
var MEMORY_KEY_PREFIX = '@MemoryStorage:';
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
var DefaultStorage = /** @class */ (function () {
|
|
46
|
+
function DefaultStorage() {
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
49
|
* This is used to set a specific item in storage
|
|
@@ -52,15 +51,9 @@ var SessionStorageClass = /** @class */ (function () {
|
|
|
52
51
|
* @param {object} value - the value
|
|
53
52
|
* @returns {string} value that was set
|
|
54
53
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!this.storage)
|
|
59
|
-
throw PlatformNotSupportedError;
|
|
60
|
-
this.storage.setItem(key, value);
|
|
61
|
-
return [2 /*return*/];
|
|
62
|
-
});
|
|
63
|
-
});
|
|
54
|
+
DefaultStorage.prototype.setItem = function (key, value) {
|
|
55
|
+
this.assertModule(this.asyncStorage);
|
|
56
|
+
return this.asyncStorage.setItem("".concat(MEMORY_KEY_PREFIX).concat(key), value);
|
|
64
57
|
};
|
|
65
58
|
/**
|
|
66
59
|
* This is used to get a specific key from storage
|
|
@@ -68,44 +61,54 @@ var SessionStorageClass = /** @class */ (function () {
|
|
|
68
61
|
* This is used to clear the storage
|
|
69
62
|
* @returns {string} the data item
|
|
70
63
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!this.storage)
|
|
75
|
-
throw PlatformNotSupportedError;
|
|
76
|
-
return [2 /*return*/, this.storage.getItem(key)];
|
|
77
|
-
});
|
|
78
|
-
});
|
|
64
|
+
DefaultStorage.prototype.getItem = function (key) {
|
|
65
|
+
this.assertModule(this.asyncStorage);
|
|
66
|
+
return this.asyncStorage.getItem("".concat(MEMORY_KEY_PREFIX).concat(key));
|
|
79
67
|
};
|
|
80
68
|
/**
|
|
81
69
|
* This is used to remove an item from storage
|
|
82
70
|
* @param {string} key - the key being set
|
|
83
71
|
* @returns {string} value - value that was deleted
|
|
84
72
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (!this.storage)
|
|
89
|
-
throw PlatformNotSupportedError;
|
|
90
|
-
this.storage.removeItem(key);
|
|
91
|
-
return [2 /*return*/];
|
|
92
|
-
});
|
|
93
|
-
});
|
|
73
|
+
DefaultStorage.prototype.removeItem = function (key) {
|
|
74
|
+
this.assertModule(this.asyncStorage);
|
|
75
|
+
return this.asyncStorage.removeItem("".concat(MEMORY_KEY_PREFIX).concat(key));
|
|
94
76
|
};
|
|
95
77
|
/**
|
|
96
78
|
* This is used to clear the storage
|
|
97
79
|
* @returns {string} nothing
|
|
98
80
|
*/
|
|
99
|
-
|
|
81
|
+
DefaultStorage.prototype.clear = function () {
|
|
100
82
|
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var allKeys;
|
|
101
84
|
return __generator(this, function (_a) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
this.assertModule(this.asyncStorage);
|
|
88
|
+
return [4 /*yield*/, this.asyncStorage.getAllKeys()];
|
|
89
|
+
case 1:
|
|
90
|
+
allKeys = _a.sent();
|
|
91
|
+
return [2 /*return*/, this.asyncStorage.multiRemove(allKeys.filter(function (key) { return key.startsWith(MEMORY_KEY_PREFIX); }))];
|
|
92
|
+
}
|
|
106
93
|
});
|
|
107
94
|
});
|
|
108
95
|
};
|
|
109
|
-
|
|
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
|
+
return DefaultStorage;
|
|
110
113
|
}());
|
|
111
|
-
export
|
|
114
|
+
export { DefaultStorage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare class InMemoryStorage implements Storage {
|
|
5
|
+
storage: Map<string, string>;
|
|
6
|
+
get length(): number;
|
|
7
|
+
key(index: number): string | null;
|
|
8
|
+
setItem(key: string, value: string): void;
|
|
9
|
+
getItem(key: string): string | null;
|
|
10
|
+
removeItem(key: string): void;
|
|
11
|
+
clear(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
var InMemoryStorage = /** @class */ (function () {
|
|
7
|
+
function InMemoryStorage() {
|
|
8
|
+
this.storage = new Map();
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(InMemoryStorage.prototype, "length", {
|
|
11
|
+
get: function () {
|
|
12
|
+
return this.storage.size;
|
|
13
|
+
},
|
|
14
|
+
enumerable: false,
|
|
15
|
+
configurable: true
|
|
16
|
+
});
|
|
17
|
+
InMemoryStorage.prototype.key = function (index) {
|
|
18
|
+
if (index > this.length - 1) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return Array.from(this.storage.keys())[index];
|
|
22
|
+
};
|
|
23
|
+
InMemoryStorage.prototype.setItem = function (key, value) {
|
|
24
|
+
this.storage.set(key, value);
|
|
25
|
+
};
|
|
26
|
+
InMemoryStorage.prototype.getItem = function (key) {
|
|
27
|
+
var _a;
|
|
28
|
+
return (_a = this.storage.get(key)) !== null && _a !== void 0 ? _a : null;
|
|
29
|
+
};
|
|
30
|
+
InMemoryStorage.prototype.removeItem = function (key) {
|
|
31
|
+
this.storage.delete(key);
|
|
32
|
+
};
|
|
33
|
+
InMemoryStorage.prototype.clear = function () {
|
|
34
|
+
this.storage.clear();
|
|
35
|
+
};
|
|
36
|
+
return InMemoryStorage;
|
|
37
|
+
}());
|
|
38
|
+
export { InMemoryStorage };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { KeyValueStorageInterface } from '../types';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class KeyValueStorage implements KeyValueStorageInterface {
|
|
3
6
|
storage?: Storage;
|
|
4
|
-
constructor();
|
|
7
|
+
constructor(storage?: Storage);
|
|
5
8
|
/**
|
|
6
9
|
* This is used to set a specific item in storage
|
|
7
10
|
* @param {string} key - the key for the item
|
|
@@ -28,5 +31,3 @@ declare class SessionStorageClass implements KeyValueStorageInterface {
|
|
|
28
31
|
*/
|
|
29
32
|
clear(): Promise<void>;
|
|
30
33
|
}
|
|
31
|
-
export declare const SessionStorage: SessionStorageClass;
|
|
32
|
-
export {};
|
|
@@ -37,14 +37,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
import { PlatformNotSupportedError } from '../Util/Errors';
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
catch (error) { }
|
|
47
|
-
}
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
var KeyValueStorage = /** @class */ (function () {
|
|
44
|
+
function KeyValueStorage(storage) {
|
|
45
|
+
this.storage = storage;
|
|
48
46
|
}
|
|
49
47
|
/**
|
|
50
48
|
* This is used to set a specific item in storage
|
|
@@ -52,7 +50,7 @@ var LocalStorageClass = /** @class */ (function () {
|
|
|
52
50
|
* @param {object} value - the value
|
|
53
51
|
* @returns {string} value that was set
|
|
54
52
|
*/
|
|
55
|
-
|
|
53
|
+
KeyValueStorage.prototype.setItem = function (key, value) {
|
|
56
54
|
return __awaiter(this, void 0, void 0, function () {
|
|
57
55
|
return __generator(this, function (_a) {
|
|
58
56
|
if (!this.storage)
|
|
@@ -68,7 +66,7 @@ var LocalStorageClass = /** @class */ (function () {
|
|
|
68
66
|
* This is used to clear the storage
|
|
69
67
|
* @returns {string} the data item
|
|
70
68
|
*/
|
|
71
|
-
|
|
69
|
+
KeyValueStorage.prototype.getItem = function (key) {
|
|
72
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
73
71
|
return __generator(this, function (_a) {
|
|
74
72
|
if (!this.storage)
|
|
@@ -82,7 +80,7 @@ var LocalStorageClass = /** @class */ (function () {
|
|
|
82
80
|
* @param {string} key - the key being set
|
|
83
81
|
* @returns {string} value - value that was deleted
|
|
84
82
|
*/
|
|
85
|
-
|
|
83
|
+
KeyValueStorage.prototype.removeItem = function (key) {
|
|
86
84
|
return __awaiter(this, void 0, void 0, function () {
|
|
87
85
|
return __generator(this, function (_a) {
|
|
88
86
|
if (!this.storage)
|
|
@@ -96,7 +94,7 @@ var LocalStorageClass = /** @class */ (function () {
|
|
|
96
94
|
* This is used to clear the storage
|
|
97
95
|
* @returns {string} nothing
|
|
98
96
|
*/
|
|
99
|
-
|
|
97
|
+
KeyValueStorage.prototype.clear = function () {
|
|
100
98
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
99
|
return __generator(this, function (_a) {
|
|
102
100
|
if (!this.storage)
|
|
@@ -106,6 +104,6 @@ var LocalStorageClass = /** @class */ (function () {
|
|
|
106
104
|
});
|
|
107
105
|
});
|
|
108
106
|
};
|
|
109
|
-
return
|
|
107
|
+
return KeyValueStorage;
|
|
110
108
|
}());
|
|
111
|
-
export
|
|
109
|
+
export { KeyValueStorage };
|