@aws-amplify/core 6.0.1-console-preview.2f5ba46.0 → 6.0.1-console-preview.9e7dd78.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/Hub/types/AuthTypes.d.ts +13 -7
- package/lib/Platform/index.d.ts +2 -2
- package/lib/Platform/index.js +2 -5
- package/lib/Platform/types.d.ts +4 -55
- package/lib/Platform/types.js +36 -48
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/index.d.ts +0 -6
- package/lib/index.js +2 -17
- package/lib/parseAWSExports.d.ts +5 -4
- package/lib/parseAWSExports.js +37 -43
- package/lib/singleton/Auth/types.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core.d.ts +0 -8
- package/lib-esm/Hub/types/AuthTypes.d.ts +13 -7
- package/lib-esm/Platform/index.d.ts +2 -2
- package/lib-esm/Platform/index.js +2 -5
- package/lib-esm/Platform/types.d.ts +4 -55
- package/lib-esm/Platform/types.js +36 -48
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/index.d.ts +0 -6
- package/lib-esm/index.js +1 -6
- package/lib-esm/parseAWSExports.d.ts +5 -4
- package/lib-esm/parseAWSExports.js +37 -43
- package/lib-esm/singleton/Auth/types.d.ts +1 -1
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/types/core.d.ts +0 -8
- package/package.json +2 -26
- package/src/Cache/CHANGELOG.md +12 -0
- package/src/Hub/types/AuthTypes.ts +8 -6
- package/src/Platform/index.ts +3 -8
- package/src/Platform/types.ts +34 -56
- package/src/Platform/version.ts +1 -1
- package/src/index.ts +1 -7
- package/src/parseAWSExports.ts +69 -63
- package/src/singleton/Auth/types.ts +1 -1
- package/src/types/core.ts +0 -10
- package/lib/Credentials.d.ts +0 -47
- package/lib/Credentials.js +0 -676
- package/lib-esm/Credentials.d.ts +0 -47
- package/lib-esm/Credentials.js +0 -673
- package/src/Credentials.ts +0 -630
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
1
3
|
export var Framework;
|
|
2
4
|
(function (Framework) {
|
|
3
5
|
// < 100 - Web frameworks
|
|
@@ -51,44 +53,40 @@ export var ApiAction;
|
|
|
51
53
|
})(ApiAction || (ApiAction = {}));
|
|
52
54
|
export var AuthAction;
|
|
53
55
|
(function (AuthAction) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
// SignUp = '1',
|
|
57
|
+
// ConfirmSignUp = '2',
|
|
58
|
+
// ResendSignUp = '3',
|
|
59
|
+
// SignIn = '4',
|
|
60
|
+
// GetMFAOptions = '5',
|
|
61
|
+
// GetPreferredMFA = '6',
|
|
62
|
+
// SetPreferredMFA = '7',
|
|
63
|
+
// DisableSMS = '8',
|
|
64
|
+
// EnableSMS = '9',
|
|
65
|
+
// SetupTOTP = '10',
|
|
66
|
+
// VerifyTotpToken = '11',
|
|
67
|
+
// ConfirmSignIn = '12',
|
|
68
|
+
// CompleteNewPassword = '13',
|
|
69
|
+
// SendCustomChallengeAnswer = '14',
|
|
70
|
+
// DeleteUserAttributes = '15',
|
|
71
|
+
// DeleteUser = '16',
|
|
72
|
+
// UpdateUserAttributes = '17',
|
|
73
|
+
// UserAttributes = '18',
|
|
74
|
+
// CurrentUserPoolUser = '19',
|
|
75
|
+
// CurrentAuthenticatedUser = '20',
|
|
76
|
+
// CurrentSession = '21',
|
|
77
|
+
// VerifyUserAttribute = '22',
|
|
78
|
+
// VerifyUserAttributeSubmit = '23',
|
|
79
|
+
// VerifyCurrentUserAttribute = '24',
|
|
80
|
+
// VerifyCurrentUserAttributeSubmit = '25',
|
|
81
|
+
// SignOut = '26',
|
|
82
|
+
// ChangePassword = '27',
|
|
83
|
+
// ForgotPassword = '28',
|
|
84
|
+
// ForgotPasswordSubmit = '29',
|
|
83
85
|
AuthAction["FederatedSignIn"] = "30";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
AuthAction["CurrentUserInfo"] = "35";
|
|
89
|
-
AuthAction["RememberDevice"] = "36";
|
|
90
|
-
AuthAction["ForgetDevice"] = "37";
|
|
91
|
-
AuthAction["FetchDevices"] = "38";
|
|
86
|
+
// CurrentUserInfo = '31',
|
|
87
|
+
// RememberDevice = '32',
|
|
88
|
+
// ForgetDevice = '33',
|
|
89
|
+
// FetchDevices = '34',
|
|
92
90
|
})(AuthAction || (AuthAction = {}));
|
|
93
91
|
export var DataStoreAction;
|
|
94
92
|
(function (DataStoreAction) {
|
|
@@ -97,20 +95,11 @@ export var DataStoreAction;
|
|
|
97
95
|
})(DataStoreAction || (DataStoreAction = {}));
|
|
98
96
|
export var GeoAction;
|
|
99
97
|
(function (GeoAction) {
|
|
100
|
-
GeoAction["
|
|
101
|
-
GeoAction["SearchForSuggestions"] = "2";
|
|
102
|
-
GeoAction["SearchByPlaceId"] = "3";
|
|
103
|
-
GeoAction["SearchByCoordinates"] = "4";
|
|
104
|
-
GeoAction["SaveGeofences"] = "5";
|
|
105
|
-
GeoAction["GetGeofence"] = "6";
|
|
106
|
-
GeoAction["ListGeofences"] = "7";
|
|
107
|
-
GeoAction["DeleteGeofences"] = "8";
|
|
98
|
+
GeoAction["None"] = "0";
|
|
108
99
|
})(GeoAction || (GeoAction = {}));
|
|
109
100
|
export var InAppMessagingAction;
|
|
110
101
|
(function (InAppMessagingAction) {
|
|
111
102
|
InAppMessagingAction["None"] = "0";
|
|
112
|
-
InAppMessagingAction["SyncMessages"] = "1";
|
|
113
|
-
InAppMessagingAction["IdentifyUser"] = "2";
|
|
114
103
|
})(InAppMessagingAction || (InAppMessagingAction = {}));
|
|
115
104
|
export var InteractionsAction;
|
|
116
105
|
(function (InteractionsAction) {
|
|
@@ -138,5 +127,4 @@ export var StorageAction;
|
|
|
138
127
|
StorageAction["Copy"] = "4";
|
|
139
128
|
StorageAction["Remove"] = "5";
|
|
140
129
|
StorageAction["GetProperties"] = "6";
|
|
141
|
-
StorageAction["Cancel"] = "7";
|
|
142
130
|
})(StorageAction || (StorageAction = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.9e7dd78.0+9e7dd78";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export var version = '6.0.1-console-preview.
|
|
2
|
+
export var version = '6.0.1-console-preview.9e7dd78.0+9e7dd78';
|
package/lib-esm/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export { ClientDevice } from './ClientDevice';
|
|
2
|
-
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
3
1
|
export { Hub } from './Hub';
|
|
4
2
|
export { HubCapsule, HubCallback, HubPayload } from './Hub/types';
|
|
5
|
-
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
6
|
-
export { AppState, AsyncStorage, Linking } from './RNComponents';
|
|
7
|
-
export { Credentials, CredentialsClass } from './Credentials';
|
|
8
|
-
export { ICredentials } from './types';
|
|
9
3
|
export { TokenProvider, AuthTokens, FetchAuthSessionOptions, AWSCredentialsAndIdentityIdProvider, AWSCredentialsAndIdentityId, Identity, OAuthConfig, CognitoUserPoolConfig, } from './singleton/Auth/types';
|
|
10
4
|
export { AuthConfig, AuthUserPoolConfig, AuthUserPoolAndIdentityPoolConfig, StorageAccessLevel, StorageConfig, GetCredentialsOptions, ResourcesConfig, LibraryOptions, AnalyticsConfig, } from './singleton/types';
|
|
11
5
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
package/lib-esm/index.js
CHANGED
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
/*
|
|
4
4
|
This file maps top-level exports from `@aws-amplify/core`. These are intended to be potentially customer-facing exports.
|
|
5
5
|
*/
|
|
6
|
-
//
|
|
7
|
-
export { ClientDevice } from './ClientDevice';
|
|
8
|
-
export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
|
|
6
|
+
// Hub exports
|
|
9
7
|
export { Hub } from './Hub';
|
|
10
|
-
export { FacebookOAuth, GoogleOAuth } from './OAuthHelper';
|
|
11
|
-
export { AppState, AsyncStorage, Linking } from './RNComponents';
|
|
12
|
-
export { Credentials, CredentialsClass } from './Credentials';
|
|
13
8
|
export { Amplify, fetchAuthSession, AmplifyClass as AmplifyClassV6, clearCredentials, } from './singleton';
|
|
14
9
|
// AWSClients exports
|
|
15
10
|
export { getCredentialsForIdentity, getId, } from './AwsClients/CognitoIdentity';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourcesConfig } from './singleton/types';
|
|
2
2
|
/**
|
|
3
|
-
* This utility
|
|
3
|
+
* This utility converts the `aws-exports.js` file generated by the Amplify CLI into a {@link ResourcesConfig} object
|
|
4
|
+
* consumable by Amplify.
|
|
4
5
|
*
|
|
5
6
|
* @param config A configuration object from `aws-exports.js`.
|
|
6
7
|
*
|
|
7
|
-
* @returns
|
|
8
|
+
* @returns A {@link ResourcesConfig} object.
|
|
8
9
|
*/
|
|
9
|
-
export declare const parseAWSExports: (config
|
|
10
|
+
export declare const parseAWSExports: (config?: Record<string, any>) => ResourcesConfig;
|
|
@@ -9,70 +9,64 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { ConsoleLogger as Logger } from './Logger';
|
|
13
|
-
var logger = new Logger('Parser');
|
|
14
12
|
/**
|
|
15
|
-
* This utility
|
|
13
|
+
* This utility converts the `aws-exports.js` file generated by the Amplify CLI into a {@link ResourcesConfig} object
|
|
14
|
+
* consumable by Amplify.
|
|
16
15
|
*
|
|
17
16
|
* @param config A configuration object from `aws-exports.js`.
|
|
18
17
|
*
|
|
19
|
-
* @returns
|
|
18
|
+
* @returns A {@link ResourcesConfig} object.
|
|
20
19
|
*/
|
|
21
20
|
export var parseAWSExports = function (config) {
|
|
21
|
+
if (config === void 0) { config = {}; }
|
|
22
|
+
var aws_cognito_identity_pool_id = config.aws_cognito_identity_pool_id, aws_cognito_sign_up_verification_method = config.aws_cognito_sign_up_verification_method, aws_mandatory_sign_in = config.aws_mandatory_sign_in, aws_mobile_analytics_app_id = config.aws_mobile_analytics_app_id, aws_mobile_analytics_app_region = config.aws_mobile_analytics_app_region, aws_user_files_s3_bucket = config.aws_user_files_s3_bucket, aws_user_files_s3_bucket_region = config.aws_user_files_s3_bucket_region, aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing = config.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing, aws_user_pools_id = config.aws_user_pools_id, aws_user_pools_web_client_id = config.aws_user_pools_web_client_id, geo = config.geo, oauth = config.oauth;
|
|
22
23
|
var amplifyConfig = {};
|
|
23
24
|
// Analytics
|
|
24
|
-
if (
|
|
25
|
-
|
|
25
|
+
if (aws_mobile_analytics_app_id) {
|
|
26
|
+
amplifyConfig.Analytics = {
|
|
26
27
|
Pinpoint: {
|
|
27
|
-
appId:
|
|
28
|
-
region:
|
|
28
|
+
appId: aws_mobile_analytics_app_id,
|
|
29
|
+
region: aws_mobile_analytics_app_region,
|
|
29
30
|
},
|
|
30
31
|
};
|
|
31
|
-
amplifyConfig.Analytics = Analytics;
|
|
32
32
|
}
|
|
33
33
|
// Auth
|
|
34
|
-
if (
|
|
34
|
+
if (aws_cognito_identity_pool_id || aws_user_pools_id) {
|
|
35
35
|
amplifyConfig.Auth = {
|
|
36
|
-
|
|
37
|
-
userPoolWebClientId: config['aws_user_pools_web_client_id'],
|
|
38
|
-
region: config['aws_cognito_region'],
|
|
39
|
-
identityPoolId: config['aws_cognito_identity_pool_id'],
|
|
40
|
-
identityPoolRegion: config['aws_cognito_region'],
|
|
41
|
-
mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable',
|
|
42
|
-
signUpVerificationMethod: config['aws_cognito_sign_up_verification_method'] || 'code',
|
|
36
|
+
Cognito: __assign({ identityPoolId: aws_cognito_identity_pool_id, allowGuestAccess: aws_mandatory_sign_in !== 'enable', signUpVerificationMethod: aws_cognito_sign_up_verification_method, userPoolClientId: aws_user_pools_web_client_id, userPoolId: aws_user_pools_id }, (oauth && { loginWith: getOAuthConfig(oauth) })),
|
|
43
37
|
};
|
|
44
38
|
}
|
|
45
39
|
// Storage
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing'],
|
|
40
|
+
if (aws_user_files_s3_bucket) {
|
|
41
|
+
amplifyConfig.Storage = {
|
|
42
|
+
S3: {
|
|
43
|
+
bucket: aws_user_files_s3_bucket,
|
|
44
|
+
region: aws_user_files_s3_bucket_region,
|
|
45
|
+
dangerouslyConnectToHttpEndpointForTesting: aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing,
|
|
53
46
|
},
|
|
54
47
|
};
|
|
55
48
|
}
|
|
56
|
-
else {
|
|
57
|
-
storageConfig = config ? config.Storage || config : {};
|
|
58
|
-
}
|
|
59
|
-
// Logging
|
|
60
|
-
if (config['Logging']) {
|
|
61
|
-
amplifyConfig.Logging = __assign(__assign({}, config['Logging']), { region: config['aws_project_region'] });
|
|
62
|
-
}
|
|
63
49
|
// Geo
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
}
|
|
50
|
+
if (geo) {
|
|
51
|
+
var amazon_location_service = geo.amazon_location_service;
|
|
52
|
+
amplifyConfig.Geo = amazon_location_service
|
|
53
|
+
? { AmazonLocationService: amazon_location_service }
|
|
54
|
+
: __assign({}, geo);
|
|
71
55
|
}
|
|
72
|
-
amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);
|
|
73
|
-
amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);
|
|
74
|
-
amplifyConfig.Storage = Object.assign({}, storageConfig);
|
|
75
|
-
amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);
|
|
76
|
-
logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);
|
|
77
56
|
return amplifyConfig;
|
|
78
57
|
};
|
|
58
|
+
var getRedirectUrl = function (redirectStr) {
|
|
59
|
+
return redirectStr.split(',');
|
|
60
|
+
};
|
|
61
|
+
var getOAuthConfig = function (_a) {
|
|
62
|
+
var domain = _a.domain, scope = _a.scope, redirectSignIn = _a.redirectSignIn, redirectSignOut = _a.redirectSignOut, responseType = _a.responseType;
|
|
63
|
+
return ({
|
|
64
|
+
oauth: {
|
|
65
|
+
domain: domain,
|
|
66
|
+
scopes: scope,
|
|
67
|
+
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
68
|
+
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
69
|
+
responseType: responseType,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
};
|
|
@@ -35,7 +35,7 @@ export type Identity = {
|
|
|
35
35
|
type: 'guest' | 'primary';
|
|
36
36
|
};
|
|
37
37
|
export interface AWSCredentialsAndIdentityIdProvider {
|
|
38
|
-
getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<AWSCredentialsAndIdentityId>;
|
|
38
|
+
getCredentialsAndIdentityId: (getCredentialsOptions: GetCredentialsOptions) => Promise<AWSCredentialsAndIdentityId | undefined>;
|
|
39
39
|
clearCredentialsAndIdentityId: () => void;
|
|
40
40
|
}
|
|
41
41
|
export type TokenProvider = {
|