From ae86aa227c673775f46a6d07f4497b28a41a51f5 Mon Sep 17 00:00:00 2001 From: David McAfee Date: Mon, 11 Sep 2023 11:15:09 -0700 Subject: [PATCH] add API dependency and exports to 'aws-amplify' package --- packages/aws-amplify/package.json | 16 ++++++++++++++++ packages/core/src/singleton/API/types.ts | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/aws-amplify/package.json b/packages/aws-amplify/package.json index 7f54446b014..e3fd49c9689 100644 --- a/packages/aws-amplify/package.json +++ b/packages/aws-amplify/package.json @@ -22,6 +22,11 @@ "import": "./lib-esm/auth/index.js", "require": "./lib/auth/index.js" }, + "./api": { + "types": "./lib-esm/api/index.d.ts", + "import": "./lib-esm/api/index.js", + "require": "./lib/api/index.js" + }, "./auth/cognito": { "types": "./lib-esm/auth/cognito/index.d.ts", "import": "./lib-esm/auth/cognito/index.js", @@ -74,6 +79,9 @@ "*": [ "./lib-esm/index.d.ts" ], + "api": [ + "./lib-esm/api/index.d.ts" + ], "utils": [ "./lib-esm/utils/index.d.ts" ], @@ -129,11 +137,13 @@ "lib-esm", "src", "analytics", + "api", "auth", "internals", "storage" ], "dependencies": { + "@aws-amplify/api": "6.0.0", "@aws-amplify/analytics": "7.0.0", "@aws-amplify/auth": "6.0.0", "@aws-amplify/core": "6.0.0", @@ -150,6 +160,12 @@ "import": "{ record }", "limit": "20.49 kB" }, + { + "name": "[API] [todo] (AppSync)", + "path": "./lib-esm/api/index.js", + "import": "{ record }", + "limit": "70.00 kB" + }, { "name": "[Analytics] identifyUser (Pinpoint)", "path": "./lib-esm/analytics/index.js", diff --git a/packages/core/src/singleton/API/types.ts b/packages/core/src/singleton/API/types.ts index 282f29d2d2e..d1cf72638cd 100644 --- a/packages/core/src/singleton/API/types.ts +++ b/packages/core/src/singleton/API/types.ts @@ -17,12 +17,12 @@ export type LibraryAPIOptions = { export type APIConfig = { AppSync?: { - defaultAuthMode: GraphQLAuthMode; - region: string; - endpoint: string; + defaultAuthMode?: GraphQLAuthMode; + region?: string; + endpoint?: string; // TODO: switch this when dependency is added: // modelIntrospectionSchema: InternalModelIntrospectionSchema; - modelIntrospectionSchema: any; + modelIntrospectionSchema?: any; }; };