Tham chiếu API

Nguồn tin (RSS)

Kiểm tra app.capabilities để biết tính năng và app.access cùng quyền máy chủ để xác định quyền truy cập. Thay giá trị mẫu trước khi gọi.

Định nghĩa kiểu

graphql
type Subscription {
  feedsFetched: FeedSyncChange!
}

type Mutation {
  createFeed(url: String!, fetchContent: Boolean!, name: String): Feed!
  deleteFeed(id: ID!): Boolean!
  deleteFeedEntries(query: String!): ActionResult!
  importFeeds(content: String!): Boolean!
  markFeedEntriesRead(query: String!, read: Boolean!): ActionResult!
  syncFeedEntryContent(id: ID!): FeedEntry!
  syncFeeds(id: ID): Boolean!
  updateFeed(id: ID!, name: String, fetchContent: Boolean, url: String): Feed!
}

type Query {
  exportFeeds: String!
  feed(id: ID!): Feed
  feedEntries(query: String!, offset: Int!, limit: Int!): [FeedEntry!]!
  feedEntry(id: ID!): FeedEntry
  feedEntryCount(query: String!): Int!
  feedEntryCounts: [FeedEntryCount!]!
  feedSyncStates: [FeedSyncState!]!
  feeds: [Feed!]!
  fetchFeedTitle(url: String!): String!
}

type ActionResult {
	affectedCount: Int!
}

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

type Feed {
	id: ID!
	name: String!
	url: String!
	fetchContent: Boolean!
	logo: String!
	lastSyncAt: Instant
	lastError: FeedError!
	createdAt: Instant!
	updatedAt: Instant!
}

type FeedEntry {
	id: ID!
	title: String!
	url: String!
	image: String!
	description: String!
	author: String!
	content: String!
	feedId: ID!
	rawId: String!
	read: Boolean!
	publishedAt: Instant!
	createdAt: Instant!
	updatedAt: Instant!
	tags: [Tag!]!
	feed: Feed
}

type FeedEntryCount {
	feedId: ID!
	count: Int!
}

type FeedError {
	code: FeedErrorCode!
	detail: String!
}

enum FeedErrorCode {
	NONE
	TIMEOUT
	SERVER
	DNS
	PARSE
	UNKNOWN
}

type FeedSyncChange {
	feedId: ID!
	error: String
	canceled: Boolean
}

type FeedSyncState {
	feedId: ID!
	taskId: ID!
	revision: Long!
	status: FeedWorkerStatus!
	error: String!
}

enum FeedWorkerStatus {
	QUEUED
	RUNNING
	CANCELED
	COMPLETED
	ERROR
}

scalar Instant

scalar Long

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

Thao tác

subscription

feedsFetched

Nhận thay đổi đồng bộ nguồn tin.

graphql
subscription feedsFetched {
  feedsFetched { feedId error canceled }
}
mutation

createFeed

Đăng ký nguồn tin và xếp đồng bộ ban đầu vào hàng đợi.

graphql
mutation createFeed($url: String!, $fetchContent: Boolean!, $name: String) {
  createFeed(url: $url, fetchContent: $fetchContent, name: $name) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
mutation

deleteFeed

Hủy đăng ký nguồn tin và xóa mọi mục của nó (cùng quan hệ thẻ).

graphql
mutation deleteFeed($id: ID!) {
  deleteFeed(id: $id)
}
mutation

deleteFeedEntries

Xóa mục nguồn tin khớp truy vấn (cùng quan hệ thẻ).

graphql
mutation deleteFeedEntries($query: String!) {
  deleteFeedEntries(query: $query) { affectedCount }
}
mutation

importFeeds

Nhập tài liệu OPML (dạng chuỗi) vào cơ sở dữ liệu nguồn tin.

graphql
mutation importFeeds($content: String!) {
  importFeeds(content: $content)
}
mutation

markFeedEntriesRead

Đánh dấu các mục nguồn tin khớp đã đọc hoặc chưa đọc và báo số bị tác động.

graphql
mutation markFeedEntriesRead($query: String!, $read: Boolean!) {
  markFeedEntriesRead(query: $query, read: $read) { affectedCount }
}
mutation

syncFeedEntryContent

Tải và lưu nội dung đầy đủ của một mục nguồn tin.

graphql
mutation syncFeedEntryContent($id: ID!) {
  syncFeedEntryContent(id: $id) { id title url image description author content feedId }
}
mutation

syncFeeds

Xếp đồng bộ một nguồn tin theo ID vào hàng đợi, hoặc tất cả nếu không cung cấp ID.

graphql
mutation syncFeeds($id: ID) {
  syncFeeds(id: $id)
}
mutation

updateFeed

Cập nhật tên hiển thị nguồn tin hoặc cờ fetchContent.

graphql
mutation updateFeed($id: ID!, $name: String, $fetchContent: Boolean, $url: String) {
  updateFeed(id: $id, name: $name, fetchContent: $fetchContent, url: $url) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

exportFeeds

Xuất mọi nguồn tin đã đăng ký thành chuỗi OPML.

graphql
query exportFeeds {
  exportFeeds
}
query

feed

Đọc một đăng ký nguồn tin theo ID; trả về null nếu không có.

graphql
query feed($id: ID!) {
  feed(id: $id) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

feedEntries

Tìm mục nguồn tin (tiêu đề + mô tả). Để query rỗng để liệt kê tất cả.

graphql
query feedEntries($query: String!, $offset: Int!, $limit: Int!) {
  feedEntries(query: $query, offset: $offset, limit: $limit) { id title url image description author content feedId }
}
query

feedEntry

Lấy một mục nguồn tin theo ID.

graphql
query feedEntry($id: ID!) {
  feedEntry(id: $id) { id title url image description author content feedId }
}
query

feedEntryCount

Đếm mục nguồn tin khớp truy vấn.

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

feedEntryCounts

Đọc tóm tắt số lượng mục nguồn tin.

graphql
query feedEntryCounts {
  feedEntryCounts { feedId count }
}
query

feedSyncStates

Đọc trạng thái đồng bộ hiện tại của các đăng ký nguồn tin.

graphql
query feedSyncStates {
  feedSyncStates { feedId taskId revision status error }
}
query

feeds

Liệt kê mọi nguồn tin đã đăng ký.

graphql
query feeds {
  feeds { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}
query

fetchFeedTitle

Lấy tiêu đề nguồn tin từ URL mà không đăng ký theo dõi.

graphql
query fetchFeedTitle($url: String!) {
  fetchFeedTitle(url: $url)
}