selfprivacy.org.app/lib/logic/api_maps/graphql_maps/schema/schema.graphql

362 lines
6.9 KiB
GraphQL
Raw Normal View History

2022-07-12 12:54:16 +00:00
type Alert {
message: String!
severity: Severity!
2022-07-12 12:54:16 +00:00
timestamp: DateTime
title: String!
}
2022-07-12 12:54:16 +00:00
type Api {
devices: [ApiDevice!]!
recoveryKey: ApiRecoveryKeyStatus!
version: String!
2022-07-12 12:54:16 +00:00
}
type ApiDevice {
creationDate: DateTime!
isCaller: Boolean!
name: String!
}
type ApiJob {
createdAt: DateTime!
description: String!
error: String
finishedAt: DateTime
name: String!
progress: Int
result: String
status: String!
statusText: String
uid: String!
updatedAt: DateTime!
2022-07-12 12:54:16 +00:00
}
type ApiKeyMutationReturn implements MutationReturnInterface {
code: Int!
key: String
message: String!
success: Boolean!
2022-07-12 12:54:16 +00:00
}
type ApiRecoveryKeyStatus {
creationDate: DateTime
exists: Boolean!
2022-07-12 12:54:16 +00:00
expirationDate: DateTime
usesLeft: Int
valid: Boolean!
2022-07-12 12:54:16 +00:00
}
type AutoUpgradeOptions {
allowReboot: Boolean!
2022-07-12 12:54:16 +00:00
enable: Boolean!
}
input AutoUpgradeSettingsInput {
enableAutoUpgrade: Boolean = null
allowReboot: Boolean = null
}
type AutoUpgradeSettingsMutationReturn implements MutationReturnInterface {
2022-07-12 12:54:16 +00:00
allowReboot: Boolean!
code: Int!
enableAutoUpgrade: Boolean!
message: String!
success: Boolean!
2022-07-12 12:54:16 +00:00
}
"""Date with time (isoformat)"""
scalar DateTime
2022-07-12 12:54:16 +00:00
type DeviceApiTokenMutationReturn implements MutationReturnInterface {
code: Int!
message: String!
success: Boolean!
2022-07-12 12:54:16 +00:00
token: String
}
enum DnsProvider {
CLOUDFLARE,
2023-06-02 03:52:32 +00:00
DESEC,
DIGITALOCEAN
2022-07-12 12:54:16 +00:00
}
type DnsRecord {
content: String!
name: String!
2022-07-12 12:54:16 +00:00
priority: Int
recordType: String!
ttl: Int!
2022-07-12 12:54:16 +00:00
}
type GenericJobButationReturn implements MutationReturnInterface {
code: Int!
job: ApiJob
2022-07-12 12:54:16 +00:00
message: String!
success: Boolean!
}
type GenericMutationReturn implements MutationReturnInterface {
2022-07-12 12:54:16 +00:00
code: Int!
message: String!
success: Boolean!
}
type Job {
getJob(jobId: String!): ApiJob
getJobs: [ApiJob!]!
}
input MigrateToBindsInput {
emailBlockDevice: String!
bitwardenBlockDevice: String!
giteaBlockDevice: String!
nextcloudBlockDevice: String!
pleromaBlockDevice: String!
}
input MoveServiceInput {
serviceId: String!
location: String!
2022-07-12 12:54:16 +00:00
}
type Mutation {
addSshKey(sshInput: SshMutationInput!): UserMutationReturn!
authorizeWithNewDeviceApiKey(input: UseNewDeviceKeyInput!): DeviceApiTokenMutationReturn!
changeAutoUpgradeSettings(settings: AutoUpgradeSettingsInput!): AutoUpgradeSettingsMutationReturn!
changeTimezone(timezone: String!): TimezoneMutationReturn!
createUser(user: UserMutationInput!): UserMutationReturn!
2022-07-12 12:54:16 +00:00
deleteDeviceApiToken(device: String!): GenericMutationReturn!
deleteUser(username: String!): GenericMutationReturn!
disableService(serviceId: String!): ServiceMutationReturn!
enableService(serviceId: String!): ServiceMutationReturn!
2022-07-12 12:54:16 +00:00
getNewDeviceApiKey: ApiKeyMutationReturn!
getNewRecoveryApiKey(limits: RecoveryKeyLimitsInput = null): ApiKeyMutationReturn!
2022-07-12 12:54:16 +00:00
invalidateNewDeviceApiKey: GenericMutationReturn!
migrateToBinds(input: MigrateToBindsInput!): GenericJobButationReturn!
mountVolume(name: String!): GenericMutationReturn!
moveService(input: MoveServiceInput!): ServiceJobMutationReturn!
pullRepositoryChanges: GenericMutationReturn!
rebootSystem: GenericMutationReturn!
refreshDeviceApiToken: DeviceApiTokenMutationReturn!
removeJob(jobId: String!): GenericMutationReturn!
removeSshKey(sshInput: SshMutationInput!): UserMutationReturn!
resizeVolume(name: String!): GenericMutationReturn!
restartService(serviceId: String!): ServiceMutationReturn!
runSystemRebuild: GenericMutationReturn!
runSystemRollback: GenericMutationReturn!
runSystemUpgrade: GenericMutationReturn!
startService(serviceId: String!): ServiceMutationReturn!
stopService(serviceId: String!): ServiceMutationReturn!
testMutation: GenericMutationReturn!
unmountVolume(name: String!): GenericMutationReturn!
updateUser(user: UserMutationInput!): UserMutationReturn!
useRecoveryApiKey(input: UseRecoveryKeyInput!): DeviceApiTokenMutationReturn!
2022-07-12 12:54:16 +00:00
}
interface MutationReturnInterface {
code: Int!
message: String!
success: Boolean!
2022-07-12 12:54:16 +00:00
}
type Query {
api: Api!
jobs: Job!
services: Services!
storage: Storage!
system: System!
users: Users!
2022-07-12 12:54:16 +00:00
}
input RecoveryKeyLimitsInput {
expirationDate: DateTime = null
uses: Int = null
2022-07-12 12:54:16 +00:00
}
enum ServerProvider {
HETZNER
DIGITALOCEAN
2022-07-12 12:54:16 +00:00
}
type Service {
description: String!
displayName: String!
dnsRecords: [DnsRecord!]
id: String!
isEnabled: Boolean!
isMovable: Boolean!
isRequired: Boolean!
status: ServiceStatusEnum!
storageUsage: ServiceStorageUsage!
svgIcon: String!
url: String
}
type ServiceJobMutationReturn implements MutationReturnInterface {
code: Int!
job: ApiJob
message: String!
service: Service
success: Boolean!
}
type ServiceMutationReturn implements MutationReturnInterface {
code: Int!
message: String!
service: Service
success: Boolean!
}
enum ServiceStatusEnum {
ACTIVATING
ACTIVE
DEACTIVATING
FAILED
INACTIVE
OFF
RELOADING
}
type ServiceStorageUsage implements StorageUsageInterface {
service: Service
title: String!
usedSpace: String!
volume: StorageVolume
}
type Services {
allServices: [Service!]!
}
2022-07-12 12:54:16 +00:00
enum Severity {
CRITICAL
ERROR
INFO
2022-07-12 12:54:16 +00:00
SUCCESS
WARNING
}
input SshMutationInput {
username: String!
sshKey: String!
2022-07-12 12:54:16 +00:00
}
type SshSettings {
enable: Boolean!
passwordAuthentication: Boolean!
rootSshKeys: [String!]!
}
type Storage {
volumes: [StorageVolume!]!
}
interface StorageUsageInterface {
title: String!
usedSpace: String!
volume: StorageVolume
}
type StorageVolume {
freeSpace: String!
model: String
name: String!
root: Boolean!
serial: String
totalSpace: String!
type: String!
usages: [StorageUsageInterface!]!
usedSpace: String!
}
type Subscription {
count(target: Int! = 100): Int!
}
2022-07-12 12:54:16 +00:00
type System {
busy: Boolean!
domainInfo: SystemDomainInfo!
2022-07-12 12:54:16 +00:00
info: SystemInfo!
provider: SystemProviderInfo!
settings: SystemSettings!
status: Alert!
workingDirectory: String!
2022-07-12 12:54:16 +00:00
}
type SystemDomainInfo {
domain: String!
hostname: String!
provider: DnsProvider!
requiredDnsRecords: [DnsRecord!]!
}
type SystemInfo {
pythonVersion: String!
systemVersion: String!
usingBinds: Boolean!
2022-07-12 12:54:16 +00:00
}
type SystemProviderInfo {
id: String!
provider: ServerProvider!
2022-07-12 12:54:16 +00:00
}
type SystemSettings {
autoUpgrade: AutoUpgradeOptions!
ssh: SshSettings!
timezone: String!
}
type TimezoneMutationReturn implements MutationReturnInterface {
code: Int!
message: String!
success: Boolean!
timezone: String
}
2022-07-12 12:54:16 +00:00
input UseNewDeviceKeyInput {
key: String!
deviceName: String!
}
input UseRecoveryKeyInput {
key: String!
deviceName: String!
}
type User {
sshKeys: [String!]!
userType: UserType!
username: String!
}
input UserMutationInput {
username: String!
password: String!
}
type UserMutationReturn implements MutationReturnInterface {
code: Int!
message: String!
success: Boolean!
user: User
}
enum UserType {
NORMAL
PRIMARY
ROOT
}
type Users {
allUsers: [User!]!
getUser(username: String!): User
}
fragment dnsRecordFields on DnsRecord {
content
name
priority
recordType
ttl
}