Skip to content

Commit e05e00a

Browse files
authored
Merge pull request #9 from 0x46616c6b/update-api-support
increased api support to 1.2.13
2 parents 147c183 + e3c43f7 commit e05e00a

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

src/EtherpadLite/Client.php

+23-1
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,27 @@
3131
* @method Response setText($padID, $text) sets the text of a pad
3232
* @method Response getHTML($padID, $rev = null) returns the text of a pad formatted as HTML
3333
* @method Response setHTML($padID, $html) sets the html of a pad
34+
* @method Response getAttributePool($padID) returns the attribute pool of a pad
35+
* @method Response getRevisionChangeset($padID, $revision = null) get the changeset at a given revision, or last revision if 'rev' is not defined.
36+
* @method Response createDiffHTML($padID, $startRev, $endRev) returns an object of diffs from 2 points in a pad
37+
* @method Response restoreRevision($padID, $revision) restores revision from past as new changeset
3438
*
3539
* @method Response getChatHistory($padID, $start = null, $end = null) a part of the chat history, when start and end are given, the whole chat histroy, when no extra parameters are given
3640
* @method Response getChatHead($padID) returns the chatHead (last number of the last chat-message) of the pad
41+
* @method Response appendChatMessage($padID, $text, $authorID, $time = null) creates a chat message, saves it to the database and sends it to all connected clients of this pad
3742
*
3843
* @method Response createPad($padID, $text = null) creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad.
3944
* @method Response getRevisionsCount($padID) returns the number of revisions of this pad
45+
* @method Response getSavedRevisionsCount($padID) returns the number of saved revisions of this pad
46+
* @method Response listSavedRevisions($padID) returns a list of saved revisions of this pad
47+
* @method Response saveRevision($padID, $revision = null) save a revision of a pad
4048
* @method Response padUsersCount($padID) returns the number of user that are currently editing this pad
4149
* @method Response padUsers($padID) returns the list of users that are currently editing this pad
4250
* @method Response deletePad($padID) deletes a pad
51+
* @method Response movePad($sourceID, $destinationID, $force = false) moves a pad. If force is true and the destination pad exists, it will be overwritten.
52+
* @method Response copyPad($sourceID, $destinationID, $force = false) copies a pad with full history and chat. If force is true and the destination pad exists, it will be overwritten.
4353
* @method Response getReadOnlyID($padID) returns the read only link of a pad
54+
* @method Response getPadID($readOnlyID) returns the id of a pad which is assigned to the readOnlyID
4455
* @method Response setPublicStatus($padID, $publicStatus) sets a boolean for the public status of a pad
4556
* @method Response getPublicStatus($padID) return true of false
4657
* @method Response setPassword($padID, $password) returns ok or a error message
@@ -55,7 +66,7 @@
5566
*/
5667
class Client
5768
{
58-
const API_VERSION = '1.2.7';
69+
const API_VERSION = '1.2.13';
5970

6071
private $apikey = null;
6172
private $url = null;
@@ -131,14 +142,25 @@ public static function getMethods()
131142
'setText' => array('padID', 'text'),
132143
'getHTML' => array('padID', 'rev'),
133144
'setHTML' => array('padID', 'html'),
145+
'getAttributePool' => array('padID'),
146+
'createDiffHTML' => array('padID', 'startRev', 'endRev'),
147+
'restoreRevision' => array('padID', 'rev'),
148+
'getRevisionChangeset' => array('padID'),
134149
'getChatHistory' => array('padID', 'start', 'end'),
135150
'getChatHead' => array('padID'),
151+
'appendChatMessage' => array('padID', 'text', 'authorID'),
136152
'createPad' => array('padID', 'text'),
137153
'getRevisionsCount' => array('padID'),
154+
'getSavedRevisionsCount' => array('padID'),
155+
'listSavedRevisions' => array('padID'),
156+
'saveRevision' => array('padID'),
138157
'padUsersCount' => array('padID'),
139158
'padUsers' => array('padID'),
140159
'deletePad' => array('padID'),
160+
'movePad' => array('sourceID', 'destinationID'),
161+
'copyPad' => array('sourceID', 'destinationID'),
141162
'getReadOnlyID' => array('padID'),
163+
'getPadID' => array('readOnlyID'),
142164
'setPublicStatus' => array('padID', 'publicStatus'),
143165
'getPublicStatus' => array('padID'),
144166
'setPassword' => array('padID', 'password'),

src/EtherpadLite/Request.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
class Request
99
{
10-
const API_VERSION = '1.2.7';
11-
1210
private $apiKey = null;
1311
private $url = null;
1412
private $method;
@@ -55,10 +53,10 @@ protected function getUrlPath()
5553
$existingPath = parse_url($this->url, PHP_URL_PATH);
5654

5755
return $existingPath . sprintf(
58-
'/api/%s/%s',
59-
self::API_VERSION,
60-
$this->method
61-
);
56+
'/api/%s/%s',
57+
Client::API_VERSION,
58+
$this->method
59+
);
6260
}
6361

6462
/**

0 commit comments

Comments
 (0)