Skip to content

Instantly share code, notes, and snippets.

@Gamer08YT
Created June 13, 2022 06:15
Show Gist options
  • Select an option

  • Save Gamer08YT/b533ebfef33343216e37111e95d66fb5 to your computer and use it in GitHub Desktop.

Select an option

Save Gamer08YT/b533ebfef33343216e37111e95d66fb5 to your computer and use it in GitHub Desktop.

Listeners (mytriox-listener.js)

Example Request to API:

{
  "id": "{% uuid 'v4' %}",
  "channel": "listener",
  "action": "list",
  "filter": {
    "page": "/"
  },
  "data": {},
  "encoding": false
}

Example Response from API:

{
  "id": "{% uuid 'v4' %}",
  "channel": "listener",
  "action": "list",
  "status": "SUCCESS",
  "data": {
    "click": {
      "tofofcamg3mq": {
        "type": "static",
        "channel": "multi",
        "action": "paket",
        "data": {
          "size": 1,
          "paket": [
            {
              "id": "f00581dd-1600-4c00-b471-6b51219e6176",
              "channel": "location",
              "action": "href",
              "status": "SUCCESS",
              "data": {
                "url": "https://www.byte-store.de/"
              },
              "polling": false,
              "encoding": false
            }
          ]
        }
      },
      "1ib8rf534rpdg": {
        "type": "static",
        "channel": "multi",
        "action": "paket",
        "data": {
          "size": 1,
          "paket": [
            {
              "id": "fe5ffd98-4a10-458b-918b-8ea2b8f5b50c",
              "channel": "location",
              "action": "href",
              "status": "SUCCESS",
              "data": {
                "url": "/install"
              },
              "polling": false,
              "encoding": false
            }
          ]
        }
      }
    }
  },
  "polling": false,
  "encoding": false
}

Example Diagram:

graph TD;
    Listener --> Type
    Type --> Static
    Type --> Dynamic
    Listener --> Channel
    Listener --> Action
    Listener --> Data
    Listener --> Status
    Listener --> Encoding
    Static --> Frontend
    Dynamic --> Frontend
    Dynamic --> Backend
    Backend --> Response
    Response --> Frontend
    Channel --> Event
    Action --> Event
    Data --> Parser
    Status --> Parser
    Encoding --> Parser
    Event --> Frontend
    Parser --> Event
Loading

Communication (mytriox-communication.js)

Example Request to API:

{
  "id": "{% uuid 'v4' %}",
  "channel": "baud",
  "action": "list",
  "data": {},
  "polling": false,
  "encoding": false
}

Example Response from API:

{
  "id": "{% uuid 'v4' %}",
  "channel": "baud",
  "action": "list",
  "status": "SUCCESS",
  "data": {
    "pakets": [
      {
        "id": "{% uuid 'v4' %}",
        "channel": "baud",
        "action": "broadcast",
        "status": "SUCCESS",
        "data": {
          "banane": "apfel",
          "sender": "MY2021MDcwODIwMjExNzE1NTYtZTJkMmIzNTEtMjBjZi00ODAzLWIwMzMtNmE5MTI4NzhhZDA0LTE2MjgzNDkzNTY5ODETRIOX"
        },
        "polling": false,
        "encoding": false
      }
    ]
  },
  "polling": false,
  "encoding": false
}

Example Diagram:

graph TD;
    Baud --> HTTP
    Baud --> WS
    WS --> Baud
    HTTP --> Baud
    WS --> Communication
    HTTP --> Communication
    Communication --> Channel
    Communication --> Action
    Communication --> Data
    Communication --> Status
    Communication --> Encoding    
    Channel --> Event
    Action --> Event
    Data --> Parser
    Status --> Parser
    Encoding --> Parser
    Parser --> Event
    Event --> Frontend
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment