diff --git a/.gitignore b/.gitignore index 766ee6d..ea0eee9 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,13 @@ logs/ # IDE/Editor .bivvy .cursor +.windsurf/ +.1code/ +.emdash.json + +# Backup files +*.bak +*.bak-* # Claude Code user settings (gitignore local settings) .claude/settings.local.json diff --git a/Dockerfile b/Dockerfile index bf7baa4..876256c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ FROM python:3.12-slim # Set the working directory in the container WORKDIR /app -# Install uv -COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ +# Install uv (pinned tag to avoid mutable latest) +COPY --from=ghcr.io/astral-sh/uv:0.5.4 /uv /uvx /usr/local/bin/ # Create non-root user with home directory and give ownership of /app RUN groupadd --gid 1000 appuser && \ @@ -42,7 +42,7 @@ ENV UNRAID_MCP_LOG_LEVEL="INFO" # Health check HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ - CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:6970/mcp')"] + CMD ["python", "-c", "import os, urllib.request; port = os.getenv('UNRAID_MCP_PORT', '6970'); urllib.request.urlopen(f'http://localhost:{port}/mcp')"] # Run unraid-mcp-server when the container launches CMD ["uv", "run", "unraid-mcp-server"] diff --git a/docker-compose.yml b/docker-compose.yml index 7639bcb..db6a9cb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,14 +10,15 @@ services: - ALL tmpfs: - /tmp:noexec,nosuid,size=64m + - /app/logs:noexec,nosuid,size=16m ports: # HostPort:ContainerPort (maps to UNRAID_MCP_PORT inside the container, default 6970) # Change the host port (left side) if 6970 is already in use on your host - "${UNRAID_MCP_PORT:-6970}:${UNRAID_MCP_PORT:-6970}" environment: # Core API Configuration (Required) - - UNRAID_API_URL=${UNRAID_API_URL} - - UNRAID_API_KEY=${UNRAID_API_KEY} + - UNRAID_API_URL=${UNRAID_API_URL:?UNRAID_API_URL is required} + - UNRAID_API_KEY=${UNRAID_API_KEY:?UNRAID_API_KEY is required} # MCP Server Settings - UNRAID_MCP_PORT=${UNRAID_MCP_PORT:-6970} diff --git a/docs/research/feature-gap-analysis.md b/docs/research/feature-gap-analysis.md index aef3907..588354f 100644 --- a/docs/research/feature-gap-analysis.md +++ b/docs/research/feature-gap-analysis.md @@ -243,13 +243,13 @@ Every mutation identified across all research documents with their parameters an | Mutation | Parameters | Returns | Current MCP Coverage | |----------|------------|---------|---------------------| | `login(username, password)` | `String!`, `String!` | `String` | **NO** | -| `createApiKey(input)` | `CreateApiKeyInput!` | `ApiKeyWithSecret!` | **NO** | +| `apiKey.create(input)` | `CreateApiKeyInput!` | `ApiKey!` | **NO** | | `addPermission(input)` | `AddPermissionInput!` | `Boolean!` | **NO** | | `addRoleForUser(input)` | `AddRoleForUserInput!` | `Boolean!` | **NO** | | `addRoleForApiKey(input)` | `AddRoleForApiKeyInput!` | `Boolean!` | **NO** | | `removeRoleFromApiKey(input)` | `RemoveRoleFromApiKeyInput!` | `Boolean!` | **NO** | -| `deleteApiKeys(input)` | API key IDs | `Boolean` | **NO** | -| `updateApiKey(input)` | API key update data | `Boolean` | **NO** | +| `apiKey.delete(input)` | API key IDs | `Boolean!` | **NO** | +| `apiKey.update(input)` | API key update data | `ApiKey!` | **NO** | | `addUser(input)` | `addUserInput!` | `User` | **NO** | | `deleteUser(input)` | `deleteUserInput!` | `User` | **NO** | @@ -417,11 +417,11 @@ GRAPHQL_PUBSUB_CHANNEL { | Input Type | Used By | Fields | |-----------|---------|--------| -| `CreateApiKeyInput` | `createApiKey` | `name!`, `description`, `roles[]`, `permissions[]`, `overwrite` | +| `CreateApiKeyInput` | `apiKey.create` | `name!`, `description`, `roles[]`, `permissions[]`, `overwrite` | | `AddPermissionInput` | `addPermission` | `resource!`, `actions![]` | | `AddRoleForUserInput` | `addRoleForUser` | User + role assignment | -| `AddRoleForApiKeyInput` | `addRoleForApiKey` | API key + role assignment | -| `RemoveRoleFromApiKeyInput` | `removeRoleFromApiKey` | API key + role removal | +| `AddRoleForApiKeyInput` | `apiKey.addRole` | API key + role assignment | +| `RemoveRoleFromApiKeyInput` | `apiKey.removeRole` | API key + role removal | | `arrayDiskInput` | `addDiskToArray`, `removeDiskFromArray` | Disk assignment data | | `ConnectSignInInput` | `connectSignIn` | Connect credentials | | `EnableDynamicRemoteAccessInput` | `enableDynamicRemoteAccess` | Remote access config | @@ -619,9 +619,9 @@ The current MCP server has 10 tools (76 actions) after consolidation. The follow |--------------|---------------|---------------| | `list_api_keys()` | `apiKeys` query | Key inventory | | `get_api_key(id)` | `apiKey(id)` query | Key details | -| `create_api_key(input)` | `createApiKey` mutation | Key provisioning | -| `delete_api_keys(input)` | `deleteApiKeys` mutation | Key cleanup | -| `update_api_key(input)` | `updateApiKey` mutation | Key modification | +| `create_api_key(input)` | `apiKey.create` mutation | Key provisioning | +| `delete_api_keys(input)` | `apiKey.delete` mutation | Key cleanup | +| `update_api_key(input)` | `apiKey.update` mutation | Key modification | #### Remote Access Management (0 tools currently, 1 query + 3 mutations) diff --git a/docs/research/unraid-api-crawl.md b/docs/research/unraid-api-crawl.md index 9117a40..e854afa 100644 --- a/docs/research/unraid-api-crawl.md +++ b/docs/research/unraid-api-crawl.md @@ -678,11 +678,9 @@ type Query { ```graphql type Mutation { - createApiKey(input: CreateApiKeyInput!): ApiKeyWithSecret! + apiKey: ApiKeyMutations! addPermission(input: AddPermissionInput!): Boolean! addRoleForUser(input: AddRoleForUserInput!): Boolean! - addRoleForApiKey(input: AddRoleForApiKeyInput!): Boolean! - removeRoleFromApiKey(input: RemoveRoleFromApiKeyInput!): Boolean! startArray: Array stopArray: Array addDiskToArray(input: arrayDiskInput): Array diff --git a/docs/research/unraid-api-source-analysis.md b/docs/research/unraid-api-source-analysis.md index f225aff..d9b7155 100644 --- a/docs/research/unraid-api-source-analysis.md +++ b/docs/research/unraid-api-source-analysis.md @@ -565,11 +565,11 @@ api/src/unraid-api/graph/resolvers/ | **RClone** | `createRCloneRemote(input)` | Create remote storage | CREATE_ANY:FLASH | | **RClone** | `deleteRCloneRemote(input)` | Delete remote storage | DELETE_ANY:FLASH | | **UPS** | `configureUps(config)` | Update UPS configuration | UPDATE_ANY:* | -| **API Keys** | `createApiKey(input)` | Create API key | CREATE_ANY:API_KEY | -| **API Keys** | `addRoleForApiKey(input)` | Add role to key | UPDATE_ANY:API_KEY | -| **API Keys** | `removeRoleFromApiKey(input)` | Remove role from key | UPDATE_ANY:API_KEY | -| **API Keys** | `deleteApiKeys(input)` | Delete API keys | DELETE_ANY:API_KEY | -| **API Keys** | `updateApiKey(input)` | Update API key | UPDATE_ANY:API_KEY | +| **API Keys** | `apiKey.create(input)` | Create API key | CREATE_ANY:API_KEY | +| **API Keys** | `apiKey.addRole(input)` | Add role to key | UPDATE_ANY:API_KEY | +| **API Keys** | `apiKey.removeRole(input)` | Remove role from key | UPDATE_ANY:API_KEY | +| **API Keys** | `apiKey.delete(input)` | Delete API keys | DELETE_ANY:API_KEY | +| **API Keys** | `apiKey.update(input)` | Update API key | UPDATE_ANY:API_KEY | --- diff --git a/docs/unraid-schema.graphql b/docs/unraid-schema.graphql index 43c1ef7..2f51f85 100644 --- a/docs/unraid-schema.graphql +++ b/docs/unraid-schema.graphql @@ -1,140 +1,645 @@ -# Unraid GraphQL API Schema (SDL) -# Extracted from live introspection of the Unraid API. -# Used for offline validation of MCP tool queries and mutations. +# ------------------------------------------------------ +# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY) +# ------------------------------------------------------ -# ============================================================================ -# Custom Scalars -# ============================================================================ -scalar BigInt +"""Directive to document required permissions for fields""" +directive @usePermissions( + """The action required for access (must be a valid AuthAction enum value)""" + action: String + + """The resource required for access (must be a valid Resource enum value)""" + resource: String +) on FIELD_DEFINITION + +type ParityCheck { + """Date of the parity check""" + date: DateTime + + """Duration of the parity check in seconds""" + duration: Int + + """Speed of the parity check, in MB/s""" + speed: String + + """Status of the parity check""" + status: ParityCheckStatus! + + """Number of errors during the parity check""" + errors: Int + + """Progress percentage of the parity check""" + progress: Int + + """Whether corrections are being written to parity""" + correcting: Boolean + + """Whether the parity check is paused""" + paused: Boolean + + """Whether the parity check is running""" + running: Boolean +} + +""" +A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. +""" scalar DateTime -scalar JSON -scalar PrefixedID -scalar Port -# ============================================================================ -# Enums -# ============================================================================ -enum ArrayState { - DISABLE_DISK - INVALID_EXPANSION - NEW_ARRAY - NEW_DISK_TOO_SMALL - NO_DATA_DISKS - PARITY_NOT_BIGGEST - RECON_DISK - STARTED - STOPPED - SWAP_DSBL - TOO_MANY_MISSING_DISKS +enum ParityCheckStatus { + NEVER_RUN + RUNNING + PAUSED + COMPLETED + CANCELLED + FAILED } -enum ArrayStateInputState { - START - STOP +type Capacity { + """Free capacity""" + free: String! + + """Used capacity""" + used: String! + + """Total capacity""" + total: String! } -enum ArrayDiskFsColor { - BLUE_BLINK - BLUE_ON - GREEN_BLINK - GREEN_ON - GREY_OFF - RED_OFF - RED_ON - YELLOW_BLINK - YELLOW_ON +type ArrayCapacity { + """Capacity in kilobytes""" + kilobytes: Capacity! + + """Capacity in number of disks""" + disks: Capacity! } +type ArrayDisk implements Node { + id: PrefixedID! + + """ + Array slot number. Parity1 is always 0 and Parity2 is always 29. Array slots will be 1 - 28. Cache slots are 30 - 53. Flash is 54. + """ + idx: Int! + name: String + device: String + + """(KB) Disk Size total""" + size: BigInt + status: ArrayDiskStatus + + """Is the disk a HDD or SSD.""" + rotational: Boolean + + """Disk temp - will be NaN if array is not started or DISK_NP""" + temp: Int + + """ + Count of I/O read requests sent to the device I/O drivers. These statistics may be cleared at any time. + """ + numReads: BigInt + + """ + Count of I/O writes requests sent to the device I/O drivers. These statistics may be cleared at any time. + """ + numWrites: BigInt + + """ + Number of unrecoverable errors reported by the device I/O drivers. Missing data due to unrecoverable array read errors is filled in on-the-fly using parity reconstruct (and we attempt to write this data back to the sector(s) which failed). Any unrecoverable write error results in disabling the disk. + """ + numErrors: BigInt + + """(KB) Total Size of the FS (Not present on Parity type drive)""" + fsSize: BigInt + + """(KB) Free Size on the FS (Not present on Parity type drive)""" + fsFree: BigInt + + """(KB) Used Size on the FS (Not present on Parity type drive)""" + fsUsed: BigInt + exportable: Boolean + + """ + Type of Disk - used to differentiate Boot / Cache / Flash / Data (DATA) / Parity + """ + type: ArrayDiskType! + + """(%) Disk space left to warn""" + warning: Int + + """(%) Disk space left for critical""" + critical: Int + + """File system type for the disk""" + fsType: String + + """User comment on disk""" + comment: String + + """File format (ex MBR: 4KiB-aligned)""" + format: String + + """ata | nvme | usb | (others)""" + transport: String + color: ArrayDiskFsColor + + """Whether the disk is currently spinning""" + isSpinning: Boolean +} + +interface Node { + id: PrefixedID! +} + +""" +The `BigInt` scalar type represents non-fractional signed whole numeric values. +""" +scalar BigInt + enum ArrayDiskStatus { - DISK_DSBL - DISK_DSBL_NEW - DISK_INVALID - DISK_NEW DISK_NP - DISK_NP_DSBL - DISK_NP_MISSING DISK_OK + DISK_NP_MISSING + DISK_INVALID DISK_WRONG + DISK_DSBL + DISK_NP_DSBL + DISK_DSBL_NEW + DISK_NEW } enum ArrayDiskType { - CACHE DATA - FLASH PARITY + BOOT + FLASH + CACHE } -enum AuthAction { - CREATE_ANY - CREATE_OWN - DELETE_ANY - DELETE_OWN - READ_ANY - READ_OWN - UPDATE_ANY - UPDATE_OWN +enum ArrayDiskFsColor { + GREEN_ON + GREEN_BLINK + BLUE_ON + BLUE_BLINK + YELLOW_ON + YELLOW_BLINK + RED_ON + RED_OFF + GREY_OFF } -enum ContainerPortType { - TCP - UDP +type UnraidArray implements Node { + id: PrefixedID! + + """Current array state""" + state: ArrayState! + + """Current array capacity""" + capacity: ArrayCapacity! + + """Returns the active boot disk""" + boot: ArrayDisk + + """ + All detected boot devices: every Boot entry for internal boot, including mirrored members when configured, or the mounted /boot Flash entry for legacy USB boot + """ + bootDevices: [ArrayDisk!]! + + """Parity disks in the current array""" + parities: [ArrayDisk!]! + + """Current parity check status""" + parityCheckStatus: ParityCheck! + + """Data disks in the current array""" + disks: [ArrayDisk!]! + + """Caches in the current array""" + caches: [ArrayDisk!]! } -enum ContainerState { - EXITED - RUNNING +enum ArrayState { + STARTED + STOPPED + NEW_ARRAY + RECON_DISK + DISABLE_DISK + SWAP_DSBL + INVALID_EXPANSION + PARITY_NOT_BIGGEST + TOO_MANY_MISSING_DISKS + NEW_DISK_TOO_SMALL + NO_DATA_DISKS } -enum ConfigErrorState { - INELIGIBLE - INVALID - NO_KEY_SERVER - UNKNOWN_ERROR - WITHDRAWN +type Share implements Node { + id: PrefixedID! + + """Display name""" + name: String + + """(KB) Free space""" + free: BigInt + + """(KB) Used Size""" + used: BigInt + + """(KB) Total size""" + size: BigInt + + """Disks that are included in this share""" + include: [String!] + + """Disks that are excluded from this share""" + exclude: [String!] + + """Is this share cached""" + cache: Boolean + + """Original name""" + nameOrig: String + + """User comment""" + comment: String + + """Allocator""" + allocator: String + + """Split level""" + splitLevel: String + + """Floor""" + floor: String + + """COW""" + cow: String + + """Color""" + color: String + + """LUKS status""" + luksStatus: String } +type DiskPartition { + """The name of the partition""" + name: String! + + """The filesystem type of the partition""" + fsType: DiskFsType! + + """The size of the partition in bytes""" + size: Float! +} + +"""The type of filesystem on the disk partition""" enum DiskFsType { + XFS BTRFS + VFAT + ZFS EXT4 NTFS - VFAT - XFS - ZFS } +type Disk implements Node { + id: PrefixedID! + + """The device path of the disk (e.g. /dev/sdb)""" + device: String! + + """The type of disk (e.g. SSD, HDD)""" + type: String! + + """The model name of the disk""" + name: String! + + """The manufacturer of the disk""" + vendor: String! + + """The total size of the disk in bytes""" + size: Float! + + """The number of bytes per sector""" + bytesPerSector: Float! + + """The total number of cylinders on the disk""" + totalCylinders: Float! + + """The total number of heads on the disk""" + totalHeads: Float! + + """The total number of sectors on the disk""" + totalSectors: Float! + + """The total number of tracks on the disk""" + totalTracks: Float! + + """The number of tracks per cylinder""" + tracksPerCylinder: Float! + + """The number of sectors per track""" + sectorsPerTrack: Float! + + """The firmware revision of the disk""" + firmwareRevision: String! + + """The serial number of the disk""" + serialNum: String! + + """ + Device identifier from emhttp devs.ini used by disk assignment commands + """ + emhttpDeviceId: String + + """The interface type of the disk""" + interfaceType: DiskInterfaceType! + + """The SMART status of the disk""" + smartStatus: DiskSmartStatus! + + """The current temperature of the disk in Celsius""" + temperature: Float + + """The partitions on the disk""" + partitions: [DiskPartition!]! + + """Whether the disk is spinning or not""" + isSpinning: Boolean! +} + +"""The type of interface the disk uses to connect to the system""" enum DiskInterfaceType { - PCIE SAS SATA - UNKNOWN USB + PCIE + UNKNOWN } +""" +The SMART (Self-Monitoring, Analysis and Reporting Technology) status of the disk +""" enum DiskSmartStatus { OK UNKNOWN } -enum NotificationImportance { - ALERT - INFO - WARNING +type KeyFile { + location: String + contents: String } -enum NotificationType { - ARCHIVE - UNREAD +type Registration implements Node { + id: PrefixedID! + type: registrationType + keyFile: KeyFile + state: RegistrationState + expiration: String + updateExpiration: String } -enum ParityCheckStatus { - CANCELLED - COMPLETED - FAILED - NEVER_RUN - PAUSED - RUNNING +enum registrationType { + BASIC + PLUS + PRO + STARTER + UNLEASHED + LIFETIME + INVALID + TRIAL } +enum RegistrationState { + TRIAL + BASIC + PLUS + PRO + STARTER + UNLEASHED + LIFETIME + EEXPIRED + EGUID + EGUID1 + ETRIAL + ENOKEYFILE + ENOKEYFILE1 + ENOKEYFILE2 + ENOFLASH + ENOFLASH1 + ENOFLASH2 + ENOFLASH3 + ENOFLASH4 + ENOFLASH5 + ENOFLASH6 + ENOFLASH7 + EBLACKLISTED + EBLACKLISTED1 + EBLACKLISTED2 + ENOCONN +} + +type Vars implements Node { + id: PrefixedID! + + """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 + regTy: registrationType + 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 + bootEligible: Boolean + enableBootTransfer: String + reservedNames: 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 +} + +"""Possible error states for configuration""" +enum ConfigErrorState { + UNKNOWN_ERROR + INELIGIBLE + INVALID + NO_KEY_SERVER + WITHDRAWN +} + +type Permission { + resource: Resource! + + """Actions allowed on this resource""" + actions: [AuthAction!]! +} + +"""Available resources for permissions""" enum Resource { ACTIVATION_CODE API_KEY @@ -167,64 +672,155 @@ enum Resource { WELCOME } +"""Authentication actions with possession (e.g., create:any, read:own)""" +enum AuthAction { + """Create any resource""" + CREATE_ANY + + """Create own resource""" + CREATE_OWN + + """Read any resource""" + READ_ANY + + """Read own resource""" + READ_OWN + + """Update any resource""" + UPDATE_ANY + + """Update own resource""" + UPDATE_OWN + + """Delete any resource""" + DELETE_ANY + + """Delete own resource""" + DELETE_OWN +} + +type ApiKey implements Node { + id: PrefixedID! + key: String! + name: String! + description: String + roles: [Role!]! + createdAt: String! + permissions: [Permission!]! +} + +"""Available roles for API keys and users""" enum Role { + """Full administrative access to all resources""" ADMIN + + """Internal Role for Unraid Connect""" CONNECT + + """Basic read access to user profile only""" GUEST + + """Read-only access to all resources""" VIEWER } -enum RegistrationState { - BASIC - EBLACKLISTED - EBLACKLISTED1 - EBLACKLISTED2 - EEXPIRED - EGUID - EGUID1 - ENOCONN - ENOFLASH - ENOFLASH1 - ENOFLASH2 - ENOFLASH3 - ENOFLASH4 - ENOFLASH5 - ENOFLASH6 - ENOFLASH7 - ENOKEYFILE - ENOKEYFILE1 - ENOKEYFILE2 - ETRIAL - LIFETIME - PLUS - PRO - STARTER - TRIAL - UNLEASHED +type SsoSettings implements Node { + id: PrefixedID! + + """List of configured OIDC providers""" + oidcProviders: [OidcProvider!]! } -enum registrationType { - BASIC - INVALID - LIFETIME - PLUS - PRO - STARTER - TRIAL - UNLEASHED +type UnifiedSettings implements Node & FormSchema { + id: PrefixedID! + + """The data schema for the settings""" + dataSchema: JSON! + + """The UI schema for the settings""" + uiSchema: JSON! + + """The current values of the settings""" + values: JSON! } -enum ServerStatus { - NEVER_CONNECTED - OFFLINE - ONLINE +interface FormSchema { + """The data schema for the form""" + dataSchema: JSON! + + """The UI schema for the form""" + uiSchema: JSON! + + """The current values of the form""" + values: JSON! } -enum Temperature { - CELSIUS - FAHRENHEIT +""" +The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON @specifiedBy(url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf") + +type ApiKeyFormSettings implements Node & FormSchema { + id: PrefixedID! + + """The data schema for the API key form""" + dataSchema: JSON! + + """The UI schema for the API key form""" + uiSchema: JSON! + + """The current values of the API key form""" + values: JSON! } +type UpdateSettingsResponse { + """Whether a restart is required for the changes to take effect""" + restartRequired: Boolean! + + """The updated settings values""" + values: JSON! + + """Warning messages about configuration issues found during validation""" + warnings: [String!] +} + +type Settings implements Node { + id: PrefixedID! + + """A view of all settings""" + unified: UnifiedSettings! + + """SSO settings""" + sso: SsoSettings! + + """The API setting values""" + api: ApiConfig! +} + +type Theme { + """The theme name""" + name: ThemeName! + + """Whether to show the header banner image""" + showBannerImage: Boolean! + + """Whether to show the banner gradient""" + showBannerGradient: Boolean! + + """Whether to show the description in the header""" + showHeaderDescription: Boolean! + + """The background color of the header""" + headerBackgroundColor: String + + """The text color of the header""" + headerPrimaryTextColor: String + + """The secondary text color of the header""" + headerSecondaryTextColor: String +} + +"""The theme name""" enum ThemeName { azure black @@ -232,232 +828,675 @@ enum ThemeName { white } -enum UpdateStatus { - REBUILD_READY - UNKNOWN - UPDATE_AVAILABLE - UP_TO_DATE +type InfoDisplayCase implements Node { + id: PrefixedID! + + """Case image URL""" + url: String! + + """Case icon identifier""" + icon: String! + + """Error message if any""" + error: String! + + """Base64 encoded case image""" + base64: String! } -enum VmState { - CRASHED - IDLE - NOSTATE - PAUSED - PMSUSPENDED +type InfoDisplay implements Node { + id: PrefixedID! + + """Case display configuration""" + case: InfoDisplayCase! + + """UI theme name""" + theme: ThemeName! + + """Temperature unit (C or F)""" + unit: Temperature! + + """Enable UI scaling""" + scale: Boolean! + + """Show tabs in UI""" + tabs: Boolean! + + """Enable UI resize""" + resize: Boolean! + + """Show WWN identifiers""" + wwn: Boolean! + + """Show totals""" + total: Boolean! + + """Show usage statistics""" + usage: Boolean! + + """Show text labels""" + text: Boolean! + + """Warning temperature threshold""" + warning: Int! + + """Critical temperature threshold""" + critical: Int! + + """Hot temperature threshold""" + hot: Int! + + """Maximum temperature threshold""" + max: Int + + """Locale setting""" + locale: String +} + +"""Temperature unit""" +enum Temperature { + CELSIUS + FAHRENHEIT +} + +type Language { + """Language code (e.g. en_US)""" + code: String! + + """Language description/name""" + name: String! + + """URL to the language pack XML""" + url: String +} + +type PartnerLink { + """Display title for the link""" + title: String! + + """The URL""" + url: String! +} + +type PartnerConfig { + name: String + url: String + + """Link to hardware specifications for this system""" + hardwareSpecsUrl: String + + """Link to the system manual/documentation""" + manualUrl: String + + """Link to manufacturer support page""" + supportUrl: String + + """Additional custom links provided by the partner""" + extraLinks: [PartnerLink!] +} + +type BrandingConfig { + header: String + headermetacolor: String + background: String + showBannerGradient: Boolean + theme: String + + """ + Banner image source. Supports local path, remote URL, or data URI/base64. + """ + bannerImage: String + + """ + Built-in case model value written to case-model.cfg when no custom override is supplied. + """ + caseModel: String + + """ + Case model image source. Supports local path, remote URL, or data URI/base64. + """ + caseModelImage: String + + """ + Partner logo source for light themes (azure/white). Supports local path, remote URL, or data URI/base64. + """ + partnerLogoLightUrl: String + + """ + Partner logo source for dark themes (black/gray). Supports local path, remote URL, or data URI/base64. + """ + partnerLogoDarkUrl: String + + """Indicates if a partner logo exists""" + hasPartnerLogo: Boolean + + """Custom title for onboarding welcome step""" + onboardingTitle: String + + """Custom subtitle for onboarding welcome step""" + onboardingSubtitle: String + + """Custom title for fresh install onboarding""" + onboardingTitleFreshInstall: String + + """Custom subtitle for fresh install onboarding""" + onboardingSubtitleFreshInstall: String + + """Custom title for upgrade onboarding""" + onboardingTitleUpgrade: String + + """Custom subtitle for upgrade onboarding""" + onboardingSubtitleUpgrade: String + + """Custom title for downgrade onboarding""" + onboardingTitleDowngrade: String + + """Custom subtitle for downgrade onboarding""" + onboardingSubtitleDowngrade: String + + """Custom title for incomplete onboarding""" + onboardingTitleIncomplete: String + + """Custom subtitle for incomplete onboarding""" + onboardingSubtitleIncomplete: String +} + +type SystemConfig { + serverName: String + model: String + comment: String +} + +type ActivationCode { + code: String + partner: PartnerConfig + branding: BrandingConfig + system: SystemConfig +} + +type OnboardingState { + registrationState: RegistrationState + + """Indicates whether the system is registered""" + isRegistered: Boolean! + + """Indicates whether the system is a fresh install""" + isFreshInstall: Boolean! + + """Indicates whether an activation code is present""" + hasActivationCode: Boolean! + + """Indicates whether activation is required based on current state""" + activationRequired: Boolean! +} + +"""Onboarding completion state and context""" +type Onboarding { + """ + The current onboarding status (INCOMPLETE, UPGRADE, DOWNGRADE, or COMPLETED) + """ + status: OnboardingStatus! + + """Whether this is a partner/OEM build with activation code""" + isPartnerBuild: Boolean! + + """Whether the onboarding flow has been completed""" + completed: Boolean! + + """The OS version when onboarding was completed""" + completedAtVersion: String + + """The activation code from the .activationcode file, if present""" + activationCode: String + + """Runtime onboarding state values used by the onboarding flow""" + onboardingState: OnboardingState! +} + +""" +The current onboarding status based on completion state and version relationship +""" +enum OnboardingStatus { + INCOMPLETE + UPGRADE + DOWNGRADE + COMPLETED +} + +type Customization { + activationCode: ActivationCode + + """Onboarding completion state and context""" + onboarding: Onboarding! + availableLanguages: [Language!] +} + +"""Result of attempting internal boot pool setup""" +type OnboardingInternalBootResult { + ok: Boolean! + code: Int + output: String! +} + +type RCloneDrive { + """Provider name""" + name: String! + + """Provider options and configuration schema""" + options: JSON! +} + +type RCloneBackupConfigForm { + id: ID! + dataSchema: JSON! + uiSchema: JSON! +} + +type RCloneBackupSettings { + configForm(formOptions: RCloneConfigFormInput): RCloneBackupConfigForm! + drives: [RCloneDrive!]! + remotes: [RCloneRemote!]! +} + +input RCloneConfigFormInput { + providerType: String + showAdvanced: Boolean = false + parameters: JSON +} + +type RCloneRemote { + name: String! + type: String! + parameters: JSON! + + """Complete remote configuration""" + config: JSON! +} + +"""Represents a tracked plugin installation operation""" +type PluginInstallOperation { + """Unique identifier of the operation""" + id: ID! + + """Plugin URL passed to the installer""" + url: String! + + """Optional plugin name for display purposes""" + name: String + + """Current status of the operation""" + status: PluginInstallStatus! + + """Timestamp when the operation was created""" + createdAt: DateTime! + + """Timestamp for the last update to this operation""" + updatedAt: DateTime + + """Timestamp when the operation finished, if applicable""" + finishedAt: DateTime + + """ + Collected output lines generated by the installer (capped at recent lines) + """ + output: [String!]! +} + +"""Status of a plugin installation operation""" +enum PluginInstallStatus { + FAILED + QUEUED RUNNING - SHUTDOWN - SHUTOFF + SUCCEEDED } -enum UPSCableType { - CUSTOM - ETHER - SIMPLE - SMART - USB +"""Emitted event representing progress for a plugin installation""" +type PluginInstallEvent { + """Identifier of the related plugin installation operation""" + operationId: ID! + + """Status reported with this event""" + status: PluginInstallStatus! + + """Output lines newly emitted since the previous event""" + output: [String!] + + """Timestamp when the event was emitted""" + timestamp: DateTime! } -enum UPSKillPower { - NO - YES -} +type ArrayMutations { + """Set array state""" + setState(input: ArrayStateInput!): UnraidArray! -enum UPSServiceState { - DISABLE - ENABLE -} + """Add new disk to array""" + addDiskToArray(input: ArrayDiskInput!): UnraidArray! -enum UPSType { - APCSMART - DUMB - MODBUS - NET - PCNET - SNMP - USB -} + """ + Remove existing disk from array. NOTE: The array must be stopped before running this otherwise it'll throw an error. + """ + removeDiskFromArray(input: ArrayDiskInput!): UnraidArray! -# ============================================================================ -# Interfaces -# ============================================================================ -interface Node { - id: PrefixedID! -} + """Mount a disk in the array""" + mountArrayDisk(id: PrefixedID!): ArrayDisk! -# ============================================================================ -# Input Types -# ============================================================================ -input AddPermissionInput { - actions: [AuthAction!]! - resource: Resource! -} + """Unmount a disk from the array""" + unmountArrayDisk(id: PrefixedID!): ArrayDisk! -input ArrayDiskInput { - id: PrefixedID! - slot: Int + """Clear statistics for a disk in the array""" + clearArrayDiskStatistics(id: PrefixedID!): Boolean! } input ArrayStateInput { + """Array state""" desiredState: ArrayStateInputState! } -input CreateApiKeyInput { - description: String - name: String! - overwrite: Boolean - permissions: [AddPermissionInput!] - roles: [Role!] +enum ArrayStateInputState { + START + STOP } -input UpdateApiKeyInput { - description: String +input ArrayDiskInput { + """Disk ID""" id: PrefixedID! - name: String - permissions: [AddPermissionInput!] + + """The slot for the disk""" + slot: Int +} + +type DockerMutations { + """Start a container""" + start(id: PrefixedID!): DockerContainer! + + """Stop a container""" + stop(id: PrefixedID!): DockerContainer! + + """Pause (Suspend) a container""" + pause(id: PrefixedID!): DockerContainer! + + """Unpause (Resume) a container""" + unpause(id: PrefixedID!): DockerContainer! + + """Remove a container""" + removeContainer(id: PrefixedID!, withImage: Boolean): Boolean! + + """Update auto-start configuration for Docker containers""" + updateAutostartConfiguration(entries: [DockerAutostartEntryInput!]!, persistUserPreferences: Boolean): Boolean! + + """Update a container to the latest image""" + updateContainer(id: PrefixedID!): DockerContainer! + + """Update multiple containers to the latest images""" + updateContainers(ids: [PrefixedID!]!): [DockerContainer!]! + + """Update all containers that have available updates""" + updateAllContainers: [DockerContainer!]! +} + +input DockerAutostartEntryInput { + """Docker container identifier""" + id: PrefixedID! + + """Whether the container should auto-start""" + autoStart: Boolean! + + """Number of seconds to wait after starting the container""" + wait: Int +} + +type VmMutations { + """Start a virtual machine""" + start(id: PrefixedID!): Boolean! + + """Stop a virtual machine""" + stop(id: PrefixedID!): Boolean! + + """Pause a virtual machine""" + pause(id: PrefixedID!): Boolean! + + """Resume a virtual machine""" + resume(id: PrefixedID!): Boolean! + + """Force stop a virtual machine""" + forceStop(id: PrefixedID!): Boolean! + + """Reboot a virtual machine""" + reboot(id: PrefixedID!): Boolean! + + """Reset a virtual machine""" + reset(id: PrefixedID!): Boolean! +} + +"""API Key related mutations""" +type ApiKeyMutations { + """Create an API key""" + create(input: CreateApiKeyInput!): ApiKey! + + """Add a role to an API key""" + addRole(input: AddRoleForApiKeyInput!): Boolean! + + """Remove a role from an API key""" + removeRole(input: RemoveRoleFromApiKeyInput!): Boolean! + + """Delete one or more API keys""" + delete(input: DeleteApiKeyInput!): Boolean! + + """Update an API key""" + update(input: UpdateApiKeyInput!): ApiKey! +} + +input CreateApiKeyInput { + name: String! + description: String roles: [Role!] + permissions: [AddPermissionInput!] + + """ + This will replace the existing key if one already exists with the same name, otherwise returns the existing key + """ + overwrite: Boolean +} + +input AddPermissionInput { + resource: Resource! + actions: [AuthAction!]! +} + +input AddRoleForApiKeyInput { + apiKeyId: PrefixedID! + role: Role! +} + +input RemoveRoleFromApiKeyInput { + apiKeyId: PrefixedID! + role: Role! } input DeleteApiKeyInput { ids: [PrefixedID!]! } -# Alias used in keys.py (deleteApiKeys at root level) -input DeleteApiKeysInput { - ids: [PrefixedID!]! +input UpdateApiKeyInput { + id: PrefixedID! + name: String + description: String + roles: [Role!] + permissions: [AddPermissionInput!] +} + +"""Customization related mutations""" +type CustomizationMutations { + """Update the UI theme (writes dynamix.cfg)""" + setTheme( + """Theme to apply""" + theme: ThemeName! + ): Theme! + + """Update the display locale (language)""" + setLocale( + """Locale code to apply (e.g. en_US)""" + locale: String! + ): String! +} + +""" +Parity check related mutations, WIP, response types and functionaliy will change +""" +type ParityCheckMutations { + """Start a parity check""" + start(correct: Boolean!): JSON! + + """Pause a parity check""" + pause: JSON! + + """Resume a parity check""" + resume: JSON! + + """Cancel a parity check""" + cancel: JSON! +} + +"""RClone related mutations""" +type RCloneMutations { + """Create a new RClone remote""" + createRCloneRemote(input: CreateRCloneRemoteInput!): RCloneRemote! + + """Delete an existing RClone remote""" + deleteRCloneRemote(input: DeleteRCloneRemoteInput!): Boolean! } input CreateRCloneRemoteInput { name: String! - parameters: JSON! type: String! + parameters: JSON! } input DeleteRCloneRemoteInput { name: String! } -input RCloneConfigFormInput { - parameters: JSON - providerType: String - showAdvanced: Boolean +"""Onboarding related mutations""" +type OnboardingMutations { + """Mark onboarding as completed""" + completeOnboarding: Onboarding! + + """Reset onboarding progress (for testing)""" + resetOnboarding: Onboarding! + + """Override onboarding state for testing (in-memory only)""" + setOnboardingOverride(input: OnboardingOverrideInput!): Onboarding! + + """Clear onboarding override state and reload from disk""" + clearOnboardingOverride: Onboarding! + + """Create and configure internal boot pool via emcmd operations""" + createInternalBootPool(input: CreateInternalBootPoolInput!): OnboardingInternalBootResult! } -input NotificationFilter { - importance: NotificationImportance - limit: Int! - offset: Int! - type: NotificationType! +"""Onboarding override input for testing""" +input OnboardingOverrideInput { + onboarding: OnboardingOverrideCompletionInput + activationCode: ActivationCodeOverrideInput + partnerInfo: PartnerInfoOverrideInput + registrationState: RegistrationState } -input NotificationData { - description: String! - importance: NotificationImportance! - link: String - subject: String! - title: String! +"""Onboarding completion override input""" +input OnboardingOverrideCompletionInput { + completed: Boolean + completedAtVersion: String } -# Alias used in notifications.py create mutation -input CreateNotificationInput { - description: String! - importance: NotificationImportance! - link: String - subject: String! - title: String! +"""Activation code override input""" +input ActivationCodeOverrideInput { + code: String + partner: PartnerConfigInput + branding: BrandingConfigInput + system: SystemConfigInput } -input UPSConfigInput { - batteryLevel: Int - customUpsCable: String - device: String - killUps: UPSKillPower - minutes: Int - overrideUpsCapacity: Int - service: UPSServiceState - timeout: Int - upsCable: UPSCableType - upsType: UPSType -} - -# ============================================================================ -# Object Types -# ============================================================================ -type Capacity { - free: String! - total: String! - used: String! -} - -type ArrayCapacity { - disks: Capacity! - kilobytes: Capacity! -} - -type ArrayDisk implements Node { - id: PrefixedID! - idx: Int! +input PartnerConfigInput { name: String - device: String - size: BigInt - status: ArrayDiskStatus - rotational: Boolean - temp: Int - numReads: BigInt - numWrites: BigInt - numErrors: BigInt - fsSize: BigInt - fsFree: BigInt - fsUsed: BigInt - exportable: Boolean - type: ArrayDiskType! - warning: Int - critical: Int - fsType: String + url: String + hardwareSpecsUrl: String + manualUrl: String + supportUrl: String + extraLinks: [PartnerLinkInput!] +} + +"""Partner link input for custom links""" +input PartnerLinkInput { + title: String! + url: String! +} + +input BrandingConfigInput { + header: String + headermetacolor: String + background: String + showBannerGradient: Boolean + theme: String + bannerImage: String + caseModel: String + caseModelImage: String + partnerLogoLightUrl: String + partnerLogoDarkUrl: String + hasPartnerLogo: Boolean + onboardingTitle: String + onboardingSubtitle: String + onboardingTitleFreshInstall: String + onboardingSubtitleFreshInstall: String + onboardingTitleUpgrade: String + onboardingSubtitleUpgrade: String + onboardingTitleDowngrade: String + onboardingSubtitleDowngrade: String + onboardingTitleIncomplete: String + onboardingSubtitleIncomplete: String +} + +input SystemConfigInput { + serverName: String + model: String comment: String - format: String - transport: String - color: ArrayDiskFsColor - isSpinning: Boolean } -type UnraidArray implements Node { - id: PrefixedID! - state: ArrayState! - capacity: ArrayCapacity! - boot: ArrayDisk - parities: [ArrayDisk!]! - disks: [ArrayDisk!]! - caches: [ArrayDisk!]! - parityCheckStatus: ParityCheck! +"""Partner info override input""" +input PartnerInfoOverrideInput { + partner: PartnerConfigInput + branding: BrandingConfigInput } -type ParityCheck { - correcting: Boolean - date: DateTime - duration: Int - errors: Int - paused: Boolean - progress: Int - running: Boolean - speed: String - status: ParityCheckStatus! +"""Input for creating an internal boot pool during onboarding""" +input CreateInternalBootPoolInput { + poolName: String! + devices: [String!]! + bootSizeMiB: Int! + updateBios: Boolean! + reboot: Boolean } -type ParityCheckMutations { - start(correct: Boolean): JSON! - pause: JSON! - resume: JSON! - cancel: JSON! +"""Unraid plugin management mutations""" +type UnraidPluginsMutations { + """Install an Unraid plugin and track installation progress""" + installPlugin(input: InstallPluginInput!): PluginInstallOperation! + + """Install an Unraid language pack and track installation progress""" + installLanguage(input: InstallPluginInput!): PluginInstallOperation! } -type ArrayMutations { - addDiskToArray(input: ArrayDiskInput!): UnraidArray! - clearArrayDiskStatistics(id: PrefixedID!): Boolean! - mountArrayDisk(id: PrefixedID!): ArrayDisk! - removeDiskFromArray(input: ArrayDiskInput!): UnraidArray! - setState(input: ArrayStateInput!): UnraidArray! - unmountArrayDisk(id: PrefixedID!): ArrayDisk! +"""Input payload for installing a plugin""" +input InstallPluginInput { + """Plugin installation URL (.plg)""" + url: String! + + """Optional human-readable plugin name used for logging""" + name: String + + """ + Force installation even when plugin is already present. Defaults to true to mirror the existing UI behaviour. + """ + forced: Boolean } type Config implements Node { @@ -466,587 +1505,541 @@ type Config implements Node { error: String } -type CoreVersions { - api: String - kernel: String - unraid: String -} - -type PackageVersions { - docker: String - git: String - nginx: String - node: String - npm: String - openssl: String - php: String - pm2: String -} - -type InfoVersions implements Node { - id: PrefixedID! - core: CoreVersions! - packages: PackageVersions - # Flattened fields used by the MCP tool queries (may exist in live API) - kernel: String - openssl: String - systemOpenssl: String - systemOpensslLib: String - node: String - v8: String - npm: String - yarn: String - pm2: String - gulp: String - grunt: String - git: String - tsc: String - mysql: String - redis: String - mongodb: String - apache: String - nginx: String - php: String - docker: String - postfix: String - postgresql: String - perl: String - python: String - gcc: String - unraid: String -} - -type InfoOs implements Node { - id: PrefixedID! - platform: String - distro: String - release: String - codename: String - kernel: String - arch: String - hostname: String - logofile: String - serial: String - build: String - uptime: String - fqdn: String - servicepack: String - uefi: Boolean - codepage: String -} - -type InfoCpu implements Node { - id: PrefixedID! - manufacturer: String - brand: String - vendor: String - family: String - model: String - stepping: Int - revision: String - voltage: String - speed: Float - speedmin: Float - speedmax: Float - threads: Int - cores: Int - processors: Int - socket: String - cache: JSON - flags: [String!] - packages: CpuPackages! - topology: [[[Int!]!]!]! -} - -type CpuLoad { - percentGuest: Float! - percentIdle: Float! - percentIrq: Float! - percentNice: Float! - percentSteal: Float! - percentSystem: Float! - percentTotal: Float! - percentUser: Float! -} - -type CpuPackages implements Node { - id: PrefixedID! - power: [Float!]! - temp: [Float!]! - totalPower: Float! -} - -type CpuUtilization implements Node { - id: PrefixedID! - cpus: [CpuLoad!]! - percentTotal: Float! -} - -type MemoryLayout implements Node { - id: PrefixedID! - bank: String - type: String - clockSpeed: Int - formFactor: String - manufacturer: String - partNum: String - serialNum: String - size: BigInt! - voltageConfigured: Int - voltageMax: Int - voltageMin: Int -} - -type InfoMemory implements Node { - id: PrefixedID! - layout: [MemoryLayout!]! -} - -type MemoryUtilization implements Node { - id: PrefixedID! - active: BigInt! - available: BigInt! - buffcache: BigInt! - free: BigInt! - percentSwapTotal: Float! - percentTotal: Float! - swapFree: BigInt! - swapTotal: BigInt! - swapUsed: BigInt! - total: BigInt! - used: BigInt! -} - -type InfoBaseboard implements Node { - id: PrefixedID! - manufacturer: String - model: String - version: String - serial: String - assetTag: String - memMax: Float - memSlots: Float -} - -type InfoSystem implements Node { - id: PrefixedID! - manufacturer: String - model: String - version: String - serial: String - uuid: String - sku: String - virtual: Boolean -} - type InfoGpu implements Node { id: PrefixedID! - blacklisted: Boolean! - class: String! - productid: String! + + """GPU type/manufacturer""" type: String! + + """GPU type identifier""" typeid: String! + + """Whether GPU is blacklisted""" + blacklisted: Boolean! + + """Device class""" + class: String! + + """Product ID""" + productid: String! + + """Vendor name""" vendorname: String } type InfoNetwork implements Node { id: PrefixedID! + + """Network interface name""" iface: String! - mac: String + + """Network interface model""" model: String - speed: String + + """Network vendor""" vendor: String + + """MAC address""" + mac: String + + """Virtual interface flag""" virtual: Boolean + + """Network speed""" + speed: String + + """DHCP enabled flag""" dhcp: Boolean } type InfoPci implements Node { id: PrefixedID! - blacklisted: String! - class: String! - productid: String! - productname: String + + """Device type/manufacturer""" type: String! + + """Type identifier""" typeid: String! - vendorid: String! + + """Vendor name""" vendorname: String + + """Vendor ID""" + vendorid: String! + + """Product name""" + productname: String + + """Product ID""" + productid: String! + + """Blacklisted status""" + blacklisted: String! + + """Device class""" + class: String! } type InfoUsb implements Node { id: PrefixedID! - bus: String - device: String + + """USB device name""" name: String! + + """USB bus number""" + bus: String + + """USB device number""" + device: String } type InfoDevices implements Node { id: PrefixedID! + + """List of GPU devices""" gpu: [InfoGpu!] + + """List of network interfaces""" network: [InfoNetwork!] + + """List of PCI devices""" pci: [InfoPci!] + + """List of USB devices""" usb: [InfoUsb!] } -type InfoDisplayCase implements Node { - id: PrefixedID! - base64: String! - error: String! - icon: String! - url: String! +"""CPU load for a single core""" +type CpuLoad { + """The total CPU load on a single core, in percent.""" + percentTotal: Float! + + """The percentage of time the CPU spent in user space.""" + percentUser: Float! + + """The percentage of time the CPU spent in kernel space.""" + percentSystem: Float! + + """ + The percentage of time the CPU spent on low-priority (niced) user space processes. + """ + percentNice: Float! + + """The percentage of time the CPU was idle.""" + percentIdle: Float! + + """The percentage of time the CPU spent servicing hardware interrupts.""" + percentIrq: Float! + + """The percentage of time the CPU spent running virtual machines (guest).""" + percentGuest: Float! + + """The percentage of CPU time stolen by the hypervisor.""" + percentSteal: Float! } -type InfoDisplay implements Node { +type CpuPackages implements Node { id: PrefixedID! - case: InfoDisplayCase! - critical: Int! - hot: Int! - locale: String - max: Int - resize: Boolean! - scale: Boolean! - tabs: Boolean! - text: Boolean! - theme: ThemeName! - total: Boolean! - unit: Temperature! - usage: Boolean! - warning: Int! - wwn: Boolean! + + """Total CPU package power draw (W)""" + totalPower: Float! + + """Power draw per package (W)""" + power: [Float!]! + + """Temperature per package (°C)""" + temp: [Float!]! } -type Apps { - installed: Int - started: Int +type CpuUtilization implements Node { + id: PrefixedID! + + """Total CPU load in percent""" + percentTotal: Float! + + """CPU load for each core""" + cpus: [CpuLoad!]! +} + +type InfoCpu implements Node { + id: PrefixedID! + + """CPU manufacturer""" + manufacturer: String + + """CPU brand name""" + brand: String + + """CPU vendor""" + vendor: String + + """CPU family""" + family: String + + """CPU model""" + model: String + + """CPU stepping""" + stepping: Int + + """CPU revision""" + revision: String + + """CPU voltage""" + voltage: String + + """Current CPU speed in GHz""" + speed: Float + + """Minimum CPU speed in GHz""" + speedmin: Float + + """Maximum CPU speed in GHz""" + speedmax: Float + + """Number of CPU threads""" + threads: Int + + """Number of CPU cores""" + cores: Int + + """Number of physical processors""" + processors: Int + + """CPU socket type""" + socket: String + + """CPU cache information""" + cache: JSON + + """CPU feature flags""" + flags: [String!] + + """ + Per-package array of core/thread pairs, e.g. [[[0,1],[2,3]], [[4,5],[6,7]]] + """ + topology: [[[Int!]!]!]! + packages: CpuPackages! +} + +type MemoryLayout implements Node { + id: PrefixedID! + + """Memory module size in bytes""" + size: BigInt! + + """Memory bank location (e.g., BANK 0)""" + bank: String + + """Memory type (e.g., DDR4, DDR5)""" + type: String + + """Memory clock speed in MHz""" + clockSpeed: Int + + """Part number of the memory module""" + partNum: String + + """Serial number of the memory module""" + serialNum: String + + """Memory manufacturer""" + manufacturer: String + + """Form factor (e.g., DIMM, SODIMM)""" + formFactor: String + + """Configured voltage in millivolts""" + voltageConfigured: Int + + """Minimum voltage in millivolts""" + voltageMin: Int + + """Maximum voltage in millivolts""" + voltageMax: Int +} + +type MemoryUtilization implements Node { + id: PrefixedID! + + """Total system memory in bytes""" + total: BigInt! + + """Used memory in bytes""" + used: BigInt! + + """Free memory in bytes""" + free: BigInt! + + """Available memory in bytes""" + available: BigInt! + + """Active memory in bytes""" + active: BigInt! + + """Buffer/cache memory in bytes""" + buffcache: BigInt! + + """Memory usage percentage""" + percentTotal: Float! + + """Total swap memory in bytes""" + swapTotal: BigInt! + + """Used swap memory in bytes""" + swapUsed: BigInt! + + """Free swap memory in bytes""" + swapFree: BigInt! + + """Swap usage percentage""" + percentSwapTotal: Float! +} + +type InfoMemory implements Node { + id: PrefixedID! + + """Physical memory layout""" + layout: [MemoryLayout!]! +} + +type InfoNetworkInterface implements Node { + id: PrefixedID! + + """Interface name (e.g. eth0)""" + name: String! + + """Interface description/label""" + description: String + + """MAC Address""" + macAddress: String + + """Connection status""" + status: String + + """IPv4 Protocol mode""" + protocol: String + + """IPv4 Address""" + ipAddress: String + + """IPv4 Netmask""" + netmask: String + + """IPv4 Gateway""" + gateway: String + + """Using DHCP for IPv4""" + useDhcp: Boolean + + """IPv6 Address""" + ipv6Address: String + + """IPv6 Netmask""" + ipv6Netmask: String + + """IPv6 Gateway""" + ipv6Gateway: String + + """Using DHCP for IPv6""" + useDhcp6: Boolean +} + +type InfoOs implements Node { + id: PrefixedID! + + """Operating system platform""" + platform: String + + """Linux distribution name""" + distro: String + + """OS release version""" + release: String + + """OS codename""" + codename: String + + """Kernel version""" + kernel: String + + """OS architecture""" + arch: String + + """Hostname""" + hostname: String + + """Fully qualified domain name""" + fqdn: String + + """OS build identifier""" + build: String + + """Service pack version""" + servicepack: String + + """Boot time ISO string""" + uptime: String + + """OS logo name""" + logofile: String + + """OS serial number""" + serial: String + + """OS started via UEFI""" + uefi: Boolean +} + +type InfoSystem implements Node { + id: PrefixedID! + + """System manufacturer""" + manufacturer: String + + """System model""" + model: String + + """System version""" + version: String + + """System serial number""" + serial: String + + """System UUID""" + uuid: String + + """System SKU""" + sku: String + + """Virtual machine flag""" + virtual: Boolean +} + +type InfoBaseboard implements Node { + id: PrefixedID! + + """Motherboard manufacturer""" + manufacturer: String + + """Motherboard model""" + model: String + + """Motherboard version""" + version: String + + """Motherboard serial number""" + serial: String + + """Motherboard asset tag""" + assetTag: String + + """Maximum memory capacity in bytes""" + memMax: Float + + """Number of memory slots""" + memSlots: Float +} + +type CoreVersions { + """Unraid version""" + unraid: String + + """Unraid API version""" + api: String + + """Kernel version""" + kernel: String +} + +type PackageVersions { + """OpenSSL version""" + openssl: String + + """Node.js version""" + node: String + + """npm version""" + npm: String + + """pm2 version""" + pm2: String + + """Git version""" + git: String + + """nginx version""" + nginx: String + + """PHP version""" + php: String + + """Docker version""" + docker: String +} + +type InfoVersions implements Node { + id: PrefixedID! + + """Core system versions""" + core: CoreVersions! + + """Software package versions""" + packages: PackageVersions } type Info implements Node { id: PrefixedID! - os: InfoOs! - cpu: InfoCpu! - memory: InfoMemory! - baseboard: InfoBaseboard! - system: InfoSystem! - versions: InfoVersions! - devices: InfoDevices! - display: InfoDisplay! - apps: Apps - machineId: ID + + """Current server time""" time: DateTime! + + """Motherboard information""" + baseboard: InfoBaseboard! + + """CPU information""" + cpu: InfoCpu! + + """Device information""" + devices: InfoDevices! + + """Display configuration""" + display: InfoDisplay! + + """Machine ID""" + machineId: ID + + """Memory information""" + memory: InfoMemory! + + """Operating system information""" + os: InfoOs! + + """System information""" + system: InfoSystem! + + """Software versions""" + versions: InfoVersions! + + """Network interfaces""" + networkInterfaces: [InfoNetworkInterface!]! + + """Primary management interface""" + primaryNetwork: InfoNetworkInterface } -type MetricsCpu { - used: Float -} - -type MetricsMemory { - used: Float - total: Float -} - -type Metrics implements Node { - id: PrefixedID! - cpu: MetricsCpu - memory: MetricsMemory -} - -type Service implements Node { - id: PrefixedID! - name: String - state: String - online: Boolean - uptime: Uptime - version: String -} - -type Uptime { - timestamp: String -} - -type AccessUrl { - type: String - name: String - ipv4: String - ipv6: String -} - -type Network implements Node { - id: PrefixedID! - accessUrls: [AccessUrl!] -} - -type KeyFile { - contents: String - location: String -} - -type Registration implements Node { - id: PrefixedID! - type: registrationType - keyFile: KeyFile - state: RegistrationState - expiration: String - updateExpiration: String -} - -type ConnectSettings { - status: String - sandbox: Boolean - flashGuid: String -} - -type Owner { - username: String! - avatar: String! - url: String! -} - -type ProfileModel implements Node { - id: PrefixedID! - avatar: String! - url: String! - username: String! -} - -type Server implements Node { - id: PrefixedID! +type ExplicitStatusItem { name: String! - status: ServerStatus! - description: String - ip: String - port: Int - guid: String! - apikey: String! - lanip: String! - localurl: String! - remoteurl: String! - owner: ProfileModel! - wanip: String! + updateStatus: UpdateStatus! } -type Flash implements Node { - id: PrefixedID! - guid: String! - product: String! - vendor: String! - size: BigInt -} - -type Vars implements Node { - id: PrefixedID! - version: String - name: String - timeZone: String - comment: String - security: String - workgroup: String - domain: String - domainShort: String - hideDotFiles: Boolean - localMaster: Boolean - enableFruit: String - useNtp: Boolean - domainLogin: String - sysModel: String - sysFlashSlots: Int - useSsl: Boolean - port: Int - portssl: Int - localTld: String - bindMgt: Boolean - useTelnet: Boolean - porttelnet: Int - useSsh: Boolean - portssh: Int - startPage: String - startArray: Boolean - shutdownTimeout: Int - shareSmbEnabled: Boolean - shareNfsEnabled: Boolean - shareAfpEnabled: Boolean - shareCacheEnabled: Boolean - shareAvahiEnabled: Boolean - safeMode: Boolean - startMode: String - configValid: Boolean - configError: ConfigErrorState - joinStatus: String - deviceCount: Int - flashGuid: String - flashProduct: String - flashVendor: String - mdState: String - mdVersion: String - shareCount: Int - shareSmbCount: Int - shareNfsCount: Int - shareAfpCount: Int - shareMoverActive: Boolean - csrfToken: String -} - -type ApiConfig { - extraOrigins: [String!]! - plugins: [String!]! - sandbox: Boolean - ssoSubIds: [String!]! - version: String! -} - -type SsoSettings implements Node { - id: PrefixedID! - oidcProviders: [OidcProvider!]! -} - -type OidcProvider { - id: PrefixedID! - name: String! - clientId: String! - clientSecret: String - issuer: String - authorizationEndpoint: String - tokenEndpoint: String - jwksUri: String - scopes: [String!]! - buttonText: String - buttonIcon: String - buttonStyle: String - buttonVariant: String - authorizationRuleMode: String - authorizationRules: [JSON!] -} - -type UnifiedSettings implements Node { - id: PrefixedID! - dataSchema: JSON! - uiSchema: JSON! - values: JSON! -} - -type Settings implements Node { - id: PrefixedID! - api: ApiConfig! - sso: SsoSettings! - unified: UnifiedSettings! -} - -type UPSBattery { - chargeLevel: Int! - estimatedRuntime: Int! - health: String! -} - -type UPSPower { - inputVoltage: Float! - loadPercentage: Int! - outputVoltage: Float! -} - -type UPSDevice { - id: ID! - model: String! - name: String! - status: String! - battery: UPSBattery! - power: UPSPower! - # Flattened fields used by MCP tool queries - runtime: Int - charge: Int - load: Int - voltage: Float - frequency: Float - temperature: Float -} - -type UPSConfiguration { - enabled: Boolean - mode: String - cable: String - driver: String - port: String - batteryLevel: Int - customUpsCable: String - device: String - killUps: String - minutes: Int - modelName: String - netServer: String - nisIp: String - overrideUpsCapacity: Int - service: String - timeout: Int - upsCable: String - upsName: String - upsType: String -} - -type Share implements Node { - id: PrefixedID! - name: String - free: BigInt - used: BigInt - size: BigInt - include: [String!] - exclude: [String!] - cache: Boolean - nameOrig: String - comment: String - allocator: String - splitLevel: String - floor: String - cow: String - color: String - luksStatus: String -} - -type Disk implements Node { - id: PrefixedID! - device: String! - name: String! - serialNum: String! - size: Float! - temperature: Float - bytesPerSector: Float! - firmwareRevision: String! - interfaceType: DiskInterfaceType! - isSpinning: Boolean! - partitions: [DiskPartition!]! - sectorsPerTrack: Float! - smartStatus: DiskSmartStatus! - totalCylinders: Float! - totalHeads: Float! - totalSectors: Float! - totalTracks: Float! - tracksPerCylinder: Float! - type: String! - vendor: String! -} - -type DiskPartition { - fsType: DiskFsType! - name: String! - size: Float! -} - -type UnassignedDevice { - id: PrefixedID! - device: String - name: String - size: BigInt - type: String -} - -type LogFile { - name: String! - path: String! - size: Int! - modifiedAt: DateTime! -} - -type LogFileContent { - path: String! - content: String! - totalLines: Int! - startLine: Int +"""Update status of a container.""" +enum UpdateStatus { + UP_TO_DATE + UPDATE_AVAILABLE + REBUILD_READY + UNKNOWN } type ContainerPort { @@ -1056,6 +2049,39 @@ type ContainerPort { type: ContainerPortType! } +""" +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 +""" +scalar Port + +enum ContainerPortType { + TCP + UDP +} + +type DockerPortConflictContainer { + id: PrefixedID! + name: String! +} + +type DockerContainerPortConflict { + privatePort: Port! + type: ContainerPortType! + containers: [DockerPortConflictContainer!]! +} + +type DockerLanPortConflict { + lanIpPort: String! + publicPort: Port + type: ContainerPortType! + containers: [DockerPortConflictContainer!]! +} + +type DockerPortConflicts { + containerPorts: [DockerContainerPortConflict!]! + lanPorts: [DockerLanPortConflict!]! +} + type ContainerHostConfig { networkMode: String! } @@ -1068,7 +2094,18 @@ type DockerContainer implements Node { command: String! created: Int! ports: [ContainerPort!]! + + """List of LAN-accessible host:port values""" + lanIpPorts: [String!] + + """Total size of all files in the container (in bytes)""" sizeRootFs: BigInt + + """Size of writable layer (in bytes)""" + sizeRw: BigInt + + """Size of container logs (in bytes)""" + sizeLog: BigInt labels: JSON state: ContainerState! status: String! @@ -1076,110 +2113,217 @@ type DockerContainer implements Node { networkSettings: JSON mounts: [JSON!] autoStart: Boolean! + + """Zero-based order in the auto-start list""" + autoStartOrder: Int + + """Wait time in seconds applied after start""" + autoStartWait: Int + templatePath: String + + """Project/Product homepage URL""" + projectUrl: String + + """Registry/Docker Hub URL""" + registryUrl: String + + """Support page/thread URL""" + supportUrl: String + + """Icon URL""" + iconUrl: String + + """Resolved WebUI URL from template""" + webUiUrl: String + + """Shell to use for console access (from template)""" + shell: String + + """Port mappings from template (used when container is not running)""" + templatePorts: [ContainerPort!] + + """Whether the container is orphaned (no template found)""" + isOrphaned: Boolean! + isUpdateAvailable: Boolean + isRebuildReady: Boolean + + """Whether Tailscale is enabled for this container""" + tailscaleEnabled: Boolean! + + """Tailscale status for this container (fetched via docker exec)""" + tailscaleStatus(forceRefresh: Boolean = false): TailscaleStatus } -type PortConflict { - containerName: String - port: Int - conflictsWith: String -} - -type ExplicitStatusItem { - name: String! - updateStatus: UpdateStatus! -} - -type ContainerUpdateStatus { - id: PrefixedID! - name: String - updateAvailable: Boolean - currentVersion: String - latestVersion: String -} - -type DockerMutations { - start(id: PrefixedID!): DockerContainer! - stop(id: PrefixedID!): DockerContainer! - pause(id: PrefixedID!): DockerContainer! - unpause(id: PrefixedID!): DockerContainer! - removeContainer(id: PrefixedID!): Boolean! - updateContainer(id: PrefixedID!): DockerContainer! - updateAllContainers: [DockerContainer!]! - logs(id: PrefixedID!, tail: Int): String +enum ContainerState { + RUNNING + PAUSED + EXITED } type DockerNetwork implements Node { id: PrefixedID! name: String! - driver: String! + created: String! scope: String! - containers: JSON! + driver: String! + enableIPv6: Boolean! + ipam: JSON! + internal: Boolean! attachable: Boolean! + ingress: Boolean! configFrom: JSON! configOnly: Boolean! - created: String! - enableIPv6: Boolean! - ingress: Boolean! - internal: Boolean! - ipam: JSON! - labels: JSON! + containers: JSON! options: JSON! + labels: JSON! +} + +type DockerContainerLogLine { + timestamp: DateTime! + message: String! +} + +type DockerContainerLogs { + containerId: PrefixedID! + lines: [DockerContainerLogLine!]! + + """ + Cursor that can be passed back through the since argument to continue streaming logs. + """ + cursor: DateTime +} + +type DockerContainerStats { + id: PrefixedID! + + """CPU Usage Percentage""" + cpuPercent: Float! + + """Memory Usage String (e.g. 100MB / 1GB)""" + memUsage: String! + + """Memory Usage Percentage""" + memPercent: Float! + + """Network I/O String (e.g. 100MB / 1GB)""" + netIO: String! + + """Block I/O String (e.g. 100MB / 1GB)""" + blockIO: String! +} + +"""Tailscale exit node connection status""" +type TailscaleExitNodeStatus { + """Whether the exit node is online""" + online: Boolean! + + """Tailscale IPs of the exit node""" + tailscaleIps: [String!] +} + +"""Tailscale status for a Docker container""" +type TailscaleStatus { + """Whether Tailscale is online in the container""" + online: Boolean! + + """Current Tailscale version""" + version: String + + """Latest available Tailscale version""" + latestVersion: String + + """Whether a Tailscale update is available""" + updateAvailable: Boolean! + + """Configured Tailscale hostname""" + hostname: String + + """Actual Tailscale DNS name""" + dnsName: String + + """DERP relay code""" + relay: String + + """DERP relay region name""" + relayName: String + + """Tailscale IPv4 and IPv6 addresses""" + tailscaleIps: [String!] + + """Advertised subnet routes""" + primaryRoutes: [String!] + + """Whether this container is an exit node""" + isExitNode: Boolean! + + """Status of the connected exit node (if using one)""" + exitNodeStatus: TailscaleExitNodeStatus + + """Tailscale Serve/Funnel WebUI URL""" + webUiUrl: String + + """Tailscale key expiry date""" + keyExpiry: DateTime + + """Days until key expires""" + keyExpiryDays: Int + + """Whether the Tailscale key has expired""" + keyExpired: Boolean! + + """Tailscale backend state (Running, NeedsLogin, Stopped, etc.)""" + backendState: String + + """Authentication URL if Tailscale needs login""" + authUrl: String } type Docker implements Node { id: PrefixedID! - containers(skipCache: Boolean! = false): [DockerContainer!]! - networks(skipCache: Boolean! = false): [DockerNetwork!]! - portConflicts: [PortConflict!] - containerUpdateStatuses: [ContainerUpdateStatus!] - logs(id: PrefixedID!, tail: Int): String + containers(skipCache: Boolean! = false @deprecated(reason: "Caching has been removed; this parameter is now ignored")): [DockerContainer!]! + networks(skipCache: Boolean! = false @deprecated(reason: "Caching has been removed; this parameter is now ignored")): [DockerNetwork!]! + portConflicts(skipCache: Boolean! = false @deprecated(reason: "Caching has been removed; this parameter is now ignored")): DockerPortConflicts! + + """ + Access container logs. Requires specifying a target container id through resolver arguments. + """ + logs(id: PrefixedID!, since: DateTime, tail: Int): DockerContainerLogs! + container(id: PrefixedID!): DockerContainer + organizer(skipCache: Boolean! = false @deprecated(reason: "Caching has been removed; this parameter is now ignored")): ResolvedOrganizerV1! + containerUpdateStatuses: [ExplicitStatusItem!]! } -type VmDomain implements Node { - id: PrefixedID! - name: String - state: VmState! - uuid: String +type DockerTemplateSyncResult { + scanned: Int! + matched: Int! + skipped: Int! + errors: [String!]! } -type VmMutations { - start(id: PrefixedID!): Boolean! - stop(id: PrefixedID!): Boolean! - pause(id: PrefixedID!): Boolean! - resume(id: PrefixedID!): Boolean! - forceStop(id: PrefixedID!): Boolean! - reboot(id: PrefixedID!): Boolean! - reset(id: PrefixedID!): Boolean! -} - -type Vms implements Node { - id: PrefixedID! - domain: [VmDomain!] - domains: [VmDomain!] -} - -type Permission { - actions: [AuthAction!]! - resource: Resource! -} - -type ApiKey implements Node { - id: PrefixedID! +type ResolvedOrganizerView { + id: String! name: String! - key: String! - roles: JSON - permissions: JSON - createdAt: String! - description: String - lastUsed: String + rootId: String! + flatEntries: [FlatOrganizerEntry!]! + prefs: JSON } -type ApiKeyMutations { - create(input: CreateApiKeyInput!): ApiKey! - update(input: UpdateApiKeyInput!): ApiKey! - delete(input: DeleteApiKeyInput!): Boolean! - addRole(input: JSON!): Boolean! - removeRole(input: JSON!): Boolean! +type ResolvedOrganizerV1 { + version: Float! + views: [ResolvedOrganizerView!]! +} + +type FlatOrganizerEntry { + id: String! + type: String! + name: String! + parentId: String + depth: Float! + position: Float! + path: [String!]! + hasChildren: Boolean! + childrenIds: [String!]! + meta: DockerContainer } type NotificationCounts { @@ -1196,233 +2340,1231 @@ type NotificationOverview { type Notification implements Node { id: PrefixedID! + + """Also known as 'event'""" title: String! subject: String! description: String! importance: NotificationImportance! link: String type: NotificationType! + + """ISO Timestamp for when the notification occurred""" timestamp: String formattedTimestamp: String } +enum NotificationImportance { + ALERT + INFO + WARNING +} + +enum NotificationType { + UNREAD + ARCHIVE +} + type Notifications implements Node { id: PrefixedID! + + """A cached overview of the notifications in the system & their severity.""" overview: NotificationOverview! list(filter: NotificationFilter!): [Notification!]! - warningsAndAlerts: [Notification!] - # Mutation-like fields used by MCP notification mutations - createNotification(input: CreateNotificationInput!): Notification - archiveNotification(id: PrefixedID!): Boolean - unreadNotification(id: PrefixedID!): Boolean - deleteNotification(id: PrefixedID!, type: NotificationType!): Boolean - deleteArchivedNotifications: Boolean - archiveAll(importance: NotificationImportance): Boolean + + """ + Deduplicated list of unread warning and alert notifications, sorted latest first. + """ + warningsAndAlerts: [Notification!]! +} + +input NotificationFilter { + importance: NotificationImportance + type: NotificationType! + offset: Int! + limit: Int! +} + +type FlashBackupStatus { + """Status message indicating the outcome of the backup initiation.""" + status: String! + + """Job ID if available, can be used to check job status.""" + jobId: String +} + +type Flash implements Node { + id: PrefixedID! + guid: String! + vendor: String! + product: String! +} + +type LogFile { + """Name of the log file""" + name: String! + + """Full path to the log file""" + path: String! + + """Size of the log file in bytes""" + size: Int! + + """Last modified timestamp""" + modifiedAt: DateTime! +} + +type LogFileContent { + """Path to the log file""" + path: String! + + """Content of the log file""" + content: String! + + """Total number of lines in the file""" + totalLines: Int! + + """Starting line number of the content (1-indexed)""" + startLine: Int +} + +type TemperatureReading { + """Temperature value""" + value: Float! + + """Temperature unit""" + unit: TemperatureUnit! + + """Timestamp of reading""" + timestamp: DateTime! + + """Temperature status""" + status: TemperatureStatus! +} + +enum TemperatureUnit { + CELSIUS + FAHRENHEIT + KELVIN + RANKINE +} + +enum TemperatureStatus { + NORMAL + WARNING + CRITICAL + UNKNOWN +} + +type TemperatureSensor implements Node { + id: PrefixedID! + + """Sensor name""" + name: String! + + """Type of sensor""" + type: SensorType! + + """Physical location""" + location: String + + """Current temperature""" + current: TemperatureReading! + + """Minimum recorded""" + min: TemperatureReading + + """Maximum recorded""" + max: TemperatureReading + + """Warning threshold""" + warning: Float + + """Critical threshold""" + critical: Float + + """Historical readings for this sensor""" + history: [TemperatureReading!] +} + +"""Type of temperature sensor""" +enum SensorType { + CPU_PACKAGE + CPU_CORE + MOTHERBOARD + CHIPSET + GPU + DISK + NVME + AMBIENT + VRM + CUSTOM +} + +type TemperatureSummary { + """Average temperature across all sensors""" + average: Float! + + """Hottest sensor""" + hottest: TemperatureSensor! + + """Coolest sensor""" + coolest: TemperatureSensor! + + """Count of sensors at warning level""" + warningCount: Int! + + """Count of sensors at critical level""" + criticalCount: Int! +} + +type TemperatureMetrics implements Node { + id: PrefixedID! + + """All temperature sensors""" + sensors: [TemperatureSensor!]! + + """Temperature summary""" + summary: TemperatureSummary! +} + +"""System metrics including CPU and memory utilization""" +type Metrics implements Node { + id: PrefixedID! + + """Current CPU utilization metrics""" + cpu: CpuUtilization + + """Current memory utilization metrics""" + memory: MemoryUtilization + + """Temperature metrics""" + temperature: TemperatureMetrics +} + +type SensorConfig { + enabled: Boolean +} + +type LmSensorsConfig { + enabled: Boolean + config_path: String +} + +type IpmiConfig { + enabled: Boolean + args: [String!] +} + +type TemperatureSensorsConfig { + lm_sensors: LmSensorsConfig + smartctl: SensorConfig + ipmi: IpmiConfig +} + +type TemperatureThresholdsConfig { + cpu_warning: Int + cpu_critical: Int + disk_warning: Int + disk_critical: Int + warning: Int + critical: Int +} + +type TemperatureHistoryConfig { + max_readings: Int + retention_ms: Int +} + +type Owner { + username: String! + url: String! + avatar: String! +} + +type ProfileModel implements Node { + id: PrefixedID! + username: String! + url: String! + avatar: String! +} + +type Server implements Node { + id: PrefixedID! + owner: ProfileModel! + guid: String! + apikey: String! + name: String! + + """Server description/comment""" + comment: String + + """Whether this server is online or offline""" + status: ServerStatus! + wanip: String! + lanip: String! + localurl: String! + remoteurl: String! +} + +enum ServerStatus { + ONLINE + OFFLINE + NEVER_CONNECTED +} + +type ApiConfig { + version: String! + extraOrigins: [String!]! + sandbox: Boolean + ssoSubIds: [String!]! + plugins: [String!]! +} + +type OidcAuthorizationRule { + """The claim to check (e.g., email, sub, groups, hd)""" + claim: String! + + """The comparison operator""" + operator: AuthorizationOperator! + + """The value(s) to match against""" + value: [String!]! +} + +"""Operators for authorization rule matching""" +enum AuthorizationOperator { + EQUALS + CONTAINS + ENDS_WITH + STARTS_WITH +} + +type OidcProvider { + """The unique identifier for the OIDC provider""" + id: PrefixedID! + + """Display name of the OIDC provider""" + name: String! + + """OAuth2 client ID registered with the provider""" + clientId: String! + + """OAuth2 client secret (if required by provider)""" + clientSecret: String + + """ + OIDC issuer URL (e.g., https://accounts.google.com). Required for auto-discovery via /.well-known/openid-configuration + """ + issuer: String + + """ + OAuth2 authorization endpoint URL. If omitted, will be auto-discovered from issuer/.well-known/openid-configuration + """ + authorizationEndpoint: String + + """ + OAuth2 token endpoint URL. If omitted, will be auto-discovered from issuer/.well-known/openid-configuration + """ + tokenEndpoint: String + + """ + JSON Web Key Set URI for token validation. If omitted, will be auto-discovered from issuer/.well-known/openid-configuration + """ + jwksUri: String + + """OAuth2 scopes to request (e.g., openid, profile, email)""" + scopes: [String!]! + + """Flexible authorization rules based on claims""" + authorizationRules: [OidcAuthorizationRule!] + + """ + Mode for evaluating authorization rules - OR (any rule passes) or AND (all rules must pass). Defaults to OR. + """ + authorizationRuleMode: AuthorizationRuleMode + + """Custom text for the login button""" + buttonText: String + + """URL or base64 encoded icon for the login button""" + buttonIcon: String + + """ + Button variant style from Reka UI. See https://reka-ui.com/docs/components/button + """ + buttonVariant: String + + """ + Custom CSS styles for the button (e.g., "background: linear-gradient(to right, #4f46e5, #7c3aed); border-radius: 9999px;") + """ + buttonStyle: String +} + +""" +Mode for evaluating authorization rules - OR (any rule passes) or AND (all rules must pass) +""" +enum AuthorizationRuleMode { + OR + AND +} + +type OidcConfiguration { + """List of configured OIDC providers""" + providers: [OidcProvider!]! + + """ + Default allowed redirect origins that apply to all OIDC providers (e.g., Tailscale domains) + """ + defaultAllowedOrigins: [String!] +} + +type OidcSessionValidation { + valid: Boolean! + username: String +} + +type PublicOidcProvider { + id: ID! + name: String! + buttonText: String + buttonIcon: String + buttonVariant: String + buttonStyle: String +} + +"""System time configuration and current status""" +type SystemTime { + """Current server time in ISO-8601 format (UTC)""" + currentTime: String! + + """IANA timezone identifier currently in use""" + timeZone: String! + + """Whether NTP/PTP time synchronization is enabled""" + useNtp: Boolean! + + """Configured NTP servers (empty strings indicate unused slots)""" + ntpServers: [String!]! +} + +"""Selectable timezone option from the system list""" +type TimeZoneOption { + """IANA timezone identifier""" + value: String! + + """Display label for the timezone""" + label: String! +} + +type UPSBattery { + """ + Battery charge level as a percentage (0-100). Unit: percent (%). Example: 100 means battery is fully charged + """ + chargeLevel: Int! + + """ + Estimated runtime remaining on battery power. Unit: seconds. Example: 3600 means 1 hour of runtime remaining + """ + estimatedRuntime: Int! + + """ + Battery health status. Possible values: 'Good', 'Replace', 'Unknown'. Indicates if the battery needs replacement + """ + health: String! +} + +type UPSPower { + """ + Input voltage from the wall outlet/mains power. Unit: volts (V). Example: 120.5 for typical US household voltage + """ + inputVoltage: Float! + + """ + Output voltage being delivered to connected devices. Unit: volts (V). Example: 120.5 - should match input voltage when on mains power + """ + outputVoltage: Float! + + """ + Current load on the UPS as a percentage of its capacity. Unit: percent (%). Example: 25 means UPS is loaded at 25% of its maximum capacity + """ + loadPercentage: Int! + + """ + Nominal power capacity of the UPS. Unit: watts (W). Example: 1000 means the UPS is rated for 1000 watts. This is the maximum power the UPS can deliver + """ + nominalPower: Int + + """ + Current power consumption calculated from load percentage and nominal power. Unit: watts (W). Example: 350 means 350 watts currently being used. Calculated as: nominalPower * (loadPercentage / 100) + """ + currentPower: Float +} + +type UPSDevice { + """ + Unique identifier for the UPS device. Usually based on the model name or a generated ID + """ + id: ID! + + """Display name for the UPS device. Can be customized by the user""" + name: String! + + """UPS model name/number. Example: 'APC Back-UPS Pro 1500'""" + model: String! + + """ + Current operational status of the UPS. Common values: 'Online', 'On Battery', 'Low Battery', 'Replace Battery', 'Overload', 'Offline'. 'Online' means running on mains power, 'On Battery' means running on battery backup + """ + status: String! + + """Battery-related information""" + battery: UPSBattery! + + """Power-related information""" + power: UPSPower! +} + +type UPSConfiguration { + """ + UPS service state. Values: 'enable' or 'disable'. Controls whether the UPS monitoring service is running + """ + service: String + + """ + Type of cable connecting the UPS to the server. Common values: 'usb', 'smart', 'ether', 'custom'. Determines communication protocol + """ + upsCable: String + + """ + Custom cable configuration string. Only used when upsCable is set to 'custom'. Format depends on specific UPS model + """ + customUpsCable: String + + """ + UPS communication type. Common values: 'usb', 'net', 'snmp', 'dumb', 'pcnet', 'modbus'. Defines how the server communicates with the UPS + """ + upsType: String + + """ + Device path or network address for UPS connection. Examples: '/dev/ttyUSB0' for USB, '192.168.1.100:3551' for network. Depends on upsType setting + """ + device: String + + """ + Override UPS capacity for runtime calculations. Unit: volt-amperes (VA). Example: 1500 for a 1500VA UPS. Leave unset to use UPS-reported capacity + """ + overrideUpsCapacity: Int + + """ + Battery level threshold for shutdown. Unit: percent (%). Example: 10 means shutdown when battery reaches 10%. System will shutdown when battery drops to this level + """ + batteryLevel: Int + + """ + Runtime threshold for shutdown. Unit: minutes. Example: 5 means shutdown when 5 minutes runtime remaining. System will shutdown when estimated runtime drops below this + """ + minutes: Int + + """ + Timeout for UPS communications. Unit: seconds. Example: 0 means no timeout. Time to wait for UPS response before considering it offline + """ + timeout: Int + + """ + Kill UPS power after shutdown. Values: 'yes' or 'no'. If 'yes', tells UPS to cut power after system shutdown. Useful for ensuring complete power cycle + """ + killUps: String + + """ + Network Information Server (NIS) IP address. Default: '0.0.0.0' (listen on all interfaces). IP address for apcupsd network information server + """ + nisIp: String + + """ + Network server mode. Values: 'on' or 'off'. Enable to allow network clients to monitor this UPS + """ + netServer: String + + """ + UPS name for network monitoring. Used to identify this UPS on the network. Example: 'SERVER_UPS' + """ + upsName: String + + """ + Override UPS model name. Used for display purposes. Leave unset to use UPS-reported model + """ + modelName: String +} + +type VmDomain implements Node { + """The unique identifier for the vm (uuid)""" + id: PrefixedID! + + """A friendly name for the vm""" + name: String + + """Current domain vm state""" + state: VmState! + + """The UUID of the vm""" + uuid: String @deprecated(reason: "Use id instead") +} + +"""The state of a virtual machine""" +enum VmState { + NOSTATE + RUNNING + IDLE + PAUSED + SHUTDOWN + SHUTOFF + CRASHED + PMSUSPENDED +} + +type Vms implements Node { + id: PrefixedID! + domains: [VmDomain!] + domain: [VmDomain!] +} + +type Uptime { + timestamp: String +} + +type Service implements Node { + id: PrefixedID! + name: String + online: Boolean + uptime: Uptime + version: String } type UserAccount implements Node { id: PrefixedID! + + """The name of the user""" name: String! + + """A description of the user""" description: String! + + """The roles of the user""" roles: [Role!]! + + """The permissions of the user""" permissions: [Permission!] } -type RCloneRemote { +type Plugin { + """The name of the plugin package""" name: String! - type: String! - parameters: JSON! - config: JSON! + + """The version of the plugin package""" + version: String! + + """Whether the plugin has an API module""" + hasApiModule: Boolean + + """Whether the plugin has a CLI module""" + hasCliModule: Boolean } -type RCloneDrive { - name: String! - options: JSON! +type AccessUrl { + type: URL_TYPE! + name: String + ipv4: URL + ipv6: URL } -type RCloneBackupConfigForm { - id: ID! - dataSchema: JSON! - uiSchema: JSON! +enum URL_TYPE { + LAN + WIREGUARD + WAN + MDNS + OTHER + DEFAULT } -type RCloneBackupSettings { - remotes: [RCloneRemote!]! - drives: [RCloneDrive!]! - configForm(formOptions: RCloneConfigFormInput): RCloneBackupConfigForm! +""" +A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt. +""" +scalar URL + +type AccessUrlObject { + ipv4: String + ipv6: String + type: URL_TYPE! + name: String } -type RCloneMutations { - createRCloneRemote(input: CreateRCloneRemoteInput!): RCloneRemote! - deleteRCloneRemote(input: DeleteRCloneRemoteInput!): Boolean! +type ApiKeyResponse { + valid: Boolean! + error: String } -type Theme { - name: ThemeName! - headerBackgroundColor: String - headerPrimaryTextColor: String - headerSecondaryTextColor: String - showBannerGradient: Boolean! - showBannerImage: Boolean! - showHeaderDescription: Boolean! +type MinigraphqlResponse { + status: MinigraphStatus! + timeout: Int + error: String } -type FlashBackupStatus { - jobId: String +"""The status of the minigraph""" +enum MinigraphStatus { + PRE_INIT + CONNECTING + CONNECTED + PING_FAILURE + ERROR_RETRYING +} + +type CloudResponse { status: String! + ip: String + error: String } -type UpdateSettingsResponse { - restartRequired: Boolean! - values: JSON! - warnings: [String!] +type RelayResponse { + status: String! + timeout: String + error: String } -# ============================================================================ -# Root Query Type -# ============================================================================ +type Cloud { + error: String + apiKey: ApiKeyResponse! + relay: RelayResponse + minigraphql: MinigraphqlResponse! + cloud: CloudResponse! + allowedOrigins: [String!]! +} + +type RemoteAccess { + """The type of WAN access used for Remote Access""" + accessType: WAN_ACCESS_TYPE! + + """The type of port forwarding used for Remote Access""" + forwardType: WAN_FORWARD_TYPE + + """The port used for Remote Access""" + port: Int +} + +enum WAN_ACCESS_TYPE { + DYNAMIC + ALWAYS + DISABLED +} + +enum WAN_FORWARD_TYPE { + UPNP + STATIC +} + +type DynamicRemoteAccessStatus { + """The type of dynamic remote access that is enabled""" + enabledType: DynamicRemoteAccessType! + + """The type of dynamic remote access that is currently running""" + runningType: DynamicRemoteAccessType! + + """Any error message associated with the dynamic remote access""" + error: String +} + +enum DynamicRemoteAccessType { + STATIC + UPNP + DISABLED +} + +type ConnectSettingsValues { + """The type of WAN access used for Remote Access""" + accessType: WAN_ACCESS_TYPE! + + """The type of port forwarding used for Remote Access""" + forwardType: WAN_FORWARD_TYPE + + """The port used for Remote Access""" + port: Int +} + +type ConnectSettings implements Node { + id: PrefixedID! + + """The data schema for the Connect settings""" + dataSchema: JSON! + + """The UI schema for the Connect settings""" + uiSchema: JSON! + + """The values for the Connect settings""" + values: ConnectSettingsValues! +} + +type Connect implements Node { + id: PrefixedID! + + """The status of dynamic remote access""" + dynamicRemoteAccess: DynamicRemoteAccessStatus! + + """The settings for the Connect instance""" + settings: ConnectSettings! +} + +type Network implements Node { + id: PrefixedID! + accessUrls: [AccessUrl!] +} + +input AccessUrlObjectInput { + ipv4: String + ipv6: String + type: URL_TYPE! + name: String +} + +"\n### Description:\n\nID scalar type that prefixes the underlying ID with the server identifier on output and strips it on input.\n\nWe use this scalar type to ensure that the ID is unique across all servers, allowing the same underlying resource ID to be used across different server instances.\n\n#### Input Behavior:\n\nWhen providing an ID as input (e.g., in arguments or input objects), the server identifier prefix (':') is optional.\n\n- If the prefix is present (e.g., '123:456'), it will be automatically stripped, and only the underlying ID ('456') will be used internally.\n- If the prefix is absent (e.g., '456'), the ID will be used as-is.\n\nThis makes it flexible for clients, as they don't strictly need to know or provide the server ID.\n\n#### Output Behavior:\n\nWhen an ID is returned in the response (output), it will *always* be prefixed with the current server's unique identifier (e.g., '123:456').\n\n#### Example:\n\nNote: The server identifier is '123' in this example.\n\n##### Input (Prefix Optional):\n```graphql\n# Both of these are valid inputs resolving to internal ID '456'\n{\n someQuery(id: \"123:456\") { ... }\n anotherQuery(id: \"456\") { ... }\n}\n```\n\n##### Output (Prefix Always Added):\n```graphql\n# Assuming internal ID is '456'\n{\n \"data\": {\n \"someResource\": {\n \"id\": \"123:456\" \n }\n }\n}\n```\n " +scalar PrefixedID + type Query { - # Array - array: UnraidArray! - parityHistory: [ParityCheck!]! - - # Config - config: Config! - - # Disks - disk(id: PrefixedID!): Disk! - disks: [Disk!]! - - # Docker - docker: Docker! - dockerNetwork(id: PrefixedID!): DockerNetwork - dockerNetworks: [DockerNetwork!] - - # Flash - flash: Flash! - - # Info - info: Info! - - # Logs - logFile(path: String!, lines: Int, startLine: Int): LogFileContent! - logFiles: [LogFile!]! - - # Metrics - metrics: Metrics! - - # Notifications - notifications: Notifications! - - # Online - online: Boolean! - - # Owner - owner: Owner! - - # API Keys - apiKey(id: PrefixedID!): ApiKey apiKeys: [ApiKey!]! + apiKey(id: PrefixedID!): ApiKey - # RClone - rclone: RCloneBackupSettings! + """All possible roles for API keys""" + apiKeyPossibleRoles: [Role!]! - # Registration - registration: Registration + """All possible permissions for API keys""" + apiKeyPossiblePermissions: [Permission!]! - # Servers - server: Server - servers: [Server!]! + """Get the actual permissions that would be granted by a set of roles""" + getPermissionsForRoles(roles: [Role!]!): [Permission!]! - # Services - services: [Service!]! + """ + Preview the effective permissions for a combination of roles and explicit permissions + """ + previewEffectivePermissions(roles: [Role!], permissions: [AddPermissionInput!]): [Permission!]! - # Settings - settings: Settings! + """Get all available authentication actions with possession""" + getAvailableAuthActions: [AuthAction!]! - # Shares - shares: [Share!]! - - # Unassigned devices - unassignedDevices: [UnassignedDevice!] - - # UPS - upsConfiguration: UPSConfiguration! - upsDeviceById(id: PrefixedID!): UPSDevice - upsDevices: [UPSDevice!]! - - # User + """Get JSON Schema for API key creation form""" + getApiKeyCreationFormSchema: ApiKeyFormSettings! + config: Config! + display: InfoDisplay! + flash: Flash! me: UserAccount! - # Vars + """Get all notifications""" + notifications: Notifications! + online: Boolean! + owner: Owner! + registration: Registration + server: Server + servers: [Server!]! + services: [Service!]! + shares: [Share!]! vars: Vars! - # VMs + """Get information about all VMs on the system""" vms: Vms! + parityHistory: [ParityCheck!]! + array: UnraidArray! + customization: Customization - # Network (used by MCP tool) - network: Network + """Whether the system is a fresh install (no license key)""" + isFreshInstall: Boolean! + publicTheme: Theme! + info: Info! + docker: Docker! + disks: [Disk!]! + disk(id: PrefixedID!): Disk! + rclone: RCloneBackupSettings! + logFiles: [LogFile!]! + logFile(path: String!, lines: Int, startLine: Int): LogFileContent! + settings: Settings! + isSSOEnabled: Boolean! - # Connect (used by MCP tool) - connect: ConnectSettings + """Get public OIDC provider information for login buttons""" + publicOidcProviders: [PublicOidcProvider!]! + + """Get all configured OIDC providers (admin only)""" + oidcProviders: [OidcProvider!]! + + """Get a specific OIDC provider by ID""" + oidcProvider(id: PrefixedID!): OidcProvider + + """Get the full OIDC configuration (admin only)""" + oidcConfiguration: OidcConfiguration! + + """Validate an OIDC session token (internal use for CLI validation)""" + validateOidcSession(token: String!): OidcSessionValidation! + metrics: Metrics! + + """Retrieve current system time configuration""" + systemTime: SystemTime! + + """Retrieve available time zone options""" + timeZoneOptions: [TimeZoneOption!]! + upsDevices: [UPSDevice!]! + upsDeviceById(id: String!): UPSDevice + upsConfiguration: UPSConfiguration! + + """Retrieve a plugin installation operation by identifier""" + pluginInstallOperation(operationId: ID!): PluginInstallOperation + + """List all tracked plugin installation operations""" + pluginInstallOperations: [PluginInstallOperation!]! + + """List installed Unraid OS plugins by .plg filename""" + installedUnraidPlugins: [String!]! + + """List all installed plugins with their metadata""" + plugins: [Plugin!]! + remoteAccess: RemoteAccess! + connect: Connect! + network: Network! + cloud: Cloud! } -# ============================================================================ -# Root Mutation Type -# ============================================================================ type Mutation { - # Array - array: ArrayMutations! - - # Parity - parityCheck: ParityCheckMutations! - - # Docker - docker: DockerMutations! - - # Notifications (root-level) + """Creates a new notification record""" createNotification(input: NotificationData!): Notification! - archiveNotification(id: PrefixedID!): Notification! - archiveAll(importance: NotificationImportance): NotificationOverview! deleteNotification(id: PrefixedID!, type: NotificationType!): NotificationOverview! + + """Deletes all archived notifications on server.""" deleteArchivedNotifications: NotificationOverview! + + """Marks a notification as archived.""" + archiveNotification(id: PrefixedID!): Notification! + archiveNotifications(ids: [PrefixedID!]!): NotificationOverview! + + """ + Creates a notification if an equivalent unread notification does not already exist. + """ + notifyIfUnique(input: NotificationData!): Notification + archiveAll(importance: NotificationImportance): NotificationOverview! + + """Marks a notification as unread.""" unreadNotification(id: PrefixedID!): Notification! - # Also accessible as nested (used by MCP tools) - notifications: Notifications! + unarchiveNotifications(ids: [PrefixedID!]!): NotificationOverview! + unarchiveAll(importance: NotificationImportance): NotificationOverview! - # API Keys (root-level aliases used by keys.py) - createApiKey(input: CreateApiKeyInput!): ApiKey! - updateApiKey(input: UpdateApiKeyInput!): ApiKey! - deleteApiKeys(input: DeleteApiKeysInput!): Boolean! - # Nested API key mutations - apiKey: ApiKeyMutations! - - # RClone - rclone: RCloneMutations! - - # VM + """Reads each notification to recompute & update the overview.""" + recalculateOverview: NotificationOverview! + array: ArrayMutations! + docker: DockerMutations! vm: VmMutations! + parityCheck: ParityCheckMutations! + apiKey: ApiKeyMutations! + customization: CustomizationMutations! + rclone: RCloneMutations! + onboarding: OnboardingMutations! + unraidPlugins: UnraidPluginsMutations! - # Settings + """Update server name, comment, and model""" + updateServerIdentity(name: String!, comment: String, sysModel: String): Server! + updateSshSettings(input: UpdateSshInput!): Vars! + createDockerFolder(name: String!, parentId: String, childrenIds: [String!]): ResolvedOrganizerV1! + setDockerFolderChildren(folderId: String, childrenIds: [String!]!): ResolvedOrganizerV1! + deleteDockerEntries(entryIds: [String!]!): ResolvedOrganizerV1! + moveDockerEntriesToFolder(sourceEntryIds: [String!]!, destinationFolderId: String!): ResolvedOrganizerV1! + moveDockerItemsToPosition(sourceEntryIds: [String!]!, destinationFolderId: String!, position: Float!): ResolvedOrganizerV1! + renameDockerFolder(folderId: String!, newName: String!): ResolvedOrganizerV1! + createDockerFolderWithItems(name: String!, parentId: String, sourceEntryIds: [String!], position: Float): ResolvedOrganizerV1! + updateDockerViewPreferences(viewId: String = "default", prefs: JSON!): ResolvedOrganizerV1! + syncDockerTemplatePaths: DockerTemplateSyncResult! + + """ + Reset Docker template mappings to defaults. Use this to recover from corrupted state. + """ + resetDockerTemplateMappings: Boolean! + refreshDockerDigests: Boolean! + + """Initiates a flash drive backup using a configured remote.""" + initiateFlashBackup(input: InitiateFlashBackupInput!): FlashBackupStatus! updateSettings(input: JSON!): UpdateSettingsResponse! + updateTemperatureConfig(input: TemperatureConfigInput!): Boolean! - # UPS + """Update system time configuration""" + updateSystemTime(input: UpdateSystemTimeInput!): SystemTime! configureUps(config: UPSConfigInput!): Boolean! + + """ + Add one or more plugins to the API. Returns false if restart was triggered automatically, true if manual restart is required. + """ + addPlugin(input: PluginManagementInput!): Boolean! + + """ + Remove one or more plugins from the API. Returns false if restart was triggered automatically, true if manual restart is required. + """ + removePlugin(input: PluginManagementInput!): Boolean! + updateApiSettings(input: ConnectSettingsInput!): ConnectSettingsValues! + connectSignIn(input: ConnectSignInInput!): Boolean! + connectSignOut: Boolean! + setupRemoteAccess(input: SetupRemoteAccessInput!): Boolean! + enableDynamicRemoteAccess(input: EnableDynamicRemoteAccessInput!): Boolean! +} + +input NotificationData { + title: String! + subject: String! + description: String! + importance: NotificationImportance! + link: String +} + +input UpdateSshInput { + enabled: Boolean! + + """SSH Port (default 22)""" + port: Int! +} + +input InitiateFlashBackupInput { + """The name of the remote configuration to use for the backup.""" + remoteName: String! + + """Source path to backup (typically the flash drive).""" + sourcePath: String! + + """Destination path on the remote.""" + destinationPath: String! + + """ + Additional options for the backup operation, such as --dry-run or --transfers. + """ + options: JSON +} + +input TemperatureConfigInput { + enabled: Boolean + polling_interval: Int + default_unit: TemperatureUnit + sensors: TemperatureSensorsConfigInput + thresholds: TemperatureThresholdsConfigInput + history: TemperatureHistoryConfigInput +} + +input TemperatureSensorsConfigInput { + lm_sensors: LmSensorsConfigInput + smartctl: SensorConfigInput + ipmi: IpmiConfigInput +} + +input LmSensorsConfigInput { + enabled: Boolean + config_path: String +} + +input SensorConfigInput { + enabled: Boolean +} + +input IpmiConfigInput { + enabled: Boolean + args: [String!] +} + +input TemperatureThresholdsConfigInput { + cpu_warning: Int + cpu_critical: Int + disk_warning: Int + disk_critical: Int + warning: Int + critical: Int +} + +input TemperatureHistoryConfigInput { + max_readings: Int + retention_ms: Int +} + +input UpdateSystemTimeInput { + """New IANA timezone identifier to apply""" + timeZone: String + + """Enable or disable NTP-based synchronization""" + useNtp: Boolean + + """ + Ordered list of up to four NTP servers. Supply empty strings to clear positions. + """ + ntpServers: [String!] + + """ + Manual date/time to apply when disabling NTP, expected format YYYY-MM-DD HH:mm:ss + """ + manualDateTime: String +} + +input UPSConfigInput { + """Enable or disable the UPS monitoring service""" + service: UPSServiceState + + """Type of cable connecting the UPS to the server""" + upsCable: UPSCableType + + """ + Custom cable configuration (only used when upsCable is CUSTOM). Format depends on specific UPS model + """ + customUpsCable: String + + """UPS communication protocol""" + upsType: UPSType + + """ + Device path or network address for UPS connection. Examples: '/dev/ttyUSB0' for USB, '192.168.1.100:3551' for network + """ + device: String + + """ + Override UPS capacity for runtime calculations. Unit: watts (W). Leave unset to use UPS-reported capacity + """ + overrideUpsCapacity: Int + + """ + Battery level percentage to initiate shutdown. Unit: percent (%) - Valid range: 0-100 + """ + batteryLevel: Int + + """Runtime left in minutes to initiate shutdown. Unit: minutes""" + minutes: Int + + """ + Time on battery before shutdown. Unit: seconds. Set to 0 to disable timeout-based shutdown + """ + timeout: Int + + """ + Turn off UPS power after system shutdown. Useful for ensuring complete power cycle + """ + killUps: UPSKillPower +} + +"""Service state for UPS daemon""" +enum UPSServiceState { + ENABLE + DISABLE +} + +"""UPS cable connection types""" +enum UPSCableType { + USB + SIMPLE + SMART + ETHER + CUSTOM +} + +"""UPS communication protocols""" +enum UPSType { + USB + APCSMART + NET + SNMP + DUMB + PCNET + MODBUS +} + +"""Kill UPS power after shutdown option""" +enum UPSKillPower { + YES + NO +} + +input PluginManagementInput { + """Array of plugin package names to add or remove""" + names: [String!]! + + """ + Whether to treat plugins as bundled plugins. Bundled plugins are installed to node_modules at build time and controlled via config only. + """ + bundled: Boolean! = false + + """ + Whether to restart the API after the operation. When false, a restart has already been queued. + """ + restart: Boolean! = true +} + +input ConnectSettingsInput { + """The type of WAN access to use for Remote Access""" + accessType: WAN_ACCESS_TYPE + + """The type of port forwarding to use for Remote Access""" + forwardType: WAN_FORWARD_TYPE + + """ + The port to use for Remote Access. Not required for UPNP forwardType. Required for STATIC forwardType. Ignored if accessType is DISABLED or forwardType is UPNP. + """ + port: Int +} + +input ConnectSignInInput { + """The API key for authentication""" + apiKey: String! + + """User information for the sign-in""" + userInfo: ConnectUserInfoInput +} + +input ConnectUserInfoInput { + """The preferred username of the user""" + preferred_username: String! + + """The email address of the user""" + email: String! + + """The avatar URL of the user""" + avatar: String +} + +input SetupRemoteAccessInput { + """The type of WAN access to use for Remote Access""" + accessType: WAN_ACCESS_TYPE! + + """The type of port forwarding to use for Remote Access""" + forwardType: WAN_FORWARD_TYPE + + """ + The port to use for Remote Access. Not required for UPNP forwardType. Required for STATIC forwardType. Ignored if accessType is DISABLED or forwardType is UPNP. + """ + port: Int +} + +input EnableDynamicRemoteAccessInput { + """The AccessURL Input for dynamic remote access""" + url: AccessUrlInput! + + """Whether to enable or disable dynamic remote access""" + enabled: Boolean! +} + +input AccessUrlInput { + type: URL_TYPE! + name: String + ipv4: URL + ipv6: URL } -# ============================================================================ -# Root Subscription Type -# ============================================================================ type Subscription { - arraySubscription: UnraidArray! - logFile(path: String!): LogFileContent! + displaySubscription: InfoDisplay! notificationAdded: Notification! notificationsOverview: NotificationOverview! + notificationsWarningsAndAlerts: [Notification!]! ownerSubscription: Owner! - parityHistorySubscription: ParityCheck! serversSubscription: Server! + parityHistorySubscription: ParityCheck! + arraySubscription: UnraidArray! + dockerContainerStats: DockerContainerStats! + logFile(path: String!): LogFileContent! systemMetricsCpu: CpuUtilization! systemMetricsCpuTelemetry: CpuPackages! systemMetricsMemory: MemoryUtilization! + systemMetricsTemperature: TemperatureMetrics upsUpdates: UPSDevice! + pluginInstallUpdates(operationId: ID!): PluginInstallEvent! } diff --git a/pyproject.toml b/pyproject.toml index 0515555..ad129aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "hatchling.build" # ============================================================================ [project] name = "unraid-mcp" -version = "0.2.0" +version = "0.2.1" description = "MCP Server for Unraid API - provides tools to interact with an Unraid server's GraphQL API" readme = "README.md" license = {file = "LICENSE"} @@ -189,7 +189,7 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401", "D104"] -"tests/**/*.py" = ["D", "S101", "PLR2004"] # Allow asserts and magic values in tests +"tests/**/*.py" = ["D", "S101", "S105", "S106", "S107", "PLR2004"] # Allow test-only patterns [tool.ruff.lint.pydocstyle] convention = "google" diff --git a/tests/http_layer/test_request_construction.py b/tests/http_layer/test_request_construction.py index e588c77..c183788 100644 --- a/tests/http_layer/test_request_construction.py +++ b/tests/http_layer/test_request_construction.py @@ -659,9 +659,10 @@ class TestArrayToolRequests: return_value=_graphql_response({"parityCheck": {"start": True}}) ) tool = self._get_tool() - result = await tool(action="parity_start") + result = await tool(action="parity_start", correct=False) body = _extract_request_body(route.calls.last.request) assert "StartParityCheck" in body["query"] + assert body["variables"] == {"correct": False} assert result["success"] is True @respx.mock @@ -858,9 +859,9 @@ class TestNotificationsToolRequests: async def test_create_sends_input_variables(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"notifications": {"createNotification": { + {"createNotification": { "id": "n1", "title": "Test", "importance": "INFO", - }}} + }} ) ) tool = self._get_tool() @@ -882,7 +883,7 @@ class TestNotificationsToolRequests: async def test_archive_sends_id_variable(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"notifications": {"archiveNotification": True}} + {"archiveNotification": {"id": "notif-1"}} ) ) tool = self._get_tool() @@ -901,7 +902,7 @@ class TestNotificationsToolRequests: async def test_delete_sends_id_and_type(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"notifications": {"deleteNotification": True}} + {"deleteNotification": {"unread": {"total": 0}}} ) ) tool = self._get_tool() @@ -920,7 +921,7 @@ class TestNotificationsToolRequests: async def test_archive_all_sends_importance_when_provided(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"notifications": {"archiveAll": True}} + {"archiveAll": {"archive": {"total": 1}}} ) ) tool = self._get_tool() @@ -1087,10 +1088,10 @@ class TestKeysToolRequests: async def test_create_sends_input_variables(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"createApiKey": { + {"apiKey": {"create": { "id": "k2", "name": "new-key", "key": "secret", "roles": ["read"], - }} + }}} ) ) tool = self._get_tool() @@ -1106,7 +1107,7 @@ class TestKeysToolRequests: async def test_update_sends_input_variables(self) -> None: route = respx.post(API_URL).mock( return_value=_graphql_response( - {"updateApiKey": {"id": "k1", "name": "renamed", "roles": ["admin"]}} + {"apiKey": {"update": {"id": "k1", "name": "renamed", "roles": ["admin"]}}} ) ) tool = self._get_tool() @@ -1126,12 +1127,12 @@ class TestKeysToolRequests: @respx.mock async def test_delete_sends_ids_when_confirmed(self) -> None: route = respx.post(API_URL).mock( - return_value=_graphql_response({"deleteApiKeys": True}) + return_value=_graphql_response({"apiKey": {"delete": True}}) ) tool = self._get_tool() result = await tool(action="delete", key_id="k1", confirm=True) body = _extract_request_body(route.calls.last.request) - assert "DeleteApiKeys" in body["query"] + assert "DeleteApiKey" in body["query"] assert body["variables"]["input"]["ids"] == ["k1"] assert result["success"] is True diff --git a/tests/safety/test_destructive_guards.py b/tests/safety/test_destructive_guards.py index 1512906..4432bfe 100644 --- a/tests/safety/test_destructive_guards.py +++ b/tests/safety/test_destructive_guards.py @@ -305,7 +305,7 @@ class TestConfirmAllowsExecution: assert result["success"] is True async def test_notifications_delete_with_confirm(self, _mock_notif_graphql: AsyncMock) -> None: - _mock_notif_graphql.return_value = {"notifications": {"deleteNotification": True}} + _mock_notif_graphql.return_value = {"deleteNotification": {"unread": {"total": 0}}} tool_fn = make_tool_fn( "unraid_mcp.tools.notifications", "register_notifications_tool", "unraid_notifications" ) @@ -318,7 +318,7 @@ class TestConfirmAllowsExecution: assert result["success"] is True async def test_notifications_delete_archived_with_confirm(self, _mock_notif_graphql: AsyncMock) -> None: - _mock_notif_graphql.return_value = {"notifications": {"deleteArchivedNotifications": True}} + _mock_notif_graphql.return_value = {"deleteArchivedNotifications": {"archive": {"total": 0}}} tool_fn = make_tool_fn( "unraid_mcp.tools.notifications", "register_notifications_tool", "unraid_notifications" ) @@ -332,7 +332,7 @@ class TestConfirmAllowsExecution: assert result["success"] is True async def test_keys_delete_with_confirm(self, _mock_keys_graphql: AsyncMock) -> None: - _mock_keys_graphql.return_value = {"deleteApiKeys": True} + _mock_keys_graphql.return_value = {"apiKey": {"delete": True}} tool_fn = make_tool_fn("unraid_mcp.tools.keys", "register_keys_tool", "unraid_keys") result = await tool_fn(action="delete", key_id="key-123", confirm=True) assert result["success"] is True diff --git a/tests/test_array.py b/tests/test_array.py index 8717d78..9837022 100644 --- a/tests/test_array.py +++ b/tests/test_array.py @@ -39,12 +39,17 @@ class TestArrayValidation: with pytest.raises(ToolError, match="Invalid action"): await tool_fn(action=action) + async def test_parity_start_requires_correct(self, _mock_graphql: AsyncMock) -> None: + tool_fn = _make_tool() + with pytest.raises(ToolError, match="correct is required"): + await tool_fn(action="parity_start") + class TestArrayActions: async def test_parity_start(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = {"parityCheck": {"start": True}} tool_fn = _make_tool() - result = await tool_fn(action="parity_start") + result = await tool_fn(action="parity_start", correct=False) assert result["success"] is True assert result["action"] == "parity_start" _mock_graphql.assert_called_once() @@ -94,14 +99,14 @@ class TestArrayMutationFailures: async def test_parity_start_mutation_returns_false(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = {"parityCheck": {"start": False}} tool_fn = _make_tool() - result = await tool_fn(action="parity_start") + result = await tool_fn(action="parity_start", correct=False) assert result["success"] is True assert result["data"] == {"parityCheck": {"start": False}} async def test_parity_start_mutation_returns_null(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = {"parityCheck": {"start": None}} tool_fn = _make_tool() - result = await tool_fn(action="parity_start") + result = await tool_fn(action="parity_start", correct=False) assert result["success"] is True assert result["data"] == {"parityCheck": {"start": None}} @@ -110,7 +115,7 @@ class TestArrayMutationFailures: ) -> None: _mock_graphql.return_value = {"parityCheck": {"start": {}}} tool_fn = _make_tool() - result = await tool_fn(action="parity_start") + result = await tool_fn(action="parity_start", correct=False) assert result["success"] is True assert result["data"] == {"parityCheck": {"start": {}}} @@ -128,7 +133,7 @@ class TestArrayNetworkErrors: _mock_graphql.side_effect = ToolError("HTTP error 500: Internal Server Error") tool_fn = _make_tool() with pytest.raises(ToolError, match="HTTP error 500"): - await tool_fn(action="parity_start") + await tool_fn(action="parity_start", correct=False) async def test_connection_refused(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.side_effect = ToolError("Network connection error: Connection refused") diff --git a/tests/test_keys.py b/tests/test_keys.py index 2236fbe..28b23e4 100644 --- a/tests/test_keys.py +++ b/tests/test_keys.py @@ -65,7 +65,9 @@ class TestKeysActions: async def test_create(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = { - "createApiKey": {"id": "k:new", "name": "new-key", "key": "secret123", "roles": []} + "apiKey": { + "create": {"id": "k:new", "name": "new-key", "key": "secret123", "roles": []} + } } tool_fn = _make_tool() result = await tool_fn(action="create", name="new-key") @@ -74,11 +76,13 @@ class TestKeysActions: async def test_create_with_roles(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = { - "createApiKey": { - "id": "k:new", - "name": "admin-key", - "key": "secret", - "roles": ["admin"], + "apiKey": { + "create": { + "id": "k:new", + "name": "admin-key", + "key": "secret", + "roles": ["admin"], + } } } tool_fn = _make_tool() @@ -86,13 +90,15 @@ class TestKeysActions: assert result["success"] is True async def test_update(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"updateApiKey": {"id": "k:1", "name": "renamed", "roles": []}} + _mock_graphql.return_value = { + "apiKey": {"update": {"id": "k:1", "name": "renamed", "roles": []}} + } tool_fn = _make_tool() result = await tool_fn(action="update", key_id="k:1", name="renamed") assert result["success"] is True async def test_delete(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"deleteApiKeys": True} + _mock_graphql.return_value = {"apiKey": {"delete": True}} tool_fn = _make_tool() result = await tool_fn(action="delete", key_id="k:1", confirm=True) assert result["success"] is True diff --git a/tests/test_notifications.py b/tests/test_notifications.py index 40dae42..890d5fd 100644 --- a/tests/test_notifications.py +++ b/tests/test_notifications.py @@ -82,9 +82,7 @@ class TestNotificationsActions: async def test_create(self, _mock_graphql: AsyncMock) -> None: _mock_graphql.return_value = { - "notifications": { - "createNotification": {"id": "n:new", "title": "Test", "importance": "INFO"} - } + "createNotification": {"id": "n:new", "title": "Test", "importance": "INFO"} } tool_fn = _make_tool() result = await tool_fn( @@ -97,13 +95,13 @@ class TestNotificationsActions: assert result["success"] is True async def test_archive_notification(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"notifications": {"archiveNotification": True}} + _mock_graphql.return_value = {"archiveNotification": {"id": "n:1"}} tool_fn = _make_tool() result = await tool_fn(action="archive", notification_id="n:1") assert result["success"] is True async def test_delete_with_confirm(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"notifications": {"deleteNotification": True}} + _mock_graphql.return_value = {"deleteNotification": {"unread": {"total": 0}}} tool_fn = _make_tool() result = await tool_fn( action="delete", @@ -114,13 +112,13 @@ class TestNotificationsActions: assert result["success"] is True async def test_archive_all(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"notifications": {"archiveAll": True}} + _mock_graphql.return_value = {"archiveAll": {"archive": {"total": 1}}} tool_fn = _make_tool() result = await tool_fn(action="archive_all") assert result["success"] is True async def test_unread_notification(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"notifications": {"unreadNotification": True}} + _mock_graphql.return_value = {"unreadNotification": {"id": "n:1"}} tool_fn = _make_tool() result = await tool_fn(action="unread", notification_id="n:1") assert result["success"] is True @@ -140,7 +138,7 @@ class TestNotificationsActions: assert filter_var["offset"] == 5 async def test_delete_archived(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = {"notifications": {"deleteArchivedNotifications": True}} + _mock_graphql.return_value = {"deleteArchivedNotifications": {"archive": {"total": 0}}} tool_fn = _make_tool() result = await tool_fn(action="delete_archived", confirm=True) assert result["success"] is True @@ -180,9 +178,7 @@ class TestNotificationsCreateValidation: ) async def test_alert_importance_accepted(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = { - "notifications": {"createNotification": {"id": "n:1", "importance": "ALERT"}} - } + _mock_graphql.return_value = {"createNotification": {"id": "n:1", "importance": "ALERT"}} tool_fn = _make_tool() result = await tool_fn( action="create", title="T", subject="S", description="D", importance="alert" @@ -223,9 +219,7 @@ class TestNotificationsCreateValidation: ) async def test_title_at_max_accepted(self, _mock_graphql: AsyncMock) -> None: - _mock_graphql.return_value = { - "notifications": {"createNotification": {"id": "n:1", "importance": "NORMAL"}} - } + _mock_graphql.return_value = {"createNotification": {"id": "n:1", "importance": "NORMAL"}} tool_fn = _make_tool() result = await tool_fn( action="create", diff --git a/unraid_mcp/tools/array.py b/unraid_mcp/tools/array.py index 85fe93b..b712849 100644 --- a/unraid_mcp/tools/array.py +++ b/unraid_mcp/tools/array.py @@ -22,7 +22,7 @@ QUERIES: dict[str, str] = { MUTATIONS: dict[str, str] = { "parity_start": """ - mutation StartParityCheck($correct: Boolean) { + mutation StartParityCheck($correct: Boolean!) { parityCheck { start(correct: $correct) } } """, @@ -92,7 +92,9 @@ def register_array_tool(mcp: FastMCP) -> None: query = MUTATIONS[action] variables: dict[str, Any] | None = None - if action == "parity_start" and correct is not None: + if action == "parity_start": + if correct is None: + raise ToolError("correct is required for 'parity_start' action") variables = {"correct": correct} data = await make_graphql_request(query, variables) diff --git a/unraid_mcp/tools/keys.py b/unraid_mcp/tools/keys.py index 191c970..65dfeae 100644 --- a/unraid_mcp/tools/keys.py +++ b/unraid_mcp/tools/keys.py @@ -29,17 +29,17 @@ QUERIES: dict[str, str] = { MUTATIONS: dict[str, str] = { "create": """ mutation CreateApiKey($input: CreateApiKeyInput!) { - createApiKey(input: $input) { id name key roles } + apiKey { create(input: $input) { id name key roles } } } """, "update": """ mutation UpdateApiKey($input: UpdateApiKeyInput!) { - updateApiKey(input: $input) { id name roles } + apiKey { update(input: $input) { id name roles } } } """, "delete": """ - mutation DeleteApiKeys($input: DeleteApiKeysInput!) { - deleteApiKeys(input: $input) + mutation DeleteApiKey($input: DeleteApiKeyInput!) { + apiKey { delete(input: $input) } } """, } @@ -116,7 +116,7 @@ def register_keys_tool(mcp: FastMCP) -> None: data = await make_graphql_request(MUTATIONS["create"], {"input": input_data}) return { "success": True, - "key": data.get("createApiKey", {}), + "key": (data.get("apiKey") or {}).get("create", {}), } if action == "update": @@ -130,14 +130,14 @@ def register_keys_tool(mcp: FastMCP) -> None: data = await make_graphql_request(MUTATIONS["update"], {"input": input_data}) return { "success": True, - "key": data.get("updateApiKey", {}), + "key": (data.get("apiKey") or {}).get("update", {}), } if action == "delete": if not key_id: raise ToolError("key_id is required for 'delete' action") data = await make_graphql_request(MUTATIONS["delete"], {"input": {"ids": [key_id]}}) - result = data.get("deleteApiKeys") + result = (data.get("apiKey") or {}).get("delete") if not result: raise ToolError( f"Failed to delete API key '{key_id}': no confirmation from server" diff --git a/unraid_mcp/tools/notifications.py b/unraid_mcp/tools/notifications.py index 3053a13..a40eedb 100644 --- a/unraid_mcp/tools/notifications.py +++ b/unraid_mcp/tools/notifications.py @@ -44,33 +44,33 @@ QUERIES: dict[str, str] = { MUTATIONS: dict[str, str] = { "create": """ - mutation CreateNotification($input: CreateNotificationInput!) { - notifications { createNotification(input: $input) { id title importance } } + mutation CreateNotification($input: NotificationData!) { + createNotification(input: $input) { id title importance } } """, "archive": """ mutation ArchiveNotification($id: PrefixedID!) { - notifications { archiveNotification(id: $id) } + archiveNotification(id: $id) } """, "unread": """ mutation UnreadNotification($id: PrefixedID!) { - notifications { unreadNotification(id: $id) } + unreadNotification(id: $id) } """, "delete": """ mutation DeleteNotification($id: PrefixedID!, $type: NotificationType!) { - notifications { deleteNotification(id: $id, type: $type) } + deleteNotification(id: $id, type: $type) } """, "delete_archived": """ mutation DeleteArchivedNotifications { - notifications { deleteArchivedNotifications } + deleteArchivedNotifications } """, "archive_all": """ mutation ArchiveAllNotifications($importance: NotificationImportance) { - notifications { archiveAll(importance: $importance) } + archiveAll(importance: $importance) } """, }