@geek-fun/serverlessinsight 0.9.6 → 0.9.8
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/AGENTS.md +1 -0
- package/CHANGELOG.md +68 -0
- package/README.md +52 -11
- package/README.zh-CN.md +44 -10
- package/dist/package.json +2 -1
- package/dist/src/commands/deploy.js +3 -1
- package/dist/src/commands/destroy.js +3 -1
- package/dist/src/commands/forceUnlock.js +2 -2
- package/dist/src/commands/index.js +28 -8
- package/dist/src/commands/local.js +3 -2
- package/dist/src/commands/login.js +120 -37
- package/dist/src/commands/logout.js +3 -5
- package/dist/src/commands/migrate.js +17 -10
- package/dist/src/commands/plan.js +5 -1
- package/dist/src/commands/show.js +3 -1
- package/dist/src/commands/whoami.js +24 -6
- package/dist/src/common/aliyunClient/cdnOperations.js +64 -29
- package/dist/src/common/aliyunClient/dnsOperations.js +10 -0
- package/dist/src/common/aliyunClient/fc3Operations.js +36 -7
- package/dist/src/common/apiClient.js +1 -0
- package/dist/src/common/bindingReconcile.js +182 -0
- package/dist/src/common/cdnCapabilities.js +80 -0
- package/dist/src/common/certUtils.js +44 -5
- package/dist/src/common/consoleLines.js +126 -0
- package/dist/src/common/constants.js +4 -2
- package/dist/src/common/credentialStore.js +136 -39
- package/dist/src/common/domainUtils.js +23 -4
- package/dist/src/common/functionDefinition.js +4 -1
- package/dist/src/common/functionDomainCapabilities.js +28 -0
- package/dist/src/common/functionDomainReconcile.js +197 -0
- package/dist/src/common/lineContext.js +164 -0
- package/dist/src/common/planCapabilities.js +14 -27
- package/dist/src/common/planCompare.js +8 -7
- package/dist/src/common/planFormatter.js +71 -37
- package/dist/src/common/stateBackend/cosStateBackend.js +0 -46
- package/dist/src/common/stateBackend/index.js +24 -16
- package/dist/src/common/stateBackend/ossStateBackend.js +0 -25
- package/dist/src/common/stateBackend/remoteStateBackend.js +5 -22
- package/dist/src/common/stateBackend/saasStateBackend.js +46 -53
- package/dist/src/common/stateBackend/tosStateBackend.js +100 -0
- package/dist/src/common/stateBackend/types.js +0 -9
- package/dist/src/common/tencentClient/cdnOperations.js +165 -0
- package/dist/src/common/tencentClient/cosOperations.js +18 -2
- package/dist/src/common/tencentClient/dnspodOperations.js +12 -0
- package/dist/src/common/tencentClient/index.js +16 -0
- package/dist/src/common/tencentClient/scfOperations.js +23 -1
- package/dist/src/common/tencentClient/sslOperations.js +147 -77
- package/dist/src/common/volcengineClient/cdnOperations.js +221 -0
- package/dist/src/common/volcengineClient/dnsOperations.js +132 -0
- package/dist/src/common/volcengineClient/index.js +28 -0
- package/dist/src/common/volcengineClient/tosOperations.js +131 -1
- package/dist/src/lang/en.js +89 -12
- package/dist/src/lang/zh-CN.js +90 -11
- package/dist/src/parser/bucketParser.js +22 -79
- package/dist/src/parser/functionParser.js +13 -9
- package/dist/src/stack/aliyunStack/apigwResource.js +2 -1
- package/dist/src/stack/aliyunStack/fc3Planner.js +32 -12
- package/dist/src/stack/aliyunStack/fc3Resource.js +169 -121
- package/dist/src/stack/aliyunStack/ossPlanner.js +12 -4
- package/dist/src/stack/aliyunStack/ossResource.js +484 -501
- package/dist/src/stack/aliyunStack/ossTypes.js +21 -67
- package/dist/src/stack/localStack/aliyunFc.js +59 -9
- package/dist/src/stack/localStack/bucket.js +75 -28
- package/dist/src/stack/localStack/event.js +33 -24
- package/dist/src/stack/localStack/httpAdapter.js +1 -13
- package/dist/src/stack/localStack/index.js +2 -2
- package/dist/src/stack/localStack/localServer.js +85 -7
- package/dist/src/stack/scfStack/cosPlanner.js +11 -3
- package/dist/src/stack/scfStack/cosResource.js +339 -161
- package/dist/src/stack/scfStack/cosTypes.js +25 -34
- package/dist/src/stack/scfStack/scfPlanner.js +26 -8
- package/dist/src/stack/scfStack/scfResource.js +191 -124
- package/dist/src/stack/volcengineStack/tosPlanner.js +13 -1
- package/dist/src/stack/volcengineStack/tosResource.js +398 -7
- package/dist/src/stack/volcengineStack/tosTypes.js +27 -0
- package/dist/src/stack/volcengineStack/vefaasTypes.js +1 -1
- package/dist/src/types/domains/state.js +6 -0
- package/dist/src/validator/bucketSchema.js +35 -113
- package/dist/src/validator/cdnSchema.js +30 -0
- package/dist/src/validator/eventSchema.js +2 -20
- package/dist/src/validator/functionSchema.js +55 -8
- package/dist/src/validator/rootSchema.js +3 -3
- package/dist/src/validator/semanticValidation.js +504 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/release-notes.md +82 -6
- package/samples/aliyun-poc-api-cdn.yml +1 -1
- package/samples/aliyun-poc-bucket-cdn.yml +28 -26
- package/samples/aliyun-poc-domain.yml +2 -1
- package/samples/volcengine-poc-tos-state.yml +36 -0
package/release-notes.md
CHANGED
|
@@ -1,8 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
### ⚠️ Breaking change
|
|
3
|
+
|
|
4
|
+
- Buckets now declare custom domains through a `domains` list with per-binding
|
|
5
|
+
certificate and CDN configuration, and transfer acceleration moves to the
|
|
6
|
+
bucket-level `accelerate` field
|
|
7
|
+
([#279](https://github.com/geek-fun/serverlessinsight/issues/279)). The legacy
|
|
8
|
+
`domain`, `website.domain`, `www_bind_apex` and per-domain `accelerate` forms
|
|
9
|
+
are rejected with localized migration guidance, and existing single-domain
|
|
10
|
+
state migrates in place so removed bindings cannot reappear. See the issue for
|
|
11
|
+
the old-vs-new configuration mapping.
|
|
12
|
+
|
|
13
|
+
### ✨ Added
|
|
14
|
+
|
|
15
|
+
- Native TOS Bucket Store state backend for Volcengine
|
|
16
|
+
([#290](https://github.com/geek-fun/serverlessinsight/issues/290)). `BUCKET_STORE`
|
|
17
|
+
now selects OSS, COS or TOS from the original YAML provider or explicit
|
|
18
|
+
`storageProvider` / `storageRegion`, resolves credentials for the storage cloud
|
|
19
|
+
(permanent or STS), and reuses the common remote backend for reads, writes,
|
|
20
|
+
backups, automatic V3 upgrades, migration ownership and best-effort locking.
|
|
21
|
+
Unsupported storage providers are still rejected explicitly. See the
|
|
22
|
+
[backend matrix, permissions and concurrency limits](docs/regional-deployment-state.md#bucket-store-backend-matrix).
|
|
23
|
+
- Bucket domain bindings can now be fronted by CDN acceleration on Tencent COS
|
|
24
|
+
([#295](https://github.com/geek-fun/serverlessinsight/pull/295)).
|
|
25
|
+
- Volcengine TOS buckets now support custom domain bindings with CDN delivery
|
|
26
|
+
([#296](https://github.com/geek-fun/serverlessinsight/pull/296)).
|
|
27
|
+
- Functions can bind a list of custom domains, with paths merged into shared
|
|
28
|
+
routes across functions
|
|
29
|
+
([#286](https://github.com/geek-fun/serverlessinsight/issues/286)).
|
|
30
|
+
- `si local` routes production-shaped gateway URLs without the `/SI_EVENTS/`
|
|
31
|
+
prefix when exactly one trigger matches, serves buckets with an explicit
|
|
32
|
+
`website` block (index document with SPA fallback), and mirrors the deployed
|
|
33
|
+
aliyun gateway event contract (rebuilt Host, gateway-injected `X-Forwarded-*` /
|
|
34
|
+
`X-Ca-*` metadata, path parameters); `--strict-prefix` restores prefix-only
|
|
35
|
+
routing ([#298](https://github.com/geek-fun/serverlessinsight/issues/298)).
|
|
36
|
+
- SaaS logins pick the region interactively and derive the Console URL
|
|
37
|
+
automatically (ADR-008): international and China credentials coexist as
|
|
38
|
+
separate profiles, `whoami` lists all profiles and logout targets the active
|
|
39
|
+
one.
|
|
40
|
+
- `si plan` renders array-valued attribute changes as per-entry structural
|
|
41
|
+
diffs: unchanged entries are omitted, the parent line carries a `(+N / -M)`
|
|
42
|
+
tally, and each added/removed entry gets its own line
|
|
43
|
+
([#300](https://github.com/geek-fun/serverlessinsight/pull/300)).
|
|
44
|
+
|
|
45
|
+
### 🐛 Fixed
|
|
46
|
+
|
|
47
|
+
- SaaS state operations verify CLI credentials before routing, failing with a
|
|
48
|
+
clear error instead of sending operations down the wrong line.
|
|
49
|
+
- Volcengine CDN configuration options now match the `UpdateCdnConfig` API.
|
|
50
|
+
- CDN delivery reconciles DNS records by value-matched ownership, and omitted
|
|
51
|
+
CDN options no longer produce phantom deployment changes
|
|
52
|
+
([#296](https://github.com/geek-fun/serverlessinsight/pull/296)).
|
|
53
|
+
- Corrected the state scope protocol referenced in SaaS regional error messages.
|
|
2
54
|
|
|
3
55
|
## 👥 Contributors
|
|
4
56
|
|
|
5
|
-
- **
|
|
57
|
+
- **AnnChord** (8 commits)
|
|
58
|
+
- **Kcatleong** (4 commits)
|
|
59
|
+
- **blankll** (11 commits)
|
|
6
60
|
- **seven** (1 commit)
|
|
7
61
|
|
|
8
62
|
|
|
@@ -11,10 +65,32 @@ See the full commit history below for the changes in this release.
|
|
|
11
65
|
<details>
|
|
12
66
|
<summary>📋 Full commit history</summary>
|
|
13
67
|
|
|
14
|
-
_Changes from v0.9.
|
|
68
|
+
_Changes from v0.9.7 to v0.9.8_
|
|
15
69
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
70
|
+
- cb3d9c3 release: v0.9.8 (blankll, 13 minutes ago)
|
|
71
|
+
- 4cc8f14 fix(saas): verify CLI credentials before routing state operations (blankll, 83 minutes ago)
|
|
72
|
+
- 0df905e test(service): await the async state backend factory in TOS lifecycle specs (blankll, 2 hours ago)
|
|
73
|
+
- 4262a41 feat(saas): cross-check the validate region against the resolved line (blankll, 3 hours ago)
|
|
74
|
+
- 505db69 feat(saas): ADR-008 line routing — region picker, dual-line credentials, key line segments (blankll, 5 hours ago)
|
|
75
|
+
- 38abdde test(local): cover strict-prefix forwarding in runLocal options (blankll, 4 days ago)
|
|
76
|
+
- f9ea336 test(local): harden startup races in CLI smoke and routing suites (blankll, 4 days ago)
|
|
77
|
+
- 4cd9682 feat(local): layered URL resolution, passthrough-faithful events and bucket website mode (blankll, 4 days ago)
|
|
78
|
+
- 5b26db3 feat(plan): render array attribute changes as per-entry structural diffs (blankll, 4 days ago)
|
|
79
|
+
- f2d0bde fix(lang): state scope protocol 3 in SaaS regional error copy (blankll, 5 days ago)
|
|
80
|
+
- 7f2f0bc test(function): close patch-coverage gaps in the domains reconcile (#286) (Kcatleong, 6 days ago)
|
|
81
|
+
- a7d288a feat(function): domains binding list with cross-function merged routes (#286) (Kcatleong, 7 days ago)
|
|
82
|
+
- 77d6220 fix(cdn): unify DNS record ownership and option defaults in review of #296 (blankll, 6 days ago)
|
|
83
|
+
- 7b212cc fix(volcengine): correct CDN config enums against the UpdateCdnConfig API docs (AnnChord, 7 days ago)
|
|
84
|
+
- e2b185b test(volcengine): raise branch coverage on client and executor paths (AnnChord, 7 days ago)
|
|
85
|
+
- b6cdaaf test(volcengine): cover client error paths and executor update branches (AnnChord, 7 days ago)
|
|
86
|
+
- 74a9f5d docs(cdn): mark Volcengine bucket CDN delivered in the capability matrix (AnnChord, 7 days ago)
|
|
87
|
+
- f104ad0 test(volcengine): cover TOS domain/CDN bindings end to end (AnnChord, 7 days ago)
|
|
88
|
+
- 3e13740 feat(volcengine): deliver TOS bucket domain bindings and CDN delivery (AnnChord, 7 days ago)
|
|
89
|
+
- f58edef feat(client): add Volcengine CDN, DNS and TOS domain client operations (AnnChord, 7 days ago)
|
|
90
|
+
- 6e9fd0a chore: ignore workbuddy (Kcatleong, 8 days ago)
|
|
91
|
+
- 47fbff7 feat(cdn): deliver Tencent COS bucket domain CDN acceleration (#295) (AnnChord, 8 days ago)
|
|
92
|
+
- a25bb84 feat(bucket)!: support multiple custom domains per bucket (#279) (#292) (seven, 9 days ago)
|
|
93
|
+
- 56152b3 feat(state): add TOS Bucket Store backend for storage parity (#291) (Kcatleong, 10 days ago)
|
|
18
94
|
|
|
19
95
|
</details>
|
|
20
96
|
|
|
@@ -22,4 +98,4 @@ _Changes from v0.9.5 to v0.9.6_
|
|
|
22
98
|
|
|
23
99
|
## 📦 Install
|
|
24
100
|
|
|
25
|
-
`npm install -g @geek-fun/serverlessinsight@0.9.
|
|
101
|
+
`npm install -g @geek-fun/serverlessinsight@0.9.8`
|
|
@@ -67,7 +67,7 @@ events:
|
|
|
67
67
|
cdn:
|
|
68
68
|
enabled: true
|
|
69
69
|
cdn_type: web
|
|
70
|
-
scope:
|
|
70
|
+
scope: chinese_mainland
|
|
71
71
|
cache_ttl: 86400 # 24 hours for static config
|
|
72
72
|
ignore_query_string: true # Ignore query params, same response
|
|
73
73
|
origin_protocol: follow # Follow original protocol
|
|
@@ -20,13 +20,13 @@ buckets:
|
|
|
20
20
|
website:
|
|
21
21
|
code: dist
|
|
22
22
|
index: index.html
|
|
23
|
-
|
|
24
|
-
domain_name: static.example.com
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
domains:
|
|
24
|
+
- domain_name: static.example.com
|
|
25
|
+
certificate_id: cas-cert-abc123
|
|
26
|
+
cdn: true # Simple: CDN enabled with sensible defaults
|
|
27
27
|
|
|
28
28
|
# Example 2: Advanced CDN configuration
|
|
29
|
-
# Full control over CDN settings
|
|
29
|
+
# Full control over CDN settings; a bucket may declare several bindings
|
|
30
30
|
advanced_cdn_bucket:
|
|
31
31
|
name: insight-poc-advanced-cdn
|
|
32
32
|
security:
|
|
@@ -34,30 +34,32 @@ buckets:
|
|
|
34
34
|
website:
|
|
35
35
|
code: dist
|
|
36
36
|
index: index.html
|
|
37
|
-
|
|
38
|
-
domain_name: assets.example.com
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
domains:
|
|
38
|
+
- domain_name: assets.example.com
|
|
39
|
+
certificate_id: cas-cert-def456
|
|
40
|
+
cdn:
|
|
41
|
+
enabled: true
|
|
42
|
+
cdn_type: web # web | download | video
|
|
43
|
+
scope: global # domestic | overseas | global
|
|
44
|
+
cache_ttl: 3600 # Cache TTL in seconds
|
|
45
|
+
ignore_query_string: false # Ignore query string in cache key
|
|
46
|
+
origin_protocol: https # http | https | follow
|
|
47
|
+
compression: true # Enable Gzip compression
|
|
48
|
+
force_redirect_https: true # Force HTTPS redirect
|
|
49
|
+
- domain_name: legacy.example.com
|
|
50
|
+
certificate_id: cas-cert-def456
|
|
49
51
|
|
|
50
52
|
# Example 3: CDN + Transfer Acceleration (dual-layer)
|
|
51
|
-
# CDN origin uses accelerated OSS endpoint
|
|
53
|
+
# CDN origin uses the accelerated OSS endpoint (bucket-level accelerate)
|
|
52
54
|
dual_acceleration_bucket:
|
|
53
55
|
name: insight-poc-dual-accel
|
|
54
56
|
security:
|
|
55
57
|
acl: PRIVATE
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
accelerate: true # OSS Transfer Acceleration for origin fetch
|
|
59
|
+
domains:
|
|
60
|
+
- domain_name: downloads.example.com
|
|
61
|
+
certificate_id: cas-cert-ghi789
|
|
62
|
+
cdn:
|
|
63
|
+
enabled: true
|
|
64
|
+
cdn_type: download
|
|
65
|
+
scope: global
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TOS Bucket Store state backend (issue #290).
|
|
2
|
+
# The bucket must exist before deploying; si never provisions state buckets.
|
|
3
|
+
# Create it in the storage region and grant GetObject/PutObject/DeleteObject on
|
|
4
|
+
# infra/state.json plus its .backup, .si-lock and upgrade sibling objects.
|
|
5
|
+
#
|
|
6
|
+
# Credentials (permanent or STS):
|
|
7
|
+
# VOLCENGINE_ACCESS_KEY_ID / VOLCENGINE_ACCESS_KEY / VOLCSTACK_ACCESS_KEY_ID
|
|
8
|
+
# VOLCENGINE_SECRET_KEY / VOLCENGINE_ACCESS_KEY_SECRET / VOLCSTACK_SECRET_ACCESS_KEY
|
|
9
|
+
# VOLCSTACK_SESSION_TOKEN / VOLCENGINE_SESSION_TOKEN (temporary credentials only)
|
|
10
|
+
version: 0.0.1
|
|
11
|
+
provider:
|
|
12
|
+
name: volcengine
|
|
13
|
+
region: cn-beijing
|
|
14
|
+
|
|
15
|
+
app: insight-poc
|
|
16
|
+
service: insight-poc-tos-state
|
|
17
|
+
|
|
18
|
+
backend:
|
|
19
|
+
state_manager:
|
|
20
|
+
type: BUCKET_STORE
|
|
21
|
+
bucket: example-state
|
|
22
|
+
key: infra/state.json
|
|
23
|
+
# Defaults to the original YAML provider and region. Explicit settings are
|
|
24
|
+
# pinned and never move when -v / -r workload overrides change the deployment:
|
|
25
|
+
# storageProvider: volcengine
|
|
26
|
+
# storageRegion: cn-beijing
|
|
27
|
+
|
|
28
|
+
functions:
|
|
29
|
+
hello_function:
|
|
30
|
+
name: insight-poc-hello-fn
|
|
31
|
+
code:
|
|
32
|
+
runtime: node20/v1
|
|
33
|
+
handler: index.handler
|
|
34
|
+
path: ./artifacts/function.zip
|
|
35
|
+
memory: 128
|
|
36
|
+
timeout: 30
|