435 lines
12 KiB
Go
435 lines
12 KiB
Go
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
package docs
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
const docTemplate = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{escape .Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"license": {
|
|
"name": "GPL-3.0"
|
|
},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/account/changePassword": {
|
|
"put": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Account"
|
|
],
|
|
"summary": "Change account password",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/auth/login": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Acquire tokens via login credentials (and 2FA code if needed)",
|
|
"parameters": [
|
|
{
|
|
"description": "desc",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.LoginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "desc",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.LoginResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/passwordResetBegin": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Request password reset email",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/auth/passwordResetComplete": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Complete password reset with email code and provide 2FA code or backup code if needed",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/auth/refresh": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Receive new tokens via refresh token",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/auth/registrationBegin": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Register an account",
|
|
"parameters": [
|
|
{
|
|
"description": "desc",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.RegistrationBeginRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Account is created and awaiting verification"
|
|
},
|
|
"409": {
|
|
"description": "Username or email is already taken"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/registrationComplete": {
|
|
"post": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Auth"
|
|
],
|
|
"summary": "Confirm with code, finish creating the account",
|
|
"parameters": [
|
|
{
|
|
"description": "desc",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.RegistrationCompleteRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "desc",
|
|
"schema": {
|
|
"$ref": "#/definitions/models.RegistrationCompleteResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/profile": {
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Update profile",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/profile/me": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Get own profile when authorized",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/profile/privacy": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Get profile privacy settings",
|
|
"responses": {}
|
|
},
|
|
"patch": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Update profile privacy settings",
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/profile/{username}": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"JWT": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Profile"
|
|
],
|
|
"summary": "Get someone's profile details",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Username",
|
|
"name": "username",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {}
|
|
}
|
|
},
|
|
"/service/health": {
|
|
"get": {
|
|
"description": "Used internally for checking service health",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"Service"
|
|
],
|
|
"summary": "Get health status",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Says whether it's healthy or not",
|
|
"schema": {
|
|
"$ref": "#/definitions/controllers.HealthStatus"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"controllers.HealthStatus": {
|
|
"type": "object",
|
|
"properties": {
|
|
"healthy": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"models.LoginRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"password",
|
|
"username"
|
|
],
|
|
"properties": {
|
|
"password": {
|
|
"type": "string",
|
|
"maxLength": 100
|
|
},
|
|
"totp": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string",
|
|
"maxLength": 20,
|
|
"minLength": 3
|
|
}
|
|
}
|
|
},
|
|
"models.LoginResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.RegistrationBeginRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"password",
|
|
"username"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.RegistrationCompleteRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"username",
|
|
"verification_code"
|
|
],
|
|
"properties": {
|
|
"birthday": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"username": {
|
|
"type": "string"
|
|
},
|
|
"verification_code": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.RegistrationCompleteResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"refresh_token": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"JWT": {
|
|
"type": "apiKey",
|
|
"name": "Authorization",
|
|
"in": "header"
|
|
}
|
|
}
|
|
}`
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = &swag.Spec{
|
|
Version: "1.0",
|
|
Host: "",
|
|
BasePath: "/api/",
|
|
Schemes: []string{"http"},
|
|
Title: "Easywish client API",
|
|
Description: "Easy and feature-rich wishlist.",
|
|
InfoInstanceName: "swagger",
|
|
SwaggerTemplate: docTemplate,
|
|
LeftDelim: "{{",
|
|
RightDelim: "}}",
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
}
|