TODO: change api.conf URL references to use environment variables and add these variables to the docker-compose configuration for host domain
1566 lines
47 KiB
YAML
1566 lines
47 KiB
YAML
openapi: "3.0.3"
|
|
info:
|
|
title: 17th Rangers Database API
|
|
description: An API for the 17th Rangers Database
|
|
contact:
|
|
email: indigo@indigofox.dev
|
|
license:
|
|
name: MIT
|
|
url: https://opensource.org/license/mit/
|
|
version: "0.0.1"
|
|
servers:
|
|
- url: http://localhost:3001/api
|
|
description: Development
|
|
- url: https://indigofox.dev:9230/api
|
|
description: Production
|
|
tags:
|
|
- name: members
|
|
description: Operations on users/members
|
|
- name: ranks
|
|
description: Rank information & related categories
|
|
- name: awards
|
|
description: Badges & ribbons
|
|
- name: courses
|
|
description: Training courses
|
|
- name: member statuses
|
|
description: Member status indicating active, inactive, company membership, etc.
|
|
paths:
|
|
/members:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get all members
|
|
description: Get all members
|
|
operationId: getMembers
|
|
parameters: []
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
|
|
post:
|
|
tags:
|
|
- members
|
|
summary: Add one or more Members
|
|
description: Add a new Member
|
|
operationId: addMember
|
|
requestBody:
|
|
description: Array of Member objects to add
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Member"
|
|
example:
|
|
- name: Ocean
|
|
email: ocean@example.com
|
|
website: https://example.com
|
|
- name: Paradox
|
|
steamId64: "76561198000000000"
|
|
email: paradox@example.com
|
|
- name: Rhy94
|
|
discordId: "123456789012345678"
|
|
- name: Randy
|
|
- name: Pedano
|
|
- name: French Toast?
|
|
- name: Sherman
|
|
- name: Trigger Tigger
|
|
- name: Giland
|
|
- name: Doc Halladay
|
|
- name: EagleTrooper
|
|
- name: Bones
|
|
- name: burntcopper
|
|
- name: Hakugard
|
|
- name: Hizumi
|
|
- name: MattPod
|
|
- name: Newt
|
|
- name: Raven367
|
|
- name: Sadert
|
|
- name: Sly
|
|
- name: TrashPandaTX
|
|
- name: Alvil
|
|
- name: birdman850
|
|
- name: Goblin
|
|
- name: Page
|
|
- name: Slothdotpy
|
|
- name: Stoner
|
|
- name: Waykook
|
|
- name: A-Train
|
|
- name: Anderp
|
|
- name: Alecazam2001
|
|
- name: Blaze
|
|
- name: BlueFist13F
|
|
- name: Chops
|
|
- name: Fantasy
|
|
- name: FreqiMANN
|
|
- name: Gio
|
|
- name: Homie
|
|
- name: IndigoFox
|
|
- name: JustSam0709
|
|
- name: KarlKirbs
|
|
- name: Kfir
|
|
- name: Khodi
|
|
- name: Kron
|
|
- name: Lulux Liengod
|
|
- name: MechaSaurusRex
|
|
- name: naga
|
|
- name: Pixy
|
|
- name: PrivateKitty
|
|
- name: Silent Assassin
|
|
- name: TheSaladKing
|
|
- name: tiberius
|
|
- name: WacktheMedic
|
|
- name: Buck
|
|
- name: Cletus
|
|
- name: Dan
|
|
- name: evilbawb
|
|
- name: Flunky
|
|
- name: Jacket
|
|
- name: Lewis
|
|
- name: TheWikiFish
|
|
- name: Waffle
|
|
- name: Aiglos
|
|
- name: Bears
|
|
- name: Blackwell
|
|
- name: Chugalug
|
|
- name: Comra
|
|
- name: DrippyIce
|
|
- name: Dr.Machicken
|
|
- name: Gretalian or G
|
|
- name: Hepheastus
|
|
- name: horrorhynde
|
|
- name: HowIsAsh
|
|
- name: kuya luya ginger
|
|
- name: Iron
|
|
- name: King 0-1
|
|
- name: Mr_Hghwy
|
|
- name: SocietalPhoenix
|
|
- name: Snowbandit1861
|
|
- name: Skark18
|
|
- name: Tazer
|
|
- name: Teal
|
|
- name: TimmyTheWhale
|
|
- name: Wimpy
|
|
- name: VioletSnow
|
|
- name: Xufffer
|
|
- name: Ken
|
|
- name: Meeseks
|
|
- name: ajdj100
|
|
- name: Jaeger22
|
|
- name: Raccoon
|
|
- name: WallyWorld
|
|
- name: BadDad
|
|
- name: Caboose
|
|
- name: Hairy
|
|
- name: Muffin
|
|
- name: McCann
|
|
- name: Andi
|
|
- name: Blitzcraig
|
|
- name: Okami
|
|
- name: Radd
|
|
- name: Ryan
|
|
- name: Adrian
|
|
- name: Broski
|
|
- name: Gary
|
|
- name: gossler
|
|
- name: Griggs
|
|
- name: Grizzly(Jay)
|
|
- name: Kerwin
|
|
- name: Pancho
|
|
- name: Mcanaan
|
|
- name: Midnightowl23
|
|
- name: "Null"
|
|
- name: Vlad
|
|
- name: Thats Colin
|
|
- name: JesseKjames08
|
|
- name: Opossum42
|
|
- name: BannanaBoat
|
|
- name: Captin228
|
|
- name: Juice
|
|
- name: Rosey
|
|
- name: Sassy
|
|
- name: Scarab
|
|
- name: Taters159
|
|
- name: Zeps
|
|
- name: Xylemic
|
|
- name: Maestroshake
|
|
- name: Ramsay
|
|
- name: PapkaMush
|
|
- name: Mclovin
|
|
- name: 757Live
|
|
- name: Talon
|
|
- name: OdinPanda
|
|
- name: Zombie
|
|
- name: Puma
|
|
- name: Rugged
|
|
- name: Woods
|
|
- name: Jackson
|
|
- name: Sawgunner17
|
|
- name: sean97T
|
|
- name: TurtleBread
|
|
- name: Marchand
|
|
- name: Jordon
|
|
- name: codux
|
|
- name: WNUSS97
|
|
- name: Rose
|
|
- name: Malk
|
|
responses:
|
|
"201":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
# empty array
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
example: []
|
|
|
|
"207":
|
|
description: Some members were created successfully.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
|
|
"400":
|
|
description: Invalid input
|
|
|
|
"500":
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
# allOf:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: The error message.
|
|
example: Failed to create any Members.
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
example: []
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
|
|
/members/{id}:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get a member by id
|
|
description: Get a specific member by providing an id.
|
|
operationId: getMemberById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Member"
|
|
|
|
"404":
|
|
description: Member not found
|
|
|
|
put:
|
|
tags:
|
|
- members
|
|
summary: Update a member by id
|
|
description: Update core member details by providing an id.
|
|
operationId: updateMemberById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to update
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
requestBody:
|
|
description: Member object that needs to be updated
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Member"
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Member"
|
|
"400":
|
|
description: Invalid input
|
|
"404":
|
|
description: Member not found
|
|
|
|
delete:
|
|
tags:
|
|
- members
|
|
summary: Delete a member by id
|
|
description: Delete a member by providing an id.
|
|
operationId: deleteMemberById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to delete
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
allOf:
|
|
- type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
example: "Member with id=${id} was deleted!"
|
|
deletedMember:
|
|
$ref: "#/components/schemas/Member"
|
|
|
|
"400":
|
|
description: Invalid input
|
|
"404":
|
|
description: Member not found
|
|
|
|
/members/{id}/details:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get a member's details by id
|
|
description: Get member details by providing an id. Returns additional information like courses they've attended, taught, or are subject matter experts for, as well as awards they've earned.
|
|
operationId: getMemberDetailsById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/MemberExtended"
|
|
"404":
|
|
description: Member not found
|
|
/members/{id}/courses/taught:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get course instances taught by a member
|
|
description: Get course instances taught by a member
|
|
operationId: getCourseInstancesTaughtByMember
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/CourseEvent"
|
|
/members/{id}/courses/attended:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get course instances attended by a member
|
|
description: Get course instances by a member
|
|
operationId: getCourseInstancesAttendedByMember
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/CourseEvent"
|
|
/members/{id}/courses/sme:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get courses a member is a subject matter expert for
|
|
description: Get courses a member is a subject matter expert for
|
|
operationId: getCoursesSMEByMember
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
|
|
/members/{id}/awards:
|
|
get:
|
|
tags:
|
|
- members
|
|
summary: Get awards earned by a member
|
|
description: Get awards earned by a member
|
|
operationId: getAwardsEarnedByMember
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: ID of member to return
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
|
|
/awards:
|
|
get:
|
|
tags:
|
|
- awards
|
|
summary: Get all awards
|
|
description: Get all awards
|
|
operationId: getAwards
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
"500":
|
|
description: Internal server error
|
|
|
|
post:
|
|
tags:
|
|
- awards
|
|
summary: Create awards
|
|
description: Create awards
|
|
operationId: createAwards
|
|
requestBody:
|
|
description: Award objects that need to be created
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Award"
|
|
example:
|
|
- name: "Basic Training"
|
|
shortname: "BT"
|
|
description: "Marks the completion of basic training and formal induction to the community."
|
|
imageUrl: "https://img.guildedcdn.com/ContentMedia/831b507af3f11728cfe6f0b2ac95e9cf-Full.webp?w=100&h=30"
|
|
footprint: "ribbon"
|
|
category: "Infantry"
|
|
- name: "Advanced Infantry Training"
|
|
shortname: "AIT"
|
|
description: "Awarded upon successful completion of all 4 parts of AIT."
|
|
imageUrl: "https://img.guildedcdn.com/ContentMedia/d6c823b6c23a4bc4a9dfc73ae98d6e27-Full.webp?w=100&h=30"
|
|
footprint: "ribbon"
|
|
category: "Infantry"
|
|
|
|
responses:
|
|
"201":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
# empty array
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
example: []
|
|
|
|
"207":
|
|
description: Some ranks were created successfully.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
|
|
"400":
|
|
description: Invalid input
|
|
|
|
"500":
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
# allOf:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: The error message.
|
|
example: Failed to create any Awards.
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
example: []
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
/awards?id={id}:
|
|
get:
|
|
tags:
|
|
- awards
|
|
summary: Get award by id
|
|
description: Get award by id
|
|
operationId: getAwardById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Award id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Award"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Award not found
|
|
"500":
|
|
description: Internal server error
|
|
/awards/details?id={id}:
|
|
get:
|
|
tags:
|
|
- awards
|
|
summary: Get award details by id
|
|
description: Retrieves information about an award, including members who hold it and courses required to achieve it.
|
|
operationId: getAwardDetailsById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Award id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/AwardDetail"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Award not found
|
|
"500":
|
|
description: Internal server error
|
|
/awards/categories:
|
|
get:
|
|
tags:
|
|
- awards
|
|
summary: Get all award categories
|
|
description: Get all award categories
|
|
operationId: getAwardCategories
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example: [Infantry, Support, Specialty, Tenure, Commendation]
|
|
"404":
|
|
description: Award categories not found
|
|
"500":
|
|
description: Internal server error
|
|
|
|
/ranks:
|
|
get:
|
|
tags:
|
|
- ranks
|
|
summary: Get all ranks
|
|
description: Get all ranks
|
|
operationId: getRanks
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Rank"
|
|
"500":
|
|
description: Internal server error
|
|
|
|
post:
|
|
tags:
|
|
- ranks
|
|
summary: Create ranks
|
|
description: Create ranks
|
|
operationId: createRanks
|
|
requestBody:
|
|
description: Rank objects that need to be created
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Rank"
|
|
example:
|
|
- name: Recruit
|
|
shortname: RCT
|
|
category: Enlisted
|
|
sort_id: 22
|
|
image_url: https://i.imgur.com/UE1Zs6g.png
|
|
- name: Private
|
|
shortname: PVT
|
|
category: Enlisted
|
|
sort_id: 21
|
|
image_url: http://i.imgur.com/Wh4nYns.png
|
|
- name: Private First Class
|
|
shortname: PFC
|
|
category: Enlisted
|
|
sort_id: 20
|
|
image_url: http://i.imgur.com/9V9PBDi.png
|
|
- name: Specialist
|
|
shortname: SPC
|
|
category: Enlisted
|
|
sort_id: 19
|
|
image_url: http://i.imgur.com/jEEuKKB.png
|
|
- name: Corporal
|
|
shortname: CPL
|
|
category: NCO
|
|
sort_id: 18
|
|
image_url: http://i.imgur.com/nfZrieG.png
|
|
- name: Sergeant
|
|
shortname: SGT
|
|
category: NCO
|
|
sort_id: 17
|
|
image_url: http://i.imgur.com/hfGy0ZZ.png
|
|
- name: Staff Sergeant
|
|
shortname: SSG
|
|
category: NCO
|
|
sort_id: 16
|
|
image_url: http://i.imgur.com/ZVg95ep.png
|
|
- name: Sergeant 1st Class
|
|
shortname: SFC
|
|
category: NCO
|
|
sort_id: 15
|
|
image_url: ""
|
|
- name: Master Sergeant
|
|
shortname: MSG
|
|
category: NCO
|
|
sort_id: 14
|
|
image_url: ""
|
|
- name: 1st Sergeant
|
|
shortname: 1SG
|
|
category: NCO
|
|
sort_id: 13
|
|
image_url: ""
|
|
- name: Sergeant Major
|
|
shortname: SGM
|
|
category: NCO
|
|
sort_id: 12
|
|
image_url: ""
|
|
- name: Warrant Officer 1
|
|
shortname: W01
|
|
category: Enlisted
|
|
sort_id: 11
|
|
image_url: ""
|
|
- name: Chief Warrant Officer 2
|
|
shortname: CW02
|
|
category: Enlisted
|
|
sort_id: 10
|
|
image_url: ""
|
|
- name: Chief Warrant Officer 3
|
|
shortname: CW03
|
|
category: NCO
|
|
sort_id: 9
|
|
image_url: ""
|
|
- name: Chief Warrant Officer 4
|
|
shortname: CW04
|
|
category: NCO
|
|
sort_id: 8
|
|
image_url: ""
|
|
- name: Chief Warrant Officer 5
|
|
shortname: CW05
|
|
category: NCO
|
|
sort_id: 7
|
|
image_url: ""
|
|
- name: 2nd Lieutenant
|
|
shortname: 2LT
|
|
category: Officer
|
|
sort_id: 6
|
|
image_url: ""
|
|
- name: 1st Lieutenant
|
|
shortname: 1LT
|
|
category: Officer
|
|
sort_id: 5
|
|
image_url: ""
|
|
- name: Captain
|
|
shortname: CPT
|
|
category: Officer
|
|
sort_id: 4
|
|
image_url: ""
|
|
- name: Major
|
|
shortname: MAJ
|
|
category: Officer
|
|
sort_id: 3
|
|
image_url: ""
|
|
- name: Lieutenant Colonel
|
|
shortname: LTC
|
|
category: Officer
|
|
sort_id: 2
|
|
image_url: ""
|
|
- name: Staff
|
|
shortname: STAFF
|
|
category: ""
|
|
sort_id: 1
|
|
image_url: ""
|
|
|
|
responses:
|
|
"201":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Rank"
|
|
# empty array
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
example: []
|
|
|
|
"207":
|
|
description: Some ranks were created successfully.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Rank"
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
|
|
"400":
|
|
description: Invalid input
|
|
|
|
"500":
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
# allOf:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: The error message.
|
|
example: Failed to create any Ranks.
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Rank"
|
|
example: []
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
/ranks?id={id}:
|
|
get:
|
|
tags:
|
|
- ranks
|
|
summary: Get rank by id
|
|
description: Get rank by id
|
|
operationId: getRankById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Rank id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Rank"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Rank not found
|
|
"500":
|
|
description: Internal server error
|
|
/ranks/details?id={id}:
|
|
get:
|
|
tags:
|
|
- ranks
|
|
summary: Get rank details by id
|
|
description: Retrieves information about an rank, including members who hold it and courses required to achieve it.
|
|
operationId: getRankDetailsById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Rank id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/RankDetail"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Rank not found
|
|
"500":
|
|
description: Internal server error
|
|
/ranks/categories:
|
|
get:
|
|
tags:
|
|
- ranks
|
|
summary: Get all rank categories
|
|
description: Get all rank categories
|
|
operationId: getRankCategories
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example: [Enlisted, NCO, Officer, Staff]
|
|
"404":
|
|
description: Rank categories not found
|
|
"500":
|
|
description: Internal server error
|
|
|
|
/courses:
|
|
get:
|
|
tags:
|
|
- courses
|
|
summary: Get all courses
|
|
description: Get all courses
|
|
operationId: getCourses
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
"500":
|
|
description: Internal server error
|
|
|
|
post:
|
|
tags:
|
|
- courses
|
|
summary: Create courses
|
|
description: Create courses
|
|
operationId: createCourses
|
|
requestBody:
|
|
description: Course objects that need to be created
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Course"
|
|
example:
|
|
- name: 68 Whiskey (Medical)
|
|
shortname: 68Whiskey
|
|
description: 68 Whiskey is a specialized, advanced infantry role that is solely focused on the sustainability and survivability of personnel after engagements. 68W are uniquely equipped to provide definitive care to all friendly personnel and fulfill a vital backline role in the unit. By the end of this training, trainees will be able to identify, treat, and clear any event from routine patient care to mass casualty incidents.
|
|
category: Infantry
|
|
- name: Heavy Weapons Training
|
|
shortname: Heavy Weapons
|
|
description: Requirement 1 of 2 for the Heavy Weapons Ribbon
|
|
category: Infantry
|
|
- name: Combat Life Saver (CLS)
|
|
shortname: CLS
|
|
description: The Combat Life Saver is an important and unique role within the 17th. It is one of the few roles that allow you to serve a dual-purpose role. You are a rifleman (first and foremost), however, during certain instances, your role changes and you become a first responder and a vitally important assistant to the 68W trained Squad Medic. How well you do your job can be the difference between a mission success and a fireteam or even squad-level wipe. A well-trained and efficient Combat Life Saver can be just as effective in saving teammates as a 68W trained Squad Medic. This training is designed to teach all the core skills and knowledge required to effectively fill the role of Combat Life Saver.
|
|
category: Infantry
|
|
- name: Advanced Infantry Training 1
|
|
shortname: AIT1
|
|
description: Standard Field Operations
|
|
category: Infantry
|
|
- name: Advanced Infantry Training 2
|
|
shortname: AIT2
|
|
description: Standard Combat Operations
|
|
category: Infantry
|
|
- name: Advanced Infantry Training 3
|
|
shortname: AIT3
|
|
description: Urban Combat Operations
|
|
category: Infantry
|
|
- name: Advanced Infantry Training 4
|
|
shortname: AIT4
|
|
description: CQB Training
|
|
category: Infantry
|
|
responses:
|
|
"201":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
# empty array
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
example: []
|
|
|
|
"207":
|
|
description: Some ranks were created successfully.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
|
|
"400":
|
|
description: Invalid input
|
|
|
|
"500":
|
|
description: Internal server error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
# allOf:
|
|
type: object
|
|
properties:
|
|
message:
|
|
type: string
|
|
description: The error message.
|
|
example: Failed to create any Courses.
|
|
successes:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
example: []
|
|
failures:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/SequelizeError"
|
|
/courses?id={id}:
|
|
get:
|
|
tags:
|
|
- courses
|
|
summary: Get course by id
|
|
description: Get course by id
|
|
operationId: getCourseById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Course id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/Course"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Course not found
|
|
"500":
|
|
description: Internal server error
|
|
/courses/details?id={id}:
|
|
get:
|
|
tags:
|
|
- courses
|
|
summary: Get course details by id
|
|
description: Retrieves information about an course, including members who hold it and courses required to achieve it.
|
|
operationId: getCourseDetailsById
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
description: Course id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
format: int64
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: "#/components/schemas/CourseDetail"
|
|
"400":
|
|
description: Invalid ID supplied
|
|
"404":
|
|
description: Course not found
|
|
"500":
|
|
description: Internal server error
|
|
/courses/categories:
|
|
get:
|
|
tags:
|
|
- courses
|
|
summary: Get all course categories
|
|
description: Get all course categories
|
|
operationId: getCourseCategories
|
|
responses:
|
|
"200":
|
|
description: successful operation
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
example: [Infantry, Support, Specialty, Tenure, Commendation]
|
|
"404":
|
|
description: Course categories not found
|
|
"500":
|
|
description: Internal server error
|
|
components:
|
|
schemas:
|
|
Member:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
maxLength: 100
|
|
email:
|
|
type: string
|
|
maxLength: 100
|
|
nullable: true
|
|
website:
|
|
type: string
|
|
maxLength: 240
|
|
nullable: true
|
|
steamId64:
|
|
type: string
|
|
maxLength: 17
|
|
nullable: true
|
|
steamProfileName:
|
|
type: string
|
|
maxLength: 32
|
|
nullable: true
|
|
discordId:
|
|
type: string
|
|
maxLength: 18
|
|
nullable: true
|
|
discordUsername:
|
|
type: string
|
|
maxLength: 32
|
|
nullable: true
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
rank:
|
|
$ref: "#/components/schemas/Rank"
|
|
status:
|
|
$ref: "#/components/schemas/MemberStatus"
|
|
example:
|
|
id: 1
|
|
name: John Doe
|
|
email: test@example.com
|
|
website: https://example.com
|
|
steamId64: "76561198000000000"
|
|
steamProfileName: JohnDoe
|
|
discordId: "123456789012345678"
|
|
discordUsername: JohnDoe#1234
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
MemberExtended:
|
|
allOf:
|
|
- $ref: "#/components/schemas/Member"
|
|
- type: object
|
|
properties:
|
|
awards:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
coursesSME:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
coursesTaught:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/CourseEvent"
|
|
coursesAttended:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/CourseEvent"
|
|
example:
|
|
id: 1
|
|
name: John Doe
|
|
email: Phantom29@opera.com
|
|
website: https://example.com
|
|
steamId64: "76561198000000000"
|
|
steamProfileName: JohnDoe
|
|
discordId: "123456789012345678"
|
|
discordUsername: JohnDoe#1234
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
awards:
|
|
- id: 3
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is earned by completing the Basic Rifle Marksmanship course."
|
|
category: Infantry
|
|
imageUrl: "https://example.com/brm.png"
|
|
footprint: "badge"
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
coursesSME:
|
|
- id: 1
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is designed to teach the basics of rifle marksmanship. It is intended for new members and those who have not received formal training in the past."
|
|
imageUrl: "https://example.com/brm.png"
|
|
coursesTaught:
|
|
- id: 24
|
|
runDate: "2020-01-02"
|
|
createdAt: "2020-01-02T00:00:00.000Z"
|
|
updatedAt: "2020-01-02T00:00:00.000Z"
|
|
coursesAttended:
|
|
- id: 24
|
|
runDate: "2020-01-02"
|
|
createdAt: "2020-01-02T00:00:00.000Z"
|
|
updatedAt: "2020-01-02T00:00:00.000Z"
|
|
Rank:
|
|
type: object
|
|
description: Describes the Rank a Member holds, including a category and custom sort id.
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
maxLength: 100
|
|
category:
|
|
type: string
|
|
maxLength: 100
|
|
enum:
|
|
- Enlisted
|
|
- Officer
|
|
- NCO
|
|
sortId:
|
|
type: integer
|
|
default: 0
|
|
imageUrl:
|
|
type: string
|
|
maxLength: 240
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
example:
|
|
id: 1
|
|
name: Private First Class
|
|
category: Enlisted
|
|
sortId: 2
|
|
imageUrl: https://example.com/image.png
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
RankDetail:
|
|
allOf:
|
|
- $ref: "#/components/schemas/Rank"
|
|
- type: object
|
|
properties:
|
|
members:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
example:
|
|
id: 1
|
|
name: Private First Class
|
|
category: Enlisted
|
|
sortId: 2
|
|
imageUrl: https://example.com/image.png
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
members:
|
|
- id: 1
|
|
name: John Doe
|
|
email: test@example.com
|
|
website: https://example.com
|
|
steamId64: "76561198000000000"
|
|
MemberStatus:
|
|
type: object
|
|
description: Describes a Member's company membership or inactivity reason.
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
maxLength: 100
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
example:
|
|
id: 1
|
|
name: Alpha Company
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
Award:
|
|
type: object
|
|
description: Defines an course, usually a ribbon or badge, that a Member can earn by taking Courses or through other means.
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
maxLength: 100
|
|
shortname:
|
|
type: string
|
|
maxLength: 70
|
|
description:
|
|
type: string
|
|
maxLength: 1000
|
|
nullable: true
|
|
imageUrl:
|
|
type: string
|
|
maxLength: 255
|
|
nullable: true
|
|
description: An image representing the course.
|
|
footprint:
|
|
type: string
|
|
description: Whether the course is a ribbon or a badge.
|
|
maxLength: 45
|
|
enum:
|
|
- "Ribbon"
|
|
- "Badge"
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
example:
|
|
id: 3
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is earned by completing the Basic Rifle Marksmanship course."
|
|
imageUrl: "https://example.com/brm.png"
|
|
footprint: "badge"
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
|
|
AwardDetail:
|
|
allOf:
|
|
- $ref: "#/components/schemas/Award"
|
|
- type: object
|
|
properties:
|
|
awardHolders:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
coursesRequired:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Course"
|
|
example:
|
|
id: 3
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This badge is earned by completing the Basic Rifle Marksmanship course."
|
|
category: "Infantry"
|
|
imageUrl: "https://example.com/brm.png"
|
|
footprint: "Badge"
|
|
createdAt: 2020-01-01 00:00:00.000Z
|
|
updatedAt: 2020-01-01 00:00:00.000Z
|
|
awardHolders:
|
|
- id: 1
|
|
name: John Doe
|
|
email: test@example.com
|
|
website: https://example.com
|
|
steamId64: 76561198000000000
|
|
coursesRequired:
|
|
- id: 1
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is designed to teach the basics of rifle marksmanship. It is intended for new members and those who have not received formal training in the past."
|
|
category: "Infantry"
|
|
imageUrl: "https://example.com/brm.png"
|
|
Course:
|
|
type: object
|
|
description: Represents the definition of training course. It may contribute toward earning an Award.
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
name:
|
|
type: string
|
|
maxLength: 100
|
|
shortname:
|
|
type: string
|
|
maxLength: 70
|
|
description:
|
|
type: string
|
|
maxLength: 1000
|
|
nullable: true
|
|
imageUrl:
|
|
type: string
|
|
description: An image representing the course.
|
|
maxLength: 255
|
|
nullable: true
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
example:
|
|
id: 1
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is designed to teach the basics of rifle marksmanship. It is intended for new members and those who have not received formal training in the past."
|
|
imageUrl: "https://example.com/brm.png"
|
|
|
|
CourseDetail:
|
|
allOf:
|
|
- $ref: "#/components/schemas/Course"
|
|
- type: object
|
|
properties:
|
|
sme:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Member"
|
|
trainingsHeld:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/CourseEvent"
|
|
possibleAwards:
|
|
type: array
|
|
items:
|
|
$ref: "#/components/schemas/Award"
|
|
example:
|
|
id: 1
|
|
name: "Basic Rifle Marksmanship"
|
|
shortname: "BRM"
|
|
description: "This course is designed to teach the basics of rifle marksmanship. It is intended for new members and those who have not received formal training in the past."
|
|
imageUrl: "https://example.com/brm.png"
|
|
sme:
|
|
- id: 1
|
|
name: John Doe
|
|
email: test@example.com
|
|
website: https://example.com
|
|
steamId64: 76561198000000000
|
|
|
|
CourseEvent:
|
|
type: object
|
|
description: Represents a specific instance of a Course, including the date it was taught, who taught it, and who attended.
|
|
properties:
|
|
id:
|
|
type: integer
|
|
format: int64
|
|
readOnly: true
|
|
runDate:
|
|
type: string
|
|
format: date
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
readOnly: true
|
|
example:
|
|
id: 24
|
|
runDate: "2020-01-02"
|
|
createdAt: "2020-01-02T00:00:00.000Z"
|
|
updatedAt: "2020-01-02T00:00:00.000Z"
|
|
SequelizeError:
|
|
type: object
|
|
description: A Sequelize error.
|
|
properties:
|
|
message:
|
|
type: string
|
|
type:
|
|
type: string
|
|
path:
|
|
type: string
|
|
value:
|
|
type: string
|
|
origin:
|
|
type: string
|
|
instance:
|
|
type: object
|
|
validatorKey:
|
|
type: string
|
|
validatorName:
|
|
type: string
|
|
validatorArgs:
|
|
type: array
|
|
items:
|
|
type: string
|
|
|
|
responses:
|
|
UnauthorizedError:
|
|
description: Access token is missing or invalid
|
|
|
|
# 1) Define the security scheme type (HTTP bearer)
|
|
securitySchemes:
|
|
bearerAuth: # arbitrary name for the security scheme
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT # optional, arbitrary value for documentation purposes
|
|
# 2) Apply the security globally to all operations
|
|
security:
|
|
- bearerAuth: [] # use the same name as above
|