mirror of
https://github.com/certd/certd.git
synced 2026-07-29 08:12:36 +08:00
chore: format
This commit is contained in:
+21
-21
@@ -5,10 +5,10 @@ import { TencentAccess } from "../../../plugin-lib/tencent/access.js";
|
||||
import { TencentSslClient } from "../../../plugin-lib/tencent/index.js";
|
||||
|
||||
@IsTaskPlugin({
|
||||
name: 'TencentDeployCertToLive',
|
||||
title: '腾讯云-部署到腾讯云直播',
|
||||
icon: 'svg:icon-tencentcloud',
|
||||
desc: 'https://console.cloud.tencent.com/live/',
|
||||
name: "TencentDeployCertToLive",
|
||||
title: "腾讯云-部署到腾讯云直播",
|
||||
icon: "svg:icon-tencentcloud",
|
||||
desc: "https://console.cloud.tencent.com/live/",
|
||||
group: pluginGroups.tencent.key,
|
||||
needPlus: false,
|
||||
default: {
|
||||
@@ -19,11 +19,11 @@ import { TencentSslClient } from "../../../plugin-lib/tencent/index.js";
|
||||
})
|
||||
export class TencentDeployCertToLive extends AbstractTaskPlugin {
|
||||
@TaskInput({
|
||||
title: 'Access提供者',
|
||||
helper: 'access 授权',
|
||||
title: "Access提供者",
|
||||
helper: "access 授权",
|
||||
component: {
|
||||
name: 'access-selector',
|
||||
type: 'tencent',
|
||||
name: "access-selector",
|
||||
type: "tencent",
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
@@ -31,20 +31,20 @@ export class TencentDeployCertToLive extends AbstractTaskPlugin {
|
||||
|
||||
@TaskInput(
|
||||
createRemoteSelectInputDefine({
|
||||
title: '直播域名',
|
||||
helper: '请选择域名或输入域名',
|
||||
typeName: 'TencentDeployCertToLive',
|
||||
title: "直播域名",
|
||||
helper: "请选择域名或输入域名",
|
||||
typeName: "TencentDeployCertToLive",
|
||||
action: TencentDeployCertToLive.prototype.onGetDomainList.name,
|
||||
})
|
||||
)
|
||||
domains!: string[];
|
||||
|
||||
@TaskInput({
|
||||
title: '域名证书',
|
||||
helper: '请选择前置任务输出的域名证书,或者选择前置任务“上传证书到腾讯云”任务的证书ID',
|
||||
title: "域名证书",
|
||||
helper: "请选择前置任务输出的域名证书,或者选择前置任务“上传证书到腾讯云”任务的证书ID",
|
||||
component: {
|
||||
name: 'output-selector',
|
||||
from: [...CertApplyPluginNames, 'UploadCertToTencent'],
|
||||
name: "output-selector",
|
||||
from: [...CertApplyPluginNames, "UploadCertToTencent"],
|
||||
},
|
||||
required: true,
|
||||
})
|
||||
@@ -56,13 +56,13 @@ export class TencentDeployCertToLive extends AbstractTaskPlugin {
|
||||
const access = await this.getAccess<TencentAccess>(this.accessId);
|
||||
|
||||
let tencentCertId = this.cert as string;
|
||||
if (typeof this.cert !== 'string') {
|
||||
if (typeof this.cert !== "string") {
|
||||
const sslClient = new TencentSslClient({
|
||||
access,
|
||||
logger: this.logger,
|
||||
});
|
||||
tencentCertId = await sslClient.uploadToTencent({
|
||||
certName: this.appendTimeSuffix('certd'),
|
||||
certName: this.appendTimeSuffix("certd"),
|
||||
cert: this.cert,
|
||||
});
|
||||
}
|
||||
@@ -81,18 +81,18 @@ export class TencentDeployCertToLive extends AbstractTaskPlugin {
|
||||
const res = await client.ModifyLiveDomainCertBindings(params);
|
||||
this.checkRet(res);
|
||||
|
||||
this.logger.info('部署完成', JSON.stringify(res));
|
||||
this.logger.info("部署完成", JSON.stringify(res));
|
||||
}
|
||||
|
||||
checkRet(ret: any) {
|
||||
if (!ret || ret.Error) {
|
||||
throw new Error('执行失败:' + ret.Error.Code + ',' + ret.Error.Message);
|
||||
throw new Error("执行失败:" + ret.Error.Code + "," + ret.Error.Message);
|
||||
}
|
||||
}
|
||||
|
||||
async getLiveClient() {
|
||||
const accessProvider = await this.getAccess<TencentAccess>(this.accessId);
|
||||
const sdk = await import('tencentcloud-sdk-nodejs/tencentcloud/services/live/v20180801/index.js');
|
||||
const sdk = await import("tencentcloud-sdk-nodejs/tencentcloud/services/live/v20180801/index.js");
|
||||
const CssClient = sdk.v20180801.Client;
|
||||
|
||||
const clientConfig = {
|
||||
@@ -100,7 +100,7 @@ export class TencentDeployCertToLive extends AbstractTaskPlugin {
|
||||
secretId: accessProvider.secretId,
|
||||
secretKey: accessProvider.secretKey,
|
||||
},
|
||||
region: '',
|
||||
region: "",
|
||||
profile: {
|
||||
httpProfile: {
|
||||
endpoint: `live.${accessProvider.intlDomain()}tencentcloudapi.com`,
|
||||
|
||||
Reference in New Issue
Block a user