mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
List all valid TTRSS input
This commit is contained in:
parent
fbbf751214
commit
4e3369cd03
2 changed files with 55 additions and 3 deletions
|
@ -32,9 +32,51 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
|||
const LEVEL = 14;
|
||||
const VERSION = "17.4";
|
||||
const LABEL_OFFSET = 1024;
|
||||
const VALID_INPUT = [
|
||||
'op' => "str",
|
||||
'sid' => "str",
|
||||
'user' => "str",
|
||||
'password' => "str",
|
||||
'include_empty' => "bool",
|
||||
'unread_only' => "bool",
|
||||
'enable_nested' => "bool",
|
||||
'caption' => "str",
|
||||
'parent_id' => "int",
|
||||
'category_id' => "int",
|
||||
'feed_url' => "str",
|
||||
'login' => "str",
|
||||
'feed_id' => "int",
|
||||
'article_id' => "int",
|
||||
'label_id' => "int",
|
||||
'article_ids' => "str",
|
||||
'assign' => "bool",
|
||||
'is_cat' => "bool",
|
||||
'cat_id' => "int",
|
||||
'limit' => "int",
|
||||
'offset' => "int",
|
||||
'include_nested' => "bool",
|
||||
'skip' => "int",
|
||||
'filter' => "str",
|
||||
'show_excerpt' => "bool",
|
||||
'show_content' => "bool",
|
||||
'view_mode' => "str",
|
||||
'include_attachments' => "bool",
|
||||
'since_id' => "int",
|
||||
'order_by' => "str",
|
||||
'sanitize' => "bool",
|
||||
'force_update' => "bool",
|
||||
'has_sandbox' => "bool",
|
||||
'include_header' => "bool",
|
||||
'search' => "str",
|
||||
'search_mode' => "str",
|
||||
'match_on' => "str",
|
||||
'mode' => "int",
|
||||
'field' => "int",
|
||||
'data' => "str",
|
||||
];
|
||||
const FATAL_ERR = [
|
||||
'seq' => null,
|
||||
'status' => 1,
|
||||
'seq' => null,
|
||||
'status' => 1,
|
||||
'content' => ['error' => "NOT_LOGGED_IN"],
|
||||
];
|
||||
|
||||
|
@ -618,4 +660,14 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function opSetArticleLabel(array $data): array {
|
||||
if (!isset($data['article_ids']) || !isset($data['label_id'])) {
|
||||
throw new Exception("INCORRECT_USAGE");
|
||||
}
|
||||
$label = $this->labelIn($data['label_id']);
|
||||
$articles = explode(",", (string) $data['article_ids']);
|
||||
$assign = ValueInfo::bool(isset($data['assign']) ? $data['assign'] : null, false);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -769,7 +769,7 @@ class TestTinyTinyAPI extends Test\AbstractTest {
|
|||
$this->assertResponse($this->respGood($exp), $this->h->dispatch(new Request("POST", "", json_encode($in))));
|
||||
}
|
||||
|
||||
public function testRetrieveLabelList() {
|
||||
public function testRetrieveTheLabelList() {
|
||||
$in = [
|
||||
['op' => "getLabels", 'sid' => "PriestsOfSyrinx"],
|
||||
['op' => "getLabels", 'sid' => "PriestsOfSyrinx", 'article_id' => 1],
|
||||
|
|
Loading…
Reference in a new issue