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

feat: implement wakatime projects endpoint (resolve #196)

This commit is contained in:
Ferdinand Mütsch
2021-05-01 13:52:03 +02:00
parent 0fbb554fc3
commit cf3d293688
15 changed files with 770 additions and 402 deletions

View File

@@ -160,6 +160,48 @@ var doc = `{
}
}
},
"/compat/wakatime/v1/users/{user}/projects": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Mimics https://wakatime.com/developers#projects",
"produces": [
"application/json"
],
"tags": [
"wakatime"
],
"summary": "Retrieve and fitler the user's projects",
"operationId": "get-wakatime-projects",
"parameters": [
{
"type": "string",
"description": "User ID to fetch data for (or 'current')",
"name": "user",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Query to filter projects by",
"name": "q",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.ProjectsViewModel"
}
}
}
}
},
"/compat/wakatime/v1/users/{user}/stats/{range}": {
"get": {
"security": [
@@ -574,6 +616,31 @@ var doc = `{
}
}
},
"v1.Project": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"repository": {
"type": "string"
}
}
},
"v1.ProjectsViewModel": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.Project"
}
}
}
},
"v1.StatsData": {
"type": "object",
"properties": {

View File

@@ -144,6 +144,48 @@
}
}
},
"/compat/wakatime/v1/users/{user}/projects": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Mimics https://wakatime.com/developers#projects",
"produces": [
"application/json"
],
"tags": [
"wakatime"
],
"summary": "Retrieve and fitler the user's projects",
"operationId": "get-wakatime-projects",
"parameters": [
{
"type": "string",
"description": "User ID to fetch data for (or 'current')",
"name": "user",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Query to filter projects by",
"name": "q",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/v1.ProjectsViewModel"
}
}
}
}
},
"/compat/wakatime/v1/users/{user}/stats/{range}": {
"get": {
"security": [
@@ -558,6 +600,31 @@
}
}
},
"v1.Project": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"repository": {
"type": "string"
}
}
},
"v1.ProjectsViewModel": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/v1.Project"
}
}
}
},
"v1.StatsData": {
"type": "object",
"properties": {

View File

@@ -117,6 +117,22 @@ definitions:
schemaVersion:
type: integer
type: object
v1.Project:
properties:
id:
type: string
name:
type: string
repository:
type: string
type: object
v1.ProjectsViewModel:
properties:
data:
items:
$ref: '#/definitions/v1.Project'
type: array
type: object
v1.StatsData:
properties:
daily_average:
@@ -392,6 +408,33 @@ paths:
summary: Retrieve summary for all time
tags:
- wakatime
/compat/wakatime/v1/users/{user}/projects:
get:
description: Mimics https://wakatime.com/developers#projects
operationId: get-wakatime-projects
parameters:
- description: User ID to fetch data for (or 'current')
in: path
name: user
required: true
type: string
- description: Query to filter projects by
in: query
name: q
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/v1.ProjectsViewModel'
security:
- ApiKeyAuth: []
summary: Retrieve and fitler the user's projects
tags:
- wakatime
/compat/wakatime/v1/users/{user}/stats/{range}:
get:
description: Mimics https://wakatime.com/developers#stats