PlainApp
API 참조

이미지

기능 지원은 app.capabilities, 인가는 app.access와 호스트 권한으로 확인하세요. 예제는 합성 값을 사용합니다. 호출 전에 경로, ID, 입력, 필터를 바꾸세요.

타입 정의

graphql
type Subscription {
  imageModelsUpdated: ImageModelsUpdate!
}

type Mutation {
  cancelImageIndex: Boolean!
  cancelImageModelDownload: Boolean!
  disableImageSearch: Boolean!
  enableImageSearch: Boolean!
  importImageSearchModel: Boolean!
  startImageIndex(force: Boolean): Boolean!
}

type Query {
  imageCount(query: String!): Int!
  imageSearchStatus: ImageSearchStatus!
  images(query: String!, offset: Int!, limit: Int!, sortBy: ImageSortBy!): [Image!]!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

type Image implements MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	width: Int!
	height: Int!
	rotation: Int!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
	takenAt: Instant
	isFavorite: Boolean!
	tags: [Tag!]!
}

type ImageModelsUpdate {
	version: Long!
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

type ImageSearchStatus {
	status: ImageSearchStatusType!
	downloadProgress: Int!
	errorMessage: String!
	modelSize: Long!
	modelDir: String!
	isIndexing: Boolean!
	totalImages: Int!
	indexedImages: Int!
}

enum ImageSearchStatusType {
	UNAVAILABLE
	DOWNLOADING
	LOADING
	READY
	ERROR
}

enum ImageSortBy {
	UPDATED_AT_ASC
	UPDATED_AT_DESC
	SIZE_ASC
	SIZE_DESC
	NAME_ASC
	NAME_DESC
	TAKEN_AT_DESC
}

scalar Instant

scalar Long

interface MediaItem {
	id: ID!
	title: String!
	path: String!
	size: Long!
	bucketId: ID!
	createdAt: Instant!
	updatedAt: Instant!
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

작업

subscription

imageModelsUpdated

이미지 검색 모델의 다운로드 또는 사용 가능 상태 업데이트를 받습니다.

graphql
subscription imageModelsUpdated {
  imageModelsUpdated { version status downloadProgress errorMessage modelSize modelDir isIndexing totalImages }
}
mutation

cancelImageIndex

실행 중인 인덱싱을 취소합니다.

graphql
mutation cancelImageIndex {
  cancelImageIndex
}
mutation

cancelImageModelDownload

진행 중인 AI 모델 다운로드를 취소합니다.

graphql
mutation cancelImageModelDownload {
  cancelImageModelDownload
}
mutation

disableImageSearch

AI 의미 기반 이미지 검색을 비활성화하고 리소스를 해제합니다.

graphql
mutation disableImageSearch {
  disableImageSearch
}
mutation

enableImageSearch

AI 의미 기반 이미지 검색을 활성화합니다. 기기에 모델이 없으면 다운로드합니다.

graphql
mutation enableImageSearch {
  enableImageSearch
}
mutation

importImageSearchModel

이미 업로드된 완전한 이미지 검색 모델 패키지를 검증하고 활성화합니다.

graphql
mutation importImageSearchModel {
  importImageSearchModel
}
mutation

startImageIndex

AI 검색용 이미지 인덱싱을 시작합니다. 전체를 다시 인덱싱하려면 force=true를 전달하세요.

graphql
# `force` re-scans images that already have an embedding.
mutation startImageIndex($force: Boolean) {
  startImageIndex(force: $force)
}
query

imageCount

쿼리에 일치하는 이미지 수를 셉니다.

graphql
query imageCount($query: String!) {
  imageCount(query: $query)
}
query

imageSearchStatus

현재 AI 의미 검색 인덱싱 상태를 가져옵니다.

graphql
query imageSearchStatus {
  imageSearchStatus { status downloadProgress errorMessage modelSize modelDir isIndexing totalImages indexedImages }
}
query

images

이미지 카탈로그를 필터, 페이지 구분, 정렬로 검색합니다.

graphql
query images($query: String!, $offset: Int!, $limit: Int!, $sortBy: ImageSortBy!) {
  images(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id title path size width height rotation bucketId }
}