diff --git a/models/Agent.json b/models/Agent.json new file mode 100644 index 0000000..75b5beb --- /dev/null +++ b/models/Agent.json @@ -0,0 +1,29 @@ +{ + "description": "", + "type": "object", + "properties": { + "accountId": { + "type": "string", + "minLength": 1 + }, + "symbol": { + "type": "string", + "minLength": 1 + }, + "headquarters": { + "type": "string", + "minLength": 1, + "description": "The headquarters of the agent." + }, + "credits": { + "type": "integer", + "description": "The number of credits the agent has available. Credits can be negative if funds have been overdrawn." + } + }, + "required": [ + "accountId", + "symbol", + "headquarters", + "credits" + ] +} \ No newline at end of file diff --git a/models/Agent.yaml b/models/Agent.yaml deleted file mode 100644 index a628421..0000000 --- a/models/Agent.yaml +++ /dev/null @@ -1,25 +0,0 @@ -description: '' -type: object -x-examples: - example-1: - accountId: cl0hok34m0003ks0jjql5q8f2 - symbol: 2C52AD - headquarters: X1-OE-PM - credits: 0 -properties: - accountId: - type: string - minLength: 1 - symbol: - type: string - minLength: 1 - headquarters: - type: string - minLength: 1 - credits: - type: integer -required: - - accountId - - symbol - - headquarters - - credits diff --git a/models/WaypointChart.json b/models/Chart.json similarity index 62% rename from models/WaypointChart.json rename to models/Chart.json index 6eead76..d2879d9 100644 --- a/models/WaypointChart.json +++ b/models/Chart.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "The chart of the waypoint, which makes the waypoint visible to other agents.", + "description": "The chart of a system or waypoint, which makes the location visible to other agents.", "properties": { "submittedBy": { "type": "string" diff --git a/models/Contract.json b/models/Contract.json new file mode 100644 index 0000000..d283870 --- /dev/null +++ b/models/Contract.json @@ -0,0 +1,51 @@ +{ + "description": "", + "type": "object", + "properties": { + "id": { + "type": "string", + "minLength": 1 + }, + "factionSymbol": { + "type": "string", + "minLength": 1, + "description": "The symbol of the faction that this contract is for." + }, + "type": { + "type": "string", + "enum": [ + "PROCUREMENT", + "TRANSPORT", + "SHUTTLE" + ] + }, + "terms": { + "type": "object", + "$ref": "./ContractTerms.json" + }, + "accepted": { + "type": "boolean", + "default": false, + "description": "Whether the contract has been accepted by the agent" + }, + "fulfilled": { + "type": "boolean", + "default": false, + "description": "Whether the contract has been fulfilled" + }, + "expiration": { + "type": "string", + "format": "date-time", + "description": "The time at which the contract expires" + } + }, + "required": [ + "id", + "factionSymbol", + "type", + "terms", + "accepted", + "fulfilled", + "expiration" + ] +} \ No newline at end of file diff --git a/models/Contract.yaml b/models/Contract.yaml deleted file mode 100644 index fcea507..0000000 --- a/models/Contract.yaml +++ /dev/null @@ -1,86 +0,0 @@ -description: '' -type: object -properties: - id: - type: string - minLength: 1 - faction: - type: string - minLength: 1 - type: - type: string - minLength: 1 - terms: - type: object - properties: - deadline: - type: string - minLength: 1 - payment: - type: object - properties: - onAccepted: - type: integer - onFulfilled: - type: integer - required: - - onAccepted - - onFulfilled - deliver: - type: array - uniqueItems: true - minItems: 1 - items: - required: - - tradeSymbol - - destination - - units - - fulfilled - properties: - tradeSymbol: - type: string - minLength: 1 - destination: - type: string - minLength: 1 - units: - type: integer - fulfilled: - type: integer - required: - - deadline - - payment - - deliver - accepted: - type: boolean - fulfilled: - type: boolean - expiresAt: - type: string - minLength: 1 -required: - - id - - faction - - type - - terms - - accepted - - fulfilled - - expiresAt -x-examples: - example-1: - id: cl0hok38t0014ks0jnoy8o5vh - faction: COMMERCE_REPUBLIC - type: PROCUREMENT - terms: - deadline: '2022-03-11T05:16:59.113Z' - payment: - onAccepted: 20000 - onFulfilled: 100000 - deliver: - - tradeSymbol: IRON_ORE - destination: X1-OE-PM - units: 10000 - fulfilled: 0 - accepted: false - fulfilled: false - expiresAt: '2022-03-09T05:16:59.112Z' diff --git a/models/ContractDelivery.yaml b/models/ContractDelivery.yaml deleted file mode 100644 index eab93e9..0000000 --- a/models/ContractDelivery.yaml +++ /dev/null @@ -1,30 +0,0 @@ -description: '' -type: object -properties: - data: - type: object - properties: - tradeSymbol: - type: string - minLength: 1 - destination: - type: string - minLength: 1 - units: - type: integer - fulfilled: - type: integer - required: - - tradeSymbol - - destination - - units - - fulfilled -required: - - data -x-examples: - example-1: - data: - tradeSymbol: IRON_ORE - destination: X1-OE-PM - units: 10000 - fulfilled: 500 diff --git a/models/ContractPayment.json b/models/ContractPayment.json new file mode 100644 index 0000000..a102adf --- /dev/null +++ b/models/ContractPayment.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "onAccepted": { + "type": "integer", + "description": "The amount of credits received up front for accepting the contract." + }, + "onFulfilled": { + "type": "integer", + "description": "The amount of credits received when the contract is fulfilled." + } + }, + "required": [ + "onAccepted", + "onFulfilled" + ] +} \ No newline at end of file diff --git a/models/ContractProcurement.json b/models/ContractProcurement.json new file mode 100644 index 0000000..df988d3 --- /dev/null +++ b/models/ContractProcurement.json @@ -0,0 +1,30 @@ +{ + "description": "The details of a procurement contract. Includes the type of good, units needed, and the destination.", + "type": "object", + "properties": { + "tradeSymbol": { + "type": "string", + "description": "The symbol of the trade good to deliver.", + "minLength": 1 + }, + "destinationSymbol": { + "type": "string", + "description": "The destination where goods need to be delivered.", + "minLength": 1 + }, + "unitsRequired": { + "type": "integer", + "description": "The number of units that need to be delivered on this contract." + }, + "unitsFulfilled": { + "type": "integer", + "description": "The number of units fulfilled on this contract." + } + }, + "required": [ + "tradeSymbol", + "destinationSymbol", + "unitsRequired", + "unitsFulfilled" + ] +} \ No newline at end of file diff --git a/models/ContractTerms.json b/models/ContractTerms.json new file mode 100644 index 0000000..cc5d191 --- /dev/null +++ b/models/ContractTerms.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "deadline": { + "type": "string", + "format": "date-time", + "description": "The deadline for the contract." + }, + "payment": { + "type": "object", + "$ref": "./ContractPayment.json" + }, + "procurement": { + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "type": "object", + "$ref": "./ContractProcurement.json" + } + } + }, + "required": [ + "deadline", + "payment" + ] +} \ No newline at end of file diff --git a/models/Cooldown.json b/models/Cooldown.json index 6711be5..148d98c 100644 --- a/models/Cooldown.json +++ b/models/Cooldown.json @@ -18,5 +18,10 @@ "description": "The date and time when the cooldown expires in ISO 8601 format", "minimum": 0 } - } + }, + "required": [ + "totalSeconds", + "remainingSeconds", + "expiration" + ] } \ No newline at end of file diff --git a/models/Extraction.json b/models/Extraction.json new file mode 100644 index 0000000..0c78e39 --- /dev/null +++ b/models/Extraction.json @@ -0,0 +1,18 @@ +{ + "description": "", + "type": "object", + "properties": { + "shipSymbol": { + "type": "string", + "minLength": 1 + }, + "yield": { + "type": "object", + "$ref": "./ExtractionYield.json" + } + }, + "required": [ + "shipSymbol", + "yield" + ] +} \ No newline at end of file diff --git a/models/Extraction.yaml b/models/Extraction.yaml deleted file mode 100644 index 7d2943c..0000000 --- a/models/Extraction.yaml +++ /dev/null @@ -1,26 +0,0 @@ -description: '' -type: object -properties: - shipSymbol: - type: string - minLength: 1 - yield: - type: object - properties: - tradeSymbol: - type: string - minLength: 1 - units: - type: integer - required: - - tradeSymbol - - units -required: - - shipSymbol - - yield -x-examples: - example-1: - shipSymbol: 4B902A-1 - yield: - tradeSymbol: SILICON - units: 16 diff --git a/models/ExtractionYield.json b/models/ExtractionYield.json new file mode 100644 index 0000000..ab238a1 --- /dev/null +++ b/models/ExtractionYield.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "units": { + "type": "integer", + "description": "The number of units extracted that were placed into the ship's cargo hold." + } + }, + "required": [ + "symbol", + "units" + ] +} \ No newline at end of file diff --git a/models/Faction.json b/models/Faction.json index c383928..755b1ce 100644 --- a/models/Faction.json +++ b/models/Faction.json @@ -1,20 +1,6 @@ { "description": "", "type": "object", - "x-examples": { - "example-1": { - "symbol": "COMMERCE_REPUBLIC", - "name": "Commerce Repubic", - "description": "", - "headquarters": "X1-OE-PM", - "traits": [ - "BUREAUCRATIC", - "CAPITALISTIC", - "GUILD", - "ESTABLISHED" - ] - } - }, "properties": { "symbol": { "type": "string", @@ -35,7 +21,8 @@ "traits": { "type": "array", "items": { - "type": "string" + "type": "object", + "$ref": "./FactionTrait.json" } } }, diff --git a/models/FactionTrait.json b/models/FactionTrait.json new file mode 100644 index 0000000..2e95d0c --- /dev/null +++ b/models/FactionTrait.json @@ -0,0 +1,55 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The unique identifier of the trait.", + "enum": [ + "BUREAUCRATIC", + "SECRETIVE", + "CAPITALISTIC", + "INDUSTRIOUS", + "PEACEFUL", + "DISTRUSTFUL", + "WELCOMING", + "ANARCHIST", + "CONFLICTED", + "AUTHORITARIAN", + "OLIGARCHICAL", + "DYNASTIC", + "DEMOCRACTIC", + "DECENTRALIZED", + "SMUGGLERS", + "SCAVENGERS", + "REBELLIOUS", + "EXILES", + "PIRATES", + "RAIDERS", + "CLAN", + "GUILD", + "DOMINION", + "FRINGE", + "FORSAKEN", + "ISOLATED", + "LOCALIZED", + "ESTABLISHED", + "NOTABLE", + "DOMINANT", + "INESCAPABLE" + ] + }, + "name": { + "type": "string", + "description": "The name of the trait." + }, + "description": { + "type": "string", + "description": "A description of the trait." + } + }, + "required": [ + "symbol", + "name", + "description" + ] +} \ No newline at end of file diff --git a/models/Jump.json b/models/Jump.json deleted file mode 100644 index 792d59d..0000000 --- a/models/Jump.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "", - "type": "object", - "properties": { - "shipSymbol": { - "type": "string", - "minLength": 1 - }, - "destination": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "shipSymbol", - "destination" - ], - "x-examples": { - "example-1": { - "shipSymbol": "1D7FDA-1", - "destination": "00E0B1" - } - }, - "examples": [ - { - "shipSymbol": "1D7FDA-1", - "destination": "00E0B1" - } - ] -} \ No newline at end of file diff --git a/models/Market.json b/models/Market.json index 2730266..141e8d1 100644 --- a/models/Market.json +++ b/models/Market.json @@ -10,14 +10,26 @@ "type": "array", "description": "The list of goods that are exported from this market.", "items": { - "type": "string" + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the good." + } + } } }, "imports": { "type": "array", "description": "The list of goods that are sought as imports in this market.", "items": { - "type": "string" + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the good." + } + } } }, "transactions": { @@ -34,5 +46,12 @@ "$ref": "./MarketTradeGood.json" } } - } + }, + "required": [ + "symbol", + "exports", + "imports", + "transactions", + "tradeGoods" + ] } \ No newline at end of file diff --git a/models/MarketTradeGood.json b/models/MarketTradeGood.json index 4519f05..0b6ba5a 100644 --- a/models/MarketTradeGood.json +++ b/models/MarketTradeGood.json @@ -7,7 +7,7 @@ }, "tradeVolume": { "type": "integer", - "description": "The average volume flowing through the market for this type of good.", + "description": "The typical volume flowing through the market for this type of good.", "minimum": 1 }, "supply": { @@ -29,5 +29,12 @@ "description": "The price at which this good is bought.", "minimum": 0 } - } + }, + "required": [ + "symbol", + "tradeVolume", + "supply", + "purchasePrice", + "sellPrice" + ] } \ No newline at end of file diff --git a/models/MarketTransaction.json b/models/MarketTransaction.json index b076537..30d71e7 100644 --- a/models/MarketTransaction.json +++ b/models/MarketTransaction.json @@ -23,6 +23,11 @@ "description": "The price per unit of the transaction.", "minimum": 1 }, + "totalPrice": { + "type": "integer", + "description": "The total price of the transaction.", + "minimum": 1 + }, "shipSymbol": { "type": "string", "description": "The symbol of the ship that made the transaction." @@ -32,5 +37,13 @@ "format": "date-time", "description": "The timestamp of the transaction." } - } + }, + "required": [ + "symbol", + "type", + "units", + "pricePerUnit", + "shipSymbol", + "timestamp" + ] } \ No newline at end of file diff --git a/models/Meta.json b/models/Meta.json new file mode 100644 index 0000000..48b7e71 --- /dev/null +++ b/models/Meta.json @@ -0,0 +1,27 @@ +{ + "description": "", + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "limit": { + "type": "integer" + } + }, + "required": [ + "total", + "page", + "limit" + ], + "x-examples": { + "example-1": { + "total": 6, + "page": 1, + "limit": 20 + } + } +} \ No newline at end of file diff --git a/models/Meta.yaml b/models/Meta.yaml deleted file mode 100644 index 6fb23a0..0000000 --- a/models/Meta.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: '' -type: object -properties: - total: - type: integer - page: - type: integer - limit: - type: integer -required: - - total - - page - - limit -x-examples: - example-1: - total: 6 - page: 1 - limit: 20 diff --git a/models/ScannedShip.json b/models/ScannedShip.json new file mode 100644 index 0000000..5fe4c50 --- /dev/null +++ b/models/ScannedShip.json @@ -0,0 +1,43 @@ +{ + "description": "The ship that was scanned. Details include information about the ship that could be detected by the scanner.", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]_[HEX_ID]`", + "minLength": 8 + }, + "registration": { + "type": "object", + "$ref": "./ShipRegistration.json" + }, + "nav": { + "type": "object", + "$ref": "./ShipNav.json" + }, + "frame": { + "$ref": "./ShipFrame.json" + }, + "reactor": { + "$ref": "./ShipReactor.json" + }, + "engine": { + "$ref": "./ShipEngine.json" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "./ShipMount.json" + } + } + }, + "required": [ + "symbol", + "registration", + "nav", + "frame", + "reactor", + "engine", + "mounts" + ] +} \ No newline at end of file diff --git a/models/ScannedShip.yaml b/models/ScannedShip.yaml deleted file mode 100644 index 3e9af22..0000000 --- a/models/ScannedShip.yaml +++ /dev/null @@ -1,47 +0,0 @@ -description: '' -type: object -properties: - symbol: - type: string - minLength: 1 - registration: - type: object - properties: - factionSymbol: - type: string - minLength: 1 - role: - type: string - minLength: 1 - required: - - factionSymbol - - role - frameSymbol: - type: string - minLength: 1 - reactorSymbol: - type: string - minLength: 1 - engineSymbol: - type: string - minLength: 1 - expiration: - type: string - minLength: 1 -required: - - symbol - - registration - - frameSymbol - - reactorSymbol - - engineSymbol - - expiration -x-examples: - example-1: - symbol: SPACERS_GUILD-65E1BA - registration: - factionSymbol: SPACERS_GUILD - role: EXCAVATOR - frameSymbol: FRAME_LIGHT_FREIGHTER - reactorSymbol: REACTOR_FUSION_I - engineSymbol: ENGINE_ION_DRIVE_I - expiration: '2022-03-12T00:44:14.222Z' diff --git a/models/Ship.json b/models/Ship.json index 04b5a75..40e9ed8 100644 --- a/models/Ship.json +++ b/models/Ship.json @@ -45,6 +45,16 @@ } }, "required": [ - "symbol" + "symbol", + "registration", + "nav", + "crew", + "frame", + "reactor", + "engine", + "modules", + "mounts", + "cargo", + "fuel" ] } \ No newline at end of file diff --git a/models/ShipCargo.json b/models/ShipCargo.json index bdc27f9..b2e4348 100644 --- a/models/ShipCargo.json +++ b/models/ShipCargo.json @@ -11,11 +11,11 @@ "description": "The items currently in the cargo hold.", "items": { "$ref": "./ShipCargoItem.json" - }, - "required": [ - "capacity", - "inventory" - ] + } } - } + }, + "required": [ + "capacity", + "inventory" + ] } \ No newline at end of file diff --git a/models/ShipCargoItem.json b/models/ShipCargoItem.json index a8760bd..1a1621c 100644 --- a/models/ShipCargoItem.json +++ b/models/ShipCargoItem.json @@ -3,13 +3,16 @@ "description": "The type of cargo item and the number of units.", "properties": { "symbol": { - "type": "string" + "type": "string", + "description": "The unique identifier of the cargo item type." }, "name": { - "type": "string" + "type": "string", + "description": "The name of the cargo item type." }, "units": { "type": "integer", + "description": "The number of units of the cargo item.", "minimum": 1 } }, diff --git a/models/ShipCrew.json b/models/ShipCrew.json index db12854..f48bcfb 100644 --- a/models/ShipCrew.json +++ b/models/ShipCrew.json @@ -1,12 +1,5 @@ { "type": "object", - "required": [ - "count", - "min", - "max", - "rotation", - "morale" - ], "description": "The ship's crew service and maintain the ship's systems and equipment.", "properties": { "count": { @@ -41,5 +34,13 @@ "description": "The amount of credits per crew member paid per minute of time travelled between waypoints. Wages are paid when a ship departs from a waypoint.", "minimum": 0 } - } + }, + "required": [ + "count", + "min", + "max", + "rotation", + "morale", + "wages" + ] } \ No newline at end of file diff --git a/models/ShipEngine.json b/models/ShipEngine.json index c480fda..5b0b1de 100644 --- a/models/ShipEngine.json +++ b/models/ShipEngine.json @@ -12,13 +12,7 @@ ] }, "name": { - "type": "string", - "enum": [ - "Impulse Drive", - "Ion Drive", - "Advanced Ion Drive", - "Hyper Drive" - ] + "type": "string" }, "condition": { "$ref": "./ShipCondition.json" @@ -30,5 +24,11 @@ "requirements": { "$ref": "./ShipRequirements.json" } - } + }, + "required": [ + "symbol", + "name", + "speed", + "requirements" + ] } \ No newline at end of file diff --git a/models/ShipFrame.json b/models/ShipFrame.json index ea51b29..03b5782 100644 --- a/models/ShipFrame.json +++ b/models/ShipFrame.json @@ -21,22 +21,7 @@ ] }, "name": { - "type": "string", - "enum": [ - "Drone", - "Interceptor", - "Racer", - "Fighter", - "Frigate", - "Shuttle", - "Explorer", - "Light Freighter", - "Heavy Freighter", - "Transport", - "Destroyer", - "Cruiser", - "Carrier" - ] + "type": "string" }, "condition": { "$ref": "./ShipCondition.json" @@ -56,5 +41,13 @@ "requirements": { "$ref": "./ShipRequirements.json" } - } + }, + "required": [ + "symbol", + "name", + "moduleSlots", + "mountingPoints", + "fuelCapacity", + "requirements" + ] } \ No newline at end of file diff --git a/models/ShipFuel.json b/models/ShipFuel.json index e2a5081..889ca5e 100644 --- a/models/ShipFuel.json +++ b/models/ShipFuel.json @@ -31,5 +31,9 @@ "timestamp" ] } - } + }, + "required": [ + "amount", + "capacity" + ] } \ No newline at end of file diff --git a/models/ShipModule.json b/models/ShipModule.json index 0de418a..c353912 100644 --- a/models/ShipModule.json +++ b/models/ShipModule.json @@ -15,19 +15,15 @@ ] }, "name": { - "type": "string", - "enum": [ - "Fuel Tank", - "Cargo Hold", - "Crew Quarters", - "Envoy Quarters", - "Passenger Cabin", - "Micro Refinery", - "Jump Drive" - ] + "type": "string" }, "requirements": { "$ref": "./ShipRequirements.json" } - } + }, + "required": [ + "symbol", + "name", + "requirements" + ] } \ No newline at end of file diff --git a/models/ShipMount.json b/models/ShipMount.json index e79051a..043c3c1 100644 --- a/models/ShipMount.json +++ b/models/ShipMount.json @@ -17,21 +17,15 @@ ] }, "name": { - "type": "string", - "enum": [ - "Gas Siphon I", - "Gas Siphon II", - "Gas Siphon III", - "Sensor Array I", - "Sensor Array II", - "Sensor Array III", - "Mining Laser I", - "Mining Laser II", - "Mining Laser III" - ] + "type": "string" }, "requirements": { "$ref": "./ShipRequirements.json" } - } + }, + "required": [ + "symbol", + "name", + "requirements" + ] } \ No newline at end of file diff --git a/models/ShipNav.json b/models/ShipNav.json index e92cf1d..400ce4b 100644 --- a/models/ShipNav.json +++ b/models/ShipNav.json @@ -2,6 +2,10 @@ "type": "object", "description": "The navigation information of the ship.", "properties": { + "waypointSymbol": { + "type": "string", + "description": "The waypoint symbol of the ship's current location, or if the ship is in-transit, the waypoint symbol of the ship's destination." + }, "route": { "$ref": "./ShipNavRoute.json" }, @@ -13,6 +17,7 @@ } }, "required": [ + "waypointSymbol", "route", "status", "speed" diff --git a/models/ShipNavRoute.json b/models/ShipNavRoute.json index eefe049..a500921 100644 --- a/models/ShipNavRoute.json +++ b/models/ShipNavRoute.json @@ -2,21 +2,13 @@ "type": "object", "description": "The routing information for the ship's most recent transit or current location.", "properties": { - "symbol": { - "type": "string", - "description": "The unique identifer of the waypoint." + "destination": { + "type": "object", + "$ref": "./Waypoint.json" }, - "name": { - "type": "string", - "description": "The name of the waypoint." - }, - "x": { - "type": "integer", - "description": "The x coordinate of the waypoint." - }, - "y": { - "type": "integer", - "description": "The y coordinate of the waypoint." + "departure": { + "type": "object", + "$ref": "./Waypoint.json" }, "arrival": { "type": "string", @@ -25,10 +17,8 @@ } }, "required": [ - "symbol", - "name", - "x", - "y", + "destination", + "departure", "arrival" ] } \ No newline at end of file diff --git a/models/ShipReactor.json b/models/ShipReactor.json index 8352b3f..6abc42c 100644 --- a/models/ShipReactor.json +++ b/models/ShipReactor.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "The reactor of the ship. It is a large, cylindrical structure that is usually located in the center of the ship. The reactor is responsible for powering the ship's systems and weapons.", + "description": "The reactor of the ship. The reactor is responsible for powering the ship's systems and weapons.", "properties": { "symbol": { "type": "string", @@ -13,14 +13,7 @@ ] }, "name": { - "type": "string", - "enum": [ - "Solar Reactor", - "Fusion Reactor", - "Fission Reactor", - "Chemical Reactor", - "Dark Matter Reactor" - ] + "type": "string" }, "condition": { "$ref": "./ShipCondition.json" @@ -29,11 +22,15 @@ "type": "integer", "minimum": 1 }, - "cooldown": { - "$ref": "./Cooldown.json" - }, "requirements": { "$ref": "./ShipRequirements.json" } - } + }, + "required": [ + "symbol", + "name", + "condition", + "powerOutput", + "requirements" + ] } \ No newline at end of file diff --git a/models/ShipRegistration.json b/models/ShipRegistration.json index 8068c2a..74b8859 100644 --- a/models/ShipRegistration.json +++ b/models/ShipRegistration.json @@ -1,10 +1,5 @@ { "type": "object", - "required": [ - "name", - "faction", - "role" - ], "description": "The public registration information of the ship", "properties": { "name": { @@ -20,5 +15,10 @@ "role": { "$ref": "./ShipRole.json" } - } + }, + "required": [ + "name", + "faction", + "role" + ] } \ No newline at end of file diff --git a/models/ShipRequirements.json b/models/ShipRequirements.json index 2510319..862a2ab 100644 --- a/models/ShipRequirements.json +++ b/models/ShipRequirements.json @@ -14,5 +14,10 @@ "type": "integer", "description": "The number of module slots required for installation." } - } + }, + "required": [ + "power", + "crew", + "slots" + ] } \ No newline at end of file diff --git a/models/Shipyard.json b/models/Shipyard.json index f99ac83..9803aad 100644 --- a/models/Shipyard.json +++ b/models/Shipyard.json @@ -7,6 +7,13 @@ "description": "The symbol of the shipyard. The symbol is the same as the waypoint where the shipyard is located.", "minLength": 1 }, + "transactions": { + "type": "array", + "description": "The list of recent transactions at this shipyard.", + "items": { + "$ref": "./ShipyardTransaction.json" + } + }, "ships": { "type": "array", "description": "The ships that are currently available for purchase at the shipyard.", @@ -14,5 +21,9 @@ "$ref": "./ShipyardShip.json" } } - } + }, + "required": [ + "symbol", + "ships" + ] } \ No newline at end of file diff --git a/models/ShipyardShip.json b/models/ShipyardShip.json index 2533e1b..393807f 100644 --- a/models/ShipyardShip.json +++ b/models/ShipyardShip.json @@ -6,7 +6,7 @@ "type": "string", "minLength": 1 }, - "price": { + "purchasePrice": { "type": "integer" }, "frame": { @@ -30,5 +30,14 @@ "$ref": "./ShipMount.json" } } - } + }, + "required": [ + "symbol", + "purchasePrice", + "frame", + "reactor", + "engine", + "modules", + "mounts" + ] } \ No newline at end of file diff --git a/models/ShipyardTransaction.json b/models/ShipyardTransaction.json new file mode 100644 index 0000000..dc0fd3e --- /dev/null +++ b/models/ShipyardTransaction.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the ship that was purchased." + }, + "price": { + "type": "integer", + "description": "The price of the transaction.", + "minimum": 1 + }, + "agentSymbol": { + "type": "string", + "description": "The symbol of the agent that made the transaction." + }, + "timestamp": { + "type": "string", + "format": "date-time", + "description": "The timestamp of the transaction." + } + }, + "required": [ + "symbol", + "price", + "agentSymbol", + "timestamp" + ] +} \ No newline at end of file diff --git a/models/Survey.json b/models/Survey.json new file mode 100644 index 0000000..cbf50b2 --- /dev/null +++ b/models/Survey.json @@ -0,0 +1,30 @@ +{ + "description": "A resource survey of a waypoint, detailing a specific extraction location and the types of resources that can be found there.", + "type": "object", + "properties": { + "signature": { + "type": "string", + "description": "A unique signature for the location of this survey. This signature is verified when attempting an extraction using this survey.", + "minLength": 1 + }, + "deposits": { + "type": "array", + "description": "A list of deposits that can be found at this location.", + "items": { + "type": "object", + "$ref": "./SurveyDeposit.json" + } + }, + "expiration": { + "type": "string", + "format": "date-time", + "description": "The date and time when the survey expires. After this date and time, the survey will no longer be available for extraction.", + "minimum": 0 + } + }, + "required": [ + "signature", + "deposits", + "expiration" + ] +} \ No newline at end of file diff --git a/models/Survey.yaml b/models/Survey.yaml deleted file mode 100644 index 11ceea6..0000000 --- a/models/Survey.yaml +++ /dev/null @@ -1,23 +0,0 @@ -description: '' -type: object -x-examples: - example-1: - signature: X1-OE-D2DD38 - deposits: - - COPPER_ORE - expiration: '2022-03-08T05:41:55.514Z' -properties: - signature: - type: string - minLength: 1 - deposits: - type: array - items: - type: string - expiration: - type: string - minLength: 1 -required: - - signature - - deposits - - expiration diff --git a/models/SurveyDeposit.json b/models/SurveyDeposit.json new file mode 100644 index 0000000..671a4fd --- /dev/null +++ b/models/SurveyDeposit.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "description": "A surveyed deposit of a mineral or resource available for extraction.", + "properties": { + "symbol": { + "type": "string", + "description": "The symbol of the deposit." + } + }, + "required": [ + "symbol" + ] +} \ No newline at end of file diff --git a/models/System.json b/models/System.json new file mode 100644 index 0000000..7e91a2d --- /dev/null +++ b/models/System.json @@ -0,0 +1,63 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "sectorSymbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "type": "string", + "enum": [ + "NEUTRON_STAR", + "RED_STAR", + "ORANGE_STAR", + "BLUE_STAR", + "YOUNG_STAR", + "WHITE_DWARF", + "BLACK_HOLE", + "HYPERGIANT", + "NEBULA", + "UNSTABLE" + ] + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "waypoints": { + "type": "array", + "items": { + "type": "object", + "$ref": "./SystemWaypoint.json" + } + }, + "factions": { + "type": "array", + "items": { + "type": "object", + "$ref": "./SystemFaction.json" + } + }, + "chart": { + "type": "object", + "$ref": "./Chart.json" + } + }, + "required": [ + "symbol", + "sectorSymbol", + "type", + "x", + "y", + "waypoints", + "factions", + "chart" + ] +} \ No newline at end of file diff --git a/models/System.yaml b/models/System.yaml deleted file mode 100644 index fedeec8..0000000 --- a/models/System.yaml +++ /dev/null @@ -1,55 +0,0 @@ -description: '' -type: object -x-examples: - example-1: - symbol: X1-OE - sector: X1 - type: RED_STAR - x: 0 - 'y': 0 - waypoints: - - X1-OE-PM - - X1-OE-PM01 - - X1-OE-A005 - - X1-OE-25X - factions: - - COMMERCE_REPUBLIC - - MINERS_COLLECTIVE - - SPACERS_GUILD - charted: true - chartedBy: null -properties: - symbol: - type: string - minLength: 1 - sector: - type: string - minLength: 1 - type: - type: string - minLength: 1 - x: - type: integer - 'y': - type: integer - waypoints: - type: array - items: - type: string - factions: - type: array - items: - type: string - charted: - type: boolean - chartedBy: - type: string -required: - - symbol - - sector - - type - - x - - 'y' - - waypoints - - factions - - charted diff --git a/models/SystemFaction.json b/models/SystemFaction.json new file mode 100644 index 0000000..1022638 --- /dev/null +++ b/models/SystemFaction.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "symbol" + ] +} \ No newline at end of file diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json new file mode 100644 index 0000000..1022638 --- /dev/null +++ b/models/SystemWaypoint.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "symbol" + ] +} \ No newline at end of file diff --git a/models/Trade.yaml b/models/Trade.yaml deleted file mode 100644 index 6931790..0000000 --- a/models/Trade.yaml +++ /dev/null @@ -1,24 +0,0 @@ -description: '' -type: object -properties: - waypointSymbol: - type: string - minLength: 1 - tradeSymbol: - type: string - minLength: 1 - credits: - type: integer - units: - type: integer -required: - - waypointSymbol - - tradeSymbol - - credits - - units -x-examples: - example-1: - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - credits: -843 - units: 1 diff --git a/models/Waypoint.json b/models/Waypoint.json index 619bd59..8a75362 100644 --- a/models/Waypoint.json +++ b/models/Waypoint.json @@ -40,7 +40,7 @@ } }, "chart": { - "$ref": "./WaypointChart.json" + "$ref": "./Chart.json" } }, "required": [ @@ -51,6 +51,7 @@ "y", "orbitals", "factions", - "traits" + "traits", + "chart" ] } \ No newline at end of file diff --git a/models/WaypointFaction.json b/models/WaypointFaction.json index 33b0b8b..1022638 100644 --- a/models/WaypointFaction.json +++ b/models/WaypointFaction.json @@ -5,5 +5,8 @@ "type": "string", "minLength": 1 } - } + }, + "required": [ + "symbol" + ] } \ No newline at end of file diff --git a/models/WaypointOrbital.json b/models/WaypointOrbital.json index 7ef5bda..2f34ed9 100644 --- a/models/WaypointOrbital.json +++ b/models/WaypointOrbital.json @@ -6,5 +6,8 @@ "type": "string", "minLength": 1 } - } + }, + "required": [ + "symbol" + ] } \ No newline at end of file diff --git a/models/WaypointTrait.json b/models/WaypointTrait.json index 5ed26e4..bf7b6d9 100644 --- a/models/WaypointTrait.json +++ b/models/WaypointTrait.json @@ -68,5 +68,10 @@ "type": "string", "description": "A description of the trait." } - } + }, + "required": [ + "symbol", + "name", + "description" + ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index f080a5f..226b61d 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -40,13 +40,13 @@ "description": "A Bearer token for accessing secured API endpoints." }, "agent": { - "$ref": "../models/Agent.yaml" + "$ref": "../models/Agent.json" }, "faction": { "$ref": "../models/Faction.json" }, "contract": { - "$ref": "../models/Contract.yaml" + "$ref": "../models/Contract.json" }, "ship": { "$ref": "../models/Ship.json" @@ -102,7 +102,7 @@ "type": "object", "properties": { "data": { - "$ref": "../models/Agent.yaml" + "$ref": "../models/Agent.json" } } }, @@ -331,7 +331,7 @@ } }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [ @@ -849,7 +849,7 @@ ], "properties": { "extraction": { - "$ref": "../models/Extraction.yaml" + "$ref": "../models/Extraction.json" }, "cooldown": { "$ref": "../models/Cooldown.json" @@ -873,23 +873,7 @@ "type": "object", "properties": { "survey": { - "$ref": "../models/Survey.yaml" - } - } - }, - "examples": { - "No Survey": { - "value": {} - }, - "With Survey": { - "value": { - "survey": { - "signature": "X1-OE-D2DD38", - "deposits": [ - "COPPER_ORE" - ], - "expiration": "2022-03-08T05:41:55.514Z" - } + "$ref": "../models/Survey.json" } } } @@ -1010,7 +994,7 @@ "surveys": { "type": "array", "items": { - "$ref": "../models/Survey.yaml" + "$ref": "../models/Survey.json" } }, "cooldown": { @@ -1022,70 +1006,6 @@ "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "cooldown": { - "duration": 899, - "expiration": "2022-03-12T02:11:35.618Z" - }, - "surveys": [ - { - "signature": "X1-OE-397C82", - "deposits": [ - "SILICON" - ], - "expiration": "2022-03-12T02:00:19.622Z" - }, - { - "signature": "X1-OE-4413F6", - "deposits": [ - "ALUMINUM_ORE", - "ALUMINUM_ORE", - "COPPER_ORE", - "IRON_ORE" - ], - "expiration": "2022-03-12T02:20:08.625Z" - }, - { - "signature": "X1-OE-E6480F", - "deposits": [ - "ALUMINUM_ORE", - "IRON_ORE", - "QUARTZ", - "SILICON" - ], - "expiration": "2022-03-12T02:18:00.626Z" - }, - { - "signature": "X1-OE-660BE9", - "deposits": [ - "ALUMINUM_ORE" - ], - "expiration": "2022-03-12T02:20:45.626Z" - }, - { - "signature": "X1-OE-D64798", - "deposits": [ - "COPPER_ORE", - "QUARTZ", - "SILICON" - ], - "expiration": "2022-03-12T02:07:33.626Z" - }, - { - "signature": "X1-OE-F799F3", - "deposits": [ - "IRON_ORE" - ], - "expiration": "2022-03-12T02:23:16.627Z" - } - ] - } - } - } } } } @@ -1128,70 +1048,26 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": { - "jump": { - "shipSymbol": "1D7FDA-1", - "destination": "00E0B1" - }, - "cooldown": { - "duration": 719, - "expiration": "2022-03-12T00:52:56.735Z" - } - } - } - }, "properties": { "data": { "type": "object", - "required": [ - "jump", - "cooldown" - ], "properties": { - "jump": { - "type": "object", - "required": [ - "shipSymbol", - "destination" - ], - "properties": { - "shipSymbol": { - "type": "string", - "minLength": 1 - }, - "destination": { - "type": "string", - "minLength": 1 - } - } + "route": { + "$ref": "../models/ShipNavRoute.json" }, "cooldown": { "$ref": "../models/Cooldown.json" } - } + }, + "required": [ + "route", + "cooldown" + ] } }, "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "jump": { - "shipSymbol": "1D7FDA-1", - "destination": "00E0B1" - }, - "cooldown": { - "duration": 719, - "expiration": "2022-03-12T00:52:56.735Z" - } - } - } - } } } } @@ -1232,6 +1108,7 @@ } ], "post": { + "description": "Purchase cargo.", "summary": "Purchase Cargo", "tags": [ "fleet" @@ -1244,36 +1121,18 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "MICROPROCESSORS", - "credits": -843, - "units": 1 - } - } - }, "properties": { "data": { - "$ref": "../models/Trade.yaml" + "properties": { + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + } } }, "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "MICROPROCESSORS", - "credits": -843, - "units": 1 - } - } - } } } } @@ -1340,24 +1199,16 @@ }, "properties": { "data": { - "$ref": "../models/Trade.yaml" + "properties": { + "transaction": { + "$ref": "../models/MarketTransaction.json" + } + } } }, "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "waypointSymbol": "X1-OE-PM", - "tradeSymbol": "SILICON", - "credits": 144, - "units": -1 - } - } - } } } } @@ -1666,7 +1517,7 @@ "uniqueItems": true, "minItems": 1, "items": { - "$ref": "../models/ScannedShip.yaml" + "$ref": "../models/ScannedShip.json" } }, "cooldown": { @@ -1684,7 +1535,7 @@ "$ref": "../models/Cooldown.json" }, "system": { - "$ref": "../models/System.yaml" + "$ref": "../models/System.json" } }, "required": [ @@ -1922,11 +1773,11 @@ "uniqueItems": true, "minItems": 1, "items": { - "$ref": "../models/Contract.yaml" + "$ref": "../models/Contract.json" } }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [ @@ -1973,36 +1824,7 @@ "type": "object", "properties": { "data": { - "$ref": "../models/Contract.yaml" - } - } - }, - "examples": { - "Success": { - "value": { - "data": { - "id": "cl0hok38t0014ks0jnoy8o5vh", - "faction": "COMMERCE_REPUBLIC", - "type": "PROCUREMENT", - "terms": { - "deadline": "2022-03-11T05:16:59.113Z", - "payment": { - "onAccepted": 20000, - "onFulfilled": 100000 - }, - "deliver": [ - { - "tradeSymbol": "IRON_ORE", - "destination": "X1-OE-PM", - "units": 10000, - "fulfilled": 0 - } - ] - }, - "accepted": false, - "fulfilled": false, - "expiresAt": "2022-03-09T05:16:59.112Z" - } + "$ref": "../models/Contract.json" } } } @@ -2044,19 +1866,9 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": { - "tradeSymbol": "IRON_ORE", - "destination": "X1-OE-PM", - "units": 10000, - "fulfilled": -30000 - } - } - }, "properties": { "data": { - "$ref": "../models/ContractDelivery.yaml" + "$ref": "../models/ContractProcurement.json" } }, "required": [ @@ -2125,7 +1937,7 @@ "type": "object", "properties": { "data": { - "$ref": "../models/Contract.yaml" + "$ref": "../models/Contract.json" } } } @@ -2167,7 +1979,7 @@ "type": "object", "properties": { "data": { - "$ref": "../models/Contract.yaml" + "$ref": "../models/Contract.json" } } } @@ -2261,49 +2073,17 @@ "uniqueItems": true, "minItems": 1, "items": { - "$ref": "../models/System.yaml" + "$ref": "../models/System.json" } }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [ "data", "meta" ] - }, - "examples": { - "Success": { - "value": { - "data": [ - { - "symbol": "X1-OE", - "sector": "X1", - "type": "RED_STAR", - "x": 0, - "y": 0, - "waypoints": [ - "X1-OE-PM", - "X1-OE-PM01", - "X1-OE-A005", - "X1-OE-25X" - ], - "factions": [ - "COMMERCE_REPUBLIC", - "MINERS_COLLECTIVE", - "SPACERS_GUILD" - ], - "charted": true - } - ], - "meta": { - "total": 0, - "page": 0, - "limit": 0 - } - } - } } } } @@ -2361,28 +2141,12 @@ }, "properties": { "data": { - "$ref": "../models/System.yaml" + "$ref": "../models/System.json" } }, "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "symbol": "X1-ZZ", - "sector": "X1", - "type": "BLUE_STAR", - "x": -2, - "y": 9, - "waypoints": [], - "factions": [], - "charted": false - } - } - } } } } @@ -2511,7 +2275,7 @@ } }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [ @@ -2571,7 +2335,7 @@ "$ref": "../models/Waypoint.json" }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [ @@ -2634,7 +2398,7 @@ } }, "meta": { - "$ref": "../models/Meta.yaml" + "$ref": "../models/Meta.json" } }, "required": [