fix: lint issues for unimplemented methods

This commit is contained in:
montaghanmy
2023-04-07 10:09:25 +01:00
parent 254df9828c
commit de0a2d2066
3 changed files with 13 additions and 4 deletions
@@ -37,16 +37,17 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
issuer: this.infos.issuer?.replace(/\/+$/, ""),
jwksUri: this.infos.jwks_uri,
// For local deployment create a https agent that ignore self signed certificate
// eslint-disable-next-line @typescript-eslint/no-var-requires
requestAgent: new (require("https").Agent)({
rejectUnauthorized: this.infos.issuer.includes("example.com") ? false : true,
}),
});
}
fetchCompanyInfo(consoleCompanyCode: string): Promise<ConsoleHookCompany> {
throw new Error("Method not implemented.");
throw new Error(`Method not implemented, ${consoleCompanyCode}.`);
}
resendVerificationEmail(email: string): Promise<void> {
throw new Error("Method not implemented.");
throw new Error(`Method not implemented, ${email}.`);
}
private auth() {
@@ -57,6 +58,7 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
company: ConsoleCompany,
user: CreateConsoleUser,
): Promise<CreatedConsoleUser> {
logger.info(`Method not implemented, ${company.id}, ${user.id}.`);
return null;
}
@@ -65,22 +67,26 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
user: UpdateConsoleUserRole,
): Promise<UpdatedConsoleUserRole> {
logger.info("Remote: updateUserRole");
logger.info(`Method not implemented, ${company.id}, ${user.id}.`);
return null;
}
async createCompany(company: CreateConsoleCompany): Promise<CreatedConsoleCompany> {
logger.info("Remote: createCompany");
logger.info(`Method not implemented, ${company}.`);
return null;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
addUserToTwake(user: CreateConsoleUser): Promise<User> {
logger.info("Remote: addUserToTwake");
logger.info(`Method not implemented, ${user}.`);
//should do noting for real console
return Promise.resolve(undefined);
}
async updateLocalCompanyFromConsole(partialCompanyDTO: ConsoleHookCompany): Promise<Company> {
logger.info(`Method not implemented, ${partialCompanyDTO}.`);
return null;
}
@@ -95,6 +101,9 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {
role => role.applications === undefined || role.applications.find(a => a.code === "twake"),
);
//REMOVE LATER
logger.info(`Roles are: ${roles}.`);
let user = await gr.services.users.getByConsoleId(userDTO.email);
if (!user) {
@@ -238,7 +238,7 @@ export class ConsoleController {
private async userUpdated(code: string) {
//Not implemented yet
throw CrudException.notImplemented("Unimplemented");
throw CrudException.notImplemented(`Method not implemented, ${code}.`);
}
private async companyRemoved(content: ConsoleHookCompanyDeletedContent) {
@@ -12,7 +12,7 @@ const routes: FastifyPluginCallback = (fastify: FastifyInstance, options, next)
const accessControl = async (
request: FastifyRequest<{ Body: ConsoleHookBody; Querystring: ConsoleHookQueryString }>,
) => {
throw fastify.httpErrors.notImplemented("Hook service doesn't exist anymore");
throw fastify.httpErrors.notImplemented(`Hook service doesn't exist anymore, ${request}.`);
};
fastify.route({