From 5fa456c758ee46a49cab92fc8f22c7609ef7d4d2 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:25:33 -0700 Subject: [PATCH 01/13] chore: port CognitoUserPool over to InternalCognitoUserPool --- .../{CognitoUserPool.js => internals/InternalCognitoUserPool.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/amazon-cognito-identity-js/src/{CognitoUserPool.js => internals/InternalCognitoUserPool.js} (100%) diff --git a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js similarity index 100% rename from packages/amazon-cognito-identity-js/src/CognitoUserPool.js rename to packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js From 8f7430401fb3031c8160e1acee59feb75ef84172 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:26:23 -0700 Subject: [PATCH 02/13] chore: restore CognitoUserPool --- .../src/CognitoUserPool.js | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 packages/amazon-cognito-identity-js/src/CognitoUserPool.js diff --git a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js new file mode 100644 index 00000000000..3f188234291 --- /dev/null +++ b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js @@ -0,0 +1,194 @@ +/*! + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +import Client from './Client'; +import CognitoUser from './CognitoUser'; +import StorageHelper from './StorageHelper'; + +const USER_POOL_ID_MAX_LENGTH = 55; + +/** @class */ +export default class CognitoUserPool { + /** + * Constructs a new CognitoUserPool object + * @param {object} data Creation options. + * @param {string} data.UserPoolId Cognito user pool id. + * @param {string} data.ClientId User pool application client id. + * @param {string} data.endpoint Optional custom service endpoint. + * @param {object} data.fetchOptions Optional options for fetch API. + * (only credentials option is supported) + * @param {object} data.Storage Optional storage object. + * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional: + * boolean flag indicating if the data collection is enabled + * to support cognito advanced security features. By default, this + * flag is set to true. + */ + constructor(data, wrapRefreshSessionCallback) { + const { + UserPoolId, + ClientId, + endpoint, + fetchOptions, + AdvancedSecurityDataCollectionFlag, + } = data || {}; + if (!UserPoolId || !ClientId) { + throw new Error('Both UserPoolId and ClientId are required.'); + } + if (UserPoolId.length > USER_POOL_ID_MAX_LENGTH || !/^[\w-]+_[0-9a-zA-Z]+$/.test(UserPoolId)) { + throw new Error('Invalid UserPoolId format.'); + } + const region = UserPoolId.split('_')[0]; + + this.userPoolId = UserPoolId; + this.clientId = ClientId; + + this.client = new Client(region, endpoint, fetchOptions); + + /** + * By default, AdvancedSecurityDataCollectionFlag is set to true, + * if no input value is provided. + */ + this.advancedSecurityDataCollectionFlag = + AdvancedSecurityDataCollectionFlag !== false; + + this.storage = data.Storage || new StorageHelper().getStorage(); + + if (wrapRefreshSessionCallback) { + this.wrapRefreshSessionCallback = wrapRefreshSessionCallback; + } + } + + /** + * @returns {string} the user pool id + */ + getUserPoolId() { + return this.userPoolId; + } + + /** + * @returns {string} the user pool name + */ + getUserPoolName() { + return this.getUserPoolId().split('_')[1]; + } + + /** + * @returns {string} the client id + */ + getClientId() { + return this.clientId; + } + + /** + * @typedef {object} SignUpResult + * @property {CognitoUser} user New user. + * @property {bool} userConfirmed If the user is already confirmed. + */ + /** + * method for signing up a user + * @param {string} username User's username. + * @param {string} password Plain-text initial password entered by user. + * @param {(AttributeArg[])=} userAttributes New user attributes. + * @param {(AttributeArg[])=} validationData Application metadata. + * @param {(AttributeArg[])=} clientMetadata Client metadata. + * @param {nodeCallback} callback Called on error or with the new user. + * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger + * @returns {void} + */ + signUp( + username, + password, + userAttributes, + validationData, + callback, + clientMetadata + ) { + const jsonReq = { + ClientId: this.clientId, + Username: username, + Password: password, + UserAttributes: userAttributes, + ValidationData: validationData, + ClientMetadata: clientMetadata, + }; + if (this.getUserContextData(username)) { + jsonReq.UserContextData = this.getUserContextData(username); + } + this.client.request('SignUp', jsonReq, (err, data) => { + if (err) { + return callback(err, null); + } + + const cognitoUser = { + Username: username, + Pool: this, + Storage: this.storage, + }; + + const returnData = { + user: new CognitoUser(cognitoUser), + userConfirmed: data.UserConfirmed, + userSub: data.UserSub, + codeDeliveryDetails: data.CodeDeliveryDetails, + }; + + return callback(null, returnData); + }); + } + + /** + * method for getting the current user of the application from the local storage + * + * @returns {CognitoUser} the user retrieved from storage + */ + getCurrentUser() { + const lastUserKey = `CognitoIdentityServiceProvider.${this.clientId}.LastAuthUser`; + + const lastAuthUser = this.storage.getItem(lastUserKey); + if (lastAuthUser) { + const cognitoUser = { + Username: lastAuthUser, + Pool: this, + Storage: this.storage, + }; + + return new CognitoUser(cognitoUser); + } + + return null; + } + + /** + * This method returns the encoded data string used for cognito advanced security feature. + * This would be generated only when developer has included the JS used for collecting the + * data on their client. Please refer to documentation to know more about using AdvancedSecurity + * features + * @param {string} username the username for the context data + * @returns {string} the user context data + **/ + getUserContextData(username) { + if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') { + return undefined; + } + /* eslint-disable */ + const amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData; + /* eslint-enable */ + + if (this.advancedSecurityDataCollectionFlag) { + const advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData( + username, + this.userPoolId, + this.clientId + ); + if (advancedSecurityData) { + const userContextData = { + EncodedData: advancedSecurityData, + }; + return userContextData; + } + } + return {}; + } +} From 1b8553a387a943f0ed6ef4b74fc1e0024339580f Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:32:12 -0700 Subject: [PATCH 03/13] feat: add userAgentValue parameter to signUp --- .../src/internals/InternalCognitoUserPool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js index 3f188234291..99b8db7562b 100644 --- a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js @@ -95,6 +95,7 @@ export default class CognitoUserPool { * @param {(AttributeArg[])=} clientMetadata Client metadata. * @param {nodeCallback} callback Called on error or with the new user. * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger + * @param {string} userAgentValue Optional string containing custom user agent value * @returns {void} */ signUp( @@ -103,7 +104,8 @@ export default class CognitoUserPool { userAttributes, validationData, callback, - clientMetadata + clientMetadata, + userAgentValue ) { const jsonReq = { ClientId: this.clientId, From 2c0d9c6b6e54933c79dae467f9f04343739dd053 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:38:01 -0700 Subject: [PATCH 04/13] feat: update class name and imports --- .../src/internals/InternalCognitoUserPool.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js index 99b8db7562b..fb1e0621e31 100644 --- a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import Client from './Client'; -import CognitoUser from './CognitoUser'; -import StorageHelper from './StorageHelper'; +import Client from '../Client'; +import CognitoUser from '../CognitoUser'; +import StorageHelper from '../StorageHelper'; const USER_POOL_ID_MAX_LENGTH = 55; /** @class */ -export default class CognitoUserPool { +export class InternalCognitoUserPool { /** * Constructs a new CognitoUserPool object * @param {object} data Creation options. From 7995aa6739ea0c55effc9b0f35e537b0a33208bd Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:43:01 -0700 Subject: [PATCH 05/13] feat: make CognitoUserPool extend internal and override signUp --- .../src/CognitoUserPool.js | 167 ++---------------- 1 file changed, 10 insertions(+), 157 deletions(-) diff --git a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js index 3f188234291..d71a575311e 100644 --- a/packages/amazon-cognito-identity-js/src/CognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/CognitoUserPool.js @@ -3,83 +3,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -import Client from './Client'; import CognitoUser from './CognitoUser'; -import StorageHelper from './StorageHelper'; +import { InternalCognitoUserPool } from './internals'; const USER_POOL_ID_MAX_LENGTH = 55; /** @class */ -export default class CognitoUserPool { - /** - * Constructs a new CognitoUserPool object - * @param {object} data Creation options. - * @param {string} data.UserPoolId Cognito user pool id. - * @param {string} data.ClientId User pool application client id. - * @param {string} data.endpoint Optional custom service endpoint. - * @param {object} data.fetchOptions Optional options for fetch API. - * (only credentials option is supported) - * @param {object} data.Storage Optional storage object. - * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional: - * boolean flag indicating if the data collection is enabled - * to support cognito advanced security features. By default, this - * flag is set to true. - */ - constructor(data, wrapRefreshSessionCallback) { - const { - UserPoolId, - ClientId, - endpoint, - fetchOptions, - AdvancedSecurityDataCollectionFlag, - } = data || {}; - if (!UserPoolId || !ClientId) { - throw new Error('Both UserPoolId and ClientId are required.'); - } - if (UserPoolId.length > USER_POOL_ID_MAX_LENGTH || !/^[\w-]+_[0-9a-zA-Z]+$/.test(UserPoolId)) { - throw new Error('Invalid UserPoolId format.'); - } - const region = UserPoolId.split('_')[0]; - - this.userPoolId = UserPoolId; - this.clientId = ClientId; - - this.client = new Client(region, endpoint, fetchOptions); - - /** - * By default, AdvancedSecurityDataCollectionFlag is set to true, - * if no input value is provided. - */ - this.advancedSecurityDataCollectionFlag = - AdvancedSecurityDataCollectionFlag !== false; - - this.storage = data.Storage || new StorageHelper().getStorage(); - - if (wrapRefreshSessionCallback) { - this.wrapRefreshSessionCallback = wrapRefreshSessionCallback; - } - } - - /** - * @returns {string} the user pool id - */ - getUserPoolId() { - return this.userPoolId; - } - - /** - * @returns {string} the user pool name - */ - getUserPoolName() { - return this.getUserPoolId().split('_')[1]; - } - - /** - * @returns {string} the client id - */ - getClientId() { - return this.clientId; - } +export default class CognitoUserPool extends InternalCognitoUserPool { /** * @typedef {object} SignUpResult @@ -105,90 +35,13 @@ export default class CognitoUserPool { callback, clientMetadata ) { - const jsonReq = { - ClientId: this.clientId, - Username: username, - Password: password, - UserAttributes: userAttributes, - ValidationData: validationData, - ClientMetadata: clientMetadata, - }; - if (this.getUserContextData(username)) { - jsonReq.UserContextData = this.getUserContextData(username); - } - this.client.request('SignUp', jsonReq, (err, data) => { - if (err) { - return callback(err, null); - } - - const cognitoUser = { - Username: username, - Pool: this, - Storage: this.storage, - }; - - const returnData = { - user: new CognitoUser(cognitoUser), - userConfirmed: data.UserConfirmed, - userSub: data.UserSub, - codeDeliveryDetails: data.CodeDeliveryDetails, - }; - - return callback(null, returnData); - }); - } - - /** - * method for getting the current user of the application from the local storage - * - * @returns {CognitoUser} the user retrieved from storage - */ - getCurrentUser() { - const lastUserKey = `CognitoIdentityServiceProvider.${this.clientId}.LastAuthUser`; - - const lastAuthUser = this.storage.getItem(lastUserKey); - if (lastAuthUser) { - const cognitoUser = { - Username: lastAuthUser, - Pool: this, - Storage: this.storage, - }; - - return new CognitoUser(cognitoUser); - } - - return null; - } - - /** - * This method returns the encoded data string used for cognito advanced security feature. - * This would be generated only when developer has included the JS used for collecting the - * data on their client. Please refer to documentation to know more about using AdvancedSecurity - * features - * @param {string} username the username for the context data - * @returns {string} the user context data - **/ - getUserContextData(username) { - if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') { - return undefined; - } - /* eslint-disable */ - const amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData; - /* eslint-enable */ - - if (this.advancedSecurityDataCollectionFlag) { - const advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData( - username, - this.userPoolId, - this.clientId - ); - if (advancedSecurityData) { - const userContextData = { - EncodedData: advancedSecurityData, - }; - return userContextData; - } - } - return {}; + return super.signUp( + username, + password, + userAttributes, + validationData, + callback, + clientMetadata + ); } } From 5b216a6e6c7c91177bb3dd1371ff911be708a677 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 09:43:48 -0700 Subject: [PATCH 06/13] feat: export InternalCognitoUserPool from internals index --- packages/amazon-cognito-identity-js/src/internals/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/amazon-cognito-identity-js/src/internals/index.js b/packages/amazon-cognito-identity-js/src/internals/index.js index 42084ebe8da..2a528004dfd 100644 --- a/packages/amazon-cognito-identity-js/src/internals/index.js +++ b/packages/amazon-cognito-identity-js/src/internals/index.js @@ -2,3 +2,4 @@ export { addAuthCategoryToCognitoUserAgent, addFrameworkToCognitoUserAgent, } from '../UserAgent'; +export { InternalCognitoUserPool } from './InternalCognitoUserPool'; From e45491d0df658e0da7565d22a78a5ed823512f65 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 10:05:02 -0700 Subject: [PATCH 07/13] feat: send userAgentValue to client service call --- packages/amazon-cognito-identity-js/src/Client.js | 4 ++-- .../src/internals/InternalCognitoUserPool.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/amazon-cognito-identity-js/src/Client.js b/packages/amazon-cognito-identity-js/src/Client.js index 1ee3f8b4dbc..592a5fefb25 100644 --- a/packages/amazon-cognito-identity-js/src/Client.js +++ b/packages/amazon-cognito-identity-js/src/Client.js @@ -75,11 +75,11 @@ export default class Client { * @param {function} callback Callback called when a response is returned * @returns {void} */ - request(operation, params, callback) { + request(operation, params, callback, userAgentValue) { const headers = { 'Content-Type': 'application/x-amz-json-1.1', 'X-Amz-Target': `AWSCognitoIdentityProviderService.${operation}`, - 'X-Amz-User-Agent': getAmplifyUserAgent(), + 'X-Amz-User-Agent': userAgentValue || getAmplifyUserAgent(), 'Cache-Control': 'no-store', }; diff --git a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js index fb1e0621e31..4a5b9ff480a 100644 --- a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js @@ -137,7 +137,7 @@ export class InternalCognitoUserPool { }; return callback(null, returnData); - }); + }, userAgentValue); } /** From 622bb40bd7a44b30dc518e3b2623a05800a0d335 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 10:59:09 -0700 Subject: [PATCH 08/13] test: fix internalsIndex test --- .../amazon-cognito-identity-js/__tests__/internalsIndex.test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js b/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js index 4b448a3e8a1..b83519ad35f 100644 --- a/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js +++ b/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js @@ -6,6 +6,7 @@ describe('import * keys', () => { Array [ "addAuthCategoryToCognitoUserAgent", "addFrameworkToCognitoUserAgent", + "InternalCognitoUserPool", ] `); }); From bcf5946768820d221833f1cd8cc096bd38b918dd Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 10:59:38 -0700 Subject: [PATCH 09/13] build: export InternalCognitoUserPool from internals scope --- .../internals/index.d.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/amazon-cognito-identity-js/internals/index.d.ts b/packages/amazon-cognito-identity-js/internals/index.d.ts index c7ecb6928c7..b8822d87935 100644 --- a/packages/amazon-cognito-identity-js/internals/index.d.ts +++ b/packages/amazon-cognito-identity-js/internals/index.d.ts @@ -1,2 +1,34 @@ +import { + NodeCallback, + ClientMetadata, + CognitoUser, + CognitoUserAttribute, + ICognitoUserPoolData, + ISignUpResult, +} from 'amazon-cognito-identity-js'; + export const addAuthCategoryToCognitoUserAgent: () => void; export const addFrameworkToCognitoUserAgent: (content: string) => void; + +export class InternalCognitoUserPool { + constructor( + data: ICognitoUserPoolData, + wrapRefreshSessionCallback?: (target: NodeCallback.Any) => NodeCallback.Any + ); + + public getUserPoolId(): string; + public getUserPoolName(): string; + public getClientId(): string; + + public signUp( + username: string, + password: string, + userAttributes: CognitoUserAttribute[], + validationData: CognitoUserAttribute[], + callback: NodeCallback, + clientMetadata?: ClientMetadata, + userAgentValue?: string + ): void; + + public getCurrentUser(): CognitoUser | null; +} From 11e22ad8a96b65b18c31e4be39ea7cb1dc380553 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Thu, 3 Aug 2023 11:00:21 -0700 Subject: [PATCH 10/13] chore: update CognitoUserPool type to extend internal --- packages/amazon-cognito-identity-js/index.d.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/amazon-cognito-identity-js/index.d.ts b/packages/amazon-cognito-identity-js/index.d.ts index 0a32f2c9fc5..7b7941c1f8c 100644 --- a/packages/amazon-cognito-identity-js/index.d.ts +++ b/packages/amazon-cognito-identity-js/index.d.ts @@ -1,3 +1,4 @@ +import { InternalCognitoUserPool } from './internals'; declare module 'amazon-cognito-identity-js' { //import * as AWS from "aws-sdk"; @@ -331,18 +332,7 @@ declare module 'amazon-cognito-identity-js' { AdvancedSecurityDataCollectionFlag?: boolean; } - export class CognitoUserPool { - constructor( - data: ICognitoUserPoolData, - wrapRefreshSessionCallback?: ( - target: NodeCallback.Any - ) => NodeCallback.Any - ); - - public getUserPoolId(): string; - public getUserPoolName(): string; - public getClientId(): string; - + export class CognitoUserPool extends InternalCognitoUserPool { public signUp( username: string, password: string, @@ -351,8 +341,6 @@ declare module 'amazon-cognito-identity-js' { callback: NodeCallback, clientMetadata?: ClientMetadata ): void; - - public getCurrentUser(): CognitoUser | null; } export interface ICognitoUserSessionData { From 47bdc825886d56644cbc6403f009b4baac810ea7 Mon Sep 17 00:00:00 2001 From: erinleigh90 <106691284+erinleigh90@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:52:10 -0700 Subject: [PATCH 11/13] Apply suggestions from code review Co-authored-by: Jim Blanchard --- packages/amazon-cognito-identity-js/src/Client.js | 1 + .../src/internals/InternalCognitoUserPool.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/amazon-cognito-identity-js/src/Client.js b/packages/amazon-cognito-identity-js/src/Client.js index 592a5fefb25..a0706890412 100644 --- a/packages/amazon-cognito-identity-js/src/Client.js +++ b/packages/amazon-cognito-identity-js/src/Client.js @@ -73,6 +73,7 @@ export default class Client { * @param {string} operation API operation * @param {object} params Input parameters * @param {function} callback Callback called when a response is returned + * @param {string} userAgentValue Optional string containing custom user agent value * @returns {void} */ request(operation, params, callback, userAgentValue) { diff --git a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js index 4a5b9ff480a..af98946441e 100644 --- a/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js +++ b/packages/amazon-cognito-identity-js/src/internals/InternalCognitoUserPool.js @@ -1,4 +1,4 @@ -/*! +/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ From 6484b4568404e5b6f9a34179b100e9e7d014338b Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Mon, 7 Aug 2023 11:42:39 -0700 Subject: [PATCH 12/13] chore: remove unnecessary test on internals index --- .../__tests__/internalsIndex.test.js | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js diff --git a/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js b/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js deleted file mode 100644 index b83519ad35f..00000000000 --- a/packages/amazon-cognito-identity-js/__tests__/internalsIndex.test.js +++ /dev/null @@ -1,13 +0,0 @@ -import * as exported from '../src/internals/index'; - -describe('import * keys', () => { - it('should match snapshot', () => { - expect(Object.keys(exported)).toMatchInlineSnapshot(` - Array [ - "addAuthCategoryToCognitoUserAgent", - "addFrameworkToCognitoUserAgent", - "InternalCognitoUserPool", - ] - `); - }); -}); From 6aaea852d796b3585c0a0e08d3bc0e99e0fc18b1 Mon Sep 17 00:00:00 2001 From: Erin Beal Date: Mon, 7 Aug 2023 23:24:55 -0700 Subject: [PATCH 13/13] chore: increase bundle size limit --- packages/auth/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/package.json b/packages/auth/package.json index e3419e0616e..6c9116c2dd4 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -60,7 +60,7 @@ "name": "Auth (top-level class)", "path": "./lib-esm/index.js", "import": "{ Amplify, Auth }", - "limit": "56.29 kB" + "limit": "56.38 kB" } ], "jest": {