mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
initial commit
This commit is contained in:
commit
512d4b01d5
55 changed files with 6430 additions and 0 deletions
69
src/types.ts
Normal file
69
src/types.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
export interface Env {
|
||||
GITHUB_WEBHOOK_SECRET: string;
|
||||
GITHUB_APP_ID?: string;
|
||||
GITHUB_PRIVATE_KEY?: string;
|
||||
GITHUB_CLIENT_ID?: string;
|
||||
GITHUB_CLIENT_SECRET?: string;
|
||||
DISCORD_TOKEN?: string;
|
||||
DISCORD_CHANNEL_ID?: string;
|
||||
BASE_URL?: string;
|
||||
KV: KVNamespace;
|
||||
DISCORD_GATEWAY: DurableObjectNamespace;
|
||||
}
|
||||
|
||||
export interface Config {
|
||||
baseUrl: string;
|
||||
github: {
|
||||
webhookSecret: string;
|
||||
appId: number;
|
||||
privateKey: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
};
|
||||
discord: {
|
||||
token: string;
|
||||
defaultChannelId: string;
|
||||
};
|
||||
routes: Route[];
|
||||
}
|
||||
|
||||
export interface Route {
|
||||
id: string;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
filters: Filter[];
|
||||
target: {
|
||||
channelId: string;
|
||||
threadId?: string;
|
||||
};
|
||||
lang?: string;
|
||||
}
|
||||
|
||||
export interface Filter {
|
||||
type: "event" | "repo" | "actor" | "action" | "branch" | "keyword";
|
||||
match: string | string[];
|
||||
exclude?: boolean;
|
||||
}
|
||||
|
||||
export interface WebhookEvent {
|
||||
event: string;
|
||||
payload: Record<string, unknown>;
|
||||
signature?: string;
|
||||
}
|
||||
|
||||
export interface FormattedMessage {
|
||||
embeds?: Array<{
|
||||
title?: string;
|
||||
description?: string;
|
||||
url?: string;
|
||||
color?: number;
|
||||
author?: {
|
||||
name: string;
|
||||
icon_url?: string;
|
||||
url?: string;
|
||||
};
|
||||
fields?: Array<{ name: string; value: string; inline?: boolean }>;
|
||||
footer?: { text: string };
|
||||
timestamp?: string;
|
||||
}>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue