@aws-amplify/core 6.0.1-console-preview.5f040a2.0 → 6.0.1-console-preview.a1c533e.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.
@@ -37,3 +37,10 @@ export declare class HubClass {
37
37
  private _toListeners;
38
38
  }
39
39
  export declare const Hub: HubClass;
40
+ /**
41
+ * @internal
42
+ *
43
+ * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
44
+ *
45
+ */
46
+ export declare const HubInternal: HubClass;
@@ -146,3 +146,10 @@ export { HubClass };
146
146
  pseudo Singleton for the main messaging bus, however you can still create
147
147
  your own instance of HubClass() for a separate "private bus" of events.*/
148
148
  export var Hub = new HubClass('__default__');
149
+ /**
150
+ * @internal
151
+ *
152
+ * Internal hub used for core Amplify functionality. Not intended for use outside of Amplify.
153
+ *
154
+ */
155
+ export var HubInternal = new HubClass('internal-hub');
@@ -0,0 +1,16 @@
1
+ import { AdditionalDetails, SetCustomUserAgentInput } from './types';
2
+ /**
3
+ * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
4
+ * clean up any custom state set with this API.
5
+ *
6
+ * @note
7
+ * This API operates globally. Calling this API multiple times will result in the most recently set values for a
8
+ * particular API being used.
9
+ *
10
+ * @note
11
+ * This utility IS NOT compatible with SSR.
12
+ *
13
+ * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
14
+ */
15
+ export declare const setCustomUserAgent: (input: SetCustomUserAgentInput) => (() => void);
16
+ export declare const getCustomUserAgent: (category: string, api: string) => AdditionalDetails | undefined;
@@ -0,0 +1,65 @@
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
+ };
14
+ // Maintains custom user-agent state set by external consumers.
15
+ var customUserAgentState = {};
16
+ /**
17
+ * Sets custom user agent state which will be appended to applicable requests. Returns a function that can be used to
18
+ * clean up any custom state set with this API.
19
+ *
20
+ * @note
21
+ * This API operates globally. Calling this API multiple times will result in the most recently set values for a
22
+ * particular API being used.
23
+ *
24
+ * @note
25
+ * This utility IS NOT compatible with SSR.
26
+ *
27
+ * @param input - SetCustomUserAgentInput that defines custom state to apply to the specified APIs.
28
+ */
29
+ export var setCustomUserAgent = function (input) {
30
+ var _a;
31
+ // Save custom user-agent state & increment reference counter
32
+ // TODO Remove `any` when we upgrade to TypeScript 5.2, see: https://github.com/microsoft/TypeScript/issues/44373
33
+ customUserAgentState[input.category] = input.apis.reduce(function (acc, api) {
34
+ var _a;
35
+ var _b;
36
+ return (__assign(__assign({}, acc), (_a = {}, _a[api] = {
37
+ refCount: ((_b = acc[api]) === null || _b === void 0 ? void 0 : _b.refCount) ? acc[api].refCount + 1 : 1,
38
+ additionalDetails: input.additionalDetails,
39
+ }, _a)));
40
+ }, (_a = customUserAgentState[input.category]) !== null && _a !== void 0 ? _a : {});
41
+ // Callback that cleans up state for APIs recorded by this call
42
+ var cleanUpCallbackCalled = false;
43
+ var cleanUpCallback = function () {
44
+ // Only allow the cleanup callback to be called once
45
+ if (cleanUpCallbackCalled) {
46
+ return;
47
+ }
48
+ cleanUpCallbackCalled = true;
49
+ input.apis.forEach(function (api) {
50
+ var apiRefCount = customUserAgentState[input.category][api].refCount;
51
+ if (apiRefCount > 1) {
52
+ customUserAgentState[input.category][api].refCount = apiRefCount - 1;
53
+ }
54
+ else {
55
+ delete customUserAgentState[input.category][api];
56
+ // Clean up category if no more APIs set
57
+ if (!Object.keys(customUserAgentState[input.category]).length) {
58
+ delete customUserAgentState[input.category];
59
+ }
60
+ }
61
+ });
62
+ };
63
+ return cleanUpCallback;
64
+ };
65
+ export var getCustomUserAgent = function (category, api) { var _a, _b; return (_b = (_a = customUserAgentState[category]) === null || _a === void 0 ? void 0 : _a[api]) === null || _b === void 0 ? void 0 : _b.additionalDetails; };
@@ -19,6 +19,7 @@ var __read = (this && this.__read) || function (o, n) {
19
19
  import { Framework } from './types';
20
20
  import { version } from './version';
21
21
  import { detectFramework, observeFrameworkChanges } from './detectFramework';
22
+ import { getCustomUserAgent } from './customUserAgent';
22
23
  var BASE_USER_AGENT = "aws-amplify";
23
24
  var PlatformBuilder = /** @class */ (function () {
24
25
  function PlatformBuilder() {
@@ -52,6 +53,14 @@ export var getAmplifyUserAgentObject = function (_a) {
52
53
  userAgent.push([category, action]);
53
54
  }
54
55
  userAgent.push(['framework', detectFramework()]);
56
+ if (category && action) {
57
+ var customState = getCustomUserAgent(category, action);
58
+ if (customState) {
59
+ customState.forEach(function (state) {
60
+ userAgent.push(state);
61
+ });
62
+ }
63
+ }
55
64
  return userAgent;
56
65
  };
57
66
  export var getAmplifyUserAgent = function (customUserAgentDetails) {
@@ -59,7 +68,7 @@ export var getAmplifyUserAgent = function (customUserAgentDetails) {
59
68
  var userAgentString = userAgent
60
69
  .map(function (_a) {
61
70
  var _b = __read(_a, 2), agentKey = _b[0], agentValue = _b[1];
62
- return "".concat(agentKey, "/").concat(agentValue);
71
+ return agentKey && agentValue ? "".concat(agentKey, "/").concat(agentValue) : agentKey;
63
72
  })
64
73
  .join(' ');
65
74
  return userAgentString;
@@ -126,4 +126,35 @@ export type CustomUserAgentDetails = (CustomUserAgentDetailsBase & {
126
126
  category?: never;
127
127
  action?: never;
128
128
  }) | UserAgentDetailsWithCategory<Category.API> | UserAgentDetailsWithCategory<Category.Auth> | UserAgentDetailsWithCategory<Category.Analytics> | UserAgentDetailsWithCategory<Category.DataStore> | UserAgentDetailsWithCategory<Category.Geo> | UserAgentDetailsWithCategory<Category.Interactions> | UserAgentDetailsWithCategory<Category.InAppMessaging> | UserAgentDetailsWithCategory<Category.Predictions> | UserAgentDetailsWithCategory<Category.PubSub> | UserAgentDetailsWithCategory<Category.PushNotification> | UserAgentDetailsWithCategory<Category.Storage>;
129
+ /**
130
+ * `refCount` tracks how many consumers have set state for a particular API to avoid it being cleared before all
131
+ * consumers are done using it.
132
+ *
133
+ * Category -> Action -> Custom State
134
+ */
135
+ export type CategoryUserAgentStateMap = Record<string, {
136
+ refCount: number;
137
+ additionalDetails: AdditionalDetails;
138
+ }>;
139
+ export type CustomUserAgentStateMap = Record<string, CategoryUserAgentStateMap>;
140
+ export type AdditionalDetails = [string, string?][];
141
+ type StorageUserAgentInput = {
142
+ category: Category.Storage;
143
+ apis: StorageAction[];
144
+ };
145
+ type AuthUserAgentInput = {
146
+ category: Category.Auth;
147
+ apis: AuthAction[];
148
+ };
149
+ type InAppMessagingUserAgentInput = {
150
+ category: Category.InAppMessaging;
151
+ apis: InAppMessagingAction[];
152
+ };
153
+ type GeoUserAgentInput = {
154
+ category: Category.Geo;
155
+ apis: GeoAction[];
156
+ };
157
+ export type SetCustomUserAgentInput = (StorageUserAgentInput | AuthUserAgentInput | InAppMessagingUserAgentInput | GeoUserAgentInput) & {
158
+ additionalDetails: AdditionalDetails;
159
+ };
129
160
  export {};
@@ -1 +1 @@
1
- export declare const version = "6.0.1-console-preview.5f040a2.0+5f040a2";
1
+ export declare const version = "6.0.1-console-preview.a1c533e.0+a1c533e";
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export var version = '6.0.1-console-preview.5f040a2.0+5f040a2';
2
+ export var version = '6.0.1-console-preview.a1c533e.0+a1c533e';
@@ -1,15 +1,16 @@
1
1
  export { generateRandomString, isBrowser, isNonRetryableError, isWebWorker, jitteredBackoff, jitteredExponentialRetry, NonRetryableError, retry, urlSafeDecode, urlSafeEncode, } from './utils';
2
2
  export { parseAWSExports } from './parseAWSExports';
3
3
  export { LegacyConfig } from './singleton/types';
4
- export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, } from './singleton/Auth/types';
5
4
  export { decodeJWT, assertTokenProviderConfig, assertIdentityPoolIdConfig, assertOAuthConfig, } from './singleton/Auth/utils';
6
5
  export { isTokenExpired } from './singleton/Auth';
7
6
  export { APIAuthMode, DocumentType } from './singleton/API/types';
8
7
  export { Signer } from './Signer';
8
+ export { JWT, StrictUnion, CognitoIdentityPoolConfig, JwtPayload, AuthStandardAttributeKey, AuthVerifiableAttributeKey, } from './singleton/Auth/types';
9
9
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
10
10
  export { ClientDevice } from './ClientDevice';
11
11
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
12
- export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
12
+ export { ApiAction, AuthAction, AnalyticsAction, Category, CustomUserAgentDetails, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, SetCustomUserAgentInput, } from './Platform/types';
13
+ export { setCustomUserAgent } from './Platform/customUserAgent';
13
14
  export { ServiceWorker } from './ServiceWorker';
14
15
  export { BackgroundProcessManager } from './BackgroundProcessManager';
15
16
  export { Mutex } from './Mutex';
@@ -21,4 +22,4 @@ export { fetchAuthSession } from './singleton/apis/internal/fetchAuthSession';
21
22
  export { AMPLIFY_SYMBOL } from './Hub';
22
23
  export { base64Decoder, base64Encoder } from './utils/convert';
23
24
  export { getCrypto } from './utils/globalHelpers';
24
- export { HubClass } from './Hub';
25
+ export { HubInternal } from './Hub';
@@ -13,10 +13,11 @@ export { isTokenExpired } from './singleton/Auth';
13
13
  export { Signer } from './Signer';
14
14
  // Logging utilities
15
15
  export { ConsoleLogger, ConsoleLogger as Logger } from './Logger';
16
- // Platform & device utils
16
+ // Platform & user-agent utilities
17
17
  export { ClientDevice } from './ClientDevice';
18
18
  export { Platform, getAmplifyUserAgentObject, getAmplifyUserAgent, } from './Platform';
19
19
  export { ApiAction, AuthAction, AnalyticsAction, Category, DataStoreAction, Framework, GeoAction, InteractionsAction, InAppMessagingAction, PredictionsAction, PubSubAction, PushNotificationAction, StorageAction, } from './Platform/types';
20
+ export { setCustomUserAgent } from './Platform/customUserAgent';
20
21
  // Service worker
21
22
  export { ServiceWorker } from './ServiceWorker';
22
23
  // Other utilities & constants
@@ -31,4 +32,4 @@ export { AMPLIFY_SYMBOL } from './Hub';
31
32
  export { base64Decoder, base64Encoder } from './utils/convert';
32
33
  export { getCrypto } from './utils/globalHelpers';
33
34
  // Hub
34
- export { HubClass } from './Hub';
35
+ export { HubInternal } from './Hub';
@@ -9,6 +9,31 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
29
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
30
+ if (ar || !(i in from)) {
31
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32
+ ar[i] = from[i];
33
+ }
34
+ }
35
+ return to.concat(ar || Array.prototype.slice.call(from));
36
+ };
12
37
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
13
38
  // SPDX-License-Identifier: Apache-2.0
14
39
  import { ConsoleLogger as Logger } from './Logger';
@@ -30,9 +55,9 @@ var authTypeMapping = {
30
55
  * @returns A {@link ResourcesConfig} object.
31
56
  */
32
57
  export var parseAWSExports = function (config) {
33
- var _a;
58
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
34
59
  if (config === void 0) { config = {}; }
35
- 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_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, 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_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;
36
61
  var amplifyConfig = {};
37
62
  // Analytics
38
63
  if (aws_mobile_analytics_app_id) {
@@ -46,7 +71,7 @@ export var parseAWSExports = function (config) {
46
71
  // Notifications
47
72
  if (Notifications) {
48
73
  if ((_a = Notifications.InAppMessaging) === null || _a === void 0 ? void 0 : _a.AWSPinpoint) {
49
- var _b = Notifications.InAppMessaging.AWSPinpoint, appId = _b.appId, region = _b.region;
74
+ var _p = Notifications.InAppMessaging.AWSPinpoint, appId = _p.appId, region = _p.region;
50
75
  amplifyConfig.Notifications = {
51
76
  InAppMessaging: {
52
77
  Pinpoint: {
@@ -73,12 +98,45 @@ export var parseAWSExports = function (config) {
73
98
  };
74
99
  }
75
100
  // Auth
101
+ var mfaConfig = aws_cognito_mfa_configuration ? {
102
+ status: aws_cognito_mfa_configuration && aws_cognito_mfa_configuration.toLowerCase(),
103
+ totpEnabled: (_b = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('TOTP')) !== null && _b !== void 0 ? _b : false,
104
+ smsEnabled: (_c = aws_cognito_mfa_types === null || aws_cognito_mfa_types === void 0 ? void 0 : aws_cognito_mfa_types.includes('SMS')) !== null && _c !== void 0 ? _c : false
105
+ } : undefined;
106
+ var passwordFormatConfig = aws_cognito_password_protection_settings ? {
107
+ minLength: aws_cognito_password_protection_settings.passwordPolicyMinLength,
108
+ requireLowercase: (_e = (_d = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _d === void 0 ? void 0 : _d.includes('REQUIRES_LOWERCASE')) !== null && _e !== void 0 ? _e : false,
109
+ requireUppercase: (_g = (_f = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _f === void 0 ? void 0 : _f.includes('REQUIRES_UPPERCASE')) !== null && _g !== void 0 ? _g : false,
110
+ requireNumbers: (_j = (_h = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _h === void 0 ? void 0 : _h.includes('REQUIRES_NUMBERS')) !== null && _j !== void 0 ? _j : false,
111
+ requireSpecialCharacters: (_l = (_k = aws_cognito_password_protection_settings.passwordPolicyCharacters) === null || _k === void 0 ? void 0 : _k.includes('REQUIRES_SYMBOLS')) !== null && _l !== void 0 ? _l : false,
112
+ } : undefined;
113
+ var mergedUserAttributes = Array.from(new Set(__spreadArray(__spreadArray([], __read((aws_cognito_verification_mechanisms !== null && aws_cognito_verification_mechanisms !== void 0 ? aws_cognito_verification_mechanisms : [])), false), __read((aws_cognito_signup_attributes !== null && aws_cognito_signup_attributes !== void 0 ? aws_cognito_signup_attributes : [])), false)));
114
+ var userAttributesConfig = mergedUserAttributes.map(function (s) {
115
+ var _a;
116
+ return (_a = {},
117
+ _a[s.toLowerCase()] = {
118
+ required: true // All user attributes generated by the CLI will be required
119
+ },
120
+ _a);
121
+ });
122
+ var loginWithEmailEnabled = (_m = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('EMAIL')) !== null && _m !== void 0 ? _m : false;
123
+ var loginWithPhoneEnabled = (_o = aws_cognito_username_attributes === null || aws_cognito_username_attributes === void 0 ? void 0 : aws_cognito_username_attributes.includes('PHONE_NUMBER')) !== null && _o !== void 0 ? _o : false;
76
124
  if (aws_cognito_identity_pool_id || aws_user_pools_id) {
77
125
  amplifyConfig.Auth = {
78
- 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 &&
79
- Object.keys(oauth).length > 0 && {
80
- loginWith: getOAuthConfig(oauth),
81
- })),
126
+ Cognito: {
127
+ identityPoolId: aws_cognito_identity_pool_id,
128
+ allowGuestAccess: aws_mandatory_sign_in !== 'enable',
129
+ signUpVerificationMethod: aws_cognito_sign_up_verification_method,
130
+ userAttributes: userAttributesConfig,
131
+ userPoolClientId: aws_user_pools_web_client_id,
132
+ userPoolId: aws_user_pools_id,
133
+ mfa: mfaConfig,
134
+ passwordFormat: passwordFormatConfig,
135
+ loginWith: __assign({ username: (loginWithEmailEnabled || loginWithPhoneEnabled) ? false : true, email: loginWithEmailEnabled, phone: loginWithPhoneEnabled }, (oauth &&
136
+ Object.keys(oauth).length > 0 && {
137
+ oauth: getOAuthConfig(oauth),
138
+ })),
139
+ },
82
140
  };
83
141
  }
84
142
  // Storage
@@ -116,12 +174,10 @@ var getRedirectUrl = function (redirectStr) {
116
174
  var getOAuthConfig = function (_a) {
117
175
  var domain = _a.domain, scope = _a.scope, redirectSignIn = _a.redirectSignIn, redirectSignOut = _a.redirectSignOut, responseType = _a.responseType;
118
176
  return ({
119
- oauth: {
120
- domain: domain,
121
- scopes: scope,
122
- redirectSignIn: getRedirectUrl(redirectSignIn),
123
- redirectSignOut: getRedirectUrl(redirectSignOut),
124
- responseType: responseType,
125
- },
177
+ domain: domain,
178
+ scopes: scope,
179
+ redirectSignIn: getRedirectUrl(redirectSignIn),
180
+ redirectSignOut: getRedirectUrl(redirectSignOut),
181
+ responseType: responseType,
126
182
  });
127
183
  };
@@ -50,6 +50,11 @@ export type AuthTokens = {
50
50
  idToken?: JWT;
51
51
  accessToken: JWT;
52
52
  };
53
+ export type AuthStandardAttributeKey = 'address' | 'birthdate' | 'email_verified' | 'family_name' | 'gender' | 'given_name' | 'locale' | 'middle_name' | 'name' | 'nickname' | 'phone_number_verified' | 'picture' | 'preferred_username' | 'profile' | 'sub' | 'updated_at' | 'website' | 'zoneinfo' | AuthVerifiableAttributeKey;
54
+ export type AuthVerifiableAttributeKey = 'email' | 'phone_number';
55
+ export type AuthConfigUserAttributes = Partial<Record<AuthStandardAttributeKey, {
56
+ required: boolean;
57
+ }>>;
53
58
  export type AuthConfig = StrictUnion<AuthIdentityPoolConfig | AuthUserPoolConfig | AuthUserPoolAndIdentityPoolConfig>;
54
59
  type UnionKeys<T> = T extends T ? keyof T : never;
55
60
  type StrictUnionHelper<T, TAll> = T extends any ? T & Partial<Record<Exclude<UnionKeys<TAll>, keyof T>, never>> : never;
@@ -59,6 +64,11 @@ export type AuthIdentityPoolConfig = {
59
64
  userPoolClientId?: never;
60
65
  userPoolId?: never;
61
66
  loginWith?: never;
67
+ signUpVerificationMethod?: never;
68
+ userAttributes?: never;
69
+ mfa?: never;
70
+ passwordFormat?: never;
71
+ endpoint?: never;
62
72
  };
63
73
  };
64
74
  export type CognitoIdentityPoolConfig = {
@@ -77,7 +87,24 @@ export type CognitoUserPoolConfig = {
77
87
  signUpVerificationMethod?: 'code' | 'link';
78
88
  loginWith?: {
79
89
  oauth?: OAuthConfig;
90
+ username?: boolean;
91
+ email?: boolean;
92
+ phone?: boolean;
80
93
  };
94
+ userAttributes?: AuthConfigUserAttributes;
95
+ mfa?: {
96
+ status?: 'on' | 'off' | 'optional';
97
+ totpEnabled?: boolean;
98
+ smsEnabled?: boolean;
99
+ };
100
+ passwordFormat?: {
101
+ minLength?: number;
102
+ requireLowercase?: boolean;
103
+ requireUppercase?: boolean;
104
+ requireNumbers?: boolean;
105
+ requireSpecialCharacters?: boolean;
106
+ };
107
+ endpoint?: string;
81
108
  };
82
109
  export type OAuthConfig = {
83
110
  domain: string;