<?php

declare(strict_types=1);

/**
 * 本文件属于 DBErp 进销存系统。
 *
 * 版权所有 © 2026 北京珑大钜商科技有限公司。保留所有权利。
 *
 * 未经官方授权，不得删除、篡改或隐藏本文件中的版权声明、产品标识与来源信息。
 * 商业授权、官方更新与技术支持服务，请以珑大官方支持中心记录为准。
 *
 * @link https://support.loongdom.cn
 * @see  https://www.dberp.com.cn
 */

namespace App\Services\SupportCenter;

/**
 * Loongdom Support Center Open Host API 端点路径。
 */
final class SupportCenterOpenHostEndpoints
{
    public const SITE_BINDING_ACCESS_CONFIRM = '/api/open/v1/host/site-binding-validations/access-confirm';

    public const SITE_BINDING_STATUS = '/api/open/v1/host/site-binding-validations/status';

    public const SITE_PRESENCE = '/api/open/v1/host/site-presence';

    public const AUTHORIZATION_SYNC = '/api/open/v1/host/authorizations/sync';

    public const SYSTEM_UPDATE_CHECK = '/api/open/v1/host/system-updates/check';

    public const SYSTEM_UPDATE_DOWNLOAD_TOKEN = '/api/open/v1/host/system-updates/download-token';

    public const SYSTEM_UPDATE_DOWNLOAD = '/api/open/v1/host/system-updates/download';

    public const SYSTEM_UPDATE_RESULTS = '/api/open/v1/host/system-updates/results';

    public const SYSTEM_UPDATE_FAILURES = '/api/open/v1/host/system-updates/failures';

    public const PLUGIN_CATALOG = '/api/open/v1/host/plugins/catalog';

    public const PLUGIN_UPDATE_CHECK = '/api/open/v1/host/plugins/updates/check';

    public static function pluginDetail(string $pluginCode): string
    {
        return '/api/open/v1/host/plugins/'.rawurlencode(trim($pluginCode));
    }

    public static function pluginClaimCheck(string $pluginCode): string
    {
        return '/api/open/v1/host/plugins/'.rawurlencode(trim($pluginCode)).'/claim-check';
    }

    public static function pluginDownloadToken(string $pluginCode): string
    {
        return '/api/open/v1/host/plugins/'.rawurlencode(trim($pluginCode)).'/download-token';
    }

    public static function pluginDownload(string $downloadToken): string
    {
        return '/api/open/v1/host/plugins/downloads/'.trim($downloadToken);
    }
}
