mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:20:43 +00:00
refactor: trim irc helper exports
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
const IRC_ERROR_CODES = new Set(["432", "464", "465"]);
|
||||
const IRC_NICK_COLLISION_CODES = new Set(["433", "436"]);
|
||||
|
||||
export type IrcPrivmsgEvent = {
|
||||
type IrcPrivmsgEvent = {
|
||||
senderNick: string;
|
||||
senderUser?: string;
|
||||
senderHost?: string;
|
||||
@@ -39,7 +39,7 @@ export type IrcClientOptions = {
|
||||
onLine?: (line: string) => void;
|
||||
};
|
||||
|
||||
export type IrcNickServOptions = {
|
||||
type IrcNickServOptions = {
|
||||
enabled?: boolean;
|
||||
service?: string;
|
||||
password?: string;
|
||||
|
||||
@@ -42,7 +42,7 @@ const IrcNickServSchema = z
|
||||
}
|
||||
});
|
||||
|
||||
export const IrcAccountSchemaBase = z
|
||||
const IrcAccountSchemaBase = z
|
||||
.object({
|
||||
name: z.string().optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
@@ -68,7 +68,7 @@ export const IrcAccountSchemaBase = z
|
||||
})
|
||||
.strict();
|
||||
|
||||
export const IrcAccountSchema = IrcAccountSchemaBase.superRefine((value, ctx) => {
|
||||
const IrcAccountSchema = IrcAccountSchemaBase.superRefine((value, ctx) => {
|
||||
requireOpenAllowFrom({
|
||||
policy: value.dmPolicy,
|
||||
allowFrom: value.allowFrom,
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { RuntimeEnv } from "./runtime-api.js";
|
||||
import { getIrcRuntime } from "./runtime.js";
|
||||
import type { CoreConfig, IrcInboundMessage } from "./types.js";
|
||||
|
||||
export type IrcMonitorOptions = {
|
||||
type IrcMonitorOptions = {
|
||||
accountId?: string;
|
||||
config?: CoreConfig;
|
||||
runtime?: RuntimeEnv;
|
||||
|
||||
@@ -3,14 +3,14 @@ import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js"
|
||||
import type { IrcAccountConfig, IrcChannelConfig } from "./types.js";
|
||||
import type { IrcInboundMessage } from "./types.js";
|
||||
|
||||
export type IrcGroupMatch = {
|
||||
type IrcGroupMatch = {
|
||||
allowed: boolean;
|
||||
groupConfig?: IrcChannelConfig;
|
||||
wildcardConfig?: IrcChannelConfig;
|
||||
hasConfiguredGroups: boolean;
|
||||
};
|
||||
|
||||
export type IrcGroupAccessGate = {
|
||||
type IrcGroupAccessGate = {
|
||||
allowed: boolean;
|
||||
reason: string;
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@ import { hasIrcControlChars, stripIrcControlChars } from "./control-chars.js";
|
||||
|
||||
const IRC_TARGET_PATTERN = /^[^\s:]+$/u;
|
||||
|
||||
export type ParsedIrcLine = {
|
||||
type ParsedIrcLine = {
|
||||
raw: string;
|
||||
prefix?: string;
|
||||
command: string;
|
||||
@@ -11,7 +11,7 @@ export type ParsedIrcLine = {
|
||||
trailing?: string;
|
||||
};
|
||||
|
||||
export type ParsedIrcPrefix = {
|
||||
type ParsedIrcPrefix = {
|
||||
nick?: string;
|
||||
user?: string;
|
||||
host?: string;
|
||||
|
||||
@@ -18,7 +18,7 @@ type SendIrcOptions = {
|
||||
client?: IrcClient;
|
||||
};
|
||||
|
||||
export type SendIrcResult = {
|
||||
type SendIrcResult = {
|
||||
messageId: string;
|
||||
target: string;
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ export type IrcAccountConfig = {
|
||||
mediaMaxMb?: number;
|
||||
};
|
||||
|
||||
export type IrcConfig = IrcAccountConfig & {
|
||||
type IrcConfig = IrcAccountConfig & {
|
||||
accounts?: Record<string, IrcAccountConfig>;
|
||||
defaultAccount?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user