mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-15 11:36:53 -04:00
collecting all available API versions to a list
and export it making it available for /api/versions
This commit is contained in:
parent
bf29feb321
commit
9c754a7397
1 changed files with 13 additions and 7 deletions
|
@ -37,6 +37,14 @@ catch(e)
|
||||||
fs.writeFileSync("./APIKEY.txt",apikey,"utf8");
|
fs.writeFileSync("./APIKEY.txt",apikey,"utf8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//liitle helper for concatenating the following API versions
|
||||||
|
function apiConcat(v1, v2) {
|
||||||
|
for (var key in v1) {
|
||||||
|
v2[key] = v1[key];
|
||||||
|
}
|
||||||
|
return v2;
|
||||||
|
}
|
||||||
|
|
||||||
//a list of all functions
|
//a list of all functions
|
||||||
var API_V1 =
|
var API_V1 =
|
||||||
{ "createGroup" : []
|
{ "createGroup" : []
|
||||||
|
@ -86,13 +94,6 @@ var API_V1_2_7 =
|
||||||
, "getChatHistory" : ["padID", "start", "end"]
|
, "getChatHistory" : ["padID", "start", "end"]
|
||||||
, "getChatHead" : ["padID"] };
|
, "getChatHead" : ["padID"] };
|
||||||
|
|
||||||
function apiConcat(v1, v2) {
|
|
||||||
for (var key in v1) {
|
|
||||||
v2[key] = v1[key];
|
|
||||||
}
|
|
||||||
return v2;
|
|
||||||
}
|
|
||||||
|
|
||||||
API_V1_1 = apiConcat(API_V1, API_V1_1) ;
|
API_V1_1 = apiConcat(API_V1, API_V1_1) ;
|
||||||
API_V1_2 = apiConcat(API_V1_1, API_V1_2) ;
|
API_V1_2 = apiConcat(API_V1_1, API_V1_2) ;
|
||||||
API_V1_2_1 = apiConcat(API_V1_2, API_V1_2_1) ;
|
API_V1_2_1 = apiConcat(API_V1_2, API_V1_2_1) ;
|
||||||
|
@ -107,6 +108,11 @@ var version = { "1" : API_V1
|
||||||
// set the latest available API version here
|
// set the latest available API version here
|
||||||
exports.latestApiVersion = '1.2.7';
|
exports.latestApiVersion = '1.2.7';
|
||||||
|
|
||||||
|
//collect all available API versions and make it available for API endpoint
|
||||||
|
versions = [];
|
||||||
|
for (key in version) versions.push(key);
|
||||||
|
exports.versions = versions;
|
||||||
|
|
||||||
// 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…
Add table
Add a link
Reference in a new issue