{
    "name": "Счётчик",
    "description": "Команда, кнопка и страница с общим счётчиком.",
    "version": "1.0.0",
    "permissions": {
        "telegram.read": {},
        "telegram.send": {},
        "bot.read": {},
        "bot.send": {},
        "db.read": {},
        "db.write": {},
        "config.read": {},
        "interface.read": {},
        "interface.write": {}
    },
    "dependencies": [],
    "changes": "Счётчик, кнопка увеличения и форма сброса.",
    "source": true,
    "interface": {
        "commands": [
            {
                "id": "counter",
                "alias": "counter",
                "access": "trusted",
                "source": "both"
            }
        ],
        "handlers": [
            {
                "id": "changed",
                "source": "telegram",
                "event": "config",
                "access": "public"
            }
        ],
        "callbacks": [
            {
                "id": "increment",
                "fields": {
                    "amount": {
                        "type": "integer",
                        "min": 1,
                        "max": 100,
                        "default": 1
                    }
                },
                "access": "trusted",
                "confirm": false
            }
        ],
        "actions": [
            {
                "id": "reset",
                "fields": {
                    "value": {
                        "type": "integer",
                        "min": 0,
                        "max": 1000,
                        "default": 0
                    }
                },
                "access": "trusted",
                "confirm": true
            }
        ],
        "config": {
            "step": {
                "type": "integer",
                "label": {
                    "ru": "Шаг",
                    "en": "Step"
                },
                "min": 1,
                "max": 100,
                "default": 1
            }
        },
        "pages": [
            {
                "id": "main",
                "title": {
                    "ru": "Счётчик",
                    "en": "Counter"
                },
                "elements": [
                    {
                        "id": "count",
                        "type": "metric",
                        "label": {
                            "ru": "Значение",
                            "en": "Value"
                        }
                    },
                    {
                        "id": "reset",
                        "type": "form",
                        "action": "reset",
                        "label": {
                            "ru": "Задать значение",
                            "en": "Set value"
                        }
                    }
                ]
            }
        ]
    }
}
