diff --git a/packages/aws-amplify/package.json b/packages/aws-amplify/package.json index bb1f5d1a532..629cc8a69d0 100644 --- a/packages/aws-amplify/package.json +++ b/packages/aws-amplify/package.json @@ -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", @@ -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" ], diff --git a/packages/core/__tests__/parseAWSExports.test.ts b/packages/core/__tests__/parseAWSExports.test.ts index ad10286095a..8305afcf162 100644 --- a/packages/core/__tests__/parseAWSExports.test.ts +++ b/packages/core/__tests__/parseAWSExports.test.ts @@ -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: { @@ -129,6 +137,14 @@ describe('Parser', () => { defaultAuthMode: 'userPool', }, }, + Notifications: { + InAppMessaging: { + Pinpoint: { + appId, + region, + }, + }, + }, }); }); diff --git a/packages/core/src/parseAWSExports.ts b/packages/core/src/parseAWSExports.ts index eb8ac16137b..e1927b31b59 100644 --- a/packages/core/src/parseAWSExports.ts +++ b/packages/core/src/parseAWSExports.ts @@ -45,6 +45,7 @@ export const parseAWSExports = ( geo, oauth, aws_cloud_logic_custom, + Notifications, } = config; const amplifyConfig: ResourcesConfig = {}; @@ -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];