From af32e6440e889d440f341204a5fba578a519b379 Mon Sep 17 00:00:00 2001 From: ManojNB Date: Thu, 5 Oct 2023 14:20:29 -0700 Subject: [PATCH 1/2] chore(config): add notifications exports file parsing (#12206) --- packages/core/__tests__/parseAWSExports.test.ts | 16 ++++++++++++++++ packages/core/src/parseAWSExports.ts | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) 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]; From f92387f5a7bb7bc8d041b685b5b49e6c6e56cdd9 Mon Sep 17 00:00:00 2001 From: AllanZhengYP Date: Thu, 5 Oct 2023 14:46:52 -0700 Subject: [PATCH 2/2] fix(aws-amplify): server export path (#12210) --- packages/aws-amplify/package.json | 8 ++++++++ 1 file changed, 8 insertions(+) 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" ],