mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Merge pull request #2165 from stephan48/develop
Added an API method for retrieving the padID from the readonlyID
This commit is contained in:
commit
1f40e05270
2 changed files with 72 additions and 1 deletions
|
@ -640,6 +640,32 @@ exports.getReadOnlyID = function(padID, callback)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
getPadID(roID) returns the padID of a pad based on the readonlyID(roID)
|
||||||
|
|
||||||
|
Example returns:
|
||||||
|
|
||||||
|
{code: 0, message:"ok", data: {padID: padID}}
|
||||||
|
{code: 1, message:"padID does not exist", data: null}
|
||||||
|
*/
|
||||||
|
exports.getPadID = function(roID, callback)
|
||||||
|
{
|
||||||
|
//get the PadId
|
||||||
|
readOnlyManager.getPadId(roID, function(err, retrievedPadID)
|
||||||
|
{
|
||||||
|
if(ERR(err, callback)) return;
|
||||||
|
|
||||||
|
if(retrievedPadID == null)
|
||||||
|
{
|
||||||
|
callback(new customError("padID does not exist","apierror"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
callback(null, {padID: retrievedPadID});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad
|
setPublicStatus(padID, publicStatus) sets a boolean for the public status of a pad
|
||||||
|
|
||||||
|
|
|
@ -300,10 +300,55 @@ var version =
|
||||||
, "getChatHistory" : ["padID", "start", "end"]
|
, "getChatHistory" : ["padID", "start", "end"]
|
||||||
, "getChatHead" : ["padID"]
|
, "getChatHead" : ["padID"]
|
||||||
}
|
}
|
||||||
|
, "1.2.10":
|
||||||
|
{ "createGroup" : []
|
||||||
|
, "createGroupIfNotExistsFor" : ["groupMapper"]
|
||||||
|
, "deleteGroup" : ["groupID"]
|
||||||
|
, "listPads" : ["groupID"]
|
||||||
|
, "listAllPads" : []
|
||||||
|
, "createDiffHTML" : ["padID", "startRev", "endRev"]
|
||||||
|
, "createPad" : ["padID", "text"]
|
||||||
|
, "createGroupPad" : ["groupID", "padName", "text"]
|
||||||
|
, "createAuthor" : ["name"]
|
||||||
|
, "createAuthorIfNotExistsFor": ["authorMapper" , "name"]
|
||||||
|
, "listPadsOfAuthor" : ["authorID"]
|
||||||
|
, "createSession" : ["groupID", "authorID", "validUntil"]
|
||||||
|
, "deleteSession" : ["sessionID"]
|
||||||
|
, "getSessionInfo" : ["sessionID"]
|
||||||
|
, "listSessionsOfGroup" : ["groupID"]
|
||||||
|
, "listSessionsOfAuthor" : ["authorID"]
|
||||||
|
, "getText" : ["padID", "rev"]
|
||||||
|
, "setText" : ["padID", "text"]
|
||||||
|
, "getHTML" : ["padID", "rev"]
|
||||||
|
, "setHTML" : ["padID", "html"]
|
||||||
|
, "getAttributePool" : ["padID"]
|
||||||
|
, "getRevisionsCount" : ["padID"]
|
||||||
|
, "getRevisionChangeset" : ["padID", "rev"]
|
||||||
|
, "getLastEdited" : ["padID"]
|
||||||
|
, "deletePad" : ["padID"]
|
||||||
|
, "copyPad" : ["sourceID", "destinationID", "force"]
|
||||||
|
, "movePad" : ["sourceID", "destinationID", "force"]
|
||||||
|
, "getReadOnlyID" : ["padID"]
|
||||||
|
, "getPadID" : ["roID"]
|
||||||
|
, "setPublicStatus" : ["padID", "publicStatus"]
|
||||||
|
, "getPublicStatus" : ["padID"]
|
||||||
|
, "setPassword" : ["padID", "password"]
|
||||||
|
, "isPasswordProtected" : ["padID"]
|
||||||
|
, "listAuthorsOfPad" : ["padID"]
|
||||||
|
, "padUsersCount" : ["padID"]
|
||||||
|
, "getAuthorName" : ["authorID"]
|
||||||
|
, "padUsers" : ["padID"]
|
||||||
|
, "sendClientsMessage" : ["padID", "msg"]
|
||||||
|
, "listAllGroups" : []
|
||||||
|
, "checkToken" : []
|
||||||
|
, "getChatHistory" : ["padID"]
|
||||||
|
, "getChatHistory" : ["padID", "start", "end"]
|
||||||
|
, "getChatHead" : ["padID"]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// set the latest available API version here
|
// set the latest available API version here
|
||||||
exports.latestApiVersion = '1.2.9';
|
exports.latestApiVersion = '1.2.10';
|
||||||
|
|
||||||
// exports the versions so it can be used by the new Swagger endpoint
|
// exports the versions so it can be used by the new Swagger endpoint
|
||||||
exports.version = version;
|
exports.version = version;
|
||||||
|
|
Loading…
Reference in a new issue