@geek-fun/serverlessinsight 0.6.0 → 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 +1 -1
- package/dist/src/common/aliyunClient/apigwOperations.js +5 -5
- package/dist/src/common/aliyunClient/ossOperations.js +231 -16
- package/dist/src/common/constants.js +10 -4
- package/dist/src/common/index.js +1 -0
- package/dist/src/common/planFormatter.js +269 -0
- package/dist/src/common/retryUtils.js +5 -0
- package/dist/src/lang/en.js +44 -1
- package/dist/src/lang/zh-CN.js +43 -0
- package/dist/src/stack/aliyunStack/ossResource.js +5 -3
- package/dist/src/stack/scfStack/planner.js +1 -57
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Whether you're building on AWS, Alibaba Cloud, Huawei Cloud, or other providers,
|
|
|
37
37
|
- 🏠 **Local Testing** - Run and debug serverless functions locally
|
|
38
38
|
- 🔄 **Template Generation** - Generate provider-specific IaC templates
|
|
39
39
|
- 🌐 **API Gateway Integration** - Configure HTTP endpoints for your functions
|
|
40
|
+
- 🌐 **Custom Domain Binding** - Automatic domain binding with DNS verification for OSS and API Gateway
|
|
40
41
|
- 💾 **Resource Management** - Manage storage, databases, and other cloud resources
|
|
41
42
|
- 🔐 **Security First** - Built-in validation and security best practices
|
|
42
43
|
- 📊 **Comprehensive Logging** - Debug and monitor your applications
|
|
@@ -143,10 +144,10 @@ For more examples, check out the [samples](./samples) directory:
|
|
|
143
144
|
|
|
144
145
|
- [API Gateway Example](./samples/aliyun-poc-api.yml) - Deploy functions with HTTP endpoints
|
|
145
146
|
- [Storage Example](./samples/aliyun-poc-bucket.yml) - Configure OSS buckets
|
|
147
|
+
- [Custom Domain Example](./samples/aliyun-poc-domain.yml) - Configure OSS static website with custom domain binding
|
|
146
148
|
- [Database Example](./samples/aliyun-poc-rds.yml) - Set up RDS databases
|
|
147
149
|
- [Table Store Example](./samples/aliyun-poc-table.yml) - Configure OTS table storage
|
|
148
150
|
- [Elasticsearch Example](./samples/aliyun-poc-es.yml) - Deploy Elasticsearch Serverless
|
|
149
|
-
- [Custom Domain Example](./samples/aliyun-poc-domain.yml) - Configure custom domains
|
|
150
151
|
- [GPU Functions Example](./samples/aliyun-poc-fc-gpu.yml) - Deploy GPU-enabled functions
|
|
151
152
|
- [Huawei Cloud Example](./samples/huawei-poc-fc.yml) - Deploy to Huawei Cloud FunctionGraph
|
|
152
153
|
|
|
@@ -249,6 +250,98 @@ This architecture enables:
|
|
|
249
250
|
|
|
250
251
|
---
|
|
251
252
|
|
|
253
|
+
## 🌐 Custom Domain Binding
|
|
254
|
+
|
|
255
|
+
ServerlessInsight provides automatic custom domain binding for OSS buckets and API Gateway with built-in DNS verification.
|
|
256
|
+
|
|
257
|
+
### OSS Custom Domain Binding
|
|
258
|
+
|
|
259
|
+
When you configure a custom domain for an OSS bucket (static website hosting), ServerlessInsight automatically:
|
|
260
|
+
|
|
261
|
+
1. **Binds the domain** to your OSS bucket
|
|
262
|
+
2. **Creates DNS CNAME records** pointing to the correct OSS endpoint
|
|
263
|
+
3. **Handles domain ownership verification** via DNS TXT records when required by the cloud provider
|
|
264
|
+
4. **Manages retry logic** with DNS propagation polling for reliable binding
|
|
265
|
+
|
|
266
|
+
```yaml
|
|
267
|
+
buckets:
|
|
268
|
+
my_website:
|
|
269
|
+
name: my-website-bucket
|
|
270
|
+
security:
|
|
271
|
+
acl: PUBLIC_READ
|
|
272
|
+
website:
|
|
273
|
+
code: ./dist
|
|
274
|
+
domain: www.example.com # Custom domain binding
|
|
275
|
+
index: index.html
|
|
276
|
+
error_page: 404.html
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Domain Ownership Verification Flow
|
|
280
|
+
|
|
281
|
+
When binding a custom domain that requires ownership verification:
|
|
282
|
+
|
|
283
|
+
```
|
|
284
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
285
|
+
│ OSS Custom Domain Binding │
|
|
286
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
287
|
+
│
|
|
288
|
+
▼
|
|
289
|
+
┌───────────────────────┐
|
|
290
|
+
│ PutCname (Attempt) │
|
|
291
|
+
└───────────────────────┘
|
|
292
|
+
│
|
|
293
|
+
┌───────────────────┴───────────────────┐
|
|
294
|
+
│ │
|
|
295
|
+
▼ ▼
|
|
296
|
+
┌───────────────┐ ┌─────────────────┐
|
|
297
|
+
│ Success │ │ NeedVerifyDomain│
|
|
298
|
+
└───────────────┘ │ Ownership │
|
|
299
|
+
└─────────────────┘
|
|
300
|
+
│
|
|
301
|
+
▼
|
|
302
|
+
┌─────────────────────────┐
|
|
303
|
+
│ CreateCnameToken API │
|
|
304
|
+
│ (Get TXT record value) │
|
|
305
|
+
└─────────────────────────┘
|
|
306
|
+
│
|
|
307
|
+
▼
|
|
308
|
+
┌─────────────────────────┐
|
|
309
|
+
│ Check existing TXT │
|
|
310
|
+
│ records (avoid dupes) │
|
|
311
|
+
└─────────────────────────┘
|
|
312
|
+
│
|
|
313
|
+
▼
|
|
314
|
+
┌─────────────────────────┐
|
|
315
|
+
│ Add DNS TXT Record │
|
|
316
|
+
│ (_dnsauth.domain) │
|
|
317
|
+
└─────────────────────────┘
|
|
318
|
+
│
|
|
319
|
+
▼
|
|
320
|
+
┌─────────────────────────┐
|
|
321
|
+
│ Poll DNS Propagation │
|
|
322
|
+
│ (up to 10 × 1 min) │
|
|
323
|
+
└─────────────────────────┘
|
|
324
|
+
│
|
|
325
|
+
▼
|
|
326
|
+
┌─────────────────────────┐
|
|
327
|
+
│ Retry PutCname │
|
|
328
|
+
│ (up to 5 × 30 sec) │
|
|
329
|
+
└─────────────────────────┘
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Supported Domain Types
|
|
333
|
+
|
|
334
|
+
For OSS static website hosting, ServerlessInsight supports:
|
|
335
|
+
|
|
336
|
+
| Domain Type | CNAME Target | Use Case |
|
|
337
|
+
| ----------------- | -------------------------------- | ---------------------------------------------- |
|
|
338
|
+
| Root domain (`@`) | `bucket.region.taihangcda.cn` | Bypasses DNS CNAME restriction on root domains |
|
|
339
|
+
| Subdomain (`www`) | `bucket.oss-region.aliyuncs.com` | Standard OSS endpoint |
|
|
340
|
+
|
|
341
|
+
For detailed configuration, see [OSS Custom Domain Binding Guide](./docs/oss-custom-domain-binding.md).
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
252
345
|
## 🗄️ State Management
|
|
253
346
|
|
|
254
347
|
ServerlessInsight uses a state-based deployment model that tracks all deployed resources in a local state file (`.serverlessinsight/state-{app}-{service}.json` in the project directory). This enables:
|
package/README.zh-CN.md
CHANGED
|
@@ -37,6 +37,7 @@ ServerlessInsight 是一个强大的 Serverless 框架,用于跨多个云服
|
|
|
37
37
|
- 🏠 **本地测试** - 在本地运行和调试 Serverless 函数
|
|
38
38
|
- 🔄 **模板生成** - 生成特定云服务商的 IaC 模板
|
|
39
39
|
- 🌐 **API 网关集成** - 为您的函数配置 HTTP 端点
|
|
40
|
+
- 🌐 **自定义域名绑定** - 支持 OSS 和 API 网关的自动域名绑定与 DNS 验证
|
|
40
41
|
- 💾 **资源管理** - 管理存储、数据库和其他云资源
|
|
41
42
|
- 🔐 **安全优先** - 内置验证和安全最佳实践
|
|
42
43
|
- 📊 **全面的日志记录** - 调试和监控您的应用
|
|
@@ -143,10 +144,10 @@ events:
|
|
|
143
144
|
|
|
144
145
|
- [API 网关示例](./samples/aliyun-poc-api.yml) - 部署带 HTTP 端点的函数
|
|
145
146
|
- [存储示例](./samples/aliyun-poc-bucket.yml) - 配置 OSS 存储桶
|
|
147
|
+
- [自定义域名示例](./samples/aliyun-poc-domain.yml) - 配置 OSS 静态网站托管与自定义域名绑定
|
|
146
148
|
- [数据库示例](./samples/aliyun-poc-rds.yml) - 设置 RDS 数据库
|
|
147
149
|
- [表格存储示例](./samples/aliyun-poc-table.yml) - 配置 OTS 表格存储
|
|
148
150
|
- [Elasticsearch 示例](./samples/aliyun-poc-es.yml) - 部署 Elasticsearch Serverless
|
|
149
|
-
- [自定义域名示例](./samples/aliyun-poc-domain.yml) - 配置自定义域名
|
|
150
151
|
- [GPU 函数示例](./samples/aliyun-poc-fc-gpu.yml) - 部署支持 GPU 的函数
|
|
151
152
|
- [华为云示例](./samples/huawei-poc-fc.yml) - 部署到华为云 FunctionGraph
|
|
152
153
|
|
|
@@ -176,6 +177,98 @@ npm run lint:check
|
|
|
176
177
|
|
|
177
178
|
---
|
|
178
179
|
|
|
180
|
+
## 🌐 自定义域名绑定
|
|
181
|
+
|
|
182
|
+
ServerlessInsight 为 OSS 存储桶和 API 网关提供自动化的自定义域名绑定,内置 DNS 验证功能。
|
|
183
|
+
|
|
184
|
+
### OSS 自定义域名绑定
|
|
185
|
+
|
|
186
|
+
当您为 OSS 存储桶(静态网站托管)配置自定义域名时,ServerlessInsight 会自动:
|
|
187
|
+
|
|
188
|
+
1. **绑定域名**到您的 OSS 存储桶
|
|
189
|
+
2. **创建 DNS CNAME 记录**,指向正确的 OSS Endpoint
|
|
190
|
+
3. **处理域名所有权验证**,通过 DNS TXT 记录完成云服务商要求的验证
|
|
191
|
+
4. **管理重试逻辑**,通过 DNS 传播轮询确保绑定可靠
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
buckets:
|
|
195
|
+
my_website:
|
|
196
|
+
name: my-website-bucket
|
|
197
|
+
security:
|
|
198
|
+
acl: PUBLIC_READ
|
|
199
|
+
website:
|
|
200
|
+
code: ./dist
|
|
201
|
+
domain: www.example.com # 自定义域名绑定
|
|
202
|
+
index: index.html
|
|
203
|
+
error_page: 404.html
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### 域名所有权验证流程
|
|
207
|
+
|
|
208
|
+
当绑定需要所有权验证的自定义域名时:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
212
|
+
│ OSS 自定义域名绑定流程 │
|
|
213
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
214
|
+
│
|
|
215
|
+
▼
|
|
216
|
+
┌───────────────────────┐
|
|
217
|
+
│ PutCname (首次尝试) │
|
|
218
|
+
└───────────────────────┘
|
|
219
|
+
│
|
|
220
|
+
┌───────────────────┴───────────────────┐
|
|
221
|
+
│ │
|
|
222
|
+
▼ ▼
|
|
223
|
+
┌───────────────┐ ┌─────────────────┐
|
|
224
|
+
│ 绑定成功 │ │ 需要域名所有权 │
|
|
225
|
+
└───────────────┘ │ 验证 │
|
|
226
|
+
└─────────────────┘
|
|
227
|
+
│
|
|
228
|
+
▼
|
|
229
|
+
┌─────────────────────────┐
|
|
230
|
+
│ CreateCnameToken API │
|
|
231
|
+
│ (获取 TXT 记录值) │
|
|
232
|
+
└─────────────────────────┘
|
|
233
|
+
│
|
|
234
|
+
▼
|
|
235
|
+
┌─────────────────────────┐
|
|
236
|
+
│ 检查现有 TXT 记录 │
|
|
237
|
+
│ (避免重复创建) │
|
|
238
|
+
└─────────────────────────┘
|
|
239
|
+
│
|
|
240
|
+
▼
|
|
241
|
+
┌─────────────────────────┐
|
|
242
|
+
│ 添加 DNS TXT 记录 │
|
|
243
|
+
│ (_dnsauth.domain) │
|
|
244
|
+
└─────────────────────────┘
|
|
245
|
+
│
|
|
246
|
+
▼
|
|
247
|
+
┌─────────────────────────┐
|
|
248
|
+
│ 轮询 DNS 传播状态 │
|
|
249
|
+
│ (最多 10 次 × 1 分钟) │
|
|
250
|
+
└─────────────────────────┘
|
|
251
|
+
│
|
|
252
|
+
▼
|
|
253
|
+
┌─────────────────────────┐
|
|
254
|
+
│ 重试 PutCname │
|
|
255
|
+
│ (最多 5 次 × 30 秒) │
|
|
256
|
+
└─────────────────────────┘
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 支持的域名类型
|
|
260
|
+
|
|
261
|
+
对于 OSS 静态网站托管,ServerlessInsight 支持:
|
|
262
|
+
|
|
263
|
+
| 域名类型 | CNAME 目标 | 使用场景 |
|
|
264
|
+
| -------------- | -------------------------------- | --------------------------- |
|
|
265
|
+
| 根域名 (`@`) | `bucket.region.taihangcda.cn` | 绕过根域名的 DNS CNAME 限制 |
|
|
266
|
+
| 子域名 (`www`) | `bucket.oss-region.aliyuncs.com` | 标准 OSS Endpoint |
|
|
267
|
+
|
|
268
|
+
详细配置请参考 [OSS 自定义域名绑定指南](./docs/oss-custom-domain-binding.md)。
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
179
272
|
## 📘 文档
|
|
180
273
|
|
|
181
274
|
完整文档请访问 [serverlessinsight.geekfun.club](https://serverlessinsight.geekfun.club)
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -43,10 +43,10 @@ const stateManager_1 = require("../stateManager");
|
|
|
43
43
|
const sidUtils_1 = require("../sidUtils");
|
|
44
44
|
const domainUtils_1 = require("../domainUtils");
|
|
45
45
|
const constants_1 = require("../constants");
|
|
46
|
+
const retryUtils_1 = require("../retryUtils");
|
|
46
47
|
const removeUndefined = (obj) => {
|
|
47
48
|
return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
|
|
48
49
|
};
|
|
49
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
50
50
|
const isNetworkTimeoutError = (error) => {
|
|
51
51
|
if (!error || typeof error !== 'object')
|
|
52
52
|
return false;
|
|
@@ -103,7 +103,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
103
103
|
attempt: String(attempt),
|
|
104
104
|
max: String(maxAttempts),
|
|
105
105
|
}));
|
|
106
|
-
await sleep(delayMs);
|
|
106
|
+
await (0, retryUtils_1.sleep)(delayMs);
|
|
107
107
|
const propagated = await checkPropagation();
|
|
108
108
|
if (propagated) {
|
|
109
109
|
logger_1.logger.info(lang_1.lang.__('APIGW_DNS_VERIFIED', { minutes: String(attempt) }));
|
|
@@ -135,7 +135,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
135
135
|
return true;
|
|
136
136
|
}
|
|
137
137
|
if (attempt < constants_1.APIGW_DNS_PUBLIC_RESOLUTION_MAX_ATTEMPTS) {
|
|
138
|
-
await sleep(constants_1.APIGW_DNS_PUBLIC_RESOLUTION_DELAY_MS);
|
|
138
|
+
await (0, retryUtils_1.sleep)(constants_1.APIGW_DNS_PUBLIC_RESOLUTION_DELAY_MS);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
logger_1.logger.warn(lang_1.lang.__('APIGW_PUBLIC_DNS_TIMEOUT', { domain: domainName }));
|
|
@@ -706,7 +706,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
706
706
|
attempt: String(attempt),
|
|
707
707
|
max: String(constants_1.APIGW_DOMAIN_BIND_MAX_RETRIES),
|
|
708
708
|
}));
|
|
709
|
-
await sleep(constants_1.APIGW_DOMAIN_BIND_RETRY_DELAY_MS);
|
|
709
|
+
await (0, retryUtils_1.sleep)(constants_1.APIGW_DOMAIN_BIND_RETRY_DELAY_MS);
|
|
710
710
|
try {
|
|
711
711
|
await apigwClient.setDomain(setDomainRequest);
|
|
712
712
|
await setCertificate();
|
|
@@ -756,7 +756,7 @@ const createApigwOperations = (apigwClient, dnsClient, _context) => {
|
|
|
756
756
|
attempt: String(attempt),
|
|
757
757
|
max: String(constants_1.APIGW_DOMAIN_BIND_MAX_RETRIES),
|
|
758
758
|
}));
|
|
759
|
-
await sleep(constants_1.APIGW_DOMAIN_BIND_RETRY_DELAY_MS);
|
|
759
|
+
await (0, retryUtils_1.sleep)(constants_1.APIGW_DOMAIN_BIND_RETRY_DELAY_MS);
|
|
760
760
|
try {
|
|
761
761
|
await apigwClient.setDomain(setDomainRequest);
|
|
762
762
|
await setCertificate();
|
|
@@ -10,10 +10,32 @@ const bucketTypes_1 = require("../../stack/bucketTypes");
|
|
|
10
10
|
const logger_1 = require("../logger");
|
|
11
11
|
const lang_1 = require("../../lang");
|
|
12
12
|
const domainUtils_1 = require("../domainUtils");
|
|
13
|
+
const retryUtils_1 = require("../retryUtils");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
13
15
|
const ossRequest = (ossClient, params) => {
|
|
14
16
|
return ossClient.request(params);
|
|
15
17
|
};
|
|
16
18
|
const escapeXmlText = (text) => text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
19
|
+
const toCamelCase = (str) => str.charAt(0).toLowerCase() + str.slice(1);
|
|
20
|
+
const parseXmlResponse = (xml, tagName) => {
|
|
21
|
+
try {
|
|
22
|
+
const containerRegex = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`);
|
|
23
|
+
const containerMatch = containerRegex.exec(xml);
|
|
24
|
+
if (!containerMatch)
|
|
25
|
+
return null;
|
|
26
|
+
const innerXml = containerMatch[1];
|
|
27
|
+
const result = {};
|
|
28
|
+
const childRegex = /<(\w+)>([^<]*)<\/\1>/g;
|
|
29
|
+
let match;
|
|
30
|
+
while ((match = childRegex.exec(innerXml)) !== null) {
|
|
31
|
+
result[toCamelCase(match[1])] = match[2].trim();
|
|
32
|
+
}
|
|
33
|
+
return Object.keys(result).length > 0 ? result : null;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
17
39
|
const createOssOperations = (ossClient, region, dnsOps) => {
|
|
18
40
|
const useBucket = (bucketName) => {
|
|
19
41
|
ossClient.useBucket(bucketName);
|
|
@@ -31,6 +53,37 @@ const createOssOperations = (ossClient, region, dnsOps) => {
|
|
|
31
53
|
<Force>true</Force>
|
|
32
54
|
</CertificateConfiguration>`;
|
|
33
55
|
};
|
|
56
|
+
const createCnameToken = async (bucketName, domain) => {
|
|
57
|
+
useBucket(bucketName);
|
|
58
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
59
|
+
<BucketCnameConfiguration>
|
|
60
|
+
<Cname>
|
|
61
|
+
<Domain>${escapeXmlText(domain)}</Domain>
|
|
62
|
+
</Cname>
|
|
63
|
+
</BucketCnameConfiguration>`;
|
|
64
|
+
const params = {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
bucket: bucketName,
|
|
67
|
+
subres: { cname: '', comp: 'token' },
|
|
68
|
+
headers: {
|
|
69
|
+
'Content-Type': 'application/xml',
|
|
70
|
+
},
|
|
71
|
+
content: xml,
|
|
72
|
+
successStatuses: [200],
|
|
73
|
+
};
|
|
74
|
+
const response = await ossRequest(ossClient, params);
|
|
75
|
+
const responseXml = response.data || '';
|
|
76
|
+
const parsed = parseXmlResponse(responseXml, 'CnameToken');
|
|
77
|
+
if (!parsed || !parsed.token) {
|
|
78
|
+
throw new Error(lang_1.lang.__('OSS_CNAME_TOKEN_CREATE_FAILED', { domain }));
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
bucket: bucketName,
|
|
82
|
+
cname: domain,
|
|
83
|
+
token: parsed.token,
|
|
84
|
+
expireTime: parsed.expireTime || '',
|
|
85
|
+
};
|
|
86
|
+
};
|
|
34
87
|
const putBucketCname = async (bucketName, domain, certificate) => {
|
|
35
88
|
useBucket(bucketName);
|
|
36
89
|
const certXml = buildCertificateXml(certificate);
|
|
@@ -54,24 +107,24 @@ const createOssOperations = (ossClient, region, dnsOps) => {
|
|
|
54
107
|
};
|
|
55
108
|
await ossClient.request(params);
|
|
56
109
|
logger_1.logger.info(lang_1.lang.__('OSS_BUCKET_CNAME_BOUND', { domain }));
|
|
57
|
-
return true;
|
|
110
|
+
return { success: true, needVerification: false };
|
|
58
111
|
}
|
|
59
112
|
catch (error) {
|
|
60
113
|
const err = error;
|
|
61
114
|
if (err.code === 'CnameAlreadyExists' || err.status === 409) {
|
|
62
115
|
logger_1.logger.info(lang_1.lang.__('OSS_BUCKET_CNAME_EXISTS', { domain }));
|
|
63
|
-
return true;
|
|
116
|
+
return { success: true, needVerification: false };
|
|
64
117
|
}
|
|
65
118
|
if (err.code === 'NeedVerifyDomainOwnership') {
|
|
66
119
|
logger_1.logger.warn(lang_1.lang.__('OSS_BUCKET_CNAME_NEED_VERIFY', { domain }));
|
|
67
|
-
return false;
|
|
120
|
+
return { success: false, needVerification: true };
|
|
68
121
|
}
|
|
69
122
|
if (certificate) {
|
|
70
123
|
// eslint-disable-next-line preserve-caught-error
|
|
71
124
|
throw new Error(lang_1.lang.__('OSS_BUCKET_CNAME_BIND_FAILED', { error: String(error) }));
|
|
72
125
|
}
|
|
73
126
|
logger_1.logger.warn(lang_1.lang.__('OSS_BUCKET_CNAME_BIND_FAILED', { error: String(error) }));
|
|
74
|
-
return false;
|
|
127
|
+
return { success: false, needVerification: false };
|
|
75
128
|
}
|
|
76
129
|
};
|
|
77
130
|
const deleteBucketCname = async (bucketName, domain) => {
|
|
@@ -172,15 +225,166 @@ const createOssOperations = (ossClient, region, dnsOps) => {
|
|
|
172
225
|
const mainDomain = (0, domainUtils_1.extractMainDomain)(domain);
|
|
173
226
|
const hostRecord = (0, domainUtils_1.extractHostRecord)(domain, mainDomain);
|
|
174
227
|
const ossEndpoint = getOssEndpoint(bucketName);
|
|
175
|
-
|
|
228
|
+
let cnameResult = await putBucketCname(bucketName, domain, certificate);
|
|
229
|
+
let txtRecordId;
|
|
230
|
+
if (cnameResult.needVerification) {
|
|
231
|
+
const verificationResult = await handleDomainOwnershipVerification(bucketName, domain, certificate);
|
|
232
|
+
cnameResult = verificationResult;
|
|
233
|
+
txtRecordId = verificationResult.txtRecordId;
|
|
234
|
+
}
|
|
235
|
+
const bucketCnameBound = cnameResult.success;
|
|
176
236
|
if (certificate && bucketCnameBound) {
|
|
177
237
|
logger_1.logger.info(lang_1.lang.__('OSS_BUCKET_CERT_BOUND', { domain }));
|
|
178
238
|
}
|
|
179
239
|
await addCorsRuleForDomain(bucketName, domain);
|
|
180
240
|
if (!dnsOps) {
|
|
181
241
|
logger_1.logger.warn(lang_1.lang.__('OSS_DNS_MANUAL_CONFIG_REQUIRED', { domain, cname: ossEndpoint }));
|
|
182
|
-
return { domain, cname: ossEndpoint, bucketCnameBound };
|
|
242
|
+
return { domain, cname: ossEndpoint, bucketCnameBound, txtRecordId };
|
|
243
|
+
}
|
|
244
|
+
const result = await createOrFindDnsCnameRecord(domain, mainDomain, hostRecord, ossEndpoint, bucketCnameBound);
|
|
245
|
+
return { ...result, txtRecordId };
|
|
246
|
+
};
|
|
247
|
+
const logOssVerificationInstructions = (domain, fullTxtRecord, token) => {
|
|
248
|
+
const mainDomain = (0, domainUtils_1.extractMainDomain)(domain);
|
|
249
|
+
const separator = '='.repeat(80);
|
|
250
|
+
logger_1.logger.error(`\n${separator}\n${lang_1.lang.__('OSS_VERIFICATION_HEADER')}\n${separator}\n${lang_1.lang.__('OSS_VERIFICATION_DOMAIN', { domain })}\n\n${lang_1.lang.__('OSS_VERIFICATION_INSTRUCTIONS')}\n\n${lang_1.lang.__('OSS_VERIFICATION_RECORD_NAME', { name: `${fullTxtRecord}.${mainDomain}` })}\n${lang_1.lang.__('OSS_VERIFICATION_RECORD_TYPE')}\n${lang_1.lang.__('OSS_VERIFICATION_RECORD_VALUE', { value: token })}`);
|
|
251
|
+
logger_1.logger.error(`\n${separator}\n${lang_1.lang.__('OSS_VERIFICATION_NEXT_STEPS')}\n${lang_1.lang.__('OSS_VERIFICATION_STEP1')}\n${lang_1.lang.__('OSS_VERIFICATION_STEP2')}\n${separator}\n`);
|
|
252
|
+
};
|
|
253
|
+
const handleDomainOwnershipVerification = async (bucketName, domain, certificate) => {
|
|
254
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_CREATING_VERIFICATION_TOKEN', { domain }));
|
|
255
|
+
const tokenInfo = await createCnameToken(bucketName, domain);
|
|
256
|
+
const txtRecordName = '_dnsauth';
|
|
257
|
+
const hostRecord = (0, domainUtils_1.extractHostRecord)(domain, (0, domainUtils_1.extractMainDomain)(domain));
|
|
258
|
+
const fullTxtRecord = hostRecord ? `${txtRecordName}.${hostRecord}` : txtRecordName;
|
|
259
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_VERIFICATION_TOKEN_CREATED', {
|
|
260
|
+
domain,
|
|
261
|
+
txtRecord: fullTxtRecord,
|
|
262
|
+
token: tokenInfo.token,
|
|
263
|
+
}));
|
|
264
|
+
const txtResult = await addVerificationTxtRecord((0, domainUtils_1.extractMainDomain)(domain), fullTxtRecord, tokenInfo.token);
|
|
265
|
+
if (txtResult.success) {
|
|
266
|
+
await pollTxtDnsPropagation((0, domainUtils_1.extractMainDomain)(domain), fullTxtRecord, tokenInfo.token);
|
|
267
|
+
const retryResult = await retryCnameBindingAfterVerification(bucketName, domain, certificate);
|
|
268
|
+
return { ...retryResult, txtRecordId: txtResult.recordId };
|
|
183
269
|
}
|
|
270
|
+
logOssVerificationInstructions(domain, fullTxtRecord, tokenInfo.token);
|
|
271
|
+
throw new Error(lang_1.lang.__('OSS_CNAME_MANUAL_VERIFICATION_REQUIRED', {
|
|
272
|
+
domain,
|
|
273
|
+
txtRecord: `${fullTxtRecord}.${(0, domainUtils_1.extractMainDomain)(domain)}`,
|
|
274
|
+
token: tokenInfo.token,
|
|
275
|
+
}));
|
|
276
|
+
};
|
|
277
|
+
const addVerificationTxtRecord = async (mainDomain, fullTxtRecord, token) => {
|
|
278
|
+
if (!dnsOps)
|
|
279
|
+
return { success: false };
|
|
280
|
+
try {
|
|
281
|
+
const existingRecords = await dnsOps.describeDomainRecords(mainDomain, fullTxtRecord);
|
|
282
|
+
const existingRecord = existingRecords.find((record) => record.rr === fullTxtRecord && record.type === 'TXT' && record.value === token);
|
|
283
|
+
if (existingRecord) {
|
|
284
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_TXT_RECORD_ALREADY_EXISTS', {
|
|
285
|
+
txtRecord: `${fullTxtRecord}.${mainDomain}`,
|
|
286
|
+
}));
|
|
287
|
+
return { success: true, recordId: existingRecord.recordId };
|
|
288
|
+
}
|
|
289
|
+
const recordId = await dnsOps.addDomainRecord({
|
|
290
|
+
domainName: mainDomain,
|
|
291
|
+
rr: fullTxtRecord,
|
|
292
|
+
type: 'TXT',
|
|
293
|
+
value: token,
|
|
294
|
+
ttl: 600,
|
|
295
|
+
});
|
|
296
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_TXT_RECORD_CREATED', {
|
|
297
|
+
txtRecord: `${fullTxtRecord}.${mainDomain}`,
|
|
298
|
+
}));
|
|
299
|
+
return { success: true, recordId };
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_CNAME_TXT_RECORD_CREATE_FAILED', {
|
|
303
|
+
txtRecord: `${fullTxtRecord}.${mainDomain}`,
|
|
304
|
+
error: String(error),
|
|
305
|
+
}));
|
|
306
|
+
return { success: false };
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
const pollTxtDnsPropagation = async (mainDomain, fullTxtRecord, token) => {
|
|
310
|
+
if (!dnsOps)
|
|
311
|
+
return false;
|
|
312
|
+
const checkPropagation = async () => {
|
|
313
|
+
try {
|
|
314
|
+
const currentRecords = await dnsOps.describeDomainRecords(mainDomain, fullTxtRecord);
|
|
315
|
+
return currentRecords.some((record) => record.rr === fullTxtRecord &&
|
|
316
|
+
record.type === 'TXT' &&
|
|
317
|
+
record.value === token &&
|
|
318
|
+
record.status === 'ENABLE');
|
|
319
|
+
}
|
|
320
|
+
catch (checkError) {
|
|
321
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_CNAME_DNS_CHECK_FAILED', { error: String(checkError) }));
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_DNS_PROPAGATION_WAITING', { domain: mainDomain }));
|
|
326
|
+
for (let attempt = 1; attempt <= constants_1.DNS_PROPAGATION_MAX_ATTEMPTS; attempt++) {
|
|
327
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_DNS_PROPAGATION_CHECK', {
|
|
328
|
+
attempt: String(attempt),
|
|
329
|
+
max: String(constants_1.DNS_PROPAGATION_MAX_ATTEMPTS),
|
|
330
|
+
}));
|
|
331
|
+
await (0, retryUtils_1.sleep)(constants_1.DNS_PROPAGATION_DELAY_MS);
|
|
332
|
+
const propagated = await checkPropagation();
|
|
333
|
+
if (propagated) {
|
|
334
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_DNS_PROPAGATION_VERIFIED', {
|
|
335
|
+
domain: mainDomain,
|
|
336
|
+
minutes: String(attempt),
|
|
337
|
+
}));
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_CNAME_DNS_PROPAGATION_TIMEOUT', {
|
|
342
|
+
max: String(constants_1.DNS_PROPAGATION_MAX_ATTEMPTS),
|
|
343
|
+
}));
|
|
344
|
+
return false;
|
|
345
|
+
};
|
|
346
|
+
const retryCnameBindingAfterVerification = async (bucketName, domain, certificate) => {
|
|
347
|
+
logger_1.logger.info(lang_1.lang.__('OSS_CNAME_WAITING_FOR_VERIFICATION', { domain }));
|
|
348
|
+
for (let attempt = 1; attempt <= constants_1.DOMAIN_BIND_MAX_RETRIES; attempt++) {
|
|
349
|
+
if (attempt > 1) {
|
|
350
|
+
logger_1.logger.info(lang_1.lang.__('RETRY_ATTEMPT', {
|
|
351
|
+
operation: 'domain binding',
|
|
352
|
+
attempt: String(attempt),
|
|
353
|
+
max: String(constants_1.DOMAIN_BIND_MAX_RETRIES),
|
|
354
|
+
}));
|
|
355
|
+
}
|
|
356
|
+
await (0, retryUtils_1.sleep)(constants_1.DOMAIN_BIND_RETRY_DELAY_MS);
|
|
357
|
+
try {
|
|
358
|
+
const cnameResult = await putBucketCname(bucketName, domain, certificate);
|
|
359
|
+
if (cnameResult.success) {
|
|
360
|
+
return cnameResult;
|
|
361
|
+
}
|
|
362
|
+
if (!cnameResult.needVerification) {
|
|
363
|
+
return cnameResult;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
catch (error) {
|
|
367
|
+
if (attempt === constants_1.DOMAIN_BIND_MAX_RETRIES) {
|
|
368
|
+
throw error;
|
|
369
|
+
}
|
|
370
|
+
logger_1.logger.warn(lang_1.lang.__('RETRY_ATTEMPT_FAILED', {
|
|
371
|
+
operation: 'domain binding',
|
|
372
|
+
attempt: String(attempt),
|
|
373
|
+
max: String(constants_1.DOMAIN_BIND_MAX_RETRIES),
|
|
374
|
+
error: String(error),
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
const hostRecord = (0, domainUtils_1.extractHostRecord)(domain, (0, domainUtils_1.extractMainDomain)(domain));
|
|
379
|
+
const txtRecordName = '_dnsauth';
|
|
380
|
+
const fullTxtRecord = hostRecord ? `${txtRecordName}.${hostRecord}` : txtRecordName;
|
|
381
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_CNAME_VERIFICATION_RETRY_FAILED', {
|
|
382
|
+
domain,
|
|
383
|
+
txtRecord: `${fullTxtRecord}.${(0, domainUtils_1.extractMainDomain)(domain)}`,
|
|
384
|
+
}));
|
|
385
|
+
return { success: false, needVerification: true };
|
|
386
|
+
};
|
|
387
|
+
const createOrFindDnsCnameRecord = async (domain, mainDomain, hostRecord, ossEndpoint, bucketCnameBound) => {
|
|
184
388
|
try {
|
|
185
389
|
const existingRecords = await dnsOps.describeDomainRecords(mainDomain, hostRecord);
|
|
186
390
|
const existingRecord = existingRecords.find((record) => record.rr === hostRecord && record.type === 'CNAME' && record.value === ossEndpoint);
|
|
@@ -237,18 +441,28 @@ const createOssOperations = (ossClient, region, dnsOps) => {
|
|
|
237
441
|
}));
|
|
238
442
|
}
|
|
239
443
|
};
|
|
240
|
-
const unbindCustomDomain = async (bucketName, domain, dnsRecordId) => {
|
|
444
|
+
const unbindCustomDomain = async (bucketName, domain, dnsRecordId, txtRecordId) => {
|
|
241
445
|
await removeCorsRuleForDomain(bucketName, domain);
|
|
242
446
|
await deleteBucketCname(bucketName, domain);
|
|
243
|
-
if (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
447
|
+
if (dnsOps) {
|
|
448
|
+
if (dnsRecordId && dnsRecordId !== 'existing') {
|
|
449
|
+
try {
|
|
450
|
+
await dnsOps.deleteDomainRecord(dnsRecordId);
|
|
451
|
+
logger_1.logger.info(lang_1.lang.__('OSS_DNS_CNAME_DELETED', { domain }));
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_DNS_CNAME_DELETE_FAILED', { domain, error: String(error) }));
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (txtRecordId) {
|
|
458
|
+
try {
|
|
459
|
+
await dnsOps.deleteDomainRecord(txtRecordId);
|
|
460
|
+
logger_1.logger.info(lang_1.lang.__('OSS_DNS_TXT_RECORD_DELETED', { domain }));
|
|
461
|
+
}
|
|
462
|
+
catch (error) {
|
|
463
|
+
logger_1.logger.warn(lang_1.lang.__('OSS_DNS_TXT_RECORD_DELETE_FAILED', { domain, error: String(error) }));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
252
466
|
}
|
|
253
467
|
};
|
|
254
468
|
return {
|
|
@@ -486,6 +700,7 @@ const createOssOperations = (ossClient, region, dnsOps) => {
|
|
|
486
700
|
bindCustomDomain,
|
|
487
701
|
unbindCustomDomain,
|
|
488
702
|
getOssEndpoint,
|
|
703
|
+
createCnameToken,
|
|
489
704
|
};
|
|
490
705
|
};
|
|
491
706
|
exports.createOssOperations = createOssOperations;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RAM_ROLE_PROPAGATION_DELAY_MS = exports.APIGW_DNS_PUBLIC_RESOLUTION_DELAY_MS = exports.APIGW_DNS_PUBLIC_RESOLUTION_MAX_ATTEMPTS = exports.APIGW_DOMAIN_BIND_RETRY_DELAY_MS = exports.APIGW_DOMAIN_BIND_MAX_RETRIES = exports.STALE_LOCK_THRESHOLD = exports.DEFAULT_LOCK_RETRY_DELAY = exports.DEFAULT_LOCK_TIMEOUT = exports.LOCK_FILE_SUFFIX = exports.OSS_STATE_REQUEST_TIMEOUT_MS = exports.OSS_STATE_CONNECT_TIMEOUT_MS = exports.FC3_CODE_INLINE_SIZE_LIMIT = exports.ALIYUN_FC3_READ_TIMEOUT_MS = exports.ALIYUN_FC3_CONNECT_TIMEOUT_MS = exports.SI_LOCALSTACK_SERVER_PORT = exports.SI_BOOTSTRAP_BUCKET_PREFIX = exports.SI_BOOTSTRAP_FC_PREFIX = exports.OSS_DEPLOYMENT_TIMEOUT = exports.CODE_ZIP_SIZE_LIMIT = void 0;
|
|
3
|
+
exports.RAM_ROLE_PROPAGATION_DELAY_MS = exports.APIGW_DNS_PUBLIC_RESOLUTION_DELAY_MS = exports.APIGW_DNS_PUBLIC_RESOLUTION_MAX_ATTEMPTS = exports.APIGW_DOMAIN_BIND_RETRY_DELAY_MS = exports.APIGW_DOMAIN_BIND_MAX_RETRIES = exports.DNS_PROPAGATION_DELAY_MS = exports.DNS_PROPAGATION_MAX_ATTEMPTS = exports.DOMAIN_BIND_RETRY_DELAY_MS = exports.DOMAIN_BIND_MAX_RETRIES = exports.STALE_LOCK_THRESHOLD = exports.DEFAULT_LOCK_RETRY_DELAY = exports.DEFAULT_LOCK_TIMEOUT = exports.LOCK_FILE_SUFFIX = exports.OSS_STATE_REQUEST_TIMEOUT_MS = exports.OSS_STATE_CONNECT_TIMEOUT_MS = exports.FC3_CODE_INLINE_SIZE_LIMIT = exports.ALIYUN_FC3_READ_TIMEOUT_MS = exports.ALIYUN_FC3_CONNECT_TIMEOUT_MS = exports.SI_LOCALSTACK_SERVER_PORT = exports.SI_BOOTSTRAP_BUCKET_PREFIX = exports.SI_BOOTSTRAP_FC_PREFIX = exports.OSS_DEPLOYMENT_TIMEOUT = exports.CODE_ZIP_SIZE_LIMIT = void 0;
|
|
4
4
|
exports.CODE_ZIP_SIZE_LIMIT = 300 * 1000; // 300 KB - code package size limit for inline deployment
|
|
5
5
|
exports.OSS_DEPLOYMENT_TIMEOUT = 3000; // in seconds
|
|
6
6
|
exports.SI_BOOTSTRAP_FC_PREFIX = 'si-bootstrap-api';
|
|
@@ -17,9 +17,15 @@ exports.LOCK_FILE_SUFFIX = '.si-lock';
|
|
|
17
17
|
exports.DEFAULT_LOCK_TIMEOUT = 10 * 60 * 1000; // 10 minutes
|
|
18
18
|
exports.DEFAULT_LOCK_RETRY_DELAY = 2000; // 2 seconds
|
|
19
19
|
exports.STALE_LOCK_THRESHOLD = 60 * 60 * 1000; // 1 hour
|
|
20
|
-
// API Gateway
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
20
|
+
// Shared domain binding retry configuration (used by API Gateway, OSS, and future resources)
|
|
21
|
+
exports.DOMAIN_BIND_MAX_RETRIES = 5;
|
|
22
|
+
exports.DOMAIN_BIND_RETRY_DELAY_MS = 30000; // 30 seconds
|
|
23
|
+
// Shared DNS propagation polling configuration (used by API Gateway, OSS, and future resources)
|
|
24
|
+
exports.DNS_PROPAGATION_MAX_ATTEMPTS = 10;
|
|
25
|
+
exports.DNS_PROPAGATION_DELAY_MS = 60000; // 1 minute
|
|
26
|
+
// API Gateway domain binding (aliases for shared constants)
|
|
27
|
+
exports.APIGW_DOMAIN_BIND_MAX_RETRIES = exports.DOMAIN_BIND_MAX_RETRIES;
|
|
28
|
+
exports.APIGW_DOMAIN_BIND_RETRY_DELAY_MS = exports.DOMAIN_BIND_RETRY_DELAY_MS;
|
|
23
29
|
exports.APIGW_DNS_PUBLIC_RESOLUTION_MAX_ATTEMPTS = 10;
|
|
24
30
|
exports.APIGW_DNS_PUBLIC_RESOLUTION_DELAY_MS = 30000; // 30 seconds
|
|
25
31
|
// RAM role propagation
|
package/dist/src/common/index.js
CHANGED
|
@@ -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;
|
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,6 +288,32 @@ 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}}',
|
|
279
317
|
OSS_BUCKET_CERT_BINDING: 'Binding SSL certificate to custom domain {{domain}} on bucket {{bucketName}}',
|
|
280
318
|
OSS_BUCKET_CERT_BOUND: 'SSL certificate bound to custom domain: {{domain}}',
|
|
281
319
|
OSS_CORS_RULE_ADDED: 'Added CORS rule for custom domain: {{domain}}',
|
|
@@ -468,4 +506,9 @@ exports.en = {
|
|
|
468
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.',
|
|
469
507
|
// Protocol messages
|
|
470
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',
|
|
471
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,6 +287,32 @@ 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}}',
|
|
278
316
|
OSS_BUCKET_CERT_BINDING: '正在为存储桶 {{bucketName}} 的自定义域名 {{domain}} 绑定 SSL 证书',
|
|
279
317
|
OSS_BUCKET_CERT_BOUND: '已为自定义域名绑定 SSL 证书: {{domain}}',
|
|
280
318
|
OSS_CORS_RULE_ADDED: '已为自定义域名添加 CORS 规则: {{domain}}',
|
|
@@ -464,4 +502,9 @@ exports.zhCN = {
|
|
|
464
502
|
TENCENT_CERT_REFERENCE_NOT_SUPPORTED: '证书 "{{name}}" 使用了 certificate_id 引用模式,腾讯云暂不支持该模式。请改用 certificate_body 和 private_key。',
|
|
465
503
|
// 协议消息
|
|
466
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}} 意外失败',
|
|
467
510
|
};
|
|
@@ -167,6 +167,7 @@ const createBucketResource = async (context, bucket, state) => {
|
|
|
167
167
|
domain: bucket.website.domain,
|
|
168
168
|
cname: cnameInfo.cname,
|
|
169
169
|
...(cnameInfo.dnsRecordId ? { dnsRecordId: cnameInfo.dnsRecordId } : {}),
|
|
170
|
+
...(cnameInfo.txtRecordId ? { txtRecordId: cnameInfo.txtRecordId } : {}),
|
|
170
171
|
};
|
|
171
172
|
instances.push(dnsInstance);
|
|
172
173
|
// Refresh bucket info to capture auto-added CORS rule
|
|
@@ -233,7 +234,7 @@ const updateBucketResource = async (context, bucket, state) => {
|
|
|
233
234
|
if (bucket.website?.domain) {
|
|
234
235
|
const domainChanged = existingDnsInstance?.domain !== bucket.website.domain;
|
|
235
236
|
if (domainChanged && existingDnsInstance) {
|
|
236
|
-
await client.oss.unbindCustomDomain(config.bucketName, existingDnsInstance.domain, existingDnsInstance.dnsRecordId);
|
|
237
|
+
await client.oss.unbindCustomDomain(config.bucketName, existingDnsInstance.domain, existingDnsInstance.dnsRecordId, existingDnsInstance.txtRecordId);
|
|
237
238
|
}
|
|
238
239
|
const certificate = bucket.website.domain_certificate
|
|
239
240
|
? await resolveBucketDomainCertificate(bucket.website.domain_certificate, context, client)
|
|
@@ -258,6 +259,7 @@ const updateBucketResource = async (context, bucket, state) => {
|
|
|
258
259
|
domain: bucket.website.domain,
|
|
259
260
|
cname: cnameInfo.cname,
|
|
260
261
|
...(cnameInfo.dnsRecordId ? { dnsRecordId: cnameInfo.dnsRecordId } : {}),
|
|
262
|
+
...(cnameInfo.txtRecordId ? { txtRecordId: cnameInfo.txtRecordId } : {}),
|
|
261
263
|
};
|
|
262
264
|
instances.push(dnsInstance);
|
|
263
265
|
// Refresh bucket info to capture auto-added CORS rule
|
|
@@ -268,7 +270,7 @@ const updateBucketResource = async (context, bucket, state) => {
|
|
|
268
270
|
}
|
|
269
271
|
}
|
|
270
272
|
else if (existingDnsInstance) {
|
|
271
|
-
await client.oss.unbindCustomDomain(config.bucketName, existingDnsInstance.domain, existingDnsInstance.dnsRecordId);
|
|
273
|
+
await client.oss.unbindCustomDomain(config.bucketName, existingDnsInstance.domain, existingDnsInstance.dnsRecordId, existingDnsInstance.txtRecordId);
|
|
272
274
|
}
|
|
273
275
|
const resourceState = {
|
|
274
276
|
mode: 'managed',
|
|
@@ -285,7 +287,7 @@ const deleteBucketResource = async (context, bucketName, logicalId, state) => {
|
|
|
285
287
|
const existingState = state.resources[logicalId];
|
|
286
288
|
const dnsInstance = existingState?.instances?.find((i) => i.type === types_1.ResourceTypeEnum.ALIYUN_OSS_DNS_CNAME);
|
|
287
289
|
if (dnsInstance) {
|
|
288
|
-
await client.oss.unbindCustomDomain(bucketName, dnsInstance.domain, dnsInstance.dnsRecordId);
|
|
290
|
+
await client.oss.unbindCustomDomain(bucketName, dnsInstance.domain, dnsInstance.dnsRecordId, dnsInstance.txtRecordId);
|
|
289
291
|
}
|
|
290
292
|
try {
|
|
291
293
|
await client.oss.deleteBucket(bucketName);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.displayPlan = exports.generateTencentPlan = void 0;
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
|
+
Object.defineProperty(exports, "displayPlan", { enumerable: true, get: function () { return common_1.displayPlan; } });
|
|
5
6
|
const lang_1 = require("../../lang");
|
|
6
7
|
const scfPlanner_1 = require("./scfPlanner");
|
|
7
8
|
const cosPlanner_1 = require("./cosPlanner");
|
|
@@ -32,60 +33,3 @@ const generateTencentPlan = async (iac, backend) => {
|
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
exports.generateTencentPlan = generateTencentPlan;
|
|
35
|
-
const displayPlan = (planResult) => {
|
|
36
|
-
const separator = '========================================';
|
|
37
|
-
if (planResult.items.length === 0) {
|
|
38
|
-
common_1.logger.info(`${separator}\n${lang_1.lang.__('DEPLOYMENT_PLAN')}\n${separator}\n${lang_1.lang.__('NO_CHANGES_INFRASTRUCTURE_UP_TO_DATE')}`);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const createActions = planResult.items.filter((item) => item.action === 'create');
|
|
42
|
-
const updateActions = planResult.items.filter((item) => item.action === 'update');
|
|
43
|
-
const deleteActions = planResult.items.filter((item) => item.action === 'delete');
|
|
44
|
-
const noopActions = planResult.items.filter((item) => item.action === 'noop');
|
|
45
|
-
const sections = [];
|
|
46
|
-
if (createActions.length > 0) {
|
|
47
|
-
const createLines = [`[${lang_1.lang.__('CREATE')}]:`];
|
|
48
|
-
for (const item of createActions) {
|
|
49
|
-
createLines.push(` + ${item.logicalId} (${item.resourceType})`);
|
|
50
|
-
if (item.changes?.after) {
|
|
51
|
-
const jsonStr = JSON.stringify(item.changes.after, null, 2);
|
|
52
|
-
createLines.push(` ${jsonStr.split('\n').join('\n ')}`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
sections.push(createLines.join('\n'));
|
|
56
|
-
}
|
|
57
|
-
if (updateActions.length > 0) {
|
|
58
|
-
const updateLines = [`[${lang_1.lang.__('UPDATE')}]:`];
|
|
59
|
-
for (const item of updateActions) {
|
|
60
|
-
updateLines.push(` ~ ${item.logicalId} (${item.resourceType})`);
|
|
61
|
-
if (item.drifted) {
|
|
62
|
-
updateLines.push(` [${lang_1.lang.__('DRIFTED')}] ${lang_1.lang.__('REMOTE_CONFIG_DIFFERS')}`);
|
|
63
|
-
}
|
|
64
|
-
if (item.changes) {
|
|
65
|
-
const jsonStr = JSON.stringify(item.changes, null, 2);
|
|
66
|
-
updateLines.push(` ${lang_1.lang.__('CHANGES')}: ${jsonStr.split('\n').join('\n ')}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
sections.push(updateLines.join('\n'));
|
|
70
|
-
}
|
|
71
|
-
if (deleteActions.length > 0) {
|
|
72
|
-
const deleteLines = [`[${lang_1.lang.__('DELETE')}]:`];
|
|
73
|
-
for (const item of deleteActions) {
|
|
74
|
-
deleteLines.push(` - ${item.logicalId} (${item.resourceType})`);
|
|
75
|
-
if (item.changes?.before) {
|
|
76
|
-
const jsonStr = JSON.stringify(item.changes.before, null, 2);
|
|
77
|
-
deleteLines.push(` ${jsonStr.split('\n').join('\n ')}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
sections.push(deleteLines.join('\n'));
|
|
81
|
-
}
|
|
82
|
-
if (noopActions.length > 0) {
|
|
83
|
-
const noopLines = [`[${lang_1.lang.__('NO_CHANGE')}]:`];
|
|
84
|
-
for (const item of noopActions) {
|
|
85
|
-
noopLines.push(` = ${item.logicalId} (${item.resourceType})`);
|
|
86
|
-
}
|
|
87
|
-
sections.push(noopLines.join('\n'));
|
|
88
|
-
}
|
|
89
|
-
common_1.logger.info(`\n${separator}\n${lang_1.lang.__('DEPLOYMENT_PLAN')}\n${separator}\n${sections.join('\n\n')}\n\n${separator}\n${lang_1.lang.__('PLAN')}: ${createActions.length} ${lang_1.lang.__('TO_CREATE')}, ${updateActions.length} ${lang_1.lang.__('TO_UPDATE')}, ${deleteActions.length} ${lang_1.lang.__('TO_DELETE')}, ${noopActions.length} ${lang_1.lang.__('UNCHANGED')}\n${separator}`);
|
|
90
|
-
};
|
|
91
|
-
exports.displayPlan = displayPlan;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/show.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/certificateResolver.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/domainUtils.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/sidUtils.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/casOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/lockUtils.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/remoteStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/dnspodOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/sslOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/certificateParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/certificate.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/certificateSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/forceUnlock.ts","../src/commands/index.ts","../src/commands/local.ts","../src/commands/plan.ts","../src/commands/show.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/certificateResolver.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/credentials.ts","../src/common/domainUtils.ts","../src/common/fileUtils.ts","../src/common/getVersion.ts","../src/common/hashUtils.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/lockManager.ts","../src/common/logger.ts","../src/common/planFormatter.ts","../src/common/providerEnum.ts","../src/common/requestHelper.ts","../src/common/retryUtils.ts","../src/common/runtimeMapper.ts","../src/common/scfClient.ts","../src/common/sidUtils.ts","../src/common/stateManager.ts","../src/common/aliyunClient/apigwOperations.ts","../src/common/aliyunClient/casOperations.ts","../src/common/aliyunClient/dnsOperations.ts","../src/common/aliyunClient/ecsOperations.ts","../src/common/aliyunClient/esOperations.ts","../src/common/aliyunClient/fc3Operations.ts","../src/common/aliyunClient/index.ts","../src/common/aliyunClient/nasOperations.ts","../src/common/aliyunClient/ossOperations.ts","../src/common/aliyunClient/ramOperations.ts","../src/common/aliyunClient/rdsOperations.ts","../src/common/aliyunClient/slsOperations.ts","../src/common/aliyunClient/tablestoreOperations.ts","../src/common/aliyunClient/types.ts","../src/common/dependencyGraph/graph.ts","../src/common/dependencyGraph/index.ts","../src/common/dependencyGraph/types.ts","../src/common/stateBackend/cosStateBackend.ts","../src/common/stateBackend/index.ts","../src/common/stateBackend/localStateBackend.ts","../src/common/stateBackend/lockUtils.ts","../src/common/stateBackend/ossStateBackend.ts","../src/common/stateBackend/remoteStateBackend.ts","../src/common/stateBackend/types.ts","../src/common/tencentClient/cosOperations.ts","../src/common/tencentClient/dnspodOperations.ts","../src/common/tencentClient/esOperations.ts","../src/common/tencentClient/index.ts","../src/common/tencentClient/scfOperations.ts","../src/common/tencentClient/sslOperations.ts","../src/common/tencentClient/tdsqlcOperations.ts","../src/common/tencentClient/types.ts","../src/lang/en.ts","../src/lang/index.ts","../src/lang/zh-CN.ts","../src/parser/bucketParser.ts","../src/parser/certificateParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/parseUtils.ts","../src/parser/tableParser.ts","../src/parser/tagParser.ts","../src/stack/bucketTypes.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/aliyunStack/apigwExecutor.ts","../src/stack/aliyunStack/apigwPlanner.ts","../src/stack/aliyunStack/apigwResource.ts","../src/stack/aliyunStack/apigwTypes.ts","../src/stack/aliyunStack/databaseExecutor.ts","../src/stack/aliyunStack/databasePlanner.ts","../src/stack/aliyunStack/databaseResource.ts","../src/stack/aliyunStack/deployer.ts","../src/stack/aliyunStack/destroyer.ts","../src/stack/aliyunStack/esServerlessTypes.ts","../src/stack/aliyunStack/fc3Executor.ts","../src/stack/aliyunStack/fc3Planner.ts","../src/stack/aliyunStack/fc3Resource.ts","../src/stack/aliyunStack/fc3Types.ts","../src/stack/aliyunStack/index.ts","../src/stack/aliyunStack/ossExecutor.ts","../src/stack/aliyunStack/ossPlanner.ts","../src/stack/aliyunStack/ossResource.ts","../src/stack/aliyunStack/ossTypes.ts","../src/stack/aliyunStack/planner.ts","../src/stack/aliyunStack/rdsTypes.ts","../src/stack/aliyunStack/tablestoreExecutor.ts","../src/stack/aliyunStack/tablestorePlanner.ts","../src/stack/aliyunStack/tablestoreResource.ts","../src/stack/aliyunStack/tablestoreTypes.ts","../src/stack/localStack/aliyunFc.ts","../src/stack/localStack/bucket.ts","../src/stack/localStack/event.ts","../src/stack/localStack/function.ts","../src/stack/localStack/functionRunner.ts","../src/stack/localStack/index.ts","../src/stack/localStack/localServer.ts","../src/stack/localStack/utils.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/scfStack/cosExecutor.ts","../src/stack/scfStack/cosPlanner.ts","../src/stack/scfStack/cosResource.ts","../src/stack/scfStack/cosTypes.ts","../src/stack/scfStack/deployer.ts","../src/stack/scfStack/destroyer.ts","../src/stack/scfStack/esServerlessExecutor.ts","../src/stack/scfStack/esServerlessPlanner.ts","../src/stack/scfStack/esServerlessResource.ts","../src/stack/scfStack/esServerlessTypes.ts","../src/stack/scfStack/index.ts","../src/stack/scfStack/planner.ts","../src/stack/scfStack/scfExecutor.ts","../src/stack/scfStack/scfPlanner.ts","../src/stack/scfStack/scfResource.ts","../src/stack/scfStack/scfTypes.ts","../src/stack/scfStack/tdsqlcExecutor.ts","../src/stack/scfStack/tdsqlcPlanner.ts","../src/stack/scfStack/tdsqlcResource.ts","../src/stack/scfStack/tdsqlcTypes.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/tablestore.d.ts","../src/types/domains/backend.ts","../src/types/domains/bucket.ts","../src/types/domains/certificate.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/lock.ts","../src/types/domains/provider.ts","../src/types/domains/resolvable.ts","../src/types/domains/state.ts","../src/types/domains/table.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/types/localStack/index.ts","../src/validator/bucketSchema.ts","../src/validator/certificateSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts","../src/validator/tableschema.ts","../src/validator/templateRefSchema.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|