2025-02-06 15:26:47 +07:00
|
|
|
#ifndef APIUTILS_H
|
|
|
|
|
#define APIUTILS_H
|
|
|
|
|
|
2025-02-15 13:58:48 +07:00
|
|
|
#include <QNetworkReply>
|
2025-02-06 15:26:47 +07:00
|
|
|
#include <QObject>
|
|
|
|
|
|
2025-02-07 22:22:14 +07:00
|
|
|
#include "apiDefs.h"
|
2025-02-15 13:58:48 +07:00
|
|
|
#include "core/defs.h"
|
2025-02-07 22:22:14 +07:00
|
|
|
|
|
|
|
|
namespace apiUtils
|
2025-02-06 15:26:47 +07:00
|
|
|
{
|
2025-02-07 22:22:14 +07:00
|
|
|
bool isServerFromApi(const QJsonObject &serverConfigObject);
|
|
|
|
|
|
2025-02-06 15:26:47 +07:00
|
|
|
bool isSubscriptionExpired(const QString &subscriptionEndDate);
|
2025-02-07 22:22:14 +07:00
|
|
|
|
2026-04-17 15:01:24 +08:00
|
|
|
bool isSubscriptionExpiringSoon(const QString &subscriptionEndDate, int withinDays = 30);
|
2026-04-08 11:21:12 +07:00
|
|
|
|
2025-04-16 09:58:44 +07:00
|
|
|
bool isPremiumServer(const QJsonObject &serverConfigObject);
|
|
|
|
|
|
2025-02-07 22:22:14 +07:00
|
|
|
apiDefs::ConfigType getConfigType(const QJsonObject &serverConfigObject);
|
2025-02-15 11:50:42 +07:00
|
|
|
apiDefs::ConfigSource getConfigSource(const QJsonObject &serverConfigObject);
|
2025-02-15 13:58:48 +07:00
|
|
|
|
2025-10-06 08:06:36 +04:00
|
|
|
amnezia::ErrorCode checkNetworkReplyErrors(const QList<QSslError> &sslErrors, const QString &replyErrorString,
|
|
|
|
|
const QNetworkReply::NetworkError &replyError, const int httpStatusCode,
|
|
|
|
|
const QByteArray &responseBody);
|
2025-05-13 12:29:33 +08:00
|
|
|
|
|
|
|
|
QString getPremiumV1VpnKey(const QJsonObject &serverConfigObject);
|
2025-10-07 19:16:28 +04:00
|
|
|
QString getPremiumV2VpnKey(const QJsonObject &serverConfigObject);
|
2025-02-06 15:26:47 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // APIUTILS_H
|