{ "module": "brother", "version": "1", "emits": [ "scan.added" ], "config": { "scanner": { "type": "string", "description": "The network scanner's eSCL address, such as http://192.0.2.10/eSCL: the scanner's own address and the path its eSCL service answers on; the operator's, with no default.", "pattern": "^https?://.+", "trusted": true, "required": true }, "scan-folder": { "type": "string", "description": "The absolute path of the folder the scans are filed in as PDF files; the module makes it when it files the first scan, and never touches a file in it that it did not write. The operator's, with no default.", "pattern": "^/", "trusted": true, "required": true }, "resolution": { "type": "number", "description": "The resolution asked of the scanner, in dpi: 100, 200, 300 or 600. A scanner may give another; the scan is filed at the resolution it gave.", "enum": [ 100, 200, 300, 600 ], "trusted": false, "default": 300 }, "color-mode": { "type": "string", "description": "Whether the scan is in colour or in grays: color or gray.", "enum": [ "color", "gray" ], "trusted": false, "default": "color" }, "crop": { "type": "boolean", "description": "Whether the document is cut out of the platen's white lid; false files the whole platen.", "trusted": false, "default": true } }, "seats": [ { "name": "scanner", "scope": "mesh", "serves": [ "scan", "status", "list" ] } ], "claims": [ { "name": "scanner", "scope": "mesh", "serves": [ "scan", "status", "list" ] } ], "tools": [ "scanner.scan", "scanner.status", "scanner.list" ], "resources": [ { "id": "state", "type": "directory", "mode": "0700", "owner": "${machine:account}", "place": ".", "unknown": "program" }, { "id": "settings", "type": "file", "path": "${dir:state}/settings.json", "owner": "${machine:account}", "mode": "0600", "takes-config": [ "scanner", "scan-folder", "resolution", "color-mode", "crop" ], "merge": "json", "template": "files/settings.json" } ], "build": { "artifacts": [ { "name": "tools", "kind": "bundle", "language": "go", "system": "arch", "from": "cmd/brother", "binary": "brother", "loads": [ "brother" ], "env": { "BROTHER_SETTINGS": "${dir:state}/settings.json" } }, { "name": "files", "kind": "archive", "from": "files" } ] } }