{
  "openapi": "3.1.0",
  "info": {
    "title": "Nore Client API",
    "version": "1.2.0",
    "description": "Publiczne API Nore Client: wydania, aktualizacje launchera i moda, wydarzenia i aktualności. Bez klucza, CORS otwarty, odpowiedzi z ETag."
  },
  "servers": [
    {
      "url": "https://noroclient.pl"
    }
  ],
  "paths": {
    "/api/v1/status": {
      "get": {
        "summary": "Stan API i synchronizacji w tle",
        "responses": {
          "200": {
            "description": "Stan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "api": {
                      "type": "string"
                    },
                    "latest": {
                      "type": "string"
                    },
                    "sync": {
                      "type": "object",
                      "properties": {
                        "at": {
                          "type": "string"
                        },
                        "ok": {
                          "type": "boolean"
                        },
                        "ms": {
                          "type": "integer"
                        },
                        "releases": {
                          "type": "integer"
                        },
                        "ageSeconds": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/version": {
      "get": {
        "summary": "Najnowsze wydanie",
        "responses": {
          "200": {
            "description": "Wydanie",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "published": {
                      "type": "string"
                    },
                    "notes": {
                      "type": "string"
                    },
                    "downloads": {
                      "type": "integer"
                    },
                    "assets": {
                      "type": "object",
                      "properties": {
                        "win": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "size": {
                              "type": "integer"
                            },
                            "url": {
                              "type": "string"
                            },
                            "digest": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "downloads": {
                              "type": "integer"
                            }
                          }
                        },
                        "linux": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "size": {
                              "type": "integer"
                            },
                            "url": {
                              "type": "string"
                            },
                            "digest": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "downloads": {
                              "type": "integer"
                            }
                          }
                        },
                        "mac": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "size": {
                              "type": "integer"
                            },
                            "url": {
                              "type": "string"
                            },
                            "digest": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "downloads": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "mods": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string"
                          },
                          "digest": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "downloads": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/releases": {
      "get": {
        "summary": "Ostatnie wydania",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 30,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "releases": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string"
                          },
                          "published": {
                            "type": "string"
                          },
                          "downloads": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "summary": "Liczniki pobrań",
        "responses": {
          "200": {
            "description": "Liczniki",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "releases": {
                      "type": "integer"
                    },
                    "downloads": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "win": {
                          "type": "integer"
                        },
                        "linux": {
                          "type": "integer"
                        },
                        "mac": {
                          "type": "integer"
                        },
                        "mods": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/updates/launcher": {
      "get": {
        "summary": "Aktualizacja launchera",
        "parameters": [
          {
            "name": "platform",
            "in": "query",
            "required": true,
            "schema": {
              "enum": [
                "win",
                "linux",
                "mac"
              ]
            }
          },
          {
            "name": "current",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wynik",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "update": {
                      "type": "boolean"
                    },
                    "version": {
                      "type": "string"
                    },
                    "download": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer"
                        },
                        "url": {
                          "type": "string"
                        },
                        "digest": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "downloads": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/updates/mod": {
      "get": {
        "summary": "Plik moda dla wersji Minecraft",
        "parameters": [
          {
            "name": "mc",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "loader",
            "in": "query",
            "schema": {
              "enum": [
                "fabric",
                "forge"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plik",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mc": {
                      "type": "string"
                    },
                    "loader": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "java": {
                      "type": "integer"
                    },
                    "jar": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer"
                        },
                        "url": {
                          "type": "string"
                        },
                        "digest": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "downloads": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/download/{platform}": {
      "get": {
        "summary": "Pobierz instalator",
        "parameters": [
          {
            "name": "platform",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "win",
                "linux",
                "mac"
              ]
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Przekierowanie do pliku w GitHub Releases"
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "summary": "Wydarzenia",
        "responses": {
          "200": {
            "description": "Wydarzenia",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "forced": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/news": {
      "get": {
        "summary": "Aktualności",
        "responses": {
          "200": {
            "description": "Aktualności",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "news": {
                      "type": "array"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/platforms": {
      "get": {
        "summary": "Obsługiwane wersje",
        "responses": {
          "200": {
            "description": "Platformy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "platforms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "loader": {
                            "type": "string"
                          },
                          "java": {
                            "type": "integer"
                          },
                          "versions": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}