refactor: share allowlist match metadata

Co-authored-by: thewilloftheshadow <thewilloftheshadow@users.noreply.github.com>
This commit is contained in:
Peter Steinbergerandthewilloftheshadow committed 2026-01-18 01:49:25 +00:00
1 parent ccb30665f7
commit 62354dff9c
10 files changed
+94 -55

No files matched your search

+5 -12
View File
@@ -1,3 +1,5 @@
import type { AllowlistMatch } from "../../channels/allowlist-match.js";
export function normalizeSlackSlug(raw?: string) {
const trimmed = raw?.trim().toLowerCase() ?? "";
if (!trimmed) return "";
@@ -14,18 +16,9 @@ export function normalizeAllowListLower(list?: Array<string | number>) {
return normalizeAllowList(list).map((entry) => entry.toLowerCase());
}
export type SlackAllowListMatch = {
allowed: boolean;
matchKey?: string;
matchSource?:
| "wildcard"
| "id"
| "prefixed-id"
| "prefixed-user"
| "name"
| "prefixed-name"
| "slug";
};
export type SlackAllowListMatch = AllowlistMatch<
"wildcard" | "id" | "prefixed-id" | "prefixed-user" | "name" | "prefixed-name" | "slug"
>;
export function resolveSlackAllowListMatch(params: {
allowList: string[];