@aws-amplify/core 6.0.1-console-preview.b278dcb.0 → 6.0.1-console-preview.be08038.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/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/parseAWSExports.js +20 -6
- package/lib/singleton/Auth/types.d.ts +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/parseAWSExports.js +20 -6
- package/lib-esm/singleton/Auth/types.d.ts +2 -2
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Platform/version.ts +1 -1
- package/src/parseAWSExports.ts +25 -7
- package/src/singleton/Auth/types.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.1-console-preview.
|
|
1
|
+
export declare const version = "6.0.1-console-preview.be08038.0+be08038";
|
package/lib/Platform/version.js
CHANGED
package/lib/parseAWSExports.js
CHANGED
|
@@ -60,7 +60,7 @@ var authTypeMapping = {
|
|
|
60
60
|
var parseAWSExports = function (config) {
|
|
61
61
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
62
62
|
if (config === void 0) { config = {}; }
|
|
63
|
-
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_bots = config.aws_bots, aws_bots_config = config.aws_bots_config, 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_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_username_attributes = config.aws_cognito_username_attributes, 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, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
63
|
+
var aws_appsync_apiKey = config.aws_appsync_apiKey, aws_appsync_authenticationType = config.aws_appsync_authenticationType, aws_appsync_graphqlEndpoint = config.aws_appsync_graphqlEndpoint, aws_appsync_region = config.aws_appsync_region, aws_bots = config.aws_bots, aws_bots_config = config.aws_bots_config, 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_cognito_mfa_configuration = config.aws_cognito_mfa_configuration, aws_cognito_mfa_types = config.aws_cognito_mfa_types, aws_cognito_password_protection_settings = config.aws_cognito_password_protection_settings, aws_cognito_verification_mechanisms = config.aws_cognito_verification_mechanisms, aws_cognito_signup_attributes = config.aws_cognito_signup_attributes, aws_cognito_social_providers = config.aws_cognito_social_providers, aws_cognito_username_attributes = config.aws_cognito_username_attributes, 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, aws_cloud_logic_custom = config.aws_cloud_logic_custom, Notifications = config.Notifications;
|
|
64
64
|
var amplifyConfig = {};
|
|
65
65
|
// Analytics
|
|
66
66
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -155,13 +155,21 @@ var parseAWSExports = function (config) {
|
|
|
155
155
|
userPoolId: aws_user_pools_id,
|
|
156
156
|
mfa: mfaConfig,
|
|
157
157
|
passwordFormat: passwordFormatConfig,
|
|
158
|
-
loginWith:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
loginWith: {
|
|
159
|
+
username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true,
|
|
160
|
+
email: loginWithEmailEnabled,
|
|
161
|
+
phone: loginWithPhoneEnabled
|
|
162
|
+
},
|
|
162
163
|
},
|
|
163
164
|
};
|
|
164
165
|
}
|
|
166
|
+
var hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
|
|
167
|
+
var hasSocialProviderConfig = aws_cognito_social_providers ? aws_cognito_social_providers.length > 0 : false;
|
|
168
|
+
if (amplifyConfig.Auth && hasOAuthConfig) {
|
|
169
|
+
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({}, (getOAuthConfig(oauth))), (hasSocialProviderConfig && {
|
|
170
|
+
providers: parseSocialProviders(aws_cognito_social_providers)
|
|
171
|
+
})) });
|
|
172
|
+
}
|
|
165
173
|
// Storage
|
|
166
174
|
if (aws_user_files_s3_bucket) {
|
|
167
175
|
amplifyConfig.Storage = {
|
|
@@ -202,6 +210,12 @@ var getOAuthConfig = function (_a) {
|
|
|
202
210
|
scopes: scope,
|
|
203
211
|
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
204
212
|
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
205
|
-
responseType: responseType
|
|
213
|
+
responseType: responseType
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
var parseSocialProviders = function (aws_cognito_social_providers) {
|
|
217
|
+
return aws_cognito_social_providers.map(function (provider) {
|
|
218
|
+
var updatedProvider = provider.toLowerCase();
|
|
219
|
+
return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);
|
|
206
220
|
});
|
|
207
221
|
};
|
|
@@ -112,9 +112,9 @@ export type OAuthConfig = {
|
|
|
112
112
|
redirectSignIn: Array<string>;
|
|
113
113
|
redirectSignOut: Array<string>;
|
|
114
114
|
responseType: 'code' | 'token';
|
|
115
|
-
providers?: Array<
|
|
115
|
+
providers?: Array<OAuthProvider | CustomProvider>;
|
|
116
116
|
};
|
|
117
|
-
type
|
|
117
|
+
export type OAuthProvider = 'Google' | 'Facebook' | 'Amazon' | 'Apple';
|
|
118
118
|
type CustomProvider = {
|
|
119
119
|
custom: string;
|
|
120
120
|
};
|