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 #13342

Merged
merged 25 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7ddca1b
chore: Merge release into main (#13309)
ashika112 Apr 29, 2024
c280817
fix: Await network call on identifyUser APIs
cshfang Apr 29, 2024
26da39d
Merge branch 'main' into fix/notifications-issues
cshfang Apr 30, 2024
36b5d1e
feat(react-native): add getDeviceName util (#13015)
ashwinkumar6 Apr 30, 2024
b2bf80a
feat(auth): enable gen2 e2e tests
israx Apr 29, 2024
38e20c8
chore: enable oauth test
israx Apr 30, 2024
ca9f941
Merge branch 'main' into fix/notifications-issues
cshfang Apr 30, 2024
cd5d337
fix: Await network call on identifyUser APIs (#13313)
cshfang Apr 30, 2024
a75ae7b
fix: Prevent creating multiple endpoint ids
cshfang Apr 30, 2024
fd859f9
Bump bundle size limit
cshfang Apr 30, 2024
2f3d65d
Update unit test to be more meaningful/robust
cshfang Apr 30, 2024
e2cdd38
Update unit test description
cshfang Apr 30, 2024
4920716
fix: Prevent creating multiple endpoint ids (#13319)
cshfang Apr 30, 2024
d218d81
chore: add deprecation notice to DataStore exported Schemaa type (#13…
svidgen May 1, 2024
db2845d
Merge branch 'main' into feat/enable-auth-gen2
israx May 1, 2024
e8e8796
chore: Bump `@aws-amplify/core` peer dependency across the library (#…
jimblanc May 1, 2024
196700c
Merge branch 'main' into feat/enable-auth-gen2
israx May 1, 2024
420e2c5
chore(deps): bump ejs from 3.1.9 to 3.1.10 (#13325)
dependabot[bot] May 2, 2024
377e6b6
Merge branch 'main' into feat/enable-auth-gen2
israx May 2, 2024
78a21b8
feat(gh-actions): gen2 e2e rest api (#13293)
Samaritan1011001 May 2, 2024
55bc6ee
Merge branch 'main' into feat/enable-auth-gen2
israx May 2, 2024
82e1bd3
feat(auth): enable auth gen2 (#13324)
israx May 2, 2024
5f34186
feat(auth): add a default deviceName when remembering device (#13022)
ashwinkumar6 May 2, 2024
f65cae2
fix(core): Always set login methods when parsing Gen2 config files (#…
jimblanc May 2, 2024
c794c14
chore(repo): add --forceExit to rollup command (#13331)
HuiSF May 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/integ-config/integ-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,16 @@ tests:
spec: restful
browser: *minimal_browser_list

# API Gen2
- test_name: integ_react_rest_api_gen2
desc: 'GEN2 Vite + React REST API'
framework: vite
category: api
sample_name: [rest]
spec: restful
backend: gen2
browser: *minimal_browser_list

# AUTH
- test_name: integ_react_javascript_authentication
desc: 'React Authentication'
Expand Down Expand Up @@ -512,6 +522,81 @@ tests:
spec: sign-in-with-oauth
browser: [chrome]

# AUTH GEN2
- test_name: integ_react_javascript_authentication_gen2
desc: 'React Authentication'
framework: react
category: auth
sample_name: [javascript-auth]
spec: functional-auth
browser: *minimal_browser_list
backend: gen2
- test_name: integ_react_auth_1_guest_to_authenticated_user_gen2
desc: 'Guest to Authenticated User'
framework: react
category: auth
sample_name: [guest-to-auth-user]
spec: guest-to-auth-user
browser: *minimal_browser_list
backend: gen2
- test_name: integ_react_typescript_authentication_gen2
desc: 'React Typescript Authentication'
framework: react
category: auth
sample_name: [typescript-auth]
spec: functional-auth
browser: *minimal_browser_list
backend: gen2
- test_name: integ_react_auth_2_sign_in_after_sign_up_gen2
desc: 'Sign In after Sign Up'
framework: react
category: auth
sample_name: [auto-signin-after-signup]
spec: auto-signin-after-signup
browser: *minimal_browser_list
backend: gen2
- test_name: integ_react_device_tracking_gen2
desc: 'cognito-device-tracking'
framework: react
category: auth
sample_name: [device-tracking]
spec: device-tracking
browser: *minimal_browser_list
backend: gen2
- test_name: integ_react_delete_user_gen2
desc: 'delete-user'
framework: react
category: auth
sample_name: [delete-user]
spec: delete-user
browser: *minimal_browser_list
backend: gen2
- test_name: integ_next_auth_authenticator_and_ssr_page_gen2
desc: 'Authenticator and SSR page'
framework: next
category: auth
sample_name: [auth-ssr]
spec: auth-ssr
browser: [chrome]
backend: gen2
- test_name: integ_next_auth_authenticator_and_rsc_page_gen2
desc: 'Authenticator and RSC page'
framework: next
category: auth
sample_name: [auth-rsc]
spec: auth-rsc
browser: [chrome]
backend: gen2
- test_name: integ_next_sign_in_with_oauth_gen2
desc: 'Sign-in with the OAuth flow'
framework: next
category: auth
sample_name: [sign-in-with-oauth]
spec: sign-in-with-oauth
browser: [chrome]
backend: gen2


# DISABLED Angular/Vue tests:
# TODO: delete tests or add custom ui logic to support them.

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/callable-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
browser:
required: true
type: string
backend:
required: true
type: string
amplifyjs_dir:
required: true
type: boolean
Expand Down Expand Up @@ -73,6 +76,7 @@ jobs:
E2E_SAMPLE_NAME: ${{ matrix.sample_name }}
E2E_SPEC: ${{ inputs.spec }}
E2E_BROWSER: ${{ matrix.browser }}
E2E_BACKEND: ${{ inputs.backend }}
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
Expand All @@ -85,6 +89,7 @@ jobs:
$E2E_SPEC \
$E2E_BROWSER \
dev \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
-n $E2E_RETRY_COUNT

Expand All @@ -97,6 +102,7 @@ jobs:
E2E_SAMPLE_NAME: ${{ matrix.sample_name }}
E2E_SPEC: ${{ inputs.spec }}
E2E_BROWSER: ${{ matrix.browser }}
E2E_BACKEND: ${{ inputs.backend }}
E2E_AMPLIFY_JS_DIR: ${{ inputs.amplifyjs_dir == true && env.AMPLIFY_DIR || ''}}
E2E_RETRY_COUNT: ${{ inputs.retry_count }}
E2E_TEST_NAME: ${{ inputs.test_name }}
Expand All @@ -109,6 +115,7 @@ jobs:
$E2E_SPEC \
$E2E_BROWSER \
prod \
$E2E_BACKEND \
$E2E_AMPLIFY_JS_DIR" \
-n $E2E_RETRY_COUNT
- name: Upload artifact
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/callable-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
amplifyjs_dir: ${{ matrix.integ-config.amplifyjs_dir || false }}
sample_name: ${{ toJSON(matrix.integ-config.sample_name) || '[""]' }}
browser: ${{ toJSON(matrix.integ-config.browser) || '[""]' }}
backend: ${{ matrix.integ-config.backend }}
timeout_minutes: ${{ matrix.integ-config.timeout_minutes || 35 }}
retry_count: ${{ matrix.integ-config.retry_count || 3 }}

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"scripts": {
"build": "npm run clean && npm run build:esm-cjs",
"build-with-test": "npm test && npm run build",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"clean": "npm run clean:size && rimraf dist",
"clean:size": "rimraf dual-publish-tmp tmp*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Analytics Pinpoint Provider API: identifyUser', () => {
});

beforeEach(() => {
mockUpdateEndpoint.mockClear();
mockUpdateEndpoint.mockReset();
});

it('passes through parameter along with Analytics boilerplate to core Pinpoint identifyUser API', async () => {
Expand Down Expand Up @@ -82,4 +82,13 @@ describe('Analytics Pinpoint Provider API: identifyUser', () => {
userAttributes,
});
});

it('rejects if underlying promise rejects', async () => {
mockUpdateEndpoint.mockRejectedValue(new Error());
const input: IdentifyUserInput = {
userId: 'user-id',
userProfile: {},
};
await expect(identifyUser(input)).rejects.toBeDefined();
});
});
4 changes: 2 additions & 2 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
"build-with-test": "npm run clean && npm run test && npm run build",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "npm run clean:size && rimraf dist lib lib-esm",
Expand Down Expand Up @@ -100,7 +100,7 @@
"tslib": "^2.5.0"
},
"peerDependencies": {
"@aws-amplify/core": "^6.0.0"
"@aws-amplify/core": "^6.1.0"
},
"devDependencies": {
"@aws-amplify/core": "6.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const identifyUser = async ({
const { credentials, identityId } = await resolveCredentials();
const { appId, region } = resolveConfig();
const { userAttributes } = options ?? {};
updateEndpoint({
await updateEndpoint({
appId,
category: 'Analytics',
credentials,
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 @@ -18,7 +18,7 @@
"test:watch": "tslint 'src/**/*.ts' && jest -w 1 --watch",
"build-with-test": "npm test && npm build",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "npm run clean:size && rimraf dist lib lib-esm",
Expand Down
4 changes: 2 additions & 2 deletions packages/api-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test:watch": "tslint 'src/**/*.ts' && jest -w 1 --watch",
"build-with-test": "npm test && npm build",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "npm run clean:size && rimraf dist lib lib-esm",
Expand Down Expand Up @@ -84,7 +84,7 @@
"tslib": "^2.5.0"
},
"peerDependencies": {
"@aws-amplify/core": "^6.0.0"
"@aws-amplify/core": "^6.1.0"
},
"devDependencies": {
"@aws-amplify/core": "6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
"build-with-test": "npm test && npm run build",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "npm run clean:size && rimraf dist lib lib-esm",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ describe('fetchDevices', () => {
const dateEpoch = 1.696296885807e9;
const date = new Date(dateEpoch * 1000);
const clientResponseDevice = {
DeviceAttributes: [{ Name: 'attributeName', Value: 'attributeValue' }],
DeviceAttributes: [
{ Name: 'attributeName', Value: 'attributeValue' },
{ Name: 'device_name', Value: 'deviceNameValue' },
],
DeviceCreateDate: dateEpoch,
DeviceKey: 'DeviceKey',
DeviceLastAuthenticatedDate: dateEpoch,
DeviceLastModifiedDate: dateEpoch,
};
const apiOutputDevice = {
id: 'DeviceKey',
name: undefined,
name: 'deviceNameValue',
attributes: {
attributeName: 'attributeValue',
device_name: 'deviceNameValue',
},
createDate: date,
lastModifiedDate: date,
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "yarn lint --fix && jest -w 1 --coverage --logHeapUsage",
"build-with-test": "npm test && npm run build",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "npm run clean:size && rimraf lib-esm lib dist",
Expand Down Expand Up @@ -94,7 +94,7 @@
"tslib": "^2.5.0"
},
"peerDependencies": {
"@aws-amplify/core": "^6.0.0"
"@aws-amplify/core": "^6.1.0"
},
"devDependencies": {
"@aws-amplify/core": "6.1.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/auth/src/providers/cognito/apis/fetchDevices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ const parseDevicesResponse = async (
DeviceLastModifiedDate,
DeviceLastAuthenticatedDate,
}) => {
let deviceName: string | undefined;
const attributes = DeviceAttributes.reduce(
(attrs: any, { Name, Value }) => {
if (Name && Value) {
if (Name === 'device_name') deviceName = Value;
attrs[Name] = Value;
}

Expand All @@ -72,6 +74,7 @@ const parseDevicesResponse = async (

return {
id,
name: deviceName,
attributes,
createDate: DeviceCreateDate
? new Date(DeviceCreateDate * 1000)
Expand Down
2 changes: 2 additions & 0 deletions packages/auth/src/providers/cognito/utils/signInHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
AuthAction,
assertTokenProviderConfig,
base64Encoder,
getDeviceName,
} from '@aws-amplify/core/internals/utils';

import { ClientMetadata, ConfirmSignInOptions } from '../types';
Expand Down Expand Up @@ -1072,6 +1073,7 @@ export async function getNewDeviceMetatada(
{ region: getRegion(userPoolId) },
{
AccessToken: accessToken,
DeviceName: await getDeviceName(),
DeviceKey: newDeviceMetadata?.DeviceKey,
DeviceSecretVerifierConfig: deviceSecretVerifierConfig,
},
Expand Down
10 changes: 5 additions & 5 deletions packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"test:size": "size-limit",
"build-with-test": "npm run clean && npm test && tsc && webpack -p",
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
"build:esm-cjs": "rollup -c rollup.config.mjs",
"build:esm-cjs": "rollup --forceExit -c rollup.config.mjs",
"build:watch": "npm run build:esm-cjs -- --watch",
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
"clean": "rimraf lib-esm lib dist",
Expand Down Expand Up @@ -293,7 +293,7 @@
"name": "[Analytics] record (Pinpoint)",
"path": "./dist/esm/analytics/index.mjs",
"import": "{ record }",
"limit": "17.02 kB"
"limit": "17.05 kB"
},
{
"name": "[Analytics] record (Kinesis)",
Expand All @@ -317,7 +317,7 @@
"name": "[Analytics] identifyUser (Pinpoint)",
"path": "./dist/esm/analytics/index.mjs",
"import": "{ identifyUser }",
"limit": "15.52 kB"
"limit": "15.53 kB"
},
{
"name": "[Analytics] enable",
Expand Down Expand Up @@ -383,7 +383,7 @@
"name": "[Auth] confirmSignIn (Cognito)",
"path": "./dist/esm/auth/index.mjs",
"import": "{ confirmSignIn }",
"limit": "28.10 kB"
"limit": "28.26 kB"
},
{
"name": "[Auth] updateMFAPreference (Cognito)",
Expand Down Expand Up @@ -449,7 +449,7 @@
"name": "[Auth] Basic Auth Flow (Cognito)",
"path": "./dist/esm/auth/index.mjs",
"import": "{ signIn, signOut, fetchAuthSession, confirmSignIn }",
"limit": "29.90 kB"
"limit": "30.06 kB"
},
{
"name": "[Auth] OAuth Auth Flow (Cognito)",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/__mocks__/configMocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This directory contains equivalent Gen1 & Gen2 configurations which are used to validate interoperability between
different config versions/schemas. Make sure that any updates applied to one are applied to the other.
Loading
Loading