@aws-amplify/adapter-nextjs 1.0.14 → 1.0.15-unstable.76af8d7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"createServerRunnerForAPI.js","sources":["../../../../src/api/createServerRunnerForAPI.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAGA,MAA+E,OAAA,GAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AAGxE,MAAM,wBAAwB,GAAG,CAAC,EACxC,MAAM,GAC8B,KAEjC;AACH,IAAA,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;IAE/C,OAAO;QACN,2BAA2B,EAAE,IAAA,OAAA,CAAA,iCAAiC,EAAC;AAC9D,YAAA,MAAM,EAAE,aAAa;SACrB,CAAC;AACF,QAAA,eAAe,EAAE,aAAa;KAC9B,CAAC;AACH,CAAC,CAAC;AAbW,OAAA,CAAA,wBAAwB,GAanC,wBAAA;;"}
1
+ {"version":3,"file":"createServerRunnerForAPI.js","sources":["../../../src/api/createServerRunnerForAPI.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createServerRunnerForAPI = void 0;\nconst utils_1 = require(\"../utils\");\nconst createServerRunnerForAPI = ({ config, }) => {\n const amplifyConfig = (0, utils_1.getAmplifyConfig)(config);\n return {\n runWithAmplifyServerContext: (0, utils_1.createRunWithAmplifyServerContext)({\n config: amplifyConfig,\n }),\n resourcesConfig: amplifyConfig,\n };\n};\nexports.createServerRunnerForAPI = createServerRunnerForAPI;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,wBAAwB,GAAG,KAAK,CAAC,CAAC;AAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,wBAAwB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK;AAClD,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAChE,IAAI,OAAO;AACX,QAAQ,2BAA2B,EAAE,IAAI,OAAO,CAAC,iCAAiC,EAAE;AACpF,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,QAAQ,eAAe,EAAE,aAAa;AACtC,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateServerClient.js","sources":["../../../../src/api/generateServerClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,MAA+E,WAAA,GAAA,OAAA,CAAA,4BAAA,CAAA,CAAA;AAC/E,MAAwD,QAAA,GAAA,OAAA,CAAA,wBAAA,CAAA,CAAA;AACxD,MAGkD,cAAA,GAAA,OAAA,CAAA,0CAAA,CAAA,CAAA;AAOlD,MAAsE,0BAAA,GAAA,OAAA,CAAA,4BAAA,CAAA,CAAA;AACtE,MAA4C,OAAA,GAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AAgB5C;;;;;;;;AAQG;AACH,SAAgB,gCAAgC,CAE9C,EACD,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACY,EAAA;AACrB,IAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;QAClC,MAAM,IAAI,wCAAyB,CAAC;AACnC,YAAA,OAAO,EACN,yHAAyH;;AAE1H,YAAA,kBAAkB,EACjB,+FAA+F;AAChG,SAAA,CAAC,CAAC;AACH,KAAA;AAED,IAAA,MAAM,EAAE,2BAA2B,EAAE,eAAe,EAAE,GACrD,IAAA,0BAAA,CAAA,wBAAwB,EAAC,EAAE,MAAM,EAAE,CAAC,CAAC;;;;IAKtC,MAAM,UAAU,GAAG,CAAC,EAAkC,KACrD,2BAA2B,CAAC;QAC3B,iBAAiB,EAAE,EAAE,OAAO,EAAE;AAC9B,QAAA,SAAS,EAAE,WAAW,IACrB,EAAE,CAAC,IAAA,cAAA,CAAA,uBAAuB,EAAC,WAAW,CAAC,CAAC,OAAO,CAAC;AACjD,KAAA,CAAC,CAAC;IAEJ,OAAO,IAAA,6CAAiC,EAA2B;AAClE,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,MAAM,EAAE,eAAe;QACvB,QAAQ;QACR,SAAS;AACT,KAAA,CAAC,CAAC;AACJ,CAAC;AArCD,OAqCC,CAAA,gCAAA,GAAA,gCAAA,CAAA;AAED;;;;;;;;;;;;;;;AAeG;AACH,SAAgB,+BAA+B,CAE7C,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAmB,EAAA;AACjD,IAAA,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,IAAA,uBAAc,EAAI;AACxB,QAAA,MAAM,EAAE,aAAa;QACrB,QAAQ;QACR,SAAS;AACT,KAAA,CAAC,CAAC;AACJ,CAAC;AATD,OASC,CAAA,+BAAA,GAAA,+BAAA;;"}
1
+ {"version":3,"file":"generateServerClient.js","sources":["../../../src/api/generateServerClient.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClientUsingReqRes = exports.generateServerClientUsingCookies = void 0;\nconst internals_1 = require(\"@aws-amplify/api/internals\");\nconst server_1 = require(\"aws-amplify/api/server\");\nconst adapter_core_1 = require(\"@aws-amplify/core/internals/adapter-core\");\nconst createServerRunnerForAPI_1 = require(\"./createServerRunnerForAPI\");\nconst utils_1 = require(\"../utils\");\n/**\n * Generates an API client that can be used inside a Next.js Server Component with Dynamic Rendering\n *\n * @example\n * import { cookies } from \"next/headers\"\n *\n * const client = generateServerClientUsingCookies({ cookies });\n * const result = await client.graphql({ query: listPosts });\n */\nfunction generateServerClientUsingCookies({ config, cookies, authMode, authToken, }) {\n if (typeof cookies !== 'function') {\n throw new adapter_core_1.AmplifyServerContextError({\n message: 'generateServerClientUsingCookies is only compatible with the `cookies` Dynamic Function available in Server Components.',\n // TODO: link to docs\n recoverySuggestion: 'use `generateServerClient` inside of `runWithAmplifyServerContext` with the `request` object.',\n });\n }\n const { runWithAmplifyServerContext, resourcesConfig } = (0, createServerRunnerForAPI_1.createServerRunnerForAPI)({ config });\n // This function reference gets passed down to InternalGraphQLAPI.ts.graphql\n // where this._graphql is passed in as the `fn` argument\n // causing it to always get invoked inside `runWithAmplifyServerContext`\n const getAmplify = (fn) => runWithAmplifyServerContext({\n nextServerContext: { cookies },\n operation: contextSpec => fn((0, adapter_core_1.getAmplifyServerContext)(contextSpec).amplify),\n });\n return (0, internals_1.generateClientWithAmplifyInstance)({\n amplify: getAmplify,\n config: resourcesConfig,\n authMode,\n authToken,\n });\n}\nexports.generateServerClientUsingCookies = generateServerClientUsingCookies;\n/**\n * Generates an API client that can be used with both Pages Router and App Router\n *\n * @example\n * import config from './amplifyconfiguration.json';\n * import { listPosts } from './graphql/queries';\n *\n * const client = generateServerClientUsingReqRes({ config });\n *\n * const result = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: (contextSpec) => client.graphql(contextSpec, {\n * query: listPosts,\n * }),\n * });\n */\nfunction generateServerClientUsingReqRes({ config, authMode, authToken }) {\n const amplifyConfig = (0, utils_1.getAmplifyConfig)(config);\n return (0, server_1.generateClient)({\n config: amplifyConfig,\n authMode,\n authToken,\n });\n}\nexports.generateServerClientUsingReqRes = generateServerClientUsingReqRes;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EA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QAAQ;AAChB,QAAQ,SAAS;AACjB,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,gCAAgC,GAAG,gCAAgC,CAAC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,+BAA+B,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;AAC1E,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAChE,IAAI,OAAO,IAAI,QAAQ,CAAC,cAAc,EAAE;AACxC,QAAQ,MAAM,EAAE,aAAa;AAC7B,QAAQ,QAAQ;AAChB,QAAQ,SAAS;AACjB,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,+BAA+B,GAAG,+BAA+B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/api/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,IAGgC,sBAAA,GAAA,OAAA,CAAA,wBAAA,CAAA,CAAA;AAF/B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iCAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,sBAAA,CAAA,+BAA+B,CAAA,EAAA,EAAA,CAAA,CAAA;AAC/B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kCAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,sBAAA,CAAA,gCAAgC,CAAA,EAAA,EAAA,CAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/api/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateServerClientUsingCookies = exports.generateServerClientUsingReqRes = void 0;\nvar generateServerClient_1 = require(\"./generateServerClient\");\nObject.defineProperty(exports, \"generateServerClientUsingReqRes\", { enumerable: true, get: function () { return generateServerClient_1.generateServerClientUsingReqRes; } });\nObject.defineProperty(exports, \"generateServerClientUsingCookies\", { enumerable: true, get: function () { return generateServerClient_1.generateServerClientUsingCookies; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gCAAgC,GAAG,OAAO,CAAC,+BAA+B,GAAG,KAAK,CAAC,CAAC;AAC5F,IAAI,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC/D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,iCAAiC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,+BAA+B,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7K,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kCAAkC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,sBAAsB,CAAC,gCAAgC,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createServerRunner.js","sources":["../../../src/createServerRunner.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAIA,MAA8E,OAAA,GAAA,OAAA,CAAA,SAAA,CAAA,CAAA;AAG9E;;;;;;;;;;;;;;;;;;AAkBG;AACI,MAAM,kBAAkB,GAAkC,CAAC,EACjE,MAAM,GACN,KAAI;AACJ,IAAA,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,MAAM,CAAC,CAAC;IAE/C,OAAO;QACN,2BAA2B,EAAE,IAAA,OAAA,CAAA,iCAAiC,EAAC;AAC9D,YAAA,MAAM,EAAE,aAAa;SACrB,CAAC;KACF,CAAC;AACH,CAAC,CAAC;AAVW,OAAA,CAAA,kBAAkB,GAU7B,kBAAA;;"}
1
+ {"version":3,"file":"createServerRunner.js","sources":["../../src/createServerRunner.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createServerRunner = void 0;\nconst utils_1 = require(\"./utils\");\n/**\n * Creates the `runWithAmplifyServerContext` function to run Amplify server side APIs in an isolated request context.\n *\n * @remarks\n * This function should be called only once; you can use the returned `runWithAmplifyServerContext` across\n * your codebase.\n *\n * @param input The input used to create the `runWithAmplifyServerContext` function.\n * @param input.config The {@link ResourcesConfig} imported from the `amplifyconfiguration.json` file or manually\n * created.\n * @returns An object that contains the `runWithAmplifyServerContext` function.\n *\n * @example\n * import { createServerRunner } from '@aws-amplify/adapter-nextjs';\n * import config from './amplifyconfiguration.json';\n *\n * export const { runWithAmplifyServerContext } = createServerRunner({ config })\n *\n */\nconst createServerRunner = ({ config, }) => {\n const amplifyConfig = (0, utils_1.getAmplifyConfig)(config);\n return {\n runWithAmplifyServerContext: (0, utils_1.createRunWithAmplifyServerContext)({\n config: amplifyConfig,\n }),\n };\n};\nexports.createServerRunner = createServerRunner;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK;AAC5C,IAAI,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAChE,IAAI,OAAO;AACX,QAAQ,2BAA2B,EAAE,IAAI,OAAO,CAAC,iCAAiC,EAAE;AACpF,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,KAAK,CAAC;AACN,CAAC,CAAC;AACF,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,IAA0D,oBAAA,GAAA,OAAA,CAAA,sBAAA,CAAA,CAAA;AAAjD,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,oBAAA,CAAA,kBAAkB,CAAA,EAAA,EAAA,CAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createServerRunner = void 0;\nvar createServerRunner_1 = require(\"./createServerRunner\");\nObject.defineProperty(exports, \"createServerRunner\", { enumerable: true, get: function () { return createServerRunner_1.createServerRunner; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACpC,IAAI,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAC3D,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,oBAAoB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"NextServer.js","sources":["../../../../src/types/NextServer.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;"}
1
+ {"version":3,"file":"NextServer.js","sources":["../../../src/types/NextServer.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/types/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/types/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createCookieStorageAdapterFromNextServerContext.js","sources":["../../../../src/utils/createCookieStorageAdapterFromNextServerContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,MAA2D,WAAA,GAAA,OAAA,CAAA,gBAAA,CAAA,CAAA;AAC3D,MAGkD,cAAA,GAAA,OAAA,CAAA,0CAAA,CAAA,CAAA;AAIrC,OAAA,CAAA,gBAAgB,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAErC,MAAM,+CAA+C,GAAG,CAC9D,OAA2B,KACD;IAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG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CAAW,QAAA,EAAA,OAAO,CAAC,WAAW,EAAE,CAAE,CAAA,CAAC,CAAC;AAC3D,KAAA;AACD,IAAA,IAAI,QAAQ,EAAE;AACb,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAA,QAAA,CAAU,CAAC,CAAC;AACnC,KAAA;AACD,IAAA,IAAI,QAAQ,EAAE;AACb,QAAA,iBAAiB,CAAC,IAAI,CAAC,YAAY,QAAQ,CAAA,CAAE,CAAC,CAAC;AAC/C,KAAA;AACD,IAAA,IAAI,MAAM,EAAE;AACX,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAA,MAAA,CAAQ,CAAC,CAAC;AACjC,KAAA;AAED,IAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,IAAY,KAC7C,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;;"}
1
+ {"version":3,"file":"createCookieStorageAdapterFromNextServerContext.js","sources":["../../../src/utils/createCookieStorageAdapterFromNextServerContext.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createCookieStorageAdapterFromNextServerContext = exports.DATE_IN_THE_PAST = void 0;\nconst server_js_1 = require(\"next/server.js\");\nconst adapter_core_1 = require(\"@aws-amplify/core/internals/adapter-core\");\nexports.DATE_IN_THE_PAST = new Date(0);\nconst createCookieStorageAdapterFromNextServerContext = (context) => {\n const { request: req, response: res } = context;\n // When the server context is from `getServerSideProps`, the `req` is an instance\n // of IncomingMessage, and the `res` is an instance of ServerResponse.\n // We cannot import these two classes here from `http` as it breaks in Next\n // Edge Runtime. Hence, we check the methods that we need to use for creating\n // cookie adapter.\n if (req &&\n res &&\n Object.prototype.toString.call(req.cookies) === '[object Object]' &&\n typeof res.setHeader === 'function') {\n return createCookieStorageAdapterFromGetServerSidePropsContext(req, res);\n }\n const { request, response } = context;\n // When the server context is from `middleware`, the `request` is an instance\n // of `NextRequest`.\n // When the server context is from a route handler, the `request` is an `Proxy`\n // wrapped `Request`.\n // The `NextRequest` and the `Proxy` are sharing the same interface by Next\n // implementation. So we don't need to detect the difference.\n if (request && response) {\n if (response instanceof server_js_1.NextResponse) {\n return createCookieStorageAdapterFromNextRequestAndNextResponse(request, response);\n }\n else {\n return createCookieStorageAdapterFromNextRequestAndHttpResponse(request, response);\n }\n }\n const { cookies } = context;\n if (typeof cookies === 'function') {\n return createCookieStorageAdapterFromNextCookies(cookies);\n }\n // This should not happen normally.\n throw new adapter_core_1.AmplifyServerContextError({\n message: 'Attempted to create cookie storage adapter from an unsupported Next.js server context.',\n });\n};\nexports.createCookieStorageAdapterFromNextServerContext = createCookieStorageAdapterFromNextServerContext;\nconst createCookieStorageAdapterFromNextRequestAndNextResponse = (request, response) => {\n const readonlyCookieStore = request.cookies;\n const mutableCookieStore = response.cookies;\n return {\n get(name) {\n return readonlyCookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: readonlyCookieStore.getAll.bind(readonlyCookieStore),\n set(name, value, options) {\n mutableCookieStore.set(ensureEncodedForJSCookie(name), value, options);\n },\n delete(name) {\n mutableCookieStore.delete(ensureEncodedForJSCookie(name));\n },\n };\n};\nconst createCookieStorageAdapterFromNextRequestAndHttpResponse = (request, response) => {\n const readonlyCookieStore = request.cookies;\n const mutableCookieStore = createMutableCookieStoreFromHeaders(response.headers);\n return {\n get(name) {\n return readonlyCookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: readonlyCookieStore.getAll.bind(readonlyCookieStore),\n ...mutableCookieStore,\n };\n};\nconst createCookieStorageAdapterFromNextCookies = (cookies) => {\n const cookieStore = cookies();\n // When Next cookies() is called in a server component, it returns a readonly\n // cookie store. Hence calling set and delete throws an error. However,\n // cookies() returns a mutable cookie store when called in a server action.\n // We have no way to detect which one is returned, so we try to call set and delete\n // and safely ignore the error if it is thrown.\n const setFunc = (name, value, options) => {\n try {\n cookieStore.set(ensureEncodedForJSCookie(name), value, options);\n }\n catch {\n // no-op\n }\n };\n const deleteFunc = name => {\n try {\n cookieStore.delete(ensureEncodedForJSCookie(name));\n }\n catch {\n // no-op\n }\n };\n return {\n get(name) {\n return cookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: cookieStore.getAll.bind(cookieStore),\n set: setFunc,\n delete: deleteFunc,\n };\n};\nconst createCookieStorageAdapterFromGetServerSidePropsContext = (request, response) => {\n const cookiesMap = { ...request.cookies };\n const allCookies = Object.entries(cookiesMap).map(([name, value]) => ({\n name,\n value,\n }));\n return {\n get(name) {\n const value = cookiesMap[ensureEncodedForJSCookie(name)];\n return value\n ? {\n name,\n value,\n }\n : undefined;\n },\n getAll() {\n return allCookies;\n },\n set(name, value, options) {\n response.setHeader('Set-Cookie', `${ensureEncodedForJSCookie(name)}=${value};${options ? serializeSetCookieOptions(options) : ''}`);\n },\n delete(name) {\n response.setHeader('Set-Cookie', `${ensureEncodedForJSCookie(name)}=;Expires=${exports.DATE_IN_THE_PAST.toUTCString()}`);\n },\n };\n};\nconst createMutableCookieStoreFromHeaders = (headers) => {\n const setFunc = (name, value, options) => {\n headers.append('Set-Cookie', `${ensureEncodedForJSCookie(name)}=${value};${options ? serializeSetCookieOptions(options) : ''}`);\n };\n const deleteFunc = name => {\n headers.append('Set-Cookie', `${ensureEncodedForJSCookie(name)}=;Expires=${exports.DATE_IN_THE_PAST.toUTCString()}`);\n };\n return {\n set: setFunc,\n delete: deleteFunc,\n };\n};\nconst serializeSetCookieOptions = (options) => {\n const { expires, domain, httpOnly, sameSite, secure } = options;\n const serializedOptions = [];\n if (domain) {\n serializedOptions.push(`Domain=${domain}`);\n }\n if (expires) {\n serializedOptions.push(`Expires=${expires.toUTCString()}`);\n }\n if (httpOnly) {\n serializedOptions.push(`HttpOnly`);\n }\n if (sameSite) {\n serializedOptions.push(`SameSite=${sameSite}`);\n }\n if (secure) {\n serializedOptions.push(`Secure`);\n }\n return serializedOptions.join(';');\n};\n// Ensures the cookie names are encoded in order to look up the cookie store\n// that is manipulated by js-cookie on the client side.\n// Details of the js-cookie encoding behavior see:\n// https://github.com/js-cookie/js-cookie#encoding\n// The implementation is borrowed from js-cookie without escaping `[()]` as\n// we are not using those chars in the auth keys.\nconst ensureEncodedForJSCookie = (name) => encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent);\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,+CAA+C,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAC5F,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAC;AAC3E,OAAO,CAAC,gBAAgB,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AACvC,MAAM,+CAA+C,GAAG,CAAC,OAAO,KAAK;AACrE,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,GAAG;AACX,QAAQ,GAAG;AACX,QAAQ,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,iBAAiB;AACzE,QAAQ,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,EAAE;AAC7C,QAAQ,OAAO,uDAAuD,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACjF,KAAK;AACL,IAAI,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CA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C,CAAC;AACnD,KAAK;AACL,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AACnE,KAAK;AACL,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3C,KAAK;AACL,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACvD,KAAK;AACL,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRunWithAmplifyServerContext.js","sources":["../../../../src/utils/createRunWithAmplifyServerContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,MAA2E,MAAA,GAAA,OAAA,CAAA,mBAAA,CAAA,CAAA;AAC3E,MAKkC,cAAA,GAAA,OAAA,CAAA,0BAAA,CAAA,CAAA;AAIlC,MAAoH,iDAAA,GAAA,OAAA,CAAA,mDAAA,CAAA,CAAA;AAE7G,MAAM,iCAAiC,GAAG,CAAC,EACjD,MAAM,EAAE,eAAe,GAGvB,KAAI;IACJ,MAAM,2BAA2B,GAChC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAI;;;QAG1C,IAAI,eAAe,CAAC,IAAI,EAAE;AACzB,YAAA,MAAM,eAAe;;;;;AAKpB,YAAA,iBAAiB,KAAK,IAAI;AACzB,kBAAE,MAAqB,CAAA,qBAAA;kBACrB,IAAA,cAAA,CAAA,6CAA6C,EAC7C,IAAA,iGAA+C,EAC9C,iBAAiB,CACjB,CACA,CAAC;YACN,MAAM,mBAAmB,GAAG,IAAA,cAAyC,CAAA,yCAAA,EACpE,eAAe,CAAC,IAAI,EACpB,eAAe,CACf,CAAC;YACF,MAAM,aAAa,GAAG,IAAA,cAA4B,CAAA,4BAAA,EACjD,eAAe,CAAC,IAAI,EACpB,eAAe,CACf,CAAC;AAEF,YAAA,OAAO,IAAA,cAAA,CAAA,2BAA+B,EACrC,eAAe,EACf;AACC,gBAAA,IAAI,EAAE,EAAE,mBAAmB,EAAE,aAAa,EAAE;aAC5C,EACD,SAAS,CACT,CAAC;AACF,SAAA;;;QAID,OAAO,IAAA,0CAA+B,EAAC,eAAe,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;AACxE,KAAC,CAAC;AAEH,IAAA,OAAO,2BAA2B,CAAC;AACpC,CAAC,CAAC;AA9CW,OAAA,CAAA,iCAAiC,GA8C5C,iCAAA;;"}
1
+ {"version":3,"file":"createRunWithAmplifyServerContext.js","sources":["../../../src/utils/createRunWithAmplifyServerContext.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createRunWithAmplifyServerContext = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst adapter_core_1 = require(\"aws-amplify/adapter-core\");\nconst createCookieStorageAdapterFromNextServerContext_1 = require(\"./createCookieStorageAdapterFromNextServerContext\");\nconst createRunWithAmplifyServerContext = ({ config: resourcesConfig, }) => {\n const runWithAmplifyServerContext = async ({ nextServerContext, operation }) => {\n // When the Auth config is presented, attempt to create a Amplify server\n // context with token and credentials provider.\n if (resourcesConfig.Auth) {\n const keyValueStorage = \n // When `null` is passed as the value of `nextServerContext`, opt-in\n // unauthenticated role (primarily for static rendering). It's\n // safe to use the singleton `MemoryKeyValueStorage` here, as the\n // static rendering uses the same unauthenticated role cross-sever.\n nextServerContext === null\n ? core_1.sharedInMemoryStorage\n : (0, adapter_core_1.createKeyValueStorageFromCookieStorageAdapter)((0, createCookieStorageAdapterFromNextServerContext_1.createCookieStorageAdapterFromNextServerContext)(nextServerContext));\n const credentialsProvider = (0, adapter_core_1.createAWSCredentialsAndIdentityIdProvider)(resourcesConfig.Auth, keyValueStorage);\n const tokenProvider = (0, adapter_core_1.createUserPoolsTokenProvider)(resourcesConfig.Auth, keyValueStorage);\n return (0, adapter_core_1.runWithAmplifyServerContext)(resourcesConfig, {\n Auth: { credentialsProvider, tokenProvider },\n }, operation);\n }\n // Otherwise it may be the case that auth is not used, e.g. API key.\n // Omitting the `Auth` in the second parameter.\n return (0, adapter_core_1.runWithAmplifyServerContext)(resourcesConfig, {}, operation);\n };\n return runWithAmplifyServerContext;\n};\nexports.createRunWithAmplifyServerContext = createRunWithAmplifyServerContext;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,KAAK,CAAC,CAAC;AACnD,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,cAAc,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC3D,MAAM,iDAAiD,GAAG,OAAO,CAAC,mDAAmD,CAAC,CAAC;AACvH,MAAM,iCAAiC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,KAAK;AAC5E,IAAI,MAAM,2BAA2B,GAAG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK;AACpF;AACA;AACA,QAAQ,IAAI,eAAe,CAAC,IAAI,EA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AALnB,OAAA,CAAA,gBAAgB,GAKG,gBAAA;;"}
1
+ {"version":3,"file":"getAmplifyConfig.js","sources":["../../../src/utils/getAmplifyConfig.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAmplifyConfig = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst getAmplifyConfig = (config) => Object.keys(config).some(key => key.startsWith('aws_'))\n ? (0, utils_1.parseAWSExports)(config)\n : config;\nexports.getAmplifyConfig = getAmplifyConfig;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAClC,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,gBAAgB,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5F,MAAM,IAAI,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC;AAC1C,MAAM,MAAM,CAAC;AACb,OAAO,CAAC,gBAAgB,GAAG,gBAAgB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/utils/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA,IAAsD,kBAAA,GAAA,OAAA,CAAA,oBAAA,CAAA,CAAA;AAA7C,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,kBAAA,CAAA,gBAAgB,CAAA,EAAA,EAAA,CAAA,CAAA;AACzB,IAAwF,mCAAA,GAAA,OAAA,CAAA,qCAAA,CAAA,CAAA;AAA/E,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mCAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,mCAAA,CAAA,iCAAiC,CAAA,EAAA,EAAA,CAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/utils/index.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createRunWithAmplifyServerContext = exports.getAmplifyConfig = void 0;\nvar getAmplifyConfig_1 = require(\"./getAmplifyConfig\");\nObject.defineProperty(exports, \"getAmplifyConfig\", { enumerable: true, get: function () { return getAmplifyConfig_1.getAmplifyConfig; } });\nvar createRunWithAmplifyServerContext_1 = require(\"./createRunWithAmplifyServerContext\");\nObject.defineProperty(exports, \"createRunWithAmplifyServerContext\", { enumerable: true, get: function () { return createRunWithAmplifyServerContext_1.createRunWithAmplifyServerContext; } });\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,iCAAiC,GAAG,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;AAC9E,IAAI,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACvD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,EAAE,CAAC,CAAC;AAC3I,IAAI,mCAAmC,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC;AACzF,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,mCAAmC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,mCAAmC,CAAC,iCAAiC,CAAC,EAAE,EAAE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createServerRunnerForAPI.mjs","sources":["../../../../src/api/createServerRunnerForAPI.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;MAMa,wBAAwB,GAAG,CAAC,EACxC,MAAM,GAC8B,KAEjC;AACH,IAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO;QACN,2BAA2B,EAAE,iCAAiC,CAAC;AAC9D,YAAA,MAAM,EAAE,aAAa;SACrB,CAAC;AACF,QAAA,eAAe,EAAE,aAAa;KAC9B,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"createServerRunnerForAPI.mjs","sources":["../../../src/api/createServerRunnerForAPI.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createRunWithAmplifyServerContext, getAmplifyConfig } from '../utils';\nexport const createServerRunnerForAPI = ({ config, }) => {\n const amplifyConfig = getAmplifyConfig(config);\n return {\n runWithAmplifyServerContext: createRunWithAmplifyServerContext({\n config: amplifyConfig,\n }),\n resourcesConfig: amplifyConfig,\n };\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAEY,MAAC,wBAAwB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK;AACzD,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACnD,IAAI,OAAO;AACX,QAAQ,2BAA2B,EAAE,iCAAiC,CAAC;AACvE,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,QAAQ,eAAe,EAAE,aAAa;AACtC,KAAK,CAAC;AACN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateServerClient.mjs","sources":["../../../../src/api/generateServerClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;AACA;AA+BA;;;;;;;;AAQG;AACG,SAAU,gCAAgC,CAE9C,EACD,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,GACY,EAAA;AACrB,IAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;QAClC,MAAM,IAAI,yBAAyB,CAAC;AACnC,YAAA,OAAO,EACN,yHAAyH;;AAE1H,YAAA,kBAAkB,EACjB,+FAA+F;AAChG,SAAA,CAAC,CAAC;AACH,KAAA;AAED,IAAA,MAAM,EAAE,2BAA2B,EAAE,eAAe,EAAE,GACrD,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;;;;IAKtC,MAAM,UAAU,GAAG,CAAC,EAAkC,KACrD,2BAA2B,CAAC;QAC3B,iBAAiB,EAAE,EAAE,OAAO,EAAE;AAC9B,QAAA,SAAS,EAAE,WAAW,IACrB,EAAE,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;AACjD,KAAA,CAAC,CAAC;AAEJ,IAAA,OAAO,iCAAiC,CAA2B;AAClE,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,MAAM,EAAE,eAAe;QACvB,QAAQ;QACR,SAAS;AACT,KAAA,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;AAeG;AACG,SAAU,+BAA+B,CAE7C,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAmB,EAAA;AACjD,IAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC/C,IAAA,OAAO,cAAc,CAAI;AACxB,QAAA,MAAM,EAAE,aAAa;QACrB,QAAQ;QACR,SAAS;AACT,KAAA,CAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"generateServerClient.mjs","sources":["../../../src/api/generateServerClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { generateClientWithAmplifyInstance } from '@aws-amplify/api/internals';\nimport { generateClient } from 'aws-amplify/api/server';\nimport { getAmplifyServerContext, AmplifyServerContextError, } from '@aws-amplify/core/internals/adapter-core';\nimport { createServerRunnerForAPI } from './createServerRunnerForAPI';\nimport { getAmplifyConfig } from '../utils';\n/**\n * Generates an API client that can be used inside a Next.js Server Component with Dynamic Rendering\n *\n * @example\n * import { cookies } from \"next/headers\"\n *\n * const client = generateServerClientUsingCookies({ cookies });\n * const result = await client.graphql({ query: listPosts });\n */\nexport function generateServerClientUsingCookies({ config, cookies, authMode, authToken, }) {\n if (typeof cookies !== 'function') {\n throw new AmplifyServerContextError({\n message: 'generateServerClientUsingCookies is only compatible with the `cookies` Dynamic Function available in Server Components.',\n // TODO: link to docs\n recoverySuggestion: 'use `generateServerClient` inside of `runWithAmplifyServerContext` with the `request` object.',\n });\n }\n const { runWithAmplifyServerContext, resourcesConfig } = createServerRunnerForAPI({ config });\n // This function reference gets passed down to InternalGraphQLAPI.ts.graphql\n // where this._graphql is passed in as the `fn` argument\n // causing it to always get invoked inside `runWithAmplifyServerContext`\n const getAmplify = (fn) => runWithAmplifyServerContext({\n nextServerContext: { cookies },\n operation: contextSpec => fn(getAmplifyServerContext(contextSpec).amplify),\n });\n return generateClientWithAmplifyInstance({\n amplify: getAmplify,\n config: resourcesConfig,\n authMode,\n authToken,\n });\n}\n/**\n * Generates an API client that can be used with both Pages Router and App Router\n *\n * @example\n * import config from './amplifyconfiguration.json';\n * import { listPosts } from './graphql/queries';\n *\n * const client = generateServerClientUsingReqRes({ config });\n *\n * const result = await runWithAmplifyServerContext({\n * nextServerContext: { request, response },\n * operation: (contextSpec) => client.graphql(contextSpec, {\n * query: listPosts,\n * }),\n * });\n */\nexport function generateServerClientUsingReqRes({ config, authMode, authToken }) {\n const amplifyConfig = getAmplifyConfig(config);\n return generateClient({\n config: amplifyConfig,\n authMode,\n authToken,\n });\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;A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createServerRunner.mjs","sources":["../../../src/createServerRunner.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;AAOA;;;;;;;;;;;;;;;;;;AAkBG;MACU,kBAAkB,GAAkC,CAAC,EACjE,MAAM,GACN,KAAI;AACJ,IAAA,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE/C,OAAO;QACN,2BAA2B,EAAE,iCAAiC,CAAC;AAC9D,YAAA,MAAM,EAAE,aAAa;SACrB,CAAC;KACF,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"createServerRunner.mjs","sources":["../../src/createServerRunner.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createRunWithAmplifyServerContext, getAmplifyConfig } from './utils';\n/**\n * Creates the `runWithAmplifyServerContext` function to run Amplify server side APIs in an isolated request context.\n *\n * @remarks\n * This function should be called only once; you can use the returned `runWithAmplifyServerContext` across\n * your codebase.\n *\n * @param input The input used to create the `runWithAmplifyServerContext` function.\n * @param input.config The {@link ResourcesConfig} imported from the `amplifyconfiguration.json` file or manually\n * created.\n * @returns An object that contains the `runWithAmplifyServerContext` function.\n *\n * @example\n * import { createServerRunner } from '@aws-amplify/adapter-nextjs';\n * import config from './amplifyconfiguration.json';\n *\n * export const { runWithAmplifyServerContext } = createServerRunner({ config })\n *\n */\nexport const createServerRunner = ({ config, }) => {\n const amplifyConfig = getAmplifyConfig(config);\n return {\n runWithAmplifyServerContext: createRunWithAmplifyServerContext({\n config: amplifyConfig,\n }),\n };\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK;AACnD,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACnD,IAAI,OAAO;AACX,QAAQ,2BAA2B,EAAE,iCAAiC,CAAC;AACvE,YAAY,MAAM,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,KAAK,CAAC;AACN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createCookieStorageAdapterFromNextServerContext.mjs","sources":["../../../../src/utils/createCookieStorageAdapterFromNextServerContext.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AACA;MAUa,gBAAgB,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE;AAE/B,MAAA,+CAA+C,GAAG,CAC9D,OAA2B,KACD;IAC1B,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GACpC,OAAwD,CAAC;;;;;;AAO1D,IAAA,IACC,GAAG;QACH,GAAG;AACH,QAAA,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,iBAAiB;AACjE,QAAA,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,EAClC;AACD,QAAA,OAAO,uDAAuD,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACzE,KAAA;AAED,IAAA,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAG7B,CAAC;;;;;;;IAQF,IAAI,OAAO,IAAI,QAAQ,EAAE;QACxB,IAAI,QAAQ,YAAY,YAAY,EAAE;AACrC,YAAA,OAAO,wDAAwD,CAC9D,OAAO,EACP,QAAQ,CACR,CAAC;AACF,SAAA;AAAM,aAAA;AACN,YAAA,OAAO,wDAAwD,CAC9D,OAAO,EACP,QAAQ,CACR,CAAC;AACF,SAAA;AACD,KAAA;AAED,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,OAEnB,CAAC;AAEF,IAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAClC,QAAA,OAAO,yCAAyC,CAAC,OAAO,CAAC,CAAC;AAC1D,KAAA;;IAGD,MAAM,IAAI,yB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,CACjC,OAAuC,KAC5B;AACX,IAAA,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAChE,MAAM,iBAAiB,GAAa,EAAE,CAAC;AACvC,IAAA,IAAI,MAAM,EAAE;AACX,QAAA,iBAAiB,CAAC,IAAI,CAAC,UAAU,MAAM,CAAA,CAAE,CAAC,CAAC;AAC3C,KAAA;AACD,IAAA,IAAI,OAAO,EAAE;QACZ,iBAAiB,CAAC,IAAI,CAAC,CAAW,QAAA,EAAA,OAAO,CAAC,WAAW,EAAE,CAAE,CAAA,CAAC,CAAC;AAC3D,KAAA;AACD,IAAA,IAAI,QAAQ,EAAE;AACb,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAA,QAAA,CAAU,CAAC,CAAC;AACnC,KAAA;AACD,IAAA,IAAI,QAAQ,EAAE;AACb,QAAA,iBAAiB,CAAC,IAAI,CAAC,YAAY,QAAQ,CAAA,CAAE,CAAC,CAAC;AAC/C,KAAA;AACD,IAAA,IAAI,MAAM,EAAE;AACX,QAAA,iBAAiB,CAAC,IAAI,CAAC,CAAA,MAAA,CAAQ,CAAC,CAAC;AACjC,KAAA;AAED,IAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,IAAY,KAC7C,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;;;;"}
1
+ {"version":3,"file":"createCookieStorageAdapterFromNextServerContext.mjs","sources":["../../../src/utils/createCookieStorageAdapterFromNextServerContext.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NextResponse } from 'next/server.js';\nimport { AmplifyServerContextError, } from '@aws-amplify/core/internals/adapter-core';\nexport const DATE_IN_THE_PAST = new Date(0);\nexport const createCookieStorageAdapterFromNextServerContext = (context) => {\n const { request: req, response: res } = context;\n // When the server context is from `getServerSideProps`, the `req` is an instance\n // of IncomingMessage, and the `res` is an instance of ServerResponse.\n // We cannot import these two classes here from `http` as it breaks in Next\n // Edge Runtime. Hence, we check the methods that we need to use for creating\n // cookie adapter.\n if (req &&\n res &&\n Object.prototype.toString.call(req.cookies) === '[object Object]' &&\n typeof res.setHeader === 'function') {\n return createCookieStorageAdapterFromGetServerSidePropsContext(req, res);\n }\n const { request, response } = context;\n // When the server context is from `middleware`, the `request` is an instance\n // of `NextRequest`.\n // When the server context is from a route handler, the `request` is an `Proxy`\n // wrapped `Request`.\n // The `NextRequest` and the `Proxy` are sharing the same interface by Next\n // implementation. So we don't need to detect the difference.\n if (request && response) {\n if (response instanceof NextResponse) {\n return createCookieStorageAdapterFromNextRequestAndNextResponse(request, response);\n }\n else {\n return createCookieStorageAdapterFromNextRequestAndHttpResponse(request, response);\n }\n }\n const { cookies } = context;\n if (typeof cookies === 'function') {\n return createCookieStorageAdapterFromNextCookies(cookies);\n }\n // This should not happen normally.\n throw new AmplifyServerContextError({\n message: 'Attempted to create cookie storage adapter from an unsupported Next.js server context.',\n });\n};\nconst createCookieStorageAdapterFromNextRequestAndNextResponse = (request, response) => {\n const readonlyCookieStore = request.cookies;\n const mutableCookieStore = response.cookies;\n return {\n get(name) {\n return readonlyCookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: readonlyCookieStore.getAll.bind(readonlyCookieStore),\n set(name, value, options) {\n mutableCookieStore.set(ensureEncodedForJSCookie(name), value, options);\n },\n delete(name) {\n mutableCookieStore.delete(ensureEncodedForJSCookie(name));\n },\n };\n};\nconst createCookieStorageAdapterFromNextRequestAndHttpResponse = (request, response) => {\n const readonlyCookieStore = request.cookies;\n const mutableCookieStore = createMutableCookieStoreFromHeaders(response.headers);\n return {\n get(name) {\n return readonlyCookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: readonlyCookieStore.getAll.bind(readonlyCookieStore),\n ...mutableCookieStore,\n };\n};\nconst createCookieStorageAdapterFromNextCookies = (cookies) => {\n const cookieStore = cookies();\n // When Next cookies() is called in a server component, it returns a readonly\n // cookie store. Hence calling set and delete throws an error. However,\n // cookies() returns a mutable cookie store when called in a server action.\n // We have no way to detect which one is returned, so we try to call set and delete\n // and safely ignore the error if it is thrown.\n const setFunc = (name, value, options) => {\n try {\n cookieStore.set(ensureEncodedForJSCookie(name), value, options);\n }\n catch {\n // no-op\n }\n };\n const deleteFunc = name => {\n try {\n cookieStore.delete(ensureEncodedForJSCookie(name));\n }\n catch {\n // no-op\n }\n };\n return {\n get(name) {\n return cookieStore.get(ensureEncodedForJSCookie(name));\n },\n getAll: cookieStore.getAll.bind(cookieStore),\n set: setFunc,\n delete: deleteFunc,\n };\n};\nconst createCookieStorageAdapterFromGetServerSidePropsContext = (request, response) => {\n const cookiesMap = { ...request.cookies };\n const allCookies = Object.entries(cookiesMap).map(([name, value]) => ({\n name,\n value,\n }));\n return {\n get(name) {\n const value = cookiesMap[ensureEncodedForJSCookie(name)];\n return value\n ? {\n name,\n value,\n }\n : undefined;\n },\n getAll() {\n return allCookies;\n },\n set(name, value, options) {\n response.setHeader('Set-Cookie', `${ensureEncodedForJSCookie(name)}=${value};${options ? serializeSetCookieOptions(options) : ''}`);\n },\n delete(name) {\n response.setHeader('Set-Cookie', `${ensureEncodedForJSCookie(name)}=;Expires=${DATE_IN_THE_PAST.toUTCString()}`);\n },\n };\n};\nconst createMutableCookieStoreFromHeaders = (headers) => {\n const setFunc = (name, value, options) => {\n headers.append('Set-Cookie', `${ensureEncodedForJSCookie(name)}=${value};${options ? serializeSetCookieOptions(options) : ''}`);\n };\n const deleteFunc = name => {\n headers.append('Set-Cookie', `${ensureEncodedForJSCookie(name)}=;Expires=${DATE_IN_THE_PAST.toUTCString()}`);\n };\n return {\n set: setFunc,\n delete: deleteFunc,\n };\n};\nconst serializeSetCookieOptions = (options) => {\n const { expires, domain, httpOnly, sameSite, secure } = options;\n const serializedOptions = [];\n if (domain) {\n serializedOptions.push(`Domain=${domain}`);\n }\n if (expires) {\n serializedOptions.push(`Expires=${expires.toUTCString()}`);\n }\n if (httpOnly) {\n serializedOptions.push(`HttpOnly`);\n }\n if (sameSite) {\n serializedOptions.push(`SameSite=${sameSite}`);\n }\n if (secure) {\n serializedOptions.push(`Secure`);\n }\n return serializedOptions.join(';');\n};\n// Ensures the cookie names are encoded in order to look up the cookie store\n// that is manipulated by js-cookie on the client side.\n// Details of the js-cookie encoding behavior see:\n// https://github.com/js-cookie/js-cookie#encoding\n// The implementation is borrowed from js-cookie without escaping `[()]` as\n// we are not using those chars in the auth keys.\nconst ensureEncodedForJSCookie = (name) => encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent);\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,gBAAgB,GAAG,IAAI,IAAI,CAAC,CAAC,EAAE;AAChC,MAAC,+CAA+C,GAAG,CAAC,OAAO,KAAK;AAC5E,IAAI,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,GAAG;AACX,QAAQ,GAAG;AACX,QAAQ,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,iBAAiB;AACzE,QAAQ,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU,EAAE;AAC7C,QAAQ,OAAO,uDAAuD,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AACjF,KAAK;AACL,IAAI,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,OAAO,IAAI,QAAQ,EAAE;AAC7B,QAAQ,IAAI,QAAQ,YAAY,YAAY,EAAE;AAC9C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,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3C,KAAK;AACL,IAAI,IAAI,QAAQ,EAAE;AAClB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AACvD,KAAK;AACL,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACzC,KAAK;AACL,IAAI,OAAO,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,wBAAwB,GAAG,CAAC,IAAI,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,kBAAkB,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRunWithAmplifyServerContext.mjs","sources":["../../../../src/utils/createRunWithAmplifyServerContext.ts"],"sourcesContent":[null],"names":["runWithAmplifyServerContext","runWithAmplifyServerContextCore"],"mappings":";;;;AAAA;AACA;AAca,MAAA,iCAAiC,GAAG,CAAC,EACjD,MAAM,EAAE,eAAe,GAGvB,KAAI;IACJ,MAAMA,6BAA2B,GAChC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAI;;;QAG1C,IAAI,eAAe,CAAC,IAAI,EAAE;AACzB,YAAA,MAAM,eAAe;;;;;AAKpB,YAAA,iBAAiB,KAAK,IAAI;AACzB,kBAAE,qBAAqB;kBACrB,6CAA6C,CAC7C,+CAA+C,CAC9C,iBAAiB,CACjB,CACA,CAAC;YACN,MAAM,mBAAmB,GAAG,yCAAyC,CACpE,eAAe,CAAC,IAAI,EACpB,eAAe,CACf,CAAC;YACF,MAAM,aAAa,GAAG,4BAA4B,CACjD,eAAe,CAAC,IAAI,EACpB,eAAe,CACf,CAAC;YAEF,OAAOC,2BAA+B,CACrC,eAAe,EACf;AACC,gBAAA,IAAI,EAAE,EAAE,mBAAmB,EAAE,aAAa,EAAE;aAC5C,EACD,SAAS,CACT,CAAC;AACF,SAAA;;;QAID,OAAOA,2BAA+B,CAAC,eAAe,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;AACxE,KAAC,CAAC;AAEH,IAAA,OAAOD,6BAA2B,CAAC;AACpC;;;;"}
1
+ {"version":3,"file":"createRunWithAmplifyServerContext.mjs","sources":["../../../src/utils/createRunWithAmplifyServerContext.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { sharedInMemoryStorage } from '@aws-amplify/core';\nimport { createAWSCredentialsAndIdentityIdProvider, createKeyValueStorageFromCookieStorageAdapter, createUserPoolsTokenProvider, runWithAmplifyServerContext as runWithAmplifyServerContextCore, } from 'aws-amplify/adapter-core';\nimport { createCookieStorageAdapterFromNextServerContext } from './createCookieStorageAdapterFromNextServerContext';\nexport const createRunWithAmplifyServerContext = ({ config: resourcesConfig, }) => {\n const runWithAmplifyServerContext = async ({ nextServerContext, operation }) => {\n // When the Auth config is presented, attempt to create a Amplify server\n // context with token and credentials provider.\n if (resourcesConfig.Auth) {\n const keyValueStorage = \n // When `null` is passed as the value of `nextServerContext`, opt-in\n // unauthenticated role (primarily for static rendering). It's\n // safe to use the singleton `MemoryKeyValueStorage` here, as the\n // static rendering uses the same unauthenticated role cross-sever.\n nextServerContext === null\n ? sharedInMemoryStorage\n : createKeyValueStorageFromCookieStorageAdapter(createCookieStorageAdapterFromNextServerContext(nextServerContext));\n const credentialsProvider = createAWSCredentialsAndIdentityIdProvider(resourcesConfig.Auth, keyValueStorage);\n const tokenProvider = createUserPoolsTokenProvider(resourcesConfig.Auth, keyValueStorage);\n return runWithAmplifyServerContextCore(resourcesConfig, {\n Auth: { credentialsProvider, tokenProvider },\n }, operation);\n }\n // Otherwise it may be the case that auth is not used, e.g. API key.\n // Omitting the `Auth` in the second parameter.\n return runWithAmplifyServerContextCore(resourcesConfig, {}, operation);\n };\n return runWithAmplifyServerContext;\n};\n"],"names":["runWithAmplifyServerContext","runWithAmplifyServerContextCore"],"mappings":";;;;AAAA;AACA;AAIY,MAAC,iCAAiC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,KAAK;AACnF,IAAI,MAAMA,6BAA2B,GAAG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK;AACpF;AACA;AACA,QAAQ,IAAI,eAAe,CAAC,IAAI,EAAE;AAClC,YAAY,MAAM,eAAe;AACjC;AACA;AACA;AACA;AACA,YAAY,iBAAiB,KAAK,IAAI;AACtC,kBAAkB,qBAAqB;AACvC,kBAAkB,6CAA6C,CAAC,+CAA+C,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACpI,YAAY,MAAM,mBAAmB,GAAG,yCAAyC,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACzH,YAAY,MAAM,aAAa,GAAG,4BAA4B,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACtG,YAAY,OAAOC,2BAA+B,CAAC,eAAe,EAAE;AACpE,gBAAgB,IAAI,EAAE,EAAE,mBAAmB,EAAE,aAAa,EAAE;AAC5D,aAAa,EAAE,SAAS,CAAC,CAAC;AAC1B,SAAS;AACT;AACA;AACA,QAAQ,OAAOA,2BAA+B,CAAC,eAAe,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC;AAC/E,KAAK,CAAC;AACN,IAAI,OAAOD,6BAA2B,CAAC;AACvC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getAmplifyConfig.mjs","sources":["../../../../src/utils/getAmplifyConfig.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;AAMO,MAAM,gBAAgB,GAAG,CAC/B,MAAsC,KAEtC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACtD,MAAE,eAAe,CAAC,MAAM,CAAC;MACtB;;;;"}
1
+ {"version":3,"file":"getAmplifyConfig.mjs","sources":["../../../src/utils/getAmplifyConfig.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { parseAWSExports } from '@aws-amplify/core/internals/utils';\nexport const getAmplifyConfig = (config) => Object.keys(config).some(key => key.startsWith('aws_'))\n ? parseAWSExports(config)\n : config;\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,gBAAgB,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;AACnG,MAAM,eAAe,CAAC,MAAM,CAAC;AAC7B,MAAM;;;;"}
package/package.json CHANGED
@@ -1,73 +1,74 @@
1
1
  {
2
- "author": "Amazon Web Services",
3
- "name": "@aws-amplify/adapter-nextjs",
4
- "version": "1.0.14",
5
- "description": "The adapter for the supporting of using Amplify APIs in Next.js.",
6
- "peerDependencies": {
7
- "aws-amplify": "^6.0.7",
8
- "next": ">=13.5.0 <15.0.0"
9
- },
10
- "dependencies": {
11
- "cookie": "0.5.0"
12
- },
13
- "devDependencies": {
14
- "@types/cookie": "0.5.1",
15
- "@types/node": "^20.3.1",
16
- "@types/react": "^18.2.13",
17
- "@types/react-dom": "^18.2.6",
18
- "aws-amplify": "6.0.14",
19
- "jest-fetch-mock": "3.0.3",
20
- "next": ">= 13.5.0 < 15.0.0"
21
- },
22
- "publishConfig": {
23
- "access": "public"
24
- },
25
- "bugs": {
26
- "url": "https://github.com/aws/aws-amplify/issues"
27
- },
28
- "exports": {
29
- ".": {
30
- "types": "./dist/esm/index.d.ts",
31
- "import": "./dist/esm/index.mjs",
32
- "require": "./dist/cjs/index.js"
33
- },
34
- "./api": {
35
- "types": "./dist/esm/api/index.d.ts",
36
- "import": "./dist/esm/api/index.mjs",
37
- "require": "./dist/cjs/api/index.js"
38
- },
39
- "./data": {
40
- "types": "./dist/esm/api/index.d.ts",
41
- "import": "./dist/esm/api/index.mjs",
42
- "require": "./dist/cjs/api/index.js"
43
- },
44
- "./package.json": "./package.json"
45
- },
46
- "files": [
47
- "dist/cjs",
48
- "dist/esm",
49
- "src",
50
- "api",
51
- "data"
52
- ],
53
- "homepage": "https://aws-amplify.github.io/",
54
- "license": "Apache-2.0",
55
- "main": "./dist/cjs/index.js",
56
- "module": "./dist/esm/index.mjs",
57
- "typings": "./dist/esm/index.d.ts",
58
- "sideEffects": false,
59
- "scripts": {
60
- "build": "npm run clean && npm run build:esm-cjs",
61
- "build-with-test": "npm test && npm run build",
62
- "build:esm-cjs": "rollup -c rollup.config.mjs",
63
- "build:watch": "npm run build:esm-cjs -- --watch",
64
- "clean": "npm run clean:size && rimraf dist",
65
- "clean:size": "rimraf dual-publish-tmp tmp*",
66
- "format": "echo \"Not implemented\"",
67
- "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
68
- "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
69
- "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
70
- "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
71
- },
72
- "gitHead": "ac07014b8a5bbf12f6e9188a6eb2f3f29cc3880c"
2
+ "author": "Amazon Web Services",
3
+ "name": "@aws-amplify/adapter-nextjs",
4
+ "version": "1.0.15-unstable.76af8d7.0+76af8d7",
5
+ "description": "The adapter for the supporting of using Amplify APIs in Next.js.",
6
+ "peerDependencies": {
7
+ "aws-amplify": "6.0.15-unstable.76af8d7.0+76af8d7",
8
+ "next": ">=13.5.0 <15.0.0"
9
+ },
10
+ "dependencies": {
11
+ "cookie": "0.5.0"
12
+ },
13
+ "devDependencies": {
14
+ "@types/cookie": "0.5.1",
15
+ "@types/node": "^20.3.1",
16
+ "@types/react": "^18.2.13",
17
+ "@types/react-dom": "^18.2.6",
18
+ "aws-amplify": "6.0.15-unstable.76af8d7.0+76af8d7",
19
+ "jest-fetch-mock": "3.0.3",
20
+ "next": ">= 13.5.0 < 15.0.0",
21
+ "typescript": "5.0.2"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/aws/aws-amplify/issues"
28
+ },
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/esm/index.d.ts",
32
+ "import": "./dist/esm/index.mjs",
33
+ "require": "./dist/cjs/index.js"
34
+ },
35
+ "./api": {
36
+ "types": "./dist/esm/api/index.d.ts",
37
+ "import": "./dist/esm/api/index.mjs",
38
+ "require": "./dist/cjs/api/index.js"
39
+ },
40
+ "./data": {
41
+ "types": "./dist/esm/api/index.d.ts",
42
+ "import": "./dist/esm/api/index.mjs",
43
+ "require": "./dist/cjs/api/index.js"
44
+ },
45
+ "./package.json": "./package.json"
46
+ },
47
+ "files": [
48
+ "dist/cjs",
49
+ "dist/esm",
50
+ "src",
51
+ "api",
52
+ "data"
53
+ ],
54
+ "homepage": "https://aws-amplify.github.io/",
55
+ "license": "Apache-2.0",
56
+ "main": "./dist/cjs/index.js",
57
+ "module": "./dist/esm/index.mjs",
58
+ "typings": "./dist/esm/index.d.ts",
59
+ "sideEffects": false,
60
+ "scripts": {
61
+ "build": "npm run clean && npm run build:esm-cjs",
62
+ "build-with-test": "npm test && npm run build",
63
+ "build:esm-cjs": "rollup -c rollup.config.mjs",
64
+ "build:watch": "npm run build:esm-cjs -- --watch",
65
+ "clean": "npm run clean:size && rimraf dist",
66
+ "clean:size": "rimraf dual-publish-tmp tmp*",
67
+ "format": "echo \"Not implemented\"",
68
+ "lint": "eslint '**/*.{ts,tsx}' && npm run ts-coverage",
69
+ "lint:fix": "eslint '**/*.{ts,tsx}' --fix",
70
+ "test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
71
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 90.31"
72
+ },
73
+ "gitHead": "76af8d7b1d2ebd25439e202d7aef568cc6902c56"
73
74
  }