Skip to content

Commit a9cfa0a

Browse files
committed
fix: resolve lint/prettier errors across all packages
1 parent 2bd7dad commit a9cfa0a

File tree

36 files changed

+150
-111
lines changed

36 files changed

+150
-111
lines changed

packages/adapter-nextjs/src/auth/utils/appendSetCookieHeaders.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import { CookieStorage } from 'aws-amplify/adapter-core';
4-
5-
import { serializeCookie } from 'aws-amplify/adapter-core';
3+
import { CookieStorage, serializeCookie } from 'aws-amplify/adapter-core';
64

75
export const appendSetCookieHeaders = (
86
headers: Headers,

packages/adapter-nextjs/src/auth/utils/appendSetCookieHeadersToNextApiResponse.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { NextApiResponse } from 'next';
5-
import { CookieStorage } from 'aws-amplify/adapter-core';
6-
7-
import { serializeCookie } from 'aws-amplify/adapter-core';
5+
import { CookieStorage, serializeCookie } from 'aws-amplify/adapter-core';
86

97
export const appendSetCookieHeadersToNextApiResponse = (
108
response: NextApiResponse,

packages/adapter-nextjs/src/auth/utils/authFlowProofCookies.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { CookieStorage } from 'aws-amplify/adapter-core';
4+
import { CookieStorage, isSSLOrigin } from 'aws-amplify/adapter-core';
55

66
import {
77
AUTH_FLOW_PROOF_MAX_AGE,
@@ -12,8 +12,6 @@ import {
1212
STATE_COOKIE_NAME,
1313
} from '../constant';
1414

15-
import { isSSLOrigin } from 'aws-amplify/adapter-core';
16-
1715
export const createSignInFlowProofCookies = ({
1816
state,
1917
pkce,

packages/adapter-nextjs/src/auth/utils/tokenCookies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
CookieStorage,
77
DEFAULT_AUTH_TOKEN_COOKIES_MAX_AGE,
88
createKeysForAuthStorage,
9+
isSSLOrigin,
910
} from 'aws-amplify/adapter-core';
1011

1112
import { OAuthTokenResponsePayload } from '../types';
@@ -15,7 +16,6 @@ import {
1516
} from '../constant';
1617

1718
import { getAccessTokenUsername } from './getAccessTokenUsername';
18-
import { isSSLOrigin } from 'aws-amplify/adapter-core';
1919

2020
export const createTokenCookies = ({
2121
tokensPayload,

packages/adapter-nextjs/src/utils/createCookieStorageAdapterFromNextServerContext.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import {
66
AmplifyServerContextError,
77
CookieStorage,
88
} from 'aws-amplify/adapter-core/internals';
9+
import {
10+
ensureEncodedForJSCookie,
11+
serializeCookie,
12+
} from 'aws-amplify/adapter-core';
913

1014
import { NextServer } from '../types';
1115
import { isServerSideAuthAllowedCookie } from '../auth/utils';
1216

13-
import { ensureEncodedForJSCookie, serializeCookie } from 'aws-amplify/adapter-core';
14-
1517
export const DATE_IN_THE_PAST = new Date(0);
1618

1719
export const createCookieStorageAdapterFromNextServerContext = async (

packages/api-graphql/src/Providers/AWSAppSyncRealTimeProvider/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { AmplifyContext } from '@aws-amplify/core';
5-
65
import {
76
CustomUserAgentDetails,
87
DocumentType,

packages/api-graphql/src/Providers/AWSWebSocketProvider/authHeaders.ts

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ type AWSAppSyncRealTimeAuthInput =
1717
host?: string | undefined;
1818
};
1919

20-
const awsAuthTokenHeader = async (ctx: AmplifyContext, { host }: AWSAppSyncRealTimeAuthInput) => {
20+
const awsAuthTokenHeader = async (
21+
ctx: AmplifyContext,
22+
{ host }: AWSAppSyncRealTimeAuthInput,
23+
) => {
2124
const session = await ctx.fetchAuthSession();
2225

2326
return {
@@ -26,10 +29,10 @@ const awsAuthTokenHeader = async (ctx: AmplifyContext, { host }: AWSAppSyncRealT
2629
};
2730
};
2831

29-
const awsRealTimeApiKeyHeader = async (_ctx: AmplifyContext, {
30-
apiKey,
31-
host,
32-
}: AWSAppSyncRealTimeAuthInput) => {
32+
const awsRealTimeApiKeyHeader = async (
33+
_ctx: AmplifyContext,
34+
{ apiKey, host }: AWSAppSyncRealTimeAuthInput,
35+
) => {
3336
const dt = new Date();
3437
const dtStr = dt.toISOString().replace(/[:-]|\.\d{3}/g, '');
3538

@@ -40,12 +43,15 @@ const awsRealTimeApiKeyHeader = async (_ctx: AmplifyContext, {
4043
};
4144
};
4245

43-
const awsRealTimeIAMHeader = async (ctx: AmplifyContext, {
44-
payload,
45-
canonicalUri,
46-
appSyncGraphqlEndpoint,
47-
region,
48-
}: AWSAppSyncRealTimeAuthInput) => {
46+
const awsRealTimeIAMHeader = async (
47+
ctx: AmplifyContext,
48+
{
49+
payload,
50+
canonicalUri,
51+
appSyncGraphqlEndpoint,
52+
region,
53+
}: AWSAppSyncRealTimeAuthInput,
54+
) => {
4955
const endpointInfo = {
5056
region,
5157
service: 'appsync',
@@ -77,10 +83,10 @@ const awsRealTimeIAMHeader = async (ctx: AmplifyContext, {
7783
return signedParams.headers;
7884
};
7985

80-
const customAuthHeader = async (_ctx: AmplifyContext, {
81-
host,
82-
additionalCustomHeaders,
83-
}: AWSAppSyncRealTimeAuthInput) => {
86+
const customAuthHeader = async (
87+
_ctx: AmplifyContext,
88+
{ host, additionalCustomHeaders }: AWSAppSyncRealTimeAuthInput,
89+
) => {
8490
/**
8591
* If `additionalHeaders` was provided to the subscription as a function,
8692
* the headers that are returned by that function will already have been
@@ -96,17 +102,18 @@ const customAuthHeader = async (_ctx: AmplifyContext, {
96102
};
97103
};
98104

99-
export const awsRealTimeHeaderBasedAuth = async (ctx: AmplifyContext, {
100-
apiKey,
101-
authenticationType,
102-
canonicalUri,
103-
appSyncGraphqlEndpoint,
104-
region,
105-
additionalCustomHeaders,
106-
payload,
107-
}: AWSAppSyncRealTimeAuthInput): Promise<
108-
Record<string, string | undefined> | undefined
109-
> => {
105+
export const awsRealTimeHeaderBasedAuth = async (
106+
ctx: AmplifyContext,
107+
{
108+
apiKey,
109+
authenticationType,
110+
canonicalUri,
111+
appSyncGraphqlEndpoint,
112+
region,
113+
additionalCustomHeaders,
114+
payload,
115+
}: AWSAppSyncRealTimeAuthInput,
116+
): Promise<Record<string, string | undefined> | undefined> => {
110117
const headerHandler = {
111118
apiKey: awsRealTimeApiKeyHeader,
112119
iam: awsRealTimeIAMHeader,

packages/api-graphql/src/Providers/AWSWebSocketProvider/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import { Observable, Subscription, SubscriptionLike } from 'rxjs';
44
import { GraphQLError } from 'graphql';
5-
import { AmplifyContext, ConsoleLogger, Hub, HubPayload } from '@aws-amplify/core';
5+
import {
6+
AmplifyContext,
7+
ConsoleLogger,
8+
Hub,
9+
HubPayload,
10+
} from '@aws-amplify/core';
611
import {
712
CustomUserAgentDetails,
813
DocumentType,

packages/api-graphql/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import * as events from './internals/events';
55

66
export { events };
77

8-
export { createGraphQLAPI, GraphQLAPIClass, graphqlOperation } from './GraphQLAPI';
8+
export {
9+
createGraphQLAPI,
10+
GraphQLAPIClass,
11+
graphqlOperation,
12+
} from './GraphQLAPI';
913
export * from './types';
1014

1115
export { CONNECTION_STATE_CHANGE } from './Providers/constants';

packages/api-graphql/src/internals/InternalGraphQLAPI.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class InternalGraphQLAPIClass {
5454
constructor(ctx: AmplifyContext) {
5555
this.ctx = ctx;
5656
}
57+
5758
/**
5859
* @private
5960
*/
@@ -397,7 +398,8 @@ export class InternalGraphQLAPIClass {
397398
// know why somethings depends on its absence!)
398399
const memoKey = appSyncGraphqlEndpoint ?? 'none';
399400
const realtimeProvider =
400-
this.appSyncRealTime.get(memoKey) ?? new AWSAppSyncRealTimeProvider(this.ctx);
401+
this.appSyncRealTime.get(memoKey) ??
402+
new AWSAppSyncRealTimeProvider(this.ctx);
401403
this.appSyncRealTime.set(memoKey, realtimeProvider);
402404

403405
return realtimeProvider
@@ -426,4 +428,5 @@ export class InternalGraphQLAPIClass {
426428
}
427429
}
428430

429-
export const createInternalGraphQLAPI = (ctx: AmplifyContext) => new InternalGraphQLAPIClass(ctx);
431+
export const createInternalGraphQLAPI = (ctx: AmplifyContext) =>
432+
new InternalGraphQLAPIClass(ctx);

0 commit comments

Comments
 (0)