@geek-fun/serverlessinsight 0.5.10 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -1
- package/README.zh-CN.md +94 -1
- package/dist/package.json +3 -1
- package/dist/src/common/aliyunClient/apigwOperations.js +5 -5
- package/dist/src/common/aliyunClient/casOperations.js +116 -0
- package/dist/src/common/aliyunClient/index.js +8 -0
- package/dist/src/common/aliyunClient/ossOperations.js +290 -18
- package/dist/src/common/certificateResolver.js +63 -0
- package/dist/src/common/constants.js +10 -4
- package/dist/src/common/iacHelper.js +9 -1
- package/dist/src/common/index.js +2 -0
- package/dist/src/common/planFormatter.js +269 -0
- package/dist/src/common/retryUtils.js +5 -0
- package/dist/src/common/tencentClient/index.js +18 -0
- package/dist/src/common/tencentClient/sslOperations.js +107 -0
- package/dist/src/lang/en.js +86 -1
- package/dist/src/lang/zh-CN.js +84 -0
- package/dist/src/parser/bucketParser.js +19 -1
- package/dist/src/parser/certificateParser.js +23 -0
- package/dist/src/parser/index.js +2 -0
- package/dist/src/stack/aliyunStack/apigwResource.js +41 -14
- package/dist/src/stack/aliyunStack/apigwTypes.js +32 -2
- package/dist/src/stack/aliyunStack/ossResource.js +44 -5
- package/dist/src/stack/localStack/event.js +1 -1
- package/dist/src/stack/scfStack/cosResource.js +35 -4
- package/dist/src/stack/scfStack/planner.js +1 -57
- package/dist/src/types/domains/certificate.js +2 -0
- package/dist/src/types/index.js +1 -0
- package/dist/src/validator/bucketSchema.js +23 -1
- package/dist/src/validator/certificateSchema.js +31 -0
- package/dist/src/validator/eventSchema.js +12 -0
- package/dist/src/validator/iacSchema.js +2 -0
- package/dist/src/validator/rootSchema.js +3 -0
- package/dist/src/validator/templateRefSchema.js +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displayPlan = exports.formatPlan = exports.formatPlanItem = exports.computeAttributeDiffs = void 0;
|
|
4
|
+
const hashUtils_1 = require("./hashUtils");
|
|
5
|
+
const lang_1 = require("../lang");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
7
|
+
const COLOR = {
|
|
8
|
+
RESET: '\x1b[0m',
|
|
9
|
+
GREEN: '\x1b[32m',
|
|
10
|
+
YELLOW: '\x1b[33m',
|
|
11
|
+
RED: '\x1b[31m',
|
|
12
|
+
CYAN: '\x1b[36m',
|
|
13
|
+
DIM: '\x1b[2m',
|
|
14
|
+
};
|
|
15
|
+
const COMPUTED_ATTRIBUTES = new Set([
|
|
16
|
+
'codeHash',
|
|
17
|
+
'functionId',
|
|
18
|
+
'functionArn',
|
|
19
|
+
'createdTime',
|
|
20
|
+
'lastModifiedTime',
|
|
21
|
+
'status',
|
|
22
|
+
'invokeUrl',
|
|
23
|
+
'invokeArn',
|
|
24
|
+
'arn',
|
|
25
|
+
'id',
|
|
26
|
+
]);
|
|
27
|
+
const DEFAULT_CONFIG = {
|
|
28
|
+
colorize: true,
|
|
29
|
+
indentSize: 4,
|
|
30
|
+
keyAlignWidth: 12,
|
|
31
|
+
showUnchangedAttributes: false,
|
|
32
|
+
maxUnchangedHidden: 5,
|
|
33
|
+
};
|
|
34
|
+
const isObject = (val) => typeof val === 'object' && val !== null && !Array.isArray(val);
|
|
35
|
+
const isSimpleObject = (val) => {
|
|
36
|
+
if (!isObject(val))
|
|
37
|
+
return false;
|
|
38
|
+
const obj = val;
|
|
39
|
+
return Object.values(obj).every((v) => typeof v !== 'object' || v === null);
|
|
40
|
+
};
|
|
41
|
+
const computeAttributeDiffs = (before, after) => {
|
|
42
|
+
if (!before && !after)
|
|
43
|
+
return { diffs: [], unchangedCount: 0 };
|
|
44
|
+
if (!before && after) {
|
|
45
|
+
return {
|
|
46
|
+
diffs: Object.entries(after)
|
|
47
|
+
.map(([key, value]) => ({
|
|
48
|
+
key,
|
|
49
|
+
after: value,
|
|
50
|
+
action: 'add',
|
|
51
|
+
isComputed: COMPUTED_ATTRIBUTES.has(key),
|
|
52
|
+
children: isObject(value) && !isSimpleObject(value)
|
|
53
|
+
? (0, exports.computeAttributeDiffs)(undefined, value).diffs
|
|
54
|
+
: undefined,
|
|
55
|
+
}))
|
|
56
|
+
.sort((a, b) => a.key.localeCompare(b.key)),
|
|
57
|
+
unchangedCount: 0,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (before && !after) {
|
|
61
|
+
return {
|
|
62
|
+
diffs: Object.entries(before)
|
|
63
|
+
.map(([key, value]) => ({
|
|
64
|
+
key,
|
|
65
|
+
before: value,
|
|
66
|
+
action: 'remove',
|
|
67
|
+
isComputed: COMPUTED_ATTRIBUTES.has(key),
|
|
68
|
+
children: isObject(value) && !isSimpleObject(value)
|
|
69
|
+
? (0, exports.computeAttributeDiffs)(value, undefined).diffs
|
|
70
|
+
: undefined,
|
|
71
|
+
}))
|
|
72
|
+
.sort((a, b) => a.key.localeCompare(b.key)),
|
|
73
|
+
unchangedCount: 0,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const { changed, added, removed } = (0, hashUtils_1.diffAttributes)(before, after);
|
|
77
|
+
const allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);
|
|
78
|
+
const unchangedCount = allKeys.size -
|
|
79
|
+
Object.keys(changed).length -
|
|
80
|
+
Object.keys(added).length -
|
|
81
|
+
Object.keys(removed).length;
|
|
82
|
+
const addDiffs = Object.entries(added).map(([key, value]) => ({
|
|
83
|
+
key,
|
|
84
|
+
after: value,
|
|
85
|
+
action: 'add',
|
|
86
|
+
isComputed: COMPUTED_ATTRIBUTES.has(key),
|
|
87
|
+
children: isObject(value) && !isSimpleObject(value)
|
|
88
|
+
? (0, exports.computeAttributeDiffs)(undefined, value).diffs
|
|
89
|
+
: undefined,
|
|
90
|
+
}));
|
|
91
|
+
const removeDiffs = Object.entries(removed).map(([key, value]) => ({
|
|
92
|
+
key,
|
|
93
|
+
before: value,
|
|
94
|
+
action: 'remove',
|
|
95
|
+
isComputed: COMPUTED_ATTRIBUTES.has(key),
|
|
96
|
+
children: isObject(value) && !isSimpleObject(value)
|
|
97
|
+
? (0, exports.computeAttributeDiffs)(value, undefined).diffs
|
|
98
|
+
: undefined,
|
|
99
|
+
}));
|
|
100
|
+
const changeDiffs = Object.entries(changed).map(([key, { before: oldVal, after: newVal }]) => {
|
|
101
|
+
const bothObjects = isObject(oldVal) && isObject(newVal);
|
|
102
|
+
return {
|
|
103
|
+
key,
|
|
104
|
+
before: oldVal,
|
|
105
|
+
after: newVal,
|
|
106
|
+
action: 'change',
|
|
107
|
+
children: bothObjects
|
|
108
|
+
? (0, exports.computeAttributeDiffs)(oldVal, newVal).diffs
|
|
109
|
+
: undefined,
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
const diffs = [...addDiffs, ...removeDiffs, ...changeDiffs].sort((a, b) => a.key.localeCompare(b.key));
|
|
113
|
+
return { diffs, unchangedCount };
|
|
114
|
+
};
|
|
115
|
+
exports.computeAttributeDiffs = computeAttributeDiffs;
|
|
116
|
+
const colorize = (text, color, enabled) => enabled ? `${COLOR[color]}${text}${COLOR.RESET}` : text;
|
|
117
|
+
const formatValue = (value) => {
|
|
118
|
+
if (typeof value === 'string')
|
|
119
|
+
return `"${value}"`;
|
|
120
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
121
|
+
return String(value);
|
|
122
|
+
if (value === null || value === undefined)
|
|
123
|
+
return 'null';
|
|
124
|
+
if (Array.isArray(value)) {
|
|
125
|
+
if (value.length === 0)
|
|
126
|
+
return '[]';
|
|
127
|
+
return `[${value.map((v) => formatValue(v)).join(', ')}]`;
|
|
128
|
+
}
|
|
129
|
+
if (isSimpleObject(value)) {
|
|
130
|
+
const entries = Object.entries(value)
|
|
131
|
+
.map(([k, v]) => `${k}: ${formatValue(v)}`)
|
|
132
|
+
.join(', ');
|
|
133
|
+
return `{ ${entries} }`;
|
|
134
|
+
}
|
|
135
|
+
return JSON.stringify(value);
|
|
136
|
+
};
|
|
137
|
+
const computeMaxKeyWidth = (diffs, baseIndent) => diffs.reduce((maxWidth, diff) => {
|
|
138
|
+
const keyWidth = diff.key.length + 1;
|
|
139
|
+
const childWidth = diff.children && diff.children.length > 0
|
|
140
|
+
? computeMaxKeyWidth(diff.children, baseIndent + 4)
|
|
141
|
+
: 0;
|
|
142
|
+
return Math.max(maxWidth, keyWidth, childWidth);
|
|
143
|
+
}, 0);
|
|
144
|
+
const formatAttributeLines = (diff, indent, config, keyWidth) => {
|
|
145
|
+
const spaces = ' '.repeat(indent);
|
|
146
|
+
const alignedKey = (diff.key + ':').padEnd(keyWidth);
|
|
147
|
+
switch (diff.action) {
|
|
148
|
+
case 'add': {
|
|
149
|
+
if (diff.children && diff.children.length > 0) {
|
|
150
|
+
const childKeyWidth = computeMaxKeyWidth(diff.children, indent);
|
|
151
|
+
return [
|
|
152
|
+
colorize(`${spaces}${alignedKey}`, 'GREEN', config.colorize),
|
|
153
|
+
...diff.children.flatMap((child) => formatAttributeLines(child, indent + config.indentSize, config, childKeyWidth)),
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
const value = diff.isComputed
|
|
157
|
+
? colorize(lang_1.lang.__('PLAN_COMPUTED_VALUE'), 'CYAN', config.colorize)
|
|
158
|
+
: formatValue(diff.after);
|
|
159
|
+
return [colorize(`${spaces}${alignedKey} ${value}`, 'GREEN', config.colorize)];
|
|
160
|
+
}
|
|
161
|
+
case 'remove': {
|
|
162
|
+
if (diff.children && diff.children.length > 0) {
|
|
163
|
+
const childKeyWidth = computeMaxKeyWidth(diff.children, indent);
|
|
164
|
+
return [
|
|
165
|
+
colorize(`${spaces}${alignedKey}`, 'RED', config.colorize),
|
|
166
|
+
...diff.children.flatMap((child) => formatAttributeLines(child, indent + config.indentSize, config, childKeyWidth)),
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
return [
|
|
170
|
+
colorize(`${spaces}${alignedKey} ${formatValue(diff.before)}`, 'RED', config.colorize),
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
case 'change': {
|
|
174
|
+
if (diff.children && diff.children.length > 0) {
|
|
175
|
+
const childKeyWidth = computeMaxKeyWidth(diff.children, indent);
|
|
176
|
+
return [
|
|
177
|
+
colorize(`${spaces}${alignedKey}`, 'YELLOW', config.colorize),
|
|
178
|
+
...diff.children.flatMap((child) => formatAttributeLines(child, indent + config.indentSize, config, childKeyWidth)),
|
|
179
|
+
];
|
|
180
|
+
}
|
|
181
|
+
const beforeStr = formatValue(diff.before);
|
|
182
|
+
const afterStr = formatValue(diff.after);
|
|
183
|
+
return [
|
|
184
|
+
colorize(`${spaces}${alignedKey} ${beforeStr} -> ${afterStr}`, 'YELLOW', config.colorize),
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const ACTION_DESC = {
|
|
190
|
+
create: 'PLAN_WILL_CREATE',
|
|
191
|
+
update: 'PLAN_WILL_UPDATE',
|
|
192
|
+
delete: 'PLAN_WILL_DESTROY',
|
|
193
|
+
noop: 'PLAN_NO_CHANGES',
|
|
194
|
+
refresh: 'PLAN_WILL_REFRESH',
|
|
195
|
+
};
|
|
196
|
+
const ACTION_SYMBOL = {
|
|
197
|
+
create: '+',
|
|
198
|
+
update: '~',
|
|
199
|
+
delete: '-',
|
|
200
|
+
refresh: '↻',
|
|
201
|
+
};
|
|
202
|
+
const ACTION_COLOR = {
|
|
203
|
+
create: 'GREEN',
|
|
204
|
+
update: 'YELLOW',
|
|
205
|
+
delete: 'RED',
|
|
206
|
+
refresh: 'CYAN',
|
|
207
|
+
};
|
|
208
|
+
const formatPlanItem = (item, config = DEFAULT_CONFIG) => {
|
|
209
|
+
const descKey = ACTION_DESC[item.action] ?? 'PLAN_NO_CHANGES';
|
|
210
|
+
const headerLine = ` # ${item.logicalId} ${lang_1.lang.__(descKey)}`;
|
|
211
|
+
if (item.action === 'noop') {
|
|
212
|
+
return headerLine;
|
|
213
|
+
}
|
|
214
|
+
const symbol = ACTION_SYMBOL[item.action] ?? ' ';
|
|
215
|
+
const symbolColor = ACTION_COLOR[item.action] ?? 'RESET';
|
|
216
|
+
const resourceLine = colorize(` ${symbol} ${item.logicalId}:`, symbolColor, config.colorize);
|
|
217
|
+
if (!item.changes) {
|
|
218
|
+
return [headerLine, resourceLine].join('\n');
|
|
219
|
+
}
|
|
220
|
+
const { diffs, unchangedCount } = (0, exports.computeAttributeDiffs)(item.changes.before, item.changes.after);
|
|
221
|
+
const keyWidth = Math.max(config.keyAlignWidth, computeMaxKeyWidth(diffs, config.indentSize));
|
|
222
|
+
const attrLines = diffs.length > 0
|
|
223
|
+
? diffs.flatMap((diff) => formatAttributeLines(diff, config.indentSize, config, keyWidth))
|
|
224
|
+
: [];
|
|
225
|
+
const hiddenLine = unchangedCount > 0 && !config.showUnchangedAttributes
|
|
226
|
+
? [
|
|
227
|
+
colorize(` # ${lang_1.lang.__('PLAN_UNCHANGED_ATTRS', { count: String(unchangedCount) })}`, 'DIM', config.colorize),
|
|
228
|
+
]
|
|
229
|
+
: [];
|
|
230
|
+
return [headerLine, resourceLine, ...attrLines, ...hiddenLine].join('\n');
|
|
231
|
+
};
|
|
232
|
+
exports.formatPlanItem = formatPlanItem;
|
|
233
|
+
const formatPlan = (items, config = DEFAULT_CONFIG) => {
|
|
234
|
+
if (items.length === 0) {
|
|
235
|
+
return lang_1.lang.__('NO_CHANGES_INFRASTRUCTURE_UP_TO_DATE');
|
|
236
|
+
}
|
|
237
|
+
const createItems = items.filter((i) => i.action === 'create');
|
|
238
|
+
const updateItems = items.filter((i) => i.action === 'update');
|
|
239
|
+
const deleteItems = items.filter((i) => i.action === 'delete');
|
|
240
|
+
const refreshItems = items.filter((i) => i.action === 'refresh');
|
|
241
|
+
const noopItems = items.filter((i) => i.action === 'noop');
|
|
242
|
+
const actionItems = [
|
|
243
|
+
...createItems,
|
|
244
|
+
...updateItems,
|
|
245
|
+
...deleteItems,
|
|
246
|
+
...refreshItems,
|
|
247
|
+
...noopItems,
|
|
248
|
+
];
|
|
249
|
+
const header = [
|
|
250
|
+
`${lang_1.lang.__('PLAN_HEADER')}\n`,
|
|
251
|
+
colorize(lang_1.lang.__('PLAN_LEGEND_CREATE'), 'GREEN', config.colorize),
|
|
252
|
+
colorize(lang_1.lang.__('PLAN_LEGEND_UPDATE'), 'YELLOW', config.colorize),
|
|
253
|
+
colorize(lang_1.lang.__('PLAN_LEGEND_DESTROY'), 'RED', config.colorize),
|
|
254
|
+
'',
|
|
255
|
+
];
|
|
256
|
+
const itemLines = actionItems.flatMap((item) => [(0, exports.formatPlanItem)(item, config), '']);
|
|
257
|
+
const summary = lang_1.lang.__('PLAN_SUMMARY', {
|
|
258
|
+
createCount: String(createItems.length),
|
|
259
|
+
updateCount: String(updateItems.length),
|
|
260
|
+
deleteCount: String(deleteItems.length),
|
|
261
|
+
});
|
|
262
|
+
return [...header, ...itemLines, summary].join('\n');
|
|
263
|
+
};
|
|
264
|
+
exports.formatPlan = formatPlan;
|
|
265
|
+
const displayPlan = (planResult) => {
|
|
266
|
+
const output = (0, exports.formatPlan)(planResult.items);
|
|
267
|
+
logger_1.logger.info(output);
|
|
268
|
+
};
|
|
269
|
+
exports.displayPlan = displayPlan;
|
|
@@ -43,16 +43,19 @@ exports.createTencentClient = void 0;
|
|
|
43
43
|
const tencentcloud = __importStar(require("tencentcloud-sdk-nodejs-scf"));
|
|
44
44
|
const cynosdb = __importStar(require("tencentcloud-sdk-nodejs-cynosdb"));
|
|
45
45
|
const tencentEs = __importStar(require("tencentcloud-sdk-nodejs-es"));
|
|
46
|
+
const tencentSsl = __importStar(require("tencentcloud-sdk-nodejs-ssl"));
|
|
46
47
|
const cos_nodejs_sdk_v5_1 = __importDefault(require("cos-nodejs-sdk-v5"));
|
|
47
48
|
const scfOperations_1 = require("./scfOperations");
|
|
48
49
|
const cosOperations_1 = require("./cosOperations");
|
|
49
50
|
const tdsqlcOperations_1 = require("./tdsqlcOperations");
|
|
50
51
|
const esOperations_1 = require("./esOperations");
|
|
51
52
|
const dnspodOperations_1 = require("./dnspodOperations");
|
|
53
|
+
const sslOperations_1 = require("./sslOperations");
|
|
52
54
|
__exportStar(require("./types"), exports);
|
|
53
55
|
const ScfClient = tencentcloud.scf.v20180416.Client;
|
|
54
56
|
const CynosdbClient = cynosdb.cynosdb.v20190107.Client;
|
|
55
57
|
const EsClient = tencentEs.es.v20180416.Client;
|
|
58
|
+
const SslClient = tencentSsl.ssl.v20191205.Client;
|
|
56
59
|
// Initialize SDK clients (internal)
|
|
57
60
|
const initializeSdkClients = (context) => {
|
|
58
61
|
const scfClientConfig = {
|
|
@@ -98,11 +101,25 @@ const initializeSdkClients = (context) => {
|
|
|
98
101
|
},
|
|
99
102
|
};
|
|
100
103
|
const esClient = new EsClient(esClientConfig);
|
|
104
|
+
const sslClientConfig = {
|
|
105
|
+
credential: {
|
|
106
|
+
secretId: context.accessKeyId,
|
|
107
|
+
secretKey: context.accessKeySecret,
|
|
108
|
+
},
|
|
109
|
+
region: context.region,
|
|
110
|
+
profile: {
|
|
111
|
+
httpProfile: {
|
|
112
|
+
endpoint: 'ssl.tencentcloudapi.com',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
const sslClient = new SslClient(sslClientConfig);
|
|
101
117
|
return {
|
|
102
118
|
scf: scfClient,
|
|
103
119
|
cos: cosClient,
|
|
104
120
|
cynosdb: cynosdbClient,
|
|
105
121
|
es: esClient,
|
|
122
|
+
ssl: sslClient,
|
|
106
123
|
dns: (0, dnspodOperations_1.createDnsClient)(context),
|
|
107
124
|
};
|
|
108
125
|
};
|
|
@@ -114,6 +131,7 @@ const createTencentClient = (context) => {
|
|
|
114
131
|
cos: (0, cosOperations_1.createCosOperations)(sdkClients.cos, context.region, dnsOps),
|
|
115
132
|
tdsqlc: (0, tdsqlcOperations_1.createTdsqlcOperations)(sdkClients.cynosdb, context),
|
|
116
133
|
es: (0, esOperations_1.createTencentEsOperations)(sdkClients.es, context),
|
|
134
|
+
ssl: (0, sslOperations_1.createSslOperations)(sdkClients.ssl),
|
|
117
135
|
dns: dnsOps,
|
|
118
136
|
};
|
|
119
137
|
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSslOperations = void 0;
|
|
4
|
+
const lang_1 = require("../../lang");
|
|
5
|
+
const logger_1 = require("../logger");
|
|
6
|
+
const createSslOperations = (sslClient) => ({
|
|
7
|
+
uploadCertificate: async (alias, cert, key, chain) => {
|
|
8
|
+
logger_1.logger.info(lang_1.lang.__('SSL_UPLOADING_CERT', { alias }));
|
|
9
|
+
const response = await sslClient.UploadCertificate({
|
|
10
|
+
CertificatePublicKey: chain ? `${cert}\n${chain}` : cert,
|
|
11
|
+
CertificatePrivateKey: key,
|
|
12
|
+
CertificateType: 'SVR',
|
|
13
|
+
Alias: alias,
|
|
14
|
+
Repeatable: false,
|
|
15
|
+
});
|
|
16
|
+
const certificateId = response.RepeatCertId ?? response.CertificateId;
|
|
17
|
+
if (!certificateId) {
|
|
18
|
+
throw new Error(lang_1.lang.__('SSL_UPLOAD_NO_CERT_ID', { alias }));
|
|
19
|
+
}
|
|
20
|
+
logger_1.logger.info(lang_1.lang.__('SSL_CERT_UPLOADED', { alias, certificateId }));
|
|
21
|
+
return { certificateId, alias };
|
|
22
|
+
},
|
|
23
|
+
getCertificate: async (certificateId) => {
|
|
24
|
+
try {
|
|
25
|
+
const response = await sslClient.DescribeCertificateDetail({ CertificateId: certificateId });
|
|
26
|
+
return {
|
|
27
|
+
certificateId: response.CertificateId ?? certificateId,
|
|
28
|
+
alias: response.Alias ?? undefined,
|
|
29
|
+
domain: response.Domain ?? undefined,
|
|
30
|
+
status: response.Status ?? undefined,
|
|
31
|
+
certBeginTime: response.CertBeginTime ?? undefined,
|
|
32
|
+
certEndTime: response.CertEndTime ?? undefined,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
if (error &&
|
|
37
|
+
typeof error === 'object' &&
|
|
38
|
+
'code' in error &&
|
|
39
|
+
(error.code === 'FailedOperation.CertificateNotFound' || error.code === 'ResourceNotFound')) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
deleteCertificate: async (certificateId) => {
|
|
46
|
+
logger_1.logger.info(lang_1.lang.__('SSL_DELETING_CERT', { certificateId }));
|
|
47
|
+
try {
|
|
48
|
+
const response = await sslClient.DeleteCertificate({ CertificateId: certificateId });
|
|
49
|
+
if (response.DeleteResult === false) {
|
|
50
|
+
throw new Error(lang_1.lang.__('SSL_DELETE_FAILED', { certificateId }));
|
|
51
|
+
}
|
|
52
|
+
logger_1.logger.info(lang_1.lang.__('SSL_CERT_DELETED', { certificateId }));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error &&
|
|
56
|
+
typeof error === 'object' &&
|
|
57
|
+
'code' in error &&
|
|
58
|
+
(error.code === 'FailedOperation.CertificateNotFound' || error.code === 'ResourceNotFound')) {
|
|
59
|
+
logger_1.logger.warn(lang_1.lang.__('SSL_CERT_NOT_FOUND', { certificateId }));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
deployCertificateInstance: async (certificateId, resourceType, instanceIdList) => {
|
|
66
|
+
logger_1.logger.info(lang_1.lang.__('SSL_DEPLOYING_CERT', {
|
|
67
|
+
certificateId,
|
|
68
|
+
resourceType,
|
|
69
|
+
instances: instanceIdList.join(', '),
|
|
70
|
+
}));
|
|
71
|
+
try {
|
|
72
|
+
const response = await sslClient.DeployCertificateInstance({
|
|
73
|
+
CertificateId: certificateId,
|
|
74
|
+
ResourceType: resourceType,
|
|
75
|
+
InstanceIdList: instanceIdList,
|
|
76
|
+
});
|
|
77
|
+
const deployStatus = response.DeployStatus ?? undefined;
|
|
78
|
+
if (deployStatus === 0) {
|
|
79
|
+
logger_1.logger.info(lang_1.lang.__('SSL_CERT_DEPLOY_EXISTING_TASK', {
|
|
80
|
+
certificateId,
|
|
81
|
+
resourceType,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
logger_1.logger.info(lang_1.lang.__('SSL_CERT_DEPLOY_SUBMITTED', {
|
|
86
|
+
certificateId,
|
|
87
|
+
resourceType,
|
|
88
|
+
deployRecordId: String(response.DeployRecordId ?? ''),
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
deployRecordId: response.DeployRecordId ?? undefined,
|
|
93
|
+
deployStatus,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
98
|
+
// eslint-disable-next-line preserve-caught-error
|
|
99
|
+
throw new Error(lang_1.lang.__('SSL_CERT_DEPLOY_FAILED', {
|
|
100
|
+
resourceType,
|
|
101
|
+
certificateId,
|
|
102
|
+
error: message,
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
exports.createSslOperations = createSslOperations;
|
package/dist/src/lang/en.js
CHANGED
|
@@ -80,7 +80,7 @@ exports.en = {
|
|
|
80
80
|
PLAN_COMMAND_TENCENT_ONLY: 'Plan command is currently only supported for Tencent provider',
|
|
81
81
|
GENERATING_PLAN_FOR_SCF: 'Generating plan for Tencent SCF resources...',
|
|
82
82
|
DEPLOYMENT_PLAN: 'DEPLOYMENT PLAN',
|
|
83
|
-
NO_CHANGES_INFRASTRUCTURE_UP_TO_DATE: 'No changes. Infrastructure is up
|
|
83
|
+
NO_CHANGES_INFRASTRUCTURE_UP_TO_DATE: 'No changes. Infrastructure is up to date.',
|
|
84
84
|
CREATE: 'CREATE',
|
|
85
85
|
UPDATE: 'UPDATE',
|
|
86
86
|
DELETE: 'DELETE',
|
|
@@ -103,6 +103,18 @@ exports.en = {
|
|
|
103
103
|
EXECUTING_PLAN: 'Executing deployment plan...',
|
|
104
104
|
DEPLOY_CONFIRMATION: 'Do you want to perform these actions? (yes/no): ',
|
|
105
105
|
DEPLOY_CANCELLED: 'Deployment cancelled.',
|
|
106
|
+
PLAN_WILL_CREATE: 'will be created',
|
|
107
|
+
PLAN_WILL_UPDATE: 'will be updated in-place',
|
|
108
|
+
PLAN_WILL_DESTROY: 'will be destroyed',
|
|
109
|
+
PLAN_WILL_REFRESH: 'will be refreshed',
|
|
110
|
+
PLAN_NO_CHANGES: 'no changes',
|
|
111
|
+
PLAN_HEADER: 'ServerlessInsight will perform the following actions:',
|
|
112
|
+
PLAN_LEGEND_CREATE: ' + create',
|
|
113
|
+
PLAN_LEGEND_UPDATE: ' ~ update in-place',
|
|
114
|
+
PLAN_LEGEND_DESTROY: ' - destroy',
|
|
115
|
+
PLAN_SUMMARY: 'Plan: {{createCount}} to add, {{updateCount}} to change, {{deleteCount}} to destroy.',
|
|
116
|
+
PLAN_UNCHANGED_ATTRS: '({{count}} unchanged attributes hidden)',
|
|
117
|
+
PLAN_COMPUTED_VALUE: '(known after deploy)',
|
|
106
118
|
// TDSQL-C database messages
|
|
107
119
|
TDSQL_CLUSTER_CREATION_INITIATED: 'TDSQL-C cluster creation initiated',
|
|
108
120
|
TDSQL_CLUSTER_CREATION_FAILED: 'Failed to create TDSQL-C cluster',
|
|
@@ -276,11 +288,42 @@ exports.en = {
|
|
|
276
288
|
OSS_BUCKET_CNAME_BIND_FAILED: 'Failed to bind bucket CNAME: {{error}}',
|
|
277
289
|
OSS_BUCKET_CNAME_UNBIND_FAILED: 'Failed to unbind bucket CNAME: {{error}}',
|
|
278
290
|
OSS_BUCKET_CNAME_NEED_VERIFY: 'Domain ownership verification required. Please add TXT record in DNS console, then retry.',
|
|
291
|
+
OSS_CNAME_TOKEN_CREATE_FAILED: 'Failed to create CnameToken for domain ownership verification: {{domain}}',
|
|
292
|
+
OSS_CNAME_CREATING_VERIFICATION_TOKEN: 'Creating verification token for domain: {{domain}}',
|
|
293
|
+
OSS_CNAME_VERIFICATION_TOKEN_CREATED: 'Verification token created for domain {{domain}}. TXT record: {{txtRecord}}, Token: {{token}}',
|
|
294
|
+
OSS_CNAME_TXT_RECORD_CREATED: 'Created TXT record for domain ownership verification: {{txtRecord}}',
|
|
295
|
+
OSS_CNAME_TXT_RECORD_ALREADY_EXISTS: 'TXT verification record already exists: {{txtRecord}}',
|
|
296
|
+
OSS_CNAME_TXT_RECORD_CREATE_FAILED: 'Failed to create TXT record {{txtRecord}}: {{error}}. Please add manually.',
|
|
297
|
+
OSS_CNAME_WAITING_FOR_VERIFICATION: 'Waiting for domain ownership verification to propagate for: {{domain}}',
|
|
298
|
+
OSS_CNAME_DNS_PROPAGATION_WAITING: 'Waiting for TXT record DNS propagation for domain: {{domain}}',
|
|
299
|
+
OSS_CNAME_DNS_PROPAGATION_CHECK: 'Checking TXT record DNS propagation (attempt {{attempt}}/{{max}}, waiting 1 minute)...',
|
|
300
|
+
OSS_CNAME_DNS_PROPAGATION_VERIFIED: 'TXT record DNS propagation verified for domain: {{domain}} after {{minutes}} minute(s)',
|
|
301
|
+
OSS_CNAME_DNS_PROPAGATION_TIMEOUT: 'TXT record DNS propagation could not be verified after {{max}} attempts. Proceeding with binding retry anyway...',
|
|
302
|
+
OSS_CNAME_DNS_CHECK_FAILED: 'TXT record DNS propagation check failed: {{error}}',
|
|
303
|
+
OSS_CNAME_VERIFICATION_RETRY_FAILED: 'Domain ownership verification pending. Please add TXT record: {{txtRecord}} and retry deployment.',
|
|
304
|
+
OSS_CNAME_MANUAL_VERIFICATION_REQUIRED: 'Manual domain ownership verification required for {{domain}}. ' +
|
|
305
|
+
'Please add TXT record: {{txtRecord}} with value: {{token}}, then retry deployment.',
|
|
306
|
+
OSS_VERIFICATION_HEADER: 'OSS Domain Ownership Verification Required',
|
|
307
|
+
OSS_VERIFICATION_DOMAIN: 'Domain: {{domain}}',
|
|
308
|
+
OSS_VERIFICATION_INSTRUCTIONS: 'To verify domain ownership, add the following TXT DNS record:',
|
|
309
|
+
OSS_VERIFICATION_RECORD_NAME: ' Record Name: {{name}}',
|
|
310
|
+
OSS_VERIFICATION_RECORD_TYPE: ' Record Type: TXT',
|
|
311
|
+
OSS_VERIFICATION_RECORD_VALUE: ' Record Value: {{value}}',
|
|
312
|
+
OSS_VERIFICATION_NEXT_STEPS: 'After adding the TXT record:',
|
|
313
|
+
OSS_VERIFICATION_STEP1: '1. Wait 5-10 minutes for DNS propagation',
|
|
314
|
+
OSS_VERIFICATION_STEP2: '2. Run the deploy command again',
|
|
315
|
+
OSS_DNS_TXT_RECORD_DELETED: 'Deleted DNS TXT verification record for domain: {{domain}}',
|
|
316
|
+
OSS_DNS_TXT_RECORD_DELETE_FAILED: 'Failed to delete DNS TXT record for {{domain}}: {{error}}',
|
|
317
|
+
OSS_BUCKET_CERT_BINDING: 'Binding SSL certificate to custom domain {{domain}} on bucket {{bucketName}}',
|
|
318
|
+
OSS_BUCKET_CERT_BOUND: 'SSL certificate bound to custom domain: {{domain}}',
|
|
279
319
|
OSS_CORS_RULE_ADDED: 'Added CORS rule for custom domain: {{domain}}',
|
|
280
320
|
OSS_CORS_RULE_EXISTS: 'CORS rule already exists for custom domain: {{domain}}',
|
|
281
321
|
OSS_CORS_RULE_ADD_FAILED: 'Failed to add CORS rule for {{domain}}: {{error}}',
|
|
282
322
|
OSS_CORS_RULE_REMOVED: 'Removed CORS rule for custom domain: {{domain}}',
|
|
283
323
|
OSS_CORS_RULE_REMOVE_FAILED: 'Failed to remove CORS rule for {{domain}}: {{error}}',
|
|
324
|
+
OSS_BUCKET_PUBLIC_ACCESS_BLOCK_DISABLED: 'Disabled Block Public Access for bucket: {{bucketName}}',
|
|
325
|
+
OSS_BUCKET_PUBLIC_ACCESS_BLOCK_DISABLE_FAILED: 'Failed to disable Block Public Access for bucket {{bucketName}}: {{error}}. ' +
|
|
326
|
+
'You may need to manually disable Block Public Access in the Alibaba Cloud OSS Console.',
|
|
284
327
|
// Tencent COS DNS messages
|
|
285
328
|
COS_DNS_CNAME_CREATED: 'Created DNS CNAME record: {{domain}} -> {{cname}}',
|
|
286
329
|
COS_DNS_CNAME_EXISTS: 'DNS CNAME record already exists: {{domain}} -> {{cname}}',
|
|
@@ -426,4 +469,46 @@ exports.en = {
|
|
|
426
469
|
RAM_ROLE_DRIFT_RECOVERY_FAILED: 'Failed to recover from RAM role state drift for "{{roleName}}": {{error}}. ' +
|
|
427
470
|
'The role existed in the cloud but recovery operations failed. ' +
|
|
428
471
|
'To fix: manually verify the role in the cloud console, remove it from state, and redeploy.',
|
|
472
|
+
// Certificate messages
|
|
473
|
+
CERT_INVALID_CONFIGURATION: 'Certificate "{{name}}" must have either (certificate_body + private_key) or certificate_id, but not both',
|
|
474
|
+
CERT_FILE_NOT_FOUND: 'Certificate file not found: {{filePath}}',
|
|
475
|
+
CERT_READING_FILE: 'Reading certificate file: {{filePath}}',
|
|
476
|
+
CERT_PARSING_CERTIFICATES: 'Parsing certificates configuration',
|
|
477
|
+
CERT_RESOLVING_REFERENCE: 'Resolving certificate reference "{{reference}}" for domain "{{domain}}"',
|
|
478
|
+
CERT_REFERENCE_NOT_FOUND: 'Certificate reference "{{reference}}" could not be resolved. Ensure it is defined in the certificates block.',
|
|
479
|
+
CERT_RESOLVED_UPLOAD: 'Certificate "{{name}}" resolved as upload mode (PEM files provided)',
|
|
480
|
+
CERT_RESOLVED_REFERENCE: 'Certificate "{{name}}" resolved as reference mode (certificate_id: {{certId}})',
|
|
481
|
+
CERT_READING_PEM_FILES: 'Reading PEM files for certificate "{{name}}"',
|
|
482
|
+
// CAS (Certificate Authority Service) messages
|
|
483
|
+
CAS_UPLOADING_CERT: 'Uploading certificate "{{name}}" to CAS',
|
|
484
|
+
CAS_CERT_UPLOADED: 'Certificate "{{name}}" uploaded to CAS (certId: {{certId}})',
|
|
485
|
+
CAS_UPLOAD_NO_CERT_ID: 'CAS upload succeeded but no certificate ID returned for "{{name}}"',
|
|
486
|
+
CAS_FETCHING_CERT: 'Fetching certificate details from CAS (certId: {{certId}})',
|
|
487
|
+
CAS_CERT_NOT_FOUND: 'Certificate not found in CAS (certId: {{certId}})',
|
|
488
|
+
CAS_CERT_FETCH_FAILED: 'Failed to fetch certificate from CAS (certId: {{certId}}): {{error}}',
|
|
489
|
+
CAS_DELETING_CERT: 'Deleting certificate from CAS (certId: {{certId}})',
|
|
490
|
+
CAS_CERT_DELETED: 'Certificate deleted from CAS (certId: {{certId}})',
|
|
491
|
+
// Tencent SSL certificate messages
|
|
492
|
+
SSL_UPLOADING_CERT: 'Uploading certificate to Tencent SSL (alias: {{alias}})',
|
|
493
|
+
SSL_CERT_UPLOADED: 'Certificate uploaded to Tencent SSL (alias: {{alias}}, certificateId: {{certificateId}})',
|
|
494
|
+
SSL_UPLOAD_NO_CERT_ID: 'SSL upload succeeded but no certificate ID returned for "{{alias}}"',
|
|
495
|
+
SSL_DELETING_CERT: 'Deleting certificate from Tencent SSL (certificateId: {{certificateId}})',
|
|
496
|
+
SSL_CERT_DELETED: 'Certificate deleted from Tencent SSL (certificateId: {{certificateId}})',
|
|
497
|
+
SSL_CERT_NOT_FOUND: 'Certificate not found in Tencent SSL (certificateId: {{certificateId}})',
|
|
498
|
+
SSL_DELETE_FAILED: 'Failed to delete certificate from Tencent SSL (certificateId: {{certificateId}})',
|
|
499
|
+
SSL_DEPLOYING_CERT: 'Deploying certificate to {{resourceType}} (certificateId: {{certificateId}}, instances: {{instances}})',
|
|
500
|
+
SSL_CERT_DEPLOY_SUBMITTED: 'Certificate deploy task submitted to {{resourceType}} (certificateId: {{certificateId}}, deployRecordId: {{deployRecordId}})',
|
|
501
|
+
SSL_CERT_DEPLOY_EXISTING_TASK: 'Certificate deploy task already in progress for {{resourceType}} (certificateId: {{certificateId}})',
|
|
502
|
+
SSL_CERT_DEPLOYED: 'Certificate deployed to {{resourceType}} (certificateId: {{certificateId}}, deployRecordId: {{deployRecordId}})',
|
|
503
|
+
SSL_CERT_DEPLOY_FAILED: 'Failed to deploy certificate to {{resourceType}} (certificateId: {{certificateId}}): {{error}}',
|
|
504
|
+
COS_BUCKET_CERT_DEPLOYING: 'Deploying SSL certificate to COS bucket domain: {{domain}} (bucket: {{bucketName}})',
|
|
505
|
+
COS_BUCKET_CERT_DEPLOYED: 'SSL certificate deployed to COS bucket domain: {{domain}}',
|
|
506
|
+
TENCENT_CERT_REFERENCE_NOT_SUPPORTED: 'Certificate "{{name}}" uses certificate_id reference mode which is not yet supported for Tencent Cloud. Use certificate_body and private_key instead.',
|
|
507
|
+
// Protocol messages
|
|
508
|
+
PROTOCOL_INFERRED_REDIRECT: 'Protocol "{{protocol}}" inferred HTTP-to-HTTPS redirect: {{redirect}}',
|
|
509
|
+
// Retry utility messages
|
|
510
|
+
RETRY_ATTEMPT: 'Retrying {{operation}} (attempt {{attempt}}/{{max}})...',
|
|
511
|
+
RETRY_ATTEMPT_FAILED: '{{operation}} attempt {{attempt}}/{{max}} failed: {{error}}. Retrying...',
|
|
512
|
+
RETRY_ALL_ATTEMPTS_FAILED: '{{operation}} failed after {{max}} attempts: {{error}}',
|
|
513
|
+
RETRY_UNEXPECTED_FAILURE: '{{operation}} failed unexpectedly',
|
|
429
514
|
};
|
package/dist/src/lang/zh-CN.js
CHANGED
|
@@ -103,6 +103,18 @@ exports.zhCN = {
|
|
|
103
103
|
EXECUTING_PLAN: '正在执行部署计划...',
|
|
104
104
|
DEPLOY_CONFIRMATION: '是否执行这些操作?(yes/no): ',
|
|
105
105
|
DEPLOY_CANCELLED: '部署已取消。',
|
|
106
|
+
PLAN_WILL_CREATE: '将被创建',
|
|
107
|
+
PLAN_WILL_UPDATE: '将就地更新',
|
|
108
|
+
PLAN_WILL_DESTROY: '将被销毁',
|
|
109
|
+
PLAN_WILL_REFRESH: '将被刷新',
|
|
110
|
+
PLAN_NO_CHANGES: '无变更',
|
|
111
|
+
PLAN_HEADER: 'ServerlessInsight 将执行以下操作:',
|
|
112
|
+
PLAN_LEGEND_CREATE: ' + 创建',
|
|
113
|
+
PLAN_LEGEND_UPDATE: ' ~ 就地更新',
|
|
114
|
+
PLAN_LEGEND_DESTROY: ' - 销毁',
|
|
115
|
+
PLAN_SUMMARY: '计划: 新增 {{createCount}} 个,变更 {{updateCount}} 个,销毁 {{deleteCount}} 个。',
|
|
116
|
+
PLAN_UNCHANGED_ATTRS: '({{count}} 个未变更属性已隐藏)',
|
|
117
|
+
PLAN_COMPUTED_VALUE: '(部署后可知)',
|
|
106
118
|
// TDSQL-C 数据库消息
|
|
107
119
|
TDSQL_CLUSTER_CREATION_INITIATED: 'TDSQL-C 集群创建已启动',
|
|
108
120
|
TDSQL_CLUSTER_CREATION_FAILED: '创建 TDSQL-C 集群失败',
|
|
@@ -275,11 +287,41 @@ exports.zhCN = {
|
|
|
275
287
|
OSS_BUCKET_CNAME_BIND_FAILED: '绑定存储桶 CNAME 失败: {{error}}',
|
|
276
288
|
OSS_BUCKET_CNAME_UNBIND_FAILED: '解绑存储桶 CNAME 失败: {{error}}',
|
|
277
289
|
OSS_BUCKET_CNAME_NEED_VERIFY: '需要验证域名所有权。请在 DNS 控制台添加 TXT 记录后重试。',
|
|
290
|
+
OSS_CNAME_TOKEN_CREATE_FAILED: '创建域名所有权验证 CnameToken 失败: {{domain}}',
|
|
291
|
+
OSS_CNAME_CREATING_VERIFICATION_TOKEN: '正在为域名创建验证令牌: {{domain}}',
|
|
292
|
+
OSS_CNAME_VERIFICATION_TOKEN_CREATED: '已为域名 {{domain}} 创建验证令牌。TXT 记录: {{txtRecord}}, 令牌: {{token}}',
|
|
293
|
+
OSS_CNAME_TXT_RECORD_CREATED: '已创建域名所有权验证 TXT 记录: {{txtRecord}}',
|
|
294
|
+
OSS_CNAME_TXT_RECORD_ALREADY_EXISTS: 'TXT 验证记录已存在: {{txtRecord}}',
|
|
295
|
+
OSS_CNAME_TXT_RECORD_CREATE_FAILED: '创建 TXT 记录 {{txtRecord}} 失败: {{error}}。请手动添加。',
|
|
296
|
+
OSS_CNAME_WAITING_FOR_VERIFICATION: '等待域名所有权验证生效: {{domain}}',
|
|
297
|
+
OSS_CNAME_DNS_PROPAGATION_WAITING: '等待域名 TXT 记录 DNS 生效: {{domain}}',
|
|
298
|
+
OSS_CNAME_DNS_PROPAGATION_CHECK: '正在检查 TXT 记录 DNS 生效状态(第 {{attempt}}/{{max}} 次,等待 1 分钟)...',
|
|
299
|
+
OSS_CNAME_DNS_PROPAGATION_VERIFIED: '域名 TXT 记录 DNS 已生效: {{domain}},耗时 {{minutes}} 分钟',
|
|
300
|
+
OSS_CNAME_DNS_PROPAGATION_TIMEOUT: 'TXT 记录 DNS 在 {{max}} 次尝试后仍未验证生效。继续尝试绑定...',
|
|
301
|
+
OSS_CNAME_DNS_CHECK_FAILED: 'TXT 记录 DNS 生效检查失败: {{error}}',
|
|
302
|
+
OSS_CNAME_VERIFICATION_RETRY_FAILED: '域名所有权验证中。请添加 TXT 记录: {{txtRecord}} 后重新部署。',
|
|
303
|
+
OSS_CNAME_MANUAL_VERIFICATION_REQUIRED: '域名 {{domain}} 需要手动验证所有权。' +
|
|
304
|
+
'请添加 TXT 记录: {{txtRecord}},值为: {{token}},然后重新部署。',
|
|
305
|
+
OSS_VERIFICATION_HEADER: 'OSS 域名所有权验证',
|
|
306
|
+
OSS_VERIFICATION_DOMAIN: '域名: {{domain}}',
|
|
307
|
+
OSS_VERIFICATION_INSTRUCTIONS: '请添加以下 TXT DNS 记录以验证域名所有权:',
|
|
308
|
+
OSS_VERIFICATION_RECORD_NAME: ' 记录名称: {{name}}',
|
|
309
|
+
OSS_VERIFICATION_RECORD_TYPE: ' 记录类型: TXT',
|
|
310
|
+
OSS_VERIFICATION_RECORD_VALUE: ' 记录值: {{value}}',
|
|
311
|
+
OSS_VERIFICATION_NEXT_STEPS: '添加 TXT 记录后:',
|
|
312
|
+
OSS_VERIFICATION_STEP1: '1. 等待 5-10 分钟 DNS 生效',
|
|
313
|
+
OSS_VERIFICATION_STEP2: '2. 重新运行部署命令',
|
|
314
|
+
OSS_DNS_TXT_RECORD_DELETED: '已删除域名所有权验证 TXT 记录: {{domain}}',
|
|
315
|
+
OSS_DNS_TXT_RECORD_DELETE_FAILED: '删除域名 TXT 记录失败: {{domain}}: {{error}}',
|
|
316
|
+
OSS_BUCKET_CERT_BINDING: '正在为存储桶 {{bucketName}} 的自定义域名 {{domain}} 绑定 SSL 证书',
|
|
317
|
+
OSS_BUCKET_CERT_BOUND: '已为自定义域名绑定 SSL 证书: {{domain}}',
|
|
278
318
|
OSS_CORS_RULE_ADDED: '已为自定义域名添加 CORS 规则: {{domain}}',
|
|
279
319
|
OSS_CORS_RULE_EXISTS: '自定义域名的 CORS 规则已存在: {{domain}}',
|
|
280
320
|
OSS_CORS_RULE_ADD_FAILED: '为 {{domain}} 添加 CORS 规则失败: {{error}}',
|
|
281
321
|
OSS_CORS_RULE_REMOVED: '已移除自定义域名的 CORS 规则: {{domain}}',
|
|
282
322
|
OSS_CORS_RULE_REMOVE_FAILED: '移除 {{domain}} 的 CORS 规则失败: {{error}}',
|
|
323
|
+
OSS_BUCKET_PUBLIC_ACCESS_BLOCK_DISABLED: '已为存储桶禁用公共访问阻止: {{bucketName}}',
|
|
324
|
+
OSS_BUCKET_PUBLIC_ACCESS_BLOCK_DISABLE_FAILED: '禁用存储桶 {{bucketName}} 的公共访问阻止失败: {{error}}。您可能需要在阿里云 OSS 控制台手动禁用公共访问阻止。',
|
|
283
325
|
// Tencent COS DNS messages
|
|
284
326
|
COS_DNS_CNAME_CREATED: '已创建 DNS CNAME 记录: {{domain}} -> {{cname}}',
|
|
285
327
|
COS_DNS_CNAME_EXISTS: 'DNS CNAME 记录已存在: {{domain}} -> {{cname}}',
|
|
@@ -423,4 +465,46 @@ exports.zhCN = {
|
|
|
423
465
|
RAM_ROLE_DRIFT_RECOVERY_FAILED: 'RAM 角色 "{{roleName}}" 状态漂移恢复失败:{{error}}。' +
|
|
424
466
|
'角色在云端存在但恢复操作失败。' +
|
|
425
467
|
'修复方法:在云控制台手动确认角色状态,从状态中移除该角色并重新部署。',
|
|
468
|
+
// 证书消息
|
|
469
|
+
CERT_INVALID_CONFIGURATION: '证书 "{{name}}" 必须具有 (certificate_body + private_key) 或 certificate_id,但不能同时存在',
|
|
470
|
+
CERT_FILE_NOT_FOUND: '未找到证书文件: {{filePath}}',
|
|
471
|
+
CERT_READING_FILE: '正在读取证书文件: {{filePath}}',
|
|
472
|
+
CERT_PARSING_CERTIFICATES: '正在解析证书配置',
|
|
473
|
+
CERT_RESOLVING_REFERENCE: '正在解析域名 "{{domain}}" 的证书引用 "{{reference}}"',
|
|
474
|
+
CERT_REFERENCE_NOT_FOUND: '无法解析证书引用 "{{reference}}"。请确保它已在 certificates 块中定义。',
|
|
475
|
+
CERT_RESOLVED_UPLOAD: '证书 "{{name}}" 解析为上传模式(提供了 PEM 文件)',
|
|
476
|
+
CERT_RESOLVED_REFERENCE: '证书 "{{name}}" 解析为引用模式(certificate_id: {{certId}})',
|
|
477
|
+
CERT_READING_PEM_FILES: '正在读取证书 "{{name}}" 的 PEM 文件',
|
|
478
|
+
// CAS(证书授权服务)消息
|
|
479
|
+
CAS_UPLOADING_CERT: '正在上传证书 "{{name}}" 到 CAS',
|
|
480
|
+
CAS_CERT_UPLOADED: '证书 "{{name}}" 已上传到 CAS(certId: {{certId}})',
|
|
481
|
+
CAS_UPLOAD_NO_CERT_ID: 'CAS 上传成功但未返回证书 "{{name}}" 的 ID',
|
|
482
|
+
CAS_FETCHING_CERT: '正在从 CAS 获取证书详情(certId: {{certId}})',
|
|
483
|
+
CAS_CERT_NOT_FOUND: '在 CAS 中未找到证书(certId: {{certId}})',
|
|
484
|
+
CAS_CERT_FETCH_FAILED: '从 CAS 获取证书失败(certId: {{certId}}):{{error}}',
|
|
485
|
+
CAS_DELETING_CERT: '正在从 CAS 删除证书(certId: {{certId}})',
|
|
486
|
+
CAS_CERT_DELETED: '已从 CAS 删除证书(certId: {{certId}})',
|
|
487
|
+
// 腾讯云 SSL 证书消息
|
|
488
|
+
SSL_UPLOADING_CERT: '正在上传证书到腾讯云 SSL(别名: {{alias}})',
|
|
489
|
+
SSL_CERT_UPLOADED: '证书已上传到腾讯云 SSL(别名: {{alias}}, 证书ID: {{certificateId}})',
|
|
490
|
+
SSL_UPLOAD_NO_CERT_ID: 'SSL 上传成功但未返回证书 "{{alias}}" 的 ID',
|
|
491
|
+
SSL_DELETING_CERT: '正在从腾讯云 SSL 删除证书(证书ID: {{certificateId}})',
|
|
492
|
+
SSL_CERT_DELETED: '已从腾讯云 SSL 删除证书(证书ID: {{certificateId}})',
|
|
493
|
+
SSL_CERT_NOT_FOUND: '在腾讯云 SSL 中未找到证书(证书ID: {{certificateId}})',
|
|
494
|
+
SSL_DELETE_FAILED: '从腾讯云 SSL 删除证书失败(证书ID: {{certificateId}})',
|
|
495
|
+
SSL_DEPLOYING_CERT: '正在部署证书到 {{resourceType}}(证书ID: {{certificateId}}, 实例: {{instances}})',
|
|
496
|
+
SSL_CERT_DEPLOY_SUBMITTED: '证书部署任务已提交到 {{resourceType}}(证书ID: {{certificateId}}, 部署记录ID: {{deployRecordId}})',
|
|
497
|
+
SSL_CERT_DEPLOY_EXISTING_TASK: '证书部署任务已在 {{resourceType}} 上运行中(证书ID: {{certificateId}})',
|
|
498
|
+
SSL_CERT_DEPLOYED: '证书已部署到 {{resourceType}}(证书ID: {{certificateId}}, 部署记录ID: {{deployRecordId}})',
|
|
499
|
+
SSL_CERT_DEPLOY_FAILED: '部署证书到 {{resourceType}} 失败(证书ID: {{certificateId}}):{{error}}',
|
|
500
|
+
COS_BUCKET_CERT_DEPLOYING: '正在为 COS 存储桶域名部署 SSL 证书: {{domain}}(存储桶: {{bucketName}})',
|
|
501
|
+
COS_BUCKET_CERT_DEPLOYED: 'SSL 证书已部署到 COS 存储桶域名: {{domain}}',
|
|
502
|
+
TENCENT_CERT_REFERENCE_NOT_SUPPORTED: '证书 "{{name}}" 使用了 certificate_id 引用模式,腾讯云暂不支持该模式。请改用 certificate_body 和 private_key。',
|
|
503
|
+
// 协议消息
|
|
504
|
+
PROTOCOL_INFERRED_REDIRECT: '协议 "{{protocol}}" 推断 HTTP 到 HTTPS 重定向:{{redirect}}',
|
|
505
|
+
// 重试工具消息
|
|
506
|
+
RETRY_ATTEMPT: '正在重试 {{operation}}(第 {{attempt}}/{{max}} 次)...',
|
|
507
|
+
RETRY_ATTEMPT_FAILED: '{{operation}} 第 {{attempt}}/{{max}} 次尝试失败:{{error}}。正在重试...',
|
|
508
|
+
RETRY_ALL_ATTEMPTS_FAILED: '{{operation}} 在 {{max}} 次尝试后失败:{{error}}',
|
|
509
|
+
RETRY_UNEXPECTED_FAILURE: '{{operation}} 意外失败',
|
|
426
510
|
};
|