Skip to content

Commit

Permalink
Merge pull request #14 from 0x46616c6b/etherpad-1.7.5
Browse files Browse the repository at this point in the history
Add compatibility Etherpad Lite API 1.3.0
  • Loading branch information
0x46616c6b authored Mar 6, 2019
2 parents a43772d + e57de32 commit 48b31c5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 142 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ jobs:
build:
docker:
- image: circleci/php:7.1
- image: systemli/etherpad-lite:1.6.1
- image: systemli/etherpad-lite:1.7.5
steps:
- checkout
- run: sudo composer self-update
- restore_cache:
keys:
- composer-{{ checksum "composer.lock" }}
- run: composer install -n --prefer-dist
- run: composer install
- save_cache:
key: composer-{{ checksum "composer.lock" }}
paths:
Expand All @@ -21,7 +21,7 @@ jobs:
command: vendor/bin/phpunit
- run:
name: Wait for Etherpad
command: dockerize -wait tcp://localhost:9001 -timeout 1m
command: dockerize -wait http://localhost:9001 -timeout 1m
- run:
name: Running Behat
command: vendor/bin/behat -f progress
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This package provides an easy access to [Etherpad Lite](https://github.com/ether/etherpad-lite) throw there built-in [HTTP API](http://etherpad.org/doc/v1.2.11/#index_http_api).

**Supported API Version: 1.2.13 (Release: 1.6.1)**
**Supported API Version: 1.3.0 (Release: 1.7.5)**

## Installation

Expand Down
11 changes: 0 additions & 11 deletions features/Chat.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,3 @@ Feature: Chat API
Then the code should be "0"
And the message should be "ok"
And the data should contain "chatHead"

Scenario: Get the chat head for a pad
Given a pad "pad" exists
And an author "author" exists

When I call "appendChatMessage" with params:
| padID | {{ padID }} |
| text | text |
| authorID | {{ authorID }} |
Then the code should be "0"
And the message should be "ok"
68 changes: 0 additions & 68 deletions features/Pad.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,6 @@ Feature: Pad API
And the message should be "ok"
And the data should contain "revisions"

Scenario: Get saved revisions from a non existing pad
When I call "getSavedRevisionsCount" with params:
| padID | pad |
Then the code should be "1"
And the message should be "padID does not exist"

Scenario: Get saved revisions from a pad
Given a pad "new_pad" exists

When I call "getSavedRevisionsCount" with params:
| padID | {{ padID }} |
Then the code should be "0"
And the message should be "ok"
And the data should contain "savedRevisions"

Scenario: List saved revisions from a non existing pad
When I call "listSavedRevisions" with params:
| padID | pad |
Then the code should be "1"
And the message should be "padID does not exist"

Scenario: List saved revisions from a pad
Given a pad "new_pad" exists
When I call "listSavedRevisions" with params:
| padID | {{ padID }} |
Then the code should be "0"
And the message should be "ok"
And the data should contain "savedRevisions"

Scenario: Save revision for a non existing pad
When I call "saveRevision" with params:
| padID | pad |
Then the code should be "1"
And the message should be "padID does not exist"

Scenario: Save revision for a pad
Given a pad "new_pad" exists

When I call "saveRevision" with params:
| padID | {{ padID }} |
Then the code should be "0"
And the message should be "ok"

Scenario: Get current editing user count for a non existing pad
When I call "padUsersCount" with params:
| padID | pad |
Expand Down Expand Up @@ -127,22 +84,6 @@ Feature: Pad API
Then the code should be "0"
And the message should be "ok"

Scenario: Move a non existing pad
When I call "movePad" with params:
| sourceID | pad1 |
| destinationID | pad2 |
Then the code should be "1"
And the message should be "padID does not exist"

Scenario: Move a pad
Given a pad "pad1" exists

When I call "movePad" with params:
| sourceID | {{ padID }} |
| destinationID | pad2 |
Then the code should be "0"
And the message should be "ok"

Scenario: Get readonly id for a non existing pad
When I call "getReadOnlyID" with params:
| padID | pad |
Expand All @@ -158,15 +99,6 @@ Feature: Pad API
And the message should be "ok"
And the data should contain "readOnlyID"

# Scenario: Get pad id from a readonly pad
# Given a readonly pad
#
# When I call "getPadID" with params:
# | readOnlyID | {{ readOnlyID }} |
# Then the code should be "0"
# And the message should be "ok"
# And the data should contain "padID"

Scenario: Set public status for a pad
Given a group pad exists

Expand Down
35 changes: 0 additions & 35 deletions features/PadContent.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ Feature: PadContent API
Then the code should be "0"
And the message should be "ok"

Scenario: Append text for a pad
Given a pad "pad" exists

When I call "appendText" with params:
| padID | {{ padID }} |
| text | text |
Then the code should be "0"
And the message should be "ok"

Scenario: Get html for a pad
Given a pad "pad" exists

Expand All @@ -38,29 +29,3 @@ Feature: PadContent API
Then the code should be "0"
And the message should be "ok"
And the data should contain "html"

# Scenario: Set html for a pad
# Given a pad "pad" exists
#
# When I call "setHTML" with params:
# | padID | {{ padID }} |
# | html | html |
# Then the code should be "0"
# And the message should be "ok"

Scenario: Get attribute pool for a pad
Given a pad "pad" exists

When I call "getAttributePool" with params:
| padID | {{ padID }} |
Then the code should be "0"
And the message should be "ok"
And the data should contain "pool"

Scenario: Get revision changeset for a pad
Given a pad "pad" exists

When I call "getRevisionChangeset" with params:
| padID | {{ padID }} |
Then the code should be "0"
And the message should be "ok"
24 changes: 0 additions & 24 deletions src/EtherpadLite/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,17 @@
*
* @method Response getText($padID, $rev = null) returns the text of a pad
* @method Response setText($padID, $text) sets the text of a pad
* @method Response appendText($padID, $text) appends text to a pad
* @method Response getHTML($padID, $rev = null) returns the text of a pad formatted as HTML
* @method Response setHTML($padID, $html) sets the html of a pad
* @method Response getAttributePool($padID) returns the attribute pool of a pad
* @method Response getRevisionChangeset($padID, $revision = null) get the changeset at a given revision, or last revision if 'rev' is not defined.
* @method Response createDiffHTML($padID, $startRev, $endRev) returns an object of diffs from 2 points in a pad
* @method Response restoreRevision($padID, $revision) restores revision from past as new changeset
*
* @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
* @method Response getChatHead($padID) returns the chatHead (last number of the last chat-message) of the pad
* @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
*
* @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.
* @method Response getRevisionsCount($padID) returns the number of revisions of this pad
* @method Response getSavedRevisionsCount($padID) returns the number of saved revisions of this pad
* @method Response listSavedRevisions($padID) returns a list of saved revisions of this pad
* @method Response saveRevision($padID, $revision = null) save a revision of a pad
* @method Response padUsersCount($padID) returns the number of user that are currently editing this pad
* @method Response padUsers($padID) returns the list of users that are currently editing this pad
* @method Response deletePad($padID) deletes a pad
* @method Response movePad($sourceID, $destinationID, $force = false) moves a pad. If force is true and the destination pad exists, it will be overwritten.
* @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.
* @method Response getReadOnlyID($padID) returns the read only link of a pad
* @method Response getPadID($readOnlyID) returns the id of a pad which is assigned to the readOnlyID
* @method Response setPublicStatus($padID, $publicStatus) sets a boolean for the public status of a pad
* @method Response getPublicStatus($padID) return true of false
* @method Response setPassword($padID, $password) returns ok or a error message
Expand Down Expand Up @@ -148,28 +135,17 @@ public static function getMethods(): array
'listSessionsOfAuthor' => ['authorID'],
'getText' => ['padID', 'rev'],
'setText' => ['padID', 'text'],
'appendText' => ['padID', 'text'],
'getHTML' => ['padID', 'rev'],
'setHTML' => ['padID', 'html'],
'getAttributePool' => ['padID'],
'createDiffHTML' => ['padID', 'startRev', 'endRev'],
'restoreRevision' => ['padID', 'rev'],
'getRevisionChangeset' => ['padID'],
'getChatHistory' => ['padID', 'start', 'end'],
'getChatHead' => ['padID'],
'appendChatMessage' => ['padID', 'text', 'authorID'],
'createPad' => ['padID', 'text'],
'getRevisionsCount' => ['padID'],
'getSavedRevisionsCount' => ['padID'],
'listSavedRevisions' => ['padID'],
'saveRevision' => ['padID'],
'padUsersCount' => ['padID'],
'padUsers' => ['padID'],
'deletePad' => ['padID'],
'movePad' => ['sourceID', 'destinationID'],
'copyPad' => ['sourceID', 'destinationID'],
'getReadOnlyID' => ['padID'],
'getPadID' => ['readOnlyID'],
'setPublicStatus' => ['padID', 'publicStatus'],
'getPublicStatus' => ['padID'],
'setPassword' => ['padID', 'password'],
Expand Down

0 comments on commit 48b31c5

Please sign in to comment.