Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release(required): Amplify JS release #11811

Merged
merged 8 commits into from
Aug 16, 2023
26 changes: 13 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ executors:

macos-executor:
macos:
xcode: 13.2.1
xcode: 13.4.1
resource_class: large

webkit-test-executor:
Expand Down Expand Up @@ -1091,12 +1091,12 @@ jobs:
steps:
- integ_test_rn_ios

integ_rn_ios_push_notifications:
executor: macos-executor
<<: *test_env_vars
working_directory: ~/amplify-js-samples-staging/samples/react-native/push-notifications/PushNotificationApp
steps:
- integ_test_rn_ios
# integ_rn_ios_push_notifications:
# executor: macos-executor
# <<: *test_env_vars
# working_directory: ~/amplify-js-samples-staging/samples/react-native/push-notifications/PushNotificationApp
# steps:
# - integ_test_rn_ios

# integ_rn_android_storage:
# executor: macos-executor
Expand Down Expand Up @@ -2013,12 +2013,12 @@ workflows:
- build
filters:
<<: *releasable_branches
- integ_rn_ios_push_notifications:
requires:
- integ_setup
- build
filters:
<<: *releasable_branches
# - integ_rn_ios_push_notifications:
# requires:
# - integ_setup
# - build
# filters:
# <<: *releasable_branches
- integ_rn_ios_device_tracking:
requires:
- integ_setup
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/node-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
**/esm/
**/cjs/
**/packages/core/src/Platform/version.ts
key: ${{ runner.os }}-build-artifacts-${{ hashFiles('./amplify-js/yarn.lock') }}
key: ${{ runner.os }}-build-artifacts-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-artifacts-
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/integ-config/integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ tests:
sample_name: [v2/custom-pk-unconnected-models]
spec: custom-pk-unconnected-models
browser: *extended_browser_list
timeout_minutes: 60
# - test_name: integ_react_datastore_custom_pk_unconnected_models_webkit
# desc: 'DataStore - Custom Primary Key (Connected Models)'
# framework: react
Expand All @@ -335,13 +336,15 @@ tests:
sample_name: [v2/custom-pk-has-one]
spec: custom-pk-has-one
browser: *minimal_browser_list
timeout_minutes: 60
- test_name: integ_react_datastore_custom_pk_has_many_many_to_many
desc: 'DataStore - Custom Primary Key (Has Many / Many to Many)'
framework: react
category: datastore
sample_name: [v2/custom-pk-has-many-many-to-many]
spec: custom-pk-has-many-many-to-many
browser: *minimal_browser_list
timeout_minutes: 60
- test_name: integ_react_datastore_background_process_manager
desc: 'DataStore - Background Process Manager'
framework: react
Expand Down
47 changes: 24 additions & 23 deletions packages/amazon-cognito-identity-js/internals/index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ export class InternalCognitoUser {
const userData = this.getUserDataFromCache();

if (!userData) {
this.fetchUserData()
this.fetchUserData(userAgentValue)
.then(data => {
callback(null, data);
})
Expand All @@ -1387,7 +1387,7 @@ export class InternalCognitoUser {
}

if (this.isFetchUserDataAndTokenRequired(params)) {
this.fetchUserData()
this.fetchUserData(userAgentValue)
.then(data => {
return this.refreshSessionIfPossible(params, userAgentValue).then(
() => data
Expand Down Expand Up @@ -1436,10 +1436,10 @@ export class InternalCognitoUser {
* @param {string} userAgentValue Optional string containing custom user agent value
*/
fetchUserData(userAgentValue) {
return this.createGetUserRequest().then(data => {
return this.createGetUserRequest(userAgentValue).then(data => {
this.cacheUserData(data);
return data;
}, userAgentValue);
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import Client from '../Client';
import CognitoUser from '../CognitoUser';
import { InternalCognitoUser } from '../internals';
import StorageHelper from '../StorageHelper';

const USER_POOL_ID_MAX_LENGTH = 55;
Expand Down Expand Up @@ -130,7 +131,7 @@ export class InternalCognitoUserPool {
};

const returnData = {
user: new CognitoUser(cognitoUser),
user: new InternalCognitoUser(cognitoUser),
userConfirmed: data.UserConfirmed,
userSub: data.UserSub,
codeDeliveryDetails: data.CodeDeliveryDetails,
Expand All @@ -156,7 +157,7 @@ export class InternalCognitoUserPool {
Storage: this.storage,
};

return new CognitoUser(cognitoUser);
return new InternalCognitoUser(cognitoUser);
}

return null;
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
"name": "Analytics (Pinpoint)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, Analytics, AWSPinpointProvider }",
"limit": "31.5 kB"
"limit": "31.57 kB"
},
{
"name": "Analytics (Kinesis)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, Analytics, AWSKinesisProvider }",
"limit": "60.5 kB"
"limit": "60.82 kB"
}
],
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"name": "API (GraphQL client)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, GraphQLAPI }",
"limit": "89.51 kB"
"limit": "90.35 kB"
}
],
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"name": "API (top-level class)",
"path": "./lib-esm/index.js",
"import": "{ Amplify, API }",
"limit": "90.27 kB"
"limit": "91.12 kB"
}
],
"jest": {
Expand Down
14 changes: 9 additions & 5 deletions packages/auth/__tests__/auth-attribute-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {
CognitoAccessToken,
CognitoUserAttribute,
} from 'amazon-cognito-identity-js';
import {
InternalCognitoUserPool,
InternalCognitoUser,
} from 'amazon-cognito-identity-js/internals';

import { AuthOptions } from '../src/types';
import { InternalAuthClass } from '../src/internals/InternalAuth';
Expand All @@ -23,7 +27,7 @@ const authOptions: AuthOptions = {
describe('User-Attribute-validation', () => {
it('Check-non-verified-attributes', async () => {
const spyonAuthUserAttributes = jest
.spyOn(InternalAuthClass.prototype, 'userAttributes')
.spyOn(InternalAuthClass.prototype as any, '_userAttributes')
.mockImplementation((user: CognitoUser) => {
const emailAttribute = new CognitoUserAttribute({
Name: 'email',
Expand Down Expand Up @@ -75,10 +79,10 @@ describe('User-Attribute-validation', () => {
const auth = new Auth(authOptions);

const spyUserPoolCurrentUser = jest
.spyOn(CognitoUserPool.prototype, 'getCurrentUser')
.spyOn(InternalCognitoUserPool.prototype, 'getCurrentUser')
.mockImplementation(() => {
return new CognitoUser({
Pool: new CognitoUserPool({
Pool: new InternalCognitoUserPool({
UserPoolId: authOptions.userPoolId,
ClientId: authOptions.userPoolWebClientId,
}),
Expand All @@ -87,7 +91,7 @@ describe('User-Attribute-validation', () => {
});

const spyUserGetSession = jest
.spyOn(CognitoUser.prototype, 'getSession')
.spyOn(InternalCognitoUser.prototype, 'getSession')
.mockImplementation((callback: any) => {
const session = new CognitoUserSession({
AccessToken: new CognitoAccessToken({ AccessToken: 'accesstoken' }),
Expand All @@ -103,7 +107,7 @@ describe('User-Attribute-validation', () => {
});

const spyGetUserData = jest
.spyOn(CognitoUser.prototype, 'getUserData')
.spyOn(InternalCognitoUser.prototype, 'getUserData')
.mockImplementation(callback => {
const emailAttribute = {
Name: 'email',
Expand Down
12 changes: 8 additions & 4 deletions packages/auth/__tests__/auth-creds-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import { Credentials } from '@aws-amplify/core';
import { AuthOptions } from '../src/types';
import {
CognitoUser,
CognitoUserPool,
CognitoUserSession,
CognitoAccessToken,
CognitoIdToken,
CognitoUserPool,
} from 'amazon-cognito-identity-js';
import {
InternalCognitoUser,
InternalCognitoUserPool,
} from 'amazon-cognito-identity-js/internals';
const authOptions: AuthOptions = {
userPoolId: 'us-west-2_0xxxxxxxx',
userPoolWebClientId: 'awsUserPoolsWebClientId',
Expand All @@ -21,7 +25,7 @@ describe('credentials syncing tests', () => {
const auth = new Auth(authOptions);

jest
.spyOn(CognitoUser.prototype, 'authenticateUser')
.spyOn(InternalCognitoUser.prototype, 'authenticateUser')
.mockImplementation((authenticationDetails, callback) => {
const session = new CognitoUserSession({
AccessToken: new CognitoAccessToken({ AccessToken: 'accesstoken' }),
Expand All @@ -32,7 +36,7 @@ describe('credentials syncing tests', () => {
});

jest
.spyOn(CognitoUserPool.prototype, 'getCurrentUser')
.spyOn(InternalCognitoUserPool.prototype, 'getCurrentUser')
.mockImplementation(() => {
return new CognitoUser({
Pool: new CognitoUserPool({
Expand All @@ -49,7 +53,7 @@ describe('credentials syncing tests', () => {
});

jest
.spyOn(CognitoUser.prototype, 'getSession')
.spyOn(InternalCognitoUser.prototype, 'getSession')
.mockImplementation((callback: any) => {
callback(null, session);
});
Expand Down
Loading