mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 00:10:21 +00:00
17 lines
474 B
TypeScript
17 lines
474 B
TypeScript
type LineCredentialAccount = {
|
|
channelAccessToken?: string;
|
|
channelSecret?: string;
|
|
};
|
|
|
|
export function hasLineCredentials(account: LineCredentialAccount): boolean {
|
|
return Boolean(account.channelAccessToken?.trim() && account.channelSecret?.trim());
|
|
}
|
|
|
|
export function parseLineAllowFromId(raw: string): string | null {
|
|
const trimmed = raw.trim().replace(/^line:(?:user:)?/i, "");
|
|
if (!/^U[a-f0-9]{32}$/i.test(trimmed)) {
|
|
return null;
|
|
}
|
|
return trimmed;
|
|
}
|