Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions plugins/sample-manifest-v1/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"manifest_version": 1,
"name": "Manifest v1 Example",
"version": "1.0.0",
"description": "Example of the version 1 capability declaration format.",
"author": "Dispatcharr Team",
"maintainers": [
"sethwv"
],
"help_url": "https://github.com/Dispatcharr/Plugins",
"capabilities": [
"outbound_network"
],
"fields": [
{
"id": "endpoint",
"label": "Endpoint",
"type": "string",
"default": "https://example.com"
}
],
"actions": [
{
"id": "check_endpoint",
"label": "Check Endpoint",
"description": "Shows the version 1 capability declaration pattern."
}
],
"license": "Unlicense",
"unlisted": "true"
}
14 changes: 14 additions & 0 deletions plugins/sample-manifest-v1/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class Plugin:
name = "Official Manifest v1 Example"
version = "1.0.0"
description = "Dispatcharr-maintained example of manifest version 1."
author = "Dispatcharr Team"

def run(self, action, params, context):
if action != "check_endpoint":
return {"status": "error", "message": f"Unknown action: {action}"}
return {
"status": "ok",
"message": "Manifest version 1 declares capabilities for approval without runtime enforcement.",
"endpoint": context["settings"].get("endpoint"),
}
32 changes: 32 additions & 0 deletions plugins/sample-manifest-v2/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"manifest_version": 2,
"name": "Manifest v2 Example",
"version": "1.0.0",
"description": "Example of version 2 capability enforcement and durable plugin storage.",
"author": "Dispatcharr Team",
"maintainers": [
"sethwv"
],
"help_url": "https://github.com/Dispatcharr/Plugins",
"capabilities": [
"background_tasks"
],
"fields": [
{
"id": "message",
"label": "Message",
"type": "string",
"default": "Hello from Dispatcharr"
}
],
"actions": [
{
"id": "write_status",
"label": "Write Status",
"description": "Writes a status file to the plugin data directory.",
"async": true
}
],
"license": "Unlicense",
"unlisted": "true"
}
18 changes: 18 additions & 0 deletions plugins/sample-manifest-v2/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pathlib import Path


class Plugin:
name = "Official Manifest v2 Example"
version = "1.0.0"
description = "Dispatcharr-maintained example of manifest version 2."
author = "Dispatcharr Team"

def run(self, action, params, context):
if action != "write_status":
return {"status": "error", "message": f"Unknown action: {action}"}

message = context["settings"].get("message", "Hello from Dispatcharr")
status_path = Path(context["data_dir"]) / "status.txt"
status_path.write_text(message, encoding="utf-8")
context["report_progress"](100, "Status file written")
return {"status": "ok", "message": f"Wrote {status_path.name}"}
Loading