mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Figma logging
This commit is contained in:
parent
2d240fc97b
commit
fd21998486
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user