refactor(plugin-sdk): share auth, routing, and stream/account helpers

This commit is contained in:
Peter Steinberger
2026-03-02 15:14:46 +00:00
parent e9dd6121f2
commit ed21b63bb8
18 changed files with 457 additions and 286 deletions

View File

@@ -1,4 +1,7 @@
import type { AllowlistMatch } from "../../channels/allowlist-match.js";
import {
resolveAllowlistMatchByCandidates,
type AllowlistMatch,
} from "../../channels/allowlist-match.js";
import {
normalizeHyphenSlug,
normalizeStringEntries,
@@ -49,19 +52,7 @@ export function resolveSlackAllowListMatch(params: {
] satisfies Array<{ value?: string; source: SlackAllowListMatch["matchSource"] }>)
: []),
];
for (const candidate of candidates) {
if (!candidate.value) {
continue;
}
if (allowList.includes(candidate.value)) {
return {
allowed: true,
matchKey: candidate.value,
matchSource: candidate.source,
};
}
}
return { allowed: false };
return resolveAllowlistMatchByCandidates({ allowList, candidates });
}
export function allowListMatches(params: {