mirror of
https://github.com/jeffusion/gitea-ai-assistant.git
synced 2026-03-27 10:05:50 +00:00
fix(lint): apply biome cleanup for notification modules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { configManager } from './config-manager.js';
|
||||
import type { NotificationServiceConfig } from '../services/notification/types.js';
|
||||
import { configManager } from './config-manager.js';
|
||||
|
||||
type AppConfig = import('./config-manager.js').AppConfig;
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import { codexEngine } from '../review/codex/codex-engine';
|
||||
import { LocalRepoManager } from '../review/context/local-repo-manager';
|
||||
import { SandboxExec } from '../review/context/sandbox-exec';
|
||||
import { reviewEngine } from '../review/engine';
|
||||
import { PullRequestDetails, giteaService } from '../services/gitea';
|
||||
import { getNotificationManager } from '../services/notification-manager';
|
||||
import type { NotificationContext } from '../services/notification/types';
|
||||
import { PullRequestDetails, giteaService } from '../services/gitea';
|
||||
import { logger } from '../utils/logger';
|
||||
|
||||
// Gitea webhook事件类型
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { createNotificationManager, type NotificationManager } from './notification/notification-manager.js';
|
||||
import { getNotificationConfigs } from '../config/index.js';
|
||||
import {
|
||||
type NotificationManager,
|
||||
createNotificationManager,
|
||||
} from './notification/notification-manager.js';
|
||||
|
||||
export function getNotificationManager(): NotificationManager {
|
||||
const configs = getNotificationConfigs();
|
||||
|
||||
@@ -41,17 +41,11 @@ export abstract class BaseNotificationService implements INotificationService {
|
||||
await this.sendMessage(message);
|
||||
}
|
||||
|
||||
protected abstract buildIssueCreatedMessage(
|
||||
context: NotificationContext
|
||||
): NotificationMessage;
|
||||
protected abstract buildIssueCreatedMessage(context: NotificationContext): NotificationMessage;
|
||||
|
||||
protected abstract buildIssueClosedMessage(
|
||||
context: NotificationContext
|
||||
): NotificationMessage;
|
||||
protected abstract buildIssueClosedMessage(context: NotificationContext): NotificationMessage;
|
||||
|
||||
protected abstract buildIssueAssignedMessage(
|
||||
context: NotificationContext
|
||||
): NotificationMessage;
|
||||
protected abstract buildIssueAssignedMessage(context: NotificationContext): NotificationMessage;
|
||||
|
||||
protected abstract buildPrCreatedMessage(context: NotificationContext): NotificationMessage;
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import * as crypto from 'crypto';
|
||||
import * as crypto from 'node:crypto';
|
||||
import { BaseNotificationService } from '../base-notification-service.js';
|
||||
import type {
|
||||
NotificationContext,
|
||||
NotificationMessage,
|
||||
NotificationServiceConfig,
|
||||
} from '../types.js';
|
||||
import type { NotificationContext, NotificationMessage } from '../types.js';
|
||||
|
||||
type FeishuApiResponse = {
|
||||
code?: number;
|
||||
@@ -21,10 +17,6 @@ function parseFeishuResponse(raw: unknown): FeishuApiResponse {
|
||||
export class FeishuNotificationService extends BaseNotificationService {
|
||||
readonly provider = 'feishu' as const;
|
||||
|
||||
constructor(config: NotificationServiceConfig) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
async sendMessage(message: NotificationMessage): Promise<void> {
|
||||
if (!this.config.webhookUrl) {
|
||||
throw new Error('Feishu webhook URL is not configured');
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { BaseNotificationService } from '../base-notification-service.js';
|
||||
import type {
|
||||
NotificationContext,
|
||||
NotificationMessage,
|
||||
NotificationServiceConfig,
|
||||
} from '../types.js';
|
||||
import type { NotificationContext, NotificationMessage } from '../types.js';
|
||||
|
||||
type WeComApiResponse = {
|
||||
errcode?: number;
|
||||
@@ -13,10 +9,6 @@ type WeComApiResponse = {
|
||||
export class WeComNotificationService extends BaseNotificationService {
|
||||
readonly provider = 'wecom' as const;
|
||||
|
||||
constructor(config: NotificationServiceConfig) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
async sendMessage(message: NotificationMessage): Promise<void> {
|
||||
if (!this.config.webhookUrl) {
|
||||
throw new Error('WeCom webhook URL is not configured');
|
||||
|
||||
Reference in New Issue
Block a user