From b3768d65aa9257a7e69f6e8d804480fb72eec87a Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Tue, 9 Jan 2024 15:13:46 -0500 Subject: [PATCH] fix: codegen on web run --- api/dev/Unraid.net/myservers.cfg | 2 +- api/dev/states/myservers.cfg | 4 +- web/composables/gql/gql.ts | 4 +- web/composables/gql/graphql.ts | 134 +++---------------------------- web/store/server.fragment.ts | 1 + 5 files changed, 15 insertions(+), 130 deletions(-) diff --git a/api/dev/Unraid.net/myservers.cfg b/api/dev/Unraid.net/myservers.cfg index 8812c8717..22531a028 100644 --- a/api/dev/Unraid.net/myservers.cfg +++ b/api/dev/Unraid.net/myservers.cfg @@ -1,5 +1,5 @@ [api] -version="3.2.3+5a94a72a" +version="3.2.3+6c0ccb2b" extraOrigins="" [local] [notifier] diff --git a/api/dev/states/myservers.cfg b/api/dev/states/myservers.cfg index a94d86853..29746b080 100644 --- a/api/dev/states/myservers.cfg +++ b/api/dev/states/myservers.cfg @@ -1,5 +1,5 @@ [api] -version="3.2.3+5a94a72a" +version="3.2.3+6c0ccb2b" extraOrigins="" [local] [notifier] @@ -21,4 +21,4 @@ dynamicRemoteAccessType="DISABLED" [upc] apikey="unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810" [connectionStatus] -minigraph="PRE_INIT" +minigraph="ERROR_RETRYING" diff --git a/web/composables/gql/gql.ts b/web/composables/gql/gql.ts index badcea613..30f5ddd20 100644 --- a/web/composables/gql/gql.ts +++ b/web/composables/gql/gql.ts @@ -16,7 +16,7 @@ const documents = { "\n mutation ConnectSignIn($input: ConnectSignInInput!) {\n connectSignIn(input: $input)\n }\n": types.ConnectSignInDocument, "\n mutation SignOut {\n connectSignOut\n }\n": types.SignOutDocument, "\n fragment PartialCloud on Cloud {\n error\n apiKey {\n valid\n error\n }\n cloud {\n status\n error\n }\n minigraphql {\n status\n error\n }\n relay {\n status\n error\n }\n }\n": types.PartialCloudFragmentDoc, - "\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n": types.serverStateDocument, + "\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n updateExpiration\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n": types.serverStateDocument, }; /** @@ -48,7 +48,7 @@ export function graphql(source: "\n fragment PartialCloud on Cloud {\n error /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n"): (typeof documents)["\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n"]; +export function graphql(source: "\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n updateExpiration\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n"): (typeof documents)["\n query serverState {\n cloud {\n ...PartialCloud\n }\n config {\n error\n valid\n }\n info {\n os {\n hostname\n }\n }\n owner {\n avatar\n username\n }\n registration {\n state\n expiration\n keyFile {\n contents\n }\n updateExpiration\n }\n vars {\n regGen\n regState\n configError\n configValid\n }\n }\n"]; export function graphql(source: string) { return (documents as any)[source] ?? {}; diff --git a/web/composables/gql/graphql.ts b/web/composables/gql/graphql.ts index 6935e14b8..275eb7e92 100644 --- a/web/composables/gql/graphql.ts +++ b/web/composables/gql/graphql.ts @@ -297,15 +297,6 @@ export enum ContainerState { Running = 'RUNNING' } -export type Device = { - __typename?: 'Device'; - device?: Maybe; - id: Scalars['ID']['output']; - sectorSize?: Maybe; - sectors?: Maybe; - tag?: Maybe; -}; - export type Devices = { __typename?: 'Devices'; gpu?: Maybe>>; @@ -339,7 +330,8 @@ export type Disk = { export enum DiskFsType { Btrfs = 'btrfs', Vfat = 'vfat', - Xfs = 'xfs' + Xfs = 'xfs', + Zfs = 'zfs' } export enum DiskInterfaceType { @@ -522,7 +514,7 @@ export type Me = UserAccount & { id: Scalars['ID']['output']; name: Scalars['String']['output']; permissions?: Maybe; - role: Scalars['String']['output']; + roles: Scalars['String']['output']; }; export enum MemoryFormFactor { @@ -579,10 +571,6 @@ export type Mutation = { addApikey?: Maybe; /** Add new disk to array */ addDiskToArray?: Maybe; - /** Add a new permission scope */ - addScope?: Maybe; - /** Add a new permission scope to apiKey */ - addScopeToApiKey?: Maybe; /** Add a new user */ addUser?: Maybe; /** Cancel parity check */ @@ -630,16 +618,6 @@ export type MutationaddDiskToArrayArgs = { }; -export type MutationaddScopeArgs = { - input: addScopeInput; -}; - - -export type MutationaddScopeToApiKeyArgs = { - input: addScopeToApiKeyInput; -}; - - export type MutationaddUserArgs = { input: addUserInput; }; @@ -872,12 +850,6 @@ export type Pci = { vendorname?: Maybe; }; -export type Permissions = { - __typename?: 'Permissions'; - grants?: Maybe; - scopes?: Maybe; -}; - export type ProfileModel = { __typename?: 'ProfileModel'; avatar?: Maybe; @@ -894,9 +866,6 @@ export type Query = { array: ArrayType; cloud?: Maybe; config: Config; - crashReportingEnabled?: Maybe; - device?: Maybe; - devices: Array>; /** Single disk */ disk?: Maybe; /** Mulitiple disks */ @@ -916,29 +885,19 @@ export type Query = { online?: Maybe; owner?: Maybe; parityHistory?: Maybe>>; - permissions?: Maybe; registration?: Maybe; server?: Maybe; servers: Array; /** Network Shares */ shares?: Maybe>>; - twoFactor?: Maybe; unassignedDevices?: Maybe>>; /** User account */ user?: Maybe; /** User accounts */ users: Array; vars?: Maybe; - /** Virtual network for vms */ - vmNetwork?: Maybe; /** Virtual machines */ vms?: Maybe; - welcome?: Maybe; -}; - - -export type QuerydeviceArgs = { - id: Scalars['ID']['input']; }; @@ -967,11 +926,6 @@ export type QuerynotificationsArgs = { }; -export type QueryserverArgs = { - name: Scalars['String']['input']; -}; - - export type QueryuserArgs = { id: Scalars['ID']['input']; }; @@ -981,11 +935,6 @@ export type QueryusersArgs = { input?: InputMaybe; }; - -export type QueryvmNetworkArgs = { - name: Scalars['String']['input']; -}; - export type Registration = { __typename?: 'Registration'; expiration?: Maybe; @@ -993,6 +942,7 @@ export type Registration = { keyFile?: Maybe; state?: Maybe; type?: Maybe; + updateExpiration?: Maybe; }; export enum RegistrationState { @@ -1043,15 +993,6 @@ export type RelayResponse = { timeout?: Maybe; }; -/** A permission scope */ -export type Scope = { - __typename?: 'Scope'; - /** A user friendly description */ - description?: Maybe; - /** A unique name for the scope */ - name?: Maybe; -}; - export type Server = { __typename?: 'Server'; apikey: Scalars['String']['output']; @@ -1117,9 +1058,6 @@ export type Subscription = { apikeys?: Maybe>>; array: ArrayType; config: Config; - crashReportingEnabled: Scalars['Boolean']['output']; - device: Device; - devices?: Maybe>; display?: Maybe; dockerContainer: DockerContainer; dockerContainers?: Maybe>>; @@ -1134,26 +1072,18 @@ export type Subscription = { parityHistory: ParityCheck; ping: Scalars['String']['output']; registration: Registration; - server: Server; - servers?: Maybe>; + server?: Maybe; service?: Maybe>; share: Share; shares?: Maybe>; - twoFactor?: Maybe; unassignedDevices?: Maybe>; user: User; users: Array>; vars: Vars; - vmNetworks?: Maybe>; vms?: Maybe; }; -export type SubscriptiondeviceArgs = { - id: Scalars['ID']['input']; -}; - - export type SubscriptiondockerContainerArgs = { id: Scalars['ID']['input']; }; @@ -1164,11 +1094,6 @@ export type SubscriptiondockerNetworkArgs = { }; -export type SubscriptionserverArgs = { - name: Scalars['String']['input']; -}; - - export type SubscriptionserviceArgs = { name: Scalars['String']['input']; }; @@ -1202,29 +1127,6 @@ export enum Theme { White = 'white' } -export type TwoFactorLocal = { - __typename?: 'TwoFactorLocal'; - enabled?: Maybe; -}; - -export type TwoFactorRemote = { - __typename?: 'TwoFactorRemote'; - enabled?: Maybe; -}; - -export type TwoFactorWithToken = { - __typename?: 'TwoFactorWithToken'; - local?: Maybe; - remote?: Maybe; - token?: Maybe; -}; - -export type TwoFactorWithoutToken = { - __typename?: 'TwoFactorWithoutToken'; - local?: Maybe; - remote?: Maybe; -}; - export type UnassignedDevice = { __typename?: 'UnassignedDevice'; devlinks?: Maybe; @@ -1301,14 +1203,14 @@ export type User = UserAccount & { name: Scalars['String']['output']; /** If the account has a password set */ password?: Maybe; - role: Scalars['String']['output']; + roles: Scalars['String']['output']; }; export type UserAccount = { description: Scalars['String']['output']; id: Scalars['ID']['output']; name: Scalars['String']['output']; - role: Scalars['String']['output']; + roles: Scalars['String']['output']; }; export type Vars = { @@ -1514,11 +1416,6 @@ export type VmDomain = { uuid: Scalars['ID']['output']; }; -export type VmNetwork = { - __typename?: 'VmNetwork'; - _placeholderType?: Maybe; -}; - export enum VmState { Crashed = 'CRASHED', Idle = 'IDLE', @@ -1557,19 +1454,6 @@ export type addApiKeyInput = { userId?: InputMaybe; }; -export type addScopeInput = { - /** Scope description */ - description?: InputMaybe; - /** Scope name */ - name: Scalars['String']['input']; -}; - -export type addScopeToApiKeyInput = { - apiKey: Scalars['String']['input']; - /** Scope name */ - name: Scalars['String']['input']; -}; - export type addUserInput = { description?: InputMaybe; name: Scalars['String']['input']; @@ -1636,9 +1520,9 @@ export type serverStateQueryVariables = Exact<{ [key: string]: never; }>; export type serverStateQuery = { __typename?: 'Query', cloud?: ( { __typename?: 'Cloud' } & { ' $fragmentRefs'?: { 'PartialCloudFragment': PartialCloudFragment } } - ) | null, config: { __typename?: 'Config', error?: ConfigErrorState | null, valid?: boolean | null }, info?: { __typename?: 'Info', os?: { __typename?: 'Os', hostname?: string | null } | null } | null, owner?: { __typename?: 'Owner', avatar?: string | null, username?: string | null } | null, registration?: { __typename?: 'Registration', state?: RegistrationState | null, expiration?: string | null, keyFile?: { __typename?: 'KeyFile', contents?: string | null } | null } | null, vars?: { __typename?: 'Vars', regGen?: string | null, regState?: RegistrationState | null, configError?: ConfigErrorState | null, configValid?: boolean | null } | null }; + ) | null, config: { __typename?: 'Config', error?: ConfigErrorState | null, valid?: boolean | null }, info?: { __typename?: 'Info', os?: { __typename?: 'Os', hostname?: string | null } | null } | null, owner?: { __typename?: 'Owner', avatar?: string | null, username?: string | null } | null, registration?: { __typename?: 'Registration', state?: RegistrationState | null, expiration?: string | null, updateExpiration?: string | null, keyFile?: { __typename?: 'KeyFile', contents?: string | null } | null } | null, vars?: { __typename?: 'Vars', regGen?: string | null, regState?: RegistrationState | null, configError?: ConfigErrorState | null, configValid?: boolean | null } | null }; export const PartialCloudFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialCloud"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Cloud"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"valid"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cloud"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"minigraphql"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relay"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]} as unknown as DocumentNode; export const ConnectSignInDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ConnectSignIn"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ConnectSignInInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"connectSignIn"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode; export const SignOutDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignOut"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"connectSignOut"}}]}}]} as unknown as DocumentNode; -export const serverStateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"serverState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cloud"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialCloud"}}]}},{"kind":"Field","name":{"kind":"Name","value":"config"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"valid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"info"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"os"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hostname"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"owner"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"kind":"Field","name":{"kind":"Name","value":"registration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"keyFile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contents"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"vars"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"regGen"}},{"kind":"Field","name":{"kind":"Name","value":"regState"}},{"kind":"Field","name":{"kind":"Name","value":"configError"}},{"kind":"Field","name":{"kind":"Name","value":"configValid"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialCloud"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Cloud"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"valid"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cloud"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"minigraphql"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relay"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export const serverStateDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"serverState"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cloud"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialCloud"}}]}},{"kind":"Field","name":{"kind":"Name","value":"config"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"valid"}}]}},{"kind":"Field","name":{"kind":"Name","value":"info"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"os"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hostname"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"owner"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"avatar"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}},{"kind":"Field","name":{"kind":"Name","value":"registration"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"expiration"}},{"kind":"Field","name":{"kind":"Name","value":"keyFile"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"contents"}}]}},{"kind":"Field","name":{"kind":"Name","value":"updateExpiration"}}]}},{"kind":"Field","name":{"kind":"Name","value":"vars"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"regGen"}},{"kind":"Field","name":{"kind":"Name","value":"regState"}},{"kind":"Field","name":{"kind":"Name","value":"configError"}},{"kind":"Field","name":{"kind":"Name","value":"configValid"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialCloud"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Cloud"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"error"}},{"kind":"Field","name":{"kind":"Name","value":"apiKey"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"valid"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cloud"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"minigraphql"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}},{"kind":"Field","name":{"kind":"Name","value":"relay"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/web/store/server.fragment.ts b/web/store/server.fragment.ts index 7906f80ba..ba39adc22 100644 --- a/web/store/server.fragment.ts +++ b/web/store/server.fragment.ts @@ -79,6 +79,7 @@ export const SERVER_STATE_QUERY = graphql(/* GraphQL */ ` keyFile { contents } + updateExpiration } vars { regGen