@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";
|
|
@@ -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.be08038.0+be08038';
|
|
@@ -57,7 +57,7 @@ var authTypeMapping = {
|
|
|
57
57
|
export var parseAWSExports = function (config) {
|
|
58
58
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
59
59
|
if (config === void 0) { config = {}; }
|
|
60
|
-
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;
|
|
60
|
+
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;
|
|
61
61
|
var amplifyConfig = {};
|
|
62
62
|
// Analytics
|
|
63
63
|
if (aws_mobile_analytics_app_id) {
|
|
@@ -152,13 +152,21 @@ export var parseAWSExports = function (config) {
|
|
|
152
152
|
userPoolId: aws_user_pools_id,
|
|
153
153
|
mfa: mfaConfig,
|
|
154
154
|
passwordFormat: passwordFormatConfig,
|
|
155
|
-
loginWith:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
loginWith: {
|
|
156
|
+
username: loginWithEmailEnabled || loginWithPhoneEnabled ? false : true,
|
|
157
|
+
email: loginWithEmailEnabled,
|
|
158
|
+
phone: loginWithPhoneEnabled
|
|
159
|
+
},
|
|
159
160
|
},
|
|
160
161
|
};
|
|
161
162
|
}
|
|
163
|
+
var hasOAuthConfig = oauth ? Object.keys(oauth).length > 0 : false;
|
|
164
|
+
var hasSocialProviderConfig = aws_cognito_social_providers ? aws_cognito_social_providers.length > 0 : false;
|
|
165
|
+
if (amplifyConfig.Auth && hasOAuthConfig) {
|
|
166
|
+
amplifyConfig.Auth.Cognito.loginWith = __assign(__assign({}, amplifyConfig.Auth.Cognito.loginWith), { oauth: __assign(__assign({}, (getOAuthConfig(oauth))), (hasSocialProviderConfig && {
|
|
167
|
+
providers: parseSocialProviders(aws_cognito_social_providers)
|
|
168
|
+
})) });
|
|
169
|
+
}
|
|
162
170
|
// Storage
|
|
163
171
|
if (aws_user_files_s3_bucket) {
|
|
164
172
|
amplifyConfig.Storage = {
|
|
@@ -198,6 +206,12 @@ var getOAuthConfig = function (_a) {
|
|
|
198
206
|
scopes: scope,
|
|
199
207
|
redirectSignIn: getRedirectUrl(redirectSignIn),
|
|
200
208
|
redirectSignOut: getRedirectUrl(redirectSignOut),
|
|
201
|
-
responseType: responseType
|
|
209
|
+
responseType: responseType
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
var parseSocialProviders = function (aws_cognito_social_providers) {
|
|
213
|
+
return aws_cognito_social_providers.map(function (provider) {
|
|
214
|
+
var updatedProvider = provider.toLowerCase();
|
|
215
|
+
return updatedProvider.charAt(0).toUpperCase() + updatedProvider.slice(1);
|
|
202
216
|
});
|
|
203
217
|
};
|
|
@@ -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
|
};
|