Feed (RSS)
Verificare app.capabilities per il supporto delle funzionalità e app.access insieme alle autorizzazioni host per l’autorizzazione. Gli esempi usano valori sintetici; sostituire percorsi, ID, input e filtri prima della chiamata.
Definizioni di tipo
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!
}Operazioni
feedsFetched
Ricevere le modifiche di sincronizzazione dei feed.
subscription feedsFetched {
feedsFetched { feedId error canceled }
}createFeed
Iscriversi a un feed e accodarne la sincronizzazione iniziale.
mutation createFeed($url: String!, $fetchContent: Boolean!, $name: String) {
createFeed(url: $url, fetchContent: $fetchContent, name: $name) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}deleteFeed
Annullare l’iscrizione a un feed ed eliminarne tutti gli articoli (e le relative associazioni ai tag).
mutation deleteFeed($id: ID!) {
deleteFeed(id: $id)
}deleteFeedEntries
Eliminare gli articoli dei feed corrispondenti a una query (e le relative associazioni ai tag).
mutation deleteFeedEntries($query: String!) {
deleteFeedEntries(query: $query) { affectedCount }
}importFeeds
Importare un documento OPML (come stringa) nel database dei feed.
mutation importFeeds($content: String!) {
importFeeds(content: $content)
}markFeedEntriesRead
Segnare gli articoli dei feed corrispondenti come letti o non letti e indicare il numero interessato.
mutation markFeedEntriesRead($query: String!, $read: Boolean!) {
markFeedEntriesRead(query: $query, read: $read) { affectedCount }
}syncFeedEntryContent
Recuperare e salvare il contenuto completo di un articolo di feed.
mutation syncFeedEntryContent($id: ID!) {
syncFeedEntryContent(id: $id) { id title url image description author content feedId }
}syncFeeds
Accodare la sincronizzazione di un feed tramite ID o di tutti i feed se non viene fornito alcun ID.
mutation syncFeeds($id: ID) {
syncFeeds(id: $id)
}updateFeed
Aggiornare il nome visualizzato di un feed o il flag fetchContent.
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 }
}exportFeeds
Esportare tutti i feed sottoscritti come stringa OPML.
query exportFeeds {
exportFeeds
}feed
Leggere un’iscrizione a un feed tramite ID; restituire null se assente.
query feed($id: ID!) {
feed(id: $id) { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}feedEntries
Cercare articoli dei feed (titolo + descrizione). Lasciare query vuoto per elencarli tutti.
query feedEntries($query: String!, $offset: Int!, $limit: Int!) {
feedEntries(query: $query, offset: $offset, limit: $limit) { id title url image description author content feedId }
}feedEntry
Recuperare un articolo di feed tramite ID.
query feedEntry($id: ID!) {
feedEntry(id: $id) { id title url image description author content feedId }
}feedEntryCount
Contare gli articoli dei feed corrispondenti a una query.
query feedEntryCount($query: String!) {
feedEntryCount(query: $query)
}feedEntryCounts
Leggere i riepiloghi dei conteggi degli articoli dei feed.
query feedEntryCounts {
feedEntryCounts { feedId count }
}feedSyncStates
Leggere lo stato corrente di sincronizzazione delle iscrizioni ai feed.
query feedSyncStates {
feedSyncStates { feedId taskId revision status error }
}feeds
Elencare tutti i feed sottoscritti.
query feeds {
feeds { id name url fetchContent logo lastSyncAt createdAt updatedAt }
}fetchFeedTitle
Recupera il titolo del feed dal suo URL senza aggiungere un abbonamento.
query fetchFeedTitle($url: String!) {
fetchFeedTitle(url: $url)
}