POST /v1/admin/themes/packages
- operationId
uploadTheme- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Upload a custom cdnca.theme/v1 package (id custom.*). Packages with url(), @import, external links, script or undeclared classes are refused.
请求体
application/json · 必填:是
响应
uploadTheme 响应| 状态码 | 说明 |
|---|
201 | Downloaded package 字段:package_sha256: string theme_id: string version: string name: object description?: object source: any requires_feature?: string downloaded_at: string(date-time) active: boolean tokens_url: string stylesheet_url: string preview_url?: string derived_from?: object |
|---|
413 | Larger than 8 MiB |
|---|
422 | Refused package |
|---|
↑ 回到列表
GET /v1/admin/themes/packages/{sha}
- operationId
getThemePackage- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
The cdnca.theme/v1 JSON of a package this installation stored (removed ones too) or a catalog theme, byte for byte (its SHA-256 is the path digest). The theme management page edits a copy of it and uploads the copy as a custom.* package whose derived_from names this package. Requires system_configuration.read.
参数
getThemePackage 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
sha | path | string | 是 | — |
|---|
响应
getThemePackage 响应| 状态码 | 说明 |
|---|
200 | Package JSON |
|---|
404 | Never stored and not in the catalog |
|---|
失败时怎么办
↑ 回到列表
POST /v1/admin/themes/packages/{sha}/activate
- operationId
activateTheme- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Make a downloaded package the active theme of one console: no body is both consoles as before; {"slot":"admin"|"user"|"all"} names one. The admin console (admin, all) takes official themes only (built in, uploads and copies, or the io.cdnca market namespace); a third party's market theme is a user console theme. An admin activation records a new error page publication revision pinned to the theme; node default error pages follow the admin console, so a user activation republishes nothing.
参数
activateTheme 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
sha | path | string | 是 | — |
|---|
If-Match | header | string | 是 | Activation revision the caller saw ("0" before any). |
|---|
请求体
application/json · 必填:否
activateTheme 请求体| 名称 | 类型 | 必填 | 说明 |
|---|
slot | string: all / admin / user | 否 | — |
|---|
响应
activateTheme 响应| 状态码 | 说明 |
|---|
200 | Activated 字段:revision: integer package_sha256: string theme_id: string error_page_publication_revision: integer error_page_republish_scopes: integer already_active?: boolean |
|---|
400 | Unknown slot |
|---|
403 | Permission denied |
|---|
404 | Not downloaded |
|---|
412 | Revision conflict |
|---|
失败时怎么办
400 按字段说明修正参数或请求体再发;不要原样重试。403 检查 Key 范围与所有者当前权限、当前租户作用域;不要换更高权限账号绕过。404 资源不存在或不属于当前租户。412 版本已变:回读最新 ETag 后重新判断,再带新的 If-Match 提交。
↑ 回到列表
PUT /v1/admin/themes/tenants/{tenant_scope_id}/domains/{hostname}
- operationId
bindTenantThemeDomain- 认证
- 登录会话:主控登录后的 Bearer 会话,由客户本人在自己的主控里使用;插件不能要求客户交出会话。
- 所需权限
契约没有单独标注权限码,权限要求见下方说明与 403 响应。
说明(契约原文)
Bind a sign-in hostname to the tenant (its sign-in page shows the tenant theme). Audited as theme.tenant_domain.bind.
参数
bindTenantThemeDomain 参数| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|
tenant_scope_id | path | string(uuid) | 是 | — |
|---|
hostname | path | string | 是 | — |
|---|
响应
bindTenantThemeDomain 响应| 状态码 | 说明 |
|---|
200 | Tenant theme 字段:schema: const cdnca.theme.tenant/v1 tenant_scope_id: string(uuid) selection_mode: any platform_allows: boolean selection_allowed: boolean selected_package_sha256?: string assigned_by?: any effective_package_sha256: string effective_theme_id: string follows_platform: boolean revision: integer domains: array<string> choices: array<object> |
|---|
409 | theme_domain_conflict (bound to another tenant) |
|---|
失败时怎么办
409 先回读资源当前状态;同一操作重试保持原 Idempotency-Key 和原请求内容。
↑ 回到列表