chore: lint

This commit is contained in:
xiaojunnuo
2026-07-15 01:25:55 +08:00
parent 167b303fae
commit 6cc74a1c0a
26 changed files with 29 additions and 75 deletions
+2 -1
View File
@@ -28,7 +28,8 @@
"cross-env": "^7.0.3",
"esmock": "^2.7.5",
"prettier": "3.3.3",
"tslib": "^2.8.1"
"tslib": "^2.8.1",
"eslint": "^8.57.0"
},
"gitHead": "268cd6cc9cb4f1f3d5d5d77859a82f18f0cb6db7"
}
+2 -1
View File
@@ -39,7 +39,8 @@
"js-yaml": "^3.11.0",
"mocha": "^10.6.0",
"prettier": "3.3.3",
"tslib": "^2.8.1"
"tslib": "^2.8.1",
"eslint": "^8.57.0"
},
"engines": {
"node": ">= 8.6.0",
@@ -24,7 +24,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
codeService: CodeService;
@Inject()
addonService: AddonService;
getService() {
getService() {
return this.service;
}
@@ -223,8 +223,3 @@ getService() {
return this.ok(true);
}
}
@@ -10,7 +10,6 @@ import { AutoFix } from "./fix/auto-fix.js";
@Autoload()
@Scope(ScopeEnum.Request, { allowDowngrade: true })
export class AutoARegister {
//这个A是必须,让他排在第一个 进行init,否则会被其他init模块抢先注册导致报错
@Inject()
autoInitSite: AutoInitSite;
@@ -44,4 +43,3 @@ export class AutoARegister {
await this.autoPrint.init();
}
}
@@ -13,7 +13,7 @@ export class AutoLoadPlugins {
@Inject()
pluginService: PluginService;
@Config('runtimeDeps')
@Config("runtimeDeps")
runtimeDepsConfig: any;
async init() {
@@ -34,23 +34,20 @@ export class AutoLoadPlugins {
}
// await import("../../plugins/index.js")
await this.pluginService.registerFromDb();
await registerPaymentProviders();
logger.info(`加载插件完成,加载模式:${process.env.certd_plugin_loadmode}`);
//初始化第三方依赖服务
initRuntimeDepsService(this.runtimeDepsConfig,{
pluginRegistry,
accessRegistry,
notificationRegistry,
dnsProviderRegistry,
addonRegistry,
});
initRuntimeDepsService(this.runtimeDepsConfig, {
pluginRegistry,
accessRegistry,
notificationRegistry,
dnsProviderRegistry,
addonRegistry,
});
// 收集插件 dependPackages 并安装
const service = getRuntimeDepsService();
service.refreshPluginDeps();
}
}
@@ -7,7 +7,6 @@ import { CaptchaService } from "./captcha-service.js";
import { EmailService } from "./email-service.js";
import { CaptchaRequest } from "../../../plugins/plugin-captcha/api.js";
// {data: '<svg.../svg>', text: 'abcd'}
/**
*/
@@ -25,7 +24,7 @@ export class CodeService {
@Inject()
captchaService: CaptchaService;
async checkCaptcha(body: any, req: CaptchaRequest) {
async checkCaptcha(body: any, req: CaptchaRequest) {
return await this.captchaService.doValidate({ form: body, req });
}
/**
@@ -196,7 +195,3 @@ async checkCaptcha(body: any, req: CaptchaRequest) {
return cache.get(this.buildValidationValueKey(code));
}
}
@@ -117,5 +117,3 @@ export class TencentSmsService implements ISmsService {
}
}
}
@@ -4,7 +4,6 @@ import { UserSettingsService } from "./user-settings-service.js";
import { UserTwoFactorSetting } from "./models.js";
import { UserService } from "../../sys/authority/service/user-service.js";
/**
* 授权
*/
@@ -15,7 +14,7 @@ export class TwoFactorService {
userSettingsService: UserSettingsService;
@Inject()
userService: UserService;
async getAuthenticatorQrCode(userId: any) {
async getAuthenticatorQrCode(userId: any) {
const setting = await this.getSetting(userId);
const authenticatorSetting = setting.authenticator;
@@ -89,6 +88,3 @@ async getAuthenticatorQrCode(userId: any) {
return true;
}
}
@@ -14,7 +14,6 @@ import { CertInfoService } from "../../../monitor/index.js";
import { ICertInfoGetter } from "@certd/plugin-lib";
import { CnameProviderService } from "../../../cname/service/cname-provider-service.js";
const serviceNames = ["ocrService"];
export class TaskServiceGetter implements IServiceGetter {
private userId: number;
@@ -100,5 +99,3 @@ export type TaskServiceCreateReq = {
userId: number;
projectId?: number;
};
@@ -48,7 +48,7 @@ export class PluginService extends BaseService<PluginEntity> {
@Inject()
builtInPluginService: BuiltInPluginService;
//@ts-ignore
//@ts-ignore
getRepository() {
return this.repository;
}
@@ -297,7 +297,7 @@ export class PluginService extends BaseService<PluginEntity> {
await this.refreshPluginDeps();
}
async refreshPluginDeps(){
async refreshPluginDeps() {
const service = getRuntimeDepsService();
service.refreshPluginDeps();
}
@@ -566,5 +566,3 @@ export class PluginService extends BaseService<PluginEntity> {
}
}
}
@@ -209,4 +209,3 @@ export class AliyunDnsProvider extends AbstractDnsProvider {
}
new AliyunDnsProvider();
@@ -275,4 +275,3 @@ export class DeployCertToAliyunAckPlugin extends AbstractTaskPlugin {
}
new DeployCertToAliyunAckPlugin();
@@ -239,7 +239,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
access: client.access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
const certIds = [];
for (const item of list) {
@@ -295,7 +295,7 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
if (certInfo.crt) {
const certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt));
@@ -404,4 +404,3 @@ export class AliyunDeployCertToALB extends AbstractTaskPlugin {
}
new AliyunDeployCertToALB();
@@ -136,7 +136,7 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
access,
logger: this.logger,
endpoint: this.endpoint || "cas.aliyuncs.com",
});
});
if (this.domainMatchMode === "auto") {
const { result, deployedList } = await this.autoMatchedDeploy({
@@ -293,4 +293,3 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin {
}
}
new DeployCertToAliyunCDN();
@@ -224,4 +224,3 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin {
}
}
new DeployCertToAliyunDCDN();
@@ -221,7 +221,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
access: client.access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
const certIds = [];
for (const item of list) {
@@ -286,7 +286,7 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
const certName = this.buildCertName(CertReader.getMainDomain(certInfo.crt));
@@ -389,4 +389,3 @@ export class AliyunDeployCertToNLB extends AbstractTaskPlugin {
}
new AliyunDeployCertToNLB();
@@ -234,7 +234,7 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
if (typeof this.cert === "object") {
const name = this.appendTimeSuffix("certd");
@@ -412,4 +412,3 @@ export class AliyunDeployCertToSLB extends AbstractTaskPlugin {
}
new AliyunDeployCertToSLB();
@@ -316,4 +316,3 @@ export class AliyunDeployCertToWafCloud extends AbstractTaskPlugin {
}
new AliyunDeployCertToWafCloud();
@@ -144,7 +144,7 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
access,
logger: this.logger,
endpoint: this.casEndpoint,
});
});
const cert = this.cert as CertInfo;
const casCert = this.cert as CasCertInfo;
@@ -250,4 +250,3 @@ export class AliyunDeployCertToWaf extends AbstractTaskPlugin {
}
new AliyunDeployCertToWaf();
@@ -85,7 +85,7 @@ export class AliyunAccess extends BaseAccess {
access: this,
logger: this.ctx.logger,
endpoint,
});
});
return client;
}
@@ -94,9 +94,8 @@ export class AliyunAccess extends BaseAccess {
access: this,
logger: this.ctx.logger,
endpoint: endpoint,
});
});
}
}
new AliyunAccess();
@@ -20,13 +20,11 @@ export class AliyunClientV2 {
logger: ILogger;
endpoint: string;
client: any;
constructor(opts: { access: AliyunAccess; logger: ILogger; endpoint: string }) {
this.access = opts.access;
this.logger = opts.logger;
this.endpoint = opts.endpoint;
}
async importRuntime(name: string) {
@@ -96,4 +94,3 @@ export class AliyunClientV2 {
return res?.body;
}
}
@@ -7,7 +7,6 @@ export class AliyunClient {
agent: any;
useROAClient: boolean;
constructor(opts: { logger: ILogger; useROAClient?: boolean }) {
this.logger = opts.logger;
this.useROAClient = opts.useROAClient || false;
@@ -82,4 +81,3 @@ export class AliyunClient {
return res;
}
}
@@ -12,7 +12,6 @@ export type AliyunSslClientOpts = {
logger: ILogger;
endpoint?: string;
region?: string;
};
export type AliyunSslGetResourceListReq = {
@@ -47,7 +46,6 @@ export class AliyunSslClient {
constructor(opts: AliyunSslClientOpts) {
this.opts = opts;
this.logger = opts.logger;
}
checkRet(ret: any) {
@@ -254,5 +252,3 @@ export class AliyunSslClient {
}
}
}
@@ -19,7 +19,7 @@ export default class TencentOssClientImpl extends BaseOssClient<TencentCosAccess
logger: this.logger,
region: this.access.region,
bucket: this.access.bucket,
});
});
}
async download(filePath: string, savePath: string): Promise<void> {
const key = this.join(this.rootDir, filePath);
@@ -52,4 +52,3 @@ export default class TencentOssClientImpl extends BaseOssClient<TencentCosAccess
this.logger.info(`文件删除成功: ${filePath}`);
}
}
@@ -9,13 +9,11 @@ export class TencentCosClient {
region: string;
bucket: string;
constructor(opts: { access: TencentAccess; logger: ILogger; region: string; bucket: string }) {
this.access = opts.access;
this.logger = opts.logger;
this.bucket = opts.bucket;
this.region = opts.region;
}
async importRuntime(specifier: string) {
@@ -122,4 +120,3 @@ export class TencentCosClient {
});
}
}