~cosmicrose/effusion-schema

008a6746b6bce5ff29ceecb85c99041aaf56077c — Rosa Richter 8 months ago
Initial commit
2 files changed, 109 insertions(+), 0 deletions(-)

A README.md
A schema.graphqls
A  => README.md +27 -0
@@ 1,27 @@
# Effusion GraphQL Schema

This is the GraphQL schema document for the [Effusion](https://sr.ht/~cosmicrose/effusion) BitTorrent client.

## License

MIT License

Copyright 2021 Rosa Richter

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

A  => schema.graphqls +82 -0
@@ 1,82 @@
scalar DateTime
scalar Base64

type Version {
  major: Int!
  minor: Int!
  patch: Int!
}

type Session {
  downSpeed: Int!
  upSpeed: Int!

  transfers: [Transfer!]!
}

type Tranfer {
  id: ID!
  name: String!
  size: Int!
  started: DateTime!
  state: TransferState!
  downloaded: Int!
  uploaded: Int!
  peers: [Peer!]!
  connectedPeersCount: Int!
  availablePeersCount: Int!
}

enum TransferState {
  CHECKING
  STOPPED
  DOWNLOADING
  SEEDING
  ERRORED
}

type Peer {
  ip: String!
  progress: Float!
  port: Int!
  protocol: Protocol!
  features: [Feature!]!
  from: PeerSource!
  client: Sring!
  downSpeed: Int!
  upSpeed: Int!
  downloaded: Int!
  uploaded: Int!
}

enum Protocol {
  BITTORRENT
  UTORRENT
  HTTP
  HTTPS
}

enum Feature {
  UTP
  FAST
  DHT
  PEX
  ENCRYPTION
}

enum PeerSource {
  TRACKER
  DHT
  PEX
}

type Query {
  version: Version!
  session: Session!
}

type Mutation {
  addTransfer(meta: Base64!): Transfer!
  startTransfer(id: ID!): Transfer!
  stopTransfer(id: ID!): Transfer!
}