From f60474b4d7c0697bc513cf41a5be9569b9385196 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Tue, 27 Aug 2024 14:12:05 -0400 Subject: [PATCH] fix: lint --- api/src/graphql/generated/client/gql.ts | 9 ++----- api/src/graphql/generated/client/graphql.ts | 27 +++++++++++++------ api/src/graphql/mothership/subscriptions.ts | 17 ------------ .../graphql/resolvers/subscription/network.ts | 2 +- api/src/mothership/jobs/ping-timeout-jobs.ts | 2 +- api/src/mothership/subscribe-to-mothership.ts | 14 +++------- .../handlers/remote-access-interface.ts | 2 +- .../handlers/static-remote-access.ts | 2 +- .../handlers/upnp-remote-access.ts | 2 +- .../remoteAccess/remote-access-controller.ts | 7 +++-- .../store/modules/dynamic-remote-access.ts | 2 +- api/src/store/state-parsers/nginx.ts | 2 +- .../graph/connect/connect.resolver.spec.ts | 2 +- .../graph/connect/connect.resolver.ts | 2 -- .../graph/connect/connect.service.spec.ts | 2 +- .../graph/network/network.resolver.spec.ts | 2 +- .../graph/resolvers/cloud/cloud.resolver.ts | 2 +- .../notifications/notifications.resolver.ts | 5 +--- .../graph/services/services.resolver.spec.ts | 2 +- .../graph/shares/shares.resolver.spec.ts | 2 +- 20 files changed, 44 insertions(+), 63 deletions(-) diff --git a/api/src/graphql/generated/client/gql.ts b/api/src/graphql/generated/client/gql.ts index 0e2191f10..7ff96c0d5 100644 --- a/api/src/graphql/generated/client/gql.ts +++ b/api/src/graphql/generated/client/gql.ts @@ -15,8 +15,7 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document- const documents = { "\n mutation sendRemoteGraphQLResponse($input: RemoteGraphQLServerInput!) {\n remoteGraphQLResponse(input: $input)\n }\n": types.sendRemoteGraphQLResponseDocument, "\n fragment RemoteGraphQLEventFragment on RemoteGraphQLEvent {\n remoteGraphQLEventData: data {\n type\n body\n sha256\n }\n }\n": types.RemoteGraphQLEventFragmentFragmentDoc, - "\n fragment RemoteAccessEventFragment on RemoteAccessEvent {\n type\n data {\n type\n url {\n type\n name\n ipv4\n ipv6\n }\n apiKey\n }\n }\n": types.RemoteAccessEventFragmentFragmentDoc, - "\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteAccessEventFragment\n ...RemoteGraphQLEventFragment\n }\n }\n": types.eventsDocument, + "\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteGraphQLEventFragment\n }\n }\n": types.eventsDocument, }; /** @@ -44,11 +43,7 @@ export function graphql(source: "\n fragment RemoteGraphQLEventFragment on Re /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n fragment RemoteAccessEventFragment on RemoteAccessEvent {\n type\n data {\n type\n url {\n type\n name\n ipv4\n ipv6\n }\n apiKey\n }\n }\n"): (typeof documents)["\n fragment RemoteAccessEventFragment on RemoteAccessEvent {\n type\n data {\n type\n url {\n type\n name\n ipv4\n ipv6\n }\n apiKey\n }\n }\n"]; -/** - * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. - */ -export function graphql(source: "\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteAccessEventFragment\n ...RemoteGraphQLEventFragment\n }\n }\n"): (typeof documents)["\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteAccessEventFragment\n ...RemoteGraphQLEventFragment\n }\n }\n"]; +export function graphql(source: "\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteGraphQLEventFragment\n }\n }\n"): (typeof documents)["\n subscription events {\n events {\n __typename\n ... on ClientConnectedEvent {\n connectedData: data {\n type\n version\n apiKey\n }\n connectedEvent: type\n }\n ... on ClientDisconnectedEvent {\n disconnectedData: data {\n type\n version\n apiKey\n }\n disconnectedEvent: type\n }\n ...RemoteGraphQLEventFragment\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/api/src/graphql/generated/client/graphql.ts b/api/src/graphql/generated/client/graphql.ts index b223f0238..81b99a682 100644 --- a/api/src/graphql/generated/client/graphql.ts +++ b/api/src/graphql/generated/client/graphql.ts @@ -468,6 +468,7 @@ export type Query = { ksServers: Array; online?: Maybe; remoteQuery: Scalars['String']['output']; + serverStatus: ServerStatusResponse; servers: Array>; status?: Maybe; }; @@ -482,6 +483,11 @@ export type QueryremoteQueryArgs = { input: RemoteGraphQLClientInput; }; + +export type QueryserverStatusArgs = { + apiKey: Scalars['String']['input']; +}; + export enum RegistrationState { /** Basic */ BASIC = 'BASIC', @@ -554,6 +560,10 @@ export type RemoteAccessInput = { export type RemoteGraphQLClientInput = { apiKey: Scalars['String']['input']; body: Scalars['String']['input']; + /** Time in milliseconds to wait for a response from the remote server (defaults to 15000) */ + timeout?: InputMaybe; + /** How long mothership should cache the result of this query in seconds, only valid on queries */ + ttl?: InputMaybe; }; export type RemoteGraphQLEvent = { @@ -621,6 +631,13 @@ export enum ServerStatus { ONLINE = 'online' } +export type ServerStatusResponse = { + __typename?: 'ServerStatusResponse'; + id: Scalars['ID']['output']; + lastPublish?: Maybe; + online: Scalars['Boolean']['output']; +}; + export type Service = { __typename?: 'Service'; name?: Maybe; @@ -718,20 +735,14 @@ export type sendRemoteGraphQLResponseMutation = { __typename?: 'Mutation', remot export type RemoteGraphQLEventFragmentFragment = { __typename?: 'RemoteGraphQLEvent', remoteGraphQLEventData: { __typename?: 'RemoteGraphQLEventData', type: RemoteGraphQLEventType, body: string, sha256: string } } & { ' $fragmentName'?: 'RemoteGraphQLEventFragmentFragment' }; -export type RemoteAccessEventFragmentFragment = { __typename?: 'RemoteAccessEvent', type: EventType, data: { __typename?: 'RemoteAccessEventData', type: RemoteAccessEventActionType, apiKey: string, url?: { __typename?: 'AccessUrl', type: URL_TYPE, name?: string | null, ipv4?: URL | null, ipv6?: URL | null } | null } } & { ' $fragmentName'?: 'RemoteAccessEventFragmentFragment' }; - export type eventsSubscriptionVariables = Exact<{ [key: string]: never; }>; -export type eventsSubscription = { __typename?: 'Subscription', events?: Array<{ __typename: 'ClientConnectedEvent', connectedEvent: EventType, connectedData: { __typename?: 'ClientConnectionEventData', type: ClientType, version: string, apiKey: string } } | { __typename: 'ClientDisconnectedEvent', disconnectedEvent: EventType, disconnectedData: { __typename?: 'ClientConnectionEventData', type: ClientType, version: string, apiKey: string } } | { __typename: 'ClientPingEvent' } | ( - { __typename: 'RemoteAccessEvent' } - & { ' $fragmentRefs'?: { 'RemoteAccessEventFragmentFragment': RemoteAccessEventFragmentFragment } } - ) | ( +export type eventsSubscription = { __typename?: 'Subscription', events?: Array<{ __typename: 'ClientConnectedEvent', connectedEvent: EventType, connectedData: { __typename?: 'ClientConnectionEventData', type: ClientType, version: string, apiKey: string } } | { __typename: 'ClientDisconnectedEvent', disconnectedEvent: EventType, disconnectedData: { __typename?: 'ClientConnectionEventData', type: ClientType, version: string, apiKey: string } } | { __typename: 'ClientPingEvent' } | { __typename: 'RemoteAccessEvent' } | ( { __typename: 'RemoteGraphQLEvent' } & { ' $fragmentRefs'?: { 'RemoteGraphQLEventFragmentFragment': RemoteGraphQLEventFragmentFragment } } ) | { __typename: 'UpdateEvent' }> | null }; export const RemoteGraphQLEventFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteGraphQLEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteGraphQLEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"remoteGraphQLEventData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"sha256"}}]}}]}}]} as unknown as DocumentNode; -export const RemoteAccessEventFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteAccessEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteAccessEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"url"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ipv4"}},{"kind":"Field","name":{"kind":"Name","value":"ipv6"}}]}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}}]}}]} as unknown as DocumentNode; export const sendRemoteGraphQLResponseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"sendRemoteGraphQLResponse"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteGraphQLServerInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"remoteGraphQLResponse"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode; -export const eventsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"events"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"events"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ClientConnectedEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"connectedData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"connectedEvent"},"name":{"kind":"Name","value":"type"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ClientDisconnectedEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"disconnectedData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"disconnectedEvent"},"name":{"kind":"Name","value":"type"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"RemoteAccessEventFragment"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"RemoteGraphQLEventFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteAccessEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteAccessEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"url"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ipv4"}},{"kind":"Field","name":{"kind":"Name","value":"ipv6"}}]}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteGraphQLEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteGraphQLEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"remoteGraphQLEventData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"sha256"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const eventsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"events"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"events"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ClientConnectedEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"connectedData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"connectedEvent"},"name":{"kind":"Name","value":"type"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ClientDisconnectedEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"disconnectedData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"version"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"disconnectedEvent"},"name":{"kind":"Name","value":"type"}}]}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"RemoteGraphQLEventFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RemoteGraphQLEventFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RemoteGraphQLEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"remoteGraphQLEventData"},"name":{"kind":"Name","value":"data"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"body"}},{"kind":"Field","name":{"kind":"Name","value":"sha256"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/api/src/graphql/mothership/subscriptions.ts b/api/src/graphql/mothership/subscriptions.ts index c6ff713d3..aec02952a 100644 --- a/api/src/graphql/mothership/subscriptions.ts +++ b/api/src/graphql/mothership/subscriptions.ts @@ -10,22 +10,6 @@ export const RemoteGraphQL_Fragment = graphql(/* GraphQL */ ` } `); -export const RemoteAccess_Fragment = graphql(/* GraphQL */ ` - fragment RemoteAccessEventFragment on RemoteAccessEvent { - type - data { - type - url { - type - name - ipv4 - ipv6 - } - apiKey - } - } -`); - export const EVENTS_SUBSCRIPTION = graphql(/* GraphQL */ ` subscription events { events { @@ -46,7 +30,6 @@ export const EVENTS_SUBSCRIPTION = graphql(/* GraphQL */ ` } disconnectedEvent: type } - ...RemoteAccessEventFragment ...RemoteGraphQLEventFragment } } diff --git a/api/src/graphql/resolvers/subscription/network.ts b/api/src/graphql/resolvers/subscription/network.ts index de1d21488..e635e7438 100644 --- a/api/src/graphql/resolvers/subscription/network.ts +++ b/api/src/graphql/resolvers/subscription/network.ts @@ -8,7 +8,7 @@ import { logger } from '@app/core'; import { AccessUrlInputSchema, } from '@app/graphql/generated/client/validators'; -import { AccessUrl } from '@app/graphql/generated/api/types'; +import { type AccessUrl } from '@app/graphql/generated/api/types'; interface UrlForFieldInput { url: string; diff --git a/api/src/mothership/jobs/ping-timeout-jobs.ts b/api/src/mothership/jobs/ping-timeout-jobs.ts index 531444ecc..c197350a1 100644 --- a/api/src/mothership/jobs/ping-timeout-jobs.ts +++ b/api/src/mothership/jobs/ping-timeout-jobs.ts @@ -1,4 +1,4 @@ -import { KEEP_ALIVE_INTERVAL_MS, ONE_MINUTE_MS, TEN_MINUTES_MS } from '@app/consts'; +import { KEEP_ALIVE_INTERVAL_MS, ONE_MINUTE_MS } from '@app/consts'; import { minigraphLogger, mothershipLogger, remoteAccessLogger } from '@app/core/log'; import { DynamicRemoteAccessType, MinigraphStatus } from '@app/graphql/generated/api/types'; import { isAPIStateDataFullyLoaded } from '@app/mothership/graphql-client'; diff --git a/api/src/mothership/subscribe-to-mothership.ts b/api/src/mothership/subscribe-to-mothership.ts index a2731df45..cf477467d 100644 --- a/api/src/mothership/subscribe-to-mothership.ts +++ b/api/src/mothership/subscribe-to-mothership.ts @@ -5,7 +5,6 @@ import { store } from '@app/store'; import { EVENTS_SUBSCRIPTION, - RemoteAccess_Fragment, RemoteGraphQL_Fragment, } from '@app/graphql/mothership/subscriptions'; @@ -36,7 +35,10 @@ export const subscribeToEvents = async (apiKey: string) => { errors.join(',') ); } else if (data) { - mothershipLogger.trace({ events: data.events }, 'Got events from mothership'); + mothershipLogger.trace( + { events: data.events }, + 'Got events from mothership' + ); for (const event of data.events?.filter(notNull) ?? []) { switch (event.__typename) { @@ -69,10 +71,6 @@ export const subscribeToEvents = async (apiKey: string) => { break; } - case 'RemoteAccessEvent': { - break; - } - case 'RemoteGraphQLEvent': { const eventAsRemoteGraphQLEvent = useFragment( RemoteGraphQL_Fragment, @@ -86,10 +84,6 @@ export const subscribeToEvents = async (apiKey: string) => { break; } - case 'UpdateEvent': { - break; - } - default: break; } diff --git a/api/src/remoteAccess/handlers/remote-access-interface.ts b/api/src/remoteAccess/handlers/remote-access-interface.ts index 4902ac6ca..217e92207 100644 --- a/api/src/remoteAccess/handlers/remote-access-interface.ts +++ b/api/src/remoteAccess/handlers/remote-access-interface.ts @@ -1,4 +1,4 @@ -import { AccessUrl } from '@app/graphql/generated/api/types'; +import { type AccessUrl } from '@app/graphql/generated/api/types'; import { type AppDispatch, type RootState } from '@app/store/index'; export interface GenericRemoteAccess { diff --git a/api/src/remoteAccess/handlers/static-remote-access.ts b/api/src/remoteAccess/handlers/static-remote-access.ts index ce8bf8005..a379b470a 100644 --- a/api/src/remoteAccess/handlers/static-remote-access.ts +++ b/api/src/remoteAccess/handlers/static-remote-access.ts @@ -1,6 +1,6 @@ import { remoteAccessLogger } from '@app/core/log'; -import { AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; +import { type AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; import { getServerIps } from '@app/graphql/resolvers/subscription/network'; import { type GenericRemoteAccess } from '@app/remoteAccess/handlers/remote-access-interface'; import { setWanAccessAndReloadNginx } from '@app/store/actions/set-wan-access-with-reload'; diff --git a/api/src/remoteAccess/handlers/upnp-remote-access.ts b/api/src/remoteAccess/handlers/upnp-remote-access.ts index 70dcb84ae..d0d107841 100644 --- a/api/src/remoteAccess/handlers/upnp-remote-access.ts +++ b/api/src/remoteAccess/handlers/upnp-remote-access.ts @@ -1,5 +1,5 @@ import { remoteAccessLogger } from '@app/core/log'; -import { AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; +import { type AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; import { getServerIps } from '@app/graphql/resolvers/subscription/network'; import { type GenericRemoteAccess } from '@app/remoteAccess/handlers/remote-access-interface'; diff --git a/api/src/remoteAccess/remote-access-controller.ts b/api/src/remoteAccess/remote-access-controller.ts index 71a21db25..dc0aa8b86 100644 --- a/api/src/remoteAccess/remote-access-controller.ts +++ b/api/src/remoteAccess/remote-access-controller.ts @@ -1,6 +1,9 @@ import { remoteAccessLogger } from '@app/core/log'; import { UnraidLocalNotifier } from '@app/core/notifiers/unraid-local'; -import { AccessUrl, DynamicRemoteAccessType } from '@app/graphql/generated/api/types'; +import { + type AccessUrl, + DynamicRemoteAccessType, +} from '@app/graphql/generated/api/types'; import { type IRemoteAccessController } from '@app/remoteAccess/handlers/remote-access-interface'; import { StaticRemoteAccess } from '@app/remoteAccess/handlers/static-remote-access'; import { UpnpRemoteAccess } from '@app/remoteAccess/handlers/upnp-remote-access'; @@ -52,7 +55,7 @@ export class RemoteAccessController implements IRemoteAccessController { const state = getState(); const { config: { - remote: { dynamicRemoteAccessType, apikey }, + remote: { dynamicRemoteAccessType }, }, dynamicRemoteAccess: { runningType }, } = state; diff --git a/api/src/store/modules/dynamic-remote-access.ts b/api/src/store/modules/dynamic-remote-access.ts index e991ae4f5..1f87448f5 100644 --- a/api/src/store/modules/dynamic-remote-access.ts +++ b/api/src/store/modules/dynamic-remote-access.ts @@ -1,5 +1,5 @@ import { remoteAccessLogger } from '@app/core/log'; -import { AccessUrlInput, AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; +import { type AccessUrlInput, type AccessUrl, DynamicRemoteAccessType, URL_TYPE } from '@app/graphql/generated/api/types'; import { createSlice, type PayloadAction } from '@reduxjs/toolkit'; interface DynamicRemoteAccessState { diff --git a/api/src/store/state-parsers/nginx.ts b/api/src/store/state-parsers/nginx.ts index 0303017b5..d38582892 100644 --- a/api/src/store/state-parsers/nginx.ts +++ b/api/src/store/state-parsers/nginx.ts @@ -1,5 +1,5 @@ import type { IniStringBooleanOrAuto } from '@app/core/types/ini'; -import { FqdnEntry } from '@app/core/types/states/nginx'; +import { type FqdnEntry } from '@app/core/types/states/nginx'; import type { StateFileToIniParserMap } from '@app/store/types'; // Allow upper or lowercase FQDN6 diff --git a/api/src/unraid-api/graph/connect/connect.resolver.spec.ts b/api/src/unraid-api/graph/connect/connect.resolver.spec.ts index 70d065b45..5b33bd049 100644 --- a/api/src/unraid-api/graph/connect/connect.resolver.spec.ts +++ b/api/src/unraid-api/graph/connect/connect.resolver.spec.ts @@ -1,4 +1,4 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test, type TestingModule } from '@nestjs/testing'; import { ConnectResolver } from './connect.resolver'; describe('ConnectResolver', () => { diff --git a/api/src/unraid-api/graph/connect/connect.resolver.ts b/api/src/unraid-api/graph/connect/connect.resolver.ts index bfeb9882b..411da0a40 100644 --- a/api/src/unraid-api/graph/connect/connect.resolver.ts +++ b/api/src/unraid-api/graph/connect/connect.resolver.ts @@ -5,7 +5,6 @@ import { GraphQLError } from 'graphql'; import { UseRoles } from 'nest-access-control'; import { RemoteAccessController } from '@app/remoteAccess/remote-access-controller'; import { - Connect, ConnectResolvers, type DynamicRemoteAccessStatus, DynamicRemoteAccessType, @@ -13,7 +12,6 @@ import { } from '@app/graphql/generated/api/types'; import { setAllowedRemoteAccessUrl, - setRemoteAccessRunningType, } from '@app/store/modules/dynamic-remote-access'; import { getServerIdentifier } from '@app/core/utils/server-identifier'; diff --git a/api/src/unraid-api/graph/connect/connect.service.spec.ts b/api/src/unraid-api/graph/connect/connect.service.spec.ts index 440eb245e..27815083b 100644 --- a/api/src/unraid-api/graph/connect/connect.service.spec.ts +++ b/api/src/unraid-api/graph/connect/connect.service.spec.ts @@ -1,4 +1,4 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test, type TestingModule } from '@nestjs/testing'; import { ConnectService } from './connect.service'; describe('ConnectService', () => { diff --git a/api/src/unraid-api/graph/network/network.resolver.spec.ts b/api/src/unraid-api/graph/network/network.resolver.spec.ts index 7ae4aeab5..4f4b51f46 100644 --- a/api/src/unraid-api/graph/network/network.resolver.spec.ts +++ b/api/src/unraid-api/graph/network/network.resolver.spec.ts @@ -1,4 +1,4 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test, type TestingModule } from '@nestjs/testing'; import { NetworkResolver } from './network.resolver'; describe('NetworkResolver', () => { diff --git a/api/src/unraid-api/graph/resolvers/cloud/cloud.resolver.ts b/api/src/unraid-api/graph/resolvers/cloud/cloud.resolver.ts index 2d35562b6..93f664573 100644 --- a/api/src/unraid-api/graph/resolvers/cloud/cloud.resolver.ts +++ b/api/src/unraid-api/graph/resolvers/cloud/cloud.resolver.ts @@ -18,7 +18,7 @@ import { checkMinigraphql } from '@app/graphql/resolvers/query/cloud/check-minig import { setupRemoteAccessThunk } from '@app/store/actions/setup-remote-access'; import { getters, store } from '@app/store/index'; import { logoutUser } from '@app/store/modules/config'; -import { Args, Mutation, Query, Resolver, Subscription } from '@nestjs/graphql'; +import { Args, Mutation, Query, Resolver } from '@nestjs/graphql'; import { UseRoles } from 'nest-access-control'; @Resolver('Cloud') diff --git a/api/src/unraid-api/graph/resolvers/notifications/notifications.resolver.ts b/api/src/unraid-api/graph/resolvers/notifications/notifications.resolver.ts index ea56bf09a..bba4c2fe6 100644 --- a/api/src/unraid-api/graph/resolvers/notifications/notifications.resolver.ts +++ b/api/src/unraid-api/graph/resolvers/notifications/notifications.resolver.ts @@ -1,16 +1,13 @@ import { type NotificationFilter } from '@app/graphql/generated/api/types'; import { getters } from '@app/store/index'; -import { Query, Resolver, Args, Mutation, Subscription } from '@nestjs/graphql'; +import { Query, Resolver, Args, Subscription } from '@nestjs/graphql'; import { GraphQLError } from 'graphql'; import { UseRoles } from 'nest-access-control'; import { Logger } from '@nestjs/common'; -import { type NotificationInput } from '@app/graphql/generated/client/graphql'; -import { GraphQLClient } from '@app/mothership/graphql-client'; import { PUBSUB_CHANNEL, createSubscription } from '@app/core/pubsub'; @Resolver() export class NotificationsResolver { - private logger = new Logger(NotificationsResolver.name); @Query() @UseRoles({ resource: 'notifications', diff --git a/api/src/unraid-api/graph/services/services.resolver.spec.ts b/api/src/unraid-api/graph/services/services.resolver.spec.ts index cce1f2f85..283706ddd 100644 --- a/api/src/unraid-api/graph/services/services.resolver.spec.ts +++ b/api/src/unraid-api/graph/services/services.resolver.spec.ts @@ -1,4 +1,4 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test, type TestingModule } from '@nestjs/testing'; import { ServicesResolver } from './services.resolver'; describe('ServicesResolver', () => { diff --git a/api/src/unraid-api/graph/shares/shares.resolver.spec.ts b/api/src/unraid-api/graph/shares/shares.resolver.spec.ts index f272974cb..7da9ed596 100644 --- a/api/src/unraid-api/graph/shares/shares.resolver.spec.ts +++ b/api/src/unraid-api/graph/shares/shares.resolver.spec.ts @@ -1,4 +1,4 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test, type TestingModule } from '@nestjs/testing'; import { SharesResolver } from './shares.resolver'; describe('SharesResolver', () => {