import {
    // 将 INodeCredentialType 替换为 ICredentialType
    ICredentialType,
    // 凭证属性的描述现在直接使用 INodeProperties 或 INodePropertyOptions
    INodeProperties,
} from 'n8n-workflow';

export class TencentCosApi implements ICredentialType { // <--- 修复点 1
    name = 'tencentCosApi';
    displayName = '腾讯云 COS API';
    properties: INodeProperties[] = [ // <--- 修复点 2: 属性类型改为 INodeProperties[]
        {
            displayName: 'SecretId',
            name: 'secretId',
            type: 'string', // 'type' 属性现在是 INodeProperties 的一部分
            default: '',
            placeholder: 'Your Tencent Cloud SecretId',
            description: '您的腾讯云 SecretId',
        },
        {
            displayName: 'SecretKey',
            name: 'secretKey',
            type: 'string', // 'type' 属性现在是 INodeProperties 的一部分
            typeOptions: {
                password: true, // 密码类型，输入时隐藏
            },
            default: '',
            placeholder: 'Your Tencent Cloud SecretKey',
            description: '您的腾讯云 SecretKey',
        },
    ];
}