Skip to content

Commit

Permalink
chore: Sync console-preview with next/main (#12211)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc authored Oct 5, 2023
2 parents 8637b15 + 68dd46e commit 7049e04
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/aws-amplify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
"import": "./lib-esm/api/index.js",
"require": "./lib/api/index.js"
},
"./api/server": {
"types": "./lib-esm/api/server.d.ts",
"import": "./lib-esm/api/server.js",
"require": "./lib/api/server.js"
},
"./datastore": {
"types": "./lib-esm/datastore/index.d.ts",
"import": "./lib-esm/datastore/index.js",
Expand Down Expand Up @@ -127,6 +132,9 @@
"api": [
"./lib-esm/api/index.d.ts"
],
"api/server": [
"./lib-esm/api/server.d.ts"
],
"utils": [
"./lib-esm/utils/index.d.ts"
],
Expand Down
16 changes: 16 additions & 0 deletions packages/core/__tests__/parseAWSExports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ describe('Parser', () => {
aws_appsync_apiKey: apiKey,
aws_appsync_region: region,
aws_appsync_authenticationType: 'AMAZON_COGNITO_USER_POOLS',
Notifications: {
InAppMessaging: {
AWSPinpoint: {
appId: appId,
region: region,
},
},
},
})
).toStrictEqual({
Analytics: {
Expand Down Expand Up @@ -129,6 +137,14 @@ describe('Parser', () => {
defaultAuthMode: 'userPool',
},
},
Notifications: {
InAppMessaging: {
Pinpoint: {
appId,
region,
},
},
},
});
});

Expand Down
16 changes: 16 additions & 0 deletions packages/core/src/parseAWSExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const parseAWSExports = (
geo,
oauth,
aws_cloud_logic_custom,
Notifications,
} = config;
const amplifyConfig: ResourcesConfig = {};

Expand All @@ -58,6 +59,21 @@ export const parseAWSExports = (
};
}

// Notifications
if (Notifications) {
if (Notifications.InAppMessaging?.AWSPinpoint) {
const { appId, region } = Notifications.InAppMessaging.AWSPinpoint;
amplifyConfig.Notifications = {
InAppMessaging: {
Pinpoint: {
appId,
region,
},
},
};
}
}

// API
if (aws_appsync_graphqlEndpoint) {
const defaultAuthMode = authTypeMapping[aws_appsync_authenticationType];
Expand Down

0 comments on commit 7049e04

Please sign in to comment.