fix: clean lint issues
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
|
|
||||||
import { getResolvedLoggerSettings } from "../../logging.js";
|
import { getResolvedLoggerSettings } from "../../logging.js";
|
||||||
import { theme } from "../../terminal/theme.js";
|
|
||||||
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
import { defaultRuntime, type RuntimeEnv } from "../../runtime.js";
|
||||||
|
import { theme } from "../../terminal/theme.js";
|
||||||
|
|
||||||
export type ProvidersLogsOptions = {
|
export type ProvidersLogsOptions = {
|
||||||
provider?: string;
|
provider?: string;
|
||||||
@@ -128,7 +128,8 @@ export async function providersLogsCommand(
|
|||||||
runtime: RuntimeEnv = defaultRuntime,
|
runtime: RuntimeEnv = defaultRuntime,
|
||||||
) {
|
) {
|
||||||
const provider = parseProviderFilter(opts.provider);
|
const provider = parseProviderFilter(opts.provider);
|
||||||
const limitRaw = typeof opts.lines === "string" ? Number(opts.lines) : opts.lines;
|
const limitRaw =
|
||||||
|
typeof opts.lines === "string" ? Number(opts.lines) : opts.lines;
|
||||||
const limit =
|
const limit =
|
||||||
typeof limitRaw === "number" && Number.isFinite(limitRaw) && limitRaw > 0
|
typeof limitRaw === "number" && Number.isFinite(limitRaw) && limitRaw > 0
|
||||||
? Math.floor(limitRaw)
|
? Math.floor(limitRaw)
|
||||||
|
|||||||
@@ -57,11 +57,7 @@ const isGetUpdatesConflict = (err: unknown) => {
|
|||||||
};
|
};
|
||||||
const errorCode = typed.error_code ?? typed.errorCode;
|
const errorCode = typed.error_code ?? typed.errorCode;
|
||||||
if (errorCode !== 409) return false;
|
if (errorCode !== 409) return false;
|
||||||
const haystack = [
|
const haystack = [typed.method, typed.description, typed.message]
|
||||||
typed.method,
|
|
||||||
typed.description,
|
|
||||||
typed.message,
|
|
||||||
]
|
|
||||||
.filter((value): value is string => typeof value === "string")
|
.filter((value): value is string => typeof value === "string")
|
||||||
.join(" ")
|
.join(" ")
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type ResolvedWhatsAppAccount = {
|
|||||||
authDir: string;
|
authDir: string;
|
||||||
isLegacyAuthDir: boolean;
|
isLegacyAuthDir: boolean;
|
||||||
selfChatMode?: boolean;
|
selfChatMode?: boolean;
|
||||||
dmPolicy?: WhatsAppAccountConfig["dmPolicy"];
|
|
||||||
allowFrom?: string[];
|
allowFrom?: string[];
|
||||||
groupAllowFrom?: string[];
|
groupAllowFrom?: string[];
|
||||||
groupPolicy?: GroupPolicy;
|
groupPolicy?: GroupPolicy;
|
||||||
@@ -118,7 +117,6 @@ export function resolveWhatsAppAccount(params: {
|
|||||||
groupAllowFrom:
|
groupAllowFrom:
|
||||||
accountCfg?.groupAllowFrom ?? params.cfg.whatsapp?.groupAllowFrom,
|
accountCfg?.groupAllowFrom ?? params.cfg.whatsapp?.groupAllowFrom,
|
||||||
groupPolicy: accountCfg?.groupPolicy ?? params.cfg.whatsapp?.groupPolicy,
|
groupPolicy: accountCfg?.groupPolicy ?? params.cfg.whatsapp?.groupPolicy,
|
||||||
dmPolicy: accountCfg?.dmPolicy ?? params.cfg.whatsapp?.dmPolicy,
|
|
||||||
textChunkLimit:
|
textChunkLimit:
|
||||||
accountCfg?.textChunkLimit ?? params.cfg.whatsapp?.textChunkLimit,
|
accountCfg?.textChunkLimit ?? params.cfg.whatsapp?.textChunkLimit,
|
||||||
groups: accountCfg?.groups ?? params.cfg.whatsapp?.groups,
|
groups: accountCfg?.groups ?? params.cfg.whatsapp?.groups,
|
||||||
|
|||||||
Reference in New Issue
Block a user