Skip to content

Commit 7b48cf9

Browse files
qq9340100claude
andauthored
docs(spec): connector.zod.ts 模块 JSDoc 停止宣传已退役的出站限流与映射转换 (#6383) (#6473)
模块级 JSDoc 有四处措辞比它描述的 schema 晚了两次退役,而这段 JSDoc 被 gen:docs 逐字生成进 content/docs/references/integration/connector.mdx ——同一页 L171/L486 的属性表已写着「已移除」,散文却还承诺 「comprehensive rate limiting」。 收敛四处:SCOPE 行的 rate limiting、「comprehensive rate limiting」、 「Bidirectional sync with field mapping and transformations」(#5552)、 「Webhook management and rate limiting required」。 新增 "What this layer does NOT provide" 一节,措辞复用 #4911 / #5552 墓碑与 SYNC_ARCHITECTURE.md(#5554)现成句,一次退役只保留一种说法。 参考文档由 gen:docs 随动重生成(未手改)。仅注释与生成文档变化, schema 形状与运行时行为不变。 Claude-Session: https://claude.ai/code/session_011M7UwH25Unfi73UHim7ajY Co-authored-by: Claude <noreply@anthropic.com>
1 parent 82bf47b commit 7b48cf9

3 files changed

Lines changed: 93 additions & 9 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
connector.zod.ts 的模块 JSDoc 不再宣传已退役的出站限流与字段映射转换
6+
7+
`packages/spec/src/integration/connector.zod.ts` 的模块级 JSDoc 有四处措辞比它描述的 schema 晚了两次退役,而这段 JSDoc 被 `gen:docs` 逐字生成进 `content/docs/references/integration/connector.mdx`——同一页的属性表已经写着「已移除」,散文却还在承诺「comprehensive rate limiting」。读者相信哪一个,取决于他先读到哪一段。
8+
9+
收敛的四处:
10+
11+
- 「Includes authentication, webhooks, **rate limiting**, field mapping, …」
12+
- 「… and comprehensive **rate limiting**.」
13+
- 「- Bidirectional sync with field mapping **and transformations**
14+
- 「- Webhook management **and rate limiting** required」
15+
16+
出站限流从来没有引擎:平台唯一的令牌桶(`packages/runtime/src/security/rate-limit.ts`)是**入站**的,`connector.rateLimitConfig` 连同 `ConnectorRateLimitConfig` / `RateLimitStrategy` 整个形状已在 `@objectstack/spec` 17.0.0 移除(#4911, ADR-0049 D2)。字段映射同理:`FieldMapping.transform` 与整个 `FieldMappingTransform` 联合已在 17.0.0 移除(#5552, ADR-0049),没有任何 runtime 执行过其中五个成员。
17+
18+
JSDoc 因此新增一节「What this layer does NOT provide」,把两条否定连同处方写明——出站限流请在 connector provider 或上游网关做;取值转换请用会真正执行它的面(import mapping 的 `mapping.fieldMapping[].transform`,或 L2 的 ETL 转换步骤)。措辞直接复用 #4911 / #5552 墓碑与 `SYNC_ARCHITECTURE.md`(#5554)的现成句,一次退役只保留一种说法。
19+
20+
参考文档 `content/docs/references/integration/connector.mdx``gen:docs` 随动重生成(未手改)。仅注释与生成文档变化,schema 形状与运行时行为不变。

content/docs/references/integration/connector.mdx

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,43 @@ retired in #4738 — narrative-only, zero consumers; see
1818
- **Enterprise Connector** (THIS FILE) - System integrators - Full SAP integration; connector-attached sync via `syncConfig`
1919

2020
**SCOPE: Most comprehensive integration layer.**
21-
Includes authentication, webhooks, rate limiting, field mapping, bidirectional sync,
21+
Includes authentication, webhooks, field mapping, bidirectional sync,
2222
retry policies, and complete lifecycle management.
2323

2424
This protocol supports multiple authentication strategies, bidirectional sync,
25-
field mapping, webhooks, and comprehensive rate limiting.
25+
field mapping, webhooks, and comprehensive retry and resilience policies.
26+
27+
## What this layer does NOT provide
28+
29+
**There is no outbound rate limiting.** This header used to advertise "rate
30+
limiting" twice — once in the SCOPE line, once as "comprehensive rate limiting" —
31+
and no engine ever backed either. `connector.rateLimitConfig`, and the entire
32+
`ConnectorRateLimitConfig` / `RateLimitStrategy` shape behind it, was removed in
33+
`@objectstack/spec` 17.0.0 (#4911, ADR-0049 D2), because **no outbound
34+
rate-limiting engine ever existed**. The platform's only token bucket (runtime
35+
`security/rate-limit.ts`) throttles **INBOUND** requests *to* us; nothing throttles
36+
the calls a connector makes *out*. Do **not** substitute `shared`'s
37+
`RateLimitConfig` — that is the inbound limiter and would cap the wrong direction.
38+
**Until an outbound throttle exists, rate-limit at the connector provider or
39+
upstream gateway.** What L3 does declare for a rate-limited upstream is
40+
`retryConfig` — whose `retryableStatusCodes` default `[408, 429, 500, 502, 503,
41+
504]` includes `429` — and `health.circuitBreaker`. The full removal reasoning is
42+
recorded at the removal site: the "REMOVED: outbound rate limiting" block in
43+
`integration/connector.zod.ts`, and `packages/spec/docs/SYNC_ARCHITECTURE.md`.
44+
45+
**Field mapping does not transform values.** This header used to offer "field
46+
mapping and transformations"; only the first half was ever true.
47+
`ConnectorFieldMappingSchema` extends the base mapping with exactly three keys —
48+
`dataType`, `required` and `syncMode`. `FieldMapping.transform` was removed in
49+
`@objectstack/spec` 17.0.0 (#5552, ADR-0049), and the whole `FieldMappingTransform`
50+
union went with it (`constant` / `cast` / `lookup` / `javascript` / `map`) — **no
51+
runtime ever executed any of the five**. An L3 connector mapping moves a value from
52+
`source` to `target`; it does not compute one. **Value conversion belongs on a
53+
surface that runs it:** the import mapping's own `mapping.fieldMapping[].transform`
54+
(`data/mapping.zod.ts` — a string enum,
55+
`none`/`constant`/`map`/`split`/`join`/`lookup`, with its settings in `params`),
56+
applied row by row by the REST import path — or an ETL transformation step
57+
(L2 above). Already authored the retired key? `os migrate meta --from 16` rewrites it.
2658

2759
## Runtime contract — descriptor vs. registered connector (#2612)
2860

@@ -52,8 +84,8 @@ Authentication is now imported from the canonical `auth/config.zod.ts`.
5284
**Use Enterprise Connector when:**
5385
- Building enterprise-grade connectors (e.g., Salesforce, SAP, Oracle)
5486
- Complex OAuth2/SAML authentication required
55-
- Bidirectional sync with field mapping and transformations
56-
- Webhook management and rate limiting required
87+
- Bidirectional sync with field mapping (`dataType` / `syncMode` per field — it moves values, it does not transform them)
88+
- Webhook management required
5789
- Full CRUD operations and data synchronization
5890
- Need comprehensive retry strategies and error handling
5991

packages/spec/src/integration/connector.zod.ts

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,43 @@ import { retiredKey } from '../shared/retired-key';
2121
* - **Enterprise Connector** (THIS FILE) - System integrators - Full SAP integration; connector-attached sync via `syncConfig`
2222
*
2323
* **SCOPE: Most comprehensive integration layer.**
24-
* Includes authentication, webhooks, rate limiting, field mapping, bidirectional sync,
24+
* Includes authentication, webhooks, field mapping, bidirectional sync,
2525
* retry policies, and complete lifecycle management.
26-
*
26+
*
2727
* This protocol supports multiple authentication strategies, bidirectional sync,
28-
* field mapping, webhooks, and comprehensive rate limiting.
28+
* field mapping, webhooks, and comprehensive retry and resilience policies.
29+
*
30+
* ## What this layer does NOT provide
31+
*
32+
* **There is no outbound rate limiting.** This header used to advertise "rate
33+
* limiting" twice — once in the SCOPE line, once as "comprehensive rate limiting" —
34+
* and no engine ever backed either. `connector.rateLimitConfig`, and the entire
35+
* `ConnectorRateLimitConfig` / `RateLimitStrategy` shape behind it, was removed in
36+
* `@objectstack/spec` 17.0.0 (#4911, ADR-0049 D2), because **no outbound
37+
* rate-limiting engine ever existed**. The platform's only token bucket (runtime
38+
* `security/rate-limit.ts`) throttles **INBOUND** requests *to* us; nothing throttles
39+
* the calls a connector makes *out*. Do **not** substitute `shared`'s
40+
* `RateLimitConfig` — that is the inbound limiter and would cap the wrong direction.
41+
* **Until an outbound throttle exists, rate-limit at the connector provider or
42+
* upstream gateway.** What L3 does declare for a rate-limited upstream is
43+
* `retryConfig` — whose `retryableStatusCodes` default `[408, 429, 500, 502, 503,
44+
* 504]` includes `429` — and `health.circuitBreaker`. The full removal reasoning is
45+
* recorded at the removal site: the "REMOVED: outbound rate limiting" block in
46+
* `integration/connector.zod.ts`, and `packages/spec/docs/SYNC_ARCHITECTURE.md`.
47+
*
48+
* **Field mapping does not transform values.** This header used to offer "field
49+
* mapping and transformations"; only the first half was ever true.
50+
* `ConnectorFieldMappingSchema` extends the base mapping with exactly three keys —
51+
* `dataType`, `required` and `syncMode`. `FieldMapping.transform` was removed in
52+
* `@objectstack/spec` 17.0.0 (#5552, ADR-0049), and the whole `FieldMappingTransform`
53+
* union went with it (`constant` / `cast` / `lookup` / `javascript` / `map`) — **no
54+
* runtime ever executed any of the five**. An L3 connector mapping moves a value from
55+
* `source` to `target`; it does not compute one. **Value conversion belongs on a
56+
* surface that runs it:** the import mapping's own `mapping.fieldMapping[].transform`
57+
* (`data/mapping.zod.ts` — a string enum,
58+
* `none`/`constant`/`map`/`split`/`join`/`lookup`, with its settings in `params`),
59+
* applied row by row by the REST import path — or an ETL transformation step
60+
* (L2 above). Already authored the retired key? `os migrate meta --from 16` rewrites it.
2961
*
3062
* ## Runtime contract — descriptor vs. registered connector (#2612)
3163
*
@@ -55,8 +87,8 @@ import { retiredKey } from '../shared/retired-key';
5587
* **Use Enterprise Connector when:**
5688
* - Building enterprise-grade connectors (e.g., Salesforce, SAP, Oracle)
5789
* - Complex OAuth2/SAML authentication required
58-
* - Bidirectional sync with field mapping and transformations
59-
* - Webhook management and rate limiting required
90+
* - Bidirectional sync with field mapping (`dataType` / `syncMode` per field — it moves values, it does not transform them)
91+
* - Webhook management required
6092
* - Full CRUD operations and data synchronization
6193
* - Need comprehensive retry strategies and error handling
6294
*

0 commit comments

Comments
 (0)