PlainApp
API 참조

세션

이름이 있는 API 토큰을 만들고 clientId와 Base64로 인코딩된 32바이트 token을 반환합니다. 로그인 및 API 토큰 세션을 나열합니다. LOGIN의 token과 urlToken은 비어 있으며, API_TOKEN 인증 정보는 로컬 소유자 요청으로만 읽을 수 있습니다.

타입 정의

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
}

작업

mutation

createApiToken

이름이 있는 API 토큰을 만들고 clientId와 Base64로 인코딩된 32바이트 token을 반환합니다.

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

renameSession

지정한 인가된 클라이언트 세션의 이름을 변경합니다.

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

revokeSession

지정한 클라이언트 세션과 접근 권한을 취소합니다.

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

sessions

로그인 및 API 토큰 세션을 나열합니다. LOGIN의 token과 urlToken은 비어 있으며, API_TOKEN 인증 정보는 로컬 소유자 요청으로만 읽을 수 있습니다.

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