@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.
Files changed (105) hide show
  1. package/.serverlessinsight/state-cdn-flow-app-cdn-flow-service.json.backup +1 -1
  2. package/.serverlessinsight/state-iam-test-app-iam-test-service.json.backup +2 -2
  3. package/.serverlessinsight/state-insight-poc-app-insight-poc-tencent.json.backup +4 -8
  4. package/.serverlessinsight/state-insight-poc-app-log-insight-poc-tencent-log.json.backup +3 -8
  5. package/.serverlessinsight/state-insight-poc-deploy-app-insight-poc-deploy.json.backup +4 -4
  6. package/.serverlessinsight/state-insight-poc-destroy-app-insight-poc-destroy.json.backup +1 -1
  7. package/.serverlessinsight/state-insight-poc-timer-app-insight-poc-timer.json.backup +28 -5
  8. package/.serverlessinsight/state-insight-volc-app-insight-volc.json.backup +2 -2
  9. package/.serverlessinsight/state-insight-volc-nested-app-insight-volc-nested.json.backup +3 -3
  10. package/.serverlessinsight/state-nested-drift-app-nested-drift-service.json.backup +20 -5
  11. package/.serverlessinsight/state-role-reconcile-test-app-role-reconcile-test-service.json.backup +3 -3
  12. package/AGENTS.md +10 -0
  13. package/CHANGELOG.md +62 -0
  14. package/README.md +256 -175
  15. package/README.zh-CN.md +249 -159
  16. package/dist/package.json +22 -19
  17. package/dist/src/commands/index.js +21 -52
  18. package/dist/src/commands/local.js +16 -3
  19. package/dist/src/commands/plan.js +35 -4
  20. package/dist/src/common/aliyunClient/apigwOperations.js +48 -9
  21. package/dist/src/common/aliyunClient/fc3Operations.js +7 -1
  22. package/dist/src/common/aliyunClient/ossOperations.js +214 -221
  23. package/dist/src/common/bucketPolicy.js +63 -0
  24. package/dist/src/common/domainUtils.js +4 -1
  25. package/dist/src/common/functionDefinition.js +25 -0
  26. package/dist/src/common/index.js +4 -0
  27. package/dist/src/common/jsonOutput.js +6 -1
  28. package/dist/src/common/nameBuilder.js +3 -1
  29. package/dist/src/common/planCapabilities.js +119 -0
  30. package/dist/src/common/planCompare.js +119 -66
  31. package/dist/src/common/planFormatter.js +22 -14
  32. package/dist/src/common/planRedaction.js +26 -0
  33. package/dist/src/common/refreshPlanner.js +66 -21
  34. package/dist/src/common/tencentClient/cosOperations.js +326 -322
  35. package/dist/src/common/tencentClient/scfOperations.js +9 -2
  36. package/dist/src/common/tencentClient/tdsqlcOperations.js +6 -11
  37. package/dist/src/common/triggerMapper.js +16 -1
  38. package/dist/src/common/volcengineClient/apigwOperations.js +82 -0
  39. package/dist/src/common/volcengineClient/iamOperations.js +27 -3
  40. package/dist/src/common/volcengineClient/tosOperations.js +62 -56
  41. package/dist/src/lang/en.js +33 -8
  42. package/dist/src/lang/index.js +28 -14
  43. package/dist/src/lang/zh-CN.js +33 -8
  44. package/dist/src/parser/eventParser.js +1 -0
  45. package/dist/src/parser/functionParser.js +1 -1
  46. package/dist/src/stack/aliyunStack/apigwDomainPlan.js +82 -0
  47. package/dist/src/stack/aliyunStack/apigwExecutor.js +4 -1
  48. package/dist/src/stack/aliyunStack/apigwPlanner.js +165 -25
  49. package/dist/src/stack/aliyunStack/apigwResource.js +172 -126
  50. package/dist/src/stack/aliyunStack/apigwTypes.js +3 -7
  51. package/dist/src/stack/aliyunStack/deployer.js +2 -0
  52. package/dist/src/stack/aliyunStack/esServerlessTypes.js +8 -4
  53. package/dist/src/stack/aliyunStack/fc3Executor.js +7 -3
  54. package/dist/src/stack/aliyunStack/fc3Planner.js +124 -155
  55. package/dist/src/stack/aliyunStack/fc3Resource.js +48 -52
  56. package/dist/src/stack/aliyunStack/fc3Types.js +30 -16
  57. package/dist/src/stack/aliyunStack/ossPlanner.js +15 -1
  58. package/dist/src/stack/aliyunStack/ossResource.js +113 -102
  59. package/dist/src/stack/aliyunStack/ossTypes.js +20 -20
  60. package/dist/src/stack/localStack/aliyunFc.js +1 -6
  61. package/dist/src/stack/localStack/event.js +31 -60
  62. package/dist/src/stack/localStack/function.js +24 -65
  63. package/dist/src/stack/localStack/functionRunner.js +10 -2
  64. package/dist/src/stack/localStack/httpAdapter.js +54 -0
  65. package/dist/src/stack/localStack/httpError.js +5 -0
  66. package/dist/src/stack/localStack/legacyLambda.js +26 -0
  67. package/dist/src/stack/localStack/localContext.js +29 -0
  68. package/dist/src/stack/localStack/localRoute.js +12 -0
  69. package/dist/src/stack/localStack/localRuntimes.js +22 -0
  70. package/dist/src/stack/localStack/localServer.js +8 -3
  71. package/dist/src/stack/localStack/requestBody.js +24 -0
  72. package/dist/src/stack/localStack/requestId.js +18 -0
  73. package/dist/src/stack/localStack/tencent.js +147 -0
  74. package/dist/src/stack/localStack/timer.js +23 -2
  75. package/dist/src/stack/localStack/volcengine.js +68 -0
  76. package/dist/src/stack/scfStack/cosPlanner.js +9 -14
  77. package/dist/src/stack/scfStack/cosResource.js +42 -50
  78. package/dist/src/stack/scfStack/cosTypes.js +19 -14
  79. package/dist/src/stack/scfStack/deployer.js +2 -0
  80. package/dist/src/stack/scfStack/scfExecutor.js +7 -3
  81. package/dist/src/stack/scfStack/scfHttpTrigger.js +106 -0
  82. package/dist/src/stack/scfStack/scfPlanner.js +67 -16
  83. package/dist/src/stack/scfStack/scfResource.js +170 -321
  84. package/dist/src/stack/scfStack/scfTypes.js +4 -3
  85. package/dist/src/stack/scfStack/tdsqlcPlanner.js +10 -13
  86. package/dist/src/stack/volcengineStack/apigwDomains.js +64 -0
  87. package/dist/src/stack/volcengineStack/apigwPlanner.js +71 -15
  88. package/dist/src/stack/volcengineStack/apigwResource.js +60 -24
  89. package/dist/src/stack/volcengineStack/apigwTypes.js +5 -1
  90. package/dist/src/stack/volcengineStack/deployer.js +6 -0
  91. package/dist/src/stack/volcengineStack/tosPlanner.js +8 -13
  92. package/dist/src/stack/volcengineStack/tosResource.js +22 -35
  93. package/dist/src/stack/volcengineStack/tosTypes.js +5 -8
  94. package/dist/src/stack/volcengineStack/vefaasPlanner.js +142 -49
  95. package/dist/src/stack/volcengineStack/vefaasResource.js +17 -12
  96. package/dist/src/stack/volcengineStack/vefaasTypes.js +6 -3
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/package.json +22 -19
  99. package/release-notes.md +53 -0
  100. package/samples/README_TENCENT_COS.md +3 -3
  101. package/samples/README_TENCENT_SCF.md +3 -3
  102. package/samples/tencent-local/index.js +13 -0
  103. package/samples/tencent-local/serverlessinsight.yml +23 -0
  104. package/samples/volcengine-local/index.js +13 -0
  105. package/samples/volcengine-local/serverlessinsight.yml +28 -0
@@ -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 plan my-stack \
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 plan command will detect the drift:
244
+ If someone modifies the bucket in Tencent Cloud Console, the diff command will detect the drift:
245
245
 
246
246
  ```bash
247
- si plan my-stack -f serverless-insight.yml
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 plan my-stack \
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 plan command will detect the drift:
148
+ If someone modifies the function in Tencent Cloud Console, the diff command will detect the drift:
149
149
 
150
150
  ```bash
151
- si plan my-stack -f serverless-insight.yml
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}