Editor Driver for ATX
Port: 17310
To memorize the create day: 2017/03/10
pip install weditor
python -m weditor
This method returns local server version
GET /api/v1/version
Status: 200
{
"name": "0.0.2"
}
This method returns the contents of a file or directory in a repository
GET /api/v1/contents/:path
Status: 200 OK
{
"type": "file",
"encoding": "base64",
"size": 5362,
"name": "README.md",
"path": "README.md",
"content": "encoded content ...",
"sha": "3d21ec53a331a6f037a91c368710b99387d012c1"
}
Status: 200 OK
[
{
"type": "file",
"size": 5362,
"name": "README.md",
"path": "README.md",
"sha": "3d21ec53a331a6f037a91c368710b99387d012c1"
},
{
"type": "dir",
"size": 0,
"name": "foo",
"path": "foo",
}
]
This method creates a new file in repository
POST /api/v1/contents/:path
{
"content": "bXkgbmV3IGZpbGUgY29udGVudHM="
}
Status: 201 Created
{
"content": {
"type": "file",
"name": "hello.txt",
"path": "notes/hello.txt",
"sha": "95b966ae1c166bd92f8ae7d1c313e738c731dfc3",
"size": 9
}
}
This method returns devices connected to PC
GET /api/v1/devices
GET /api/v1/user/device
PUT /api/v1/user/device
{
"serial": "cff12345"
}
GET /api/v1/devices/:serial/screenshot
{
"type": "jpeg",
"data": "bXkgbmV3IGZpbGUgY29udGVudHM"
}
Status: 403
{
"description": "Some reason"
}
Get uiview with json response
GET /api/v1/devices/{serial}/uiview
Status: 200
Every node will always has an id
field. iOS and Android got the some response structure.
{
"nodes": [{
"id": 0,
"text": "Hello",
"description": "hello",
"other...": "..."
}, {
"id": 1,
"other...": ".."
}]
}
This method run and get the live output
WebSocket CONNECT /api/v1/build
SEND json data
{
"content": "print('hello')"
}
RECV json data when running
{
"buffer": "hello"
}
RECV json data when finished. duration unit is ms.
{
"buffer": "end ...",
"result": {
"duration": 1002,
"exitCode": 1
}
}