| 1 | /** |
| 2 | * 来源的种类——**前端这一份清单只在这里写一次**。 |
| 3 | * |
| 4 | * 后端的那一份是 `crates/utopia-core` 里的 `SourceKind` 枚举,创建时的校验与同步时的 |
| 5 | * 分派都从它出;`utopia-store` 的测试会读这个文件,把两边对一遍——任何一边多一种 |
| 6 | * 少一种,`cargo test` 就红。此前两边各自手写,五种连接器加了同步分支、进了界面, |
| 7 | * 却没进创建的白名单:选得到、建不出来(#247)。 |
| 8 | * |
| 9 | * 顺序就是建来源对话框里的顺序。 |
| 10 | */ |
| 11 | export const CREATABLE_SOURCE_KINDS = [ |
| 12 | "folder", |
| 13 | "url", |
| 14 | "rss", |
| 15 | "github_issues", |
| 16 | "jira_issues", |
| 17 | "s3", |
| 18 | "azure_blob", |
| 19 | "gcs", |
| 20 | "webdav", |
| 21 | "notion", |
| 22 | "api", |
| 23 | "custom", |
| 24 | ] as const; |
| 25 | |
| 26 | export type CreatableSourceKind = (typeof CREATABLE_SOURCE_KINDS)[number]; |
| 27 | |
| 28 | /** 库里还会有两种人建不出来的:每个库自带的 `memory`,与老数据的 `upload` */ |
| 29 | export type SourceKind = CreatableSourceKind | "memory" | "upload"; |