backend: Add callback to application to check editing key status (#525)

This commit is contained in:
Eric Doughty-Papassideris
2024-08-25 22:26:30 +02:00
parent 9b0dcc1068
commit 483b1b0688
8 changed files with 171 additions and 17 deletions
@@ -62,6 +62,15 @@ export namespace Callback {
}
}
/** For error responses from the {@see CommandService} */
export class CommandError extends Error {
constructor(public readonly errorCode: ErrorCode, req: any, res: any) {
super(
`OnlyOffice command service error ${ErrorCodeFromValue(errorCode)} (${errorCode}): Requested ${JSON.stringify(req)} got ${JSON.stringify(res)}`,
);
}
}
/**
* Helpers to define the protocol of the OnlyOffice editor service command API
* @see https://api.onlyoffice.com/editors/command/
@@ -77,16 +86,6 @@ namespace CommandService {
error: Exclude<ErrorCode, ErrorCode.SUCCESS>;
}
export class CommandError extends Error {
constructor(errorCode: ErrorCode, req: any, res: any) {
super(
`OnlyOffice command service error ${ErrorCodeFromValue(errorCode)} (${errorCode}): Requested ${JSON.stringify(req)} got ${JSON.stringify(
res,
)}`,
);
}
}
abstract class BaseRequest<TSuccessResponse extends SuccessResponse> {
constructor(public readonly c: string) {}