485 lines
11 KiB
YAML
485 lines
11 KiB
YAML
openapi: '3.0.2'
|
|
|
|
info:
|
|
title: Dash API
|
|
version: '0.1'
|
|
|
|
servers:
|
|
- url: http://localhost:18010/api/v1
|
|
- url: http://localhost:8080/api/v1
|
|
- url: https://dash.pander.me/api/v1
|
|
|
|
paths:
|
|
/journal/entry/:
|
|
post:
|
|
operationId: writeJournalEntry
|
|
tags:
|
|
- journal
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/JournalEntry'
|
|
responses:
|
|
'200':
|
|
description: Journal entry successfully written.
|
|
/journal/entry/{date}:
|
|
get:
|
|
operationId: getJournalEntryForDate
|
|
tags:
|
|
- journal
|
|
responses:
|
|
'200':
|
|
description: A journal entry for a specific date.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/JournalEntry'
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
delete:
|
|
operationId: deleteJournalEntryForDate
|
|
tags:
|
|
- journal
|
|
responses:
|
|
'200':
|
|
description: Journal entry successfully deleted.
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
|
|
/plan/day/entry/:
|
|
post:
|
|
operationId: savePlanForDay
|
|
tags:
|
|
- plan
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanDay'
|
|
responses:
|
|
'200':
|
|
description: Plan successfully written.
|
|
/plan/day/entry/{date}:
|
|
get:
|
|
operationId: getPlanDayForDate
|
|
tags:
|
|
- plan
|
|
responses:
|
|
'200':
|
|
description: A plan for a specific date.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanDay'
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
|
|
/plan/week/entry/:
|
|
post:
|
|
operationId: savePlanForWeek
|
|
tags:
|
|
- plan
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanWeek'
|
|
responses:
|
|
'200':
|
|
description: Plan successfully written.
|
|
/plan/week/entry/{date}:
|
|
get:
|
|
operationId: getPlanWeekForDate
|
|
tags:
|
|
- plan
|
|
responses:
|
|
'200':
|
|
description: A plan for a specific week.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanWeek'
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
|
|
/plan/month/entry/:
|
|
post:
|
|
operationId: savePlanForMonth
|
|
tags:
|
|
- plan
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanMonth'
|
|
responses:
|
|
'200':
|
|
description: Plan successfully written.
|
|
/plan/month/entry/{date}:
|
|
get:
|
|
operationId: getPlanMonthForDate
|
|
tags:
|
|
- plan
|
|
responses:
|
|
'200':
|
|
description: A plan for a specific week.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PlanMonth'
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
|
|
/tracking/entry:
|
|
post:
|
|
operationId: writeTrackingEntry
|
|
tags:
|
|
- tracking
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TrackingEntry'
|
|
responses:
|
|
'200':
|
|
description: Tracking entry successfully written.
|
|
|
|
/tracking/entry/{date}:
|
|
get:
|
|
operationId: getTrackingEntryForDate
|
|
tags:
|
|
- tracking
|
|
responses:
|
|
'200':
|
|
description: A tracking entry for a specific date.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TrackingEntry'
|
|
parameters:
|
|
- name: date
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
|
|
/tracking/categories:
|
|
get:
|
|
operationId: getTrackingCategories
|
|
tags:
|
|
- tracking
|
|
responses:
|
|
'200':
|
|
description: Tracking categories successfully retrieved.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TrackingCategories'
|
|
|
|
/inbox/:
|
|
get:
|
|
operationId: getInboxItems
|
|
tags:
|
|
- inbox
|
|
responses:
|
|
'200':
|
|
description: Inbox items successfully retrieved.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/InboxItem'
|
|
post:
|
|
operationId: addInboxItem
|
|
tags:
|
|
- inbox
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InboxItem'
|
|
responses:
|
|
'200':
|
|
description: Journal entry successfully written.
|
|
/inbox/{item}:
|
|
delete:
|
|
operationId: deleteInboxItem
|
|
tags:
|
|
- inbox
|
|
responses:
|
|
'200':
|
|
description: Inbox item successfully deleted.
|
|
parameters:
|
|
- name: item
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int32
|
|
example: 1
|
|
|
|
components:
|
|
schemas:
|
|
JournalEntry:
|
|
type: object
|
|
required:
|
|
- date
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
thankful:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "thankful 1"
|
|
- "thankful 2"
|
|
- "thankful 3"
|
|
looking_forward:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "looking forward 1"
|
|
- "looking forward 2"
|
|
- "looking forward 3"
|
|
been_great:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "been great 1"
|
|
- "been great 2"
|
|
- "been great 3"
|
|
do_better:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "do better 1"
|
|
- "do better 2"
|
|
- "do better 3"
|
|
journal:
|
|
type: string
|
|
example: "journal entry 1"
|
|
|
|
PlanDay:
|
|
type: object
|
|
required:
|
|
- date
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
morning:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "morning 1"
|
|
- "morning 2"
|
|
- "morning 3"
|
|
midday:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "midday 1"
|
|
- "midday 2"
|
|
- "midday 3"
|
|
afternoon:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "afternoon 1"
|
|
- "afternoon 2"
|
|
- "afternoon 3"
|
|
evening:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "evening 1"
|
|
- "evening 2"
|
|
- "evening 3"
|
|
pleasant:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "pleasant 1"
|
|
- "pleasant 2"
|
|
- "pleasant 3"
|
|
reminders:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example:
|
|
- "reminders 1"
|
|
- "reminders 2"
|
|
- "reminders 3"
|
|
|
|
PlanWeek:
|
|
type: object
|
|
required:
|
|
- date
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
items:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/PlanWeekItem'
|
|
example: '[{"item": "witem 1"}, {"item": "witem 2", "numTodos":3, "numDone":2}, {"item": "witem 3", "numTodos":2, "numDone":2}]'
|
|
|
|
PlanWeekItem:
|
|
type: object
|
|
required:
|
|
- item
|
|
properties:
|
|
item:
|
|
type: string
|
|
example: 'planWeekItem'
|
|
numTodo:
|
|
type: integer
|
|
format: int32
|
|
example: 3
|
|
numDone:
|
|
type: integer
|
|
format: int32
|
|
example: 2
|
|
|
|
PlanMonth:
|
|
type: object
|
|
required:
|
|
- date
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
items:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example: '["mitem1", "mitem2", "mitem3"]'
|
|
|
|
TrackingItem:
|
|
type: object
|
|
required:
|
|
- date
|
|
- type
|
|
- value
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
type:
|
|
type: string
|
|
example: 'trackingItem'
|
|
value:
|
|
type: string
|
|
example: 'trackingItemValue'
|
|
|
|
TrackingEntry:
|
|
type: object
|
|
required:
|
|
- date
|
|
- items
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date
|
|
example: 2022-02-18
|
|
items:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/TrackingItem'
|
|
example: '[{"type": "titem1", "value": "titem1value"}, {"type": "titem2", "value": "titem2value"}]'
|
|
|
|
TrackingCategory:
|
|
type: object
|
|
required:
|
|
- type
|
|
- name
|
|
properties:
|
|
type:
|
|
type: string
|
|
example: 'trackingCategory'
|
|
name:
|
|
type: string
|
|
example: 'trackingCategoryName'
|
|
items:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example: '["titem1", "titem2", "titem3"]'
|
|
|
|
TrackingCategories:
|
|
type: object
|
|
properties:
|
|
categories:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/TrackingCategory'
|
|
example: '[{"type": "tcat1", "name": "tcat1name", "items": ["titem1", "titem2", "titem3"]}, {"type": "tcat2", "name": "tcat2name", "items": ["titem1", "titem2", "titem3"]}]'
|
|
|
|
InboxItem:
|
|
type: object
|
|
required:
|
|
- item
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int32
|
|
example: 1
|
|
item:
|
|
type: string
|
|
example: 'inboxItem' |