refactor(extensions): dedupe channel config, onboarding, and monitors

This commit is contained in:
Peter Steinberger
2026-03-02 08:53:11 +00:00
parent d358b3ac88
commit ad8d766f65
43 changed files with 677 additions and 776 deletions

View File

@@ -1,6 +1,7 @@
import { isAllowedParsedChatSender } from "../plugin-sdk/allow-from.js";
import { normalizeE164 } from "../utils.js";
import {
type ParsedChatTarget,
parseChatAllowTargetPrefixes,
parseChatTargetPrefixesOrThrow,
resolveServicePrefixedAllowTarget,
@@ -15,11 +16,7 @@ export type IMessageTarget =
| { kind: "chat_identifier"; chatIdentifier: string }
| { kind: "handle"; to: string; service: IMessageService };
export type IMessageAllowTarget =
| { kind: "chat_id"; chatId: number }
| { kind: "chat_guid"; chatGuid: string }
| { kind: "chat_identifier"; chatIdentifier: string }
| { kind: "handle"; handle: string };
export type IMessageAllowTarget = ParsedChatTarget | { kind: "handle"; handle: string };
const CHAT_ID_PREFIXES = ["chat_id:", "chatid:", "chat:"];
const CHAT_GUID_PREFIXES = ["chat_guid:", "chatguid:", "guid:"];