Skip to content

API cleaning #213

Open
Open
@sophia-ooo

Description

@sophia-ooo

API

GET /pattern
Get JSON for all nodes.

POST /pattern
Import JSON without a parent group.
expects JSON body []CreateElement

GET /pattern?action=get&id=,,,
(recursive) Batch JSON export of nodes.

POST /pattern?action=reset&id=,,,
(recursive) Batch reset nodes.

POST /pattern?action=delete&id=,,,
(recursive) Batch delete nodes.

POST /pattern?action=ungroup&id=,,,
Batch ungroup nodes. Each group deleted and all child nodes are given to their grandparent.

POST /pattern?action=translate&x=<offset>&y=<offset>&id=,,,
Batch translate nodes by offset.

GET /pattern/{id}
Get JSON of id and all descendants of id.

POST /pattern/{id}
Import JSON with parent group of id.
expects JSON body []CreateElement

PUT /pattern/{id}
sets node root keys.
expects JSON body UpdateElement

GET /pattern/{id}/state
returns node state (if applicable)

PUT /pattern/{id}/state
sets node state (if applicable)
expects JSON body

PUT /pattern/{id}/routes/{route_id}
sets route state on a group (if applicable)
expects JSON body UpdateElement

websocket client

subscription

{
    "action": "subscribe"
    "id": string
}

websocket server

element creation

{
    "action":"create"
    "data": [ Element ]
}

element translation

{
    "action":"translate"
    "x": int
    "y": int
    "data": [ ID ]
}

elements deleted

{
    "action":"delete"
    "data": [ ID ]
}

elements update alias

{
    "action":"update_alias"
    "id": string
    "alias": string
}

elements update position

{
    "action":"update_position"
    "id": string
    "position":{
        "x":int
        "y":int
    }
}

element update group route alias

{
    "action":"update_alias"
    "id": string
    "alias": string
}

element update group route hidden

{
    "action":"update_alias"
    "id": string
    "hidden": bool
}

element status

{
    "action":"status"
    "id": string
    "code": int
}

pattern JSON

[ Element... ] 

where element order is leaf-first

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions