1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: implement diagnostics endpoint (resolve #225)

This commit is contained in:
Ferdinand Mütsch
2021-08-07 10:16:50 +02:00
parent 9e3203ac41
commit 2088987a0c
13 changed files with 843 additions and 536 deletions

View File

@ -482,6 +482,39 @@ var doc = `{
}
}
},
"/plugins/errors": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"tags": [
"diagnostics"
],
"summary": "Push a new diagnostics object",
"operationId": "post-diagnostics",
"parameters": [
{
"description": "A single diagnostics object sent by WakaTime CLI",
"name": "diagnostics",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Diagnostics"
}
}
],
"responses": {
"201": {
"description": ""
}
}
}
},
"/summary": {
"get": {
"security": [
@ -687,6 +720,32 @@ var doc = `{
}
},
"definitions": {
"models.Diagnostics": {
"type": "object",
"properties": {
"architecture": {
"type": "string"
},
"cli_version": {
"type": "string"
},
"id": {
"type": "integer"
},
"logs": {
"type": "string"
},
"platform": {
"type": "string"
},
"plugin": {
"type": "string"
},
"stacktrace": {
"type": "string"
}
}
},
"models.Heartbeat": {
"type": "object",
"properties": {
@ -750,6 +809,7 @@ var doc = `{
"example": "2006-01-02 15:04:05.000"
},
"labels": {
"description": "labels are not persisted, but calculated at runtime, i.e. when summary is retrieved",
"type": "array",
"items": {
"$ref": "#/definitions/models.SummaryItem"

View File

@ -466,6 +466,39 @@
}
}
},
"/plugins/errors": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"consumes": [
"application/json"
],
"tags": [
"diagnostics"
],
"summary": "Push a new diagnostics object",
"operationId": "post-diagnostics",
"parameters": [
{
"description": "A single diagnostics object sent by WakaTime CLI",
"name": "diagnostics",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Diagnostics"
}
}
],
"responses": {
"201": {
"description": ""
}
}
}
},
"/summary": {
"get": {
"security": [
@ -671,6 +704,32 @@
}
},
"definitions": {
"models.Diagnostics": {
"type": "object",
"properties": {
"architecture": {
"type": "string"
},
"cli_version": {
"type": "string"
},
"id": {
"type": "integer"
},
"logs": {
"type": "string"
},
"platform": {
"type": "string"
},
"plugin": {
"type": "string"
},
"stacktrace": {
"type": "string"
}
}
},
"models.Heartbeat": {
"type": "object",
"properties": {
@ -734,6 +793,7 @@
"example": "2006-01-02 15:04:05.000"
},
"labels": {
"description": "labels are not persisted, but calculated at runtime, i.e. when summary is retrieved",
"type": "array",
"items": {
"$ref": "#/definitions/models.SummaryItem"

View File

@ -1,5 +1,22 @@
basePath: /api
definitions:
models.Diagnostics:
properties:
architecture:
type: string
cli_version:
type: string
id:
type: integer
logs:
type: string
platform:
type: string
plugin:
type: string
stacktrace:
type: string
type: object
models.Heartbeat:
properties:
branch:
@ -44,6 +61,8 @@ definitions:
format: date
type: string
labels:
description: labels are not persisted, but calculated at runtime, i.e. when
summary is retrieved
items:
$ref: '#/definitions/models.SummaryItem'
type: array
@ -622,6 +641,26 @@ paths:
summary: Push new heartbeats
tags:
- heartbeat
/plugins/errors:
post:
consumes:
- application/json
operationId: post-diagnostics
parameters:
- description: A single diagnostics object sent by WakaTime CLI
in: body
name: diagnostics
required: true
schema:
$ref: '#/definitions/models.Diagnostics'
responses:
"201":
description: ""
security:
- ApiKeyAuth: []
summary: Push a new diagnostics object
tags:
- diagnostics
/summary:
get:
operationId: get-summary