mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 01:46:14 -04:00
Feat/restructure api (#6664)
* Restructured rest api * Added swagger ui * Added reworked rest api * Reformatted code, excluded unnecessary newlines and removed version 2.2.2
This commit is contained in:
parent
76e52e51d9
commit
12f81cfb5e
10 changed files with 1588 additions and 16 deletions
|
@ -24,10 +24,10 @@ import {MapArrayType} from "../types/MapType";
|
|||
const api = require('../db/API');
|
||||
const padManager = require('../db/PadManager');
|
||||
import createHTTPError from 'http-errors';
|
||||
import {Http2ServerRequest, Http2ServerResponse} from "node:http2";
|
||||
import {Http2ServerRequest} from "node:http2";
|
||||
import {publicKeyExported} from "../security/OAuth2Provider";
|
||||
import {jwtVerify} from "jose";
|
||||
import {apikey} from './APIKeyHandler'
|
||||
import {APIFields, apikey} from './APIKeyHandler'
|
||||
// a list of all functions
|
||||
const version:MapArrayType<any> = {};
|
||||
|
||||
|
@ -141,6 +141,7 @@ version['1.3.0'] = {
|
|||
setText: ['padID', 'text', 'authorId'],
|
||||
};
|
||||
|
||||
|
||||
// set the latest available API version here
|
||||
exports.latestApiVersion = '1.3.0';
|
||||
|
||||
|
@ -148,13 +149,6 @@ exports.latestApiVersion = '1.3.0';
|
|||
exports.version = version;
|
||||
|
||||
|
||||
type APIFields = {
|
||||
apikey: string;
|
||||
api_key: string;
|
||||
padID: string;
|
||||
padName: string;
|
||||
authorization: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles an HTTP API call
|
||||
|
|
|
@ -7,6 +7,16 @@ const settings = require('../utils/Settings');
|
|||
|
||||
const apiHandlerLogger = log4js.getLogger('APIHandler');
|
||||
|
||||
|
||||
|
||||
export type APIFields = {
|
||||
apikey: string;
|
||||
api_key: string;
|
||||
padID: string;
|
||||
padName: string;
|
||||
authorization: string;
|
||||
}
|
||||
|
||||
// ensure we have an apikey
|
||||
export let apikey:string|null = null;
|
||||
const apikeyFilename = absolutePaths.makeAbsolute(argv.apikey || './APIKEY.txt');
|
||||
|
|
1527
src/node/handler/RestAPI.ts
Normal file
1527
src/node/handler/RestAPI.ts
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue