Skip to content

Commit 37e883e

Browse files
JusterZhuclaude
andcommitted
docs: update Core & Differential docs and sync i18n across all locales
- Expand SetSource signature to include all 9 parameters (authScheme, basicUsername, basicPassword, installPath) - Add AuthScheme, BasicUsername, BasicPassword fields to UpdateRequest config table - Add SetAuthScheme, SetBasicUsername, SetBasicPassword methods to UpdateRequestBuilder - Update BrotliCompressionProvider description to reflect conditional compilation implementation - Sync all changes to English (i18n/en) and Chinese (i18n/zh-Hans) translations - Replace outdated zh-Hans i18n overrides with current structured API reference format Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5e800c7 commit 37e883e

6 files changed

Lines changed: 1029 additions & 1290 deletions

File tree

website/docs/doc/GeneralUpdate.Core.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ sidebar_position: 5
143143
| `Cancel()` || `void` | UI 中提供"取消更新"按钮 | 触发内部 `CancellationTokenSource` |
144144
| `SetConfig(UpdateRequest)` | `configInfo` — 更新配置对象 | `GeneralUpdateBootstrap` | 主程序内显式配置更新参数 | 会调用 `Validate()` 检查关键字段 |
145145
| `SetConfig(string)` | `filePath` — JSON 配置文件路径 | `GeneralUpdateBootstrap` | 从文件读取更新配置 | 支持相对路径和绝对路径;UTF-8 JSON 格式 |
146-
| `SetSource(...)` | `updateUrl`, `appSecretKey`, `reportUrl?`, `scheme?`, `token?` | `GeneralUpdateBootstrap` | 轻配置入口,配合 manifest 使用 | 只提供服务端入口和密钥,身份信息由 manifest 补齐 |
146+
| `SetSource(...)` | `updateUrl`(更新检查 API 地址)<br>`appSecretKey`(应用密钥)<br>`reportUrl?`(可选上报地址)<br>`scheme?`(可选认证方案,如 `"Bearer"`)<br>`token?`(可选认证令牌)<br>`authScheme?`(可选认证方案枚举,默认 `Hmac`)<br>`basicUsername?`(可选 Basic 认证用户名)<br>`basicPassword?`(可选 Basic 认证密码)<br>`installPath?`(可选安装路径) | `GeneralUpdateBootstrap` | 轻配置入口,配合 manifest 使用 | 只提供服务端入口和密钥,身份信息由 manifest 补齐;支持 HMAC / Bearer / Basic 多种认证方式 |
147147
| `SetOption(Option<T>, T)` | `option` — 选项键, `value` — 选项值 | `GeneralUpdateBootstrap` | 设置运行时选项 | 传入 `null` 给可空选项会移除当前设置 |
148148
| `UseDiffPipeline(Action<DiffPipelineBuilder>)` | `configure` — 差分管道配置委托 | `GeneralUpdateBootstrap` | 替换或调整差分补丁管道 | 未调用时使用默认配置 |
149149
| `AddListenerUpdateInfo(...)` | `EventHandler<UpdateInfoEventArgs>` | `GeneralUpdateBootstrap` | 接收服务端版本信息 | 无更新时也会触发(`Info.Code = 404`|
@@ -197,6 +197,9 @@ sidebar_position: 5
197197
| `SetDriverDirectory(string)` | `path` | `UpdateRequestBuilder` | 设置驱动目录 ||
198198
| `SetScheme(string)` | `scheme` | `UpdateRequestBuilder` | 设置认证方案 ||
199199
| `SetToken(string)` | `token` | `UpdateRequestBuilder` | 设置认证令牌 ||
200+
| `SetAuthScheme(AuthScheme)` | `authScheme` — 认证方案枚举 | `UpdateRequestBuilder` | 设置认证方案(Hmac / Bearer / ApiKey / Basic) | 默认 `Hmac` |
201+
| `SetBasicUsername(string)` | `username` | `UpdateRequestBuilder` | 设置 Basic 认证用户名 | 需配合 `SetAuthScheme(AuthScheme.Basic)` |
202+
| `SetBasicPassword(string)` | `password` | `UpdateRequestBuilder` | 设置 Basic 认证密码 | 需配合 `SetAuthScheme(AuthScheme.Basic)` |
200203
| `SetFiles(List<string>)` | `files` | `UpdateRequestBuilder` | 设置跳过文件列表 ||
201204
| `SetFormats(List<string>)` | `formats` | `UpdateRequestBuilder` | 设置跳过扩展名列表 ||
202205
| `SetDirectories(List<string>)` | `dirs` | `UpdateRequestBuilder` | 设置跳过目录列表 ||

website/docs/doc/GeneralUpdate.Differential.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 6
1010

1111
### 1.1 组件概述
1212

13-
**GeneralUpdate.Differential** 是 GeneralUpdate 的二进制差分组件,专注解决"一个旧文件 + 一个补丁文件 = 一个新文件"的问题。它提供可替换的文件级差分算法(BSDIFF 4.0 / Streaming HDiff)、补丁压缩抽象(BZip2 / Deflate / Brotli 预留)和 BSDIFF 兼容补丁读写能力。
13+
**GeneralUpdate.Differential** 是 GeneralUpdate 的二进制差分组件,专注解决"一个旧文件 + 一个补丁文件 = 一个新文件"的问题。它提供可替换的文件级差分算法(BSDIFF 4.0 / Streaming HDiff)、补丁压缩抽象(BZip2 / Deflate,源码中预留 .NET 6+ Brotli)和 BSDIFF 兼容补丁读写能力。
1414

1515
目录级对比、批量补丁生成、并行调度、删除文件处理和更新流程编排由 `GeneralUpdate.Core``DiffPipeline``GeneralUpdate.Tools` 承担。
1616

@@ -21,7 +21,7 @@ sidebar_position: 6
2121
| 文件级差分生成 | `CleanAsync(oldFile, newFile, patchFile)` — 对比新旧文件生成 `.patch` 补丁 |
2222
| 文件级差分应用 | `DirtyAsync(oldFile, newFile, patchFile)` — 旧文件 + 补丁 → 新文件 |
2323
| 可替换差分算法 | `BsdiffDiffer`(BSDIFF 4.0,后缀排序)和 `StreamingHdiffDiffer`(块哈希索引) |
24-
| 可替换压缩格式 | BZip2 (0x00)、Deflate (0x01),源码中预留 .NET 6+ Brotli (0x02) |
24+
| 可替换压缩格式 | BZip2 (0x00)、Deflate (0x01),源码中通过 `#if NET6_0_OR_GREATER` 条件编译预留 Brotli (0x02) |
2525
| BSDIFF 兼容格式 | 写入 33 字节扩展头(32 字节 BSDIFF40 + 1 字节压缩格式),兼容 32 字节旧头 |
2626
| 线程安全 | 内置 differ 和压缩提供器均支持并发调用 |
2727

@@ -93,7 +93,7 @@ Differential 本身是底层库,不提供配置类。所有参数通过构造
9393
| --- | --- | --- | --- |
9494
| `BZip2CompressionProvider` | `0x00` | 完全可用 | BSDIFF 旧补丁兼容,解压成本较高 |
9595
| `DeflateCompressionProvider` | `0x01` | 完全可用 | 解压速度更友好,适合客户端批量应用 |
96-
| `BrotliCompressionProvider` | `0x02` | 仅 .NET 6+ 编译(源码预留| 生产不建议使用 |
96+
| `BrotliCompressionProvider` | `0x02` | 仅 .NET 6+ 编译(源码中为完整实现,通过 `#if NET6_0_OR_GREATER` 条件编译| 当前 `netstandard2.0` 包中不包含,生产不建议使用 |
9797

9898
### 3.2 实例方法
9999

website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Core.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ sidebar_position: 5
9898
| `ProductId` | `string` || Optional || Product identifier for multi-product servers |
9999
| `UpdatePath` | `string` | `InstallPath` | Optional | Valid directory path | Upgrade process location |
100100
| `Bowl` | `string` | `null` | Optional | Valid filename | Auxiliary process name to close before update |
101-
| `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme |
101+
| `Scheme` | `string` | `null` | Optional | `"Bearer"` etc. | Auth scheme (used with `Token`) |
102102
| `Token` | `string` | `null` | Optional || Auth token |
103+
| `AuthScheme` | `AuthScheme` | `Hmac` | Optional | `Hmac`, `Bearer`, `Basic` | Auth scheme enum; `Hmac` for GeneralSpacestation server-side signed auth |
104+
| `BasicUsername` | `string` | `null` | Optional || HTTP Basic auth username (requires `AuthScheme = Basic`) |
105+
| `BasicPassword` | `string` | `null` | Optional || HTTP Basic auth password (requires `AuthScheme = Basic`) |
103106
| `Files` | `List<string>` | `null` | Optional || Files to skip during update |
104107
| `Formats` | `List<string>` | `null` | Optional || Extensions to skip during update |
105108
| `Directories` | `List<string>` | `null` | Optional || Directories to skip during update |
@@ -135,7 +138,7 @@ sidebar_position: 5
135138
| `Cancel()` | None | `void` | UI "Cancel Update" button | Triggers internal `CancellationTokenSource` |
136139
| `SetConfig(UpdateRequest)` | `configInfo` | `GeneralUpdateBootstrap` | Explicit update configuration | Calls `Validate()` on key fields |
137140
| `SetConfig(string)` | `filePath` — JSON config file path | `GeneralUpdateBootstrap` | Read config from file | Supports relative/absolute paths; UTF-8 JSON |
138-
| `SetSource(...)` | `updateUrl`, `appSecretKey`, `reportUrl?`, `scheme?`, `token?` | `GeneralUpdateBootstrap` | Lightweight entry with manifest | Identity info filled by manifest |
141+
| `SetSource(...)` | `updateUrl` (version check API URL)<br>`appSecretKey` (app secret key)<br>`reportUrl?` (optional report URL)<br>`scheme?` (optional auth scheme, e.g., `"Bearer"`)<br>`token?` (optional auth token)<br>`authScheme?` (optional auth scheme enum, default `Hmac`)<br>`basicUsername?` (optional Basic auth username)<br>`basicPassword?` (optional Basic auth password)<br>`installPath?` (optional install path) | `GeneralUpdateBootstrap` | Lightweight entry with manifest | Identity info filled by manifest; supports HMAC / Bearer / Basic auth methods |
139142
| `SetOption(Option<T>, T)` | `option` — key, `value` — value | `GeneralUpdateBootstrap` | Set runtime options | Pass `null` to reset nullable options |
140143
| `UseDiffPipeline(Action<DiffPipelineBuilder>)` | `configure` — delegate | `GeneralUpdateBootstrap` | Replace or tune diff pipeline | Default used if not called |
141144
| `AddListenerUpdateInfo(...)` | `EventHandler<UpdateInfoEventArgs>` | `GeneralUpdateBootstrap` | Receive server version info | Also fires when no update available |

website/i18n/en/docusaurus-plugin-content-docs/current/doc/GeneralUpdate.Differential.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Directory-level comparison, batch patch generation, parallel scheduling, deleted
2121
| File-Level Diff Generation | `CleanAsync(oldFile, newFile, patchFile)` — compare old & new files to generate `.patch` |
2222
| File-Level Diff Application | `DirtyAsync(oldFile, newFile, patchFile)` — old file + patch → new file |
2323
| Pluggable Diff Algorithms | `BsdiffDiffer` (BSDIFF 4.0, suffix sort) and `StreamingHdiffDiffer` (block hash indexing) |
24-
| Pluggable Compression | BZip2 (0x00), Deflate (0x01), .NET 6+ Brotli (0x02) reserved in source |
24+
| Pluggable Compression | BZip2 (0x00), Deflate (0x01), .NET 6+ Brotli (0x02) available via conditional compilation |
2525
| BSDIFF Compatible Format | 33-byte extended header (32-byte BSDIFF40 + 1-byte compression format), 32-byte legacy compatible |
2626
| Thread Safety | Built-in differ and compression providers support concurrent calls |
2727

@@ -87,7 +87,7 @@ Differential is a low-level library with no configuration classes. All parameter
8787
| --- | --- | --- | --- |
8888
| `BZip2CompressionProvider` | `0x00` | Fully available | Legacy BSDIFF compatible, higher decompression cost |
8989
| `DeflateCompressionProvider` | `0x01` | Fully available | Faster decompression, better for client batch apply |
90-
| `BrotliCompressionProvider` | `0x02` | .NET 6+ only (source reserved) | Not recommended for production |
90+
| `BrotliCompressionProvider` | `0x02` | .NET 6+ only (full implementation in source behind `#if NET6_0_OR_GREATER` conditional compilation) | Not included in current `netstandard2.0` package; not recommended for production |
9191

9292
### 3.2 Instance Methods
9393

0 commit comments

Comments
 (0)