API Referansı

Oturumlar

Adlandırılmış bir API belirteci oluşturun; clientId ve Base64 kodlu 32 baytlık token döndürülür. Oturum açma ve API belirteci oturumlarını listeleyin. LOGIN için token ve urlToken boştur; API_TOKEN kimlik bilgileri yerel sahibin isteklerini gerektirir.

Tip Tanımları

graphql
type Mutation {
  createApiToken(name: String!): CreatedApiToken!
  renameSession(clientId: ID!, name: String!): Boolean!
  revokeSession(clientId: ID!): Boolean!
}

type Query {
  sessions: [Session!]!
}

type CreatedApiToken {
	clientId: ID!
	token: String!
}

scalar Instant

type Session {
	clientId: ID!
	clientName: String!
	type: SessionType!
	clientIp: String!
	osName: String!
	osVersion: String!
	appName: String!
	appVersion: String!
	lastSeenAt: Instant
	lastActive: Instant!
	createdAt: Instant!
	updatedAt: Instant!
}

enum SessionType {
	LOGIN
	API_TOKEN
}

İşlemler

mutation

createApiToken

Adlandırılmış bir API belirteci oluşturun; clientId ve Base64 kodlu 32 baytlık token döndürülür.

graphql
mutation createApiToken($name: String!) {
  createApiToken(name: $name) { clientId token }
}
mutation

renameSession

Belirtilen yetkili istemci oturumunu yeniden adlandırır.

graphql
mutation renameSession($clientId: ID!, $name: String!) {
  renameSession(clientId: $clientId, name: $name)
}
mutation

revokeSession

Belirtilen istemci oturumunu ve erişimini iptal eder.

graphql
mutation revokeSession($clientId: ID!) {
  revokeSession(clientId: $clientId)
}
query

sessions

Oturum açma ve API belirteci oturumlarını listeleyin. LOGIN için token ve urlToken boştur; API_TOKEN kimlik bilgileri yerel sahibin isteklerini gerektirir.

graphql
query sessions {
  sessions { clientId clientName type clientIp osName osVersion appName appVersion }
}