File tree Expand file tree Collapse file tree
api-graphql/src/internals Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,13 +18,13 @@ const config = defineConfig([
1818 {
1919 input : input ,
2020 output : cjsOutput ,
21- plugins : [ typescript ( cjsTSOptions ) ] ,
21+ plugins : [ typescript ( { ... cjsTSOptions , noEmitOnError : false } ) ] ,
2222 } ,
2323 // ESM config
2424 {
2525 input : input ,
2626 output : esmOutput ,
27- plugins : [ typescript ( esmTSOptions ) ] ,
27+ plugins : [ typescript ( { ... esmTSOptions , noEmitOnError : false } ) ] ,
2828 } ,
2929] ) ;
3030
Original file line number Diff line number Diff line change @@ -8,3 +8,13 @@ export {
88export { graphql , cancel , isCancelError } from './v6' ;
99export { generateClient } from './generateClient' ;
1010export { CommonPublicClientOptions , DefaultCommonClientOptions } from './types' ;
11+
12+ import { generateClient as _generateClient } from './generateClient' ;
13+
14+ /** @deprecated Use generateClient instead. */
15+ export function generateClientWithAmplifyInstance <
16+ T extends Record < any , any > = never ,
17+ ClientType = any ,
18+ > ( ...args : any [ ] ) : ClientType {
19+ return ( _generateClient as any ) ( ...args ) ;
20+ }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export {
1111} from '@aws-amplify/api-graphql' ;
1212export {
1313 generateClient ,
14+ generateClientWithAmplifyInstance ,
1415 CommonPublicClientOptions ,
1516 DefaultCommonClientOptions ,
1617} from '@aws-amplify/api-graphql/internals' ;
Original file line number Diff line number Diff line change @@ -24,3 +24,12 @@ export {
2424 AUTH_KEY_PREFIX ,
2525} from '@aws-amplify/auth/cognito' ;
2626export { DEFAULT_AUTH_TOKEN_COOKIES_MAX_AGE } from './constants' ;
27+
28+ // Deprecated stub — kept for adapter-nextjs compilation until it migrates to configure()
29+
30+ /** @deprecated Will be removed once adapter-nextjs migrates to configure(). */
31+ export function runWithAmplifyServerContext ( _input : any ) : Promise < any > {
32+ throw new Error (
33+ 'runWithAmplifyServerContext is no longer supported. Use configure() to create an AmplifyContext instead.' ,
34+ ) ;
35+ }
Original file line number Diff line number Diff line change @@ -14,3 +14,33 @@ export {
1414 LegacyConfig ,
1515 AmplifyOutputsUnknown ,
1616} from '@aws-amplify/core/internals/utils' ;
17+
18+ // Deprecated stubs — kept for adapter-nextjs compilation until it migrates to configure()
19+
20+ /** @deprecated Will be removed once adapter-nextjs migrates to configure(). */
21+ export class AmplifyServerContextError extends Error {
22+ constructor ( params : { message : string ; recoverySuggestion ?: string } ) {
23+ super ( params . message ) ;
24+ this . name = 'AmplifyServerContextError' ;
25+ }
26+ }
27+
28+ /** @deprecated Will be removed once adapter-nextjs migrates to configure(). */
29+ export function getAmplifyServerContext ( _contextSpec : any ) : any {
30+ throw new AmplifyServerContextError ( {
31+ message :
32+ 'getAmplifyServerContext is no longer supported. Use configure() to create an AmplifyContext instead.' ,
33+ } ) ;
34+ }
35+
36+ /** @deprecated Will be removed once adapter-nextjs migrates to configure(). */
37+ export namespace AmplifyServer {
38+ export type ContextSpec = { token : { value : symbol } } ;
39+ export type ContextToken = { value : symbol } ;
40+ export interface RunOperationWithContext {
41+ < Result > ( input : {
42+ operation : ( contextSpec : ContextSpec ) => Result | Promise < Result > ;
43+ [ key : string ] : any ;
44+ } ) : Promise < Result > ;
45+ }
46+ }
Original file line number Diff line number Diff line change 66 V6ClientSSRCookies ,
77 V6ClientSSRRequest ,
88 generateClient ,
9+ generateClientWithAmplifyInstance ,
910 CommonPublicClientOptions ,
1011 DefaultCommonClientOptions ,
1112} from '@aws-amplify/api/internals' ;
You can’t perform that action at this time.
0 commit comments