Files
gemory/docs/mammon-api.yml
T
2026-06-12 21:20:44 +02:00

1026 lines
26 KiB
YAML

openapi: 3.1.0
info:
title: OpenAPI definition
version: v0
servers:
- url: http://localhost:8080
description: Generated server url
paths:
/rule-books/{ruleBookId}:
get:
tags:
- rule-book
summary: Find a rule book by its id
operationId: findRuleBookById
parameters:
- name: ruleBookId
in: path
description: Id of the rule book
required: true
schema:
type: string
format: uuid
responses:
"200":
description: The rule book
content:
'*/*':
schema:
$ref: "#/components/schemas/RuleBookResponse"
"404":
description: No rule book with this id
put:
tags:
- rule-book
summary: Update a rule book
operationId: updateRuleBook
parameters:
- name: ruleBookId
in: path
description: Id of the rule book
required: true
schema:
type: string
format: uuid
requestBody:
description: New state of the rule book
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateRuleBookRequest"
required: true
responses:
"200":
description: The updated rule book
content:
'*/*':
schema:
$ref: "#/components/schemas/RuleBookResponse"
"400":
description: |-
Returned when:
- the request is invalid (e.g. blank name)
- the rule book is the default rule book, which cannot be modified
delete:
tags:
- rule-book
summary: Delete a rule book
operationId: deleteRuleBook
parameters:
- name: ruleBookId
in: path
description: Id of the rule book
required: true
schema:
type: string
format: uuid
responses:
"204":
description: The rule book was deleted
"400":
description: |-
Returned when:
- the rule book is associated to a character
- the rule book is the default rule book, which cannot be deleted
/ledgers/main/{ledgerId}:
put:
tags:
- ledger
summary: Update a main ledger
operationId: updateMainLedger
parameters:
- name: ledgerId
in: path
description: Id of the main ledger
required: true
schema:
type: string
format: uuid
requestBody:
description: New state of the main ledger
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateMainLedgerRequest"
required: true
responses:
"200":
description: The updated main ledger
content:
'*/*':
schema:
$ref: "#/components/schemas/MainLedgerResponse"
"400":
description: |-
Returned when:
- the ledger is not a main ledger
- the request is invalid
"404":
description: No ledger with this id
/ledgers/combined/{ledgerId}:
put:
tags:
- ledger
summary: Update a combined ledger
operationId: updateCombinedLedger
parameters:
- name: ledgerId
in: path
description: Id of the combined ledger
required: true
schema:
type: string
format: uuid
requestBody:
description: New state of the combined ledger
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateCombinedLedgerRequest"
required: true
responses:
"200":
description: The updated combined ledger
content:
'*/*':
schema:
$ref: "#/components/schemas/CombinedLedgerResponse"
"400":
description: |-
Returned when:
- the ledger is not a combined ledger
- the request is invalid
"404":
description: No ledger with this id
/characters/{characterId}/rule-book:
get:
tags:
- character-rule-book
summary: Find the rule book assigned to a character
operationId: findCharacterRuleBookByCharacterId
parameters:
- name: characterId
in: path
description: Id of the character
required: true
schema:
type: integer
format: int64
responses:
"200":
description: The rule book assignment of the character
content:
'*/*':
schema:
$ref: "#/components/schemas/CharacterRuleBookResponse"
"400":
description: Invalid character id
"404":
description: No rule book assigned to this character
put:
tags:
- character-rule-book
summary: Assign a rule book to a character
operationId: setCharacterRuleBookForCharacter
parameters:
- name: characterId
in: path
description: Id of the character
required: true
schema:
type: integer
format: int64
requestBody:
description: Rule book and ledger bindings to assign
content:
application/json:
schema:
$ref: "#/components/schemas/SetCharacterRuleBookRequest"
required: true
responses:
"200":
description: The rule book assignment of the character
content:
'*/*':
schema:
$ref: "#/components/schemas/CharacterRuleBookResponse"
"400":
description: |-
Returned when:
- the referenced rule book does not exist
- a bound ledger does not exist
- a bound ledger is not a main or system ledger
- a required ledger binding is missing
/rule-books:
get:
tags:
- rule-book
summary: Find all rule books
operationId: findAllRuleBooks
responses:
"200":
description: All rule books
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/RuleBookResponse"
post:
tags:
- rule-book
summary: Create a rule book
operationId: createRuleBook
requestBody:
description: Rule book to create
content:
application/json:
schema:
$ref: "#/components/schemas/CreateRuleBookRequest"
required: true
responses:
"201":
description: The created rule book
headers:
Location:
description: URL of the created rule book
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
$ref: "#/components/schemas/RuleBookResponse"
"400":
description: Invalid request (e.g. blank name)
/process-activities:
post:
tags:
- processing
summary: Process new activities for all characters with a usable token
operationId: processNewActivities
responses:
"200":
description: New activities processed
/ledgers/main:
post:
tags:
- ledger
summary: Create a main ledger
operationId: createMainLedger
requestBody:
description: Main ledger to create
content:
application/json:
schema:
$ref: "#/components/schemas/CreateMainLedgerRequest"
required: true
responses:
"201":
description: The created main ledger
headers:
Location:
description: URL of the created main ledger
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
$ref: "#/components/schemas/MainLedgerResponse"
"400":
description: Invalid request (e.g. blank name)
/ledgers/combined:
post:
tags:
- ledger
summary: Create a combined ledger
operationId: createCombinedLedger
requestBody:
description: Combined ledger to create
content:
application/json:
schema:
$ref: "#/components/schemas/CreateCombinedLedgerRequest"
required: true
responses:
"201":
description: The created combined ledger
headers:
Location:
description: URL of the created combined ledger
style: simple
schema:
type: string
format: uri
content:
'*/*':
schema:
$ref: "#/components/schemas/CombinedLedgerResponse"
"400":
description: "Invalid request (e.g. blank name, a member ledger missing\
\ or already contained)"
/activity/fetch:
post:
tags:
- activity
summary: Fetch all new activities for all characters from the EVE API
operationId: fetchAllNewActivities
responses:
"200":
description: New activities fetched and stored
/activity/fetch/{characterId}:
post:
tags:
- activity
summary: Fetch new activities for a character from the EVE API
operationId: fetchNewActivitiesForCharacter
parameters:
- name: characterId
in: path
description: Id of the character
required: true
schema:
type: integer
format: int64
responses:
"200":
description: New activities fetched and stored
"400":
description: No character with this id
/rule-books/script-definitions:
get:
tags:
- rule-book
summary: Download the TypeScript definitions for the rule script runtime
operationId: getScriptDefinitions
responses:
"200":
description: The rule-runner.d.ts type definitions
content:
text/plain:
schema:
type: string
/market/{marketTypeId}/history:
get:
tags:
- market
summary: "Find the market history of a type, most recent first"
operationId: findHistory
parameters:
- name: marketTypeId
in: path
description: Id of the market type
required: true
schema:
type: integer
format: int64
- name: days
in: query
description: Optional number of most recent days to return; omit for the full
history
required: false
schema:
type: integer
format: int32
minimum: 1
responses:
"200":
description: The market history of the type
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MarketHistoryResponse"
"400":
description: The days parameter is not greater than 0
/market/scan:
get:
tags:
- market
summary: "Scan every tracked market type, returning volume-weighted price quartiles\
\ for each"
operationId: scanMarket
parameters:
- name: days
in: query
description: Number of most recent days of history to analyse
required: false
schema:
type: integer
format: int32
default: 365
minimum: 1
- name: brokerFee
in: query
description: "Broker fee as a fraction (e.g. 0.015 for 1.5%), paid on both\
\ buy and sell orders"
required: false
schema:
type: number
default: 0.015
maximum: 1
minimum: 0
- name: salesTax
in: query
description: "Sales tax as a fraction (e.g. 0.036 for 3.6%), paid on sell\
\ orders"
required: false
schema:
type: number
default: 0.036
maximum: 1
minimum: 0
responses:
"200":
description: "The scan results, one entry per tracked market type"
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MarketScanResponse"
"400":
description: The days parameter is not greater than 0
/market/prices:
get:
tags:
- market
summary: "Return the current Jita order book (highest buy, lowest sell, order\
\ count) for each requested market type"
operationId: currentPrices
parameters:
- name: types
in: query
description: "Market type ids to price, e.g. types=34,35"
required: true
schema:
type: array
items:
type: integer
format: int64
responses:
"200":
description: "The order book for each requested type, one entry per type"
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/MarketPriceResponse"
/ledgers:
get:
tags:
- ledger
summary: Find all ledgers
operationId: findAllLedgers
responses:
"200":
description: All ledgers
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/LedgerResponse"
/ledgers/{ledgerId}:
get:
tags:
- ledger
summary: Find a ledger by its id
operationId: findLedgerById
parameters:
- name: ledgerId
in: path
description: Id of the ledger
required: true
schema:
type: string
format: uuid
responses:
"200":
description: The ledger
content:
'*/*':
schema:
$ref: "#/components/schemas/LedgerResponse"
"400":
description: The ledger cannot be exposed (system ledger)
"404":
description: No ledger with this id
/ledgers/{ledgerId}/transactions:
get:
tags:
- transaction
summary: Find all transactions in a ledger
operationId: finAllTransactionsInLedger
parameters:
- name: ledgerId
in: path
description: Id of the ledger
required: true
schema:
type: string
format: uuid
responses:
"200":
description: All transactions in the ledger
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/TransactionResponse"
"404":
description: No ledger with this id
/ledgers/{ledgerId}/balance:
get:
tags:
- ledger
summary: Find the balance of a ledger
operationId: findBalanceByLedgerId
parameters:
- name: ledgerId
in: path
description: Id of the ledger
required: true
schema:
type: string
format: uuid
responses:
"200":
description: The balance of the ledger
content:
'*/*':
schema:
$ref: "#/components/schemas/BalanceResponse"
"404":
description: No ledger with this id
/characters:
get:
tags:
- character
summary: Find all characters with a usable token
operationId: findAllCharacters
responses:
"200":
description: All characters with a usable token
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/CharacterResponse"
/characters/rule-books:
get:
tags:
- character-rule-book
summary: Find the rule books of all characters that have a token
operationId: findAllCharacterRuleBooks
responses:
"200":
description: Rule book assignments of all characters with a token
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/CharacterRuleBookResponse"
/acquisitions:
get:
tags:
- acquisition
summary: Find all acquisitions that still have remaining stock
operationId: findAllAcquisitions
responses:
"200":
description: The acquisitions with remaining stock
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/AcquisitionResponse"
components:
schemas:
UpdateRuleBookRequest:
type: object
properties:
name:
type: string
usedForAcquisitions:
type: boolean
ledgerRefs:
type: array
items:
type: string
pattern: "[a-z][a-zA-Z0-9]*"
script:
type: string
required:
- ledgerRefs
- name
- script
- usedForAcquisitions
RuleBookResponse:
type: object
properties:
ruleBookId:
type: string
format: uuid
name:
type: string
usedForAcquisitions:
type: boolean
ledgerRefs:
type: array
items:
type: string
pattern: "[a-z][a-zA-Z0-9]*"
script:
type: string
required:
- ledgerRefs
- name
- ruleBookId
- script
- usedForAcquisitions
UpdateMainLedgerRequest:
type: object
properties:
name:
type: string
required:
- name
MainLedgerResponse:
allOf:
- $ref: "#/components/schemas/LedgerResponse"
- type: object
properties:
ledgerId:
type: string
format: uuid
name:
type: string
balance:
type: number
required:
- balance
- ledgerId
- name
UpdateCombinedLedgerRequest:
type: object
properties:
name:
type: string
memberLedgerIds:
type: array
items:
type: string
format: uuid
required:
- memberLedgerIds
- name
CombinedLedgerResponse:
allOf:
- $ref: "#/components/schemas/LedgerResponse"
- type: object
properties:
ledgerId:
type: string
format: uuid
name:
type: string
balance:
type: number
memberLedgerIds:
type: array
items:
type: string
format: uuid
required:
- balance
- ledgerId
- memberLedgerIds
- name
SetCharacterRuleBookRequest:
type: object
properties:
ruleBookId:
type: string
format: uuid
bindings:
type: object
additionalProperties:
type: string
format: uuid
required:
- bindings
- ruleBookId
CharacterResponse:
type: object
properties:
characterId:
type: integer
format: int64
name:
type: string
required:
- characterId
- name
CharacterRuleBookResponse:
type: object
properties:
character:
$ref: "#/components/schemas/CharacterResponse"
ruleBook:
$ref: "#/components/schemas/RuleBookSummaryResponse"
bindings:
type: object
additionalProperties:
type: string
format: uuid
required:
- bindings
- character
- ruleBook
RuleBookSummaryResponse:
type: object
properties:
ruleBookId:
type: string
format: uuid
name:
type: string
required:
- name
- ruleBookId
CreateRuleBookRequest:
type: object
properties:
name:
type: string
usedForAcquisitions:
type: boolean
ledgerRefs:
type: array
items:
type: string
pattern: "[a-z][a-zA-Z0-9]*"
script:
type: string
required:
- ledgerRefs
- name
- script
- usedForAcquisitions
CreateMainLedgerRequest:
type: object
properties:
name:
type: string
required:
- name
CreateCombinedLedgerRequest:
type: object
properties:
name:
type: string
memberLedgerIds:
type: array
items:
type: string
format: uuid
required:
- memberLedgerIds
- name
MarketHistoryResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
date:
type: string
format: date
average:
type: number
highest:
type: number
lowest:
type: number
orderCount:
type: integer
format: int64
volume:
type: integer
format: int64
required:
- average
- date
- highest
- lowest
- marketTypeId
- orderCount
- volume
MarketScanResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
q1:
type: number
median:
type: number
q3:
type: number
totalVolume:
type: integer
format: int64
profit:
type: number
score:
type: number
required:
- marketTypeId
- median
- profit
- q1
- q3
- score
- totalVolume
MarketPriceResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
buy:
type: number
sell:
type: number
orderCount:
type: integer
format: int64
required:
- buy
- marketTypeId
- orderCount
- sell
LedgerResponse:
discriminator:
propertyName: type
mapping:
MAIN: "#/components/schemas/MainLedgerResponse"
COMBINED: "#/components/schemas/CombinedLedgerResponse"
oneOf:
- $ref: "#/components/schemas/MainLedgerResponse"
- $ref: "#/components/schemas/CombinedLedgerResponse"
properties:
type:
type: string
required:
- type
IskTransferResponse:
allOf:
- $ref: "#/components/schemas/TransferResponse"
- type: object
properties:
fromLedgerId:
type: string
format: uuid
toLedgerId:
type: string
format: uuid
amount:
type: number
required:
- amount
- fromLedgerId
- toLedgerId
ItemTransferResponse:
allOf:
- $ref: "#/components/schemas/TransferResponse"
- type: object
properties:
fromLedgerId:
type: string
format: uuid
toLedgerId:
type: string
format: uuid
marketTypeId:
type: integer
format: int64
quantity:
type: integer
format: int64
required:
- fromLedgerId
- marketTypeId
- quantity
- toLedgerId
TransactionResponse:
type: object
properties:
transactionId:
type: string
format: uuid
characterId:
type: integer
format: int64
datetime:
type: string
format: date-time
description:
type: string
transfers:
type: array
items:
$ref: "#/components/schemas/TransferResponse"
required:
- characterId
- datetime
- description
- transactionId
- transfers
TransferResponse:
discriminator:
propertyName: type
mapping:
ISK: "#/components/schemas/IskTransferResponse"
ITEM: "#/components/schemas/ItemTransferResponse"
oneOf:
- $ref: "#/components/schemas/IskTransferResponse"
- $ref: "#/components/schemas/ItemTransferResponse"
properties:
type:
type: string
required:
- type
BalanceResponse:
type: object
properties:
iskBalance:
type: number
itemBalances:
type: array
items:
$ref: "#/components/schemas/ItemBalanceResponse"
required:
- iskBalance
- itemBalances
ItemBalanceResponse:
type: object
properties:
typeId:
type: integer
format: int64
quantity:
type: integer
format: int64
required:
- quantity
- typeId
AcquisitionResponse:
type: object
properties:
acquisitionId:
type: string
format: uuid
characterId:
type: integer
format: int64
marketTypeId:
type: integer
format: int64
source:
type: string
enum:
- BOUGHT
- MANUAL
datetime:
type: string
format: date-time
quantity:
type: integer
format: int64
remaining:
type: integer
format: int64
unitCost:
type: number
required:
- acquisitionId
- characterId
- datetime
- marketTypeId
- quantity
- remaining
- source
- unitCost