{
    "openapi": "3.1.0",
    "info": {
        "title": "Cloudsign OpenAPI · 应用分发",
        "version": "1.22.0-preview.1",
        "description": "通过用户开放 API 管理自己账号下已授权的企业签名和应用分发资源，完成上传、签名、发布、查询和订单处理。接入前请在开发者中心创建 API 应用并配置权限。\n按产品筛选操作的契约，请求字段、默认值和权限与完整契约一致。应用分发列表须显式传 module=distribution。"
    },
    "servers": [
        {
            "url": "https://{host}",
            "variables": {
                "host": {
                    "default": "www.fenfa.im",
                    "description": "配置的主网站域名，不是分发或存储域名"
                }
            }
        }
    ],
    "security": [
        {
            "AccessKeySignature": []
        }
    ],
    "components": {
        "parameters": {
            "Date": {
                "name": "X-Api-Date",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "format": "date-time"
                },
                "description": "UTC，YYYY-MM-DDTHH:mm:ssZ，前后 300 秒窗口"
            },
            "Nonce": {
                "name": "X-Api-Nonce",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{32}$"
                }
            },
            "BodyHash": {
                "name": "X-Api-Content-Sha256",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                },
                "description": "实际请求体字节的 SHA-256；GET 为零字节摘要"
            },
            "Environment": {
                "name": "X-Api-Environment",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "const": "production"
                }
            },
            "SecurityToken": {
                "name": "X-Api-Security-Token",
                "in": "header",
                "required": false,
                "schema": {
                    "type": "string",
                    "pattern": "^CST_[A-Za-z0-9_-]{43}$"
                },
                "description": "Required only for AKT credentials; append SHA256(token) to the canonical string. AKP requests must omit it."
            },
            "Idempotency": {
                "name": "X-Api-Idempotency-Key",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{16,64}$"
                },
                "description": "同一次业务重试保持原值及原始请求体，更换 nonce 重新签名。有效记录保留 90 天。"
            },
            "FinancialIdempotency": {
                "name": "X-Api-Idempotency-Key",
                "in": "header",
                "required": true,
                "schema": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{16,64}$"
                },
                "description": "财务幂等记录长期保留，不按普通 90 天缓存删除。同一 API 应用跨密钥有效；保留原幂等键及确认字段，JSON 字段顺序可变化，每次使用新 nonce 重新签名。更换幂等键不能再次支付同一报价。"
            }
        },
        "schemas": {
            "App": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "name",
                    "bundle_id",
                    "platform",
                    "version",
                    "build",
                    "size_bytes",
                    "module",
                    "updated_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "name": {
                        "type": "string"
                    },
                    "bundle_id": {
                        "type": "string"
                    },
                    "platform": {
                        "type": "string",
                        "enum": [
                            "ipa",
                            "apk"
                        ]
                    },
                    "version": {
                        "type": "string"
                    },
                    "build": {
                        "type": "string"
                    },
                    "size_bytes": {
                        "type": "integer"
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "enterprise",
                            "distribution"
                        ]
                    },
                    "updated_at": {
                        "type": "integer",
                        "description": "Unix 秒"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "request_id",
                    "error"
                ],
                "properties": {
                    "request_id": {
                        "type": "string"
                    },
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Creation": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "state",
                    "module",
                    "platform",
                    "expires_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "awaiting_upload",
                            "ready",
                            "expired"
                        ]
                    },
                    "module": {
                        "type": "string"
                    },
                    "platform": {
                        "type": "string"
                    },
                    "expires_at": {
                        "type": "integer",
                        "minimum": 0
                    }
                }
            },
            "Version": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "app_id",
                    "bundle_id",
                    "platform",
                    "version",
                    "build",
                    "size_bytes",
                    "package_type",
                    "is_current",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^V[a-f0-9]{32}$"
                    },
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "bundle_id": {
                        "type": "string"
                    },
                    "platform": {
                        "type": "string",
                        "enum": [
                            "ipa",
                            "apk"
                        ]
                    },
                    "version": {
                        "type": "string"
                    },
                    "build": {
                        "type": "string"
                    },
                    "size_bytes": {
                        "type": "integer"
                    },
                    "package_type": {
                        "type": "string",
                        "enum": [
                            "original",
                            "signed"
                        ]
                    },
                    "is_current": {
                        "type": "boolean",
                        "description": "该类型安装包的当前发布标记；原包与签名包可各自为当前版本"
                    },
                    "created_at": {
                        "type": "integer",
                        "description": "Unix 秒；无法解析的旧时间为 0"
                    }
                }
            },
            "Upload": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "app_id",
                    "state",
                    "size_bytes",
                    "expires_at",
                    "version_id",
                    "error_code"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^U[a-f0-9]{32}$"
                    },
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "uploading",
                            "validating",
                            "succeeded",
                            "failed",
                            "cancelled"
                        ]
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 22
                    },
                    "expires_at": {
                        "type": "integer"
                    },
                    "version_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^V[a-f0-9]{32}$"
                    },
                    "error_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "transfer_mode": {
                        "type": "string",
                        "enum": [
                            "single",
                            "multipart"
                        ]
                    },
                    "format": {
                        "type": "string",
                        "enum": [
                            "ipa",
                            "apk"
                        ]
                    },
                    "part_size_bytes": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "part_count": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1024
                    }
                }
            },
            "UploadInput": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "file_name",
                    "size_bytes",
                    "sha256",
                    "md5"
                ],
                "properties": {
                    "file_name": {
                        "type": "string",
                        "maxLength": 160,
                        "description": "IPA 文件名",
                        "pattern": "^[^/\\\\:]+\\.(?:ipa|apk)$"
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 22,
                        "maximum": 5368709120
                    },
                    "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                    },
                    "md5": {
                        "type": "string",
                        "description": "16 字节 MD5 的标准 Base64"
                    }
                }
            },
            "MultipartUploadInput": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "file_name",
                    "size_bytes",
                    "transfer_mode"
                ],
                "properties": {
                    "file_name": {
                        "type": "string",
                        "maxLength": 160,
                        "description": "IPA 文件名",
                        "pattern": "^[^/\\\\:]+\\.(?:ipa|apk)$"
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 22,
                        "maximum": 17179869184
                    },
                    "transfer_mode": {
                        "const": "multipart",
                        "type": "string"
                    }
                }
            },
            "UploadTicket": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "upload_id",
                    "ticket"
                ],
                "properties": {
                    "upload_id": {
                        "type": "string",
                        "pattern": "^U[a-f0-9]{32}$"
                    },
                    "ticket": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "url",
                            "method",
                            "headers",
                            "expires_at"
                        ],
                        "properties": {
                            "url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "method": {
                                "type": "string",
                                "const": "PUT"
                            },
                            "headers": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "string"
                                }
                            },
                            "expires_at": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "UploadParts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "items",
                    "next_after"
                ],
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/UploadPart"
                        }
                    },
                    "next_after": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[1-9][0-9]{0,3}$"
                    }
                }
            },
            "UploadPart": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "part_number",
                    "size_bytes",
                    "sha256",
                    "uploaded"
                ],
                "properties": {
                    "part_number": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1024
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 33554432
                    },
                    "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                    },
                    "uploaded": {
                        "type": "boolean",
                        "description": "已确认暂存对象存在；最终内容校验与合并在异步 validating 阶段执行。查询 U.state=succeeded 之后才表示版本发布完成。"
                    }
                }
            },
            "UploadPartInput": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "part_number",
                    "sha256"
                ],
                "properties": {
                    "part_number": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1024
                    },
                    "sha256": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                    }
                }
            },
            "UploadPartTicket": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "upload_id",
                    "ticket",
                    "part_number"
                ],
                "properties": {
                    "upload_id": {
                        "type": "string",
                        "pattern": "^U[a-f0-9]{32}$"
                    },
                    "ticket": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "url",
                            "method",
                            "headers",
                            "expires_at"
                        ],
                        "properties": {
                            "url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "method": {
                                "type": "string",
                                "enum": [
                                    "PUT",
                                    "POST"
                                ]
                            },
                            "headers": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "string"
                                }
                            },
                            "expires_at": {
                                "type": "integer"
                            },
                            "kind": {
                                "type": "string",
                                "enum": [
                                    "s3",
                                    "oss",
                                    "local",
                                    "qiniu"
                                ],
                                "description": "平台生成的传输指令类型，由 SDK 自动识别；业务代码无需填写或选择。省略时沿用兼容传输指令。"
                            },
                            "encoding": {
                                "type": "string",
                                "const": "multipart"
                            },
                            "fields": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "key",
                                    "token"
                                ],
                                "properties": {
                                    "key": {
                                        "type": "string"
                                    },
                                    "token": {
                                        "type": "string",
                                        "x-sensitive": true
                                    }
                                }
                            }
                        },
                        "description": "平台返回该片的短期上传指令，由 SDK 按方法、请求头或表单字段自动传输。自行实现 HTTP 时，按返回指令发送；浏览器的 Content-Length 由浏览器根据文件字节生成。分片确认只表示暂存成功，整个安装包校验并返回版本 ID 后才可使用。"
                    },
                    "part_number": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1024
                    }
                }
            },
            "DownloadReceipt": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "app_id",
                    "version_id",
                    "package_type",
                    "platform",
                    "size_bytes",
                    "file_name",
                    "created_at",
                    "expires_at",
                    "ticket"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^D[a-f0-9]{32}$"
                    },
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "version_id": {
                        "type": "string",
                        "pattern": "^V[a-f0-9]{32}$"
                    },
                    "package_type": {
                        "type": "string",
                        "enum": [
                            "original",
                            "signed"
                        ]
                    },
                    "platform": {
                        "type": "string",
                        "enum": [
                            "ipa",
                            "apk"
                        ]
                    },
                    "size_bytes": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "file_name": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}-V[a-f0-9]{32}\\.(ipa|apk)$"
                    },
                    "created_at": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "expires_at": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "ticket": {
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/DownloadTicket"
                            }
                        ]
                    }
                }
            },
            "DownloadTicket": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "url",
                    "method",
                    "headers",
                    "expires_at"
                ],
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "敏感的短期存储凭证。不要记录日志、公开或附带平台 Authorization 请求头。",
                        "x-sensitive": true
                    },
                    "method": {
                        "type": "string",
                        "const": "GET"
                    },
                    "headers": {
                        "type": "object",
                        "additionalProperties": false
                    },
                    "expires_at": {
                        "type": "integer",
                        "minimum": 1
                    }
                }
            },
            "DistributionSettings": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "revision",
                    "template_id",
                    "language",
                    "introduction",
                    "available_template_ids",
                    "available_languages"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "revision": {
                        "type": "string",
                        "pattern": "^R[a-f0-9]{64}$"
                    },
                    "template_id": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 8
                    },
                    "language": {
                        "type": "string",
                        "enum": [
                            "auto",
                            "zh",
                            "en",
                            "zh-tw",
                            "vi",
                            "ru",
                            "th",
                            "ja",
                            "ko",
                            "es",
                            "pt",
                            "fr",
                            "de",
                            "it",
                            "id",
                            "ms",
                            "ar",
                            "hi",
                            "tr"
                        ]
                    },
                    "introduction": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "available_template_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 8
                        }
                    },
                    "available_languages": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "auto",
                                "zh",
                                "en",
                                "zh-tw",
                                "vi",
                                "ru",
                                "th",
                                "ja",
                                "ko",
                                "es",
                                "pt",
                                "fr",
                                "de",
                                "it",
                                "id",
                                "ms",
                                "ar",
                                "hi",
                                "tr"
                            ]
                        }
                    }
                }
            },
            "DistributionSettingsUpdated": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "settings",
                    "replayed"
                ],
                "properties": {
                    "settings": {
                        "$ref": "#/components/schemas/DistributionSettings"
                    },
                    "replayed": {
                        "type": "boolean"
                    }
                }
            },
            "DistributionSettingsInput": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "revision",
                    "template_id",
                    "language",
                    "introduction"
                ],
                "properties": {
                    "revision": {
                        "type": "string",
                        "pattern": "^R[a-f0-9]{64}$"
                    },
                    "template_id": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 8
                    },
                    "language": {
                        "type": "string",
                        "enum": [
                            "auto",
                            "zh",
                            "en",
                            "zh-tw",
                            "vi",
                            "ru",
                            "th",
                            "ja",
                            "ko",
                            "es",
                            "pt",
                            "fr",
                            "de",
                            "it",
                            "id",
                            "ms",
                            "ar",
                            "hi",
                            "tr"
                        ]
                    },
                    "introduction": {
                        "type": "string",
                        "maxLength": 255
                    }
                }
            },
            "AppStatistics": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "module",
                    "generated_at",
                    "timezone",
                    "record_scope",
                    "window",
                    "downloads",
                    "installation_statistics_state",
                    "installations",
                    "launches",
                    "daily"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "enterprise",
                            "distribution"
                        ]
                    },
                    "generated_at": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                    },
                    "timezone": {
                        "type": "string",
                        "const": "Asia/Shanghai"
                    },
                    "record_scope": {
                        "type": "string",
                        "const": "current_retained_counters"
                    },
                    "window": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "start_date",
                            "end_date",
                            "start_at",
                            "end_at"
                        ],
                        "properties": {
                            "start_date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "end_date": {
                                "type": "string",
                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                            },
                            "start_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            },
                            "end_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            }
                        }
                    },
                    "downloads": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "unit",
                            "total",
                            "today",
                            "yesterday",
                            "last_7_days",
                            "last_30_days"
                        ],
                        "properties": {
                            "unit": {
                                "type": "string",
                                "const": "admitted_downloads"
                            },
                            "total": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            },
                            "today": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            },
                            "yesterday": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            },
                            "last_7_days": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            },
                            "last_30_days": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                            }
                        }
                    },
                    "installation_statistics_state": {
                        "type": "string",
                        "enum": [
                            "available",
                            "not_initialized",
                            "not_applicable"
                        ]
                    },
                    "installations": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "unit",
                                    "total",
                                    "today",
                                    "yesterday",
                                    "last_7_days",
                                    "last_30_days",
                                    "cross_version_deduplicated"
                                ],
                                "properties": {
                                    "unit": {
                                        "type": "string",
                                        "const": "unique_admitted_device_fingerprints"
                                    },
                                    "total": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "today": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "yesterday": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "last_7_days": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "last_30_days": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "cross_version_deduplicated": {
                                        "type": "boolean",
                                        "const": true
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "launches": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "unit",
                                    "total",
                                    "today",
                                    "today_estimated",
                                    "current_rules_include_first_open",
                                    "legacy_totals_may_exclude_first_open"
                                ],
                                "properties": {
                                    "unit": {
                                        "type": "string",
                                        "const": "recorded_launch_events"
                                    },
                                    "total": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "today": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                    },
                                    "today_estimated": {
                                        "type": "boolean"
                                    },
                                    "current_rules_include_first_open": {
                                        "type": "boolean",
                                        "const": true
                                    },
                                    "legacy_totals_may_exclude_first_open": {
                                        "type": "boolean",
                                        "const": true
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "daily": {
                        "type": "array",
                        "minItems": 30,
                        "maxItems": 30,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "date",
                                "downloads",
                                "new_installations"
                            ],
                            "properties": {
                                "date": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "downloads": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                },
                                "new_installations": {
                                    "oneOf": [
                                        {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "AppPricing": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "module",
                    "generated_at",
                    "pricing_revision",
                    "reference_only",
                    "payment_api_available",
                    "currency",
                    "products",
                    "daily",
                    "refund_policy"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "enterprise",
                            "distribution"
                        ]
                    },
                    "generated_at": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                    },
                    "pricing_revision": {
                        "type": "string",
                        "pattern": "^P[a-f0-9]{64}$"
                    },
                    "reference_only": {
                        "type": "boolean",
                        "const": true
                    },
                    "payment_api_available": {
                        "type": "boolean",
                        "const": false
                    },
                    "currency": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "code",
                            "unit",
                            "prefix",
                            "suffix",
                            "external_settlement"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "CNY",
                                    "USD",
                                    "EUR",
                                    "HKD",
                                    "GBP",
                                    "POINT",
                                    "CUSTOM"
                                ]
                            },
                            "unit": {
                                "type": "string"
                            },
                            "prefix": {
                                "type": "string"
                            },
                            "suffix": {
                                "type": "string"
                            },
                            "external_settlement": {
                                "type": "string",
                                "const": "payment_provider"
                            }
                        }
                    },
                    "products": {
                        "type": "array",
                        "minItems": 6,
                        "maxItems": 12,
                        "items": {
                            "$ref": "#/components/schemas/PricedProduct"
                        }
                    },
                    "daily": {
                        "type": "array",
                        "maxItems": 3,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "sku",
                                "plan_id",
                                "enabled",
                                "unit_amount",
                                "min_days",
                                "max_days"
                            ],
                            "properties": {
                                "sku": {
                                    "type": "string",
                                    "pattern": "^day[123]$"
                                },
                                "plan_id": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3
                                },
                                "enabled": {
                                    "type": "boolean"
                                },
                                "unit_amount": {
                                    "type": "string",
                                    "pattern": "^(?:0|[1-9][0-9]{0,9})\\.[0-9]{2}$"
                                },
                                "min_days": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                },
                                "max_days": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                }
                            }
                        }
                    },
                    "refund_policy": {
                        "oneOf": [
                            {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "window_seconds",
                                    "daily_supported",
                                    "redemption_supported",
                                    "other_rules_apply"
                                ],
                                "properties": {
                                    "window_seconds": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 315360000
                                    },
                                    "daily_supported": {
                                        "type": "boolean"
                                    },
                                    "redemption_supported": {
                                        "type": "boolean",
                                        "const": false
                                    },
                                    "other_rules_apply": {
                                        "type": "boolean",
                                        "const": true
                                    }
                                }
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "PricedProduct": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "sku",
                    "category",
                    "name",
                    "amount",
                    "plan_id",
                    "quantity",
                    "quantity_unit",
                    "service_days"
                ],
                "properties": {
                    "sku": {
                        "type": "string",
                        "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
                    },
                    "category": {
                        "type": "string",
                        "enum": [
                            "enterprise_signature",
                            "distribution_points",
                            "distribution_membership"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "amount": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,9})\\.[0-9]{2}$"
                    },
                    "plan_id": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "quantity": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 2147483647
                    },
                    "quantity_unit": {
                        "type": "string",
                        "enum": [
                            "days",
                            "months",
                            "download_points",
                            "years"
                        ]
                    },
                    "service_days": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3650
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "AppQuote": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "module",
                    "generated_at",
                    "pricing_revision",
                    "reference_only",
                    "payment_api_available",
                    "currency",
                    "product"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "enterprise",
                            "distribution"
                        ]
                    },
                    "generated_at": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                    },
                    "pricing_revision": {
                        "type": "string",
                        "pattern": "^P[a-f0-9]{64}$"
                    },
                    "reference_only": {
                        "type": "boolean",
                        "const": true
                    },
                    "payment_api_available": {
                        "type": "boolean",
                        "const": false
                    },
                    "currency": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "code",
                            "unit",
                            "prefix",
                            "suffix",
                            "external_settlement"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "CNY",
                                    "USD",
                                    "EUR",
                                    "HKD",
                                    "GBP",
                                    "POINT",
                                    "CUSTOM"
                                ]
                            },
                            "unit": {
                                "type": "string"
                            },
                            "prefix": {
                                "type": "string"
                            },
                            "suffix": {
                                "type": "string"
                            },
                            "external_settlement": {
                                "type": "string",
                                "const": "payment_provider"
                            }
                        }
                    },
                    "product": {
                        "$ref": "#/components/schemas/PricedProduct"
                    }
                }
            },
            "AppMetadata": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "name",
                    "remark",
                    "revision"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "name": {
                        "type": "string"
                    },
                    "remark": {
                        "type": "string"
                    },
                    "revision": {
                        "type": "string"
                    }
                }
            },
            "PublishedVersion": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "version_id",
                    "previous_version_id",
                    "published_at"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "version_id": {
                        "type": "string"
                    },
                    "previous_version_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "published_at": {
                        "type": "integer",
                        "minimum": 0
                    }
                }
            },
            "TrashedApp": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "app_id",
                    "state",
                    "files_retained"
                ],
                "properties": {
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "state": {
                        "type": "string"
                    },
                    "files_retained": {
                        "type": "boolean"
                    }
                }
            },
            "PurchaseQuote": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "app_id",
                    "module",
                    "state",
                    "product",
                    "amount",
                    "currency",
                    "pricing_revision",
                    "created_at",
                    "expires_at",
                    "price_reserved",
                    "funds_reserved",
                    "automatic_signing",
                    "receipt"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "pattern": "^Q[a-f0-9]{32}$"
                    },
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "module": {
                        "type": "string",
                        "enum": [
                            "enterprise",
                            "distribution"
                        ]
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "awaiting_payment",
                            "paid",
                            "expired"
                        ]
                    },
                    "product": {
                        "$ref": "#/components/schemas/PricedProduct"
                    },
                    "amount": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
                    },
                    "currency": {
                        "$ref": "#/components/schemas/PurchaseCurrency"
                    },
                    "pricing_revision": {
                        "type": "string",
                        "pattern": "^P[a-f0-9]{64}$"
                    },
                    "created_at": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "expires_at": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "price_reserved": {
                        "type": "boolean",
                        "const": true
                    },
                    "funds_reserved": {
                        "type": "boolean",
                        "const": false
                    },
                    "automatic_signing": {
                        "type": "boolean",
                        "const": false
                    },
                    "receipt": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/PurchaseReceipt"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "PurchaseCurrency": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "code",
                    "unit",
                    "external_settlement",
                    "revision"
                ],
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "unit": {
                        "type": "string"
                    },
                    "external_settlement": {
                        "type": "string",
                        "const": "payment_provider"
                    },
                    "revision": {
                        "type": "string",
                        "pattern": "^C[a-f0-9]{64}$"
                    }
                }
            },
            "PurchaseReceipt": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "quote_id",
                    "app_id",
                    "order_id",
                    "state",
                    "payment_method",
                    "amount",
                    "currency",
                    "balance_before",
                    "balance_after",
                    "paid_at",
                    "automatic_signing",
                    "entitlement"
                ],
                "properties": {
                    "quote_id": {
                        "type": "string",
                        "pattern": "^Q[a-f0-9]{32}$"
                    },
                    "app_id": {
                        "type": "string",
                        "pattern": "^A[a-f0-9]{32}$"
                    },
                    "order_id": {
                        "type": "string",
                        "pattern": "^O[a-f0-9]{32}$"
                    },
                    "state": {
                        "type": "string",
                        "const": "paid"
                    },
                    "payment_method": {
                        "type": "string",
                        "const": "balance"
                    },
                    "amount": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
                    },
                    "currency": {
                        "$ref": "#/components/schemas/PurchaseCurrency"
                    },
                    "balance_before": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
                    },
                    "balance_after": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
                    },
                    "paid_at": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "automatic_signing": {
                        "type": "boolean",
                        "const": false
                    },
                    "entitlement": {
                        "$ref": "#/components/schemas/PurchaseEntitlement"
                    }
                }
            },
            "PurchaseEntitlement": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "scope",
                    "sign_expires_at",
                    "sign_plan",
                    "download_points",
                    "membership_tier",
                    "membership_expires_at"
                ],
                "properties": {
                    "scope": {
                        "type": "string",
                        "enum": [
                            "application",
                            "account"
                        ]
                    },
                    "sign_expires_at": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 0
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "sign_plan": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "enum": [
                                    1,
                                    2,
                                    3
                                ]
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "download_points": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 0
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "membership_tier": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 3
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "membership_expires_at": {
                        "oneOf": [
                            {
                                "type": "integer",
                                "minimum": 0
                            },
                            {
                                "type": "null"
                            }
                        ]
                    }
                }
            },
            "PurchaseQuoteInput": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "sku"
                ],
                "properties": {
                    "sku": {
                        "type": "string",
                        "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
                    },
                    "days": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,3}$"
                    }
                }
            },
            "PurchaseConfirmation": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "payment_method",
                    "amount",
                    "pricing_revision",
                    "currency_revision"
                ],
                "properties": {
                    "payment_method": {
                        "type": "string",
                        "const": "balance"
                    },
                    "amount": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
                    },
                    "pricing_revision": {
                        "type": "string",
                        "pattern": "^P[a-f0-9]{64}$"
                    },
                    "currency_revision": {
                        "type": "string",
                        "pattern": "^C[a-f0-9]{64}$"
                    }
                }
            }
        },
        "responses": {
            "Error": {
                "description": "400 请求格式；401 凭据无效/过期；403 未授权；404 资源不存在或不可见；405 方法不支持；409 nonce 重放；429 限流（Retry-After 秒）；503 平台关闭或依赖不可用。通过验签的失败请求也须使用新 nonce 重试。",
                "headers": {
                    "X-Request-Id": {
                        "schema": {
                            "type": "string"
                        }
                    },
                    "Retry-After": {
                        "schema": {
                            "type": "integer"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        },
        "securitySchemes": {
            "AccessKeySignature": {
                "type": "apiKey",
                "in": "header",
                "name": "Authorization",
                "description": "CS1-HMAC-SHA256 Credential=AKP<40hex> 或 AKT<40hex>,Signature=<64hex>。签入 Host、路径、规范查询和 X-Api-* 字段。AKT 必须携带 X-Api-Security-Token，并在 canonical 原有结尾追加换行和 Token 的 SHA-256 摘要；AKP 不携带该头。Secret 不发送给 API。"
            }
        }
    },
    "paths": {
        "/api/v1/apps": {
            "get": {
                "operationId": "listApps",
                "summary": "列出已授权应用",
                "description": "选择企业签名或普通分发模块，获取可操作的应用及完整 A 标识。首次请求省略 cursor，后续请求原样传回 next_cursor。空列表表示当前筛选和授权范围内没有应用。\n\nenterprise 需要 enterprise:ReadApps；distribution 需要 distribution:ReadApps。资源未授权时为空列表。无超级签名数据。\n\nsearch 对应用名称、Bundle ID、备注做关键词匹配，首尾空格忽略，最多 256 个 UTF-8 字节，不允许控制字符。% 和 _ 按普通字符匹配，不是通配符。bundle_id 是完整包名匹配（非关键词），最多 255 个 ASCII 字符；比较大小写规则跟随站点数据库排序规则。两个条件同时提供时取交集。翻页时保持 module、search、bundle_id、limit 不变；修改条件应省略 cursor 重新查询。每次只查询当前账号的已授权应用；不返回总数，查询超时不会退化为全表无限扫描。",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "module",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "enterprise",
                                "distribution"
                            ],
                            "default": "enterprise"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 50
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        },
                        "description": "上一页 next_cursor；不传为第一页"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 256
                        },
                        "description": "名称、Bundle ID 或备注关键词。最多 256 个 UTF-8 字节；百分号及下划线按字面匹配；空值不筛选。"
                    },
                    {
                        "name": "bundle_id",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 255,
                            "pattern": "^(?:[A-Za-z0-9][A-Za-z0-9._-]*)?$"
                        },
                        "description": "完整 Bundle ID，精确匹配；空值不筛选。与 search 同时指定时取交集。"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "按公开 ID 升序，游标分页",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "object",
                                            "required": [
                                                "items",
                                                "next_cursor"
                                            ],
                                            "properties": {
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/App"
                                                    }
                                                },
                                                "next_cursor": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            },
            "post": {
                "operationId": "createApp",
                "summary": "预留新应用",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "description": "创建上传前的应用预留，立即返回 A 标识。24 小时内为该 A 上传首包。包名及平台校验成功后才生成可管理的正式应用。每个账号同时最多保留 10 个待完成预留。企业签名选 ipa，普通分发可选 ipa 或 apk。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Creation"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "module",
                                    "platform",
                                    "name",
                                    "bundle_id"
                                ],
                                "properties": {
                                    "module": {
                                        "type": "string"
                                    },
                                    "platform": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "bundle_id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{id}": {
            "get": {
                "operationId": "getApp",
                "summary": "查询应用详情",
                "description": "把应用列表返回的 id 放入路径，取得包名、平台、版本、Build、包大小及更新时间。需要下载某一版本的安装包时，再查询版本列表并申请下载凭证。\n\n需要相应模块 ReadApps 动作及资源授权；不接受查询参数，不返回包地址、证书或私有存储信息。",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "应用详情",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/App"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/versions": {
            "get": {
                "operationId": "listVersions",
                "summary": "列出应用历史版本",
                "description": "从最近版本开始分页。用 package_type 区分原包和签名产物，从返回项取得 V 标识和 is_current。next_cursor 为空时已读完。\n\n需要 enterprise:ReadVersions 或 distribution:ReadVersions，及相应应用范围；不隐含 ReadApps 权限。按版本记录创建顺序倒序分页，V 标识不包含内部序号。 不做总量 COUNT；非快照分页。删除游标对应记录后返回 InvalidCursor 400，不静默重置到第一页。",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 50
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "pattern": "^V[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "package_type",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "original",
                                "signed"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "type": "object",
                                            "required": [
                                                "items",
                                                "next_cursor"
                                            ],
                                            "additionalProperties": false,
                                            "properties": {
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Version"
                                                    }
                                                },
                                                "next_cursor": {
                                                    "oneOf": [
                                                        {
                                                            "type": "null"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "pattern": "^V[a-f0-9]{32}$"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/versions/{version_id}": {
            "get": {
                "operationId": "getVersion",
                "summary": "查询指定版本",
                "description": "从同一应用的历史版本列表取 V 标识，与 A 标识一起传入路径。核对 Build、大小和包类型后，可据此申请下载凭证。\n\n需要 enterprise:ReadVersions 或 distribution:ReadVersions，及相应应用范围；不隐含 ReadApps 权限。按版本记录创建顺序倒序分页，V 标识不包含内部序号。 详情不接受查询参数。",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "version_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^V[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Version"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads": {
            "post": {
                "operationId": "createUpload",
                "summary": "创建版本上传",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "为企业签名或普通分发应用创建上传任务。推荐使用 SDK 上传助手，自动完成分片、传输与确认，无需选择存储厂商或填写后台存储配置。自行实现 HTTP 时，通用分片流程提交 transfer_mode=multipart；整包方式提交文件摘要。立即保存响应 data.id，它就是上传任务 ID，后续查询、申请凭证、确认分片及恢复上传均使用此值。任务创建成功不代表安装包已保存为版本。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Upload"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "oneOf": [
                                    {
                                        "$ref": "#/components/schemas/UploadInput"
                                    },
                                    {
                                        "$ref": "#/components/schemas/MultipartUploadInput"
                                    }
                                ]
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            },
            "get": {
                "operationId": "listUploads",
                "summary": "列出应用上传任务",
                "description": "查询企业签名或普通分发应用的上传记录，按 created_at、上传任务 ID倒序分页，支持 state 筛选。可找回上传中、等待校验或已结束的任务，继续查询进度或恢复同一个上传。\n\n只返回当前账号、当前业务 A 且由当前 API 应用创建的记录。需对应模块 UploadVersions 和写入准入；AKT 只读会话不可调用。OAuth 还须独立终端上传授权，且只能查询用户授权的既有应用。每页 1–100 条，不执行全量 COUNT，不返回对象路径、存储账号、URL 或凭据。保留 U 的情况下也可直接查询上传详情。状态变化不使当前应用内的游标失效；已清理、其他业务应用或其他 API 应用的游标返回 InvalidCursor。新应用上传校验成功前，用创建预留返回的 A 查询，并保持原 API 应用。",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 50
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "uploading",
                                "validating",
                                "succeeded",
                                "failed",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "type": "object",
                                            "required": [
                                                "items",
                                                "next_cursor"
                                            ],
                                            "additionalProperties": false,
                                            "properties": {
                                                "items": {
                                                    "type": "array",
                                                    "items": {
                                                        "$ref": "#/components/schemas/Upload"
                                                    }
                                                },
                                                "next_cursor": {
                                                    "oneOf": [
                                                        {
                                                            "type": "null"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "pattern": "^U[a-f0-9]{32}$"
                                                        }
                                                    ]
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}": {
            "get": {
                "operationId": "getUpload",
                "summary": "查询上传和校验进度",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "通过创建上传响应 data.id 中的上传任务 ID查看 state、expires_at 和 version_id。提交整包校验后查询此接口，取得版本 ID 后再发布或签名。如果失败，保留 error_code 和 request_id。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Upload"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/ticket": {
            "get": {
                "operationId": "getUploadTicket",
                "summary": "获取整包上传凭证",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "用于整包上传。按 ticket 指定的地址、方法和签名请求头上传原始文件字节，再提交整包校验。向存储发请求时只发送票据要求的头，平台 AccessKey 仅用于平台 API。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UploadTicket"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/complete": {
            "post": {
                "operationId": "completeUpload",
                "summary": "提交整包校验",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "上传全部字节后用空对象提交。分片模式先确认每一片。这个调用提交后台校验，得到回执后仍须查询上传状态，等待可用的 version_id。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Upload"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [],
                                "properties": {}
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/abort": {
            "post": {
                "operationId": "abortUpload",
                "summary": "取消未完成上传",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "用户放弃上传时，使用原 U 和一个独立的幂等键取消。先查上传状态，已进入后续处理的上传可能无法取消。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Upload"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [],
                                "properties": {}
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/parts": {
            "get": {
                "operationId": "listUploadParts",
                "summary": "查询已申报的分片",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 100
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1024,
                            "default": 0
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "断点续传时按 U 查询分片序号、摘要和 uploaded。只跳过已经确认且摘要匹配的分片。继续分页时传 next_after，确认完所有分片再提交整包校验。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UploadParts"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            },
            "post": {
                "operationId": "declareUploadPart",
                "summary": "申报分片摘要",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "按任务返回的 part_size_bytes 切分原始文件，从 1 开始为每片计算 SHA-256 并申报。同一 U 下同一序号的内容应始终一致，随后为该片申请上传凭证。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UploadPart"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UploadPartInput"
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/parts/{part_number}/ticket": {
            "get": {
                "operationId": "getUploadPartTicket",
                "summary": "获取分片上传凭证",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "part_number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1024
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "为已声明的分片申请短期上传指令。将结果交给 SDK 自动传输，无需识别或配置底层存储。自行实现 HTTP 时，严格按照返回的方法、请求头或表单字段发送原分片。传输完成后仍须确认分片，不能仅凭文件传输成功开始发布。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UploadPartTicket"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/uploads/{upload_id}/parts/{part_number}/complete": {
            "post": {
                "operationId": "completeUploadPart",
                "summary": "确认分片已上传",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "upload_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^U[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "name": "part_number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1024
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "存储返回成功后调用。若传输响应丢失，先确认同一分片。收到 PartMissing 再获取票据补传。确认成功仅代表该片可用于后续整包校验。",
                "responses": {
                    "200": {
                        "description": "成功受理；异步操作须继续查询状态",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/UploadPart"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [],
                                "properties": {}
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/download-tickets": {
            "post": {
                "operationId": "createDownloadTicket",
                "summary": "申请原包或签名包下载链接",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "description": "指定 A、V 和 package_type。第一次成功时立即保存 ticket，按其 method、url 和 headers 下载，并比对 size_bytes。幂等重放仅返回回执。链接到期后需用新的业务幂等键申请。文件传输服务由平台自动处理，调用方不选择存储厂商。\n\n账号需开通对应下载能力，原包与签名包分别授权；API 应用分别授予 DownloadOriginal / DownloadSigned，绑定自己的完整应用及版本。时长为 60–300 秒，受账号上限及 AKP 到期时间约束。AKT 及超级签名不支持。不会发布、扣费或增加安装/下载统计。重复幂等请求只返回 ticket=null 的回执，不重新签发链接。已发出存储链接在期限内可重复使用，撤销平台 AKP 不能保证即时撤回该链接；过期只阻止新下载请求，不强制中断正在进行的传输。没有 HEAD/内容校验，存储缺失可能在 GET 时返回 404，须与预期大小比对；本响应不宣称提供内容摘要。",
                "responses": {
                    "200": {
                        "description": "首次返回短期链接；重复请求返回相同回执且 ticket=null。响应不得缓存。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DownloadReceipt"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "version_id",
                                    "package_type",
                                    "duration_seconds"
                                ],
                                "properties": {
                                    "version_id": {
                                        "type": "string",
                                        "pattern": "^V[a-f0-9]{32}$"
                                    },
                                    "package_type": {
                                        "type": "string",
                                        "enum": [
                                            "original",
                                            "signed"
                                        ]
                                    },
                                    "duration_seconds": {
                                        "type": "integer",
                                        "minimum": 60,
                                        "maximum": 300
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/distribution-settings": {
            "get": {
                "operationId": "getDistributionSettings",
                "summary": "读取分发下载页设置",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功；响应禁止缓存。版本冲突须重新读取并由调用方确认，禁止 SDK 自动覆盖。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DistributionSettings"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "description": "查询当前模板、语言、介绍和 revision。下拉选择请使用返回的 available_template_ids 和 available_languages，保存设置时带回 revision。\n\n须单独授予 distribution:ReadSettings。只支持普通应用分发，返回当前模板、语言、纯文本介绍、内容版本标识和可用选项；可使用显式授予此动作的指定应用只读 AKT。",
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "distribution"
                ]
            },
            "post": {
                "operationId": "updateDistributionSettings",
                "summary": "修改分发下载页设置",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功；响应禁止缓存。版本冲突须重新读取并由调用方确认，禁止 SDK 自动覆盖。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DistributionSettingsUpdated"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/DistributionSettingsInput"
                            }
                        }
                    }
                },
                "description": "将最近读取的 revision 与模板、语言、纯文本介绍一并提交。介绍转义后最多 255 个字符。成功后读取 settings 获取新版本。遇到修订冲突先展示最新设置供确认。\n\n仅 AKP；账号已开通分发设置修改，并且 API 应用授予 distribution:UpdateSettings。必须提交全部四个字段，拒绝未知/重复字段。模板 1–8，语言来自读取结果，介绍按纯文本转义后须不超过 255 字符。版本标识绑定当前应用及三个字段原始内容，网页保存变更后返回 RevisionConflict 409。成功回执在同一事务保存；相同幂等键和字节返回旧回执并标记 replayed=true，不再次修改，也不覆盖之后的网页保存。读取与修改权限独立，未开放上传/签名写入不影响单独审批的设置修改。锁定、删除、封停、跨账号和超级签名均禁止修改；不改短链、密码、文件、计费或安装规则。",
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/statistics": {
            "get": {
                "operationId": "getAppStatistics",
                "summary": "查询应用安装、启动与下载统计",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存。daily 为升序 30 日；end_date 含今日，end_at 为明日 00:00 的排他上界。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AppStatistics"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "description": "查看累计、今日和近 30 日趋势。应用总安装按准入设备指纹跨版本去重，启动是联网记录的事件次数。查看 installation_statistics_state 区分可用、未初始化、不适用，null 表示无可用计数。\n\n账号需开通统计查询，并显式授予 enterprise:ReadStatistics 或 distribution:ReadStatistics。固定近 30 个 Asia/Shanghai 自然日，不接受查询参数。允许显式授予统计动作的指定应用 AKT。下载为现有准入计数，非下载完成或唯一设备；安装按应用设备指纹去重，不累加版本计数。首次打开计入当前启动规则；历史总启动可能不含首次，迁移当日标注估计。不返回历史每日启动以免伪造趋势。计数受现有重置与留存影响，不承诺永久累计。未初始化安装统计返回 null/state；缺失表/索引、超查询上限或不安全数值返回 StatisticsUnavailable(503)，不扫描设备表补算。账号默认关闭、10 次/分钟，可设 1–60；全局统计 600 次/分钟，并继续受一般限流。",
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/pricing": {
            "get": {
                "operationId": "getAppPricing",
                "summary": "列出套餐和按天价格",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存。产品 SKU 必须在对应模块使用；签名月套餐每月按现有 30 日计算，分发会员按一年服务规则。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AppPricing"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "description": "查询本账号在该应用上的套餐 SKU、金额单位、按天范围和退款规则。显示价格时保留金额字符串及返回的单位。选好 SKU 后可查询参考价或创建购买报价。\n\n须显式授予对应模块 ReadPricing，可使用明确授予此动作的单应用 AKT。按当前账号专属价/全局折扣和后台配置计算，不读网页登录身份。每个账号所有 API 应用/密钥共用 30 次/分钟，仍受一般限流。两位小数金额为字符串，currency 是站内展示单位，外部结算依支付服务商。pricing_revision 是本次价格内容指纹，不是财务报价票据；reference_only=true、payment_api_available=false。不创建订单、扣款、锁价或承诺库存/可购买/可退款，后续真实支付须重新确认。 此参考响应的 payment_api_available=false 不表示购买报价接口不存在；真实购买须另行创建 purchase-quotes，不能直接支付此参考结果。",
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/quote": {
            "get": {
                "operationId": "getAppQuote",
                "summary": "查询套餐参考价",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/SecurityToken"
                    },
                    {
                        "name": "sku",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "required": false,
                        "description": "仅 day1/day2/day3 必须提供；实际范围取当前配置，其他套餐禁止携带。",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3650
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存。产品 SKU 必须在对应模块使用；签名月套餐每月按现有 30 日计算，分发会员按一年服务规则。",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AppQuote"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "description": "传入价格列表中的 sku。按天 SKU 还要传 days。此查询用于界面试算，真正付款要先创建带 Q 标识的购买报价。\n\n须显式授予对应模块 ReadPricing，可使用明确授予此动作的单应用 AKT。按当前账号专属价/全局折扣和后台配置计算，不读网页登录身份。每个账号所有 API 应用/密钥共用 30 次/分钟，仍受一般限流。两位小数金额为字符串，currency 是站内展示单位，外部结算依支付服务商。pricing_revision 是本次价格内容指纹，不是财务报价票据；reference_only=true、payment_api_available=false。不创建订单、扣款、锁价或承诺库存/可购买/可退款，后续真实支付须重新确认。 此参考响应的 payment_api_available=false 不表示购买报价接口不存在；真实购买须另行创建 purchase-quotes，不能直接支付此参考结果。",
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/creation": {
            "get": {
                "operationId": "getAppCreation",
                "summary": "查询应用创建进度",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    }
                ],
                "description": "使用预留新应用返回的 A 标识查询预留状态及截止时间。首次上传完成后，用同一 A 查询正式应用详情。请使用创建该预留的 API 应用。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Creation"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/metadata": {
            "get": {
                "operationId": "getAppMetadata",
                "summary": "读取名称、备注与修订号",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    }
                ],
                "description": "修改应用资料前调用，保存返回的 revision、name 和 remark。提交修改时带回该 revision，以免覆盖网页或其他接入程序的新改动。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AppMetadata"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            },
            "post": {
                "operationId": "updateAppMetadata",
                "summary": "修改应用名称与备注",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "description": "先读取最新资料，再同时提交 revision、name、remark。已开通企业签名的应用只可修改备注，此时 name 传原名称。成功后保存新的 revision。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/AppMetadata"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "revision",
                                    "name",
                                    "remark"
                                ],
                                "properties": {
                                    "revision": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "remark": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/publish": {
            "post": {
                "operationId": "publishVersion",
                "summary": "发布或回滚指定版本",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "description": "先列出版本，取目标 version_id 和当前发布的 current_version_id。普通分发可切换到对应历史包，企业签名可回滚到符合设备验证要求的已签名历史包。并发发布时重新读取当前版本并让用户确认。\n\n普通分发发布原包或企业签名受控回滚。分别需要 distribution:PublishVersions / enterprise:PublishVersions，以及应用管理审批。企业包须为同证书、未停用、具有独立安装验证的签名包；保留原包、设备及统计身份。当前版本条件与事务幂等防止并发覆盖。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PublishedVersion"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "version_id",
                                    "current_version_id"
                                ],
                                "properties": {
                                    "version_id": {
                                        "type": "string"
                                    },
                                    "current_version_id": {
                                        "type": "string",
                                        "pattern": "^(?:V[a-f0-9]{32})?$"
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/trash": {
            "post": {
                "operationId": "trashApp",
                "summary": "确认删除应用",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "description": "在业务界面向用户确认后，将路径中的完整 A 标识同时传入 confirm_app_id。成功后应用退出用户列表，文件保留。企业签名应用进入回收站。\n\n普通分发或企业签名确认删除，分别需要独立的 distribution:TrashApps / enterprise:TrashApps 动作及应用管理审批。confirm_app_id 须等于路径。保留安装包和历史记录，不物理删除云文件。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TrashedApp"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": false,
                                "required": [
                                    "confirm_app_id"
                                ],
                                "properties": {
                                    "confirm_app_id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/purchase-quotes": {
            "post": {
                "operationId": "createPurchaseQuote",
                "summary": "创建开通或续费报价",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/Idempotency"
                    }
                ],
                "description": "选定 SKU 和天数后创建五分钟保价报价。保存 Q 标识、金额、pricing_revision 与 currency.revision，向用户展示并确认后再调用余额付款。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 另需对应模块 ReadPricing 和 CreatePurchaseQuotes。报价采用当前付款账号价格，五分钟内按原报价金额支付；不预扣或占用余额。day 套餐须提供字符串 days，其他套餐不得提供。普通分发购买的是账号点数/会员权益，不限制于此应用。每个账号最多 100 个未使用报价。 账务对账隔离期间返回 PaymentQuarantined，请保留原订单与 request_id 联系平台复核；修改预算不能解除隔离。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PurchaseQuote"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PurchaseQuoteInput"
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/purchase-quotes/{quote_id}": {
            "get": {
                "operationId": "getPurchaseQuote",
                "summary": "查询购买报价及付款结果",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "quote_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^Q[a-f0-9]{32}$"
                        }
                    }
                ],
                "description": "按 Q 查询报价是否到期或已消费。付款响应丢失时先查原报价。包含完整付款回执还须具备付款动作且来源 IP 满足付款条件。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 须对应模块 CreatePurchaseQuotes，只能查询本 API 应用创建的报价。已付款回执是付款时快照，后续网页退款以订单状态与当前应用权益为准；不会重新发放权益。 已支付报价的完整 receipt 包含付款时余额，额外要求当前模块 PayOrders 与明确付款 IP 白名单；仅报价权限时返回 paid 状态和 receipt=null。回执为历史快照，不能替代当前权益查询。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PurchaseQuote"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        },
        "/api/v1/apps/{app_id}/purchase-quotes/{quote_id}/pay": {
            "post": {
                "operationId": "payPurchaseQuote",
                "summary": "使用余额支付购买报价",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/Date"
                    },
                    {
                        "$ref": "#/components/parameters/Nonce"
                    },
                    {
                        "$ref": "#/components/parameters/BodyHash"
                    },
                    {
                        "$ref": "#/components/parameters/Environment"
                    },
                    {
                        "name": "app_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^A[a-f0-9]{32}$"
                        }
                    },
                    {
                        "name": "quote_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "^Q[a-f0-9]{32}$"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FinancialIdempotency"
                    }
                ],
                "description": "按用户确认的原报价提交 balance、金额与两个修订号。成功后余额扣减并发放对应权益。开通企业签名后，另行提交签名任务。请求超时应先查原 Q。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 须对应模块 PayOrders；来源须匹配 IPv4 /24 或更精确、IPv6 /64 或更精确的白名单。严格确认金额字符串、价格版本和金额单位版本，余额、订单、权益、退款快照、预算和长期回执在同一事务提交。余额不足、报价过期、应用/权益变化或预算不足均不扣款。两层预算按 Asia/Shanghai 的 API 成功付款总额计算，退款不返还预算；金额单位变化须重新审批。支付响应丢失时使用原幂等键重试或 GET 原报价，禁止盲目另建付款。 新付款因账务不一致可被隔离；具有当前付款权限的原成功幂等回执仍可查询。付款和 API 来源的网站退款在同一资金事务登记可靠财务通知。",
                "responses": {
                    "200": {
                        "description": "成功；禁止缓存",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "required": [
                                        "request_id",
                                        "data"
                                    ],
                                    "properties": {
                                        "request_id": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{32}$"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PurchaseReceipt"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PurchaseConfirmation"
                            }
                        }
                    }
                },
                "tags": [
                    "应用分发"
                ],
                "x-cloudsign-products": [
                    "enterprise",
                    "distribution"
                ]
            }
        }
    },
    "x-cloudsign-webhooks": "webhooks-v1.json",
    "tags": [
        {
            "name": "应用分发",
            "description": "普通 IPA / APK 应用的创建、更新上传、版本发布、下载页设置、套餐购买与用量查询。应用分发业务 API 需要授权，面向安装用户的下载页面可免登录访问。"
        }
    ],
    "x-cloudsign-product": "distribution"
}
