mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00

* Ensure we verify the raw payload. * changelog * Tidy up types * Add test for GitHib * Mock out GitHub API to allow tests to pass. * Lint
14 lines
490 B
TypeScript
14 lines
490 B
TypeScript
import { MatrixClient } from "matrix-bot-sdk";
|
|
import { BridgeAPI } from "../../web/BridgeAPI";
|
|
import { WidgetApi } from "matrix-widget-api";
|
|
|
|
export async function getBridgeApi(publicUrl: string, user: MatrixClient) {
|
|
return BridgeAPI.getBridgeAPI(publicUrl, {
|
|
requestOpenIDConnectToken: () => {
|
|
return user.getOpenIDConnectToken()
|
|
},
|
|
} as unknown as WidgetApi, {
|
|
getItem() { return null},
|
|
setItem() { },
|
|
} as unknown as Storage);
|
|
} |