1
0
forked from BRT/arc
arc/services/scripting/ScriptingConfig.h
slava cae345cf61 Implement JS-based remote scripting framework for dynamic script updates:
- Add Proof of Concept (PoC) for executing JavaScript scripts fetched remotely.
- Integrate `Black::GetProfileInfoScript` logic into a JS version with fallback to C++ on errors.
- Extend `ScreenXmlParser` with additional JS-to-C++ bridge methods.
- Update `config.ini` for scripting configuration.
- Ensure scripts are securely fetched with SHA-256 validation and use an atomic caching mechanism.
- Add developer tools for debugging JS scripts and enable easier script updates without app re-deployment.
2026-05-13 15:42:10 +07:00

34 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <QSet>
#include <QString>
namespace Scripting {
// Тонкая обёртка над секцией [scripting] в config.ini.
// Все методы перечитывают конфиг по требованию — изменения без рестарта подхватятся.
class ScriptingConfig {
public:
// Глобальный выключатель: [scripting] enabled = true|false. Default: false.
static bool isEnabled();
// Список скриптов, для которых разрешён JS-вариант.
// [scripting] use_js_for = black/get_profile_info, ozon/get_profile_info
static bool isJsEnabledFor(const QString &bankSlashScript);
// URL манифеста (опционально, по умолчанию пусто = remote-update выключен).
// [scripting] manifest_url = http://.../api/v1/scripts/manifest
static QString manifestUrl();
// Каталог локального кэша. Default: <AppDataLocation>/scripts/
static QString cacheDir();
// Запасной каталог bundled-скриптов (рядом с бинарником). Default: ./scripts/
static QString bundledDir();
private:
static QSet<QString> parseEnabledScripts();
};
} // namespace Scripting