Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -91,6 +91,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* @apiparam datetime date The date/time that should be used for the comment date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam string ip_address The IP address that should be stored for the comment. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @throws 2D304/2 INVALID_ID The comment ID does not exist
|
||||
* @throws 1D304/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1D304/4 NO_CONTENT No content was supplied
|
||||
@@ -130,8 +131,15 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
if ( \IPS\Request::i()->author === 0 )
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1D304/3', 400 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +163,7 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
* @apiparam string author_name If author is 0, the guest name that should be used
|
||||
* @apiparam string content The comment content as HTML (e.g. "<p>This is a comment.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam int hidden 1/0 indicating if the comment should be hidden
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @throws 2D304/5 INVALID_ID The comment ID does not exist or the authorized user does not have permission to view it
|
||||
* @throws 1D304/6 NO_AUTHOR The author ID does not exist
|
||||
* @throws 2D304/9 NO_PERMISSION The authorized user does not have permission to edit the comment
|
||||
@@ -219,4 +228,57 @@ class _comments extends \IPS\Content\Api\CommentController
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2D304/7', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /downloads/comments/{id}/react
|
||||
* Add a reaction
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int id ID of the reaction to add
|
||||
* @apiparam int author ID of the member reacting
|
||||
* @return \IPS\downloads\File\Comment
|
||||
* @throws 1S425/2 NO_REACTION The reaction ID does not exist
|
||||
* @throws 1S425/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/4 REACT_ERROR Error adding the reaction
|
||||
* @throws 1S425/5 INVALID_ID Object ID does not exist
|
||||
* @note If the author has already reacted to this content, any existing reaction will be removed first
|
||||
*/
|
||||
public function POSTitem_react( $id )
|
||||
{
|
||||
return $this->_reactAdd( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /downloads/comments/{id}/react
|
||||
* Delete a reaction
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author ID of the member who reacted
|
||||
* @return \IPS\downloads\File\Comment
|
||||
* @throws 1S425/6 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/7 REACT_ERROR Error adding the reaction
|
||||
* @throws 1S425/8 INVALID_ID Object ID does not exist
|
||||
* @note If the author has already reacted to this content, any existing reaction will be removed first
|
||||
*/
|
||||
public function DELETEitem_react( $id )
|
||||
{
|
||||
return $this->_reactRemove( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /downloads/comments/{id}/report
|
||||
* Reports a post
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author ID of the member reporting
|
||||
* @apiparam int report_type Report type (0 is default and is for letting CMGR team know, more options via core_automatic_moderation_types)
|
||||
* @apiparam string message Optional message
|
||||
* @return \IPS\downloads\File\Comment
|
||||
* @throws 1S425/B NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/C REPORTED_ALREADY The member has reported this item in the past 24 hours
|
||||
*/
|
||||
public function POSTitem_report( $id )
|
||||
{
|
||||
return $this->_report( $id );
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,7 @@ class _files extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int pinned 1/0 indicating if the file should be featured
|
||||
* @apiparam int featured 1/0 indicating if the file should be featured
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @throws 1S303/7 NO_CATEGEORY The category ID does not exist
|
||||
* @throws 1S303/8 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S303/9 NO_TITLE No title was supplied
|
||||
@@ -173,7 +174,15 @@ class _files extends \IPS\Content\Api\ItemController
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
if ( \IPS\Request::i()->author === 0 )
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1S303/8', 400 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +330,7 @@ class _files extends \IPS\Content\Api\ItemController
|
||||
* @apiparam int locked 1/0 indicating if the file should be locked
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam int featured 1/0 indicating if the file should be featured
|
||||
* @param int $id ID Number
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @throws 2S303/C INVALID_ID The file ID is invalid or the authorized user does not have permission to view it
|
||||
* @throws 1S303/D NO_CATEGORY The category ID does not exist or the authorized user does not have permission to post in it
|
||||
* @throws 1S303/E NO_AUTHOR The author ID does not exist
|
||||
@@ -530,8 +539,8 @@ class _files extends \IPS\Content\Api\ItemController
|
||||
'dip' => \IPS\Request::i()->ipAddress(),
|
||||
'dmid' => (int) $this->member->member_id,
|
||||
'dsize' => 0,
|
||||
'dua' => 'REST API',
|
||||
'dbrowsers' => '',
|
||||
'dua' => $_SERVER['HTTP_USER_AGENT'] ?? '',
|
||||
'dbrowsers' => 'REST API',
|
||||
'dos' => ''
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* @apiparam datetime date The date/time that should be used for the review date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam string ip_address The IP address that should be stored for the review. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member
|
||||
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @reqapiparam int rating Star rating
|
||||
* @throws 2D305/2 INVALID_ID The forum ID does not exist
|
||||
* @throws 1D305/3 NO_AUTHOR The author ID does not exist
|
||||
@@ -132,8 +133,15 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
}
|
||||
else
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
if ( \IPS\Request::i()->author === 0 )
|
||||
{
|
||||
$author = new \IPS\Member;
|
||||
$author->name = \IPS\Request::i()->author_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1D305/3', 400 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +172,7 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
* @apiparam string content The review content as HTML (e.g. "<p>This is a review.</p>"). Will be sanatized for requests using an OAuth Access Token for a particular member; will be saved unaltered for requests made using an API Key or the Client Credentials Grant Type.
|
||||
* @apiparam int hidden 1/0 indicating if the review should be hidden
|
||||
* @apiparam int rating Star rating
|
||||
* @apiparam bool anonymous If 1, the item will be posted anonymously.
|
||||
* @throws 2D305/6 INVALID_ID The review ID does not exist or the authorized user does not have permission to view it
|
||||
* @throws 1D305/7 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1D305/8 INVALID_RATING The rating is not a valid number up to the maximum rating
|
||||
@@ -234,4 +243,57 @@ class _reviews extends \IPS\Content\Api\CommentController
|
||||
throw new \IPS\Api\Exception( 'INVALID_ID', '2D305/9', 404 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /downloads/reviews/{id}/react
|
||||
* Add a reaction
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int id ID of the reaction to add
|
||||
* @apiparam int author ID of the member reacting
|
||||
* @return \IPS\downloads\File\Reviews
|
||||
* @throws 1S425/2 NO_REACTION The reaction ID does not exist
|
||||
* @throws 1S425/3 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/4 REACT_ERROR Error adding the reaction
|
||||
* @throws 1S425/5 INVALID_ID Object ID does not exist
|
||||
* @note If the author has already reacted to this content, any existing reaction will be removed first
|
||||
*/
|
||||
public function POSTitem_react( $id )
|
||||
{
|
||||
return $this->_reactAdd( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /downloads/reviews/{id}/react
|
||||
* Delete a reaction
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author ID of the member who reacted
|
||||
* @return \IPS\downloads\File\Reviews
|
||||
* @throws 1S425/6 NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/7 REACT_ERROR Error adding the reaction
|
||||
* @throws 1S425/8 INVALID_ID Object ID does not exist
|
||||
* @note If the author has already reacted to this content, any existing reaction will be removed first
|
||||
*/
|
||||
public function DELETEitem_react( $id )
|
||||
{
|
||||
return $this->_reactRemove( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /downloads/reviews/{id}/report
|
||||
* Reports a post
|
||||
*
|
||||
* @param int $id ID Number
|
||||
* @apiparam int author ID of the member reporting
|
||||
* @apiparam int report_type Report type (0 is default and is for letting CMGR team know, more options via core_automatic_moderation_types)
|
||||
* @apiparam string message Optional message
|
||||
* @return \IPS\downloads\File\Reviews
|
||||
* @throws 1S425/B NO_AUTHOR The author ID does not exist
|
||||
* @throws 1S425/C REPORTED_ALREADY The member has reported this item in the past 24 hours
|
||||
*/
|
||||
public function POSTitem_report( $id )
|
||||
{
|
||||
return $this->_report( $id );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user