@aws-amplify/core 5.8.2 → 6.0.1-console-preview.f63250a.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/README.md +3 -0
- package/lib/Amplify.d.ts +18 -17
- package/lib/Amplify.js +9 -0
- package/lib/AwsClients/CognitoIdentity/base.d.ts +3 -10
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +3 -17
- package/lib/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +8 -8
- package/lib/AwsClients/CognitoIdentity/getId.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/base.d.ts +2 -10
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/getInAppMessages.js +1 -1
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/putEvents.js +6 -0
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -17
- package/lib/AwsClients/Pinpoint/updateEndpoint.js +2 -2
- package/lib/Cache/AsyncStorageCache.d.ts +154 -0
- package/lib/Cache/AsyncStorageCache.js +744 -0
- package/lib/Cache/BrowserStorageCache.d.ts +166 -0
- package/lib/Cache/BrowserStorageCache.js +469 -0
- package/lib/Cache/InMemoryCache.d.ts +129 -0
- package/lib/Cache/InMemoryCache.js +349 -0
- package/lib/Cache/StorageCache.d.ts +39 -0
- package/lib/Cache/StorageCache.js +121 -0
- package/lib/Cache/Utils/CacheList.d.ts +89 -0
- package/lib/Cache/Utils/CacheList.js +196 -0
- package/lib/Cache/Utils/CacheUtils.d.ts +25 -0
- package/lib/Cache/Utils/CacheUtils.js +88 -0
- package/lib/Cache/Utils/index.d.ts +2 -0
- package/lib/Cache/Utils/index.js +16 -0
- package/lib/Cache/reactnative.d.ts +3 -0
- package/lib/Cache/reactnative.js +8 -0
- package/lib/Cache/types/Cache.d.ts +55 -0
- package/lib/Cache/types/Cache.js +4 -0
- package/lib/Cache/types/index.d.ts +1 -0
- package/lib/Cache/types/index.js +19 -0
- package/lib/ClientDevice/android.js +3 -2
- package/lib/ClientDevice/ios.d.ts +2 -2
- package/lib/ClientDevice/ios.js +3 -2
- package/lib/ClientDevice/reactnative.js +3 -2
- package/lib/Credentials.d.ts +1 -1
- package/lib/Credentials.js +2 -1
- package/lib/Errors.d.ts +19 -0
- package/lib/Errors.js +50 -1
- package/lib/Hub.js +1 -0
- package/lib/I18n/I18n.d.ts +29 -9
- package/lib/I18n/I18n.js +30 -5
- package/lib/I18n/index.d.ts +18 -5
- package/lib/I18n/index.js +35 -5
- package/lib/I18n/types.d.ts +4 -1
- package/lib/I18n/types.js +3 -0
- package/lib/JS.d.ts +6 -6
- package/lib/Logger/ConsoleLogger.d.ts +11 -11
- package/lib/OAuthHelper/GoogleOAuth.js +2 -1
- package/lib/Platform/detectFramework.js +2 -1
- package/lib/Platform/detection/Next.d.ts +1 -1
- package/lib/Platform/detection/React.js +1 -0
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/Providers/AWSCloudWatchProvider.d.ts +2 -2
- package/lib/Providers/AWSCloudWatchProvider.js +35 -12
- package/lib/RNComponents/index.d.ts +1 -1
- package/lib/RNComponents/reactnative.js +3 -2
- package/lib/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib/ServiceWorker/ServiceWorker.js +37 -11
- package/lib/Signer.d.ts +14 -1
- package/lib/StorageHelper/cookieStorage.d.ts +13 -0
- package/lib/StorageHelper/cookieStorage.js +167 -0
- package/lib/StorageHelper/inMemoryStorage.d.ts +10 -0
- package/lib/StorageHelper/inMemoryStorage.js +82 -0
- package/lib/StorageHelper/index.d.ts +7 -3
- package/lib/StorageHelper/index.js +9 -1
- package/lib/StorageHelper/localStorage.d.ts +32 -0
- package/lib/StorageHelper/localStorage.js +114 -0
- package/lib/StorageHelper/reactnative.d.ts +71 -1
- package/lib/StorageHelper/reactnative.js +154 -10
- package/lib/StorageHelper/sessionStorage.d.ts +32 -0
- package/lib/StorageHelper/sessionStorage.js +114 -0
- package/lib/UniversalStorage/index.d.ts +2 -2
- package/lib/Util/BackgroundProcessManager.d.ts +2 -2
- package/lib/Util/BackgroundProcessManager.js +1 -0
- package/lib/Util/DateUtils.d.ts +12 -1
- package/lib/Util/Reachability.js +7 -5
- package/lib/Util/Reachability.native.d.ts +3 -2
- package/lib/Util/StringUtils.js +3 -10
- package/lib/Util/errors/AssertError.d.ts +2 -0
- package/lib/Util/errors/AssertError.js +11 -0
- package/lib/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib/clients/middleware/retry/defaultRetryDecider.js +17 -13
- package/lib/clients/middleware/retry/isClockSkewError.js +1 -1
- package/lib/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib/clients/middleware/retry/middleware.js +13 -13
- package/lib/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +1 -1
- package/lib/clients/serde/responseInfo.js +1 -1
- package/lib/clients/types/aws.d.ts +4 -0
- package/lib/clients/types/index.d.ts +1 -1
- package/lib/constants.d.ts +7 -0
- package/lib/constants.js +9 -1
- package/lib/index.d.ts +18 -4
- package/lib/index.js +32 -5
- package/lib/parseAWSExports.d.ts +1 -1
- package/lib/singleton/Auth/index.d.ts +30 -0
- package/lib/singleton/Auth/index.js +133 -0
- package/lib/singleton/Auth/types.d.ts +95 -0
- package/lib/singleton/Auth/types.js +6 -0
- package/lib/singleton/Auth/utils/index.d.ts +5 -0
- package/lib/singleton/Auth/utils/index.js +52 -0
- package/lib/singleton/Storage/types.d.ts +14 -0
- package/lib/singleton/Storage/types.js +4 -0
- package/lib/singleton/index.d.ts +46 -0
- package/lib/singleton/index.js +147 -0
- package/lib/singleton/types.d.ts +21 -0
- package/lib/singleton/types.js +4 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types.d.ts +31 -1
- package/lib/types/types.js +2 -0
- package/lib-esm/Amplify.d.ts +18 -17
- package/lib-esm/Amplify.js +9 -0
- package/lib-esm/AwsClients/CognitoIdentity/base.d.ts +3 -10
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.d.ts +3 -17
- package/lib-esm/AwsClients/CognitoIdentity/getCredentialsForIdentity.js +8 -8
- package/lib-esm/AwsClients/CognitoIdentity/getId.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/base.d.ts +2 -10
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.js +1 -1
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/putEvents.js +6 -0
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +3 -17
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.js +2 -2
- package/lib-esm/Cache/AsyncStorageCache.d.ts +154 -0
- package/lib-esm/Cache/AsyncStorageCache.js +737 -0
- package/lib-esm/Cache/BrowserStorageCache.d.ts +166 -0
- package/lib-esm/Cache/BrowserStorageCache.js +466 -0
- package/lib-esm/Cache/InMemoryCache.d.ts +129 -0
- package/lib-esm/Cache/InMemoryCache.js +346 -0
- package/lib-esm/Cache/StorageCache.d.ts +39 -0
- package/lib-esm/Cache/StorageCache.js +118 -0
- package/lib-esm/Cache/Utils/CacheList.d.ts +89 -0
- package/lib-esm/Cache/Utils/CacheList.js +194 -0
- package/lib-esm/Cache/Utils/CacheUtils.d.ts +25 -0
- package/lib-esm/Cache/Utils/CacheUtils.js +81 -0
- package/lib-esm/Cache/Utils/index.d.ts +2 -0
- package/lib-esm/Cache/Utils/index.js +4 -0
- package/lib-esm/Cache/reactnative.d.ts +3 -0
- package/lib-esm/Cache/reactnative.js +6 -0
- package/lib-esm/Cache/types/Cache.d.ts +55 -0
- package/lib-esm/Cache/types/Cache.js +3 -0
- package/lib-esm/Cache/types/index.d.ts +1 -0
- package/lib-esm/Cache/types/index.js +3 -0
- package/lib-esm/ClientDevice/android.js +1 -0
- package/lib-esm/ClientDevice/ios.d.ts +2 -2
- package/lib-esm/ClientDevice/ios.js +1 -0
- package/lib-esm/ClientDevice/reactnative.js +1 -0
- package/lib-esm/Credentials.d.ts +1 -1
- package/lib-esm/Credentials.js +2 -1
- package/lib-esm/Errors.d.ts +19 -0
- package/lib-esm/Errors.js +49 -0
- package/lib-esm/Hub.js +1 -0
- package/lib-esm/I18n/I18n.d.ts +29 -9
- package/lib-esm/I18n/I18n.js +30 -5
- package/lib-esm/I18n/index.d.ts +18 -5
- package/lib-esm/I18n/index.js +35 -5
- package/lib-esm/I18n/types.d.ts +4 -1
- package/lib-esm/I18n/types.js +3 -0
- package/lib-esm/JS.d.ts +6 -6
- package/lib-esm/Logger/ConsoleLogger.d.ts +11 -11
- package/lib-esm/OAuthHelper/GoogleOAuth.js +2 -1
- package/lib-esm/Platform/detectFramework.js +2 -1
- package/lib-esm/Platform/detection/Next.d.ts +1 -1
- package/lib-esm/Platform/detection/React.js +1 -0
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/Providers/AWSCloudWatchProvider.d.ts +2 -2
- package/lib-esm/Providers/AWSCloudWatchProvider.js +33 -10
- package/lib-esm/RNComponents/index.d.ts +1 -1
- package/lib-esm/RNComponents/reactnative.js +1 -0
- package/lib-esm/ServiceWorker/ServiceWorker.d.ts +4 -4
- package/lib-esm/ServiceWorker/ServiceWorker.js +37 -11
- package/lib-esm/Signer.d.ts +14 -1
- package/lib-esm/StorageHelper/cookieStorage.d.ts +13 -0
- package/lib-esm/StorageHelper/cookieStorage.js +141 -0
- package/lib-esm/StorageHelper/inMemoryStorage.d.ts +10 -0
- package/lib-esm/StorageHelper/inMemoryStorage.js +79 -0
- package/lib-esm/StorageHelper/index.d.ts +7 -3
- package/lib-esm/StorageHelper/index.js +4 -0
- package/lib-esm/StorageHelper/localStorage.d.ts +32 -0
- package/lib-esm/StorageHelper/localStorage.js +111 -0
- package/lib-esm/StorageHelper/reactnative.d.ts +71 -1
- package/lib-esm/StorageHelper/reactnative.js +153 -9
- package/lib-esm/StorageHelper/sessionStorage.d.ts +32 -0
- package/lib-esm/StorageHelper/sessionStorage.js +111 -0
- package/lib-esm/UniversalStorage/index.d.ts +2 -2
- package/lib-esm/Util/BackgroundProcessManager.d.ts +2 -2
- package/lib-esm/Util/BackgroundProcessManager.js +1 -0
- package/lib-esm/Util/DateUtils.d.ts +12 -1
- package/lib-esm/Util/Reachability.js +5 -3
- package/lib-esm/Util/Reachability.native.d.ts +3 -2
- package/lib-esm/Util/StringUtils.js +3 -10
- package/lib-esm/Util/errors/AssertError.d.ts +2 -0
- package/lib-esm/Util/errors/AssertError.js +7 -0
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/defaultRetryDecider.js +17 -13
- package/lib-esm/clients/middleware/retry/isClockSkewError.js +1 -1
- package/lib-esm/clients/middleware/retry/middleware.d.ts +1 -1
- package/lib-esm/clients/middleware/retry/middleware.js +13 -13
- package/lib-esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.js +1 -1
- package/lib-esm/clients/serde/responseInfo.js +1 -1
- package/lib-esm/clients/types/aws.d.ts +4 -0
- package/lib-esm/clients/types/index.d.ts +1 -1
- package/lib-esm/constants.d.ts +7 -0
- package/lib-esm/constants.js +8 -0
- package/lib-esm/index.d.ts +18 -4
- package/lib-esm/index.js +15 -3
- package/lib-esm/parseAWSExports.d.ts +1 -1
- package/lib-esm/singleton/Auth/index.d.ts +30 -0
- package/lib-esm/singleton/Auth/index.js +129 -0
- package/lib-esm/singleton/Auth/types.d.ts +95 -0
- package/lib-esm/singleton/Auth/types.js +5 -0
- package/lib-esm/singleton/Auth/utils/index.d.ts +5 -0
- package/lib-esm/singleton/Auth/utils/index.js +45 -0
- package/lib-esm/singleton/Storage/types.d.ts +14 -0
- package/lib-esm/singleton/Storage/types.js +3 -0
- package/lib-esm/singleton/index.d.ts +46 -0
- package/lib-esm/singleton/index.js +143 -0
- package/lib-esm/singleton/types.d.ts +21 -0
- package/lib-esm/singleton/types.js +3 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/types.d.ts +31 -1
- package/lib-esm/types/types.js +2 -0
- package/package.json +38 -15
- package/src/Amplify.ts +9 -3
- package/src/AwsClients/CognitoIdentity/base.ts +2 -1
- package/src/AwsClients/CognitoIdentity/getCredentialsForIdentity.ts +13 -6
- package/src/AwsClients/Pinpoint/base.ts +6 -2
- package/src/AwsClients/Pinpoint/getInAppMessages.ts +1 -1
- package/src/AwsClients/Pinpoint/putEvents.ts +6 -0
- package/src/AwsClients/Pinpoint/updateEndpoint.ts +2 -2
- package/src/Cache/AsyncStorageCache.ts +500 -0
- package/src/Cache/BrowserStorageCache.ts +517 -0
- package/src/Cache/CHANGELOG.md +1227 -0
- package/src/Cache/InMemoryCache.ts +354 -0
- package/src/Cache/StorageCache.ts +157 -0
- package/src/Cache/Utils/CacheList.ts +198 -0
- package/src/Cache/Utils/CacheUtils.ts +92 -0
- package/src/Cache/Utils/index.ts +11 -0
- package/src/Cache/reactnative.ts +9 -0
- package/src/Cache/types/Cache.ts +75 -0
- package/src/Cache/types/index.ts +4 -0
- package/src/ClientDevice/android.ts +1 -1
- package/src/ClientDevice/ios.ts +2 -2
- package/src/ClientDevice/reactnative.ts +1 -1
- package/src/Credentials.ts +19 -17
- package/src/Errors.ts +41 -0
- package/src/Hub.ts +1 -0
- package/src/I18n/I18n.ts +40 -12
- package/src/I18n/index.ts +45 -12
- package/src/I18n/types.ts +3 -0
- package/src/JS.ts +24 -17
- package/src/Logger/ConsoleLogger.ts +10 -10
- package/src/OAuthHelper/FacebookOAuth.ts +2 -2
- package/src/OAuthHelper/GoogleOAuth.ts +9 -6
- package/src/Platform/detectFramework.ts +1 -1
- package/src/Platform/detection/React.ts +5 -3
- package/src/Platform/version.ts +1 -1
- package/src/Providers/AWSCloudWatchProvider.ts +39 -14
- package/src/RNComponents/index.ts +1 -1
- package/src/RNComponents/reactnative.ts +1 -1
- package/src/ServiceWorker/ServiceWorker.ts +58 -18
- package/src/Signer.ts +22 -3
- package/src/StorageHelper/cookieStorage.ts +99 -0
- package/src/StorageHelper/inMemoryStorage.ts +32 -0
- package/src/StorageHelper/index.ts +6 -1
- package/src/StorageHelper/localStorage.ts +60 -0
- package/src/StorageHelper/reactnative.ts +94 -14
- package/src/StorageHelper/sessionStorage.ts +60 -0
- package/src/Util/BackgroundProcessManager.ts +33 -9
- package/src/Util/DateUtils.ts +14 -5
- package/src/Util/Reachability.native.ts +3 -2
- package/src/Util/Reachability.ts +9 -7
- package/src/Util/Retry.ts +2 -1
- package/src/Util/StringUtils.ts +3 -10
- package/src/Util/errors/AssertError.ts +11 -0
- package/src/clients/handlers/fetch.ts +2 -2
- package/src/clients/middleware/retry/defaultRetryDecider.ts +12 -6
- package/src/clients/middleware/retry/isClockSkewError.ts +1 -1
- package/src/clients/middleware/retry/middleware.ts +9 -9
- package/src/clients/middleware/signing/middleware.ts +1 -1
- package/src/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.ts +1 -1
- package/src/clients/serde/responseInfo.ts +2 -1
- package/src/clients/types/aws.ts +10 -0
- package/src/clients/types/index.ts +1 -0
- package/src/constants.ts +16 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +66 -4
- package/src/parseAWSExports.ts +1 -1
- package/src/singleton/Auth/index.ts +113 -0
- package/src/singleton/Auth/types.ts +129 -0
- package/src/singleton/Auth/utils/index.ts +68 -0
- package/src/singleton/Storage/types.ts +21 -0
- package/src/singleton/index.ts +131 -0
- package/src/singleton/types.ts +48 -0
- package/src/types/types.ts +38 -1
package/README.md
ADDED
package/lib/Amplify.d.ts
CHANGED
|
@@ -3,24 +3,25 @@ export declare class AmplifyClass {
|
|
|
3
3
|
private _components;
|
|
4
4
|
private _config;
|
|
5
5
|
private _modules;
|
|
6
|
-
Auth:
|
|
7
|
-
Analytics:
|
|
8
|
-
API:
|
|
9
|
-
Credentials:
|
|
10
|
-
Storage:
|
|
11
|
-
I18n:
|
|
12
|
-
Cache:
|
|
13
|
-
PubSub:
|
|
14
|
-
Interactions:
|
|
15
|
-
Pushnotification:
|
|
16
|
-
UI:
|
|
17
|
-
XR:
|
|
18
|
-
Predictions:
|
|
19
|
-
DataStore:
|
|
20
|
-
Geo:
|
|
21
|
-
Notifications:
|
|
6
|
+
Auth: null;
|
|
7
|
+
Analytics: null;
|
|
8
|
+
API: null;
|
|
9
|
+
Credentials: null;
|
|
10
|
+
Storage: null;
|
|
11
|
+
I18n: null;
|
|
12
|
+
Cache: null;
|
|
13
|
+
PubSub: null;
|
|
14
|
+
Interactions: null;
|
|
15
|
+
Pushnotification: null;
|
|
16
|
+
UI: null;
|
|
17
|
+
XR: null;
|
|
18
|
+
Predictions: null;
|
|
19
|
+
DataStore: null;
|
|
20
|
+
Geo: null;
|
|
21
|
+
Notifications: null;
|
|
22
22
|
Logger: typeof LoggerClass;
|
|
23
|
-
ServiceWorker:
|
|
23
|
+
ServiceWorker: null;
|
|
24
|
+
get config(): any;
|
|
24
25
|
register(comp: any): void;
|
|
25
26
|
configure(config?: any): {};
|
|
26
27
|
addPluggable(pluggable: any): void;
|
package/lib/Amplify.js
CHANGED
|
@@ -17,6 +17,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.Amplify = exports.AmplifyClass = void 0;
|
|
20
|
+
// @ts-nocheck
|
|
20
21
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
21
22
|
// SPDX-License-Identifier: Apache-2.0
|
|
22
23
|
var Logger_1 = require("./Logger");
|
|
@@ -49,6 +50,14 @@ var AmplifyClass = /** @class */ (function () {
|
|
|
49
50
|
this.Logger = Logger_1.ConsoleLogger;
|
|
50
51
|
this.ServiceWorker = null;
|
|
51
52
|
}
|
|
53
|
+
Object.defineProperty(AmplifyClass.prototype, "config", {
|
|
54
|
+
// TODO: update "any" when types are determined
|
|
55
|
+
get: function () {
|
|
56
|
+
return Object.assign({}, this._config);
|
|
57
|
+
},
|
|
58
|
+
enumerable: false,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
52
61
|
AmplifyClass.prototype.register = function (comp) {
|
|
53
62
|
logger.debug('component registered in amplify', comp);
|
|
54
63
|
this._components.push(comp);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Endpoint,
|
|
1
|
+
import { Endpoint, Headers, HttpRequest, HttpResponse } from '../../clients';
|
|
2
|
+
import { DefaultConfigOptions } from '../../clients/types';
|
|
2
3
|
/**
|
|
3
4
|
* A Cognito Identity-specific transfer handler that does NOT sign requests, and
|
|
4
5
|
* disables caching.
|
|
@@ -9,15 +10,7 @@ export declare const cognitoIdentityTransferHandler: (request: HttpRequest, opti
|
|
|
9
10
|
/**
|
|
10
11
|
* @internal
|
|
11
12
|
*/
|
|
12
|
-
export declare const defaultConfig:
|
|
13
|
-
service: string;
|
|
14
|
-
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
15
|
-
url: URL;
|
|
16
|
-
};
|
|
17
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
18
|
-
computeDelay: (attempt: number) => number;
|
|
19
|
-
userAgentValue: string;
|
|
20
|
-
};
|
|
13
|
+
export declare const defaultConfig: DefaultConfigOptions;
|
|
21
14
|
/**
|
|
22
15
|
* @internal
|
|
23
16
|
*/
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse } from '../../clients';
|
|
2
2
|
import type { GetCredentialsForIdentityCommandInput as GetCredentialsForIdentityInput, GetCredentialsForIdentityCommandOutput as GetCredentialsForIdentityOutput } from './types';
|
|
3
3
|
export type { GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getCredentialsForIdentity: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions & {
|
|
8
|
-
|
|
9
|
-
endpointResolver: ({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
10
|
-
url: URL;
|
|
11
|
-
};
|
|
12
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
13
|
-
computeDelay: (attempt: number) => number;
|
|
14
|
-
userAgentValue: string;
|
|
15
|
-
}, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
16
|
-
retryDecider?: ((response?: HttpResponse, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse, error?: Error) => Promise<boolean>);
|
|
17
|
-
computeDelay?: (attempt: number) => number;
|
|
18
|
-
userAgentValue?: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
endpointResolver?: ((options: import("../../clients").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
21
|
-
url: URL;
|
|
22
|
-
});
|
|
7
|
+
export declare const getCredentialsForIdentity: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions & Partial<Record<string, unknown> & import("../../clients").ServiceClientOptions>, string> & {
|
|
8
|
+
[x: string]: unknown;
|
|
23
9
|
}, input: GetCredentialsForIdentityInput) => Promise<GetCredentialsForIdentityOutput>;
|
|
@@ -68,14 +68,14 @@ var getCredentialsForIdentityDeserializer = function (response) { return __await
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
}); };
|
|
71
|
-
var deserializeCredentials = function (
|
|
72
|
-
|
|
73
|
-
return
|
|
74
|
-
AccessKeyId:
|
|
75
|
-
SecretKey:
|
|
76
|
-
SessionToken:
|
|
77
|
-
Expiration: new Date(
|
|
78
|
-
}
|
|
71
|
+
var deserializeCredentials = function (_a) {
|
|
72
|
+
var _b = _a === void 0 ? {} : _a, AccessKeyId = _b.AccessKeyId, SecretKey = _b.SecretKey, SessionToken = _b.SessionToken, Expiration = _b.Expiration;
|
|
73
|
+
return {
|
|
74
|
+
AccessKeyId: AccessKeyId,
|
|
75
|
+
SecretKey: SecretKey,
|
|
76
|
+
SessionToken: SessionToken,
|
|
77
|
+
Expiration: Expiration && new Date(Expiration * 1000),
|
|
78
|
+
};
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
81
|
* @internal
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse } from '../../clients';
|
|
2
2
|
import { GetIdCommandInput as GetIdInput, GetIdCommandOutput as GetIdOutput } from './types';
|
|
3
3
|
export type { GetIdInput, GetIdOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getId: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions & {
|
|
8
|
-
|
|
9
|
-
endpointResolver: ({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
10
|
-
url: URL;
|
|
11
|
-
};
|
|
12
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
13
|
-
computeDelay: (attempt: number) => number;
|
|
14
|
-
userAgentValue: string;
|
|
15
|
-
}, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
16
|
-
retryDecider?: ((response?: HttpResponse, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse, error?: Error) => Promise<boolean>);
|
|
17
|
-
computeDelay?: (attempt: number) => number;
|
|
18
|
-
userAgentValue?: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
endpointResolver?: ((options: import("../../clients").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients").EndpointResolverOptions) => {
|
|
21
|
-
url: URL;
|
|
22
|
-
});
|
|
7
|
+
export declare const getId: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").ServiceClientOptions & Partial<Record<string, unknown> & import("../../clients").ServiceClientOptions>, string> & {
|
|
8
|
+
[x: string]: unknown;
|
|
23
9
|
}, input: GetIdInput) => Promise<GetIdOutput>;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DefaultConfigOptions, Headers } from '../../clients/types';
|
|
2
2
|
/**
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
|
-
export declare const defaultConfig:
|
|
6
|
-
service: string;
|
|
7
|
-
endpointResolver: ({ region }: EndpointResolverOptions) => {
|
|
8
|
-
url: URL;
|
|
9
|
-
};
|
|
10
|
-
retryDecider: (response?: import("../../clients/types").HttpResponse, error?: Error) => Promise<boolean>;
|
|
11
|
-
computeDelay: (attempt: number) => number;
|
|
12
|
-
userAgentValue: string;
|
|
13
|
-
};
|
|
5
|
+
export declare const defaultConfig: DefaultConfigOptions;
|
|
14
6
|
/**
|
|
15
7
|
* @internal
|
|
16
8
|
*/
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { GetInAppMessagesCommandInput as GetInAppMessagesInput, GetInAppMessagesCommandOutput as GetInAppMessagesOutput } from './types';
|
|
3
3
|
export type { GetInAppMessagesInput, GetInAppMessagesOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const getInAppMessages: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & {
|
|
8
|
-
|
|
9
|
-
endpointResolver: ({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
-
url: URL;
|
|
11
|
-
};
|
|
12
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
13
|
-
computeDelay: (attempt: number) => number;
|
|
14
|
-
userAgentValue: string;
|
|
15
|
-
}, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
16
|
-
retryDecider?: ((response?: HttpResponse, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse, error?: Error) => Promise<boolean>);
|
|
17
|
-
computeDelay?: (attempt: number) => number;
|
|
18
|
-
userAgentValue?: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
endpointResolver?: ((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
21
|
-
url: URL;
|
|
22
|
-
});
|
|
7
|
+
export declare const getInAppMessages: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & Partial<Record<string, unknown> & import("../../clients/types").ServiceClientOptions>, string> & {
|
|
8
|
+
[x: string]: unknown;
|
|
23
9
|
}, input: GetInAppMessagesInput) => Promise<GetInAppMessagesOutput>;
|
|
@@ -45,7 +45,7 @@ var extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/uti
|
|
|
45
45
|
var serde_1 = require("../../clients/serde");
|
|
46
46
|
var base_1 = require("./base");
|
|
47
47
|
var getInAppMessagesSerializer = function (_a, endpoint) {
|
|
48
|
-
var
|
|
48
|
+
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c;
|
|
49
49
|
var headers = (0, base_1.getSharedHeaders)();
|
|
50
50
|
var url = new URL(endpoint.url);
|
|
51
51
|
url.pathname = "v1/apps/".concat((0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId), "/endpoints/").concat((0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId), "/inappmessages");
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { PutEventsCommandInput as PutEventsInput, PutEventsCommandOutput as PutEventsOutput } from './types';
|
|
3
3
|
export type { PutEventsInput, PutEventsOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const putEvents: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & {
|
|
8
|
-
|
|
9
|
-
endpointResolver: ({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
-
url: URL;
|
|
11
|
-
};
|
|
12
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
13
|
-
computeDelay: (attempt: number) => number;
|
|
14
|
-
userAgentValue: string;
|
|
15
|
-
}, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
16
|
-
retryDecider?: ((response?: HttpResponse, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse, error?: Error) => Promise<boolean>);
|
|
17
|
-
computeDelay?: (attempt: number) => number;
|
|
18
|
-
userAgentValue?: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
endpointResolver?: ((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
21
|
-
url: URL;
|
|
22
|
-
});
|
|
7
|
+
export declare const putEvents: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & Partial<Record<string, unknown> & import("../../clients/types").ServiceClientOptions>, string> & {
|
|
8
|
+
[x: string]: unknown;
|
|
23
9
|
}, input: PutEventsInput) => Promise<PutEventsOutput>;
|
|
@@ -39,13 +39,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.putEvents = void 0;
|
|
42
|
+
var AssertError_1 = require("../../Util/errors/AssertError");
|
|
42
43
|
var authenticated_1 = require("../../clients/handlers/authenticated");
|
|
43
44
|
var composeServiceApi_1 = require("../../clients/internal/composeServiceApi");
|
|
44
45
|
var extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/utils/extendedEncodeURIComponent");
|
|
45
46
|
var serde_1 = require("../../clients/serde");
|
|
47
|
+
var constants_1 = require("../../constants");
|
|
46
48
|
var base_1 = require("./base");
|
|
47
49
|
var putEventsSerializer = function (_a, endpoint) {
|
|
48
50
|
var ApplicationId = _a.ApplicationId, EventsRequest = _a.EventsRequest;
|
|
51
|
+
(0, AssertError_1.asserts)(!!ApplicationId, {
|
|
52
|
+
name: constants_1.APPLICATION_ID_EXCEPTION,
|
|
53
|
+
message: 'ApplicationId is required for putEvents',
|
|
54
|
+
});
|
|
49
55
|
var headers = (0, base_1.getSharedHeaders)();
|
|
50
56
|
var url = new URL(endpoint.url);
|
|
51
57
|
url.pathname = "v1/apps/".concat((0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId), "/events");
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpResponse } from '../../clients/types';
|
|
2
2
|
import type { UpdateEndpointCommandInput as UpdateEndpointInput, UpdateEndpointCommandOutput as UpdateEndpointOutput } from './types';
|
|
3
3
|
export type { UpdateEndpointInput, UpdateEndpointOutput };
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const updateEndpoint: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & {
|
|
8
|
-
|
|
9
|
-
endpointResolver: ({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
10
|
-
url: URL;
|
|
11
|
-
};
|
|
12
|
-
retryDecider: (response?: HttpResponse, error?: Error) => Promise<boolean>;
|
|
13
|
-
computeDelay: (attempt: number) => number;
|
|
14
|
-
userAgentValue: string;
|
|
15
|
-
}, "retryDecider" | "computeDelay" | "userAgentValue" | "service" | "endpointResolver"> & {
|
|
16
|
-
retryDecider?: ((response?: HttpResponse, error?: unknown) => Promise<boolean>) & ((response?: HttpResponse, error?: Error) => Promise<boolean>);
|
|
17
|
-
computeDelay?: (attempt: number) => number;
|
|
18
|
-
userAgentValue?: string;
|
|
19
|
-
service?: string;
|
|
20
|
-
endpointResolver?: ((options: import("../../clients/types").EndpointResolverOptions, input?: any) => Endpoint) & (({ region }: import("../../clients/types").EndpointResolverOptions) => {
|
|
21
|
-
url: URL;
|
|
22
|
-
});
|
|
7
|
+
export declare const updateEndpoint: (config: Omit<import("../../clients").UserAgentOptions & import("../../clients").RetryOptions<HttpResponse> & import("../../clients").SigningOptions & import("../../clients/types").ServiceClientOptions & Partial<Record<string, unknown> & import("../../clients/types").ServiceClientOptions>, string> & {
|
|
8
|
+
[x: string]: unknown;
|
|
23
9
|
}, input: UpdateEndpointInput) => Promise<UpdateEndpointOutput>;
|
|
@@ -45,11 +45,11 @@ var extendedEncodeURIComponent_1 = require("../../clients/middleware/signing/uti
|
|
|
45
45
|
var serde_1 = require("../../clients/serde");
|
|
46
46
|
var base_1 = require("./base");
|
|
47
47
|
var updateEndpointSerializer = function (_a, endpoint) {
|
|
48
|
-
var
|
|
48
|
+
var _b = _a.ApplicationId, ApplicationId = _b === void 0 ? '' : _b, _c = _a.EndpointId, EndpointId = _c === void 0 ? '' : _c, EndpointRequest = _a.EndpointRequest;
|
|
49
49
|
var headers = (0, base_1.getSharedHeaders)();
|
|
50
50
|
var url = new URL(endpoint.url);
|
|
51
51
|
url.pathname = "v1/apps/".concat((0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(ApplicationId), "/endpoints/").concat((0, extendedEncodeURIComponent_1.extendedEncodeURIComponent)(EndpointId));
|
|
52
|
-
var body = JSON.stringify(EndpointRequest
|
|
52
|
+
var body = JSON.stringify(EndpointRequest);
|
|
53
53
|
return { method: 'PUT', headers: headers, url: url, body: body };
|
|
54
54
|
};
|
|
55
55
|
var updateEndpointDeserializer = function (response) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import { StorageCache } from './StorageCache';
|
|
3
|
+
import { CacheConfig, CacheItem, CacheItemOptions, ICache } from './types';
|
|
4
|
+
export declare class AsyncStorageCache extends StorageCache implements ICache {
|
|
5
|
+
/**
|
|
6
|
+
* initialize the cache
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} config - the configuration of the cache
|
|
9
|
+
*/
|
|
10
|
+
constructor(config?: CacheConfig);
|
|
11
|
+
/**
|
|
12
|
+
* decrease current size of the cache
|
|
13
|
+
* @private
|
|
14
|
+
* @param amount - the amount of the cache size which needs to be decreased
|
|
15
|
+
*/
|
|
16
|
+
_decreaseCurSizeInBytes(amount: number): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* increase current size of the cache
|
|
19
|
+
* @private
|
|
20
|
+
* @param amount - the amount of the cache szie which need to be increased
|
|
21
|
+
*/
|
|
22
|
+
_increaseCurSizeInBytes(amount: number): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* update the visited time if item has been visited
|
|
25
|
+
* @private
|
|
26
|
+
* @param item - the item which need to be refreshed
|
|
27
|
+
* @param prefixedKey - the key of the item
|
|
28
|
+
*
|
|
29
|
+
* @return the refreshed item
|
|
30
|
+
*/
|
|
31
|
+
_refreshItem(item: CacheItem, prefixedKey: string): Promise<CacheItem>;
|
|
32
|
+
/**
|
|
33
|
+
* check wether item is expired
|
|
34
|
+
* @private
|
|
35
|
+
* @param key - the key of the item
|
|
36
|
+
*
|
|
37
|
+
* @return true if the item is expired.
|
|
38
|
+
*/
|
|
39
|
+
_isExpired(key: string): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* delete item from cache
|
|
42
|
+
* @private
|
|
43
|
+
* @param prefixedKey - the key of the item
|
|
44
|
+
* @param size - optional, the byte size of the item
|
|
45
|
+
*/
|
|
46
|
+
_removeItem(prefixedKey: string, size?: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* put item into cache
|
|
49
|
+
* @private
|
|
50
|
+
* @param prefixedKey - the key of the item
|
|
51
|
+
* @param itemData - the value of the item
|
|
52
|
+
* @param itemSizeInBytes - the byte size of the item
|
|
53
|
+
*/
|
|
54
|
+
_setItem(prefixedKey: string, item: any): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* total space needed when poping out items
|
|
57
|
+
* @private
|
|
58
|
+
* @param itemSize
|
|
59
|
+
*
|
|
60
|
+
* @return total space needed
|
|
61
|
+
*/
|
|
62
|
+
_sizeToPop(itemSize: number): Promise<number>;
|
|
63
|
+
/**
|
|
64
|
+
* see whether cache is full
|
|
65
|
+
* @private
|
|
66
|
+
* @param itemSize
|
|
67
|
+
*
|
|
68
|
+
* @return true if cache is full
|
|
69
|
+
*/
|
|
70
|
+
_isCacheFull(itemSize: number): Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* scan the storage and find out all the keys owned by this cache
|
|
73
|
+
* also clean the expired keys while scanning
|
|
74
|
+
* @private
|
|
75
|
+
* @return array of keys
|
|
76
|
+
*/
|
|
77
|
+
_findValidKeys(): Promise<string[]>;
|
|
78
|
+
/**
|
|
79
|
+
* get all the items we have, sort them by their priority,
|
|
80
|
+
* if priority is same, sort them by their last visited time
|
|
81
|
+
* pop out items from the low priority (5 is the lowest)
|
|
82
|
+
* @private
|
|
83
|
+
* @param keys - all the keys in this cache
|
|
84
|
+
* @param sizeToPop - the total size of the items which needed to be poped out
|
|
85
|
+
*/
|
|
86
|
+
_popOutItems(keys: string[], sizeToPop: number): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Set item into cache. You can put number, string, boolean or object.
|
|
89
|
+
* The cache will first check whether has the same key.
|
|
90
|
+
* If it has, it will delete the old item and then put the new item in
|
|
91
|
+
* The cache will pop out items if it is full
|
|
92
|
+
* You can specify the cache item options. The cache will abort and output a warning:
|
|
93
|
+
* If the key is invalid
|
|
94
|
+
* If the size of the item exceeds itemMaxSize.
|
|
95
|
+
* If the value is undefined
|
|
96
|
+
* If incorrect cache item configuration
|
|
97
|
+
* If error happened with browser storage
|
|
98
|
+
*
|
|
99
|
+
* @param {String} key - the key of the item
|
|
100
|
+
* @param {Object} value - the value of the item
|
|
101
|
+
* @param {Object} [options] - optional, the specified meta-data
|
|
102
|
+
* @return {Promise}
|
|
103
|
+
*/
|
|
104
|
+
setItem(key: string, value: any, options: Record<string, any>): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Get item from cache. It will return null if item doesn’t exist or it has been expired.
|
|
107
|
+
* If you specified callback function in the options,
|
|
108
|
+
* then the function will be executed if no such item in the cache
|
|
109
|
+
* and finally put the return value into cache.
|
|
110
|
+
* Please make sure the callback function will return the value you want to put into the cache.
|
|
111
|
+
* The cache will abort output a warning:
|
|
112
|
+
* If the key is invalid
|
|
113
|
+
* If error happened with AsyncStorage
|
|
114
|
+
*
|
|
115
|
+
* @param {String} key - the key of the item
|
|
116
|
+
* @param {Object} [options] - the options of callback function
|
|
117
|
+
* @return {Promise} - return a promise resolves to be the value of the item
|
|
118
|
+
*/
|
|
119
|
+
getItem(key: string, options: CacheItemOptions): Promise<any>;
|
|
120
|
+
/**
|
|
121
|
+
* remove item from the cache
|
|
122
|
+
* The cache will abort output a warning:
|
|
123
|
+
* If error happened with AsyncStorage
|
|
124
|
+
* @param {String} key - the key of the item
|
|
125
|
+
* @return {Promise}
|
|
126
|
+
*/
|
|
127
|
+
removeItem(key: string): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* clear the entire cache
|
|
130
|
+
* The cache will abort output a warning:
|
|
131
|
+
* If error happened with AsyncStorage
|
|
132
|
+
* @return {Promise}
|
|
133
|
+
*/
|
|
134
|
+
clear(): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* return the current size of the cache
|
|
137
|
+
* @return {Promise}
|
|
138
|
+
*/
|
|
139
|
+
getCacheCurSize(): Promise<number>;
|
|
140
|
+
/**
|
|
141
|
+
* Return all the keys in the cache.
|
|
142
|
+
* Will return an empty array if error happend.
|
|
143
|
+
* @return {Promise}
|
|
144
|
+
*/
|
|
145
|
+
getAllKeys(): Promise<string[]>;
|
|
146
|
+
/**
|
|
147
|
+
* Return a new instance of cache with customized configuration.
|
|
148
|
+
* @param {Object} config - the customized configuration
|
|
149
|
+
* @return {Object} - the new instance of Cache
|
|
150
|
+
*/
|
|
151
|
+
createInstance(config: CacheConfig): ICache;
|
|
152
|
+
}
|
|
153
|
+
declare const instance: ICache;
|
|
154
|
+
export { AsyncStorage, instance as Cache };
|