1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 06:44:57 +00:00

List all valid TTRSS input

This commit is contained in:
J. King 2017-10-15 12:47:07 -04:00
parent fbbf751214
commit 4e3369cd03
2 changed files with 55 additions and 3 deletions

View file

@ -32,6 +32,48 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
const LEVEL = 14; const LEVEL = 14;
const VERSION = "17.4"; const VERSION = "17.4";
const LABEL_OFFSET = 1024; 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 = [ const FATAL_ERR = [
'seq' => null, 'seq' => null,
'status' => 1, 'status' => 1,
@ -618,4 +660,14 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
} }
return null; 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);
}
} }

View file

@ -769,7 +769,7 @@ class TestTinyTinyAPI extends Test\AbstractTest {
$this->assertResponse($this->respGood($exp), $this->h->dispatch(new Request("POST", "", json_encode($in)))); $this->assertResponse($this->respGood($exp), $this->h->dispatch(new Request("POST", "", json_encode($in))));
} }
public function testRetrieveLabelList() { public function testRetrieveTheLabelList() {
$in = [ $in = [
['op' => "getLabels", 'sid' => "PriestsOfSyrinx"], ['op' => "getLabels", 'sid' => "PriestsOfSyrinx"],
['op' => "getLabels", 'sid' => "PriestsOfSyrinx", 'article_id' => 1], ['op' => "getLabels", 'sid' => "PriestsOfSyrinx", 'article_id' => 1],