mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-06 17:40:30 +00:00
code generation
This commit is contained in:
parent
5ce1dff635
commit
c1c3e30a39
4 changed files with 226 additions and 103 deletions
|
@ -148,9 +148,9 @@ const docTemplate = `{
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"Group"
|
"Statistics"
|
||||||
],
|
],
|
||||||
"summary": "Get the current user's group",
|
"summary": "Get the current user's group statistics",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
@ -161,6 +161,44 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/v1/groups/statistics/purchase-price": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"Statistics"
|
||||||
|
],
|
||||||
|
"summary": "Queries the changes overtime of the purchase price over time",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "start date",
|
||||||
|
"name": "start",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "end date",
|
||||||
|
"name": "end",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/repo.ValueOverTime"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/v1/items": {
|
"/v1/items": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -449,43 +487,6 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/v1/items/{id}/attachments/download": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"Bearer": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/octet-stream"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"Items Attachments"
|
|
||||||
],
|
|
||||||
"summary": "retrieves an attachment for an item",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Item ID",
|
|
||||||
"name": "id",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Attachment token",
|
|
||||||
"name": "token",
|
|
||||||
"in": "query",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/v1/items/{id}/attachments/{attachment_id}": {
|
"/v1/items/{id}/attachments/{attachment_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -1237,6 +1238,9 @@ const docTemplate = `{
|
||||||
"repo.GroupStatistics": {
|
"repo.GroupStatistics": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"totalItemPrice": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"totalItems": {
|
"totalItems": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
@ -1248,6 +1252,9 @@ const docTemplate = `{
|
||||||
},
|
},
|
||||||
"totalUsers": {
|
"totalUsers": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"totalWithWarranty": {
|
||||||
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1821,6 +1828,40 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"repo.ValueOverTime": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"end": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"entries": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/repo.ValueOverTimeEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"valueAtEnd": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"valueAtStart": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"repo.ValueOverTimeEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"date": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"server.ErrorResponse": {
|
"server.ErrorResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -140,9 +140,9 @@
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"Group"
|
"Statistics"
|
||||||
],
|
],
|
||||||
"summary": "Get the current user's group",
|
"summary": "Get the current user's group statistics",
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
@ -153,6 +153,44 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/v1/groups/statistics/purchase-price": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"Statistics"
|
||||||
|
],
|
||||||
|
"summary": "Queries the changes overtime of the purchase price over time",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "start date",
|
||||||
|
"name": "start",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "end date",
|
||||||
|
"name": "end",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/repo.ValueOverTime"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/v1/items": {
|
"/v1/items": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -441,43 +479,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/v1/items/{id}/attachments/download": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"Bearer": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/octet-stream"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"Items Attachments"
|
|
||||||
],
|
|
||||||
"summary": "retrieves an attachment for an item",
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Item ID",
|
|
||||||
"name": "id",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Attachment token",
|
|
||||||
"name": "token",
|
|
||||||
"in": "query",
|
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "OK"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/v1/items/{id}/attachments/{attachment_id}": {
|
"/v1/items/{id}/attachments/{attachment_id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
@ -1229,6 +1230,9 @@
|
||||||
"repo.GroupStatistics": {
|
"repo.GroupStatistics": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"totalItemPrice": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
"totalItems": {
|
"totalItems": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
@ -1240,6 +1244,9 @@
|
||||||
},
|
},
|
||||||
"totalUsers": {
|
"totalUsers": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"totalWithWarranty": {
|
||||||
|
"type": "integer"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1813,6 +1820,40 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"repo.ValueOverTime": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"end": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"entries": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/repo.ValueOverTimeEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"start": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"valueAtEnd": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"valueAtStart": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"repo.ValueOverTimeEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"date": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"server.ErrorResponse": {
|
"server.ErrorResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -24,6 +24,8 @@ definitions:
|
||||||
type: object
|
type: object
|
||||||
repo.GroupStatistics:
|
repo.GroupStatistics:
|
||||||
properties:
|
properties:
|
||||||
|
totalItemPrice:
|
||||||
|
type: number
|
||||||
totalItems:
|
totalItems:
|
||||||
type: integer
|
type: integer
|
||||||
totalLabels:
|
totalLabels:
|
||||||
|
@ -32,6 +34,8 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
totalUsers:
|
totalUsers:
|
||||||
type: integer
|
type: integer
|
||||||
|
totalWithWarranty:
|
||||||
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
repo.GroupUpdate:
|
repo.GroupUpdate:
|
||||||
properties:
|
properties:
|
||||||
|
@ -416,6 +420,28 @@ definitions:
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
repo.ValueOverTime:
|
||||||
|
properties:
|
||||||
|
end:
|
||||||
|
type: string
|
||||||
|
entries:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/repo.ValueOverTimeEntry'
|
||||||
|
type: array
|
||||||
|
start:
|
||||||
|
type: string
|
||||||
|
valueAtEnd:
|
||||||
|
type: number
|
||||||
|
valueAtStart:
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
|
repo.ValueOverTimeEntry:
|
||||||
|
properties:
|
||||||
|
date:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: number
|
||||||
|
type: object
|
||||||
server.ErrorResponse:
|
server.ErrorResponse:
|
||||||
properties:
|
properties:
|
||||||
error:
|
error:
|
||||||
|
@ -608,9 +634,32 @@ paths:
|
||||||
$ref: '#/definitions/repo.GroupStatistics'
|
$ref: '#/definitions/repo.GroupStatistics'
|
||||||
security:
|
security:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: Get the current user's group
|
summary: Get the current user's group statistics
|
||||||
tags:
|
tags:
|
||||||
- Group
|
- Statistics
|
||||||
|
/v1/groups/statistics/purchase-price:
|
||||||
|
get:
|
||||||
|
parameters:
|
||||||
|
- description: start date
|
||||||
|
in: query
|
||||||
|
name: start
|
||||||
|
type: string
|
||||||
|
- description: end date
|
||||||
|
in: query
|
||||||
|
name: end
|
||||||
|
type: string
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/repo.ValueOverTime'
|
||||||
|
security:
|
||||||
|
- Bearer: []
|
||||||
|
summary: Queries the changes overtime of the purchase price over time
|
||||||
|
tags:
|
||||||
|
- Statistics
|
||||||
/v1/items:
|
/v1/items:
|
||||||
get:
|
get:
|
||||||
parameters:
|
parameters:
|
||||||
|
@ -846,29 +895,6 @@ paths:
|
||||||
summary: retrieves an attachment for an item
|
summary: retrieves an attachment for an item
|
||||||
tags:
|
tags:
|
||||||
- Items Attachments
|
- Items Attachments
|
||||||
/v1/items/{id}/attachments/download:
|
|
||||||
get:
|
|
||||||
parameters:
|
|
||||||
- description: Item ID
|
|
||||||
in: path
|
|
||||||
name: id
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
- description: Attachment token
|
|
||||||
in: query
|
|
||||||
name: token
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
produces:
|
|
||||||
- application/octet-stream
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: OK
|
|
||||||
security:
|
|
||||||
- Bearer: []
|
|
||||||
summary: retrieves an attachment for an item
|
|
||||||
tags:
|
|
||||||
- Items Attachments
|
|
||||||
/v1/items/import:
|
/v1/items/import:
|
||||||
post:
|
post:
|
||||||
parameters:
|
parameters:
|
||||||
|
|
|
@ -25,10 +25,12 @@ export interface Group {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupStatistics {
|
export interface GroupStatistics {
|
||||||
|
totalItemPrice: number;
|
||||||
totalItems: number;
|
totalItems: number;
|
||||||
totalLabels: number;
|
totalLabels: number;
|
||||||
totalLocations: number;
|
totalLocations: number;
|
||||||
totalUsers: number;
|
totalUsers: number;
|
||||||
|
totalWithWarranty: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupUpdate {
|
export interface GroupUpdate {
|
||||||
|
@ -261,6 +263,19 @@ export interface UserUpdate {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ValueOverTime {
|
||||||
|
end: string;
|
||||||
|
entries: ValueOverTimeEntry[];
|
||||||
|
start: string;
|
||||||
|
valueAtEnd: number;
|
||||||
|
valueAtStart: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ValueOverTimeEntry {
|
||||||
|
date: string;
|
||||||
|
value: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ServerErrorResponse {
|
export interface ServerErrorResponse {
|
||||||
error: string;
|
error: string;
|
||||||
fields: Record<string, string>;
|
fields: Record<string, string>;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue