mirror of
https://github.com/unraid/api.git
synced 2026-01-15 21:19:53 -06:00
feat: new key types in API
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
66
api/src/graphql/generated/client/fragment-masking.ts
Normal file
66
api/src/graphql/generated/client/fragment-masking.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import type { ResultOf, DocumentTypeDecoration, TypedDocumentNode } from '@graphql-typed-document-node/core';
|
||||
import type { FragmentDefinitionNode } from 'graphql';
|
||||
import type { Incremental } from './graphql.js';
|
||||
|
||||
|
||||
export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
|
||||
infer TType,
|
||||
any
|
||||
>
|
||||
? [TType] extends [{ ' $fragmentName'?: infer TKey }]
|
||||
? TKey extends string
|
||||
? { ' $fragmentRefs'?: { [key in TKey]: TType } }
|
||||
: never
|
||||
: never
|
||||
: never;
|
||||
|
||||
// return non-nullable if `fragmentType` is non-nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>
|
||||
): TType;
|
||||
// return nullable if `fragmentType` is nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | null | undefined
|
||||
): TType | null | undefined;
|
||||
// return array of non-nullable if `fragmentType` is array of non-nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>
|
||||
): ReadonlyArray<TType>;
|
||||
// return array of nullable if `fragmentType` is array of nullable
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
||||
): ReadonlyArray<TType> | null | undefined;
|
||||
export function useFragment<TType>(
|
||||
_documentNode: DocumentTypeDecoration<TType, any>,
|
||||
fragmentType: FragmentType<DocumentTypeDecoration<TType, any>> | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>> | null | undefined
|
||||
): TType | ReadonlyArray<TType> | null | undefined {
|
||||
return fragmentType as any;
|
||||
}
|
||||
|
||||
|
||||
export function makeFragmentData<
|
||||
F extends DocumentTypeDecoration<any, any>,
|
||||
FT extends ResultOf<F>
|
||||
>(data: FT, _fragment: F): FragmentType<F> {
|
||||
return data as FragmentType<F>;
|
||||
}
|
||||
export function isFragmentReady<TQuery, TFrag>(
|
||||
queryNode: DocumentTypeDecoration<TQuery, any>,
|
||||
fragmentNode: TypedDocumentNode<TFrag>,
|
||||
data: FragmentType<TypedDocumentNode<Incremental<TFrag>, any>> | null | undefined
|
||||
): data is FragmentType<typeof fragmentNode> {
|
||||
const deferredFields = (queryNode as { __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> } }).__meta__
|
||||
?.deferredFields;
|
||||
|
||||
if (!deferredFields) return true;
|
||||
|
||||
const fragDef = fragmentNode.definitions[0] as FragmentDefinitionNode | undefined;
|
||||
const fragName = fragDef?.name?.value;
|
||||
|
||||
const fields = (fragName && deferredFields[fragName]) || [];
|
||||
return fields.length > 0 && fields.every(field => data && field in data);
|
||||
}
|
||||
@@ -5,41 +5,43 @@ export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
||||
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: string;
|
||||
String: string;
|
||||
Boolean: boolean;
|
||||
Int: number;
|
||||
Float: number;
|
||||
ID: { input: string; output: string; }
|
||||
String: { input: string; output: string; }
|
||||
Boolean: { input: boolean; output: boolean; }
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
/** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */
|
||||
DateTime: string;
|
||||
DateTime: { input: string; output: string; }
|
||||
/** A field whose value is a IPv4 address: https://en.wikipedia.org/wiki/IPv4. */
|
||||
IPv4: any;
|
||||
IPv4: { input: any; output: any; }
|
||||
/** A field whose value is a IPv6 address: https://en.wikipedia.org/wiki/IPv6. */
|
||||
IPv6: any;
|
||||
IPv6: { input: any; output: any; }
|
||||
/** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */
|
||||
JSON: { [key: string]: any };
|
||||
JSON: { input: { [key: string]: any }; output: { [key: string]: any }; }
|
||||
/** The `Long` scalar type represents 52-bit integers */
|
||||
Long: number;
|
||||
Long: { input: number; output: number; }
|
||||
/** A field whose value is a valid TCP port within the range of 0 to 65535: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_ports */
|
||||
Port: number;
|
||||
Port: { input: number; output: number; }
|
||||
/** A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. */
|
||||
URL: URL;
|
||||
URL: { input: URL; output: URL; }
|
||||
};
|
||||
|
||||
export type AccessUrl = {
|
||||
__typename?: 'AccessUrl';
|
||||
ipv4?: Maybe<Scalars['URL']>;
|
||||
ipv6?: Maybe<Scalars['URL']>;
|
||||
name?: Maybe<Scalars['String']>;
|
||||
ipv4?: Maybe<Scalars['URL']['output']>;
|
||||
ipv6?: Maybe<Scalars['URL']['output']>;
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
type: URL_TYPE;
|
||||
};
|
||||
|
||||
export type AccessUrlInput = {
|
||||
ipv4?: InputMaybe<Scalars['URL']>;
|
||||
ipv6?: InputMaybe<Scalars['URL']>;
|
||||
name?: InputMaybe<Scalars['String']>;
|
||||
ipv4?: InputMaybe<Scalars['URL']['input']>;
|
||||
ipv6?: InputMaybe<Scalars['URL']['input']>;
|
||||
name?: InputMaybe<Scalars['String']['input']>;
|
||||
type: URL_TYPE;
|
||||
};
|
||||
|
||||
@@ -50,15 +52,15 @@ export type ArrayCapacity = {
|
||||
|
||||
export type ArrayCapacityBytes = {
|
||||
__typename?: 'ArrayCapacityBytes';
|
||||
free?: Maybe<Scalars['Long']>;
|
||||
total?: Maybe<Scalars['Long']>;
|
||||
used?: Maybe<Scalars['Long']>;
|
||||
free?: Maybe<Scalars['Long']['output']>;
|
||||
total?: Maybe<Scalars['Long']['output']>;
|
||||
used?: Maybe<Scalars['Long']['output']>;
|
||||
};
|
||||
|
||||
export type ArrayCapacityBytesInput = {
|
||||
free?: InputMaybe<Scalars['Long']>;
|
||||
total?: InputMaybe<Scalars['Long']>;
|
||||
used?: InputMaybe<Scalars['Long']>;
|
||||
free?: InputMaybe<Scalars['Long']['input']>;
|
||||
total?: InputMaybe<Scalars['Long']['input']>;
|
||||
used?: InputMaybe<Scalars['Long']['input']>;
|
||||
};
|
||||
|
||||
export type ArrayCapacityInput = {
|
||||
@@ -73,9 +75,9 @@ export type ClientConnectedEvent = {
|
||||
|
||||
export type ClientConnectionEventData = {
|
||||
__typename?: 'ClientConnectionEventData';
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['output'];
|
||||
type: ClientType;
|
||||
version: Scalars['String'];
|
||||
version: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type ClientDisconnectedEvent = {
|
||||
@@ -98,7 +100,7 @@ export enum ClientType {
|
||||
export type Config = {
|
||||
__typename?: 'Config';
|
||||
error?: Maybe<ConfigErrorState>;
|
||||
valid?: Maybe<Scalars['Boolean']>;
|
||||
valid?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export enum ConfigErrorState {
|
||||
@@ -114,10 +116,10 @@ export type Dashboard = {
|
||||
array?: Maybe<DashboardArray>;
|
||||
config?: Maybe<DashboardConfig>;
|
||||
display?: Maybe<DashboardDisplay>;
|
||||
id: Scalars['ID'];
|
||||
lastPublish?: Maybe<Scalars['DateTime']>;
|
||||
id: Scalars['ID']['output'];
|
||||
lastPublish?: Maybe<Scalars['DateTime']['output']>;
|
||||
network?: Maybe<Network>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
os?: Maybe<DashboardOs>;
|
||||
services?: Maybe<Array<Maybe<DashboardService>>>;
|
||||
twoFactor?: Maybe<DashboardTwoFactor>;
|
||||
@@ -128,13 +130,13 @@ export type Dashboard = {
|
||||
|
||||
export type DashboardApps = {
|
||||
__typename?: 'DashboardApps';
|
||||
installed?: Maybe<Scalars['Int']>;
|
||||
started?: Maybe<Scalars['Int']>;
|
||||
installed?: Maybe<Scalars['Int']['output']>;
|
||||
started?: Maybe<Scalars['Int']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardAppsInput = {
|
||||
installed: Scalars['Int'];
|
||||
started: Scalars['Int'];
|
||||
installed: Scalars['Int']['input'];
|
||||
started: Scalars['Int']['input'];
|
||||
};
|
||||
|
||||
export type DashboardArray = {
|
||||
@@ -142,40 +144,40 @@ export type DashboardArray = {
|
||||
/** Current array capacity */
|
||||
capacity?: Maybe<ArrayCapacity>;
|
||||
/** Current array state */
|
||||
state?: Maybe<Scalars['String']>;
|
||||
state?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardArrayInput = {
|
||||
/** Current array capacity */
|
||||
capacity: ArrayCapacityInput;
|
||||
/** Current array state */
|
||||
state: Scalars['String'];
|
||||
state: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardCase = {
|
||||
__typename?: 'DashboardCase';
|
||||
base64?: Maybe<Scalars['String']>;
|
||||
error?: Maybe<Scalars['String']>;
|
||||
icon?: Maybe<Scalars['String']>;
|
||||
url?: Maybe<Scalars['String']>;
|
||||
base64?: Maybe<Scalars['String']['output']>;
|
||||
error?: Maybe<Scalars['String']['output']>;
|
||||
icon?: Maybe<Scalars['String']['output']>;
|
||||
url?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardCaseInput = {
|
||||
base64: Scalars['String'];
|
||||
error?: InputMaybe<Scalars['String']>;
|
||||
icon: Scalars['String'];
|
||||
url: Scalars['String'];
|
||||
base64: Scalars['String']['input'];
|
||||
error?: InputMaybe<Scalars['String']['input']>;
|
||||
icon: Scalars['String']['input'];
|
||||
url: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardConfig = {
|
||||
__typename?: 'DashboardConfig';
|
||||
error?: Maybe<Scalars['String']>;
|
||||
valid?: Maybe<Scalars['Boolean']>;
|
||||
error?: Maybe<Scalars['String']['output']>;
|
||||
valid?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardConfigInput = {
|
||||
error?: InputMaybe<Scalars['String']>;
|
||||
valid: Scalars['Boolean'];
|
||||
error?: InputMaybe<Scalars['String']['input']>;
|
||||
valid: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
export type DashboardDisplay = {
|
||||
@@ -202,37 +204,37 @@ export type DashboardInput = {
|
||||
|
||||
export type DashboardOs = {
|
||||
__typename?: 'DashboardOs';
|
||||
hostname?: Maybe<Scalars['String']>;
|
||||
uptime?: Maybe<Scalars['DateTime']>;
|
||||
hostname?: Maybe<Scalars['String']['output']>;
|
||||
uptime?: Maybe<Scalars['DateTime']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardOsInput = {
|
||||
hostname: Scalars['String'];
|
||||
uptime: Scalars['DateTime'];
|
||||
hostname: Scalars['String']['input'];
|
||||
uptime: Scalars['DateTime']['input'];
|
||||
};
|
||||
|
||||
export type DashboardService = {
|
||||
__typename?: 'DashboardService';
|
||||
name?: Maybe<Scalars['String']>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
uptime?: Maybe<DashboardServiceUptime>;
|
||||
version?: Maybe<Scalars['String']>;
|
||||
version?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardServiceInput = {
|
||||
name: Scalars['String'];
|
||||
online: Scalars['Boolean'];
|
||||
name: Scalars['String']['input'];
|
||||
online: Scalars['Boolean']['input'];
|
||||
uptime?: InputMaybe<DashboardServiceUptimeInput>;
|
||||
version: Scalars['String'];
|
||||
version: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardServiceUptime = {
|
||||
__typename?: 'DashboardServiceUptime';
|
||||
timestamp?: Maybe<Scalars['DateTime']>;
|
||||
timestamp?: Maybe<Scalars['DateTime']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardServiceUptimeInput = {
|
||||
timestamp: Scalars['DateTime'];
|
||||
timestamp: Scalars['DateTime']['input'];
|
||||
};
|
||||
|
||||
export type DashboardTwoFactor = {
|
||||
@@ -248,53 +250,53 @@ export type DashboardTwoFactorInput = {
|
||||
|
||||
export type DashboardTwoFactorLocal = {
|
||||
__typename?: 'DashboardTwoFactorLocal';
|
||||
enabled?: Maybe<Scalars['Boolean']>;
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardTwoFactorLocalInput = {
|
||||
enabled: Scalars['Boolean'];
|
||||
enabled: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
export type DashboardTwoFactorRemote = {
|
||||
__typename?: 'DashboardTwoFactorRemote';
|
||||
enabled?: Maybe<Scalars['Boolean']>;
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardTwoFactorRemoteInput = {
|
||||
enabled: Scalars['Boolean'];
|
||||
enabled: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
export type DashboardVars = {
|
||||
__typename?: 'DashboardVars';
|
||||
flashGuid?: Maybe<Scalars['String']>;
|
||||
regState?: Maybe<Scalars['String']>;
|
||||
regTy?: Maybe<Scalars['String']>;
|
||||
flashGuid?: Maybe<Scalars['String']['output']>;
|
||||
regState?: Maybe<Scalars['String']['output']>;
|
||||
regTy?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVarsInput = {
|
||||
flashGuid: Scalars['String'];
|
||||
regState: Scalars['String'];
|
||||
regTy: Scalars['String'];
|
||||
flashGuid: Scalars['String']['input'];
|
||||
regState: Scalars['String']['input'];
|
||||
regTy: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardVersions = {
|
||||
__typename?: 'DashboardVersions';
|
||||
unraid?: Maybe<Scalars['String']>;
|
||||
unraid?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVersionsInput = {
|
||||
unraid: Scalars['String'];
|
||||
unraid: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type DashboardVms = {
|
||||
__typename?: 'DashboardVms';
|
||||
installed?: Maybe<Scalars['Int']>;
|
||||
started?: Maybe<Scalars['Int']>;
|
||||
installed?: Maybe<Scalars['Int']['output']>;
|
||||
started?: Maybe<Scalars['Int']['output']>;
|
||||
};
|
||||
|
||||
export type DashboardVmsInput = {
|
||||
installed: Scalars['Int'];
|
||||
started: Scalars['Int'];
|
||||
installed: Scalars['Int']['input'];
|
||||
started: Scalars['Int']['input'];
|
||||
};
|
||||
|
||||
export type Event = ClientConnectedEvent | ClientDisconnectedEvent | ClientPingEvent | RemoteAccessEvent | RemoteGraphQLEvent | UpdateEvent;
|
||||
@@ -310,13 +312,13 @@ export enum EventType {
|
||||
|
||||
export type FullServerDetails = {
|
||||
__typename?: 'FullServerDetails';
|
||||
apiConnectedCount?: Maybe<Scalars['Int']>;
|
||||
apiVersion?: Maybe<Scalars['String']>;
|
||||
connectionTimestamp?: Maybe<Scalars['String']>;
|
||||
apiConnectedCount?: Maybe<Scalars['Int']['output']>;
|
||||
apiVersion?: Maybe<Scalars['String']['output']>;
|
||||
connectionTimestamp?: Maybe<Scalars['String']['output']>;
|
||||
dashboard?: Maybe<Dashboard>;
|
||||
lastPublish?: Maybe<Scalars['String']>;
|
||||
lastPublish?: Maybe<Scalars['String']['output']>;
|
||||
network?: Maybe<Network>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export enum Importance {
|
||||
@@ -334,39 +336,39 @@ export enum KeyType {
|
||||
|
||||
export type KsServerDetails = {
|
||||
__typename?: 'KsServerDetails';
|
||||
accessLabel: Scalars['String'];
|
||||
accessUrl: Scalars['String'];
|
||||
apiKey?: Maybe<Scalars['String']>;
|
||||
description: Scalars['String'];
|
||||
dnsHash: Scalars['String'];
|
||||
flashBackupDate?: Maybe<Scalars['Int']>;
|
||||
flashBackupUrl: Scalars['String'];
|
||||
flashProduct: Scalars['String'];
|
||||
flashVendor: Scalars['String'];
|
||||
guid: Scalars['String'];
|
||||
ipsId: Scalars['String'];
|
||||
accessLabel: Scalars['String']['output'];
|
||||
accessUrl: Scalars['String']['output'];
|
||||
apiKey?: Maybe<Scalars['String']['output']>;
|
||||
description: Scalars['String']['output'];
|
||||
dnsHash: Scalars['String']['output'];
|
||||
flashBackupDate?: Maybe<Scalars['Int']['output']>;
|
||||
flashBackupUrl: Scalars['String']['output'];
|
||||
flashProduct: Scalars['String']['output'];
|
||||
flashVendor: Scalars['String']['output'];
|
||||
guid: Scalars['String']['output'];
|
||||
ipsId: Scalars['String']['output'];
|
||||
keyType: KeyType;
|
||||
licenseKey: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
plgVersion?: Maybe<Scalars['String']>;
|
||||
signedIn: Scalars['Boolean'];
|
||||
licenseKey: Scalars['String']['output'];
|
||||
name: Scalars['String']['output'];
|
||||
plgVersion?: Maybe<Scalars['String']['output']>;
|
||||
signedIn: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
export type LegacyService = {
|
||||
__typename?: 'LegacyService';
|
||||
name?: Maybe<Scalars['String']>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
uptime?: Maybe<Scalars['Int']>;
|
||||
version?: Maybe<Scalars['String']>;
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
uptime?: Maybe<Scalars['Int']['output']>;
|
||||
version?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
remoteGraphQLResponse: Scalars['Boolean'];
|
||||
remoteMutation: Scalars['String'];
|
||||
remoteSession?: Maybe<Scalars['Boolean']>;
|
||||
remoteGraphQLResponse: Scalars['Boolean']['output'];
|
||||
remoteMutation: Scalars['String']['output'];
|
||||
remoteSession?: Maybe<Scalars['Boolean']['output']>;
|
||||
sendNotification?: Maybe<Notification>;
|
||||
sendPing?: Maybe<Scalars['Boolean']>;
|
||||
sendPing?: Maybe<Scalars['Boolean']['output']>;
|
||||
updateDashboard: Dashboard;
|
||||
updateNetwork: Network;
|
||||
};
|
||||
@@ -412,20 +414,20 @@ export type NetworkInput = {
|
||||
|
||||
export type Notification = {
|
||||
__typename?: 'Notification';
|
||||
description?: Maybe<Scalars['String']>;
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
importance?: Maybe<Importance>;
|
||||
link?: Maybe<Scalars['String']>;
|
||||
link?: Maybe<Scalars['String']['output']>;
|
||||
status: NotificationStatus;
|
||||
subject?: Maybe<Scalars['String']>;
|
||||
title?: Maybe<Scalars['String']>;
|
||||
subject?: Maybe<Scalars['String']['output']>;
|
||||
title?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type NotificationInput = {
|
||||
description?: InputMaybe<Scalars['String']>;
|
||||
description?: InputMaybe<Scalars['String']['input']>;
|
||||
importance: Importance;
|
||||
link?: InputMaybe<Scalars['String']>;
|
||||
subject?: InputMaybe<Scalars['String']>;
|
||||
title?: InputMaybe<Scalars['String']>;
|
||||
link?: InputMaybe<Scalars['String']['input']>;
|
||||
subject?: InputMaybe<Scalars['String']['input']>;
|
||||
title?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export enum NotificationStatus {
|
||||
@@ -437,7 +439,7 @@ export enum NotificationStatus {
|
||||
|
||||
export type PingEvent = {
|
||||
__typename?: 'PingEvent';
|
||||
data?: Maybe<Scalars['String']>;
|
||||
data?: Maybe<Scalars['String']['output']>;
|
||||
type: EventType;
|
||||
};
|
||||
|
||||
@@ -453,26 +455,27 @@ export enum PingEventSource {
|
||||
|
||||
export type ProfileModel = {
|
||||
__typename?: 'ProfileModel';
|
||||
avatar?: Maybe<Scalars['String']>;
|
||||
url?: Maybe<Scalars['String']>;
|
||||
userId?: Maybe<Scalars['ID']>;
|
||||
username?: Maybe<Scalars['String']>;
|
||||
avatar?: Maybe<Scalars['String']['output']>;
|
||||
cognito_id?: Maybe<Scalars['String']['output']>;
|
||||
url?: Maybe<Scalars['String']['output']>;
|
||||
userId?: Maybe<Scalars['ID']['output']>;
|
||||
username?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
apiVersion?: Maybe<Scalars['String']>;
|
||||
apiVersion?: Maybe<Scalars['String']['output']>;
|
||||
dashboard?: Maybe<Dashboard>;
|
||||
ksServers: Array<KsServerDetails>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
remoteQuery: Scalars['String'];
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
remoteQuery: Scalars['String']['output'];
|
||||
servers: Array<Maybe<Server>>;
|
||||
status?: Maybe<ServerStatus>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerydashboardArgs = {
|
||||
id: Scalars['String'];
|
||||
id: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
|
||||
@@ -538,20 +541,20 @@ export enum RemoteAccessEventActionType {
|
||||
|
||||
export type RemoteAccessEventData = {
|
||||
__typename?: 'RemoteAccessEventData';
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['output'];
|
||||
type: RemoteAccessEventActionType;
|
||||
url?: Maybe<AccessUrl>;
|
||||
};
|
||||
|
||||
export type RemoteAccessInput = {
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['input'];
|
||||
type: RemoteAccessEventActionType;
|
||||
url?: InputMaybe<AccessUrlInput>;
|
||||
};
|
||||
|
||||
export type RemoteGraphQLClientInput = {
|
||||
apiKey: Scalars['String'];
|
||||
body: Scalars['String'];
|
||||
apiKey: Scalars['String']['input'];
|
||||
body: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type RemoteGraphQLEvent = {
|
||||
@@ -563,9 +566,9 @@ export type RemoteGraphQLEvent = {
|
||||
export type RemoteGraphQLEventData = {
|
||||
__typename?: 'RemoteGraphQLEventData';
|
||||
/** Contains mutation / subscription / query data in the form of body: JSON, variables: JSON */
|
||||
body: Scalars['String'];
|
||||
body: Scalars['String']['output'];
|
||||
/** sha256 hash of the body */
|
||||
sha256: Scalars['String'];
|
||||
sha256: Scalars['String']['output'];
|
||||
type: RemoteGraphQLEventType;
|
||||
};
|
||||
|
||||
@@ -578,39 +581,39 @@ export enum RemoteGraphQLEventType {
|
||||
|
||||
export type RemoteGraphQLServerInput = {
|
||||
/** Body - contains an object containing data: (GQL response data) or errors: (GQL Errors) */
|
||||
body: Scalars['String'];
|
||||
body: Scalars['String']['input'];
|
||||
/** sha256 hash of the body */
|
||||
sha256: Scalars['String'];
|
||||
sha256: Scalars['String']['input'];
|
||||
type: RemoteGraphQLEventType;
|
||||
};
|
||||
|
||||
export type Server = {
|
||||
__typename?: 'Server';
|
||||
apikey?: Maybe<Scalars['String']>;
|
||||
guid?: Maybe<Scalars['String']>;
|
||||
lanip?: Maybe<Scalars['String']>;
|
||||
localurl?: Maybe<Scalars['String']>;
|
||||
name?: Maybe<Scalars['String']>;
|
||||
apikey?: Maybe<Scalars['String']['output']>;
|
||||
guid?: Maybe<Scalars['String']['output']>;
|
||||
lanip?: Maybe<Scalars['String']['output']>;
|
||||
localurl?: Maybe<Scalars['String']['output']>;
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
owner?: Maybe<ProfileModel>;
|
||||
remoteurl?: Maybe<Scalars['String']>;
|
||||
remoteurl?: Maybe<Scalars['String']['output']>;
|
||||
status?: Maybe<ServerStatus>;
|
||||
wanip?: Maybe<Scalars['String']>;
|
||||
wanip?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
/** Defines server fields that have a TTL on them, for example last ping */
|
||||
export type ServerFieldsWithTtl = {
|
||||
__typename?: 'ServerFieldsWithTtl';
|
||||
lastPing?: Maybe<Scalars['String']>;
|
||||
lastPing?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type ServerModel = {
|
||||
apikey: Scalars['String'];
|
||||
guid: Scalars['String'];
|
||||
lanip: Scalars['String'];
|
||||
localurl: Scalars['String'];
|
||||
name: Scalars['String'];
|
||||
remoteurl: Scalars['String'];
|
||||
wanip: Scalars['String'];
|
||||
apikey: Scalars['String']['output'];
|
||||
guid: Scalars['String']['output'];
|
||||
lanip: Scalars['String']['output'];
|
||||
localurl: Scalars['String']['output'];
|
||||
name: Scalars['String']['output'];
|
||||
remoteurl: Scalars['String']['output'];
|
||||
wanip: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export enum ServerStatus {
|
||||
@@ -621,16 +624,16 @@ export enum ServerStatus {
|
||||
|
||||
export type Service = {
|
||||
__typename?: 'Service';
|
||||
name?: Maybe<Scalars['String']>;
|
||||
online?: Maybe<Scalars['Boolean']>;
|
||||
name?: Maybe<Scalars['String']['output']>;
|
||||
online?: Maybe<Scalars['Boolean']['output']>;
|
||||
uptime?: Maybe<Uptime>;
|
||||
version?: Maybe<Scalars['String']>;
|
||||
version?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type Subscription = {
|
||||
__typename?: 'Subscription';
|
||||
events?: Maybe<Array<Event>>;
|
||||
remoteSubscription: Scalars['String'];
|
||||
remoteSubscription: Scalars['String']['output'];
|
||||
servers: Array<Server>;
|
||||
};
|
||||
|
||||
@@ -641,19 +644,19 @@ export type SubscriptionremoteSubscriptionArgs = {
|
||||
|
||||
export type TwoFactorLocal = {
|
||||
__typename?: 'TwoFactorLocal';
|
||||
enabled?: Maybe<Scalars['Boolean']>;
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type TwoFactorRemote = {
|
||||
__typename?: 'TwoFactorRemote';
|
||||
enabled?: Maybe<Scalars['Boolean']>;
|
||||
enabled?: Maybe<Scalars['Boolean']['output']>;
|
||||
};
|
||||
|
||||
export type TwoFactorWithToken = {
|
||||
__typename?: 'TwoFactorWithToken';
|
||||
local?: Maybe<TwoFactorLocal>;
|
||||
remote?: Maybe<TwoFactorRemote>;
|
||||
token?: Maybe<Scalars['String']>;
|
||||
token?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type TwoFactorWithoutToken = {
|
||||
@@ -678,7 +681,7 @@ export type UpdateEvent = {
|
||||
|
||||
export type UpdateEventData = {
|
||||
__typename?: 'UpdateEventData';
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['output'];
|
||||
type: UpdateType;
|
||||
};
|
||||
|
||||
@@ -689,7 +692,7 @@ export enum UpdateType {
|
||||
|
||||
export type Uptime = {
|
||||
__typename?: 'Uptime';
|
||||
timestamp?: Maybe<Scalars['String']>;
|
||||
timestamp?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type UserProfileModelWithServers = {
|
||||
@@ -700,16 +703,16 @@ export type UserProfileModelWithServers = {
|
||||
|
||||
export type Vars = {
|
||||
__typename?: 'Vars';
|
||||
expireTime?: Maybe<Scalars['DateTime']>;
|
||||
flashGuid?: Maybe<Scalars['String']>;
|
||||
expireTime?: Maybe<Scalars['DateTime']['output']>;
|
||||
flashGuid?: Maybe<Scalars['String']['output']>;
|
||||
regState?: Maybe<RegistrationState>;
|
||||
regTm2?: Maybe<Scalars['String']>;
|
||||
regTy?: Maybe<Scalars['String']>;
|
||||
regTm2?: Maybe<Scalars['String']['output']>;
|
||||
regTy?: Maybe<Scalars['String']['output']>;
|
||||
};
|
||||
|
||||
export type updateDashboardMutationVariables = Exact<{
|
||||
data: DashboardInput;
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
@@ -717,7 +720,7 @@ export type updateDashboardMutation = { __typename?: 'Mutation', updateDashboard
|
||||
|
||||
export type sendNotificationMutationVariables = Exact<{
|
||||
notification: NotificationInput;
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
@@ -725,7 +728,7 @@ export type sendNotificationMutation = { __typename?: 'Mutation', sendNotificati
|
||||
|
||||
export type updateNetworkMutationVariables = Exact<{
|
||||
data: NetworkInput;
|
||||
apiKey: Scalars['String'];
|
||||
apiKey: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
|
||||
@@ -42,16 +42,16 @@ export function AccessUrlInputSchema(): z.ZodObject<Properties<AccessUrlInput>>
|
||||
return z.object({
|
||||
ipv4: definedNonNullAnySchema.nullish(),
|
||||
ipv6: definedNonNullAnySchema.nullish(),
|
||||
name: definedNonNullAnySchema.nullish(),
|
||||
name: z.string().nullish(),
|
||||
type: URL_TYPESchema
|
||||
})
|
||||
}
|
||||
|
||||
export function ArrayCapacityBytesInputSchema(): z.ZodObject<Properties<ArrayCapacityBytesInput>> {
|
||||
return z.object({
|
||||
free: definedNonNullAnySchema.nullish(),
|
||||
total: definedNonNullAnySchema.nullish(),
|
||||
used: definedNonNullAnySchema.nullish()
|
||||
free: z.number().nullish(),
|
||||
total: z.number().nullish(),
|
||||
used: z.number().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -63,31 +63,31 @@ export function ArrayCapacityInputSchema(): z.ZodObject<Properties<ArrayCapacity
|
||||
|
||||
export function DashboardAppsInputSchema(): z.ZodObject<Properties<DashboardAppsInput>> {
|
||||
return z.object({
|
||||
installed: definedNonNullAnySchema,
|
||||
started: definedNonNullAnySchema
|
||||
installed: z.number(),
|
||||
started: z.number()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardArrayInputSchema(): z.ZodObject<Properties<DashboardArrayInput>> {
|
||||
return z.object({
|
||||
capacity: z.lazy(() => ArrayCapacityInputSchema()),
|
||||
state: definedNonNullAnySchema
|
||||
state: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardCaseInputSchema(): z.ZodObject<Properties<DashboardCaseInput>> {
|
||||
return z.object({
|
||||
base64: definedNonNullAnySchema,
|
||||
error: definedNonNullAnySchema.nullish(),
|
||||
icon: definedNonNullAnySchema,
|
||||
url: definedNonNullAnySchema
|
||||
base64: z.string(),
|
||||
error: z.string().nullish(),
|
||||
icon: z.string(),
|
||||
url: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardConfigInputSchema(): z.ZodObject<Properties<DashboardConfigInput>> {
|
||||
return z.object({
|
||||
error: definedNonNullAnySchema.nullish(),
|
||||
valid: definedNonNullAnySchema
|
||||
error: z.string().nullish(),
|
||||
valid: z.boolean()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -114,23 +114,23 @@ export function DashboardInputSchema(): z.ZodObject<Properties<DashboardInput>>
|
||||
|
||||
export function DashboardOsInputSchema(): z.ZodObject<Properties<DashboardOsInput>> {
|
||||
return z.object({
|
||||
hostname: definedNonNullAnySchema,
|
||||
uptime: definedNonNullAnySchema
|
||||
hostname: z.string(),
|
||||
uptime: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceInputSchema(): z.ZodObject<Properties<DashboardServiceInput>> {
|
||||
return z.object({
|
||||
name: definedNonNullAnySchema,
|
||||
online: definedNonNullAnySchema,
|
||||
name: z.string(),
|
||||
online: z.boolean(),
|
||||
uptime: z.lazy(() => DashboardServiceUptimeInputSchema().nullish()),
|
||||
version: definedNonNullAnySchema
|
||||
version: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardServiceUptimeInputSchema(): z.ZodObject<Properties<DashboardServiceUptimeInput>> {
|
||||
return z.object({
|
||||
timestamp: definedNonNullAnySchema
|
||||
timestamp: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -143,34 +143,34 @@ export function DashboardTwoFactorInputSchema(): z.ZodObject<Properties<Dashboar
|
||||
|
||||
export function DashboardTwoFactorLocalInputSchema(): z.ZodObject<Properties<DashboardTwoFactorLocalInput>> {
|
||||
return z.object({
|
||||
enabled: definedNonNullAnySchema
|
||||
enabled: z.boolean()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardTwoFactorRemoteInputSchema(): z.ZodObject<Properties<DashboardTwoFactorRemoteInput>> {
|
||||
return z.object({
|
||||
enabled: definedNonNullAnySchema
|
||||
enabled: z.boolean()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVarsInputSchema(): z.ZodObject<Properties<DashboardVarsInput>> {
|
||||
return z.object({
|
||||
flashGuid: definedNonNullAnySchema,
|
||||
regState: definedNonNullAnySchema,
|
||||
regTy: definedNonNullAnySchema
|
||||
flashGuid: z.string(),
|
||||
regState: z.string(),
|
||||
regTy: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVersionsInputSchema(): z.ZodObject<Properties<DashboardVersionsInput>> {
|
||||
return z.object({
|
||||
unraid: definedNonNullAnySchema
|
||||
unraid: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function DashboardVmsInputSchema(): z.ZodObject<Properties<DashboardVmsInput>> {
|
||||
return z.object({
|
||||
installed: definedNonNullAnySchema,
|
||||
started: definedNonNullAnySchema
|
||||
installed: z.number(),
|
||||
started: z.number()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -182,17 +182,17 @@ export function NetworkInputSchema(): z.ZodObject<Properties<NetworkInput>> {
|
||||
|
||||
export function NotificationInputSchema(): z.ZodObject<Properties<NotificationInput>> {
|
||||
return z.object({
|
||||
description: definedNonNullAnySchema.nullish(),
|
||||
description: z.string().nullish(),
|
||||
importance: ImportanceSchema,
|
||||
link: definedNonNullAnySchema.nullish(),
|
||||
subject: definedNonNullAnySchema.nullish(),
|
||||
title: definedNonNullAnySchema.nullish()
|
||||
link: z.string().nullish(),
|
||||
subject: z.string().nullish(),
|
||||
title: z.string().nullish()
|
||||
})
|
||||
}
|
||||
|
||||
export function RemoteAccessInputSchema(): z.ZodObject<Properties<RemoteAccessInput>> {
|
||||
return z.object({
|
||||
apiKey: definedNonNullAnySchema,
|
||||
apiKey: z.string(),
|
||||
type: RemoteAccessEventActionTypeSchema,
|
||||
url: z.lazy(() => AccessUrlInputSchema().nullish())
|
||||
})
|
||||
@@ -200,15 +200,15 @@ export function RemoteAccessInputSchema(): z.ZodObject<Properties<RemoteAccessIn
|
||||
|
||||
export function RemoteGraphQLClientInputSchema(): z.ZodObject<Properties<RemoteGraphQLClientInput>> {
|
||||
return z.object({
|
||||
apiKey: definedNonNullAnySchema,
|
||||
body: definedNonNullAnySchema
|
||||
apiKey: z.string(),
|
||||
body: z.string()
|
||||
})
|
||||
}
|
||||
|
||||
export function RemoteGraphQLServerInputSchema(): z.ZodObject<Properties<RemoteGraphQLServerInput>> {
|
||||
return z.object({
|
||||
body: definedNonNullAnySchema,
|
||||
sha256: definedNonNullAnySchema,
|
||||
body: z.string(),
|
||||
sha256: z.string(),
|
||||
type: RemoteGraphQLEventTypeSchema
|
||||
})
|
||||
}
|
||||
|
||||
294
api/src/graphql/schema/types/vars/vars.graphql
Normal file
294
api/src/graphql/schema/types/vars/vars.graphql
Normal file
@@ -0,0 +1,294 @@
|
||||
type Query {
|
||||
vars: Vars @func(module: "getVars")
|
||||
}
|
||||
|
||||
type Subscription {
|
||||
vars: Vars!
|
||||
}
|
||||
|
||||
enum ConfigErrorState {
|
||||
UNKNOWN_ERROR
|
||||
INVALID
|
||||
NO_KEY_SERVER
|
||||
WITHDRAWN
|
||||
}
|
||||
|
||||
type Vars {
|
||||
"""
|
||||
Unraid version
|
||||
"""
|
||||
version: String
|
||||
maxArraysz: Int
|
||||
maxCachesz: Int
|
||||
"""
|
||||
Machine hostname
|
||||
"""
|
||||
name: String
|
||||
timeZone: String
|
||||
comment: String
|
||||
security: String
|
||||
workgroup: String
|
||||
domain: String
|
||||
domainShort: String
|
||||
hideDotFiles: Boolean
|
||||
localMaster: Boolean
|
||||
enableFruit: String
|
||||
"""
|
||||
Should a NTP server be used for time sync?
|
||||
"""
|
||||
useNtp: Boolean
|
||||
"""
|
||||
NTP Server 1
|
||||
"""
|
||||
ntpServer1: String
|
||||
"""
|
||||
NTP Server 2
|
||||
"""
|
||||
ntpServer2: String
|
||||
"""
|
||||
NTP Server 3
|
||||
"""
|
||||
ntpServer3: String
|
||||
"""
|
||||
NTP Server 4
|
||||
"""
|
||||
ntpServer4: String
|
||||
domainLogin: String
|
||||
sysModel: String
|
||||
sysArraySlots: Int
|
||||
sysCacheSlots: Int
|
||||
sysFlashSlots: Int
|
||||
useSsl: Boolean
|
||||
"""
|
||||
Port for the webui via HTTP
|
||||
"""
|
||||
port: Int
|
||||
"""
|
||||
Port for the webui via HTTPS
|
||||
"""
|
||||
portssl: Int
|
||||
localTld: String
|
||||
bindMgt: Boolean
|
||||
"""
|
||||
Should telnet be enabled?
|
||||
"""
|
||||
useTelnet: Boolean
|
||||
porttelnet: Int
|
||||
useSsh: Boolean
|
||||
portssh: Int
|
||||
startPage: String
|
||||
startArray: Boolean
|
||||
spindownDelay: String
|
||||
queueDepth: String
|
||||
spinupGroups: Boolean
|
||||
defaultFormat: String
|
||||
defaultFsType: String
|
||||
shutdownTimeout: Int
|
||||
luksKeyfile: String
|
||||
pollAttributes: String
|
||||
pollAttributesDefault: String
|
||||
pollAttributesStatus: String
|
||||
nrRequests: Int
|
||||
nrRequestsDefault: Int
|
||||
nrRequestsStatus: String
|
||||
mdNumStripes: Int
|
||||
mdNumStripesDefault: Int
|
||||
mdNumStripesStatus: String
|
||||
mdSyncWindow: Int
|
||||
mdSyncWindowDefault: Int
|
||||
mdSyncWindowStatus: String
|
||||
mdSyncThresh: Int
|
||||
mdSyncThreshDefault: Int
|
||||
mdSyncThreshStatus: String
|
||||
mdWriteMethod: Int
|
||||
mdWriteMethodDefault: String
|
||||
mdWriteMethodStatus: String
|
||||
shareDisk: String
|
||||
shareUser: String
|
||||
shareUserInclude: String
|
||||
shareUserExclude: String
|
||||
shareSmbEnabled: Boolean
|
||||
shareNfsEnabled: Boolean
|
||||
shareAfpEnabled: Boolean
|
||||
shareInitialOwner: String
|
||||
shareInitialGroup: String
|
||||
shareCacheEnabled: Boolean
|
||||
shareCacheFloor: String
|
||||
shareMoverSchedule: String
|
||||
shareMoverLogging: Boolean
|
||||
fuseRemember: String
|
||||
fuseRememberDefault: String
|
||||
fuseRememberStatus: String
|
||||
fuseDirectio: String
|
||||
fuseDirectioDefault: String
|
||||
fuseDirectioStatus: String
|
||||
shareAvahiEnabled: Boolean
|
||||
shareAvahiSmbName: String
|
||||
shareAvahiSmbModel: String
|
||||
shareAvahiAfpName: String
|
||||
shareAvahiAfpModel: String
|
||||
safeMode: Boolean
|
||||
startMode: String
|
||||
configValid: Boolean
|
||||
configError: ConfigErrorState
|
||||
joinStatus: String
|
||||
deviceCount: Int
|
||||
flashGuid: String
|
||||
flashProduct: String
|
||||
flashVendor: String
|
||||
regCheck: String
|
||||
regFile: String
|
||||
regGuid: String
|
||||
"""
|
||||
Registration type - used to be registrationType enum and should be migrated back, but changed to match mothership for now
|
||||
"""
|
||||
regTy: String
|
||||
regState: RegistrationState
|
||||
"""
|
||||
Registration owner
|
||||
"""
|
||||
regTo: String
|
||||
regTm: String
|
||||
regTm2: String
|
||||
regGen: String
|
||||
sbName: String
|
||||
sbVersion: String
|
||||
sbUpdated: String
|
||||
sbEvents: Int
|
||||
sbState: String
|
||||
sbClean: Boolean
|
||||
sbSynced: Int
|
||||
sbSyncErrs: Int
|
||||
sbSynced2: Int
|
||||
sbSyncExit: String
|
||||
sbNumDisks: Int
|
||||
mdColor: String
|
||||
mdNumDisks: Int
|
||||
mdNumDisabled: Int
|
||||
mdNumInvalid: Int
|
||||
mdNumMissing: Int
|
||||
mdNumNew: Int
|
||||
mdNumErased: Int
|
||||
mdResync: Int
|
||||
mdResyncCorr: String
|
||||
mdResyncPos: String
|
||||
mdResyncDb: String
|
||||
mdResyncDt: String
|
||||
mdResyncAction: String
|
||||
mdResyncSize: Int
|
||||
mdState: String
|
||||
mdVersion: String
|
||||
cacheNumDevices: Int
|
||||
cacheSbNumDisks: Int
|
||||
fsState: String
|
||||
"""
|
||||
Human friendly string of array events happening
|
||||
"""
|
||||
fsProgress: String
|
||||
"""
|
||||
Percentage from 0 - 100 while upgrading a disk or swapping parity drives
|
||||
"""
|
||||
fsCopyPrcnt: Int
|
||||
fsNumMounted: Int
|
||||
fsNumUnmountable: Int
|
||||
fsUnmountableMask: String
|
||||
"""
|
||||
Total amount of user shares
|
||||
"""
|
||||
shareCount: Int
|
||||
"""
|
||||
Total amount shares with SMB enabled
|
||||
"""
|
||||
shareSmbCount: Int
|
||||
"""
|
||||
Total amount shares with NFS enabled
|
||||
"""
|
||||
shareNfsCount: Int
|
||||
"""
|
||||
Total amount shares with AFP enabled
|
||||
"""
|
||||
shareAfpCount: Int
|
||||
shareMoverActive: Boolean
|
||||
csrfToken: String
|
||||
}
|
||||
|
||||
enum mdState {
|
||||
SWAP_DSBL
|
||||
STARTED
|
||||
}
|
||||
|
||||
enum registrationType {
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
INVALID
|
||||
TRIAL
|
||||
}
|
||||
|
||||
enum RegistrationState {
|
||||
TRIAL
|
||||
BASIC
|
||||
PLUS
|
||||
PRO
|
||||
STARTER
|
||||
UNLEASHED
|
||||
LIFETIME
|
||||
"""
|
||||
Trial Expired
|
||||
"""
|
||||
EEXPIRED
|
||||
"""
|
||||
GUID Error
|
||||
"""
|
||||
EGUID
|
||||
"""
|
||||
Multiple License Keys Present
|
||||
"""
|
||||
EGUID1
|
||||
"""
|
||||
Invalid installation
|
||||
"""
|
||||
ETRIAL
|
||||
"""
|
||||
No Keyfile
|
||||
"""
|
||||
ENOKEYFILE
|
||||
"""
|
||||
No Keyfile
|
||||
"""
|
||||
ENOKEYFILE1
|
||||
"""
|
||||
Missing key file
|
||||
"""
|
||||
ENOKEYFILE2
|
||||
"""
|
||||
No Flash
|
||||
"""
|
||||
ENOFLASH
|
||||
ENOFLASH1
|
||||
ENOFLASH2
|
||||
ENOFLASH3
|
||||
ENOFLASH4
|
||||
ENOFLASH5
|
||||
ENOFLASH6
|
||||
ENOFLASH7
|
||||
"""
|
||||
BLACKLISTED
|
||||
"""
|
||||
EBLACKLISTED
|
||||
"""
|
||||
BLACKLISTED
|
||||
"""
|
||||
EBLACKLISTED1
|
||||
"""
|
||||
BLACKLISTED
|
||||
"""
|
||||
EBLACKLISTED2
|
||||
"""
|
||||
Trial Requires Internet Connection
|
||||
"""
|
||||
ENOCONN
|
||||
}
|
||||
@@ -1,247 +1,213 @@
|
||||
import { type IniStringBoolean, type IniStringBooleanOrAuto } from '@app/core/types/ini';
|
||||
import {
|
||||
type IniStringBoolean,
|
||||
type IniStringBooleanOrAuto,
|
||||
} from '@app/core/types/ini';
|
||||
import { type FsType } from '@app/core/types/states/var';
|
||||
import { toNumber } from '@app/core/utils';
|
||||
import { ArrayState, RegistrationState, type registrationType } from '@app/graphql/generated/api/types';
|
||||
import {
|
||||
ArrayState,
|
||||
RegistrationState,
|
||||
registrationType,
|
||||
} from '@app/graphql/generated/api/types';
|
||||
import type { StateFileToIniParserMap } from '@app/store/types';
|
||||
|
||||
/**
|
||||
* Unraid registration check
|
||||
*/
|
||||
type RegistrationCheck =
|
||||
/** Key file is missing. */
|
||||
'ENOKEYFILE2' |
|
||||
/** Everything is fine. */
|
||||
'';
|
||||
|
||||
/**
|
||||
* Unraid registration type
|
||||
*
|
||||
* Check the {@link https://unraid.net/pricing | pricing page} for up to date info.
|
||||
*/
|
||||
type RegistrationType =
|
||||
/** Missing key file. */
|
||||
'- missing key file' |
|
||||
/** Free trial */
|
||||
'Trial' |
|
||||
/** Up to 6 attached storage devices. */
|
||||
'Basic' |
|
||||
/** Up to 12 attached storage devices. */
|
||||
'Plus' |
|
||||
/** Unlimited attached storage devices. */
|
||||
'Pro';
|
||||
|
||||
type RegistrationState =
|
||||
'TRIAL' |
|
||||
'BASIC' |
|
||||
'PLUS' |
|
||||
'PRO' |
|
||||
'EEXPIRED' |
|
||||
'EGUID' |
|
||||
'EGUID1' |
|
||||
'ETRIAL' |
|
||||
'ENOKEYFILE' |
|
||||
'ENOKEYFILE1' |
|
||||
'ENOKEYFILE2' |
|
||||
'ENOFLASH1' |
|
||||
'ENOFLASH2' |
|
||||
'ENOFLASH3' |
|
||||
'ENOFLASH4' |
|
||||
'ENOFLASH5' |
|
||||
'ENOFLASH6' |
|
||||
'ENOFLASH7' |
|
||||
'EBLACKLISTED' |
|
||||
'EBLACKLISTED1' |
|
||||
'EBLACKLISTED2' |
|
||||
'ENOCONN';
|
||||
/** Key file is missing. */
|
||||
| 'ENOKEYFILE2'
|
||||
/** Everything is fine. */
|
||||
| '';
|
||||
|
||||
export type VarIni = {
|
||||
bindMgt: IniStringBooleanOrAuto;
|
||||
cacheNumDevices: string;
|
||||
cacheSbNumDisks: string;
|
||||
comment: string;
|
||||
configValid: string;
|
||||
configState: string;
|
||||
csrfToken: string;
|
||||
defaultFormat: string;
|
||||
defaultFsType: FsType;
|
||||
deviceCount: string;
|
||||
domain: string;
|
||||
domainLogin: string;
|
||||
domainShort: string;
|
||||
flashGuid: string;
|
||||
flashProduct: string;
|
||||
flashVendor: string;
|
||||
fsCopyPrcnt: string;
|
||||
fsNumMounted: string;
|
||||
fsNumUnmountable: string;
|
||||
fsProgress: string;
|
||||
fsState: string;
|
||||
fsUnmountableMask: string;
|
||||
fuseDirectio: string;
|
||||
fuseDirectioDefault: string;
|
||||
fuseDirectioStatus: string;
|
||||
fuseRemember: string;
|
||||
fuseRememberDefault: string;
|
||||
fuseRememberStatus: string;
|
||||
hideDotFiles: string;
|
||||
localMaster: string;
|
||||
localTld: string;
|
||||
luksKeyfile: string;
|
||||
maxArraysz: string;
|
||||
maxCachesz: string;
|
||||
mdColor: string;
|
||||
mdNumDisabled: string;
|
||||
mdNumDisks: string;
|
||||
mdNumErased: string;
|
||||
mdNumInvalid: string;
|
||||
mdNumMissing: string;
|
||||
mdNumNew: string;
|
||||
mdNumStripes: string;
|
||||
mdNumStripesDefault: string;
|
||||
mdNumStripesStatus: string;
|
||||
mdResync: string;
|
||||
mdResyncAction: string;
|
||||
mdResyncCorr: string;
|
||||
mdResyncDb: string;
|
||||
mdResyncDt: string;
|
||||
mdResyncPos: string;
|
||||
mdResyncSize: string;
|
||||
mdState: string;
|
||||
mdSyncThresh: string;
|
||||
mdSyncThreshDefault: string;
|
||||
mdSyncThreshStatus: string;
|
||||
mdSyncWindow: string;
|
||||
mdSyncWindowDefault: string;
|
||||
mdSyncWindowStatus: string;
|
||||
mdVersion: string;
|
||||
mdWriteMethod: string;
|
||||
mdWriteMethodDefault: string;
|
||||
mdWriteMethodStatus: string;
|
||||
name: string;
|
||||
nrRequests: string;
|
||||
nrRequestsDefault: string;
|
||||
ntpServer1: string;
|
||||
ntpServer2: string;
|
||||
ntpServer3: string;
|
||||
ntpServer4: string;
|
||||
pollAttributes: string;
|
||||
pollAttributesDefault: string;
|
||||
pollAttributesStatus: string;
|
||||
port: string;
|
||||
portssh: string;
|
||||
portssl: string;
|
||||
porttelnet: string;
|
||||
queueDepth: string;
|
||||
regCheck: RegistrationCheck;
|
||||
regFile: string;
|
||||
regGen: string;
|
||||
regGuid: string;
|
||||
regTm: string;
|
||||
regTm2: string;
|
||||
regTo: string;
|
||||
regTy: RegistrationType;
|
||||
regState: RegistrationState;
|
||||
safeMode: string;
|
||||
sbClean: string;
|
||||
sbEvents: string;
|
||||
sbName: string;
|
||||
sbNumDisks: string;
|
||||
sbState: string;
|
||||
sbSynced: string;
|
||||
sbSynced2: string;
|
||||
sbSyncErrs: string;
|
||||
sbSyncExit: string;
|
||||
sbUpdated: string;
|
||||
sbVersion: string;
|
||||
security: string;
|
||||
shareAvahiEnabled: string;
|
||||
shareAvahiSmbModel: string;
|
||||
shareAvahiSmbName: string;
|
||||
shareCacheEnabled: string;
|
||||
shareCacheFloor: string;
|
||||
shareCount: string;
|
||||
shareDisk: string;
|
||||
shareInitialGroup: string;
|
||||
shareInitialOwner: string;
|
||||
shareMoverActive: string;
|
||||
shareMoverLogging: string;
|
||||
shareMoverSchedule: string;
|
||||
shareNfsCount: string;
|
||||
shareNfsEnabled: string;
|
||||
shareSmbCount: string;
|
||||
shareSmbEnabled: string;
|
||||
shareUser: string;
|
||||
shareUserExclude: string;
|
||||
shutdownTimeout: string;
|
||||
spindownDelay: string;
|
||||
spinupGroups: string;
|
||||
startArray: string;
|
||||
startMode: string;
|
||||
startPage: string;
|
||||
sysArraySlots: string;
|
||||
sysCacheSlots: string;
|
||||
sysFlashSlots: string;
|
||||
sysModel: string;
|
||||
timeZone: string;
|
||||
useNtp: IniStringBoolean;
|
||||
useSsh: IniStringBoolean;
|
||||
useSsl: IniStringBooleanOrAuto;
|
||||
useTelnet: string;
|
||||
version: string;
|
||||
workgroup: string;
|
||||
useUpnp: IniStringBoolean;
|
||||
bindMgt: IniStringBooleanOrAuto;
|
||||
cacheNumDevices: string;
|
||||
cacheSbNumDisks: string;
|
||||
comment: string;
|
||||
configValid: string;
|
||||
configState: string;
|
||||
csrfToken: string;
|
||||
defaultFormat: string;
|
||||
defaultFsType: FsType;
|
||||
deviceCount: string;
|
||||
domain: string;
|
||||
domainLogin: string;
|
||||
domainShort: string;
|
||||
flashGuid: string;
|
||||
flashProduct: string;
|
||||
flashVendor: string;
|
||||
fsCopyPrcnt: string;
|
||||
fsNumMounted: string;
|
||||
fsNumUnmountable: string;
|
||||
fsProgress: string;
|
||||
fsState: string;
|
||||
fsUnmountableMask: string;
|
||||
fuseDirectio: string;
|
||||
fuseDirectioDefault: string;
|
||||
fuseDirectioStatus: string;
|
||||
fuseRemember: string;
|
||||
fuseRememberDefault: string;
|
||||
fuseRememberStatus: string;
|
||||
hideDotFiles: string;
|
||||
localMaster: string;
|
||||
localTld: string;
|
||||
luksKeyfile: string;
|
||||
maxArraysz: string;
|
||||
maxCachesz: string;
|
||||
mdColor: string;
|
||||
mdNumDisabled: string;
|
||||
mdNumDisks: string;
|
||||
mdNumErased: string;
|
||||
mdNumInvalid: string;
|
||||
mdNumMissing: string;
|
||||
mdNumNew: string;
|
||||
mdNumStripes: string;
|
||||
mdNumStripesDefault: string;
|
||||
mdNumStripesStatus: string;
|
||||
mdResync: string;
|
||||
mdResyncAction: string;
|
||||
mdResyncCorr: string;
|
||||
mdResyncDb: string;
|
||||
mdResyncDt: string;
|
||||
mdResyncPos: string;
|
||||
mdResyncSize: string;
|
||||
mdState: string;
|
||||
mdSyncThresh: string;
|
||||
mdSyncThreshDefault: string;
|
||||
mdSyncThreshStatus: string;
|
||||
mdSyncWindow: string;
|
||||
mdSyncWindowDefault: string;
|
||||
mdSyncWindowStatus: string;
|
||||
mdVersion: string;
|
||||
mdWriteMethod: string;
|
||||
mdWriteMethodDefault: string;
|
||||
mdWriteMethodStatus: string;
|
||||
name: string;
|
||||
nrRequests: string;
|
||||
nrRequestsDefault: string;
|
||||
ntpServer1: string;
|
||||
ntpServer2: string;
|
||||
ntpServer3: string;
|
||||
ntpServer4: string;
|
||||
pollAttributes: string;
|
||||
pollAttributesDefault: string;
|
||||
pollAttributesStatus: string;
|
||||
port: string;
|
||||
portssh: string;
|
||||
portssl: string;
|
||||
porttelnet: string;
|
||||
queueDepth: string;
|
||||
regCheck: RegistrationCheck;
|
||||
regFile: string;
|
||||
regGen: string;
|
||||
regGuid: string;
|
||||
regTm: string;
|
||||
regTm2: string;
|
||||
regTo: string;
|
||||
regTy: string;
|
||||
regState: string;
|
||||
safeMode: string;
|
||||
sbClean: string;
|
||||
sbEvents: string;
|
||||
sbName: string;
|
||||
sbNumDisks: string;
|
||||
sbState: string;
|
||||
sbSynced: string;
|
||||
sbSynced2: string;
|
||||
sbSyncErrs: string;
|
||||
sbSyncExit: string;
|
||||
sbUpdated: string;
|
||||
sbVersion: string;
|
||||
security: string;
|
||||
shareAvahiEnabled: string;
|
||||
shareAvahiSmbModel: string;
|
||||
shareAvahiSmbName: string;
|
||||
shareCacheEnabled: string;
|
||||
shareCacheFloor: string;
|
||||
shareCount: string;
|
||||
shareDisk: string;
|
||||
shareInitialGroup: string;
|
||||
shareInitialOwner: string;
|
||||
shareMoverActive: string;
|
||||
shareMoverLogging: string;
|
||||
shareMoverSchedule: string;
|
||||
shareNfsCount: string;
|
||||
shareNfsEnabled: string;
|
||||
shareSmbCount: string;
|
||||
shareSmbEnabled: string;
|
||||
shareUser: string;
|
||||
shareUserExclude: string;
|
||||
shutdownTimeout: string;
|
||||
spindownDelay: string;
|
||||
spinupGroups: string;
|
||||
startArray: string;
|
||||
startMode: string;
|
||||
startPage: string;
|
||||
sysArraySlots: string;
|
||||
sysCacheSlots: string;
|
||||
sysFlashSlots: string;
|
||||
sysModel: string;
|
||||
timeZone: string;
|
||||
useNtp: IniStringBoolean;
|
||||
useSsh: IniStringBoolean;
|
||||
useSsl: IniStringBooleanOrAuto;
|
||||
useTelnet: string;
|
||||
version: string;
|
||||
workgroup: string;
|
||||
useUpnp: IniStringBoolean;
|
||||
};
|
||||
|
||||
const iniBooleanToJsBoolean = (value: string, defaultValue?: boolean) => {
|
||||
if (value === 'no' || value === 'false') {
|
||||
return false;
|
||||
}
|
||||
if (value === 'no' || value === 'false') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (value === 'yes' || value === 'true') {
|
||||
return true;
|
||||
}
|
||||
if (value === 'yes' || value === 'true') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (defaultValue !== undefined) {
|
||||
return defaultValue;
|
||||
}
|
||||
if (defaultValue !== undefined) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
throw new Error(`Value "${value}" is not false/true or no/yes.`);
|
||||
throw new Error(`Value "${value}" is not false/true or no/yes.`);
|
||||
};
|
||||
|
||||
const iniBooleanOrAutoToJsBoolean = (value: IniStringBooleanOrAuto) => {
|
||||
try {
|
||||
// Either it'll return true/false or throw
|
||||
return iniBooleanToJsBoolean((value as IniStringBoolean));
|
||||
} catch {
|
||||
// Auto or null
|
||||
if (value === 'auto') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
try {
|
||||
// Either it'll return true/false or throw
|
||||
return iniBooleanToJsBoolean(value as IniStringBoolean);
|
||||
} catch {
|
||||
// Auto or null
|
||||
if (value === 'auto') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`Value "${value as string}" is not auto/no/yes.`);
|
||||
throw new Error(`Value "${value as string}" is not auto/no/yes.`);
|
||||
};
|
||||
|
||||
const safeParseMdState = (mdState: string | undefined): ArrayState => {
|
||||
if (!mdState || typeof mdState !== 'string') {
|
||||
return ArrayState.STOPPED;
|
||||
}
|
||||
const stateUpper = mdState.toUpperCase()
|
||||
const attemptedParse =
|
||||
if (!mdState || typeof mdState !== 'string') {
|
||||
return ArrayState.STOPPED;
|
||||
}
|
||||
const stateUpper = mdState.toUpperCase();
|
||||
const attemptedParse =
|
||||
ArrayState[
|
||||
stateUpper.startsWith('ERROR')
|
||||
? stateUpper.split(':')[1]
|
||||
: stateUpper
|
||||
];
|
||||
|
||||
if (!attemptedParse) {
|
||||
return ArrayState.STOPPED
|
||||
}
|
||||
return attemptedParse;
|
||||
}
|
||||
if (!attemptedParse) {
|
||||
return ArrayState.STOPPED;
|
||||
}
|
||||
return attemptedParse;
|
||||
};
|
||||
|
||||
export const parse: StateFileToIniParserMap['var'] = iniFile => {
|
||||
return {
|
||||
export const parse: StateFileToIniParserMap['var'] = (iniFile) => {
|
||||
return {
|
||||
...iniFile,
|
||||
mdState: safeParseMdState(iniFile.mdState),
|
||||
bindMgt: iniBooleanOrAutoToJsBoolean(iniFile.bindMgt),
|
||||
@@ -280,12 +246,14 @@ export const parse: StateFileToIniParserMap['var'] = iniFile => {
|
||||
portssl: toNumber(iniFile.portssl),
|
||||
porttelnet: toNumber(iniFile.porttelnet),
|
||||
regCheck: iniFile.regCheck === '' ? 'Valid' : 'Error',
|
||||
regTy: (['Basic', 'Plus', 'Pro', 'Trial'].includes(iniFile.regTy)
|
||||
? iniFile.regTy
|
||||
: 'Invalid'
|
||||
).toUpperCase() as registrationType,
|
||||
regTy:
|
||||
registrationType[iniFile.regTy?.toUpperCase()] ??
|
||||
registrationType.INVALID,
|
||||
// Make sure to use a || not a ?? as regCheck can be an empty string
|
||||
regState: (iniFile.regCheck || iniFile.regTy || '').toUpperCase() ?? RegistrationState.EGUID,
|
||||
regState:
|
||||
RegistrationState[
|
||||
(iniFile.regCheck || iniFile.regTy || '').toUpperCase()
|
||||
] ?? RegistrationState.EGUID,
|
||||
safeMode: iniBooleanToJsBoolean(iniFile.safeMode),
|
||||
sbClean: iniBooleanToJsBoolean(iniFile.sbClean),
|
||||
sbEvents: toNumber(iniFile.sbEvents),
|
||||
|
||||
Reference in New Issue
Block a user