homebox/backend/app/api/docs/swagger.yaml

859 lines
18 KiB
YAML
Raw Normal View History

2022-08-30 02:30:36 +00:00
basePath: /api
definitions:
server.Result:
2022-08-30 18:05:11 +00:00
properties:
details: {}
error:
type: boolean
item: {}
message:
2022-08-30 18:05:11 +00:00
type: string
type: object
server.Results:
2022-08-30 18:05:11 +00:00
properties:
items:
type: any
2022-08-30 18:05:11 +00:00
type: object
types.ApiSummary:
2022-08-30 18:05:11 +00:00
properties:
health:
type: boolean
message:
2022-08-30 18:05:11 +00:00
type: string
title:
2022-08-30 18:05:11 +00:00
type: string
versions:
2022-08-30 18:05:11 +00:00
items:
type: string
2022-08-30 18:05:11 +00:00
type: array
type: object
types.DocumentOut:
2022-08-30 18:05:11 +00:00
properties:
id:
type: string
path:
2022-08-30 18:05:11 +00:00
type: string
title:
2022-09-09 18:20:38 +00:00
type: string
2022-08-30 18:05:11 +00:00
type: object
types.ItemAttachment:
2022-08-30 18:05:11 +00:00
properties:
createdAt:
2022-08-30 18:05:11 +00:00
type: string
document:
$ref: '#/definitions/types.DocumentOut'
2022-08-30 18:05:11 +00:00
id:
type: string
updatedAt:
2022-08-30 18:05:11 +00:00
type: string
type: object
types.ItemCreate:
2022-08-30 18:05:11 +00:00
properties:
description:
type: string
labelIds:
items:
type: string
type: array
locationId:
description: Edges
2022-08-30 18:05:11 +00:00
type: string
name:
type: string
type: object
types.ItemOut:
2022-08-30 18:05:11 +00:00
properties:
attachments:
2022-08-30 18:05:11 +00:00
items:
$ref: '#/definitions/types.ItemAttachment'
2022-08-30 18:05:11 +00:00
type: array
createdAt:
2022-08-30 18:05:11 +00:00
type: string
description:
type: string
id:
type: string
insured:
type: boolean
labels:
2022-08-30 18:05:11 +00:00
items:
$ref: '#/definitions/types.LabelSummary'
2022-08-30 18:05:11 +00:00
type: array
lifetimeWarranty:
description: Warranty
type: boolean
location:
$ref: '#/definitions/types.LocationSummary'
description: Edges
manufacturer:
2022-08-30 18:05:11 +00:00
type: string
modelNumber:
2022-08-30 18:05:11 +00:00
type: string
name:
type: string
notes:
description: Extras
2022-08-30 18:05:11 +00:00
type: string
purchaseFrom:
2022-08-30 02:30:36 +00:00
type: string
purchasePrice:
example: "0"
2022-08-30 02:30:36 +00:00
type: string
purchaseTime:
description: Purchase
2022-08-30 02:30:36 +00:00
type: string
quantity:
type: integer
serialNumber:
description: Identifications
2022-09-03 09:17:48 +00:00
type: string
soldNotes:
2022-09-03 09:17:48 +00:00
type: string
soldPrice:
example: "0"
type: string
soldTime:
description: Sold
type: string
soldTo:
type: string
updatedAt:
type: string
warrantyDetails:
type: string
warrantyExpires:
2022-09-03 09:17:48 +00:00
type: string
type: object
types.ItemSummary:
2022-09-03 09:17:48 +00:00
properties:
createdAt:
type: string
description:
type: string
id:
type: string
insured:
type: boolean
2022-09-03 09:17:48 +00:00
labels:
items:
$ref: '#/definitions/types.LabelSummary'
type: array
2022-09-09 18:20:38 +00:00
lifetimeWarranty:
description: Warranty
type: boolean
2022-09-03 09:17:48 +00:00
location:
$ref: '#/definitions/types.LocationSummary'
description: Edges
manufacturer:
type: string
modelNumber:
type: string
name:
type: string
notes:
description: Extras
type: string
purchaseFrom:
type: string
purchasePrice:
example: "0"
type: string
2022-09-03 09:17:48 +00:00
purchaseTime:
description: Purchase
type: string
quantity:
type: integer
2022-09-03 09:17:48 +00:00
serialNumber:
description: Identifications
type: string
soldNotes:
type: string
soldPrice:
example: "0"
type: string
2022-09-03 09:17:48 +00:00
soldTime:
description: Sold
type: string
soldTo:
type: string
updatedAt:
type: string
2022-09-09 18:20:38 +00:00
warrantyDetails:
type: string
warrantyExpires:
type: string
2022-09-03 09:17:48 +00:00
type: object
types.ItemUpdate:
2022-09-01 22:32:03 +00:00
properties:
description:
type: string
id:
type: string
insured:
type: boolean
labelIds:
2022-09-03 09:17:48 +00:00
items:
type: string
2022-09-03 09:17:48 +00:00
type: array
2022-09-09 18:20:38 +00:00
lifetimeWarranty:
description: Warranty
type: boolean
locationId:
2022-09-03 09:17:48 +00:00
description: Edges
type: string
2022-09-03 09:17:48 +00:00
manufacturer:
type: string
modelNumber:
2022-09-01 22:32:03 +00:00
type: string
name:
type: string
2022-09-03 09:17:48 +00:00
notes:
description: Extras
type: string
purchaseFrom:
type: string
purchasePrice:
example: "0"
type: string
2022-09-03 09:17:48 +00:00
purchaseTime:
description: Purchase
type: string
quantity:
type: integer
2022-09-03 09:17:48 +00:00
serialNumber:
description: Identifications
type: string
soldNotes:
type: string
soldPrice:
example: "0"
type: string
2022-09-03 09:17:48 +00:00
soldTime:
description: Sold
type: string
soldTo:
type: string
2022-09-09 18:20:38 +00:00
warrantyDetails:
type: string
warrantyExpires:
type: string
2022-09-01 22:32:03 +00:00
type: object
2022-09-01 23:11:14 +00:00
types.LabelCreate:
2022-09-02 01:52:40 +00:00
properties:
color:
type: string
description:
type: string
name:
type: string
2022-09-01 23:11:14 +00:00
type: object
types.LabelOut:
2022-09-02 01:52:40 +00:00
properties:
createdAt:
type: string
description:
type: string
groupId:
type: string
id:
type: string
items:
items:
$ref: '#/definitions/types.ItemSummary'
type: array
name:
type: string
updatedAt:
type: string
2022-09-01 23:11:14 +00:00
type: object
types.LabelSummary:
2022-09-02 01:52:40 +00:00
properties:
createdAt:
type: string
description:
type: string
groupId:
type: string
id:
type: string
name:
type: string
updatedAt:
type: string
2022-09-01 23:11:14 +00:00
type: object
2022-09-03 09:17:48 +00:00
types.LocationCount:
properties:
createdAt:
type: string
description:
type: string
id:
type: string
itemCount:
type: integer
name:
type: string
updatedAt:
type: string
type: object
2022-08-31 05:22:01 +00:00
types.LocationCreate:
properties:
description:
type: string
name:
type: string
type: object
types.LocationOut:
2022-09-01 22:32:03 +00:00
properties:
createdAt:
type: string
description:
type: string
id:
type: string
items:
items:
$ref: '#/definitions/types.ItemSummary'
type: array
name:
type: string
updatedAt:
type: string
type: object
types.LocationSummary:
2022-08-31 05:22:01 +00:00
properties:
createdAt:
type: string
description:
type: string
id:
type: string
name:
type: string
updatedAt:
type: string
type: object
2022-08-30 02:30:36 +00:00
types.TokenResponse:
properties:
expiresAt:
type: string
token:
type: string
type: object
2022-08-30 18:05:11 +00:00
types.UserIn:
2022-08-30 02:30:36 +00:00
properties:
email:
type: string
name:
type: string
2022-08-30 18:05:11 +00:00
password:
type: string
type: object
types.UserOut:
properties:
email:
type: string
groupId:
type: string
groupName:
type: string
id:
type: string
isSuperuser:
type: boolean
name:
type: string
type: object
2022-08-30 18:05:11 +00:00
types.UserRegistration:
properties:
groupName:
type: string
user:
$ref: '#/definitions/types.UserIn'
2022-08-30 02:30:36 +00:00
type: object
types.UserUpdate:
properties:
email:
type: string
name:
type: string
type: object
info:
contact:
name: Don't
description: This is a simple Rest API Server Template that implements some basic
User and Authentication patterns to help you get started and bootstrap your next
project!.
license:
name: MIT
title: Go API Templates
version: "1.0"
paths:
2022-09-03 09:17:48 +00:00
/v1/items:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Results'
- properties:
items:
items:
$ref: '#/definitions/types.ItemSummary'
2022-09-03 09:17:48 +00:00
type: array
type: object
security:
- Bearer: []
summary: Get All Items
tags:
- Items
post:
parameters:
- description: Item Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.ItemCreate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ItemSummary'
security:
- Bearer: []
summary: Create a new item
tags:
- Items
/v1/items/{id}:
delete:
parameters:
- description: Item ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: deletes a item
tags:
- Items
get:
parameters:
- description: Item ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ItemOut'
security:
- Bearer: []
summary: Gets a item and fields
tags:
- Items
put:
parameters:
- description: Item ID
in: path
name: id
required: true
type: string
- description: Item Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.ItemUpdate'
2022-09-03 09:17:48 +00:00
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ItemOut'
security:
- Bearer: []
summary: updates a item
tags:
- Items
2022-09-06 19:15:07 +00:00
/v1/items/import:
post:
parameters:
- description: Image to upload
in: formData
name: csv
required: true
type: file
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: imports items into the database
tags:
- Items
2022-09-01 23:11:14 +00:00
/v1/labels:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Results'
- properties:
items:
items:
$ref: '#/definitions/types.LabelOut'
type: array
type: object
security:
- Bearer: []
summary: Get All Labels
tags:
- Labels
post:
parameters:
- description: Label Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.LabelCreate'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LabelSummary'
security:
- Bearer: []
summary: Create a new label
tags:
- Labels
/v1/labels/{id}:
delete:
parameters:
- description: Label ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: deletes a label
tags:
- Labels
get:
parameters:
- description: Label ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LabelOut'
security:
- Bearer: []
summary: Gets a label and fields
tags:
- Labels
put:
parameters:
- description: Label ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LabelOut'
security:
- Bearer: []
summary: updates a label
tags:
- Labels
2022-08-31 05:22:01 +00:00
/v1/locations:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Results'
- properties:
items:
items:
2022-09-03 09:17:48 +00:00
$ref: '#/definitions/types.LocationCount'
2022-08-31 05:22:01 +00:00
type: array
type: object
security:
- Bearer: []
summary: Get All Locations
tags:
- Locations
post:
parameters:
- description: Location Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.LocationCreate'
produces:
- application/json
responses:
"200":
description: OK
schema:
2022-09-01 22:32:03 +00:00
$ref: '#/definitions/types.LocationSummary'
2022-08-31 05:22:01 +00:00
security:
- Bearer: []
summary: Create a new location
tags:
- Locations
2022-09-01 22:32:03 +00:00
/v1/locations/{id}:
delete:
parameters:
- description: Location ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: deletes a location
tags:
- Locations
get:
parameters:
- description: Location ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LocationOut'
security:
- Bearer: []
summary: Gets a location and fields
tags:
- Locations
put:
parameters:
- description: Location ID
in: path
name: id
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.LocationOut'
security:
- Bearer: []
summary: updates a location
tags:
- Locations
2022-09-04 02:42:03 +00:00
/v1/status:
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.ApiSummary'
summary: Retrieves the basic information about the API
tags:
- Base
2022-08-30 02:30:36 +00:00
/v1/users/login:
post:
consumes:
- application/x-www-form-urlencoded
- application/json
parameters:
- description: string
example: admin@admin.com
in: formData
name: username
type: string
- description: string
example: admin
in: formData
name: password
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/types.TokenResponse'
summary: User Login
tags:
- Authentication
/v1/users/logout:
post:
responses:
"204":
description: ""
security:
- Bearer: []
summary: User Logout
tags:
- Authentication
/v1/users/refresh:
get:
description: |-
handleAuthRefresh returns a handler that will issue a new token from an existing token.
This does not validate that the user still exists within the database.
responses:
"200":
description: ""
security:
- Bearer: []
summary: User Token Refresh
tags:
- Authentication
2022-08-30 18:05:11 +00:00
/v1/users/register:
post:
parameters:
- description: User Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.UserRegistration'
produces:
- application/json
responses:
2022-08-31 05:22:01 +00:00
"204":
description: ""
2022-08-30 18:05:11 +00:00
summary: Get the current user
tags:
- User
2022-08-30 02:30:36 +00:00
/v1/users/self:
2022-09-04 02:42:03 +00:00
delete:
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: Deletes the user account
tags:
- User
2022-08-30 02:30:36 +00:00
get:
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Result'
- properties:
item:
$ref: '#/definitions/types.UserOut'
2022-08-30 02:30:36 +00:00
type: object
security:
- Bearer: []
summary: Get the current user
tags:
- User
put:
parameters:
- description: User Data
in: body
name: payload
required: true
schema:
$ref: '#/definitions/types.UserUpdate'
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/server.Result'
- properties:
item:
$ref: '#/definitions/types.UserUpdate'
type: object
security:
- Bearer: []
summary: Update the current user
tags:
- User
/v1/users/self/password:
put:
produces:
- application/json
responses:
"204":
description: ""
security:
- Bearer: []
summary: 'Update the current user''s password // TODO:'
tags:
- User
securityDefinitions:
Bearer:
description: '"Type ''Bearer TOKEN'' to correctly set the API Key"'
in: header
name: Authorization
type: apiKey
swagger: "2.0"