Figma logging

This commit is contained in:
Half-Shot 2022-02-17 13:04:59 +00:00
parent 2d240fc97b
commit fd21998486
2 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,7 @@ export class FigmaFileConnection extends BaseConnection implements IConnection {
}
content["uk.half-shot.matrix-hookshot.figma.comment_id"] = payload.comment_id;
const eventId = await intent.sendEvent(this.roomId, content);
log.info(`New figma comment ${payload.comment_id} -> ${this.roomId}/${eventId}`)
await this.storage.setFigmaCommentEventId(this.roomId, payload.comment_id, eventId);
}
}

View File

@ -2,13 +2,16 @@ import { BridgeConfigFigma } from "../Config/Config";
import { MessageQueue } from "../MessageQueue";
import { Request, Response, Router, json } from "express";
import { FigmaPayload } from "./types";
import LogWrapper from "../LogWrapper";
const log = new LogWrapper('FigmaWebhooksRouter');
export class FigmaWebhooksRouter {
constructor(private readonly config: BridgeConfigFigma, private readonly queue: MessageQueue) { }
private onWebhook(req: Request<unknown, unknown, FigmaPayload, unknown>, res: Response<string|{error: string}>) {
const payload = req.body;
const instance = Object.entries(this.config.instances).find(([,p]) => p.passcode === payload.passcode);
log.debug(`Got figma webhook for instance ${instance?.[0]}`);
if (!instance) {
// No instance found
res.sendStatus(401);