@geek-fun/serverlessinsight 0.9.2 → 0.9.4
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/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
- package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
- package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +4 -8
- package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -8
- package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +4 -4
- package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
- package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +28 -5
- package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +2 -2
- package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +3 -3
- package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +20 -5
- package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
- package/AGENTS.md +10 -0
- package/CHANGELOG.md +62 -0
- package/README.md +256 -175
- package/README.zh-CN.md +249 -159
- package/dist/package.json +22 -19
- package/dist/src/commands/index.js +21 -52
- package/dist/src/commands/local.js +16 -3
- package/dist/src/commands/plan.js +35 -4
- package/dist/src/common/aliyunClient/apigwOperations.js +48 -9
- package/dist/src/common/aliyunClient/fc3Operations.js +7 -1
- package/dist/src/common/aliyunClient/ossOperations.js +214 -221
- package/dist/src/common/bucketPolicy.js +63 -0
- package/dist/src/common/domainUtils.js +4 -1
- package/dist/src/common/functionDefinition.js +25 -0
- package/dist/src/common/index.js +4 -0
- package/dist/src/common/jsonOutput.js +6 -1
- package/dist/src/common/nameBuilder.js +3 -1
- package/dist/src/common/planCapabilities.js +119 -0
- package/dist/src/common/planCompare.js +119 -66
- package/dist/src/common/planFormatter.js +22 -14
- package/dist/src/common/planRedaction.js +26 -0
- package/dist/src/common/refreshPlanner.js +66 -21
- package/dist/src/common/tencentClient/cosOperations.js +326 -322
- package/dist/src/common/tencentClient/scfOperations.js +9 -2
- package/dist/src/common/tencentClient/tdsqlcOperations.js +6 -11
- package/dist/src/common/triggerMapper.js +16 -1
- package/dist/src/common/volcengineClient/apigwOperations.js +82 -0
- package/dist/src/common/volcengineClient/iamOperations.js +27 -3
- package/dist/src/common/volcengineClient/tosOperations.js +62 -56
- package/dist/src/lang/en.js +33 -8
- package/dist/src/lang/index.js +28 -14
- package/dist/src/lang/zh-CN.js +33 -8
- package/dist/src/parser/eventParser.js +1 -0
- package/dist/src/parser/functionParser.js +1 -1
- package/dist/src/stack/aliyunStack/apigwDomainPlan.js +82 -0
- package/dist/src/stack/aliyunStack/apigwExecutor.js +4 -1
- package/dist/src/stack/aliyunStack/apigwPlanner.js +165 -25
- package/dist/src/stack/aliyunStack/apigwResource.js +172 -126
- package/dist/src/stack/aliyunStack/apigwTypes.js +3 -7
- package/dist/src/stack/aliyunStack/deployer.js +2 -0
- package/dist/src/stack/aliyunStack/esServerlessTypes.js +8 -4
- package/dist/src/stack/aliyunStack/fc3Executor.js +7 -3
- package/dist/src/stack/aliyunStack/fc3Planner.js +124 -155
- package/dist/src/stack/aliyunStack/fc3Resource.js +48 -52
- package/dist/src/stack/aliyunStack/fc3Types.js +30 -16
- package/dist/src/stack/aliyunStack/ossPlanner.js +15 -1
- package/dist/src/stack/aliyunStack/ossResource.js +113 -102
- package/dist/src/stack/aliyunStack/ossTypes.js +20 -20
- package/dist/src/stack/localStack/aliyunFc.js +1 -6
- package/dist/src/stack/localStack/event.js +31 -60
- package/dist/src/stack/localStack/function.js +24 -65
- package/dist/src/stack/localStack/functionRunner.js +10 -2
- package/dist/src/stack/localStack/httpAdapter.js +54 -0
- package/dist/src/stack/localStack/httpError.js +5 -0
- package/dist/src/stack/localStack/legacyLambda.js +26 -0
- package/dist/src/stack/localStack/localContext.js +29 -0
- package/dist/src/stack/localStack/localRoute.js +12 -0
- package/dist/src/stack/localStack/localRuntimes.js +22 -0
- package/dist/src/stack/localStack/localServer.js +8 -3
- package/dist/src/stack/localStack/requestBody.js +24 -0
- package/dist/src/stack/localStack/requestId.js +18 -0
- package/dist/src/stack/localStack/tencent.js +147 -0
- package/dist/src/stack/localStack/timer.js +23 -2
- package/dist/src/stack/localStack/volcengine.js +68 -0
- package/dist/src/stack/scfStack/cosPlanner.js +9 -14
- package/dist/src/stack/scfStack/cosResource.js +42 -50
- package/dist/src/stack/scfStack/cosTypes.js +19 -14
- package/dist/src/stack/scfStack/deployer.js +2 -0
- package/dist/src/stack/scfStack/scfExecutor.js +7 -3
- package/dist/src/stack/scfStack/scfHttpTrigger.js +106 -0
- package/dist/src/stack/scfStack/scfPlanner.js +67 -16
- package/dist/src/stack/scfStack/scfResource.js +170 -321
- package/dist/src/stack/scfStack/scfTypes.js +4 -3
- package/dist/src/stack/scfStack/tdsqlcPlanner.js +10 -13
- package/dist/src/stack/volcengineStack/apigwDomains.js +64 -0
- package/dist/src/stack/volcengineStack/apigwPlanner.js +71 -15
- package/dist/src/stack/volcengineStack/apigwResource.js +60 -24
- package/dist/src/stack/volcengineStack/apigwTypes.js +5 -1
- package/dist/src/stack/volcengineStack/deployer.js +6 -0
- package/dist/src/stack/volcengineStack/tosPlanner.js +8 -13
- package/dist/src/stack/volcengineStack/tosResource.js +22 -35
- package/dist/src/stack/volcengineStack/tosTypes.js +5 -8
- package/dist/src/stack/volcengineStack/vefaasPlanner.js +142 -49
- package/dist/src/stack/volcengineStack/vefaasResource.js +17 -12
- package/dist/src/stack/volcengineStack/vefaasTypes.js +6 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -19
- package/release-notes.md +53 -0
- package/samples/README_TENCENT_COS.md +3 -3
- package/samples/README_TENCENT_SCF.md +3 -3
- package/samples/tencent-local/index.js +13 -0
- package/samples/tencent-local/serverlessinsight.yml +23 -0
- package/samples/volcengine-local/index.js +13 -0
- package/samples/volcengine-local/serverlessinsight.yml +28 -0
package/release-notes.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
### 🔧 Changed
|
|
3
|
+
|
|
4
|
+
- CLI help, README examples, command references and sample guides now promote
|
|
5
|
+
`si diff` as the only planning command.
|
|
6
|
+
|
|
7
|
+
### 🗑 Removed
|
|
8
|
+
|
|
9
|
+
- **Breaking:** `si plan` has been removed; `si diff` is now the sole CLI
|
|
10
|
+
command for previewing deployment changes
|
|
11
|
+
([#271](https://github.com/geek-fun/serverlessinsight/issues/271)). Invoking
|
|
12
|
+
`si plan` fails fast with a localized error directing to `si diff` before any
|
|
13
|
+
cloud or state access. Migrate by replacing the command verb — `si diff`
|
|
14
|
+
accepts the same options and arguments, exit codes (`0` no changes / `2`
|
|
15
|
+
changes / `1` errors) and `--json` envelope (`planVersion: 1`) as the removed
|
|
16
|
+
command.
|
|
17
|
+
|
|
18
|
+
### 🐛 Fixed
|
|
19
|
+
|
|
20
|
+
- Aliyun API Gateway plans now report each custom domain's binding and
|
|
21
|
+
certificate fingerprint, and rewrite only the dimensions that changed.
|
|
22
|
+
- Certificate-only and redirect updates skip DNS verification, and removing a
|
|
23
|
+
domain deletes only the bindings and DNS records si owns, leaving foreign
|
|
24
|
+
records intact.
|
|
25
|
+
- CLI language detection now honors `SI_LANG`, normalizes `LC_ALL`/`LANG`, and
|
|
26
|
+
no longer prints `chcp` errors on Linux and macOS.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<details>
|
|
31
|
+
<summary>📋 Full commit history</summary>
|
|
32
|
+
|
|
33
|
+
_Changes from v0.9.3 to v0.9.4_
|
|
34
|
+
|
|
35
|
+
- ed3964a release: v0.9.4 (blankll, 18 minutes ago)
|
|
36
|
+
- b7c9062 chore(metadata): restore npm keyword aliases (blankll, 25 minutes ago)
|
|
37
|
+
- 5236bfe docs: optimize READMEs and sync GitHub About metadata (blankll, 36 minutes ago)
|
|
38
|
+
- 9103c99 fix(cli): preserve unknown-command suggestions after plan removal (#271) (blankll, 9 hours ago)
|
|
39
|
+
- 6980d77 fix(lang): make PLAN_COMMAND_NOT_SUPPORTED wording command-neutral (#271) (blankll, 10 hours ago)
|
|
40
|
+
- 73ebe6f feat(cli)!: remove si plan in favor of si diff (#271) (blankll, 10 hours ago)
|
|
41
|
+
- 9ecdb8b feat(cli): deprecate si plan in favor of si diff (#271) (blankll, 11 hours ago)
|
|
42
|
+
- ef0bcc4 test(aliyun): cover gateway diff and repair edge cases (blankll, 26 hours ago)
|
|
43
|
+
- 5e69d08 fix(aliyun): reconcile gateway domain diffs and targeted repairs (blankll, 2 days ago)
|
|
44
|
+
- 1a6aaa8 fix(lang): robust locale detection with SI_LANG override, locale normalization and win32-only chcp (blankll, 2 days ago)
|
|
45
|
+
- 95de73e docs(brand): regenerate brand.jpg at 16:9 from source image (blankll, 2 days ago)
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 📦 Install
|
|
52
|
+
|
|
53
|
+
`npm install -g @geek-fun/serverlessinsight@0.9.4`
|
|
@@ -76,7 +76,7 @@ Common Tencent Cloud regions:
|
|
|
76
76
|
Preview changes before deployment:
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
si
|
|
79
|
+
si diff \
|
|
80
80
|
-f serverless-insight.yml \
|
|
81
81
|
-r ap-guangzhou \
|
|
82
82
|
-k YOUR_SECRET_ID \
|
|
@@ -241,10 +241,10 @@ si deploy my-stack -f serverless-insight.yml
|
|
|
241
241
|
|
|
242
242
|
## Drift Detection
|
|
243
243
|
|
|
244
|
-
If someone modifies the bucket in Tencent Cloud Console, the
|
|
244
|
+
If someone modifies the bucket in Tencent Cloud Console, the diff command will detect the drift:
|
|
245
245
|
|
|
246
246
|
```bash
|
|
247
|
-
si
|
|
247
|
+
si diff -f serverless-insight.yml
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
Output will show:
|
|
@@ -69,7 +69,7 @@ functions:
|
|
|
69
69
|
Preview changes before deployment:
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
|
-
si
|
|
72
|
+
si diff \
|
|
73
73
|
-f serverless-insight.yml \
|
|
74
74
|
-r ap-guangzhou \
|
|
75
75
|
-k YOUR_SECRET_ID \
|
|
@@ -145,10 +145,10 @@ si deploy my-stack -f serverless-insight.yml
|
|
|
145
145
|
|
|
146
146
|
## Drift Detection
|
|
147
147
|
|
|
148
|
-
If someone modifies the function in Tencent Cloud Console, the
|
|
148
|
+
If someone modifies the function in Tencent Cloud Console, the diff command will detect the drift:
|
|
149
149
|
|
|
150
150
|
```bash
|
|
151
|
-
si
|
|
151
|
+
si diff -f serverless-insight.yml
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
Output will show:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
exports.handler = async (event, context) => ({
|
|
2
|
+
statusCode: 201,
|
|
3
|
+
headers: { 'Content-Type': 'application/json', 'X-Local-Example': 'scf' },
|
|
4
|
+
body: JSON.stringify({
|
|
5
|
+
message: process.env.GREETING,
|
|
6
|
+
stage: process.env.STAGE,
|
|
7
|
+
requestId: context.request_id,
|
|
8
|
+
method: event.httpMethod,
|
|
9
|
+
path: event.path,
|
|
10
|
+
query: event.queryString,
|
|
11
|
+
body: event.body,
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 0.1.0
|
|
2
|
+
app: local-example
|
|
3
|
+
service: scf-http
|
|
4
|
+
provider:
|
|
5
|
+
name: tencent
|
|
6
|
+
region: ap-guangzhou
|
|
7
|
+
stages:
|
|
8
|
+
local:
|
|
9
|
+
greeting: Hello from local SCF
|
|
10
|
+
functions:
|
|
11
|
+
echo:
|
|
12
|
+
name: local-scf-echo
|
|
13
|
+
code:
|
|
14
|
+
runtime: nodejs18
|
|
15
|
+
handler: index.handler
|
|
16
|
+
path: .
|
|
17
|
+
timeout: 3
|
|
18
|
+
triggers:
|
|
19
|
+
http:
|
|
20
|
+
auth_type: public
|
|
21
|
+
environment:
|
|
22
|
+
GREETING: ${stages.greeting}
|
|
23
|
+
STAGE: ${ctx.stage}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
exports.handler = async (event, context) => ({
|
|
2
|
+
statusCode: 201,
|
|
3
|
+
headers: { 'Content-Type': 'application/json', 'X-Local-Example': 'vefaas' },
|
|
4
|
+
body: JSON.stringify({
|
|
5
|
+
message: process.env.GREETING,
|
|
6
|
+
stage: process.env.STAGE,
|
|
7
|
+
requestId: context.requestId,
|
|
8
|
+
method: event.httpMethod,
|
|
9
|
+
path: event.path,
|
|
10
|
+
query: event.queryStringParameters,
|
|
11
|
+
body: event.body,
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: 0.1.0
|
|
2
|
+
app: local-example
|
|
3
|
+
service: vefaas-http
|
|
4
|
+
provider:
|
|
5
|
+
name: volcengine
|
|
6
|
+
region: cn-beijing
|
|
7
|
+
stages:
|
|
8
|
+
local:
|
|
9
|
+
greeting: Hello from local veFaaS
|
|
10
|
+
functions:
|
|
11
|
+
echo:
|
|
12
|
+
name: local-vefaas-echo
|
|
13
|
+
code:
|
|
14
|
+
runtime: node20/v1
|
|
15
|
+
handler: index.handler
|
|
16
|
+
path: .
|
|
17
|
+
timeout: 3
|
|
18
|
+
environment:
|
|
19
|
+
GREETING: ${stages.greeting}
|
|
20
|
+
STAGE: ${ctx.stage}
|
|
21
|
+
events:
|
|
22
|
+
api:
|
|
23
|
+
type: API_GATEWAY
|
|
24
|
+
name: local-vefaas-api
|
|
25
|
+
triggers:
|
|
26
|
+
- method: ANY
|
|
27
|
+
path: /echo
|
|
28
|
+
backend: ${functions.echo}
|